prevent error if no captions found
Browse files- pytube/__main__.py +2 -0
pytube/__main__.py
CHANGED
@@ -163,6 +163,8 @@ class YouTube(object):
|
|
163 |
self.fmt_streams.append(video)
|
164 |
|
165 |
def initialize_caption_objects(self):
|
|
|
|
|
166 |
caption_tracks = (
|
167 |
self.player_config['args']
|
168 |
['player_response']
|
|
|
163 |
self.fmt_streams.append(video)
|
164 |
|
165 |
def initialize_caption_objects(self):
|
166 |
+
if 'captions' not in self.player_config['args']['player_response']:
|
167 |
+
return
|
168 |
caption_tracks = (
|
169 |
self.player_config['args']
|
170 |
['player_response']
|