liufuhua007

fixbug

...@@ -84,6 +84,8 @@ async def main(): ...@@ -84,6 +84,8 @@ async def main():
84 await toutiao_setup(str(account_file), handle=True, auto=False) 84 await toutiao_setup(str(account_file), handle=True, auto=False)
85 elif args.platform == SOCIAL_MEDIA_BAIJIAHAO: 85 elif args.platform == SOCIAL_MEDIA_BAIJIAHAO:
86 await toutiao_setup(str(account_file), handle=True, auto=False) 86 await toutiao_setup(str(account_file), handle=True, auto=False)
87 + elif args.platform == SOCIAL_MEDIA_SOHU:
88 + await sohu_setup(str(account_file), handle=True)
87 89
88 elif args.action == 'auto_login': 90 elif args.action == 'auto_login':
89 print(f"auto Logging in with account {args.account_name} on platform {args.platform}") 91 print(f"auto Logging in with account {args.account_name} on platform {args.platform}")
......
...@@ -25,9 +25,6 @@ async def toutiao_setup(account_file, handle=False, auto=False): ...@@ -25,9 +25,6 @@ async def toutiao_setup(account_file, handle=False, auto=False):
25 async def open_toutiao_main_page(account_file): 25 async def open_toutiao_main_page(account_file):
26 async with async_playwright() as playwright: 26 async with async_playwright() as playwright:
27 options = { 27 options = {
28 - 'args': [
29 - '--lang en-GB'
30 - ],
31 'headless': False, # Set headless option here 28 'headless': False, # Set headless option here
32 } 29 }
33 # Make sure to run headed. 30 # Make sure to run headed.
...@@ -82,9 +79,6 @@ async def get_toutiao_cookie(account_file): ...@@ -82,9 +79,6 @@ async def get_toutiao_cookie(account_file):
82 print("get_toutiao_cookie") 79 print("get_toutiao_cookie")
83 async with async_playwright() as playwright: 80 async with async_playwright() as playwright:
84 options = { 81 options = {
85 - 'args': [
86 - '--lang en-GB'
87 - ],
88 'headless': False, # Set headless option here 82 'headless': False, # Set headless option here
89 } 83 }
90 # Make sure to run headed. 84 # Make sure to run headed.
...@@ -94,7 +88,7 @@ async def get_toutiao_cookie(account_file): ...@@ -94,7 +88,7 @@ async def get_toutiao_cookie(account_file):
94 context = await set_init_script(context) 88 context = await set_init_script(context)
95 # Pause the page, and start recording manually. 89 # Pause the page, and start recording manually.
96 page = await context.new_page() 90 page = await context.new_page()
97 - await page.goto("https://mp.toutiao.com") 91 + await page.goto("https://mp.toutiao.com", {waitUntil: "commit"})
98 92
99 # 手动授权登录 93 # 手动授权登录
100 await page.pause() 94 await page.pause()
......