From ef8e41d15f126c2127e830cd9a76a9e55ec4a483 Mon Sep 17 00:00:00 2001 From: trizen Date: Wed, 21 Oct 2020 00:47:49 +0300 Subject: - Filter out streams with "dur=0.000" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jesús --- lib/WWW/FairViewer.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/WWW/FairViewer.pm b/lib/WWW/FairViewer.pm index e96ed7c..59b2a80 100644 --- a/lib/WWW/FairViewer.pm +++ b/lib/WWW/FairViewer.pm @@ -973,7 +973,7 @@ sub _extract_streaming_urls { if (defined $streamingData->{dashManifestUrl}) { say STDERR ":: Contains DASH manifest URL" if $self->get_debug; - return; + ##return; } if (exists $streamingData->{adaptiveFormats}) { @@ -989,12 +989,15 @@ sub _extract_streaming_urls { if (grep { $_->{url} =~ /\bsc=yes\b/ } @results) { say STDERR ":: Contains SC = yes" if $self->get_debug; - return; + ##return; } # Keep only streams with contentLength > 0. @results = grep { $_->{itag} == 22 or (exists($_->{contentLength}) and $_->{contentLength} > 0) } @results; + # Filter out streams with "dur=0.000" + @results = grep { $_->{url} !~ /\bdur=0\.000\b/ } @results; + # Detect livestream if (!@results and exists($json->{streamingData}) and exists($json->{streamingData}{hlsManifestUrl})) { -- cgit v1.2.3