mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-23 02:32:16 +00:00
[globo] Fix extraction and make more robust (Closes #6728)
This commit is contained in:
parent
cdc8d0c373
commit
fffccaaf41
1 changed files with 6 additions and 5 deletions
|
@ -13,6 +13,7 @@ from ..compat import (
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
float_or_none,
|
float_or_none,
|
||||||
|
int_or_none,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -359,13 +360,8 @@ class GloboIE(InfoExtractor):
|
||||||
self._API_URL_TEMPLATE % video_id, video_id)['videos'][0]
|
self._API_URL_TEMPLATE % video_id, video_id)['videos'][0]
|
||||||
|
|
||||||
title = video['title']
|
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']:
|
for resource in video['resources']:
|
||||||
resource_id = resource.get('_id')
|
resource_id = resource.get('_id')
|
||||||
if not resource_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 {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
|
|
Loading…
Reference in a new issue