QIN2DIM / epic-awesome-gamer

🍷 Gracefully claim weekly free games and monthly content from Epic Store.
https://echosec.notion.site/Epic-7c74f1e29117420dbac5551e4b031f82?pvs=4
GNU General Public License v3.0
886 stars 364 forks source link

从自行跑下来的结果,和当前项目中的Actions中的记录来看,大都是卡在了登录这一步 #254

Open sulele89757 opened 1 month ago

sulele89757 commented 1 month ago

确实是登录这一步失败了,但是偶尔也有能登录成功的,应该还是验证码识别率不够高的原因

2024-07-11 15:10:20 | INFO - Try to flush cookie - {'task': 'claim_epic_games'}
2024-07-11 15:10:50 | WARNING - 执行超时 - {'task': 'authorize', 'retry': 0}
2024-07-11 15:10:53 | INFO - login-with-email - {'url': 'https://www.epicgames.com/id/login?lang=en-US&noHostRedirect=true&redirectUrl=https://store.epicgames.com/en-US/free-games&__cf_chl_rt_tk=tcUW4JSTX5bTSW0F7AJxPA_QIxBLTBlZDvKVW9ITOnQ-1720[68](https://github.com/sulele89757/weekly_robot/actions/runs/9887055991/job/27307991165#step:6:69)1853-0.0.1.1-6378'}
2024-07-11 15:11:23 | WARNING - 执行超时 - {'task': 'authorize', 'retry': 1}
2024-07-11 15:11:26 | INFO - login-with-email - {'url': 'https://www.epicgames.com/id/login?lang=en-US&noHostRedirect=true&redirectUrl=https://store.epicgames.com/en-US/free-games&__cf_chl_rt_tk=Lb9wr2leD7etqxyrMvviQJS1JKAXmxzDyP0AaRwhEw8-1[72](https://github.com/sulele89757/weekly_robot/actions/runs/9887055991/job/27307991165#step:6:73)0681886-0.0.1.1-6378'}
2024-07-11 15:11:56 | WARNING - 执行超时 - {'task': 'authorize', 'retry': 2}
2024-07-11 15:11:56 | ERROR - An error has been caught in function 'run', process 'MainProcess' (3543), thread 'MainThread' (139793224735616): - {}

下面这次应该就已经进入到领取界面了,只不过我之前手动领过了,这里报错 Locator expected to have text 'View In Cart'

2024-07-11 15:01:04 | INFO - claim_weekly_games - {'action': 'go to store', 'url': 'https://store.epicgames.com/en-US/p/the-falconeer'}
2024-07-11 15:01:17 | ERROR - An error has been caught in function 'run', process 'MainProcess' (3420), thread 'MainThread' (139670160104320): - {}
Traceback (most recent call last):
  File "/home/runner/work/auto_epic/auto_epic/epic/src/claim.py", line 162, in <module>
    asyncio.run(run())
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
    self._run_once()
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/asyncio/base_events.py", line 1909, in _run_once
    handle._run()
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
> File "/home/runner/work/auto_epic/auto_epic/epic/src/claim.py", line 158, in run
    await agent.stash()
  File "/home/runner/work/auto_epic/auto_epic/epic/src/claim.py", line 151, in stash
    await self.claim_epic_games(context)
  File "/home/runner/work/auto_epic/auto_epic/epic/src/claim.py", line 122, in claim_epic_games
    await epic.claim_weekly_games(page, single_promotions)
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tenacity/asyncio/__init__.py", line 189, in async_wrapped
    return await copy(fn, *args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tenacity/asyncio/__init__.py", line 111, in __call__
    do = await self.iter(retry_state=retry_state)
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tenacity/asyncio/__init__.py", line 153, in iter
    result = await action(retry_state)
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tenacity/_utils.py", line 99, in inner
    return call(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tenacity/__init__.py", line 398, in <lambda>
    self._add_action_func(lambda rs: rs.outcome.result())
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/tenacity/asyncio/__init__.py", line 114, in __call__
    result = await fn(*args, **kwargs)
  File "/home/runner/work/auto_epic/auto_epic/epic/src/epic_games/agent.py", line 310, in claim_weekly_games
    await expect(cta_btn).to_have_text("View In Cart")
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/playwright/async_api/_generated.py", line 19117, in to_have_text
    await self._impl_obj.to_have_text(
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/playwright/_impl/_assertions.py", line 481, in to_have_text
    await self._expect_impl(
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/playwright/_impl/_assertions.py", line [74](https://github.com/sulele89757/weekly_robot/actions/runs/9886926194/job/27307614398#step:6:75), in _expect_impl
    raise AssertionError(
AssertionError: Locator expected to have text 'View In Cart'
Actual value: <element(s) not found> 
Call log:
LocatorAssertions.to_have_text with timeout 5000ms
  - waiting for locator("//aside//button[@data-testid='add-to-cart-cta-button']")