[YouTube] Make detection of age restricted pages more reliable

This commit is contained in:
Mauricio Colli 2019-10-29 02:00:28 -03:00
parent 91c360df5e
commit 9a325b280d
No known key found for this signature in database
GPG Key ID: F200BFD6F29DDD85
1 changed files with 1 additions and 2 deletions

View File

@ -626,8 +626,7 @@ public class YoutubeStreamExtractor extends StreamExtractor {
final String playerUrl;
// Check if the video is age restricted
if (pageContent.contains("<meta property=\"og:restrictions:age")) {
// do this if it is age gated
if (!doc.select("meta[property=\"og:restrictions:age\"").isEmpty()) {
final EmbeddedInfo info = getEmbeddedInfo();
final String videoInfoUrl = getVideoInfoUrl(getId(), info.sts);
final String infoPageResponse = downloader.download(videoInfoUrl);