/usr/share/perl5/FlashVideo/Site/Blip.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 | # Part of get-flash-videos. See get_flash_videos for copyright.
package FlashVideo::Site::Blip;
use strict;
use FlashVideo::Utils;
sub find_video {
my ($self, $browser, $embed_url) = @_;
my $base = "http://blip.tv";
my $id;
if($embed_url =~ m{flash/(\d+)}) {
$id = $1;
} else {
$browser->get($embed_url);
if($browser->response->is_redirect
&& $browser->response->header("Location") =~ m!(?:/|%2f)(\d+)!i) {
$id = $1;
} else {
$id = ($browser->content =~ m!/rss/flash/(\d+)!)[0];
}
}
# Sometimes the ID is supplied in an odd way.
if (!$id) {
# Video ID is somehow related to the ID of a comment posted on the
# site, slightly odd.
if ($browser->content =~ /post_masthed_(\d+)/) {
$id = $1;
}
}
if (!$id) { ($id) = ($browser->content =~ m/data-posts-id="(\d+)"/); }
if (!$id) { ($id) = ($browser->content =~ m/data-disqus-id="(\d+)"/); }
if (!$id) { ($id) = ($embed_url =~ m/.*?(\d+$)/); }
die "No ID found\n" unless $id;
$browser->get("$base/rss/flash/$id");
my $xml = from_xml($browser);
my $content = $xml->{channel}->{item}->{"media:group"}->{"media:content"};
my $url = ref $content eq 'ARRAY' ? $content->[0]->{url} : $content->{url};
my $filename = title_to_filename($xml->{channel}->{item}->{title}, $url);
# I want to follow redirects now.
$browser->allow_redirects;
return $url, $filename;
}
1;
|