/usr/share/perl5/FlashVideo/Site/Tv.pm is in get-flash-videos 1.25~git2012.06.27-2.
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 | # Part of get-flash-videos. See get_flash_videos for copyright.
package FlashVideo::Site::Tv;
use strict;
use FlashVideo::Utils;
use FlashVideo::JSON;
sub find_video {
my($self, $browser, $embed_url, $prefs) = @_;
# this is very similar to Cbs.pm... maybe they could be merged
my $pid;
if ($browser->content =~ /so.addVariable\("pid", "([^"]*)"\);/) {
$pid = $1;
} else {
die "Could not find PID for video! " . $browser->uri->as_string;
}
my $url = "http://release.theplatform.com/content.select?format=SMIL&Tracking=true&balance=true&pid=$pid";
$browser->get($url);
if (!$browser->success) {
die "Couldn't download content.select $url: " . $browser->response->status_line;
}
my $xml = from_xml($browser);
my $items = $xml->{body}->{ref};
my $item = ref $items eq 'ARRAY' ?
(grep { $_->{src} =~ /^rtmp:\/\// } @$items)[0] :
$items;
my $filename = title_to_filename($item->{title});
my $playpath = "";
my $rtmpurl = $item->{src};
$rtmpurl =~ s/<break>.*//;
return {
flv => $filename,
# playpath => $playpath,
rtmp => $rtmpurl,
};
}
sub can_handle {
my($self, $browser, $url) = @_;
# Only trigger for tv.com (not all sites in the .tv TLD for example)
return $browser->uri->host =~ /(^|\.)tv\.com$/;
}
1;
|