Skip to content

Instantly share code, notes, and snippets.

@beppu
Created April 23, 2011 11:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beppu/938558 to your computer and use it in GitHub Desktop.
Save beppu/938558 to your computer and use it in GitHub Desktop.
on STDIN, give this script a list of google video urls, and it will download them.
#!/usr/bin/env perl
use strict;
use warnings;
use LWP::Simple;
use URI;
use URI::QueryParam;
use URI::Escape;
while(<>) {
my ($url, $title) = split(/\|/);
next unless $url;
$url =~ s/\s*$//;
$url =~ s/^\s*//;
if ($title) {
$title =~ s/\s*$//;
$title =~ s/^\s*//;
}
my $id;
my $uri = URI->new($url);
my $html = get($url);
$html =~ m{videoUrl\\x3d(http.*?)\\x};
my $video_url = URI->new(uri_unescape($1));
$id = $video_url->query_param('id');
$title = $id unless ($title);
print $title, " => ", $video_url, "\n";
my $rc = getstore($video_url, "$title.flv");
print "$rc\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment