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.

10 Responses to “Youtube Ripping: Reloaded”

  1. Youtube Ripper: Collector’s Edition « Niklas Lindblad Says:

    […] For a working script, see this post […]

  2. Kz Says:

    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…….

  3. nlindblad Says:

    The files are in plain-text. Rename them to README.txt and TODO.txt if Notepad can’t open them.

  4. James Attard Says:

    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 !

  5. Theo Says:

    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);

  6. Theo Says:

    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)

  7. Paul Says:

    Try &

  8. Paul Says:

    Err.. & :S

  9. school teacher Says:

    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

  10. Raphael diSanto Says:

    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.+?”/

Leave a Reply