[nijie] raise AuthError

This commit is contained in:
Mike Fährmann 2016-07-20 14:21:13 +02:00
parent 3136278f79
commit 0ba9601b63
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -9,7 +9,7 @@
"""Extract images from https://nijie.info/""" """Extract images from https://nijie.info/"""
from .common import AsynchronousExtractor, Message from .common import AsynchronousExtractor, Message
from .. import config, text from .. import config, text, exception
from ..cache import cache from ..cache import cache
class NijieUserExtractor(AsynchronousExtractor): class NijieUserExtractor(AsynchronousExtractor):
@ -75,5 +75,5 @@ class NijieUserExtractor(AsynchronousExtractor):
params = {"email": email, "password": password} params = {"email": email, "password": password}
page = self.session.post("https://nijie.info/login_int.php", data=params).text page = self.session.post("https://nijie.info/login_int.php", data=params).text
if "//nijie.info/login.php" in page: if "//nijie.info/login.php" in page:
raise Exception("login failed") raise exception.AuthenticationError()
return self.session.cookies return self.session.cookies