/usr/share/perl5/FlashVideo/Site/Tva.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 | # Part of get-flash-videos. See get_flash_videos for copyright.
=for comment
Uses TVA/Canoe-Specific way to get the brightcove metadata,
then forwards to the brightcove module.
TVA/Canoe live streaming
expects URL of the form
http://tva.canoe.ca/dws/?emission=xxxxxxx
=cut
package FlashVideo::Site::Tva;
use strict;
use FlashVideo::Utils;
use base 'FlashVideo::Site::Brightcove';
sub find_video {
my ($self, $browser, $embed_url) = @_;
# look inside script that generates CanoeVideoStandalone object
my $video_id = ($browser->content =~ /player.SetVideo.(\d+)/i)[0];
my $player_id = ($browser->content =~ /player.SetPlayer.(\d+)/i)[0];
debug "Extracted playerId: $player_id, videoId: $video_id"
if $player_id or $video_id;
if(!$video_id) {
# Some pages use more complex video[x][3] type code..
my $video_offset = ($browser->content =~ /player.SetVideo.\w+\[(\d+)/i)[0];
$video_id = ($browser->content =~ /videos\[$video_offset\].+'(\d+)'\s*\]/)[0];
}
die "Unable to extract Brightcove IDs from page"
unless $player_id and $video_id;
return $self->amfgateway($browser, $player_id, { videoId => $video_id, } );
}
sub can_handle {
my($self, $browser, $url) = @_;
return $browser->content =~ /player = CanoeVideoStandalone\.create\(\);/i;
}
1;
|