RedditVideoMakerBot icon indicating copy to clipboard operation
RedditVideoMakerBot copied to clipboard

[Bug]: Screenshot Error

Open JHVIW opened this issue 1 year ago • 7 comments

Describe the bug

After updating to the patched version of screenshot_updater.py, I could make 4 video's and then this error keeps occuring. It happens halfway of getting the screenshots of a post. ││ waiting for locator("button[aria-controls="comment-children"]").first

Reproduction Steps

Just run the main.py

Expected behavior

It should just continue fetching the screenshots and saving them.

Screenshots

No response

System Information

Operating System : [e.g. Windows 11] Python version : [e.g. Python 3.6] App version / Branch : [e.g. latest, V2.0, master, develop]

Sorry, something went wrong with this version! Try again, and feel free to report this issue at GitHub or the Discord community. ││ Version: 3.3.0 ││ Error: Locator.click: Timeout 30000ms exceeded. ││ Call log: ││ waiting for locator("button[aria-controls="comment-children"]").first ││ ││ 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': 1.0, 'channel_name': 'Absurdantics Tales', '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': 'streamlabspolly', 'random_voice': True, 'tiktok_voice': 'en_us_001', 'tiktok_sessionid': 'REDACTED', 'silence_duration': 0.3, 'no_emojis': False, 'elevenlabs_voice_name': 'Bella', 'elevenlabs_api_key': 'REDACTED', 'aws_polly_voice': ││ 'Matthew', 'streamlabs_polly_voice': 'Matthew', 'python_voice': '1', 'py_voice_num': '2'}}

Checklist

  • [X] I have searched the open issues for duplicates.
  • [X] I have shown the entire traceback, if possible.

Additional Context

No response

JHVIW avatar Sep 18 '24 19:09 JHVIW

Full stack trace: Traceback (most recent call last): File "c:\Users\rickv\Desktop\Coding\RedditVideos\RedditVideoMakerBot\main.py", line 131, in raise err File "c:\Users\rickv\Desktop\Coding\RedditVideos\RedditVideoMakerBot\main.py", line 113, in run_many(config["settings"]["times_to_run"]) File "c:\Users\rickv\Desktop\Coding\RedditVideos\RedditVideoMakerBot\main.py", line 68, in run_many main() File "c:\Users\rickv\Desktop\Coding\RedditVideos\RedditVideoMakerBot\main.py", line 52, in main get_screenshots_of_reddit_posts(reddit_object, number_of_comments) File "c:\Users\rickv\Desktop\Coding\RedditVideos\RedditVideoMakerBot\video_creation\screenshot_downloader.py", line 257, in get_screenshots_of_reddit_posts page.locator("button[aria-controls="comment-children"]").first.click() File "C:\Users\rickv\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright\sync_api_generated.py", line 14929, in click self._sync( File "C:\Users\rickv\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright_impl_sync_base.py", line 115, in _sync return task.result() File "C:\Users\rickv\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright_impl_locator.py", line 156, in click return await self._frame.click(self._selector, strict=True, **params) File "C:\Users\rickv\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright_impl_frame.py", line 488, in click await self._channel.send("click", locals_to_params(locals())) File "C:\Users\rickv\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright_impl_connection.py", line 59, in send return await self._connection.wrap_api_call( File "C:\Users\rickv\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright_impl_connection.py", line 514, in wrap_api_call raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None playwright._impl._errors.TimeoutError: Locator.click: Timeout 30000ms exceeded. Call log: waiting for locator("button[aria-controls="comment-children"]").first

JHVIW avatar Sep 18 '24 19:09 JHVIW

duplicate of #2129 2129

JasonLovesDoggo avatar Sep 19 '24 06:09 JasonLovesDoggo

I don't agree with it being a duplicate because that has been fixed in https://github.com/elebumm/RedditVideoMakerBot/pull/2138. I have that new version of screenshot_downloader.py in my repository and it worked for 4 video's untill it gave this error.

JHVIW avatar Sep 19 '24 07:09 JHVIW

Hmmm okay, I won't be free to look into it for a few days but I'll reopen this

JasonLovesDoggo avatar Sep 19 '24 07:09 JasonLovesDoggo

Sorry guys for the late reply this error is to do with reddit blocking the browser due to suspicious activity and can be fixed by changing your ip (via a vpn)

Roostydoo2 avatar Sep 22 '24 07:09 Roostydoo2

I found a workaround for the screenshot error, as Roostydoo2 said the browser is blocked with a captcha. What I did was activate the debugging for the browse in screenshot_downloader.py. browser = p.chromium.launch( headless=True Set this to False then increase the waiting time after the script inserted the username and password to 15 seconds, this will give you enough time to complete the captcha manually. Modify the lines page.wait_for_timeout to 15000. Also what I did was I added a timeout of 60 seconds for the page.locator('[data-test-id="post-content"]').screenshot(path=postcontentpath the line would look like this page.locator('[data-test-id="post-content"]').screenshot(path=postcontentpath, timeout=60000)

lexciobotariu avatar Oct 21 '24 06:10 lexciobotariu

não funcionou aqui, ele continua dando o mesmo erro...

LeandroGazoli avatar Jan 16 '25 11:01 LeandroGazoli