projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c0bf5e1
)
[extractor/common] Add method for extracting form hidden input fields as dict
author
Sergey M․
<dstftw@gmail.com>
Fri, 10 Jul 2015 15:49:09 +0000
(21:49 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Fri, 10 Jul 2015 15:49:09 +0000
(21:49 +0600)
youtube_dl/extractor/common.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/common.py
b/youtube_dl/extractor/common.py
index d859aea5285f331c43e44b95b41a12aee0f41f87..82f5de2d898c4238839b8ada7c43aea6b166fd5f 100644
(file)
--- 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')