Created
April 23, 2011 11:51
Revisions
-
John Beppu revised this gist
Apr 24, 2011 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,10 +8,13 @@ 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); -
John Beppu revised this gist
Apr 24, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ #!/usr/bin/env perl use strict; use warnings; use LWP::Simple; -
John Beppu revised this gist
Apr 24, 2011 . 1 changed file with 5 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,34 +1,25 @@ #!perl use strict; use warnings; use LWP::Simple; use URI; use URI::QueryParam; use URI::Escape; while(<>) { my ($url, $title) = split(/\|/); $url =~ s/\s*$//; $url =~ s/^\s*//; $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"; } -
John Beppu created this gist
Apr 23, 2011 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ #!perl use strict; use warnings; use Data::Dump 'pp'; use LWP::Simple; use URI; use URI::QueryParam; use URI::Escape; use Tie::Storable; use Storable; tie my %record => 'Tie::Storable', 'record.po'; while(<>) { my ($url, $title) = split(/\|/); $url =~ s/\s*$//; $url =~ s/^\s*//; $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; my $status = $record{$id}{status}; if ($status && $status != 200) { $rc = getstore($video_url, "$title.flv"); $record{$id} = { title => $title, status => $rc }; store \%record, 'record.po'; } }