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]: TypeError: Cannot set properties of null #2134

Open
2 tasks done
josylad opened this issue Sep 4, 2024 · 6 comments
Open
2 tasks done

[Bug]: TypeError: Cannot set properties of null #2134

josylad opened this issue Sep 4, 2024 · 6 comments
Labels
bug Something isn't working Check up needed Might be able to delete this soon check up on it again help wanted Extra attention is needed keep

Comments

@josylad
Copy link

josylad commented Sep 4, 2024

Describe the bug

It starts off fine but when it gets to the point of translating the post, it throws an error.

Reproduction Steps

set ai_similarity_enabled = true
Launch the program (py main.py) and wait.

Expected behavior

run smoothly and make a video

Screenshots

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.evaluate: TypeError: Cannot set properties of null (setting │
│ 'textContent')                                                          │
│     at eval (eval at evaluate (:226:30), <anonymous>:1:101)             │
│     at UtilityScript.evaluate (<anonymous>:233:19)                      │
│     at UtilityScript.<anonymous> (<anonymous>:1:44)                     │
│ Config: {'allow_nsfw': False, 'theme': 'light', 'times_to_run': 1,      │
│ 'opacity': 0.7, 'storymode': False, 'storymodemethod': 1,               │
│ 'storymode_max_length': 1000, 'resolution_w': 1080, 'resolution_h':     │
│ 1920, 'zoom': 1.2, 'channel_name': 'Reddit Tales', 'background':        │
│ {'background_video': 'minecraft', 'background_audio': 'lofi',           │
│ 'background_audio_volume': 0.05, '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 "/home/josylad/Documents/Projects/RedditVideoMakerBot/main.py", line 131, in <module>
    raise err
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/main.py", line 113, in <module>
    run_many(config["settings"]["times_to_run"])
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/main.py", line 68, in run_many
    main()
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/main.py", line 52, in main
    get_screenshots_of_reddit_posts(reddit_object, number_of_comments)
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/video_creation/screenshot_downloader.py", line 165, in get_screenshots_of_reddit_posts
    page.evaluate(
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/virtual/lib/python3.10/site-packages/playwright/sync_api/_generated.py", line 8183, in evaluate
    self._sync(
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/virtual/lib/python3.10/site-packages/playwright/_impl/_sync_base.py", line 115, in _sync
    return task.result()
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/virtual/lib/python3.10/site-packages/playwright/_impl/_page.py", line 435, in evaluate
    return await self._main_frame.evaluate(expression, arg)
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/virtual/lib/python3.10/site-packages/playwright/_impl/_frame.py", line 278, in evaluate
    await self._channel.send(
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/virtual/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 59, in send
    return await self._connection.wrap_api_call(
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/virtual/lib/python3.10/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.evaluate: TypeError: Cannot set properties of null (setting 'textContent')
    at eval (eval at evaluate (:226:30), <anonymous>:1:101)
    at UtilityScript.evaluate (<anonymous>:233:19)
    at UtilityScript.<anonymous> (<anonymous>:1:44)

System Information

Operating System : Ubuntu 22.04
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

It works if I set:
ai_similarity_enabled = false

@josylad josylad added the bug Something isn't working label Sep 4, 2024
@Superkaizhen07
Copy link

any fix with screenshot error post ?

@needkg
Copy link

needkg commented Sep 8, 2024

I have the same problem.

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 Sep 15, 2024
@JasonLovesDoggo
Copy link
Collaborator

does #2138 fix this for anyone here?

@JasonLovesDoggo JasonLovesDoggo added help wanted Extra attention is needed Check up needed Might be able to delete this soon check up on it again keep and removed stale labels Sep 18, 2024
@xtb7
Copy link

xtb7 commented Sep 30, 2024

I got this error because I put the wrong reddit password in my config.toml

@jordanbr20
Copy link

I am getting this as well, confirmed user and password, even going as far as creating a new account. Only happens after "Logging into reddit..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Check up needed Might be able to delete this soon check up on it again help wanted Extra attention is needed keep
Projects
None yet
Development

No branches or pull requests

6 participants