Lemme know if you find it useful.
I wrote this because none of the CPAN modules that purport to talk to Youtube seem to function offline (they all expect to be being run from a web server back-end with access to login cookies or something), which incidentally is the same reason that all of the Facebook tools in CPAN are useless.
Also, the existing tools seem to all talk the Youtube v2 protocol, which they deprecated a while ago, so it's presumably not long for this world. The v2 protocol was, of course, much easier to use than the v3 protocol. That will not stand: it had to be killed.
OAuth is really terrible, you know. Unrelentingly terrible. Also, water is wet.
The contortions required to use the Youtube API are very similar to -- yet different from in absolutely every particular -- to the contortions required to use the Facebook API, or the Twitter API. It's like OAuth is more of a "stylistic flourish" than an actual API. Saying that two services both use OAuth seems to be about as meaningful as saying that two cars are red. They're basically the same car, right?
I had to go through this OAuth crap (including the --generate-session nonsense) with my facebook-rss.pl hack, and though many of the function names are the same, they really can't share any code. It's insane.
Thanks for the thing. That's a nice tool.
Of tangentially related note, http://rg3.github.io/youtube-dl/ and http://cclive.sourceforge.net/ are currently winning at the cat-and-mouse game with google for being able to download videos from the command line.
I feel your pain wrt OAuth. Truly. Solidarity, brother.
Very nice tool, but I can't use youtubedown to download videos from http://www.drama.net
YouTube v2.0 API is supposedly good until March 5, 2015:
Google deprecation policy:
I don't know what Google will decide is "commercially reasonable" once v3 is good enough, but since they still haven't finished implementing all of v3 yet, I guess they will keep v2 going for a while still. (At least I hope so, or all my youtube scripts will break for a few years, until someone creates a black box that makes OAuth painless. That might be a while.)
Anyone fancy throwing it up on CPAN?
I didn't write it as a "library" so I'm not sure that makes a lot of sense.
I'm sure there are useful guts that could be part of other programs.
A couple of interesting things I've discovered here:
1: The v2 API wouldn't let you add more than 200 videos to a playlist. The v3 API seems to be unlimited (or, at least, the limit is over 3000).
2: With the v2 API, it was really easy to hit the quota limit, and have to wait a few minutes before connecting again. I was trying to test that failure mode with this code and wasn't able to, because I haven't been able to hit the limit at all, and I've been adding videos to this test playlist for hours.
> It's insane.
Welcome to social media.