From 46e28a84caae4820c7352232b048ecb3cbcd4012 Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Fri, 4 Oct 2013 11:53:49 +0200 Subject: [PATCH] [brightcove] Fix up some broken HTML (#1553) --- youtube_dl/extractor/brightcove.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/youtube_dl/extractor/brightcove.py b/youtube_dl/extractor/brightcove.py index 558b3d009..745212f2f 100644 --- a/youtube_dl/extractor/brightcove.py +++ b/youtube_dl/extractor/brightcove.py @@ -49,6 +49,11 @@ def _build_brighcove_url(cls, object_str): Build a Brightcove url from a xml string containing {params} """ + + # Fix up some stupid HTML, see https://github.com/rg3/youtube-dl/issues/1553 + object_str = re.sub(r'(', + 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'],