aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrançois Charlier <fcharlier@ploup.net>2012-07-06 12:21:16 +0200
committerFrançois Charlier <fcharlier@ploup.net>2012-07-06 12:31:40 +0200
commit8f64dd3d9ae803a61741f85f9ae00c1a915270ac (patch)
tree9455d5b2b9d9eb6216466d24e0c411155de3ea05
parentd630a98d8a5b1b2186d1a5a42bf24291aa232487 (diff)
downloadget-flash-videos-8f64dd3d9ae803a61741f85f9ae00c1a915270ac.tar.gz
Add support for www.pinkbike.com videos
-rw-r--r--lib/FlashVideo/Site/Pinkbike.pm26
1 files changed, 26 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;