Giter Site home page Giter Site logo

Comments (21)

demirdegerli avatar demirdegerli commented on June 3, 2024 1

Yes, ytmusicapi doesn't use the YouTube Data API so this is likely the solution. I'll completely switch to this in ~2 days unless something goes wrong. Thank you so much for your contribution!

from spotify-to-youtube.

demirdegerli avatar demirdegerli commented on June 3, 2024 1

I fixed the crashes in this commit. You can re-run the script after a while. Songs that are added before will throw a couldn't added error, ignore it.

from spotify-to-youtube.

demirdegerli avatar demirdegerli commented on June 3, 2024 1

Ok, now it finds the playlist automatically if you re-run the script. I also found out why the project you provided doesn't hit the rate-limit. It bulk-adds songs while this one adds songs one by one. But in my testing, it doesn't work. I use every method by looking it's documentation but adding multiple playlist items at once just doesn't work.

from spotify-to-youtube.

demirdegerli avatar demirdegerli commented on June 3, 2024 1

I implemented the bulk add feature and it works!
I tried this playlist: https://open.spotify.com/playlist/5bty2AFf8hgdaULWrXnue6

Implemented features thanks to this issue:

  • Bulk adding songs
  • Auto detecting the playlist that was created before

Fixed bugs thanks to this issue:

  • Rate limit
  • Maximum of 100 songs detected in Spotify playlist

from spotify-to-youtube.

fire4rt avatar fire4rt commented on June 3, 2024 1

Can confirm, this work great now. Thank you so much for the effort!

Will test it with larger playlists (1000+ songs) this and let you know how it goes, but so far so good 👌

from spotify-to-youtube.

demirdegerli avatar demirdegerli commented on June 3, 2024 1

Yes that's right. I changed it to allow duplicates to no not cause any errors. I'll fix this because auto playlist detection is useless without it. I just need to filter out the existing YouTube playlist and add missing ones with bulk add.

from spotify-to-youtube.

demirdegerli avatar demirdegerli commented on June 3, 2024

Probably Spotify is rate limiting you or not all the items in the playlist is song.

  • Are all the items in your playlist is song? (not albums etc)
  • Can you provide the console output?
  • Can you provide the playlist URL? (make sure to make your playlist public)
  • Does this happen on other 100+ playlists?

from spotify-to-youtube.

fire4rt avatar fire4rt commented on June 3, 2024

It should not be Spotify limiting since I tried using other solutions from GitHub and they don't hit this limit, problem with them is that they are not as accurate as yours in finding the correct songs. One more thing to note is that this method of authentication with youtube is limited because of the YouTube api quota, 100 songs used 5050/10000.

image

from spotify-to-youtube.

demirdegerli avatar demirdegerli commented on June 3, 2024

Yeah, YouTube is rate limiting. I can't help with this, you have to expand your quota I think. I'll look into this to handle the error.

from spotify-to-youtube.

fire4rt avatar fire4rt commented on June 3, 2024

