projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d7b4d5d
)
[gfycat] Catch errors
author
Yen Chi Hsuan
<yan12125@gmail.com>
Tue, 7 Jul 2015 06:22:13 +0000
(14:22 +0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Tue, 7 Jul 2015 06:22:13 +0000
(14:22 +0800)
youtube_dl/extractor/gfycat.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/gfycat.py
b/youtube_dl/extractor/gfycat.py
index 048ee31e28bec1970db3dc7784a5f30674dd054b..884700c52b90b53fdc8f581378d28611d7c36f33 100644
(file)
--- a/
youtube_dl/extractor/gfycat.py
+++ b/
youtube_dl/extractor/gfycat.py
@@
-6,6
+6,7
@@
from ..utils import (
int_or_none,
float_or_none,
qualities,
+ ExtractorError,
)
@@
-50,7
+51,10
@@
class GfycatIE(InfoExtractor):
gfy = self._download_json(
'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']
description = gfy.get('description')