-g option for YouTube is not working anymore #27

Closed
opened 2026-02-20 21:00:05 -05:00 by deekerman · 2 comments
Owner

Originally created by @tom87 on GitHub (Dec 11, 2010).

Since the change on YouTube on 9-12-2010 the returned download url doesn't work.
I get a HTML "Forbidden"

Originally created by @tom87 on GitHub (Dec 11, 2010). Since the change on YouTube on 9-12-2010 the returned download url doesn't work. I get a HTML "Forbidden"
Author
Owner

@rg3 commented on GitHub (Dec 11, 2010):

The option IS working and returning the video URL that YouTube is providing (notice that get_video is now a 404). However, if you want to use it to download the video, you may have to combine it with the --cookies option.

@rg3 commented on GitHub (Dec 11, 2010): The option IS working and returning the video URL that YouTube is providing (notice that get_video is now a 404). However, if you want to use it to download the video, you may have to combine it with the --cookies option.
Author
Owner

@rg3 commented on GitHub (Dec 11, 2010):

I just wanted to share the bourne shell function that I use to have a "yt" command available to watch videos while not using the web browser. It looks like this:

yt () 
{ 
    cookiefile="/tmp/cookies-$( date +%s.%N ).txt";
    url=$( youtube-dl --cookies $cookiefile -g "$@" );
    mplayer -cookies -cookies-file $cookiefile $url;
    rm -f $cookiefile
}

Then, I can use something like:

yt 'http://www.youtube.com/watch?v=lm-Vnx58UYo'

And watch the video using mplayer.

@rg3 commented on GitHub (Dec 11, 2010): I just wanted to share the bourne shell function that I use to have a "yt" command available to watch videos while not using the web browser. It looks like this: ``` yt () { cookiefile="/tmp/cookies-$( date +%s.%N ).txt"; url=$( youtube-dl --cookies $cookiefile -g "$@" ); mplayer -cookies -cookies-file $cookiefile $url; rm -f $cookiefile } ``` Then, I can use something like: ``` yt 'http://www.youtube.com/watch?v=lm-Vnx58UYo' ``` And watch the video using mplayer.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#27
No description provided.