Add check for subtitles in restricted videos

pull/41/head
Coffeemakr 2017-11-25 03:45:03 +01:00
rodzic 239df49df3
commit d76c8e1773
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 3F35676D8FF6E743
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -411,6 +411,10 @@ public class YoutubeStreamExtractor extends StreamExtractor {
@Override
@Nullable
public List<Subtitles> 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");