/usr/share/perl5/FlashVideo/Site/Metacafe.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 | # Part of get-flash-videos. See get_flash_videos for copyright.
package FlashVideo::Site::Metacafe;
use strict;
use FlashVideo::Utils;
use URI::Escape;
sub find_video {
my ($self, $browser) = @_;
if ($browser->response->header("Location") =~ /Openx/) {
# Family filter, turn it off
my $filter = "http://www.metacafe.com/f/index.php?inputType=filter&controllerGroup=user&filters=0&prevURL=" . $browser->uri->path;
debug "Disabling family filter by getting $filter";
$browser->allow_redirects;
$browser->get($filter);
}
my $url;
if ($browser->content =~ m'mediaURL=(http.+?)&') {
$url = uri_unescape($1);
} else {
die "Couldn't find mediaURL parameter.";
}
if ($browser->content =~ m'gdaKey=(.+?)&') {
$url .= "?__gda__=" . uri_unescape($1);
} else {
# They're now using a session ID on the end of the URL like this:
# ?aksessionid=1255084734240_230066
# but it doesn't seem to actually be required.
}
my $filename = title_to_filename(extract_title($browser));
return ($url, $filename);
}
1;
|