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]: screenshots fail to be taken #2183

Open
2 tasks done
Gaming8288383838 opened this issue Nov 6, 2024 · 20 comments
Open
2 tasks done

[Bug]: screenshots fail to be taken #2183

Gaming8288383838 opened this issue Nov 6, 2024 · 20 comments
Labels
bug Something isn't working stale

Comments

@Gaming8288383838
Copy link

Gaming8288383838 commented Nov 6, 2024

Describe the bug

Screens shots fail to be taken

Reproduction Steps

Ran python main.py

Expected behavior

take the screen shots

Screenshots

Screenshot (2)

System Information

Operating System : [windows 10]
Python version : [Python 3.10.0]
App version / Branch :latest

Checklist

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

Additional Context

No response

@Gaming8288383838 Gaming8288383838 added the bug Something isn't working label Nov 6, 2024
@Gaming8288383838 Gaming8288383838 changed the title [Bug]: [Bug]: screenshots fail to be taken Nov 7, 2024
@Gaming8288383838
Copy link
Author

any fixes? this issue better not be ignored

@mmnsrti
Copy link

mmnsrti commented Nov 7, 2024

hello i encountered the same issue
`(venv) (base) PS E:\app\RedditVideoMakerBot>
(venv) (base) PS E:\app\RedditVideoMakerBot> python main.py

██████╗ ███████╗██████╗ ██████╗ ██╗████████╗ ██╗ ██╗██╗██████╗ ███████╗ ██████╗ ███╗ ███╗ █████╗ ██╗ ██╗███████╗██████╗
██╔══██╗██╔════╝██╔══██╗██╔══██╗██║╚══██╔══╝ ██║ ██║██║██╔══██╗██╔════╝██╔═══██╗ ████╗ ████║██╔══██╗██║ ██╔╝██╔════╝██╔══██╗
██████╔╝█████╗ ██║ ██║██║ ██║██║ ██║ ██║ ██║██║██║ ██║█████╗ ██║ ██║ ██╔████╔██║███████║█████╔╝ █████╗ ██████╔╝
██╔══██╗██╔══╝ ██║ ██║██║ ██║██║ ██║ ╚██╗ ██╔╝██║██║ ██║██╔══╝ ██║ ██║ ██║╚██╔╝██║██╔══██║██╔═██╗ ██╔══╝ ██╔══██╗
██║ ██║███████╗██████╔╝██████╔╝██║ ██║ ╚████╔╝ ██║██████╔╝███████╗╚██████╔╝ ██║ ╚═╝ ██║██║ ██║██║ ██╗███████╗██║ ██║
══════╝╚═╝ ╚═╝

Thanks for using this tool! Feel free to contribute to this project on GitHub! If you have any questions, feel
free to join my Discord server or submit a GitHub issue. You can find solutions to many common problems in the
documentation: https://reddit-video-maker-bot.netlify.app/

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ You are using the newest version (3.3.0) of the bot │╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯###############################

Checking TOML configuration

###############################
If you see any prompts, that means that you have unset/incorrectly set variables, please input the correct values.
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ on the 1st iteration of 1 │╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯Logging into Reddit.
Version 7.7.1 of praw is outdated. Version 7.8.1 was released Friday October 25, 2024.
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ Getting subreddit threads... │╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯Using subreddit:
r/AskReddit+EntitledParents+ProRevenge+MaliciousCompliance+TodayIWIA+TalesFromRetail+Relationships+ChoosingBeggars+TIFU+LetsNotMeet+AITA+HumansBeingBros+Confession+TrueOffMyChest+NuclearRevenge+LifeProTips+AskWomen+Paranormal+UnresolvedMysteries+WholesomeStories+Glitch_in_the_Matrix from TOML config
NSFW Post Detected. Skipping...
Video will be: LPT: Some gyms are extremely cheap lifehack for homeless, vanlife, or commuters. 👍
Thread url is: https://new.reddit.com//r/LifeProTips/comments/1glsho4/lpt_some_gyms_are_extremely_cheap_lifehack_for/👍
Thread has 809 upvotes
Thread has a upvote ratio of 88.0%
Thread has 51 comments
Received subreddit threads Successfully.
Thread ID is 1glsho4
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ Saving Text to MP3 files... │╰───────────────────────────────────────────────────────────────────────────────────────────────────Saving... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.5 it/s
Saved Text to MP3 files successfully.
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Downloading screenshots of reddit posts... │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
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) y
The post is successfully skipped! You can now restart the program and this post will skipped.
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': 'streamlabspolly', '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 "E:\app\RedditVideoMakerBot\main.py", line 131, in
raise err
File "E:\app\RedditVideoMakerBot\main.py", line 113, in
run_many(config["settings"]["times_to_run"])
File "E:\app\RedditVideoMakerBot\main.py", line 68, in run_many
main()
File "E:\app\RedditVideoMakerBot\main.py", line 52, in main
get_screenshots_of_reddit_posts(reddit_object, number_of_comments)
File "E:\app\RedditVideoMakerBot\video_creation\screenshot_downloader.py", line 203, in get_screenshots_of_reddit_posts
raise e
File "E:\app\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 "E:\app\RedditVideoMakerBot\venv\lib\site-packages\playwright\sync_api_generated.py", line 16703, in screenshot
self._sync(
File "E:\app\RedditVideoMakerBot\venv\lib\site-packages\playwright_impl_sync_base.py", line 115, in _sync
return task.result()
File "E:\app\RedditVideoMakerBot\venv\lib\site-packages\playwright_impl_locator.py", line 531, in screenshot
return await self._with_element(
File "E:\app\RedditVideoMakerBot\venv\lib\site-packages\playwright_impl_locator.py", line 108, in _with_element
handle = await self.element_handle(timeout=timeout)
File "E:\app\RedditVideoMakerBot\venv\lib\site-packages\playwright_impl_locator.py", line 311, in element_handle
handle = await self._frame.wait_for_selector(
File "E:\app\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 "E:\app\RedditVideoMakerBot\venv\lib\site-packages\playwright_impl_connection.py", line 59, in send
return await self._connection.wrap_api_call(
File "E:\app\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("[data-test-id="post-content"]")

(venv) (base) PS E:\app\RedditVideoMakerBot> `

