-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Couldn't extract video | Torontosun.com #210
Comments
I am guessing this site will require a plugin to be developed. This could take awhile until someone takes an interest to do it. If you want to give a try, please go ahead. |
I managed to get video id and player id, but rtmpdump complains the connection being rejected:
Ended up using Canoe.pm and made it as Torontosun.pm but changed a couple lines. # Part of get-flash-videos. See get_flash_videos for copyright.
=pod
Torontosun
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::Torontosun;
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
# Changed video_id to look at showVideo
my $video_id = ($browser->content =~ /showVideo.(\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;
# Might not be needed
# if(!$video_id) {
# if# Some pages use more complex video[x][3] type code..
# ifmy $video_offset = ($browser->content =~ /player.SetVideo.\w+\[(\d+)/i)[0];
# if$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; I think the problem is the client signature? I have no idea how to see if it is nor how to fix it. Maybe it's due to setPublisher from this?
Here's the javascript for the video & player: function showVideo(brightcodeId){
// Effacer les anciens player
$('#player_box').text('');
var player = CanoeVideoStandalone.create();
// Selon le site, on retrouve le publisher id du site dans la configuration par site
player.setPublisher(1749345207);
// Retrouver le chanel en fonction de la story
player.setPlayer(767886190001);
// Obtenir l'id du video
player.setVideo(brightcodeId);
// The video will always start when the player is loaded
player.setAutoStart('false');
if(Sunrise.Dfp.pageDfpTags) {
var cmsid = 2314;
var scp = '';
for (var key in dfpcvarr) {
var dfpcvval = dfpcvarr[key];
scp += key + '%3D' + dfpcvval + '%26';
}
// Remove %26 at the end
scp = scp.substring(0, scp.length-3);
var preRollUrl = 'http://pubads.g.doubleclick.net/gampad/ads?iu=' + Sunrise.Dfp.Mapping.url
+ '&sz=640x480|320x240|321x241&ciu_szs=300x250,728x90&unviewed_position_start=1&output=xml_vast2&impl=s'
+ '&env=vp&gdfp_req=1&ad_rule=1&vad_type=linear&vpos=preroll&pod=1&min_ad_duration=0'
+ '&scp='+ scp + '&url='+ window.location.href
+ '&max_ad_duration=30000&ppos=1&lip=true&cmsid='+ cmsid +'&videoID=' + brightcodeId;
player.setAdServer(preRollUrl);
}
player.setStyle({width: 650, height: 360, bgcolor: '#000000' });
player.setContainer('#player_box');
player.generatePlayer();
}
showVideo(5303589262001);
$(function(){
$('.video_canoe').click(function() {
showVideo($(this).attr('rel'));
});
}); |
http://www.torontosun.com/2017/01/30/premier-kathleen-wynne-displays-grace-at-mosque
I know this web page uses CanoeVideoStandalone.
The text was updated successfully, but these errors were encountered: