mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-26 12:42:29 +01:00
[newgrounds] access 'response.text' only once
This commit is contained in:
parent
9576652fa5
commit
a16d7c59cb
@ -87,16 +87,15 @@ class NewgroundsExtractor(Extractor):
|
||||
if response.history and response.url.endswith("/social"):
|
||||
return self.session.cookies
|
||||
|
||||
page = response.text
|
||||
headers = {"Origin": self.root, "Referer": url}
|
||||
url = text.urljoin(self.root, text.extr(
|
||||
response.text, 'action="', '"'))
|
||||
auth_token = text.extr(response.text, 'name="auth" value="', '"')
|
||||
url = text.urljoin(self.root, text.extr(page, 'action="', '"'))
|
||||
data = {
|
||||
"username": username,
|
||||
"password": password,
|
||||
"remember": "1",
|
||||
"login" : "1",
|
||||
"auth" : auth_token
|
||||
"auth" : text.extr(page, 'name="auth" value="', '"'),
|
||||
}
|
||||
|
||||
response = self.request(url, method="POST", headers=headers, data=data)
|
||||
|
Loading…
Reference in New Issue
Block a user