[GH-ISSUE #2] 403 Errors #1

Closed
opened 2026-02-27 20:07:38 +03:00 by kerem · 10 comments
Owner

Originally created by @tomballgithub on GitHub (Mar 21, 2025).
Original GitHub issue: https://github.com/misiektoja/spotify_profile_monitor/issues/2

I am getting a lot of these 403 errors. I've looked back in my log, and they didn't start until 3/18 when I updated to the latest TOTP code fixes and other changes. Any ideas?

-----------------------------------------------------------------------------------------------------------------
* Fetching a new Spotify access token, it might take a while ...
* Token is valid
Timestamp:			Tue, 18 Mar 2025, 23:39:39
-----------------------------------------------------------------------------------------------------------------
Error, retrying in 3 minutes - 403 Client Error: Forbidden for url: https://spclient.wg.spotify.com/user-profile-view/v3/profile/readacted.username?playlist_limit=50&artist_limit=50&episode_limit=10&market=from_token
Timestamp:		Tue, 18 Mar 2025, 23:39:39

........

-----------------------------------------------------------------------------------------------------------------
* Fetching a new Spotify access token, it might take a while ...
* Token is valid
Timestamp:			Fri, 21 Mar 2025, 14:50:23
-----------------------------------------------------------------------------------------------------------------
Error, retrying in 3 minutes - 403 Client Error: Forbidden for url: https://spclient.wg.spotify.com/user-profile-view/v3/profile/redacted.username?playlist_limit=50&artist_limit=50&episode_limit=10&market=from_token
Timestamp:		Fri, 21 Mar 2025, 14:50:23
-----------------------------------------------------------------------------------------------------------------
Originally created by @tomballgithub on GitHub (Mar 21, 2025). Original GitHub issue: https://github.com/misiektoja/spotify_profile_monitor/issues/2 I am getting a lot of these 403 errors. I've looked back in my log, and they didn't start until 3/18 when I updated to the latest TOTP code fixes and other changes. Any ideas? ``` ----------------------------------------------------------------------------------------------------------------- * Fetching a new Spotify access token, it might take a while ... * Token is valid Timestamp: Tue, 18 Mar 2025, 23:39:39 ----------------------------------------------------------------------------------------------------------------- Error, retrying in 3 minutes - 403 Client Error: Forbidden for url: https://spclient.wg.spotify.com/user-profile-view/v3/profile/readacted.username?playlist_limit=50&artist_limit=50&episode_limit=10&market=from_token Timestamp: Tue, 18 Mar 2025, 23:39:39 ........ ----------------------------------------------------------------------------------------------------------------- * Fetching a new Spotify access token, it might take a while ... * Token is valid Timestamp: Fri, 21 Mar 2025, 14:50:23 ----------------------------------------------------------------------------------------------------------------- Error, retrying in 3 minutes - 403 Client Error: Forbidden for url: https://spclient.wg.spotify.com/user-profile-view/v3/profile/redacted.username?playlist_limit=50&artist_limit=50&episode_limit=10&market=from_token Timestamp: Fri, 21 Mar 2025, 14:50:23 ----------------------------------------------------------------------------------------------------------------- ```
kerem closed this issue 2026-02-27 20:07:38 +03:00
Author
Owner

@tomballgithub commented on GitHub (Mar 21, 2025):

The only other noteworthy thing is I am getting occasional 404 errors due to what I believe is an inaccessible playlist. It gets flagged when I first start up the monitor and then these are very consistent

-----------------------------------------------------------------------------------------------------------------
Error while processing playlist with URI spotify:playlist:redacted, skipping for now - 404 Client Error: Not Found for url: https://spclient.wg.spotify.com/user-profile-view/v3/profile/?playlist_limit=0&artist_limit=50&episode_limit=10&market=from_token
Timestamp:              Fri, 21 Mar 2025, 13:49:48
-----------------------------------------------------------------------------------------------------------------

<!-- gh-comment-id:2744384075 --> @tomballgithub commented on GitHub (Mar 21, 2025): The only other noteworthy thing is I am getting occasional 404 errors due to what I believe is an inaccessible playlist. It gets flagged when I first start up the monitor and then these are very consistent ``` ----------------------------------------------------------------------------------------------------------------- Error while processing playlist with URI spotify:playlist:redacted, skipping for now - 404 Client Error: Not Found for url: https://spclient.wg.spotify.com/user-profile-view/v3/profile/?playlist_limit=0&artist_limit=50&episode_limit=10&market=from_token Timestamp: Fri, 21 Mar 2025, 13:49:48 ----------------------------------------------------------------------------------------------------------------- ```
Author
Owner

@misiektoja commented on GitHub (Mar 21, 2025):

Please use the latest released version - it contains many fixes related to this logic.

I have been running it for a few days on my test account without any issues so far.

As for the second one - is the playlist issue visible on the user profile? Can you normally access it in your web browser? Typically, a 404 error occurs when a user removes the playlist or switches it to private.

<!-- gh-comment-id:2744387281 --> @misiektoja commented on GitHub (Mar 21, 2025): Please use the latest released version - it contains many fixes related to this logic. I have been running it for a few days on my test account without any issues so far. As for the second one - is the playlist issue visible on the user profile? Can you normally access it in your web browser? Typically, a 404 error occurs when a user removes the playlist or switches it to private.
Author
Owner

@tomballgithub commented on GitHub (Mar 21, 2025):

I will try the latest version.

The monitor and the spotify web version say this profile has 26 public playlists. The web version shows 26 and the profile tool lists 25 + 1 error. The 1 error is this popular playlist which is actually NOT managed by this profile, but it's showing up on this profile's public playlist page in the web. This is the playlist: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx

<!-- gh-comment-id:2744498285 --> @tomballgithub commented on GitHub (Mar 21, 2025): I will try the latest version. The monitor and the spotify web version say this profile has 26 public playlists. The web version shows 26 and the profile tool lists 25 + 1 error. The 1 error is this popular playlist which is actually NOT managed by this profile, but it's showing up on this profile's public playlist page in the web. This is the playlist: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx
Author
Owner

@misiektoja commented on GitHub (Mar 21, 2025):

Wow, I think you found some interesting corner case! I guess you use the -k parameter to grab all the playlists, right ?

I added it to my test account profile and encountered the same issue. It appears to be a special type of playlist. It belongs to Spotify and is dynamically generated for each user and for some reason it is not available via regular API endpoint (thus 404 error).

I need to review Spotify's documentation to understand how to manage it, maybe there is another endpoint for this, but anyway I'm confident I can address it in the code somehow. I believe we should simply skip those, as it is of little interest to us what Spotify adds/removes there. I'll get back to you on this.

By default, only public playlists owned by the user are fetched and as a workaround I suggest to disable fetching all of them (remove -k / --get_all_playlists parameter).

<!-- gh-comment-id:2744518865 --> @misiektoja commented on GitHub (Mar 21, 2025): Wow, I think you found some interesting corner case! I guess you use the -k parameter to grab all the playlists, right ? I added it to my test account profile and encountered the same issue. It appears to be a special type of playlist. It belongs to Spotify and is dynamically generated for each user and for some reason it is not available via regular API endpoint (thus 404 error). I need to review Spotify's documentation to understand how to manage it, maybe there is another endpoint for this, but anyway I'm confident I can address it in the code somehow. I believe we should simply skip those, as it is of little interest to us what Spotify adds/removes there. I'll get back to you on this. By default, only public playlists owned by the user are fetched and as a workaround I suggest to disable fetching all of them (remove -k / --get_all_playlists parameter).
Author
Owner

@tomballgithub commented on GitHub (Mar 21, 2025):

Yes, without -k I am seeing 12 playlists dropped off and not monitored. I was just going to hack the code to remove that one but never got around to it.

<!-- gh-comment-id:2744528813 --> @tomballgithub commented on GitHub (Mar 21, 2025): Yes, without -k I am seeing 12 playlists dropped off and not monitored. I was just going to hack the code to remove that one but never got around to it.
Author
Owner

@misiektoja commented on GitHub (Mar 21, 2025):

Ok, it was easier to fix than I thought. The issue stems from this:

Image

All the tracks in Spotify-generated playlists have an empty ID and a user URI ID for the user who added the track (added_by) and the code assumed something was wrong with the playlist and thus displayed the error message you saw.

I fixed it and the tool can now properly detect tracks added by the Spotify robot ;-) I pushed it into dev and main branches, so let me know if all is good now.

