aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl/extractor/theplatform.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-05-01 02:51:55 +0600
committerSergey M․ <dstftw@gmail.com>2015-05-01 02:51:55 +0600
commit1dbd717eb49d075fa1efabc674e8074fd165eb0a (patch)
tree195095fdef0f2003af4cd34a1227ee2aa5c12b19 /youtube_dl/extractor/theplatform.py
parent6a8422b942f5140238106c43e27d869d70126446 (diff)
downloadyoutube-dl-1dbd717eb49d075fa1efabc674e8074fd165eb0a.zip
youtube-dl-1dbd717eb49d075fa1efabc674e8074fd165eb0a.tar.gz
youtube-dl-1dbd717eb49d075fa1efabc674e8074fd165eb0a.tar.bz2
[theplaform] Fix FutureWarning
Diffstat (limited to 'youtube_dl/extractor/theplatform.py')
-rw-r--r--youtube_dl/extractor/theplatform.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/youtube_dl/extractor/theplatform.py b/youtube_dl/extractor/theplatform.py
index 6a006b2..92731ad 100644
--- a/youtube_dl/extractor/theplatform.py
+++ b/youtube_dl/extractor/theplatform.py
@@ -129,7 +129,9 @@ class ThePlatformIE(InfoExtractor):
head = meta.find(_x('smil:head'))
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']:
f4m_url = f4m_node.attrib['src']
if 'manifest.f4m?' not in f4m_url:
@@ -142,7 +144,9 @@ class ThePlatformIE(InfoExtractor):
formats = []
switch = body.find(_x('smil:switch'))
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:
switch = body.find(_x('smil:par'))
if switch is not None:
@@ -163,7 +167,9 @@ class ThePlatformIE(InfoExtractor):
'vbr': vbr,
})
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')):
attr = f.attrib
vbr = int_or_none(attr.get('system-bitrate'), 1000)