/usr/share/perl5/FlashVideo/Site/Nick.pm is in get-flash-videos 1.25~git2014.03.23-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 53 54 55 56 57 58 59 60 61 62 | # Part of get-flash-videos. See get_flash_videos for copyright.
package FlashVideo::Site::Nick;
use strict;
use FlashVideo::Utils;
use URI::Escape;
sub find_video {
my ($self, $browser, $embed_url) = @_;
#/mgid:cms:video:spongebob.com:895944
my $page_url = $browser->uri->as_string;
my $title;
if($browser->content =~ /<span content=["']([\w \.:]+)["'] property=["']media:title["']\/>/) {
$title = $1;
} else {
$title = "nothing";
}
my $cmsId;
if($browser->content =~ /KIDS\.add\("cmsId", "(\d+)"\);/) {
$cmsId = $1;
} else {
die "Couldn't get the cmsId.";
}
my $site;
if($browser->content =~ /KIDS\.add\(["']site["'], ["']([\w\.]+)["']\);/) {
$site = lc($1);
} else {
die "Couldn't get the site.";
}
my $type;
if($browser->content =~ /KIDS\.add\(["']type["'], ["']([a-z]+)["']\);/) {
$type = $1;
} else {
$type = "video";
}
my $uri = "mgid:cms:$type:$site:$cmsId";
$browser->get("http://www.nick.com/dynamo/video/data/mediaGen.jhtml?mgid=$uri");
my $xml = from_xml($browser->content);
my $rtmp_url = $xml->{video}->{item}[0]->{rendition}[0]->{src};
return {
rtmp => $rtmp_url,
flv => title_to_filename($title),
pageUrl => $page_url,
swfhash($browser, "http://media.nick.com/" . $uri)
};
}
sub can_handle {
my($self, $browser) = @_;
return $browser->content =~ /<script src=["']http:\/\/media.nick.com\/player\/scripts\/mtvn_player_control\.1\.0\.1\.js["']/;
}
1;
|