projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[Makefile] Excluding __pycache__ correctly (#13400)
[youtube-dl]
/
youtube_dl
/
extractor
/
gfycat.py
diff --git
a/youtube_dl/extractor/gfycat.py
b/youtube_dl/extractor/gfycat.py
index 048ee31e28bec1970db3dc7784a5f30674dd054b..45ccc11c10a18033c5d53d0416903425a6ef2385 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,
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,
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')
title = gfy.get('title') or gfy['gfyName']
description = gfy.get('description')
@@
-78,7
+82,7
@@
class GfycatIE(InfoExtractor):
video_url = gfy.get('%sUrl' % format_id)
if not video_url:
continue
video_url = gfy.get('%sUrl' % format_id)
if not video_url:
continue
- filesize =
gfy.get('%sSize' % format_id
)
+ filesize =
int_or_none(gfy.get('%sSize' % format_id)
)
formats.append({
'url': video_url,
'format_id': format_id,
formats.append({
'url': video_url,
'format_id': format_id,