[nijie] move 'username required' out of _login_impl

This commit is contained in:
Mike Fährmann
2023-12-18 23:45:58 +01:00
parent 57fc6fcf83
commit a30a3e44d5

View File

@@ -124,15 +124,15 @@ class NijieExtractor(AsynchronousMixin, BaseExtractor):
return
username, password = self._get_auth_info()
self.cookies_update(self._login_impl(username, password))
if username:
return self.cookies_update(self._login_impl(username, password))
raise exception.AuthenticationError("Username and password required")
@cache(maxage=90*86400, keyarg=1)
def _login_impl(self, username, password):
if not username or not password:
raise exception.AuthenticationError(
"Username and password required")
self.log.info("Logging in as %s", username)
url = "{}/login_int.php".format(self.root)
data = {"email": username, "password": password, "save": "on"}