[shared] Use `_form_hidden_inputs`
authorSergey M․ <dstftw@gmail.com>
Fri, 10 Jul 2015 15:55:22 +0000 (21:55 +0600)
committerSergey M․ <dstftw@gmail.com>
Fri, 10 Jul 2015 15:55:22 +0000 (21:55 +0600)
youtube_dl/extractor/shared.py

index 9f3e944e73532a92c5213ce95e7633fe6bc4c212..7fb68bc2d8eb3fb83bbc62fce981c3dbb3fd0ff8 100644 (file)
@@ -35,8 +35,7 @@ class SharedIE(InfoExtractor):
             raise ExtractorError(
                 'Video %s does not exist' % video_id, expected=True)
 
-        download_form = dict(re.findall(
-            r'<input type="hidden" name="([^"]+)" value="([^"]*)"', webpage))
+        download_form = self._form_hidden_inputs(webpage)
         request = compat_urllib_request.Request(
             url, compat_urllib_parse.urlencode(download_form))
         request.add_header('Content-Type', 'application/x-www-form-urlencoded')