Skip to content

Commit ed48df2

Browse files
committed
[YouTube] Address review comments
1 parent 17d6e5c commit ed48df2

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,6 @@ private YoutubeParsingHelper() {
177177
private static final Pattern C_WEB_PATTERN = Pattern.compile("&c=WEB");
178178
private static final Pattern C_WEB_EMBEDDED_PLAYER_PATTERN =
179179
Pattern.compile("&c=WEB_EMBEDDED_PLAYER");
180-
private static final Pattern C_TVHTML5_PLAYER_PATTERN =
181-
Pattern.compile("&c=TVHTML5");
182180
private static final Pattern C_ANDROID_PATTERN = Pattern.compile("&c=ANDROID");
183181
private static final Pattern C_IOS_PATTERN = Pattern.compile("&c=IOS");
184182

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,10 @@ private void fetchWebClientMetadataAndSetThumbnails(
998998
final JsonObject webPlayerResponse = YoutubeStreamHelper.getWebMetadataPlayerResponse(
999999
localization, contentCountry, videoId);
10001000

1001+
// Important note: we don't checkPlayabilityStatus() here, because we use this request
1002+
// exclusively for metadata, not for extracting streams. It turns out that when
1003+
// YouTube returns a playability status error, the metadata may still be there.
1004+
10011005
if (!isPlayerResponseNotValid(webPlayerResponse, videoId)) {
10021006
// The microformat JSON object of the content is only returned on the WEB client,
10031007
// so we need to store it instead of getting it directly from the playerResponse

0 commit comments

Comments
 (0)