aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZakariyya Mughal <zaki.mughal@gmail.com>2012-12-07 23:46:58 -0600
committerZakariyya Mughal <zaki.mughal@gmail.com>2012-12-07 23:46:58 -0600
commit13558321fae51f671663c46df6821faaae871b19 (patch)
treec4591ed5191125fc9270e4d2e2dafe78b5811531
parent9fb7db80c1862454003e4f91e7f3fd4e878c6a8b (diff)
downloadget-flash-videos-13558321fae51f671663c46df6821faaae871b19.tar.gz
Putlocker: change expired link logic
-rw-r--r--lib/FlashVideo/Site/Putlocker.pm19
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;