From dae0247122f14760331997a346863fc7d3887928 Mon Sep 17 00:00:00 2001 From: Ben Bryant Date: Mon, 20 Apr 2020 10:00:45 -0700 Subject: [PATCH] Added check for robot detection on player page --- youtube_dl/extractor/funimation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/youtube_dl/extractor/funimation.py b/youtube_dl/extractor/funimation.py index 703cec8ec..7d4667315 100644 --- a/youtube_dl/extractor/funimation.py +++ b/youtube_dl/extractor/funimation.py @@ -162,6 +162,10 @@ class FunimationIE(InfoExtractor): text_tracks_json_string = self._search_regex( r'"textTracks": (\[{.+?}\])', player_page, 'player data', default='') + if not text_tracks_json_string: + # Funimation player page unavailable due to robot detection. + # Don't warn so that unit tests still pass this step. + return {} text_tracks = self._parse_json( text_tracks_json_string, display_id, js_to_json, fatal=False) or [] subtitles = {}