]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[theplatform] Allow <par> without <swtich> at all
authorSergey M․ <dstftw@gmail.com>
Wed, 8 Apr 2015 15:03:11 +0000 (21:03 +0600)
committerSergey M․ <dstftw@gmail.com>
Wed, 8 Apr 2015 15:03:11 +0000 (21:03 +0600)
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.

youtube_dl/extractor/theplatform.py

index bcddd23e4b85d3e0f33bb5b8267e4c616c8a0296..2d2178331ec396b937ee1115d4e22aee1844b8fb 100644 (file)
@@ -142,6 +142,8 @@ class ThePlatformIE(InfoExtractor):
             switch = body.find(_x('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:
                 base_url = head.find(_x('smil:meta')).attrib['base']
                 for f in switch.findall(_x('smil:video')):