/usr/share/perl5/FlashVideo/Site/Flickr.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 | # Part of get-flash-videos. See get_flash_videos for copyright.
package FlashVideo::Site::Flickr;
use strict;
use FlashVideo::Utils;
use URI::Escape;
my $get_mtl = "http://www.flickr.com/apps/video/video_mtl_xml.gne?v=x";
sub find_video {
my ($self, $browser, $embed_url) = @_;
my($id) = $browser->content =~ /photo_id=(\d+)/;
my($secret) = $browser->content =~ /photo_secret=(\w+)/;
die "No video ID found\n" unless $id;
$browser->get($get_mtl . "&photo_id=$id&secret=$secret&olang=en-us&noBuffer=null&bitrate=700&target=_self");
my $xml = from_xml($browser);
my $guid = $self->make_guid;
my $video_id = $xml->{Data}->{Item}->{id}->{content};
my $playlist_url = $xml->{Playlist}->{TimelineTemplates}->{Timeline}
->{Metadata}->{Item}->{playlistUrl}->{content};
die "No video ID or playlist found" unless $video_id and $playlist_url;
$browser->get($playlist_url
. "?node_id=$video_id&secret=$secret&tech=flash&mode=playlist"
. "&lq=$guid&bitrate=700&rd=video.yahoo.com&noad=1");
$xml = eval { XML::Simple::XMLin($browser->content) };
die "Failed parsing XML: $@" if $@;
$xml = $xml->{"SEQUENCE-ITEM"};
die "XML not as expected" unless $xml;
my $filename = title_to_filename($xml->{META}->{TITLE});
my $url = $xml->{STREAM}->{APP} . $xml->{STREAM}->{FULLPATH};
return $url, $filename;
}
sub make_guid {
my($self) = @_;
my @chars = ('A' .. 'Z', 'a' .. 'z', 0 .. 9, '.', '_');
return join "", map { $chars[rand @chars] } 1 .. 22;
}
1;
|