youtube-dl

Another place where youtube-dl lives on
git clone git://git.oshgnacknak.de/youtube-dl.git
Log | Files | Refs | README | LICENSE

commit fffccaaf414800e24a5ebc9e90c324aaa37cd3a9
parent cdc8d0c37325e83da0c08ee4d97d81040e10be91
Author: Sergey M․ <dstftw@gmail.com>
Date:   Tue,  1 Sep 2015 20:41:52 +0600

[globo] Fix extraction and make more robust (Closes #6728)

Diffstat:
Myoutube_dl/extractor/globo.py | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git 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, + int_or_none, ) @@ -359,13 +360,8 @@ class GloboIE(InfoExtractor): 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 = [] - 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) + 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,