Skip to content

Instantly share code, notes, and snippets.

@ifnull
Created May 23, 2013 21:42
Show Gist options
  • Save ifnull/5639656 to your computer and use it in GitHub Desktop.
Save ifnull/5639656 to your computer and use it in GitHub Desktop.
FlashVideo::Site:: module for get-flash-videos
package FlashVideo::Site::Movieclips;
use strict;
use FlashVideo::Utils;
sub find_video {
my ($self, $browser, $embed_url) = @_;
my $video_id = ($browser->content =~ /<meta name="video_id" content="([^"]+)"/i)[0];
debug "video_id = " . $video_id;
$browser->get("http://config.movieclips.com/player/config/embed/$video_id/?loc=US");
my $xml = from_xml($browser->content);
my $playpath = $xml->{video}->{properties}->{file_path};
my $title = $xml->{video}->{properties}->{clip_title};
debug $playpath;
debug title_to_filename($title);
return {
flv => title_to_filename($title, 'flv'),
swfUrl => "http://static.movieclips.com/embedplayer.swf?shortid=$video_id",
app => "ondemand",
rtmp => "rtmp://media.movieclips.com",
playpath => $playpath
};
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment