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 #2129

Open
2 tasks done
SureelWillows opened this issue Aug 26, 2024 · 11 comments
Open
2 tasks done

[Bug]: Screenshot Error #2129

SureelWillows opened this issue Aug 26, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@SureelWillows
Copy link

Describe the bug

It starts off fine, makes mp3 files and while taking screen shots, it shows a error:
"Something went wrong!
Something went wrong with making the screenshots! Do you want to skip the post? (y/n)"

Reproduction Steps

Launch the program (py main.py)
wait..

Expected behavior

it would work as fine and error wouldnt occur

Screenshots

image

image

image

System Information

Operating System : Windows 10
Python version : Python 3.10
App version / Branch : 3.3.0

Checklist

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

Additional Context

No response

@SureelWillows SureelWillows added the bug Something isn't working label Aug 26, 2024
@UsmanChatha
Copy link

Having the same issue:

Launching Headless Browser...
Logging in to Reddit...
Skipping translation...
Something went wrong!
Something went wrong with making the screenshots! Do you want to skip the post? (y/n) n
Do you want the error traceback for debugging purposes? (y/n)y
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ 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.screenshot: Timeout 30000ms exceeded. │
│ Call log: │
│ 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': 1.0, │
│ 'channel_name': 'Reddit 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': 'tiktok', 'random_voice': True, │
│ 'elevenlabs_voice_name': 'Bella', '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 "C:\Users\dell\Downloads\RedditVideoMakerBot-master\main.py", line 131, in
raise err
File "C:\Users\dell\Downloads\RedditVideoMakerBot-master\main.py", line 113, in
run_many(config["settings"]["times_to_run"])
File "C:\Users\dell\Downloads\RedditVideoMakerBot-master\main.py", line 68, in run_many
main()
File "C:\Users\dell\Downloads\RedditVideoMakerBot-master\main.py", line 52, in main
get_screenshots_of_reddit_posts(reddit_object, number_of_comments)
File "C:\Users\dell\Downloads\RedditVideoMakerBot-master\video_creation\screenshot_downloader.py", line 203, in get_screenshots_of_reddit_posts
raise e
File "C:\Users\dell\Downloads\RedditVideoMakerBot-master\video_creation\screenshot_downloader.py", line 185, in get_screenshots_of_reddit_posts
page.locator('[data-test-id="post-content"]').screenshot(path=postcontentpath)
File "C:\Users\dell\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright\sync_api_generated.py", line 16703, in screenshot
self._sync(
File "C:\Users\dell\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright_impl_sync_base.py", line 115, in _sync
return task.result()
File "C:\Users\dell\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright_impl_locator.py", line 531, in screenshot
return await self._with_element(
File "C:\Users\dell\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright_impl_locator.py", line 108, in _with_element
handle = await self.element_handle(timeout=timeout)
File "C:\Users\dell\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright_impl_locator.py", line 311, in element_handle
handle = await self._frame.wait_for_selector(
File "C:\Users\dell\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright_impl_frame.py", line 323, in wait_for_selector
await self._channel.send("waitForSelector", locals_to_params(locals()))
File "C:\Users\dell\AppData\Local\Programs\Python\Python310\lib\site-packages\playwright_impl_connection.py", line 59, in send
return await self._connection.wrap_api_call(
File "C:\Users\dell\AppData\Local\Programs\Python\Python310\lib\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.screenshot: Timeout 30000ms exceeded.
Call log:
waiting for locator("[data-test-id="post-content"]")

@Gnlop
Copy link

Gnlop commented Aug 27, 2024

I have the same problem as you, but I do not know the cause of this error. I have tried several times and found that this error does not occur every time, but even if I find data-test-id="post-content", the screenshot cannot be taken. I have checked the cache file. Found that the interface of the post is normally taken down, but the screenshot of the comment area can not be taken.

Launching Headless Browser...
Logging in to Reddit...
Skipping translation...
Downloading screenshots... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0% -:--:--
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 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.screenshot: Timeout 30000ms exceeded. │
│ Call log: │
│ waiting for locator("#t1_lk64262") │
│ │
│ Config: {'allow_nsfw': True, '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': 'Reddit 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': 'tiktok', 'random_voice': True, │
│ 'elevenlabs_voice_name': 'Domi', '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 "F:\autovideototiktok\RedditVideoMakerBot\main.py", line 131, in
raise err
File "F:\autovideototiktok\RedditVideoMakerBot\main.py", line 113, in
run_many(config["settings"]["times_to_run"])
File "F:\autovideototiktok\RedditVideoMakerBot\main.py", line 68, in run_many
main()
File "F:\autovideototiktok\RedditVideoMakerBot\main.py", line 52, in main
get_screenshots_of_reddit_posts(reddit_object, number_of_comments)
File "F:\autovideototiktok\RedditVideoMakerBot\video_creation\screenshot_downloader.py", line 258, in get_screenshots_of_reddit_posts
page.locator(f"#t1_{comment['comment_id']}").screenshot(
File "F:\autovideototiktok\RedditVideoMakerBot\venv\lib\site-packages\playwright\sync_api_generated.py", line 16703, in screenshot
self._sync(
File "F:\autovideototiktok\RedditVideoMakerBot\venv\lib\site-packages\playwright_impl_sync_base.py", line 115, in _sync
return task.result()
File "F:\autovideototiktok\RedditVideoMakerBot\venv\lib\site-packages\playwright_impl_locator.py", line 531, in screenshot
return await self._with_element(
File "F:\autovideototiktok\RedditVideoMakerBot\venv\lib\site-packages\playwright_impl_locator.py", line 108, in _with_element
handle = await self.element_handle(timeout=timeout)
File "F:\autovideototiktok\RedditVideoMakerBot\venv\lib\site-packages\playwright_impl_locator.py", line 311, in element_handle
handle = await self._frame.wait_for_selector(
File "F:\autovideototiktok\RedditVideoMakerBot\venv\lib\site-packages\playwright_impl_frame.py", line 323, in wait_for_selector
await self._channel.send("waitForSelector", locals_to_params(locals()))
File "F:\autovideototiktok\RedditVideoMakerBot\venv\lib\site-packages\playwright_impl_connection.py", line 59, in send
return await self._connection.wrap_api_call(
File "F:\autovideototiktok\RedditVideoMakerBot\venv\lib\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.screenshot: Timeout 30000ms exceeded.
Call log:
waiting for locator("#t1_lk64262")

@zizo-pro
Copy link

zizo-pro commented Sep 2, 2024

Same Error with me

┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ 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.screenshot: Timeout 30000ms exceeded. │
│ Call log: │
│ 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': │
│ 1.0, 'channel_name': 'Reddit 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': 'tiktok', 'random_voice': True, │
│ 'elevenlabs_voice_name': 'Bella', '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:\Projects\RedditVideoMakerBot\main.py", line 131, in
raise err
File "D:\Projects\RedditVideoMakerBot\main.py", line 113, in
run_many(config["settings"]["times_to_run"])
File "D:\Projects\RedditVideoMakerBot\main.py", line 68, in run_many
main()
File "D:\Projects\RedditVideoMakerBot\main.py", line 52, in main
get_screenshots_of_reddit_posts(reddit_object, number_of_comments)
File "D:\Projects\RedditVideoMakerBot\video_creation\screenshot_downloader.py", line 203, in get_screenshots_of_reddit_posts
raise e
File "D:\Projects\RedditVideoMakerBot\video_creation\screenshot_downloader.py", line 185, in get_screenshots_of_reddit_posts
page.locator('[data-test-id="post-content"]').screenshot(path=postcontentpath)
File "C:\Program Files\Python310\lib\site-packages\playwright\sync_api_generated.py", line 16703, in screenshot
self._sync(
File "C:\Program Files\Python310\lib\site-packages\playwright_impl_sync_base.py", line 115, in _sync
return task.result()
File "C:\Program Files\Python310\lib\site-packages\playwright_impl_locator.py", line 531, in screenshot
return await self._with_element(
File "C:\Program Files\Python310\lib\site-packages\playwright_impl_locator.py", line 108, in _with_element
handle = await self.element_handle(timeout=timeout)
File "C:\Program Files\Python310\lib\site-packages\playwright_impl_locator.py", line 311, in element_handle
handle = await self._frame.wait_for_selector(
File "C:\Program Files\Python310\lib\site-packages\playwright_impl_frame.py", line 323, in wait_for_selector
await self._channel.send("waitForSelector", locals_to_params(locals()))
File "C:\Program Files\Python310\lib\site-packages\playwright_impl_connection.py", line 59, in send
return await self._connection.wrap_api_call(
File "C:\Program Files\Python310\lib\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.screenshot: Timeout 30000ms exceeded.
Call log:
waiting for locator("[data-test-id="post-content"]")

@Dofamen
Copy link

Dofamen commented Sep 4, 2024

any solution for this issue?

@salih-g
Copy link

salih-g commented Sep 5, 2024

It's occur when story mode disabled

@VanshMarda
Copy link

It's occur when story mode disabled

It still occurs when I enable it.
Should I change anything else in the config.toml?

@Roostydoo2
Copy link

It works for me when enabling story mode but for anyone where it still occurs afterwards here's my config.toml file so you can copy the settings

`[ai]
ai_similarity_enabled = false
ai_similarity_keywords = ""

[settings]
allow_nsfw = false
theme = "dark"
times_to_run = 1
opacity = 0.9
storymode = true
storymodemethod = 1
storymode_max_length = 1000
resolution_w = 1080
resolution_h = 1920
zoom = 1.0
channel_name = "Reddit Stories"

[settings.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"

[settings.tts]
voice_choice = "pyttsx"
random_voice = true
elevenlabs_voice_name = "Bella"
elevenlabs_api_key = ""
aws_polly_voice = "Matthew"
streamlabs_polly_voice = "Matthew"
tiktok_voice = "en_us_001"
tiktok_sessionid = ""
python_voice = "1"
py_voice_num = "2"
silence_duration = 0.3
no_emojis = false

[reddit.creds]
client_id = ""
client_secret = ""
username = ""
password = ""
2fa = false

[reddit.thread]
random = true
subreddit = "AskReddit"
post_id = ""
max_comment_length = 500
min_comment_length = 1
post_lang = "en-US"
min_comments = 20
`

@Dofamen
Copy link

Dofamen commented Sep 12, 2024

Thank you, I'll test it and let you know if its works for me, once again thank you for your help

@tahatsahin
Copy link

hi #2138 fixes this.

@Mregy1
Copy link

Mregy1 commented Sep 25, 2024

hi #2138 fixes this.

Actually, it doesn't. I tried it!

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

No branches or pull requests

15 participants