Skip to content

Commit 9a325b2

Browse files
committed
[YouTube] Make detection of age restricted pages more reliable
1 parent 91c360d commit 9a325b2

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,8 +626,7 @@ public void onFetchPage(@Nonnull Downloader downloader) throws IOException, Extr
626626

627627
final String playerUrl;
628628
// Check if the video is age restricted
629-
if (pageContent.contains("<meta property=\"og:restrictions:age")) {
630-
// do this if it is age gated
629+
if (!doc.select("meta[property=\"og:restrictions:age\"").isEmpty()) {
631630
final EmbeddedInfo info = getEmbeddedInfo();
632631
final String videoInfoUrl = getVideoInfoUrl(getId(), info.sts);
633632
final String infoPageResponse = downloader.download(videoInfoUrl);

0 commit comments

Comments
 (0)