[Bug Report] Error 400 on Oauth2
- Dominant language
- Java
- Stars
- 5.8k
- Forks
- 2.8k
- PR merge metrics
- No merged PRs in 30d
Description
### Bug Description
I keep getting an HttpError: 400 Bad Request when I try to play a song from YouTube
I have set up
YtdlpOAuth2ClientID
YtdlpOAuth2ClientSecret
YtdlpUseOAuth2 = yes
Made an app on google cloud
When I start the bot up it ask me to "sign in" and I go to google.com/device and all that.
It say success the bot makes a oauth2.token in /data folder
But when I try to play a song I get 400 Bad Request on the [youtube+oauth2]
### Steps to Reproduce
1. Start the bot
2. try to play a song
3. Bad Request to YouTube
### Expected Result
That it would play the song
### Debug Output
[2025-07-24 11:01:48,184] DEBUG - musicbot.bot | In bot.py::MainThread(4184), line 1252 in on_player_finished_playing: Running on_player_finished_playing
[2025-07-24 11:01:48,184] DEBUG - musicbot.bot | In bot.py::MainThread(4184), line 1357 in on_player_finished_playing: No content in current autoplaylist. Filling with new music...
[2025-07-24 11:01:49,184] ERROR - musicbot.bot | In bot.py::MainThread(4184), line 1418 in on_player_finished_playing: Error extracting song "https://youtube.com/watch?v=umdi-RZ8ntM": ERROR: [youtube+oauth2] umdi-RZ8ntM: Unable to download API page: HTTP Error 400: Bad Request (caused by )
Traceback (most recent call last):
File "C:\Python\Lib\site-packages\yt_dlp\networking\_urllib.py", line 399, in _send
res = opener.open(urllib_req, timeout=self._calculate_timeout(request))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Lib\urllib\request.py", line 525, in open
response = meth(req, response)
^^^^^^^^^^^^^^^^^^^
### Additional Info
_No response_
### Checklist
- [x] I have looked for information about this [within the documentation](https://jmusicbot.com/)
- [x] I have searched for similar issues [on the issues page](https://github.com/jagrosh/MusicBot/issues?q=is%3Aissue)
- [x] I am using an official release from [the releases page](https://github.com/jagrosh/MusicBot/releases)
### JMusicBot Version
release-040724-137-g2861810-modded
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the YouTube playback request with YtdlpOAuth2ClientID, YtdlpOAuth2ClientSecret, and YtdlpUseOAuth2 enabled, then inspect the yt-dlp youtube+oauth2 error and generated oauth2.token. Done means the configured bot can authenticate and play a YouTube song without the HTTP 400 response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, java
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100