sigma67 / spotify_to_ytmusic

Clone a Spotify playlist to YouTube Music
MIT License
791 stars 65 forks source link

Program says playlist created succesfully but it doesn't show up on the account #5

Closed yesn314 closed 3 years ago

yesn314 commented 3 years ago

Exactly what the title said. I did setup all correctly and when I refresh my account there is no new playlist.

sigma67 commented 3 years ago

Google Play Music or YouTube Music? YouTube Music should give you a link in the console. It's normal if it takes a bit to show up in your library.

yesn314 commented 3 years ago

How do you even select Youtube Music? I don't get a link or anything. It doesn't show up in either Google Play Music or Youtube Music.

sigma67 commented 3 years ago

You just use YouTube.py instead. For Google Play Music it should work fine, although I've had some issues last week as well. I just tried again and it worked. Might be related to the service being phased out?

yesn314 commented 3 years ago

First of all thanks for the quick response man! I just did the setup all over again to make sure I didn't do anything weird. I use the mobile client and when I use Youtube.py it gives me this:

Failed loading provided credentials. Make sure to provide a string or a file path. Reason: Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "Youtube.py", line 185, in main() File "Youtube.py", line 132, in main ytmusic = YTMusicTransfer() File "Youtube.py", line 15, in init self.api = YTMusic(settings['youtube']['headers']) File "C:\Users\Y\anaconda3\envs\downloading\lib\site-packages\ytmusicapi\ytmusic.py", line 96, in init self.sapisid = sapisid_from_cookie(self.headers['Cookie']) AttributeError: 'YTMusic' object has no attribute 'headers'

Furthermore the spotify link to a playlist is slightly different for me. It's now in the format: https://open.spotify.com/playlist/. Is this a problem?

sigma67 commented 3 years ago

The link is fine. Did you run the Youtube setup too? You should have

[youtube]
headers = (long JSON string)

in your settings.ini.

yesn314 commented 3 years ago

Okay that clarifies a lot. I currently have: [youtube] headers = headers_json_from_browser

So how do I run the Youtube setup?

sigma67 commented 3 years ago

Just run python3 Setup.py youtube. Then you need to find a request in your browser where you can copy your request headers, as explained here: https://ytmusicapi.readthedocs.io/en/latest/setup.html#authenticated-requests

yesn314 commented 3 years ago

Ok that was very useful. I didn't spot that before. I read the setup and guide multiple times and it wasn't there. Anyway it now gives the link, but the link doesn't work. It says: (something has gone wrong). Here is the link in case you're curious: https://music.youtube.com/playlist?list=PLhqnedN22Vhw8kLXLYF2lZOU4rVTYNiCf

sigma67 commented 3 years ago

Huh, that is strange. What playlist are you trying to convert? I can try for you to check it works. Else it's hard to tell what might be the cause.

yesn314 commented 3 years ago

https://open.spotify.com/playlist/0C6fLU4LJdh9zNPbys80gi?si=q-P3A5TgRTWgXxT7deLNhA

Relatively small playlist without errors

yesn314 commented 3 years ago

Okay good news. The one I made earlier is now showing up. I guess it just takes a really long time. But it's flawless! Thank you so much for making this tool. I don't know why the guys from spotdl aren't using this. I know I will for sure. Now I am gonna write some code to apply metadata and apply covers.

sigma67 commented 3 years ago

Glad you found it useful and got it working!

I don't know why the guys from spotdl aren't using this

Feel free to let them know about it :)

yesn314 commented 3 years ago

Just did :) You don't know how happy I am to finally have some more accurate results. For example for a 300 song playlist it only gets 30 not founds. With spotdl it was the other way around, it only found 30 accurately. If you have very popular music spotdl will work 90% of the time, but not for me. Again thanks!