-
Notifications
You must be signed in to change notification settings - Fork 190
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: Unable to look up song on YTMusic: Server returned HTTP 400: Bad Request. Request contains an invalid argument. #125
Comments
I am also facing this problem, if anybody has a solution it would help a lot. Thanks |
Having the same issue as well and cannot for the life of me figure out the fix, i just wanna send my spotify over so i can reduce my subscriptions 😭 |
This is likely related to an issue in a library that has an open ticket and recent responses by a dev: sigma67/ytmusicapi#676 |
Getting the same issue but with a twist: context:
All commands work fine (listing, importing, etc) when used with my google account, but I get the error (400) when I run the commands via my wife and kids accounts. |
Same issue here. I tried using my master account for YouTube Premium family like @jjrossi mentioned and everything worked. Not a solution to the original problem though |
Same problem. "ERROR: Unable to look up song on YTMusic: Server returned HTTP 400: Bad Request. |
Same issue here, using command line on linux (windows subsystem for linux, ubuntu). Downloading all the information from spotify works fine, but any request to yt fails with the HTTP 400: Bad Request error. |
I have a solution. Search up Tune My Music on google then click "let's start". Proceed with the steps to move your spotify playlist to youtube music. The limit for each transfer is 500 songs, after in which Tune My Music will then ask for a subscription. To bypass this just close the tab and open a new one to repeat the whole process again. |
The issue is with google no longer supporting oauth authentication.
Following these 5 steps you should be able to use this tool as before. P.S. If you're confused about step 3, here's what you should copy (until the end of 'Request Headers') & how you should (at the very top of the image) filter to find the request: |
"this line" is line 28 in backend.py
|
update nvm i found it for anyone wanting the path for where to find backend.py this is where i found mine |
Hi I seem to be having this same issue and I am attempting this solution, but my ytmusicapi browser command does not appear to work. This is what I am getting, forgive me if I am doing some terribly basic error:
I also don't see a browse?ctoken= network request, only a prettyprint one (the first one in the image) |
The latest pull request on this has the details. You need to change 4 .py files in the package. Details in files here: #132 Dont forget first to do the stuff here to build the browser.json file: #125 (comment) |
I had same issue on Windows. Try using venv.
Then continue using @ohadklein11 instructions |
I've updated my files to what was in the pull request, but I still can't seem to get to the point where I can build the browser. still running into the problem where it won't let me run ytmusicapi browser. I'm using windows powershell and my PATH is set up to include the python scripts
|
I just straight used cmd, I see ur in Powershell, dunno if mkes a difference, worth a try |
Yes use command prompt instead of powershell:
|
This comment was marked as resolved.
This comment was marked as resolved.
awesome, I have it working now so far, thanks everybody for the help!
I used the pretty print one and it worked |
Hello everybody. I'm trying to paste all the Request Headers into macOS terminal, but it seems it has a paste limit and will not paste all the headers. Can somebody please tell me how have you managed to paste all the Request Headers into Terminal? Than you in advance and wish you all a great day. |
After you copy the request headers, run |
Thank you! This worked like a charm!
…On Fri, Nov 22, 2024, 18:13 Samuel Lo ***@***.***> wrote:
Hello everybody. I'm trying to paste all the Request Headers into macOS
terminal, but it seems it has a paste limit and will not paste all the
headers. Can somebody please tell me how have you managed to paste all the
Request Headers into Terminal? Than you in advance and wish you all a great
day.
After you copy the request headers, run pbpaste | ytmusicapi browser
instead
—
Reply to this email directly, view it on GitHub
<#125 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BIZS6KHP7VHZGAJ3CPXSZX32B5J37AVCNFSM6AAAAABRHZ5OBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJUGEZDIOJUGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I tried the print one and it did not work :( - any ideas??? - no ctoken is generating on youtube music |
It should be mentioned that the request headers expire after 10 minutes so while copying once you see the 401 Request Unauthorized error, you have to reload the headers in a browser and get new ones. You will also need to remove all songs in the playlist.json file that are already done to avoid the headers timing out at the same spot again. In playlist.json, each song is a list object, the first key of a song object called "added_at". |
how can i remove songs in playlist.json? |
Easier to remove them in Spotify before your build the playlist.json, or
after they get there. Certainly be quicker
…On Tue, 26 Nov 2024, 15:55 Kingslayer129, ***@***.***> wrote:
4. In terminal, run 'ytmusicapi browser', paste the headers you've
just copied, press Enter, press ctrl+D. A new file 'browser.json' should be
created in your current dir.
It should be mentioned that the request headers expire after 10 minutes so
while copying once you see the 401 Request Unauthorized error, you have to
reload the headers in a browser and get new ones. You will also need to
remove all songs in the playlist.json file that are already done to avoid
the headers timing out at the same spot again.
In playlist.json, each song is a list object, the first key of a song
object called "added_at".
how can i remove songs in playlist.json?
—
Reply to this email directly, view it on GitHub
<#125 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALUQJ6TDZ2D5VCZCYFPHFB32CSKYJAVCNFSM6AAAAABRHZ5OBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBRGIZTIMRXGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
also instead of editing the source code you can just rename browser.json to oauth.json |
hey all, this is pretty confusing for me. when trying the workaround, all i get is and no entry with the token. am i doing something wrong? thanks |
Copy the request headers under that it worked for me. I also didn't get entry with token |
Is there a way to bypass request headers expiring every 10min ? |
if you have hard time in doing this 5th step, I am not sure why this is not recommended, |
It's not ideal, but what I ended up doing was adding |
@udaya28 Your suggestion is a good workaround. I just wanted to be more careful (since you cannot know what other code logics might rely on the existence of the |
You say you can just close the tab and re-open the tab and continue, but I find it's still trying to force a subscription to continue? |
I did it little bit differently. I edited method responsible for iteration such as it skips all tracks till track defined by me is not found. for to
for this case my last liked track was "Epitaph". You need to change it for your last liked track |
When I go to the “Load liked song” step and press the “Load” button, I get the following message for YTMUSIC:
ERROR: Unable to look up song on YTMusic: Server returned HTTP 400: Bad Request.
Request contains an invalid argument.
I tried to upgrade ytmusicapi:

pip install ytmusicapi --upgrade --user
upgrading to version 1.8.2.
I try again the “Load liked song” step and get the same result:
ERROR: Unable to look up song on YTMusic: Server returned HTTP 400: Bad Request.
Request contains an invalid argument.
The text was updated successfully, but these errors were encountered: