[Bug]: Timeout during the screenshots downloading #1898
aliabusaleh opened this issue · comments
Describe the bug
The screenshot is no longer working with the new update of the Reddit UI interface.
stake trace as following
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Sorry, something went wrong with this version! Try again, and feel free to report this issue at GitHub or the Discord community. │
│ Version: 3.2.1 │
│ Error: Timeout 30000ms exceeded. │
│ =========================== logs =========================== │
│ waiting for locator("[data-test-id=\"post-content\"]") │
│ ============================================================ │
│ Config: {'allow_nsfw': False, 'theme': 'dark', 'times_to_run': 1, 'opacity': 0.9, 'storymode': False, 'storymodemethod': 1, 'storymode_max_length': │
│ 1000, 'resolution_w': 1080, 'resolution_h': 1920, 'zoom': 0.9, 'background': {'background_video': 'minecraft', 'background_audio': 'lofi', │
│ 'background_audio_volume': 0.15, 'enable_extra_audio': False, 'background_thumbnail': False, 'background_thumbnail_font_family': 'arial', │
│ 'background_thumbnail_font_size': 96, 'background_thumbnail_font_color': '255,255,255'}, 'tts': {'voice_choice': 'tiktok', 'random_voice': True, │
│ 'elevenlabs_voice_name': 'Josh', 'elevenlabs_api_key': 'REDACTED', 'aws_polly_voice': 'Matthew', 'streamlabs_polly_voice': 'Matthew', 'tiktok_voice': │
│ 'en_us_001', 'tiktok_sessionid': 'REDACTED', 'python_voice': '1', 'py_voice_num': '2', 'silence_duration': 0.3, 'no_emojis': False}} │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Traceback (most recent call last):
File "d:\redditBot\RedditVideoMakerBot\main.py", line 132, in <module>
raise err
File "d:\redditBot\RedditVideoMakerBot\main.py", line 114, in <module>
run_many(config["settings"]["times_to_run"])
File "d:\redditBot\RedditVideoMakerBot\main.py", line 69, in run_many
main()
File "d:\redditBot\RedditVideoMakerBot\main.py", line 53, in main
get_screenshots_of_reddit_posts(reddit_object, number_of_comments)
File "d:\redditBot\RedditVideoMakerBot\video_creation\screenshot_downloader.py", line 203, in get_screenshots_of_reddit_posts
raise e
File "d:\redditBot\RedditVideoMakerBot\video_creation\screenshot_downloader.py", line 180, in get_screenshots_of_reddit_posts
location = page.locator(f'#post-title-t3_{reddit_id}').bounding_box()
File "C:\Users\aligh\anaconda3\envs\redditBotV3\lib\site-packages\playwright\sync_api\_generated.py", line 15518, in bounding_box
self._sync(self._impl_obj.bounding_box(timeout=timeout))
File "C:\Users\aligh\anaconda3\envs\redditBotV3\lib\site-packages\playwright\_impl\_sync_base.py", line 109, in _sync
return task.result()
File "C:\Users\aligh\anaconda3\envs\redditBotV3\lib\site-packages\playwright\_impl\_locator.py", line 131, in bounding_box
return await self._with_element(
File "C:\Users\aligh\anaconda3\envs\redditBotV3\lib\site-packages\playwright\_impl\_locator.py", line 115, in _with_element
handle = await self.element_handle(timeout=timeout)
File "C:\Users\aligh\anaconda3\envs\redditBotV3\lib\site-packages\playwright\_impl\_locator.py", line 315, in element_handle
handle = await self._frame.wait_for_selector(
File "C:\Users\aligh\anaconda3\envs\redditBotV3\lib\site-packages\playwright\_impl\_frame.py", line 322, in wait_for_selector
await self._channel.send("waitForSelector", locals_to_params(locals()))
File "C:\Users\aligh\anaconda3\envs\redditBotV3\lib\site-packages\playwright\_impl\_connection.py", line 61, in send
return await self._connection.wrap_api_call(
File "C:\Users\aligh\anaconda3\envs\redditBotV3\lib\site-packages\playwright\_impl\_connection.py", line 482, in wrap_api_call
return await cb()
File "C:\Users\aligh\anaconda3\envs\redditBotV3\lib\site-packages\playwright\_impl\_connection.py", line 97, in inner_send
result = next(iter(done)).result()
playwright._impl._api_types.TimeoutError: Timeout 30000ms exceeded.
=========================== logs ===========================
waiting for locator("[data-test-id=\"post-content\"]")
============================================================
Reproduction Steps
new Reddit UI + testing the code
Expected behavior
The bot should be able to take screenshot with the new Reddit UI
Screenshots
No response
System Information
Operating System : Windows 11
Python version : Python 3.10
App version / Branch : master
Checklist
- I have searched the open issues for duplicates.
- I have shown the entire traceback, if possible.
Additional Context
it's a duplicate issue of #1898
I'm having this problem too, has anyone managed to solve it?
@xuxuzin0103 yeah I fixed it and fixed another issue with the new UI check it here PR
This issue is stale because it has been open 7 days with no activity. Remove stale label or comment, or this will be closed in 10 days.
Issue closed due to being stale. Please reopen if issue persists in latest version.