[extractor/common] Case insensitive inputs extraction
authorSergey M․ <dstftw@gmail.com>
Fri, 11 Sep 2015 14:43:05 +0000 (20:43 +0600)
committerSergey M․ <dstftw@gmail.com>
Fri, 11 Sep 2015 14:43:05 +0000 (20:43 +0600)
youtube_dl/extractor/common.py

index 5eeeda08d3b2cda957106d2ee512eeee3ed55e02..835f6f368c68303c46ef399bd185b9aa8e88da2c 100644 (file)
@@ -732,7 +732,7 @@ class InfoExtractor(object):
     @staticmethod
     def _hidden_inputs(html):
         hidden_inputs = {}
-        for input in re.findall(r'<input([^>]+)>', html):
+        for input in re.findall(r'(?i)<input([^>]+)>', html):
             if not re.search(r'type=(["\'])(?:hidden|submit)\1', input):
                 continue
             name = re.search(r'name=(["\'])(?P<value>.+?)\1', input)
@@ -746,7 +746,7 @@ class InfoExtractor(object):
 
     def _form_hidden_inputs(self, form_id, html):
         form = self._search_regex(
-            r'(?s)<form[^>]+?id=(["\'])%s\1[^>]*>(?P<form>.+?)</form>' % form_id,
+            r'(?is)<form[^>]+?id=(["\'])%s\1[^>]*>(?P<form>.+?)</form>' % form_id,
             html, '%s form' % form_id, group='form')
         return self._hidden_inputs(form)