<!-- gh-comment-id:2744634280 --> @misiektoja commented on GitHub (Mar 21, 2025): Ok, it was easier to fix than I thought. The issue stems from this: <img width="437" alt="Image" src="https://github.com/user-attachments/assets/e8a93fe3-67f9-477f-9b29-dd27e52a2c42" /> All the tracks in Spotify-generated playlists have an empty ID and a user URI ID for the user who added the track (added_by) and the code assumed something was wrong with the playlist and thus displayed the error message you saw. I fixed it and the tool can now properly detect tracks added by the Spotify robot ;-) I pushed it into dev and main branches, so let me know if all is good now.
Author
Owner

@tomballgithub commented on GitHub (Mar 22, 2025):

Running this now, and it fixed the 404 errors. However, will it be monitoring for changes in this spotify playlist that is not controlled by this profile? Depending on the playlist, as some of these get refreshed constantly, that could generate lots of changes. If it will get detected, it would be nice to have a flag to ignore those types of playlists completely.

- 'Afternoon Acoustic'
[ https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1 ]
[ songs: 100, likes: 2164601, collaborators: 1 ]
[ owner: Spotify ]
[ date: Fri 23 Aug 2024, 10:05:15 - 6 months, 3 weeks, 5 days ago ]
[ update: Fri 23 Aug 2024, 10:05:15 - 6 months, 3 weeks, 5 days ago ]
'Unwind and let the afternoon unfold.'
<!-- gh-comment-id:2745299547 --> @tomballgithub commented on GitHub (Mar 22, 2025): Running this now, and it fixed the 404 errors. However, will it be monitoring for changes in this spotify playlist that is not controlled by this profile? Depending on the playlist, as some of these get refreshed constantly, that could generate lots of changes. If it will get detected, it would be nice to have a flag to ignore those types of playlists completely. ``` - 'Afternoon Acoustic' [ https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1 ] [ songs: 100, likes: 2164601, collaborators: 1 ] [ owner: Spotify ] [ date: Fri 23 Aug 2024, 10:05:15 - 6 months, 3 weeks, 5 days ago ] [ update: Fri 23 Aug 2024, 10:05:15 - 6 months, 3 weeks, 5 days ago ] 'Unwind and let the afternoon unfold.' ```
Author
Owner

