Skip to content

Commit

Permalink
Merge pull request #1 from Nekmo/atresplayer-fix-500
Browse files Browse the repository at this point in the history
Fix error 500
  • Loading branch information
Nekmo authored Feb 17, 2018
2 parents 38662df + 39ed09b commit 867811c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions youtube_dl/extractor/atresplayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,16 @@ def _real_extract(self, url):
self._URL_VIDEO_TEMPLATE.format('windows', episode_id, timestamp_shifted, token),
headers={'User-Agent': self._USER_AGENT})

fmt_json = self._download_json(
request, video_id, 'Downloading windows video JSON')
try:
fmt_json = self._download_json(
request, video_id, 'Downloading windows video JSON')
except ExtractorError as e:
fmt_json = {'resultObject': {}}
else:
result = fmt_json.get('resultDes')
if result.lower() != 'ok':
raise ExtractorError(
'%s returned error: %s' % (self.IE_NAME, result), expected=True)

result = fmt_json.get('resultDes')
if result.lower() != 'ok':
Expand Down

0 comments on commit 867811c

Please sign in to comment.