Subscribe to
Posts
Comments
NSLog(); Header Image

youtube-dl

A Mac application we're building includes the ability to download YouTube videos, and though we've previously written our own Objective-C code to do this, we're thinking of using this python script, youtube-dl to handle a lot of the process.

I believe we'd rip out (or modify) the script to simply take in a YouTube URL and to spit back out the download URL - perhaps via an NSTask - but I'm not sure. The goal is to be able to update more easily in the future when YouTube changes its URLs or HTML format as they seem to do every few months. We'd also want to get the title of the movie as well, but that shouldn't be all that difficult.

The problem is that once you hack it, it is going to take time to re-hack each subsequent version. Is the true solution to let the script download the movie and just import it immediately?

A distant alternative may be to find some way to use the JavaScript/HTML code found within the YouTube5 extension (which also works on Vimeo videos) ((xar -xf blah.safariextz spits out everything as individual resources.)), but there may be obvious licensing and copyright issues with that, so… probably not.