From c6b4e06b2272e7f4a84a1801e59b2ae8b2647b3d Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Fri, 24 Jun 2022 22:55:48 +0200 Subject: [PATCH] Backported fixes from #864 https://github.com/TeamNewPipe/NewPipeExtractor/commit/090debd83b80b05e54d08abb2531453c5fc4e73c --- .../youtube/extractors/YoutubeStreamExtractor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java index 69dabd543f..9f09e4d549 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java @@ -841,11 +841,14 @@ public void onFetchPage(@Nonnull final Downloader downloader) .getBytes(StandardCharsets.UTF_8); nextResponse = getJsonPostResponse(NEXT, body, localization); - if ((!isAgeRestricted && !isLive && !isPostLive) + // this will only be run for post-live and normal streams + if ((!isAgeRestricted && !isLive) || isAndroidClientFetchForced) { try { fetchAndroidMobileJsonPlayer(contentCountry, localization, videoId); } catch (final Exception ignored) { + // Ignore exceptions related to ANDROID client fetch or parsing, as it is not + // compulsory to play contents } } @@ -854,6 +857,8 @@ public void onFetchPage(@Nonnull final Downloader downloader) try { fetchIosMobileJsonPlayer(contentCountry, localization, videoId); } catch (final Exception ignored) { + // Ignore exceptions related to IOS client fetch or parsing, as it is not + // compulsory to play contents } } }