mirror of
https://github.com/RicterZ/nhentai.git
synced 2025-04-20 02:41:19 +02:00
fix
This commit is contained in:
parent
de157ccb7f
commit
4577e9df9a
@ -27,7 +27,7 @@ def login_parser(username, password):
|
|||||||
|
|
||||||
s.get(constant.LOGIN_URL)
|
s.get(constant.LOGIN_URL)
|
||||||
content = s.get(constant.LOGIN_URL).content
|
content = s.get(constant.LOGIN_URL).content
|
||||||
html = BeautifulSoup(content, 'html.parser').encode("ascii")
|
html = BeautifulSoup(content, 'html.parser')
|
||||||
csrf_token_elem = html.find('input', attrs={'name': 'csrfmiddlewaretoken'})
|
csrf_token_elem = html.find('input', attrs={'name': 'csrfmiddlewaretoken'})
|
||||||
|
|
||||||
if not csrf_token_elem:
|
if not csrf_token_elem:
|
||||||
@ -44,7 +44,7 @@ def login_parser(username, password):
|
|||||||
logger.error('Login failed, please check your username and password')
|
logger.error('Login failed, please check your username and password')
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
html = BeautifulSoup(s.get(constant.FAV_URL).content, 'html.parser').encode("ascii")
|
html = BeautifulSoup(s.get(constant.FAV_URL).content, 'html.parser')
|
||||||
count = html.find('span', attrs={'class': 'count'})
|
count = html.find('span', attrs={'class': 'count'})
|
||||||
if not count:
|
if not count:
|
||||||
logger.error('Cannot get count of your favorites, maybe login failed.')
|
logger.error('Cannot get count of your favorites, maybe login failed.')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user