diff options
author | Tomáš Čech <sleep_walker@suse.cz> | 2013-04-05 00:08:28 +0200 |
---|---|---|
committer | Tomáš Čech <sleep_walker@suse.cz> | 2013-04-05 00:08:28 +0200 |
commit | 2d0d9313212724400c740e8a5146c27f3c4b512c (patch) | |
tree | 2ea509c9979f602567d4e449a624556d9e95c4e7 | |
parent | 9b8b79ea33c5a3df7cfc3bfd10b40979f7b86dfc (diff) | |
download | get-flash-videos-2d0d9313212724400c740e8a5146c27f3c4b512c.tar.gz |
let there be Videofun.me support
-rw-r--r-- | lib/FlashVideo/Site/Videofun.pm | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/FlashVideo/Site/Videofun.pm b/lib/FlashVideo/Site/Videofun.pm new file mode 100644 index 0000000..0d16d03 --- /dev/null +++ b/lib/FlashVideo/Site/Videofun.pm @@ -0,0 +1,39 @@ +# Part of get-flash-videos. See get_flash_videos for copyright. +package FlashVideo::Site::Videofun; + +use strict; +use FlashVideo::Utils; +use URI::Escape; + +our $VERSION = '0.01'; +sub Version() { $VERSION; } + +sub find_video { + my ($self, $browser, $embed_url) = @_; + + my $coded_url = ""; + my $url = ""; + my $name = ""; + + + # read URL from the configuration passed to flash player + if ($browser->content =~ /\s*{url: "(http[^"]+)".*autoBuffering.*/) { + $coded_url = $1; + } else { + # if we can't get it, just leave as the video URL is there + return; + } + + debug ("Coded URL: " . $coded_url); + + + $url = uri_unescape($coded_url); + debug("URL: '" . $url . "'"); + + # URL ends with filename + $name = $url; + $name =~ s/.*\/([^\/]+)\?.*/$1/; + return $url, title_to_filename($name); +} + +1; |