@Gaming8288383838
Copy link
Author

Looks like no fix yet

@TheGreenJoker
Copy link

Same issue Today at the '9/11/2024'

@HarryHills3588
Copy link

Same issue here 11/11/2024

@JasonLovesDoggo
Copy link
Collaborator

Feel free to try #2151 to see if it fixes

@penguin321
Copy link

Feel free to try #2151 to see if it fixes

Pulled #2151 but now fails here:

image

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 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: Page.goto: NS_BINDING_ABORTED                                                                                                                                                                          │
│ Call log:                                                                                                                                                                                                     │
│ navigating to "https://new.reddit.com/r/AskReddit/comments/1gr6svg/married_men_over_30_what_kind_of_hobbies_do_you/lx3h9rt/", waiting until "load"                                                            │
│                                                                                                                                                                                                               │
│ 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': 'pyttsx', '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\ms\Desktop\RedditVideoMakerBot\main.py", line 131, in <module>
    raise err
  File "C:\Users\ms\Desktop\RedditVideoMakerBot\main.py", line 113, in <module>
    run_many(config["settings"]["times_to_run"])
  File "C:\Users\ms\Desktop\RedditVideoMakerBot\main.py", line 68, in run_many
    main()
  File "C:\Users\ms\Desktop\RedditVideoMakerBot\main.py", line 52, in main
    get_screenshots_of_reddit_posts(reddit_object, number_of_comments)
  File "C:\Users\ms\Desktop\RedditVideoMakerBot\video_creation\screenshot_downloader.py", line 227, in get_screenshots_of_reddit_posts
    page.goto(f"https://new.reddit.com{comment['comment_url']}")
  File "C:\Users\ms\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright\sync_api\_generated.py", line 8686, in goto
    self._sync(
  File "C:\Users\ms\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\ms\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright\_impl\_page.py", line 519, in goto
    return await self._main_frame.goto(**locals_to_params(locals()))
  File "C:\Users\ms\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright\_impl\_frame.py", line 145, in goto
    await self._channel.send("goto", locals_to_params(locals()))
  File "C:\Users\ms\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\ms\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.Error: Page.goto: NS_BINDING_ABORTED
Call log:
navigating to "https://new.reddit.com/r/AskReddit/comments/1gr6svg/married_men_over_30_what_kind_of_hobbies_do_you/lx3h9rt/", waiting until "load"

@Luuna6
Copy link

Luuna6 commented Nov 15, 2024

same

Feel free to try #2151 to see if it fixes

Pulled #2151 but now fails here:

image

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 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: Page.goto: NS_BINDING_ABORTED                                                                                                                                                                          │
│ Call log:                                                                                                                                                                                                     │
│ navigating to "https://new.reddit.com/r/AskReddit/comments/1gr6svg/married_men_over_30_what_kind_of_hobbies_do_you/lx3h9rt/", waiting until "load"                                                            │
│                                                                                                                                                                                                               │
│ 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': 'pyttsx', '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\ms\Desktop\RedditVideoMakerBot\main.py", line 131, in <module>
    raise err
  File "C:\Users\ms\Desktop\RedditVideoMakerBot\main.py", line 113, in <module>
    run_many(config["settings"]["times_to_run"])
  File "C:\Users\ms\Desktop\RedditVideoMakerBot\main.py", line 68, in run_many
    main()
  File "C:\Users\ms\Desktop\RedditVideoMakerBot\main.py", line 52, in main
    get_screenshots_of_reddit_posts(reddit_object, number_of_comments)
  File "C:\Users\ms\Desktop\RedditVideoMakerBot\video_creation\screenshot_downloader.py", line 227, in get_screenshots_of_reddit_posts
    page.goto(f"https://new.reddit.com{comment['comment_url']}")
  File "C:\Users\ms\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright\sync_api\_generated.py", line 8686, in goto
    self._sync(
  File "C:\Users\ms\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\ms\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright\_impl\_page.py", line 519, in goto
    return await self._main_frame.goto(**locals_to_params(locals()))
  File "C:\Users\ms\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\playwright\_impl\_frame.py", line 145, in goto
    await self._channel.send("goto", locals_to_params(locals()))
  File "C:\Users\ms\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\ms\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.Error: Page.goto: NS_BINDING_ABORTED
Call log:
navigating to "https://new.reddit.com/r/AskReddit/comments/1gr6svg/married_men_over_30_what_kind_of_hobbies_do_you/lx3h9rt/", waiting until "load"

same problem
image

@Janxyxy
Copy link

Janxyxy commented Nov 16, 2024

Reddit might have updated their ID styles for comment elements. The old selector:
page.locator(f"#t1_{comment['comment_id']}").screenshot(path=f"assets/temp/{reddit_id}/png/comment_{idx}.png")
I updated the selector to:
page.locator(f"#t1_{comment['comment_id']}-comment-rtjson-content").screenshot(path=f"assets/temp/{reddit_id}/png/comment_{idx}.png")

Now it matches the current ID structure, and the script works again.

@eyaadi
Copy link

eyaadi commented Nov 17, 2024

where are the lines

@eyaadi
Copy link

eyaadi commented Nov 17, 2024

okay so to make the solution easier just go to the video creation file and then go to the screenshot downloader.py file then copy and paste this code make sure to replace it, code can be found on this pastebin https://pastebin.com/raw/FFZryj46

Copy link
Contributor

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.

@github-actions github-actions bot added the stale label Nov 25, 2024
@TanmayChachra
Copy link

The issue is still there as of 29/11/2024

@github-actions github-actions bot removed the stale label Nov 30, 2024
@eyaadi
Copy link

eyaadi commented Nov 30, 2024

they should update prawcore
and elevenllanbs

@sarimwaniR
Copy link

@eyaadi after you're fix now it stuck here
image

@sarimwaniR
Copy link

image

@sarimwaniR
Copy link

I am using steam labs voice...

@Neo19867
Copy link

Neo19867 commented Dec 3, 2024

same problems

@justsnom
Copy link

justsnom commented Dec 3, 2024

okay so to make the solution easier just go to the video creation file and then go to the screenshot downloader.py file then copy and paste this code make sure to replace it, code can be found on this pastebin https://pastebin.com/raw/FFZryj46

this definitely works but only sometimes! it seems like it gets stuck on specific posts with this and even after turning on random it won't give me a new one every time. it doesnt prompt to skip either. is there any command to skip a particular reddit thread or some other suggestion for this?

Copy link
Contributor

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.

@github-actions github-actions bot added the stale label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

14 participants