Skip to content

Commit cfa9854

Browse files
committed
[YouTube] Fix page reload required error on streams
Playability status for the WEB client isn't checked anymore, as it requires a valid signatureTimestamp from JavaScript player to avoid a page reload error. Until we can get and use n parameter function decoding for streaming URLs of HTML5 clients again and support SABR streams, it doesn't really make sense to fetch a huge JavaScript player just to get metadata. Age-restricted content which can be watched with the embedded player is also broken due to extraction failure and non-ability to run the n parameter function, so fetching this embedded player has been also removed and all age-restricted content will throw an AgeRestrictedContentException. Playability error status checks have been adapted, as mobile clients get different error responses than the WEB client. Some strings have been extracted into constants and a fallback for unlisted privacy check has been added, in YoutubeStreamExtractor for both points.
1 parent b1175a4 commit cfa9854

2 files changed

Lines changed: 139 additions & 214 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static JsonObject getWebMetadataPlayerResponse(
7272
.getBytes(StandardCharsets.UTF_8);
7373

7474
final String url = YOUTUBEI_V1_URL + PLAYER + "?" + DISABLE_PRETTY_PRINT_PARAMETER
75-
+ "&$fields=microformat,playabilityStatus,storyboards,videoDetails";
75+
+ "&$fields=microformat,videoDetails.thumbnail.thumbnails,videoDetails.videoId";
7676

7777
return JsonUtils.toJsonObject(getValidJsonResponseBody(
7878
getDownloader().postWithContentTypeJson(

0 commit comments

Comments
 (0)