-
Notifications
You must be signed in to change notification settings - Fork 0
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
Error when running scan command ytmusic-sync.py #1
Comments
Ah, my program does not use the oath method as it incorporates uploads. It expects the headers copied from the browser. Try those instructions and let me know if that works. |
Hi, thank you for the swift reply. I tried pasting the headers directly from the browser inspector. And there seems to be progress. I'm still getting an error though.
To resolve this, I tried running the command prompt as administrator, but to no avail. |
Do me a favor and create the directory "YT Music Sync" inside the AppData\Local folder, and then try it again. It is supposed to be able to create the file if it does not exist, but I don't remember if I had already created the folder beforehand. |
A lot better.
Now I need to figure out what's wrong with the directory. And thanks a lot for this tool! |
It should print something for every file. I would need the full output of a run to find out why it is not uploading or adding songs to the library. The most likely is it is printing song not found. As for the invalid directory I believe you forgot to put quotes around a path with spaces in it. |
I made some progres, but songs are not getting added to YTM. I had to modify the script, as I couldn't figure out how to pass the folder to scan when running debugger.
This is the output.
When debugging the track variable in the function Processfile:
|
I was afraid of something like that. It sounds like mutagen has changed the format of their return object. It will take me a while to debug this and update my code. As for passing the directory, you can use something like |
Quick stupid question: Your files have all the correct tag information in them right? Also, what types of files are they, and are they using the tag format for their file type? In other words not suing ID3 tags for m4a files. |
It turns out that I was assuming Mutagen would handle mutliple tag formats for me. It does not. I have updated the code to use a library that does support multiple tag formats easily. This should fix the blank tags problem you are having. |
You're fast :-) |
I'm getting YTM authentication error. I tried with both Chrome and Firefox.
I run the command :
ytmusic-sync.py -d C:\Users\my-music-folder
When prompted, I paste the result from the oauth.json (I replaced the actual tokens with dashes)
{ "scope": "https://www.googleapis.com/auth/youtube", "token_type": "Bearer", "access_token": "---", "refresh_token": "---", "expires_at": 1731237783, "expires_in": 70895 }
I then get this error:
Traceback (most recent call last): File "C:\Users\dries\Documents\Python projects\ytmusic-sync-master\ytmusic-sync.py", line 455, in <module> authenticate() ~~~~~~~~~~~~^^ File "C:\Users\dries\Documents\Python projects\ytmusic-sync-master\ytmusic-sync.py", line 212, in authenticate ytmusicapi.setup(filepath=str(authFile)) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\dries\AppData\Local\Programs\Python\Python313\Lib\site-packages\ytmusicapi\setup.py", line 22, in setup return setup_browser(filepath, headers_raw) File "C:\Users\dries\AppData\Local\Programs\Python\Python313\Lib\site-packages\ytmusicapi\auth\browser.py", line 51, in setup_browser raise YTMusicUserError( ...<3 lines>... ) ytmusicapi.exceptions.YTMusicUserError: The following entries are missing in your headers: cookie, x-goog-authuser. Please try a different request (such as /browse) and make sure you are logged in.
I am logged in.
I added the cookie header manually and tried again.
However, I do nog see an
x-goog-authuser
in the request header.I also get this warning:
Any suggestions, please.
The text was updated successfully, but these errors were encountered: