diff options
author | trizen <trizen@protonmail.com> | 2020-10-20 23:50:11 +0300 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-11-09 17:18:29 -0500 |
commit | 18ca66194b206cec2c8327c41cac2f586d8ef463 (patch) | |
tree | 882970fad295ee99f7208254d4c155e2a10da6cd /lib/WWW | |
parent | 549626b6c38aae6a099df17152183010871c010c (diff) | |
download | fair-viewer-18ca66194b206cec2c8327c41cac2f586d8ef463.tar.lz fair-viewer-18ca66194b206cec2c8327c41cac2f586d8ef463.tar.xz fair-viewer-18ca66194b206cec2c8327c41cac2f586d8ef463.zip |
- Fixed the "403: Forbidden" errors for newly uploaded videos on unpopular channels.
When "dashManifestUrl" or "sc=yes" is detected, we now use the fallback extraction method (hypervideo or invidious instances).
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'lib/WWW')
-rw-r--r-- | lib/WWW/FairViewer.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/WWW/FairViewer.pm b/lib/WWW/FairViewer.pm index f75931e..736f549 100644 --- a/lib/WWW/FairViewer.pm +++ b/lib/WWW/FairViewer.pm @@ -969,6 +969,11 @@ sub _extract_streaming_urls { my @results; if (exists $json->{streamingData}) { + if (defined $streamingData->{dashManifestUrl}) { + say STDERR ":: Contains DASH manifest URL" if $self->get_debug; + return; + } + my $streamingData = $json->{streamingData}; if (exists $streamingData->{adaptiveFormats}) { @@ -982,6 +987,11 @@ sub _extract_streaming_urls { $self->_check_streaming_urls($videoID, \@results); + if (grep { $_->{url} =~ /\bsc=yes\b/ } @results) { + say STDERR ":: Contains SC = yes" if $self->get_debug; + return; + } + # Keep only streams with contentLength > 0. @results = grep { $_->{itag} == 22 or (exists($_->{contentLength}) and $_->{contentLength} > 0) } @results; |