Created
April 23, 2011 11:51
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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