]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
GenericIE: detect more Brightcove videos
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Wed, 10 Jul 2013 22:25:38 +0000 (00:25 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Wed, 10 Jul 2013 22:25:38 +0000 (00:25 +0200)
In some sites "class" contains more that BrightcoveExperience

youtube_dl/extractor/brightcove.py
youtube_dl/extractor/generic.py

index 125c8a6672ca96b67c5ce7cc829f157c848fc2ac..68ee5292b61157b5bccbd78619a3da758fdf93dc 100644 (file)
@@ -22,7 +22,7 @@ class BrightcoveIE(InfoExtractor):
         <object class="BrightcoveExperience">{params}</object>
         """
         object_doc = xml.etree.ElementTree.fromstring(object_str)
-        assert object_doc.attrib['class'] == u'BrightcoveExperience'
+        assert u'BrightcoveExperience' in object_doc.attrib['class']
         params = {'flashID': object_doc.attrib['id'],
                   'playerID': object_doc.find('./param[@name="playerID"]').attrib['value'],
                   }
index be9d29a6362f3bd51299507dc1c21a79a90abe94..33790741f8184a9d5e8002f0c7afc1ea20c2a986 100644 (file)
@@ -120,7 +120,7 @@ class GenericIE(InfoExtractor):
 
         self.report_extraction(video_id)
         # Look for BrigthCove:
-        m_brightcove = re.search(r'<object.+?class="BrightcoveExperience".+?</object>', webpage, re.DOTALL)
+        m_brightcove = re.search(r'<object.+?class=".*?BrightcoveExperience.*?".+?</object>', webpage, re.DOTALL)
         if m_brightcove is not None:
             self.to_screen(u'Brightcove video detected.')
             bc_url = BrightcoveIE._build_brighcove_url(m_brightcove.group())