mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-23 06:42:21 +00:00
convention fix, simplified login request
This commit is contained in:
parent
271426aa58
commit
35f987487b
@ -1,21 +1,21 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import json
|
||||||
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
clean_html,
|
clean_html,
|
||||||
determine_ext,
|
determine_ext,
|
||||||
|
ExtractorError,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
KNOWN_EXTENSIONS,
|
KNOWN_EXTENSIONS,
|
||||||
mimetype2ext,
|
mimetype2ext,
|
||||||
parse_iso8601,
|
parse_iso8601,
|
||||||
str_or_none,
|
str_or_none,
|
||||||
try_get,
|
try_get,
|
||||||
sanitized_Request,
|
|
||||||
ExtractorError,
|
|
||||||
)
|
)
|
||||||
import json
|
|
||||||
import re
|
|
||||||
|
|
||||||
|
|
||||||
class PatreonIE(InfoExtractor):
|
class PatreonIE(InfoExtractor):
|
||||||
@ -91,11 +91,11 @@ class PatreonIE(InfoExtractor):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
request = sanitized_Request(
|
login_page = self._download_webpage(
|
||||||
'https://www.patreon.com/api/login?include=campaign,user_location&json-api-version=1.0',
|
'https://www.patreon.com/api/login',
|
||||||
json.dumps(login_form).encode('ascii')
|
video_id=None,
|
||||||
)
|
note='Logging in',
|
||||||
login_page = self._download_webpage(request, None, note='Logging in')
|
data=json.dumps(login_form).encode('ascii'))
|
||||||
|
|
||||||
if re.search(r'onLoginFailed', login_page):
|
if re.search(r'onLoginFailed', login_page):
|
||||||
raise ExtractorError('Unable to login, incorrect username and/or password', expected=True)
|
raise ExtractorError('Unable to login, incorrect username and/or password', expected=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user