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