diff options
author | Nigel Taylor <njtaylor0101@gmail.com> | 2013-03-09 06:14:20 -0800 |
---|---|---|
committer | Nigel Taylor <njtaylor0101@gmail.com> | 2013-03-09 06:14:20 -0800 |
commit | e99838b60187b54d28175af04948bfb97c480338 (patch) | |
tree | 96ce70ee7a3670d00fe62f75f2f3b7523f95e557 | |
parent | cadec9e4685dfce675f3689267462bfa8c4562b4 (diff) | |
parent | 6852eba3ed79976ba23d76b02601dedcb0b80baf (diff) | |
download | get-flash-videos-e99838b60187b54d28175af04948bfb97c480338.tar.gz |
Merge pull request #102 from njtaylor/master
vimeo.pm add rediction
-rw-r--r-- | lib/FlashVideo/Site/Vimeo.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/FlashVideo/Site/Vimeo.pm b/lib/FlashVideo/Site/Vimeo.pm index cfff570..7a6e13a 100644 --- a/lib/FlashVideo/Site/Vimeo.pm +++ b/lib/FlashVideo/Site/Vimeo.pm @@ -6,10 +6,22 @@ use warnings; use FlashVideo::Utils; use FlashVideo::JSON; +our $VERSION = '0.01'; +sub Version() { $VERSION; } + sub find_video { my ($self, $browser, $embed_url) = @_; my $id; + + if ($browser->response->is_redirect) { + my $relurl = $browser->response->header('Location'); + info "Relocated to $relurl"; + $browser->get($relurl); + } + + my $page_url = $browser->uri->as_string; + if ($embed_url =~ /clip_id=(\d+)/) { $id = $1; } elsif ($embed_url =~ m!/(\d+)!) { |