From 18ca66194b206cec2c8327c41cac2f586d8ef463 Mon Sep 17 00:00:00 2001 From: trizen Date: Tue, 20 Oct 2020 23:50:11 +0300 Subject: - Fixed the "403: Forbidden" errors for newly uploaded videos on unpopular channels. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When "dashManifestUrl" or "sc=yes" is detected, we now use the fallback extraction method (hypervideo or invidious instances). Signed-off-by: Jesús --- lib/WWW/FairViewer.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- cgit v1.2.3