[brightcove] Fix up some broken HTML (#1553)
authorPhilipp Hagemeister <phihag@phihag.de>
Fri, 4 Oct 2013 09:53:49 +0000 (11:53 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Fri, 4 Oct 2013 09:53:49 +0000 (11:53 +0200)
youtube_dl/extractor/brightcove.py

index 558b3d0093975eff273d38a7a2bad9f1d4e36355..745212f2fe731bf305e56e8087089c65efabbd68 100644 (file)
@@ -49,6 +49,11 @@ class BrightcoveIE(InfoExtractor):
         Build a Brightcove url from a xml string containing
         <object class="BrightcoveExperience">{params}</object>
         """
+
+        # Fix up some stupid HTML, see https://github.com/rg3/youtube-dl/issues/1553
+        object_str = re.sub(r'(<param name="[^"]+" value="[^"]+")>',
+                            lambda m: m.group(1) + '/>', object_str)
+
         object_doc = xml.etree.ElementTree.fromstring(object_str)
         assert u'BrightcoveExperience' in object_doc.attrib['class']
         params = {'flashID': object_doc.attrib['id'],