Linking to pages and resources on this site is encouraged, but the links MUST be placed on a publically-accessible page. Placing links behind any form of login or access restriction is strictly forbidden.

How to download Lucy Pinder on television from Youtube (and other videos too)

Lucy Pinder Television

For complete information, visit the Lucy Pinder Television website... news, shows, videos, youtube links, everything about Lucy Pinder's television work is here!
Screenshot of Lucy Pinder on Nuts TV presenting Overexposed


This page originated as a rant page about the deficiencies of youtube which also provided useful technical information, but it turned out that half the internet were looking up Lucy Pinder videos on it. So it became a Lucy Pinder page which also talks about youtube. Well, sort of...

Lucy Pinder Videos Index: one of the largest collections of Lucy Pinder videos on the net. Includes her Nuts TV work plus modelling videos, PAs and more...
Video collection: Lucy Pinder on Nuts TV Here is the largest available collection of Lucy Pinder's television work for Nuts TV.
Lucy Pinder in "Level Crossings: Don't Run The Risk" I know they're a major pain in the backside, although I can't be arsed to list all the technical reasons why they're like that. The point is, pain in the backside or not, being an idiot and getting squished is a much bigger pain all over...

Still, the Lucy Pinder videos website is here, this page is about youtube itself...

Unfortunately youtube are not the most helpful or easy to use site in the world. Not only do youtube make it needlessly difficult to download the videos - an attitude I have no patience with, if you don't want people to download them don't flaming well host them in the first place - but they insist on obfuscating the business by using the unspeakably evil flash format. And they ruin the quality of the videos, too - it is absolutely cack. They purport to be 320x200 but they're so heavily compressed it looks more like 80x50.

I don't want to view videos in the browser and I take great exception to any site that tries to force me to do something in a particular way. And I particularly don't want to view videos in a browser with a flash plugin installed. Flash is used for such a lot of annoying web garbage that refusing to install a flash plugin is a requirement for avoiding continual annoyances all the time I'm surfing the web. Another requirement is that the machine running the browser should have no working sound system. Too many people embed infuriating sound files on web pages. So the machine I browse with has no speakers attached and indeed no sound card. This is much more reliable and certain than trying to disable a working sound setup. When I want to view a video I download it using wget onto a separate machine that does have working sound, and view it using mplayer. Most video sites make this easy, and a lot of them even provide download links which make it trivial. It's youtube which is the most notorious for messing me about.

And what kind of a bloody stupid name is "youtube", anyway?

I can present at least a partial solution to the problem, in the form of a method for downloading the videos and converting them into a useful format. It's not as good as having a proper download link in a decent format in the first place, but it's the best I can do...

To download a youtube video, you have to look through the source code of the web page and find the line containing:

blahblahblah/watch_fullscreen?video_id=SomEGArbAge&l=CrAp&t=SOmemoREGarbaGEblahblahblah

You then copy that, delete the blahblahblah/watch_fullscreen on the beginning, the blahblahblah on the end, and the &l=CrAp from the middle. That leaves you with

?video_id=SomEGArbAge&t=SOmemoREGarbaGE

You then stick http://www.youtube.com/get_video on the front of that:

http://www.youtube.com/get_video?video_id=SomEGArbAge&t=SOmemoREGarbaGE

That is the URL which you pass to whatever HTTP client you're going to use to download the file:

wget http://www.youtube.com/get_video?video_id=SomEGArbAge&t=SOmemoREGarbaGE -O filename.flv

or cut and paste it into GetRight, or copy it and middle-click in the rendering area with Firefox or Opera, or whatever you have to do with Internet Exploder. The resulting flash video (ack, spit) (.flv) file can probably be played by opening it from a browser with a flash plugin. I refuse to have a flash plugin installed and so I convert them to some more useful format with ffmpeg:

ffmpeg -i filename.flv -sameq -acodec copy filename.avi

An alternative would be to use ffplay to play the video.

The following script automates the process (the downloading, not the conversion, though there's nothing to stop you sticking an extra line in...) If the script is named "youtubeget" then it is invoked as

youtubeget YOUTUBEURL OPFILE

where YOUTUBEURL is the complete URL of the youtube page for the video, and OPFILE is the output filename to save it to. The user-agent string can be changed to masquerade as any recognised browser.

Your version of wget needs to be capable of following the HTTP "see other" response from youtube.

Versions which do not follow "see other" need to be patched with this patch The patch is for wget 1.8.2, which is a bit old, but it's so simple that most of the patch succeeds with later versions and the amount of hand-tweaking needed to complete the process is minimal... does make me wonder why the standard version of wget doesn't include this patch. The script also needs to be modified to pass the --follow-see-other option to wget.

More recent versions do this out of the box - this is true at least of 1.10.2-2 in Debian etch - and do not need the --follow-see-other option to work.

#!/bin/bash

if ! [ $1 ]; then
    echo No URL supplied
exit 1
fi

if ! [ $2 ]; then
    echo No output filename supplied
exit 1
fi

TMP=`mktemp /tmp/youtubeget.$$.XXXXXX || exit 1`

wget "$1" --user-agent='Opera/8.54 (X11; Linux i686; U; en)' -O $TMP

SWFFILE=`sed -n -e '/watch_fullscreen/s/\(^.*watch_fullscreen?\)\([^"]*\)\(".*$\)/\2/p' < $TMP`

VIDEO_ID=`echo $SWFFILE | sed -e 's/\(.*\)\(video_id=[^&]*\)\(.*\)/\2/'`
TRACK_ID=`echo $SWFFILE | sed -e 's/\(.*\)\(t=[^&]*\)\(.*\)/\2/'`

sleep 5

wget  'http://www.youtube.com/get_video?'$VIDEO_ID'&'$TRACK_ID \
 --user-agent='Opera/8.54 (X11; Linux i686; U; en)' -O "$2"

rm -f $TMP


And of course there's nothing to stop you modifying the script to run ffmpeg on the downloaded file.

Back to Crap Stuff


Back to Pigeon's Nest


Be kind to pigeons




Valid HTML 4.01!