/usr/share/perl5/FlashVideo/Site/Thirteen.pm is in get-flash-videos 1.25.98-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | # Part of get-flash-videos. See get_flash_videos for copyright.
package FlashVideo::Site::Thirteen;
use strict;
use FlashVideo::Utils;
use FlashVideo::JSON;
sub find_video {
my ($self, $browser, $embed_url, $prefs) = @_;
my $iframe;
if ($browser->content =~ /<iframe src="([^"]*)" /) {
$iframe = $1;
} else {
die "Couln't find iframe in " . $browser->uri->as_string;
}
my $url = 'http://www.thirteen.org' . $iframe;
$browser->get($url);
if (!$browser->success) {
die "Couldn't download iframe $url: " . $browser->response->status_line;
}
# my $mediaID;
# if ($browser->content =~ /var episodeMediaID = "([^"]*)";/) {
# $mediaID = $1;
# } else {
# die "Couldn't find mediaID $url";
# }
# my $feed_url;
# if ($browser->content =~ /var feedURL = "([^"]*)" + episodeMediaID + "([^"]*)";/) {
# $feed_url = $1 . $mediaID;# . $2;
# } else {
# $feed_url = "http://feeds.theplatform.com/ps/JSON/PortalService/2.2/getReleaseList?PID=vbnrH_ew_gqKA2Npq_EbJQJKqOxpBnQA&query=KeywordsSearch|" . $mediaID;
# }
my $pid;
if ($browser->content =~ /var pid = "([^"]*)";/) {
$pid = $1;
} elsif ($browser->uri->as_string =~ /&pid=([^&]*)&/) {
$pid = $1;
} else {
die "Could not find pid for $url";
}
my $release_url;
if ($browser->content =~ /so.addVariable\("releaseURL", "([^"]*)"+pid+"([^"]*)"\);/) {
$release_url = $1 . $pid . $2;
} else {
$release_url = "http://release.theplatform.com/content.select?pid=" . $pid . "&format=SMIL&Tracking=true";
}
$browser->get($release_url);
my $rtmp_url;
if ($browser->response->is_redirect) {
$rtmp_url = $browser->response->header("Location");
} else {
die "No redirect found for $release_url";
}
$rtmp_url =~ s/<break>//;
my $filename;
if ($rtmp_url =~ /mp4:(.*)\.mp4$/) {
$filename = title_to_filename($1);
} else {
$filename = title_to_filename("");
}
# $browser->get($feed_url);
# my $feed_data = from_json($browser->content);
# debug($feed_data->{title});
return {
rtmp => $rtmp_url,
flv => $filename,
};
}
1;
|