/usr/share/perl5/FlashVideo/Site/Adultswim.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 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 81 82 83 84 85 86 87 88 89 | # Part of get-flash-videos. See get_flash_videos for copyright.
package FlashVideo::Site::Adultswim;
use strict;
use FlashVideo::Utils;
sub find_video {
my($self, $browser, $embed_url) = @_;
my $xml;
my $id;
my $segIds;
if($browser->{content} =~ m/(<meta[^>]* ?name=["']segIds["'] ?[^>]*>)/){
my $text = $1;
if($text =~ m/content=["']([^"']+)["']/){
$segIds = $1;
}
}
my $id1;
if($segIds =~ m/^([^#]*)#/){
$id1 = $1;
}
my $title;
if($browser->{content} =~ m/<meta property=["']og:title["'] content=["']([^"']+)["']\/>/){
$title = $1;
}
my $configURL = "/tools/swf/player_configs/watch_player.xml";
# foreach($xml->{head}->{script}){
if($browser->content =~ /pageObj\.configURL = ["']([^"']+)["'];/) {
$configURL = $1;
}
# }
$browser->get($configURL);
my $serviceConfigURL;
if($browser->response->code =~ /^30\d$/){
$xml = from_xml($browser);
if($xml->{serviceConfigURL} ne ""){
$serviceConfigURL = $1;
}
} else {
$serviceConfigURL = "http://asfix.adultswim.com/staged/AS.configuration.xml";
}
$browser->get($serviceConfigURL);
$xml = from_xml($browser);
my $getVideoPlayerURL;
if($xml->{config}->{services}->{getVideoPlaylist}->{url} ne ""){
$getVideoPlayerURL = $1;
} else {
$getVideoPlayerURL = "http://asfix.adultswim.com/asfix-svc/episodeservices/getVideoPlaylist?networkName=AS";
}
my $videoURL = "$getVideoPlayerURL&id=$id1";
$browser->get($videoURL);
$xml = from_xml($browser);
# my $pick;
# foreach(@{$xml->{entry}}){
# if(!($_->{ref}->{href} =~ m/iPhone/)){
# $pick = $1;
# }
# }
# grep { $_->{name} eq "mimeType" } @{$_->{param}})[0]->{value}
# my $pick = (grep { $_->{param}->{value}->[3] eq "video/x-flv" } @{$xml->{entry} } )[0];
my $pick = $xml->{entry}[4];
my $file_url = $pick->{ref}->{href};
# $prefs->{quality}
return $file_url, title_to_filename($title);
}
1;
|