[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).
This commit is contained in:
AudricV 2022-10-29 13:15:03 +02:00
parent 4bc90cd9d8
commit 60e97cd274
No known key found for this signature in database
GPG Key ID: DA92EC7905614198
1 changed files with 5 additions and 0 deletions

View File

@ -981,6 +981,11 @@ public class YoutubeStreamExtractor extends StreamExtractor {
.value(CPN, androidCpn)
.value(CONTENT_CHECK_OK, true)
.value(RACY_CHECK_OK, true)
// Workaround getting streaming URLs which can return 403 HTTP response
// codes by using stories parameter for Android client requests
// This behavior only happen in certain countries such as UK as of
// 10.29.2022
.value("params", "8AEB")
.done())
.getBytes(StandardCharsets.UTF_8);