@tomballgithub commented on GitHub (Mar 22, 2025):

I didn't expect to really see this so quickly, but there really needs to be a way to filter the public playlists. This happened in just a few hours

-----------------------------------------------------------------------------------------------------------------
* Playlist 'Afternoon Acoustic': number of likes changed from 2164601 to 2164600 (-1)
* Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1

Check interval:         30 minutes (Sat 22 Mar 09:28 - 09:58)
Timestamp:              Sat, 22 Mar 2025, 09:58:38
-----------------------------------------------------------------------------------------------------------------
* Playlist 'Afternoon Acoustic': number of likes changed from 2164600 to 2164598 (-2)
* Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1

Check interval:         30 minutes (Sat 22 Mar 10:29 - 10:59)
Timestamp:              Sat, 22 Mar 2025, 10:59:32
-----------------------------------------------------------------------------------------------------------------
* Playlist 'Afternoon Acoustic': number of likes changed from 2164598 to 2164597 (-1)
* Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1

Check interval:         30 minutes (Sat 22 Mar 11:30 - 12:00)
Timestamp:              Sat, 22 Mar 2025, 12:00:27
-----------------------------------------------------------------------------------------------------------------
* Playlist 'Afternoon Acoustic': number of likes changed from 2164597 to 2164596 (-1)
* Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1

Check interval:         30 minutes (Sat 22 Mar 13:01 - 13:31)
Timestamp:              Sat, 22 Mar 2025, 13:31:53
-----------------------------------------------------------------------------------------------------------------
* Playlist 'Afternoon Acoustic': number of likes changed from 2164596 to 2164597 (+1)
* Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1

Check interval:         30 minutes (Sat 22 Mar 14:02 - 14:32)
Timestamp:              Sat, 22 Mar 2025, 14:32:48
-----------------------------------------------------------------------------------------------------------------
* Playlist 'Afternoon Acoustic': number of likes changed from 2164597 to 2164594 (-3)
* Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1

Check interval:         30 minutes (Sat 22 Mar 14:33 - 15:03)
Timestamp:              Sat, 22 Mar 2025, 15:03:16
-----------------------------------------------------------------------------------------------------------------
* Playlist 'Afternoon Acoustic': number of likes changed from 2164594 to 2164595 (+1)
* Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1

