projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cdc8d0c
)
[globo] Fix extraction and make more robust (Closes #6728)
author
Sergey M․
<dstftw@gmail.com>
Tue, 1 Sep 2015 14:41:52 +0000
(20:41 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Tue, 1 Sep 2015 14:41:52 +0000
(20:41 +0600)
youtube_dl/extractor/globo.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/globo.py
b/youtube_dl/extractor/globo.py
index 8a95793cae07734e67340bf49db088cdb043d1cb..33d6432a6f29942d2bf7e53e6cf9adf353d79b25 100644
(file)
--- a/
youtube_dl/extractor/globo.py
+++ b/
youtube_dl/extractor/globo.py
@@
-13,6
+13,7
@@
from ..compat import (
from ..utils import (
ExtractorError,
float_or_none,
from ..utils import (
ExtractorError,
float_or_none,
+ int_or_none,
)
)
@@
-359,13
+360,8
@@
class GloboIE(InfoExtractor):
self._API_URL_TEMPLATE % video_id, video_id)['videos'][0]
title = video['title']
self._API_URL_TEMPLATE % video_id, video_id)['videos'][0]
title = video['title']
- duration = float_or_none(video['duration'], 1000)
- like_count = video['likes']
- uploader = video['channel']
- uploader_id = video['channel_id']
formats = []
formats = []
-
for resource in video['resources']:
resource_id = resource.get('_id')
if not resource_id:
for resource in video['resources']:
resource_id = resource.get('_id')
if not resource_id:
@@
-407,6
+403,11
@@
class GloboIE(InfoExtractor):
self._sort_formats(formats)
self._sort_formats(formats)
+ duration = float_or_none(video.get('duration'), 1000)
+ like_count = int_or_none(video.get('likes'))
+ uploader = video.get('channel')
+ uploader_id = video.get('channel_id')
+
return {
'id': video_id,
'title': title,
return {
'id': video_id,
'title': title,