projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
136c8bd
)
[hostingbulk] Simplify
author
Sergey M․
<dstftw@gmail.com>
Wed, 10 Sep 2014 12:13:22 +0000
(19:13 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Wed, 10 Sep 2014 12:13:22 +0000
(19:13 +0700)
youtube_dl/extractor/hostingbulk.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/hostingbulk.py
b/youtube_dl/extractor/hostingbulk.py
index a07dd4962553dccf2a05cbf831ed87bd2c0a5bb6..8e812b66976e31e43ad594dbee6344c5e34629cf 100644
(file)
--- a/
youtube_dl/extractor/hostingbulk.py
+++ b/
youtube_dl/extractor/hostingbulk.py
@@
-57,17
+57,13
@@
class HostingBulkIE(InfoExtractor):
thumbnail = self._search_regex(
r'<img src="([^"]+)".+?class="pic"',
webpage, 'thumbnail', fatal=False)
thumbnail = self._search_regex(
r'<img src="([^"]+)".+?class="pic"',
webpage, 'thumbnail', fatal=False)
- rand = self._search_regex(
- r'<input.+?name="rand" value="([^"]+)">', webpage, 'rand')
- fields = {
- 'id': video_id,
- 'method_free': '',
- 'method_premium': '',
- 'op': 'download2',
- 'rand': rand,
- 'referer': '',
- }
+ fields = dict(re.findall(r'''(?x)<input\s+
+ type="hidden"\s+
+ name="([^"]+)"\s+
+ value="([^"]*)"
+ ''', webpage))
+
request = compat_urllib_request.Request(url, urlencode_postdata(fields))
request.add_header('Content-type', 'application/x-www-form-urlencoded')
response = self._request_webpage(request, video_id,
request = compat_urllib_request.Request(url, urlencode_postdata(fields))
request.add_header('Content-type', 'application/x-www-form-urlencoded')
response = self._request_webpage(request, video_id,