Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
- Filter out streams with "dur=0.000"
Browse files Browse the repository at this point in the history
  • Loading branch information
trizen committed Oct 20, 2020
1 parent 060c1f2 commit f05bdba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/WWW/StrawViewer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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}) {
Expand All @@ -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})) {

Expand Down

0 comments on commit f05bdba

Please sign in to comment.