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

ERROR: Unable to download webpage: HTTP Error 400: Bad Request (caused by HTTPError()) #4773

Closed
leogao opened this issue Jan 24, 2015 · 2 comments

Comments

@leogao
Copy link

@leogao leogao commented Jan 24, 2015

$~/youtube-dl https://www.youtube.com/watch?x-yt-cl=84503534&v=bJNGij15w0A&x-yt-ts=1421914688
[1] 8351
[2] 8352
-bash: x-yt-ts=1421914688: command not found
[2]+ Done v=bJNGij15w0A
$[generic] watch?x-yt-cl=84503534: Requesting header
[redirect] Following redirect to https://www.youtube.com/supported_browsers?next_url=%2F
[download] Downloading playlist: supported_browsers
[youtube:user] supported_browsers: Downloading video ids from 1 to 51
ERROR: Unable to download webpage: HTTP Error 400: Bad Request (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

[1]+ Exit 1 ~/youtube-dl https://www.youtube.com/watch?x-yt-cl=84503534

@naglis
Copy link
Collaborator

@naglis naglis commented Jan 24, 2015

Your URL contains unescaped ampersands which have a special meaning (to run the command in background) in bash (your shell), so the URL gets cut off. Notice the weird output in the beginning:

[1] 8351
[2] 8352
-bash: x-yt-ts=1421914688: command not found
[2]+ Done v=bJNGij15w0A

This is the output from bash trying to interpret and run the cut off parts of the URL.

To solve this issue, either escape the ampersands with backslashes (\), like this:

youtube-dl https://www.youtube.com/watch?x-yt-cl=84503534\&v=bJNGij15w0A\&x-yt-ts=1421914688

on enclose the URL in single or double quotes:

youtube-dl 'https://www.youtube.com/watch?x-yt-cl=84503534&v=bJNGij15w0A&x-yt-ts=1421914688'

Once you've done that, it should work fine.

Also, next time please include the full output of the command when run with --verbose flag, as outlined here.

@naglis naglis closed this Jan 24, 2015
phihag added a commit that referenced this issue Jan 24, 2015
@leogao
Copy link
Author

@leogao leogao commented Jan 27, 2015

OK, enclose the url in single or double quotes, it works well.
Thanks.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.