Youtube Ripping: Reloaded
The initial version of the Youtube command-line ripper appeared on Digg without ever reaching any sort of maturity. There was at most an hour between the beginning of the coding process and the massive public exposure. I am grateful for all the feedback I have received and, as promised I now announce a total rewrite in PHP that is confirmed working on Linux, Windows and OS X (just about any platform with PHP actually).
Version 0.40 is available for download.
- PHP5 is available for Windows as binaries from the PHP.net site
- Most Linux distributions have a package in their repositories
- There is a port of PHP5 available for OS X users
May 20th, 2007 at 2:39 pm
[…] For a working script, see this post […]
June 8th, 2007 at 2:32 pm
Hi there,
I have downloaded the script but cant seem to open the readme or todo files; perhapes you should make this into notepad or something everyone has…….
June 8th, 2007 at 7:41 pm
The files are in plain-text. Rename them to README.txt and TODO.txt if Notepad can’t open them.
June 19th, 2007 at 2:56 pm
There was a slight bug in the script - as of today at least, it didn’t work:
replace line 40 with:
ereg(’/player2.swf\?hl=en&video_id=.*’,$match,$id);
and line 42 with:
$unique_id = preg_replace(”/\/player2.swf\?hl=en&video_id=/”,”,$str);
I have one question though - although I loved your script I still cannot understand how did you arrive that youtube calls videos through the http://www.youtube.com/get_video - i didn’t manage to find that string with wget. Did you use some sniffer to arrive to that conclusion??
Thanks !
July 15th, 2007 at 8:23 pm
Great script, however as of today as least the page switching bit doesn’t work (it will only download from page one). To fix:
replace line 53 with:
$matches = preg_grep(”/&p=r&page=[0-9]*/”,$html);
July 15th, 2007 at 8:25 pm
Hmmm, not sure how to escape special commands in Wordpress so the code above won’t work. Basically you need to replace the &’s with “& amp;” (omitting the spaces)
July 21st, 2007 at 2:51 pm
Try &
July 21st, 2007 at 2:53 pm
Err.. & :S
August 17th, 2007 at 12:18 am
wartornhols@yahoo.co.uk
I’m only a thick drama teacher who can’t understand scripts! not on the computer anyway. I need to rip a piece from youtube to shiow my kids, as youtube is banned in schools. I need the following youtube vid as any video file to embed elsewhere.
http://www.youtube.com/watch?v=pjd-xkR9mxw
could anyone rip this for me and email me the result?
cheers.
I’m trying to learn
August 25th, 2007 at 3:05 am
YouTube just changed the format of their HTML in their individual video pages. You can’t search for swfobject anymore to find the unique video ID unless you can fool the javascript into thinking you have a valid Flash player. However, the unique video ID can be found by regexp-ing for /watch_fullscreen.+?”/