1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-03-09 12:50:23 -05:00

[tvw] Get rid of brackets while accessing dicts

This commit is contained in:
Fries 2025-02-04 11:11:07 -08:00
parent 9ce3313bbe
commit e4c60ade83

View file

@ -100,9 +100,9 @@ def _real_extract(self, url):
except ExtractorError as e:
if isinstance(e.cause, HTTPError):
self.write_debug(e.cause)
response = self._parse_json(e.cause.response.read().decode(), video_id)['errors']
if response['hasError'] is True:
raise ExtractorError('{} said: {}'.format(self.IE_NAME, response['error']), expected=True)
response = self._parse_json(e.cause.response.read().decode(), video_id).get('errors')
if response.get('hasError') is True:
raise ExtractorError('{} said: {}'.format(self.IE_NAME, response.get('error')), expected=True)
raise
stream_url = traverse_obj(response, ('streamingURIs', 'main'))