aboutsummaryrefslogtreecommitdiffstats
path: root/lib/WWW
diff options
context:
space:
mode:
authortrizen <trizen@protonmail.com>2020-10-21 00:47:49 +0300
committerJesús <heckyel@hyperbola.info>2020-11-09 17:23:15 -0500
commitef8e41d15f126c2127e830cd9a76a9e55ec4a483 (patch)
tree2cfa8908c9e2eefa796d35ff430a76726ab327a2 /lib/WWW
parent3356a7781516a9cff73c404c402bf41dcd8aa0d3 (diff)
downloadfair-viewer-ef8e41d15f126c2127e830cd9a76a9e55ec4a483.tar.lz
fair-viewer-ef8e41d15f126c2127e830cd9a76a9e55ec4a483.tar.xz
fair-viewer-ef8e41d15f126c2127e830cd9a76a9e55ec4a483.zip
- Filter out streams with "dur=0.000"
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'lib/WWW')
-rw-r--r--lib/WWW/FairViewer.pm7
1 files 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})) {