raise error when required username or password are missing
do not try to login as 'None' (#1192)
This commit is contained in:
@@ -100,6 +100,10 @@ class NijieExtractor(AsynchronousMixin, Extractor):
|
||||
|
||||
@cache(maxage=150*24*3600, 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"}
|
||||
|
||||
@@ -522,6 +522,10 @@ class PixivAppAPI():
|
||||
|
||||
@cache(maxage=3600, keyarg=1)
|
||||
def _login_impl(self, username, password):
|
||||
if not username or not password:
|
||||
raise exception.AuthenticationError(
|
||||
"Username and password required")
|
||||
|
||||
url = "https://oauth.secure.pixiv.net/auth/token"
|
||||
data = {
|
||||
"client_id": self.client_id,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2016-2019 Mike Fährmann
|
||||
# Copyright 2016-2020 Mike Fährmann
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
@@ -54,6 +54,10 @@ class SeigaExtractor(Extractor):
|
||||
|
||||
@cache(maxage=7*24*3600, 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 = "https://account.nicovideo.jp/api/v1/login"
|
||||
data = {"mail_tel": username, "password": password}
|
||||
|
||||
Reference in New Issue
Block a user