Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Screenshot Error #2147

Open
2 tasks done
JHVIW opened this issue Sep 18, 2024 · 6 comments
Open
2 tasks done

[Bug]: Screenshot Error #2147

JHVIW opened this issue Sep 18, 2024 · 6 comments
Labels
bug Something isn't working keep

Comments

@JHVIW
Copy link

JHVIW commented Sep 18, 2024

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

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

Additional Context

No response

@JHVIW JHVIW added the bug Something isn't working label Sep 18, 2024
@JHVIW
Copy link
Author

JHVIW commented Sep 18, 2024

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

@JasonLovesDoggo
Copy link
Collaborator

duplicate of #2129 2129

@JasonLovesDoggo JasonLovesDoggo closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2024
@JHVIW
Copy link
Author

JHVIW commented Sep 19, 2024

I don't agree with it being a duplicate because that has been fixed in #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.

@JasonLovesDoggo
Copy link
Collaborator

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

@Roostydoo2
Copy link

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)

@lexciobotariu
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working keep
Projects
None yet
Development

No branches or pull requests

4 participants