[youtube] don't crash in verbose mode if 'ad3_module' is not defined in age protected...
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 2 Aug 2013 12:17:01 +0000 (14:17 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 2 Aug 2013 12:17:01 +0000 (14:17 +0200)
youtube_dl/extractor/youtube.py

index bc89a14ffc0977eb51e48e8a2ea37a1ec8b33466..4d3bce879f7ff20029bd3fe6ceea55f284471d80 100644 (file)
@@ -718,8 +718,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                             s = url_data['s'][0]
                             if age_gate:
                                 player_version = self._search_regex(r'ad3-(.+?)\.swf',
-                                    video_info['ad3_module'][0], 'flash player',
-                                    fatal=False)
+                                    video_info['ad3_module'][0] if 'ad3_module' in video_info else 'NOT FOUND',
+                                    'flash player', fatal=False)
                                 player = 'flash player %s' % player_version
                             else:
                                 player = u'html5 player %s' % self._search_regex(r'html5player-(.+?)\.js', video_webpage,