diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-07-10 21:49:09 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-07-10 21:49:09 +0600 |
commit | 27713812a093ddfb329cd9cead878f3d0bf629cf (patch) | |
tree | 6bd4d27d0a1be7fb708eee1ebe45f963f480958c /youtube_dl/extractor/common.py | |
parent | c0bf5e1c4dc0a236402c946b0b1fd358f9e39a74 (diff) |
[extractor/common] Add method for extracting form hidden input fields as dict
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r-- | youtube_dl/extractor/common.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index d859aea52..82f5de2d8 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -705,6 +705,12 @@ class InfoExtractor(object): return self._html_search_meta('twitter:player', html, 'twitter card player') + @staticmethod + def _form_hidden_inputs(html): + return dict(re.findall( + r'<input\s+type="hidden"\s+name="([^"]+)"\s+(?:id="[^"]+"\s+)?value="([^"]*)"', + html)) + def _sort_formats(self, formats, field_preference=None): if not formats: raise ExtractorError('No video formats found') |