linsomniac / spotify_to_ytmusic

Copy playlists and liked music from Spotify to YTMusic
Creative Commons Zero v1.0 Universal
2.14k stars 136 forks source link

can't login in the gui, file "oauth.json" not detected #60

Open YDBoss12 opened 7 months ago

YDBoss12 commented 7 months ago

image

Jyzeff commented 7 months ago

same

linsomniac commented 7 months ago

This error is caused by the system not being able to run the program "ytmusicapi oauth". Perhaps ytmusicapi is not correctly installed?

Jyzeff commented 7 months ago

This error is caused by the system not being able to run the program "ytmusicapi oauth". Perhaps ytmusicapi is not correctly installed?

image it is i guess

linsomniac commented 7 months ago

Try exiting your terminal and restarting, perhaps it didn't pick up the path to ytmusicapi? Since OP is running the gui with "python -m", it might be worth trying "python -m pip install ytmusicapi" as well, to make sure it isn't another python environment that has ytmusicapi installed. You can also try running "python -c 'import ytmusicapi'" to make sure that Python is able to import the module. Ultimately, what you need to do is be able to run "ytmusicapi oauth", which I'm assuming is failing, but please check that.

If "ytmusicapi oauth" succeeds, you should then be able to run the GUI because it will detect the oauth.json file exists and will skip running the part of the code that is failing above.

I've also put in some error handling for this exception above, so that it prints a nicer message about the failure.

Jyzeff commented 7 months ago

I solved it for myself. After typing "ytmusicapi oauth", I finish logging into my ytmusic account. Then I press enter and wait 1-2 minutes. The oauth.json file is created and problem solved. The reason why it gave me an error was because I did ctrl-c without waiting 1-2 minutes after pressing enter. There is no needed for ctrl-c.

linsomniac commented 7 months ago

Glad you were able to get past that issue, thanks for the report.