[exception] improve AuthRequired messages
This commit is contained in:
@@ -200,7 +200,7 @@ class CivitaiExtractor(Extractor):
|
||||
if "Authorization" not in self.api.headers and \
|
||||
not self.cookies.get(
|
||||
"__Secure-civitai-token", domain=".civitai.com"):
|
||||
raise exception.AuthRequired(("'api-key'", "cookies"))
|
||||
raise exception.AuthRequired(("api-key", "authenticated cookies"))
|
||||
|
||||
def _parse_query(self, value):
|
||||
return text.parse_query_list(
|
||||
|
||||
@@ -318,7 +318,9 @@ class FacebookExtractor(Extractor):
|
||||
|
||||
if ('"props":{"title":"This content isn\'t available right now"' in
|
||||
profile_photos_page):
|
||||
raise exception.AuthRequired("cookies")
|
||||
raise exception.AuthRequired(
|
||||
"authenticated cookies", "profile",
|
||||
"This content isn't available right now")
|
||||
|
||||
set_id = self._extract_profile_set_id(profile_photos_page)
|
||||
avatar_page_url = text.extr(
|
||||
|
||||
@@ -341,7 +341,8 @@ class IwaraAPI():
|
||||
|
||||
def favorites(self, type):
|
||||
if not self.username:
|
||||
raise exception.AuthRequired("'username' & 'password'")
|
||||
raise exception.AuthRequired(
|
||||
"username & password", "your favorites")
|
||||
endpoint = f"/favorites/{type}s"
|
||||
return self._pagination(endpoint)
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class MadokamiMangaExtractor(MadokamiExtractor):
|
||||
def items(self):
|
||||
username, password = self._get_auth_info()
|
||||
if not username:
|
||||
raise exception.AuthRequired("'username' & 'password'")
|
||||
raise exception.AuthRequired("username & password")
|
||||
self.session.auth = util.HTTPBasicAuth(username, password)
|
||||
|
||||
url = f"{self.root}/Manga/{self.groups[0]}"
|
||||
|
||||
Reference in New Issue
Block a user