fix: issue #12
This commit is contained in:
parent
0cedd7da40
commit
e5f4ecd8ec
|
@ -1,6 +1,7 @@
|
|||
import sys
|
||||
import logging
|
||||
import asyncio
|
||||
import functools
|
||||
|
||||
import aioredis
|
||||
from tenacity import (
|
||||
|
@ -104,6 +105,9 @@ class DouYinLogin(AbstractLogin):
|
|||
sys.exit()
|
||||
|
||||
# show login qrcode
|
||||
# utils.show_qrcode(base64_qrcode_img)
|
||||
partial_show_qrcode = functools.partial(utils.show_qrcode, base64_qrcode_img)
|
||||
asyncio.get_running_loop().run_in_executor(executor=None, func=partial_show_qrcode)
|
||||
utils.show_qrcode(base64_qrcode_img)
|
||||
await asyncio.sleep(2)
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import sys
|
||||
import asyncio
|
||||
import logging
|
||||
import functools
|
||||
|
||||
import aioredis
|
||||
from tenacity import (
|
||||
|
@ -146,7 +147,10 @@ class XHSLogin(AbstractLogin):
|
|||
no_logged_in_session = cookie_dict.get("web_session")
|
||||
|
||||
# show login qrcode
|
||||
utils.show_qrcode(base64_qrcode_img)
|
||||
# utils.show_qrcode(base64_qrcode_img)
|
||||
partial_show_qrcode = functools.partial(utils.show_qrcode, base64_qrcode_img)
|
||||
asyncio.get_running_loop().run_in_executor(executor=None, func=partial_show_qrcode)
|
||||
|
||||
logging.info(f"waiting for scan code login, remaining time is 20s")
|
||||
login_flag: bool = await self.check_login_state(no_logged_in_session)
|
||||
if not login_flag:
|
||||
|
|
Loading…
Reference in New Issue