Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

credentials in the oauth.txt file are missing or wrong #2

Open
masterchief4240 opened this issue Dec 5, 2023 · 5 comments
Open

credentials in the oauth.txt file are missing or wrong #2

masterchief4240 opened this issue Dec 5, 2023 · 5 comments

Comments

@masterchief4240
Copy link

masterchief4240 commented Dec 5, 2023

First of all thanks for creating this tool!

"The credentials in the oauth.txt file are missing or wrong. Please paste the YouTube credentials into the oauth.txt file correctly. Quitting..."

Pretty sure I did everything correct, logged in YT music.

image

image

Sorry if I redacted too much, please tell me if you need more info.

@demirdegerli
Copy link
Owner

demirdegerli commented Dec 5, 2023

I tried copying request headers on Firefox too but it didn't gave me any errors. I have no idea why is that happening.
Can you replace line 114 to 124 (inclusive) in main.py with:

user_playlists = yt.get_library_playlists(None)
for playlist in user_playlists:
    if playlist['title'] == playlist_name + " - Spotify":
        playlist_id = playlist['playlistId']
        break
if not playlist_id:
    playlist_id = yt.create_playlist(playlist_name + " - Spotify", playlist_description)

Then send the error?

@masterchief4240
Copy link
Author

Hi, I replaced the lines, I get the exact same error.

image

My folder has the following files, is this okay?

image

@demirdegerli
Copy link
Owner

I'm sorry, I misunderstood the error, can you replace the lines 13-17 with this instead:

    ytmusicapi.setup(filepath="oauth.json", headers_raw=file.read())

@aprilkenopsia
Copy link

im encountering the same error, i tried the fix above and it did not work
image

PS C:\Users\games\Documents\software\sty\spotify-to-youtube-main\spotify-to-youtube-main> python3 main.py
Traceback (most recent call last):
  File "C:\Users\games\Documents\software\sty\spotify-to-youtube-main\spotify-to-youtube-main\main.py", line 13, in <module>
    ytmusicapi.setup(filepath="oauth.json", headers_raw=file.read())
TypeError: 'module' object is not callable

@demirdegerli
Copy link
Owner

That was not the fix, just to see the more detailed error. I tested the code and it works fine. Perhaps a dependancy issue?
Try running this command:

python3 -m pip install -r requirements.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants