compat_str,
compat_urllib_parse,
ExtractorError,
- int_or_none,
+ float_or_none,
unified_strdate,
)
thumbnail = itemEl.find('.//{http://search.yahoo.com/mrss/}thumbnail').attrib.get('url')
content = itemEl.find('.//{http://search.yahoo.com/mrss/}content')
- duration = int_or_none(content.attrib.get('duration'))
+ duration = float_or_none(content.attrib.get('duration'))
mediagen_url = content.attrib['url']
guid = itemEl.find('.//guid').text.rpartition(':')[-1]
return v if v is None else (int(v) // scale)
+def float_or_none(v, scale=1):
+ return v if v is None else (float(v) / scale)
+
+
def parse_duration(s):
if s is None:
return None