diff options
author | Zakariyya Mughal <zaki.mughal@gmail.com> | 2012-12-07 23:46:58 -0600 |
---|---|---|
committer | Zakariyya Mughal <zaki.mughal@gmail.com> | 2012-12-07 23:46:58 -0600 |
commit | 13558321fae51f671663c46df6821faaae871b19 (patch) | |
tree | c4591ed5191125fc9270e4d2e2dafe78b5811531 | |
parent | 9fb7db80c1862454003e4f91e7f3fd4e878c6a8b (diff) | |
download | get-flash-videos-13558321fae51f671663c46df6821faaae871b19.tar.gz |
Putlocker: change expired link logic
-rw-r--r-- | lib/FlashVideo/Site/Putlocker.pm | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/FlashVideo/Site/Putlocker.pm b/lib/FlashVideo/Site/Putlocker.pm index 8c5b27e..1a44c4d 100644 --- a/lib/FlashVideo/Site/Putlocker.pm +++ b/lib/FlashVideo/Site/Putlocker.pm @@ -57,20 +57,19 @@ sub find_video { my ($stream_url) = ($contents =~ /url="(.*?)"/); $stream_url = decode_entities($stream_url); - if($prefs->{quality} eq 'high') { + if($stream_url =~ /expired_link/) { + # if link is unavailable + if( $page_html =~ m,"/(get_file\.php\?id=[^"]*)", ) { + # download original file if link available + my $download_page = $1; + $url = URI->new( "http://www.putlocker.com/$1" ); + # this URL should be equivalent to what is returned by get_high_quality() + } + } elsif($prefs->{quality} eq 'high') { $url = get_high_quality($id, $streamID); } else { # get streaming version $url = $stream_url; - - if($url =~ /expired_link/) { - if( $page_html =~ m,"/(get_file\.php\?id=[^"]*)", ) { - # download original file if link available - my $download_page = $1; - $url = URI->new( "http://www.putlocker.com/$1" ); - # this URL should be equivalent to what is returned by get_high_quality() - } - } } info "Got the video URL: " . $url; |