Skip to content
This repository was archived by the owner on Sep 25, 2024. It is now read-only.

Account For Various Scenarios Spotify May Throw | Resubmission #7

Conversation

Kyrluckechuck
Copy link
Contributor

Description

This PR accounts for a few scenarios that I encountered Spotify throwing while dealing with a playlist of > 2000 songs:

  • The song added to the playlist may not be available to you, which can happen for a variety of reasons but the two most common being that your region was not included in the copyright license, or the song was "removed" from Spotify altogether
  • The seektable request may refuse with a 403 response while using your authorized session, and falling back on a "generic" session appears to always resolve it
    • Discovered this one by simply visiting the URL in question and then re-running the download and it immediately working. It appears to be some sort of rate-limit that a generic request clears.
  • Rate limit the decryption key requests for songs when the license is not correctly returned, this appears to typically mean you've been throttled
    • I found that waiting about a minute was enough in most circumstances, but if you want to avoid the client frequently hitting the limit, adding that 1 second delay between attempts appears to be enough to stop it from needing the ~60s delay
    • This attempts a few times, with 1 second delay first, then 60, 120, 180, 240, and then finally letting it continue (at which point it will raise a different error further down)
      • This never had more than a 1 second delay for me, so the > 60 options should not be encountered if the 1 second delay is kept (when running it on the remaining ~1300 songs in the playlist)
  • Some songs have different copyright classes (specifically songs from artists that are typically "unlicensed")
    • I don't know if it made sense to include that copyright information instead, but could not locate a reason for a P license vs a T license (one of the example songs I had returned that type), so I went the route of simply "ignoring it" and just marking the text as ''

** After the last PR was closed by upstream code changes and wasn't explicitly closed as invalid, I figured I should rebase and then re-open it. If there are any issues here, I'm happy to address them, or I can just keep my fork with the various improvements I've made elsewhere if you'd prefer not to!

Notes

This took a couple creative liberties based on me not specifically caring about certain things in how it was parsed and just wanted it to work, so I'm open to suggestions here 😄
(such as updating the max line length to be a "normal" value these days)

@NeonLightning
Copy link

any chance of updating this pr to the latest version?

@Kyrluckechuck Kyrluckechuck force-pushed the various-bug-fixes-and-catches branch from 07410f9 to 574843b Compare January 5, 2024 22:18
@Kyrluckechuck
Copy link
Contributor Author

Kyrluckechuck commented Jan 5, 2024

any chance of updating this pr to the latest version?

@NeonLightning I don't believe the repo author intends to merge this PR since it's been left for so long, but I went and updated it based on the latest upstream main here -- a few of the tweaks I improved were no longer necessary since a few things were improved in the base PR, but the rest of the tweaks were re-added!

I only did some quick tests using a couple of albums and playlists I had not downloaded, but all seemed to work as expected. Let me know if you have any issues!

@glomatico
Copy link
Owner

😰

@Kyrluckechuck
Copy link
Contributor Author

😰

@glomatico if you are interested in merging these changes (or have any feedback about them) I'm happy to rebase this on your latest changes again! 🙂

@glomatico
Copy link
Owner

glomatico commented Feb 9, 2024

😰

@glomatico if you are interested in merging these changes (or have any feedback about them) I'm happy to rebase this on your latest changes again! 🙂

Well, sorry for ignoring your pull request for so long. I think I'm up only for the Additional Copyright Handling to be pushed for now.

@Kyrluckechuck
Copy link
Contributor Author

No worries at all! That's completely fair -- I'm actually going to opt to close this out (though feel free to copy in any changes if you like them), since I've decided to kinda completely fork this via https://github.com/Kyrluckechuck/spotify-library-manager! 😄

@Kyrluckechuck Kyrluckechuck deleted the various-bug-fixes-and-catches branch March 10, 2024 17:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants