Skip to content

Commit 60e97cd

Browse files
committed
[YouTube] Workaround getting streaming URLs returning 403 HTTP response codes
Using the player parameters used to get stories seems to fix the issue, which affects currently only certain countries such as UK. This is a workaround and should be fixed in a better way (by changing the InnerTube additional client used for videos or finding what is now required in Android player requests).
1 parent 4bc90cd commit 60e97cd

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,11 @@ private void fetchAndroidMobileJsonPlayer(@Nonnull final ContentCountry contentC
981981
.value(CPN, androidCpn)
982982
.value(CONTENT_CHECK_OK, true)
983983
.value(RACY_CHECK_OK, true)
984+
// Workaround getting streaming URLs which can return 403 HTTP response
985+
// codes by using stories parameter for Android client requests
986+
// This behavior only happen in certain countries such as UK as of
987+
// 10.29.2022
988+
.value("params", "8AEB")
984989
.done())
985990
.getBytes(StandardCharsets.UTF_8);
986991

0 commit comments

Comments
 (0)