mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 03:03:01 +00:00
[theplaform] Fix FutureWarning
This commit is contained in:
parent
6a8422b942
commit
1dbd717eb4
1 changed files with 9 additions and 3 deletions
|
@ -129,7 +129,9 @@ def _real_extract(self, url):
|
||||||
head = meta.find(_x('smil:head'))
|
head = meta.find(_x('smil:head'))
|
||||||
body = meta.find(_x('smil:body'))
|
body = meta.find(_x('smil:body'))
|
||||||
|
|
||||||
f4m_node = body.find(_x('smil:seq//smil:video')) or body.find(_x('smil:seq/smil:video'))
|
f4m_node = body.find(_x('smil:seq//smil:video'))
|
||||||
|
if f4m_node is None:
|
||||||
|
f4m_node = body.find(_x('smil:seq/smil:video'))
|
||||||
if f4m_node is not None and '.f4m' in f4m_node.attrib['src']:
|
if f4m_node is not None and '.f4m' in f4m_node.attrib['src']:
|
||||||
f4m_url = f4m_node.attrib['src']
|
f4m_url = f4m_node.attrib['src']
|
||||||
if 'manifest.f4m?' not in f4m_url:
|
if 'manifest.f4m?' not in f4m_url:
|
||||||
|
@ -142,7 +144,9 @@ def _real_extract(self, url):
|
||||||
formats = []
|
formats = []
|
||||||
switch = body.find(_x('smil:switch'))
|
switch = body.find(_x('smil:switch'))
|
||||||
if switch is None:
|
if switch is None:
|
||||||
switch = body.find(_x('smil:par//smil:switch')) or body.find(_x('smil:par/smil:switch'))
|
switch = body.find(_x('smil:par//smil:switch'))
|
||||||
|
if switch is None:
|
||||||
|
switch = body.find(_x('smil:par/smil:switch'))
|
||||||
if switch is None:
|
if switch is None:
|
||||||
switch = body.find(_x('smil:par'))
|
switch = body.find(_x('smil:par'))
|
||||||
if switch is not None:
|
if switch is not None:
|
||||||
|
@ -163,7 +167,9 @@ def _real_extract(self, url):
|
||||||
'vbr': vbr,
|
'vbr': vbr,
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
switch = body.find(_x('smil:seq//smil:switch')) or body.find(_x('smil:seq/smil:switch'))
|
switch = body.find(_x('smil:seq//smil:switch'))
|
||||||
|
if switch is None:
|
||||||
|
switch = body.find(_x('smil:seq/smil:switch'))
|
||||||
for f in switch.findall(_x('smil:video')):
|
for f in switch.findall(_x('smil:video')):
|
||||||
attr = f.attrib
|
attr = f.attrib
|
||||||
vbr = int_or_none(attr.get('system-bitrate'), 1000)
|
vbr = int_or_none(attr.get('system-bitrate'), 1000)
|
||||||
|
|
Loading…
Reference in a new issue