/usr/share/perl5/FlashVideo/Site/Muzu.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 63 64 65 | # Part of get-flash-videos. See get_flash_videos for copyright.
package FlashVideo::Site::Muzu;
use strict;
use FlashVideo::Utils;
use HTML::Entities;
sub find_video {
my ($self, $browser) = @_;
# Sometimes redirects to country-specific sites, sigh...
if ($browser->response->code == 302) {
$browser->allow_redirects;
$browser->get($browser->response->header('Location'))
}
$browser->content =~ /id="trackHeading">(.*?)</;
my $title = $1;
if (!$title) {
$browser->content =~ /id="videosPageMainTitleH1">(.*?)</s;
$title = $1;
}
my $filename = title_to_filename(decode_entities($title));
my $flashvars = ($browser->content =~ m'flashvars:(?:\s+getPlayerData\(\)\s+\+\s+)?"([^"]+)')[0];
die "Unable to extract flashvars" unless $flashvars;
my %map = (
networkId => "id",
assetId => "assetId",
vidId => "assetId",
startChannel => "playlistId",
);
my $playAsset = "http://www.muzu.tv/player/playAsset/?";
for(split /&/, $flashvars) {
my($n, $v) = split /=/;
$playAsset .= "$map{$n}=$v&" if exists $map{$n};
}
$browser->get($playAsset);
die "Unable to get $playAsset" if $browser->response->is_error;
my $url = ($browser->content =~ /src="([^"]+)/)[0];
$url = decode_entities($url);
die "Unable to find video URL" unless $url;
if($url =~ /^rtmp:/) {
my($playpath) = $url =~ m{/([^/]+)$};
return {
flv => $filename,
rtmp => $url,
playpath => $playpath,
$url =~ /live/ ? (live => 1) : ()
};
} else {
return $url, $filename;
}
}
1;
|