ソースを参照

[theplatform] Allow <par> without <swtich> at all

Bare `wget` on http://link.theplatform.com/s/kYEXFC/22d_qsQ6MIRTl results in an XML without <switch> at all
but with <par> and <video> inside it. Let's handle this possible outcome as well.
Sergey M․ 10 年 前
コミット
aef8fdba11
1 ファイル変更2 行追加0 行削除
  1. 2 0
      youtube_dl/extractor/theplatform.py

+ 2 - 0
youtube_dl/extractor/theplatform.py

@@ -142,6 +142,8 @@ class ThePlatformIE(InfoExtractor):
             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'))
+            if switch is None:
+                switch = body.find(_x('smil:par'))
             if switch is not None:
             if switch is not None:
                 base_url = head.find(_x('smil:meta')).attrib['base']
                 base_url = head.find(_x('smil:meta')).attrib['base']
                 for f in switch.findall(_x('smil:video')):
                 for f in switch.findall(_x('smil:video')):