/usr/share/perl5/FlashVideo/Site/Break.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 | # Part of get-flash-videos. See get_flash_videos for copyright.
package FlashVideo::Site::Break;
use strict;
use FlashVideo::Utils;
use URI::Escape;
sub find_video {
my($self, $browser, $embed_url) = @_;
# Need to get additional ID, otherwise video download returns 403
my $video_id;
if ($browser->content =~ /flashVars\.icon = ["'](\w+)["']/) {
$video_id = $1;
}
else {
die "Couldn't get Break video ID";
}
if($browser->content =~ /<meta name=['"]embed_video_url['"] content=["']([^'"]*)["']/) {
$browser->get($1);
}
if(URI->new($embed_url)->host eq "embed.break.com") {
$browser->get($embed_url);
}
if($browser->uri->host eq "embed.break.com") {
# Embedded video
if(!$browser->success && $browser->response->header('Location') !~ /sVidLoc/) {
$browser->get($browser->response->header('Location'));
}
if($browser->response->header("Location") =~ /sVidLoc=([^&]+)/) {
my $url = uri_unescape($1).'?'.$video_id;
my $filename = title_to_filename((split /\//, $url)[-1]);
return $url, $filename;
}
}
my $path = ($browser->content =~ /sGlobalContentFilePath='([^']+)'/)[0];
my $filename = ($browser->content =~ /sGlobalFileName='([^']+)'/)[0];
die "Unable to extract path and filename" unless $path and $filename;
my $video_path = ($browser->content =~ /videoPath\s*(?:',|=)\s*['"]([^'"]+)/)[0];
# I want to follow redirects now.
$browser->allow_redirects;
return $video_path . $path . "/" . $filename . ".flv" . "?" . $video_id,
title_to_filename($filename);
}
1;
|