Skip to content

Commit

Permalink
fix: issue NanmiCoder#12
Browse files Browse the repository at this point in the history
  • Loading branch information
NanmiCoder committed Jul 3, 2023
1 parent 0cedd7d commit e5f4ecd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions media_platform/douyin/login.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
import logging
import asyncio
import functools

import aioredis
from tenacity import (
Expand Down Expand Up @@ -104,6 +105,9 @@ async def login_by_qrcode(self):
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)

Expand Down
6 changes: 5 additions & 1 deletion media_platform/xhs/login.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
import asyncio
import logging
import functools

import aioredis
from tenacity import (
Expand Down Expand Up @@ -146,7 +147,10 @@ async def login_by_qrcode(self):
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:
Expand Down

0 comments on commit e5f4ecd

Please sign in to comment.