diff --git a/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java b/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java index 0f93508e2..416881a62 100644 --- a/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java +++ b/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractor.java @@ -411,6 +411,10 @@ public class YoutubeStreamExtractor extends StreamExtractor { @Override @Nullable public List getSubtitles(SubtitlesFormat format) throws IOException, ExtractionException { + if(isAgeRestricted) { + // If the video is age restricted getPlayerConfig will fail + return null; + } JsonObject playerConfig = getPlayerConfig(getPageHtml()); String playerResponse = playerConfig.getObject("args").getString("player_response");