ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
131.36k stars 9.95k forks source link

Fails to download videos from certain URLs #543

Closed niyazpk closed 11 years ago

niyazpk commented 11 years ago

Command:

youtube-dl -cit http://www.youtube.com/watch?feature=player_embedded&v=wB3R5Xk2gTY

Result:

[youtube] Setting language
[youtube] watch: Downloading video webpage
ERROR: unable to download video webpage: HTTP Error 404: Not Found
'v' is not recognized as an internal or external command,
operable program or batch file.

This command is working though:

youtube-dl -cil http://www.youtube.com/watch?v=wB3R5Xk2gTY

So I assume it has something to do with the URL params.

Tailszefox commented 11 years ago

This is because of the ampersand in the URL of the video, as well as some other special characters depending on the shell you're using. Your second URL was simpler, that's why it worked with it. To solve that, simply quote your URL:

% youtube-dl -cit "http://www.youtube.com/watch?feature=player_embedded&v=wB3R5Xk2gTY"
[youtube] Setting language
[youtube] wB3R5Xk2gTY: Downloading video webpage
[youtube] wB3R5Xk2gTY: Downloading video info webpage
[youtube] wB3R5Xk2gTY: Extracting video information
[download] Destination: Elon Musk lecture at the Royal Aeronautical Society-wB3R5Xk2gTY.flv
[download]   1.1% of 227.59M at   21.59k/s ETA --:--

On Linux, I'd say it's better to use single quotes but given the error message, I assume you're using Windows, which seems to not take into account single quotes. Double quotes should still do the trick, though.