spotify_to_ytmusic icon indicating copy to clipboard operation
spotify_to_ytmusic copied to clipboard

Cache conversions

Open mrmbernardi opened this issue 3 years ago • 5 comments

I'm trying to transfer a playlist of 1792 songs from spotify to youtube. On my first attempt I got 920/1792 converted before encountering this error:

Could not transfer playlist 1792. ExceptionHTTPSConnectionPool(host='music.youtube.com', port=443): Read timed out. (read timeout=30)

I go to retry the command and this time I get to 460 songs before I get a similar read timeout error.

If the program would cache the conversions it's already made, I would be able to keep running this command until it converts all the songs and completes successfully, but without this it's up to chance as it starts from the beginning every time.

mrmbernardi avatar Sep 03 '22 17:09 mrmbernardi

If you want, in my spare time, I can try to implement it. It shouldn't be too difficult

guglielmobartelloni avatar Sep 04 '22 12:09 guglielmobartelloni

I got my playlist converted successfully, but it would definitely help future users with the same issue if you implemented it.

As an aside, I'm not sure why I was getting the read time outs. I have a solid connection, I'm thinking it may have been load shedding on youtube's end?

mrmbernardi avatar Sep 06 '22 22:09 mrmbernardi

It's a good idea, but it would require some sort of local database mapping search strings to videoIds. The simplest option would be some sort of text file, ideally not requiring new dependencies. I think caching should be made optional through an opt-in parameter --cache, as search results can and do change over time.

sigma67 avatar Sep 16 '22 14:09 sigma67

@guglielmobartelloni are you still interested in implementing this? Feel free to make suggestions for an implementation

sigma67 avatar Dec 12 '22 14:12 sigma67

Feel free to check out the first draft here: https://github.com/sigma67/spotify_to_ytmusic/tree/39-cache-conversions

I think we will need a CLI to interact with the cache as well:

  • option to ignore cache
  • reset cache
  • remove all entries matching a provided string from cache

sigma67 avatar Apr 20 '23 19:04 sigma67