0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-23 02:25:11 +00:00

[kusi] Two fixes

Thanks @dstftw for pointing out those
This commit is contained in:
Yen Chi Hsuan 2016-03-04 23:57:05 +08:00
parent ae7d31af1c
commit fa880d20ad

View file

@ -68,13 +68,11 @@ def _real_extract(self, url):
doc = self._download_xml(xml_url, video_id) doc = self._download_xml(xml_url, video_id)
video_title = xpath_text(doc, 'HEADLINE') video_title = xpath_text(doc, 'HEADLINE', fatal=True)
duration = float_or_none( duration = float_or_none(xpath_text(doc, 'DURATION'), scale=1000)
xpath_text(doc, 'DURATION', fatal=False), scale=1000) description = xpath_text(doc, 'ABSTRACT')
description = xpath_text(doc, 'ABSTRACT', fatal=False) thumbnail = xpath_text(doc, './THUMBNAILIMAGE/FILENAME')
thumbnail = xpath_text(doc, './THUMBNAILIMAGE/FILENAME', fatal=False) createtion_time = timeconvert(xpath_text(doc, 'rfc822creationdate'))
createtion_time = timeconvert(
xpath_text(doc, 'rfc822creationdate', fatal=False))
quality_options = doc.find('{http://search.yahoo.com/mrss/}group').findall('{http://search.yahoo.com/mrss/}content') quality_options = doc.find('{http://search.yahoo.com/mrss/}group').findall('{http://search.yahoo.com/mrss/}content')
formats = [] formats = []
@ -83,7 +81,7 @@ def _real_extract(self, url):
'url': compat_urllib_parse_unquote_plus(quality.attrib['url']), 'url': compat_urllib_parse_unquote_plus(quality.attrib['url']),
'height': int_or_none(quality.attrib.get('height')), 'height': int_or_none(quality.attrib.get('height')),
'width': int_or_none(quality.attrib.get('width')), 'width': int_or_none(quality.attrib.get('width')),
'vbr': float_or_none(quality.attrib.get('bitratebits'), scale=1024), 'vbr': float_or_none(quality.attrib.get('bitratebits'), scale=1000),
}) })
self._sort_formats(formats) self._sort_formats(formats)