mirror of
https://github.com/blackjack4494/yt-dlc.git
synced 2024-12-23 00:07:49 +00:00
[gfycat] Catch errors
This commit is contained in:
parent
d7b4d5dd50
commit
267dc07e6b
1 changed files with 5 additions and 1 deletions
|
@ -6,6 +6,7 @@ from ..utils import (
|
||||||
int_or_none,
|
int_or_none,
|
||||||
float_or_none,
|
float_or_none,
|
||||||
qualities,
|
qualities,
|
||||||
|
ExtractorError,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,7 +51,10 @@ class GfycatIE(InfoExtractor):
|
||||||
|
|
||||||
gfy = self._download_json(
|
gfy = self._download_json(
|
||||||
'http://gfycat.com/cajax/get/%s' % video_id,
|
'http://gfycat.com/cajax/get/%s' % video_id,
|
||||||
video_id, 'Downloading video info')['gfyItem']
|
video_id, 'Downloading video info')
|
||||||
|
if 'error' in gfy:
|
||||||
|
raise ExtractorError('Gfycat said: ' + gfy['error'], expected=True)
|
||||||
|
gfy = gfy['gfyItem']
|
||||||
|
|
||||||
title = gfy.get('title') or gfy['gfyName']
|
title = gfy.get('title') or gfy['gfyName']
|
||||||
description = gfy.get('description')
|
description = gfy.get('description')
|
||||||
|
|
Loading…
Reference in a new issue