Check interval:         30 minutes (Sat 22 Mar 15:03 - 15:33)
Timestamp:              Sat, 22 Mar 2025, 15:33:43
-----------------------------------------------------------------------------------------------------------------
Alive check, timestamp: Sat, 22 Mar 2025, 15:33:43
-----------------------------------------------------------------------------------------------------------------
* Playlist 'Afternoon Acoustic': number of likes changed from 2164595 to 2164596 (+1)
* Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1

Check interval:         30 minutes (Sat 22 Mar 15:34 - 16:04)
Timestamp:              Sat, 22 Mar 2025, 16:04:10
-----------------------------------------------------------------------------------------------------------------

<!-- gh-comment-id:2745733385 --> @tomballgithub commented on GitHub (Mar 22, 2025): I didn't expect to really see this so quickly, but there really needs to be a way to filter the public playlists. This happened in just a few hours ``` ----------------------------------------------------------------------------------------------------------------- * Playlist 'Afternoon Acoustic': number of likes changed from 2164601 to 2164600 (-1) * Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1 Check interval: 30 minutes (Sat 22 Mar 09:28 - 09:58) Timestamp: Sat, 22 Mar 2025, 09:58:38 ----------------------------------------------------------------------------------------------------------------- * Playlist 'Afternoon Acoustic': number of likes changed from 2164600 to 2164598 (-2) * Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1 Check interval: 30 minutes (Sat 22 Mar 10:29 - 10:59) Timestamp: Sat, 22 Mar 2025, 10:59:32 ----------------------------------------------------------------------------------------------------------------- * Playlist 'Afternoon Acoustic': number of likes changed from 2164598 to 2164597 (-1) * Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1 Check interval: 30 minutes (Sat 22 Mar 11:30 - 12:00) Timestamp: Sat, 22 Mar 2025, 12:00:27 ----------------------------------------------------------------------------------------------------------------- * Playlist 'Afternoon Acoustic': number of likes changed from 2164597 to 2164596 (-1) * Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1 Check interval: 30 minutes (Sat 22 Mar 13:01 - 13:31) Timestamp: Sat, 22 Mar 2025, 13:31:53 ----------------------------------------------------------------------------------------------------------------- * Playlist 'Afternoon Acoustic': number of likes changed from 2164596 to 2164597 (+1) * Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1 Check interval: 30 minutes (Sat 22 Mar 14:02 - 14:32) Timestamp: Sat, 22 Mar 2025, 14:32:48 ----------------------------------------------------------------------------------------------------------------- * Playlist 'Afternoon Acoustic': number of likes changed from 2164597 to 2164594 (-3) * Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1 Check interval: 30 minutes (Sat 22 Mar 14:33 - 15:03) Timestamp: Sat, 22 Mar 2025, 15:03:16 ----------------------------------------------------------------------------------------------------------------- * Playlist 'Afternoon Acoustic': number of likes changed from 2164594 to 2164595 (+1) * Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1 Check interval: 30 minutes (Sat 22 Mar 15:03 - 15:33) Timestamp: Sat, 22 Mar 2025, 15:33:43 ----------------------------------------------------------------------------------------------------------------- Alive check, timestamp: Sat, 22 Mar 2025, 15:33:43 ----------------------------------------------------------------------------------------------------------------- * Playlist 'Afternoon Acoustic': number of likes changed from 2164595 to 2164596 (+1) * Playlist URL: https://open.spotify.com/playlist/37i9dQZF1DX4E3UdUs7fUx?si=1 Check interval: 30 minutes (Sat 22 Mar 15:34 - 16:04) Timestamp: Sat, 22 Mar 2025, 16:04:10 ----------------------------------------------------------------------------------------------------------------- ```
Author
Owner

@misiektoja commented on GitHub (Mar 24, 2025):

I fully agree! Let me come up with a nice filtering solution for that. I'll keep you posted!

<!-- gh-comment-id:2746643982 --> @misiektoja commented on GitHub (Mar 24, 2025): I fully agree! Let me come up with a nice filtering solution for that. I'll keep you posted!
Author
Owner

@misiektoja commented on GitHub (Mar 24, 2025):

I'm closing this one as the 40x errors seem to be fixed. As for the filtering solution, check out the response here.

<!-- gh-comment-id:2746746874 --> @misiektoja commented on GitHub (Mar 24, 2025): I'm closing this one as the 40x errors seem to be fixed. As for the filtering solution, check out the response [here](https://github.com/misiektoja/spotify_profile_monitor/issues/3).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify_profile_monitor#1
No description provided.