mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-12-23 06:57:54 +01:00
[theplatform] Fix for python 2.6
At least single depth level extraction...
This commit is contained in:
parent
dd29eb7f81
commit
372f08c990
@ -42,8 +42,8 @@ class ThePlatformIE(InfoExtractor):
|
|||||||
# rtmp download
|
# rtmp download
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
# from http://www.cnet.com/videos/tesla-model-s-a-second-step-towards-a-cleaner-motoring-future/
|
|
||||||
}, {
|
}, {
|
||||||
|
# from http://www.cnet.com/videos/tesla-model-s-a-second-step-towards-a-cleaner-motoring-future/
|
||||||
'url': 'http://link.theplatform.com/s/kYEXFC/22d_qsQ6MIRT',
|
'url': 'http://link.theplatform.com/s/kYEXFC/22d_qsQ6MIRT',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '22d_qsQ6MIRT',
|
'id': '22d_qsQ6MIRT',
|
||||||
@ -128,7 +128,7 @@ class ThePlatformIE(InfoExtractor):
|
|||||||
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'))
|
f4m_node = body.find(_x('smil:seq//smil:video')) or 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:
|
||||||
@ -141,7 +141,7 @@ class ThePlatformIE(InfoExtractor):
|
|||||||
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'))
|
switch = body.find(_x('smil:par//smil:switch')) or 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:
|
||||||
@ -162,7 +162,7 @@ class ThePlatformIE(InfoExtractor):
|
|||||||
'vbr': vbr,
|
'vbr': vbr,
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
switch = body.find(_x('smil:seq//smil:switch'))
|
switch = body.find(_x('smil:seq//smil:switch')) or 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(attr['system-bitrate']) // 1000
|
vbr = int(attr['system-bitrate']) // 1000
|
||||||
|
Loading…
Reference in New Issue
Block a user