/usr/share/perl5/FlashVideo/Site/Redbull.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 | # Part of get-flash-videos. See get_flash_videos for copyright.
package FlashVideo::Site::Redbull;
use strict;
use FlashVideo::Utils;
use URI;
use HTML::Entities;
sub find_video {
my ($self, $browser, $page_url) = @_;
my $video_info_url;
my $host = $browser->uri->host;
if ( ($browser->content =~ /data_url:\s+'([^']+)'/) or
($browser->content =~ m{displayVideoPlayer\('([^']+)'\)})) {
$video_info_url = $1;
$video_info_url = "http://$host$video_info_url";
}
if (!$video_info_url) {
die "Couldn't find video info URL";
}
$browser->get($video_info_url);
if ($browser->response->is_redirect) {
$browser->get($browser->response->header('Location'));
}
if (!$browser->success) {
die "Couldn't download Red Bull video info XML: " .
$browser->response->status_line;
}
# Red Bull's XML is screwed up:
# <?xml version=&"1.0&"
# All your double encoded entities is belong to them.
# If Red Bull want to thank us for pointing this out, please send a few cases
# to Zak and Monsieur.
my $xml = $browser->content;
$xml =~ s/&//g;
$xml = decode_entities($xml);
my $video_info = from_xml($xml);
my $file_type = "flv";
if ($video_info->{high_video_url} =~ /\.mp4$/) {
$file_type = "mp4";
}
return {
flv => title_to_filename($video_info->{title}, $file_type),
rtmp => $video_info->{high_video_url},
};
}
1;
|