aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzakflash <zakflashvideo@gmail.com>2012-07-10 12:52:34 -0700
committerzakflash <zakflashvideo@gmail.com>2012-07-10 12:52:34 -0700
commitfcd007189cc243273e600074fc433956c4cc7e1d (patch)
tree3381aa2491696b260e0f7010bacdd655339b16bf
parente848051e82064ae115cfbd032afbf0c9de392534 (diff)
parent5fd185e94ed1b9d0d1aba4e566989bb4e3caf5d3 (diff)
downloadget-flash-videos-fcd007189cc243273e600074fc433956c4cc7e1d.tar.gz
Merge pull request #72 from fcharlier/pinkbike
Add support for www.pinkbike.com videos
-rw-r--r--lib/FlashVideo/Site/Pinkbike.pm26
-rw-r--r--t/urls3
2 files changed, 29 insertions, 0 deletions
diff --git a/lib/FlashVideo/Site/Pinkbike.pm b/lib/FlashVideo/Site/Pinkbike.pm
new file mode 100644
index 0000000..6051747
--- /dev/null
+++ b/lib/FlashVideo/Site/Pinkbike.pm
@@ -0,0 +1,26 @@
+# Part of get-flash-videos. See get_flash_videos for copyright.
+package FlashVideo::Site::Pinkbike;
+
+use strict;
+use FlashVideo::Utils;
+
+sub find_video {
+ my ($self, $browser, $embed_url) = @_;
+
+ # Extract filename from page title
+ my $title = extract_title($browser);
+ debug("Found title : " . $title);
+ my $filename = title_to_filename($title);
+ debug("Filename : " . $filename);
+
+ my $video_id = ($embed_url =~ m/\/video\/(\d+)\/?$/)[0];
+
+ die "Unable to extract url" unless $video_id;
+
+ my $url = "http://lv1.pinkbike.org/vf/" . (int($video_id / 10000)) . "/pbvid-" . $video_id . ".flv";
+ debug("Video URL: " . $url);
+
+ return $url, $filename;
+}
+
+1;
diff --git a/t/urls b/t/urls
index 06e0421..a8df888 100644
--- a/t/urls
+++ b/t/urls
@@ -304,3 +304,6 @@ http://www.videobb.com/video/WkGeqQlNSYWk
# Tv4play
http://www.tv4play.se/barn/postis_per?title=postis_per_del_10&videoid=823994
+
+# Pinkbike
+http://www.pinkbike.com/video/4263/