To avoid the quota and limitations as a whole it might be worth looking into the ytmusicapi (https://ytmusicapi.readthedocs.io/en/stable/index.html). It is unofficial, but the other projects I tried that used it did not have this issues.

from spotify-to-youtube.

demirdegerli avatar demirdegerli commented on June 3, 2024

That was a huge update. I updated the code and now it completely uses ytmusicapi. I also fixed the maximum 100 songs bug. Can you give it a try?

from spotify-to-youtube.

fire4rt avatar fire4rt commented on June 3, 2024

That was a huge update. I updated the code and now it completely uses ytmusicapi. I also fixed the maximum 100 songs bug. Can you give it a try?

Sorry for the late response. Have been away from the PC for the weekend. All songs from the playlist have been found, which is great, but for some reason after song 298 it start giving "Can't add the song with the video ID:".

The message at the end is the following, though it doesn't seem to be to be the actual cause of the problem. The ID's that are provided are the actual songs, but something is blocking them from being added. Probably youtube again :D:
Traceback (most recent call last):
"File "C:\Temp\spotify-to-youtube-main-demirdegerli\main.py", line 131, in
names_and_ids.append("{} - {} | {}".format(video_details['author'], video_details['name'], item))
~~~~~~~~~~~~~^^^^^^^^
KeyError: 'name'"

Playlist that was uses was: https://open.spotify.com/track/12CUR0UayFA7AKv6YAjokJ

Don't know if the error is correct, but this might be a similar issues like another project that I tried to use, but after 293 songs it starts getting 400 Bad Requests from YouTube, though your project did get further than that one. - rimonhanna/Spotify-To-Youtube#19 (comment)

image
image

from spotify-to-youtube.

demirdegerli avatar demirdegerli commented on June 3, 2024

KeyError is a bug caused by me, I should have checked whether video details exist YouTube gives a response to the video details request or not. Bad Request error is just YouTube rate-limiting. I can implement a workaround that adds missing videos on the second run (you have to run it after a while because the YouTube ratelimit) with little code change.

from spotify-to-youtube.

fire4rt avatar fire4rt commented on June 3, 2024

I have a question because I am a bit confused. From what I am getting you mean that after running the script on one playlist, it should remember the previously created playlist and add the ones that were missing before? Looking at the code it will still create a new playlist and start adding all songs from the start, tested it and that is what exactly happens.

Another things that might be useful is to check how exactly thing were implemented in this project. It still uses the ytmusicapi for authentication and I am not hitting any rate-limits with it. Was able to transfer the entire playlist I've provided here without issues, the problem with it is that the matching of songs is jank and every third song is the wrong one. Your script is perfect with the matching. - https://github.com/sigma67/spotify_to_ytmusic

from spotify-to-youtube.

demirdegerli avatar demirdegerli commented on June 3, 2024

Yes I forgot that 😑 I have now added the option to specify the playlist ID. But I didn't test it, hope it works 😛

from spotify-to-youtube.

demirdegerli avatar demirdegerli commented on June 3, 2024

Also I'm confused a bit, did you hit the rate-limit on this project or the other project?

from spotify-to-youtube.

fire4rt avatar fire4rt commented on June 3, 2024

I am hitting rate limits on yours and this one - rimonhanna/Spotify-To-Youtube#19 (comment)

I am not hitting rate limits on this following one, but from what I see it is made by the person that made ytmusicapi so some black magic might be happening- https://github.com/sigma67/spotify_to_ytmusic

from spotify-to-youtube.

demirdegerli avatar demirdegerli commented on June 3, 2024

I found that I can get the playlist by name and it's not necessary to get the playlist ID from the user, I'll try that.

from spotify-to-youtube.

fire4rt avatar fire4rt commented on June 3, 2024

Ok, now it finds the playlist automatically if you re-run the script. I also found out why the project you provided doesn't hit the rate-limit. It bulk-adds songs while this one adds songs one by one. But in my testing, it doesn't work. I use every method by looking it's documentation but adding multiple playlist items at once just doesn't work.

Will test it tomorrow and let you know if I find anything else. But yeah, as I said, some black magic happens in that project for it to not hit the limit :D.

from spotify-to-youtube.

fire4rt avatar fire4rt commented on June 3, 2024

Right. Small update. Managed to successfully transfer a 1640 song playlist, no errors. 👏👏👏

One small thing I've tested was the recognition if the playlist was created already but lets say failed at some point before the rerun. When you rerun it it detects the playlist, but it just adds all the songs to it, not only missing ones. Didn't notice any checks if the songs are already in the playlist in the code. I am not sure if that is intended or not. It is not that big of a problem since you can just delete it and create it from scratch now with no issues.

from spotify-to-youtube.

demirdegerli avatar demirdegerli commented on June 3, 2024

Fixed: 5c97cc0a982ec20c152aa23a06f423047b0f1874

from spotify-to-youtube.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.