[Bug]: waiting for locator("input[name=\"username\"]")
Describe the bug
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.fill: Timeout 30000ms exceeded. │ │ Call log: │ │ waiting for locator("input[name="username"]") │ │ │ │ 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}}
Reproduction Steps
Already filled everything
Expected behavior
the script working as usual.
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]
Checklist
- [x] I have searched the open issues for duplicates.
- [x] I have shown the entire traceback, if possible.
Additional Context
No response
Can confirm I have the same issue. Worked about 12 hours ago. Made no changes.
If you edit /video_creation/screenshot_downloader.py and change headless=True to headless=False and you can see the browser and I see that I'm being blocked. Here is the text of the block message:
whoa there, pardner!
Your request has been blocked due to a network policy.
Try logging in or creating an account here to get back to browsing.
If you're running a script or application, please register or sign in with your developer credentials here. Additionally make sure your User-Agent is not empty and is something unique and descriptive and try again. If you're supplying an alternate User-Agent string, try changing back to default as that can sometimes result in a block.
You can read Reddit's Terms of Service here.
if you think that we've incorrectly blocked you or you would like to discuss easier ways to get the data you want, please file a ticket here.
when contacting us, please include your ip address which is: IP Omitted and reddit account
I did try updating the user agent but didn't work. Playwright has an option to define user agent and says to use: user_agent = "project-name version by /u/username" which I wondered if having the actual project name is checked in user agent or something and allowed but doesn't seem so. Looks like I need to open a ticket.
From what i've researched it appears that the bot is sending too many requests,and that is why we are getting banned.
From what i've researched it appears that the bot is sending too many requests,and that is why we are getting banned.
I actually think it has something to do with the headless browser's browser agent and it not matching my typical login triggering a network violation. In that part of the script I don't see logic to keep trying which is why it throws an error because it just waits for load then tries to find username field and can't. I noticed after the first time it happened I got a weird prompt when logging into reddit from my main browser. Kind of like a captcha but was just a button. But was able to login fine (same ip) but still blocked via script. The API part works fine and finds posts and comments and makes the audio etc. That would be the part that would get rate limited but I'm not even close to a limit I would think as I've ran it maybe 6 times successfully before the block. I did put in a ticket so I'll update here once I find out if they'll lift the block.
Hello I have found a solution to bypass the ban, install brave or you normal browser that you use, and change the code on the file screenshot_downloader.py
print_substep("Launching Headless Browser...")
brave_path = r'C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe'
browser = p.chromium.launch(
headless=False,
executable_path=brave_path,
) # headless=False will show the browser for debugging purposes
# Device scale factor (or dsf for short) allows us to increase the resolution of the screenshots
# When the dsf is 1, the width of the screenshot is 600 pixels
# so we need a dsf such that the width of the screenshot is greater than the final resolution of the video
dsf = (W // 600) + 1
context = browser.new_context(
locale=lang or "en-us",
color_scheme="dark",
viewport=ViewportSize(width=W, height=H),
device_scale_factor=dsf,
user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
)
# Login to Reddit
print_substep("Logging in to Reddit...")
page = context.new_page()
cookies = json.load(cookie_file)
cookie_file.close()
context.add_cookies(cookies) # load preference cookies
page.set_extra_http_headers({
"Accept-Language": "en-US,en;q=0.9",
# "Upgrade-Insecure-Requests": "1"
})
now I have an error playwright._impl._errors.TimeoutError: Locator.screenshot: Timeout 30000ms exceeded. Call log: waiting for locator("[data-test-id="post-content"]")
now I have an error playwright._impl._errors.TimeoutError: Locator.screenshot: Timeout 30000ms exceeded. Call log: waiting for locator("[data-test-id="post-content"]")
There is a fix for that in this thread that worked for me on that error here: https://github.com/elebumm/RedditVideoMakerBot/issues/2255
Thank you for figuring out how to swap out the headless browser. I was going to work on that today and woke up to you already having done that. Cheers.
@bitburner Thanks (btw you can turn headless to True it does not matter if its false or true), yeah I saw the solution but now I'm facing another error lemme know if you have a solution for it. Error: Locator.screenshot: Timeout 29984ms exceeded. │ │ Call log: │ │ taking element screenshot │ │ - waiting for fonts to load...
@bitburner Thanks (btw you can turn headless to True it does not matter if its false or true), yeah I saw the solution but now I'm facing another error lemme know if you have a solution for it. Error: Locator.screenshot: Timeout 29984ms exceeded. │ │ Call log: │ │ taking element screenshot │ │ - waiting for fonts to load...
I think that the same bug I had before it started blocking me that I fixed by doing:
pip install --upgrade yt-dlp
Actually I updated the requirements.txt with newest version and re-ran requirements.txt let me find what I changed it to.
In requirements.txt I changed it to this and re-ran....
yt-dlp==2025.4.30
@bitburner Thanks (btw you can turn headless to True it does not matter if its false or true), yeah I saw the solution but now I'm facing another error lemme know if you have a solution for it. Error: Locator.screenshot: Timeout 29984ms exceeded. │ │ Call log: │ │ taking element screenshot │ │ - waiting for fonts to load...
I think in order for playwright to set headless it has to be installed via playwright. Here is their page on using different browsers (https://playwright.dev/docs/browsers). But once you get it working you can go manually into your Brave browser and turn on headless with this flag:
bravery://flags#headless
@bitburner Thanks (btw you can turn headless to True it does not matter if its false or true), yeah I saw the solution but now I'm facing another error lemme know if you have a solution for it. Error: Locator.screenshot: Timeout 29984ms exceeded. │ │ Call log: │ │ taking element screenshot │ │ - waiting for fonts to load...
I think that the same bug I had before it started blocking me that I fixed by doing:
pip install --upgrade yt-dlp
Actually I updated the requirements.txt with newest version and re-ran requirements.txt let me find what I changed it to.
In requirements.txt I changed it to this and re-ran....
yt-dlp==2025.4.30
even after updating the library I still have the same issue raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None playwright._impl._errors.TimeoutError: Locator.screenshot: Timeout 29969ms exceeded. Call log: taking element screenshot
- waiting for fonts to load...
@bitburner Thanks (btw you can turn headless to True it does not matter if its false or true), yeah I saw the solution but now I'm facing another error lemme know if you have a solution for it. Error: Locator.screenshot: Timeout 29984ms exceeded. │ │ Call log: │ │ taking element screenshot │ │ - waiting for fonts to load...
I think in order for playwright to set headless it has to be installed via playwright. Here is their page on using different browsers (https://playwright.dev/docs/browsers). But once you get it working you can go manually into your Brave browser and turn on headless with this flag:
bravery://flags#headless
for the headless it works for me without changing anything just I set headless to True
@bitburner Thanks (btw you can turn headless to True it does not matter if its false or true), yeah I saw the solution but now I'm facing another error lemme know if you have a solution for it. Error: Locator.screenshot: Timeout 29984ms exceeded. │ │ Call log: │ │ taking element screenshot │ │ - waiting for fonts to load...
I think that the same bug I had before it started blocking me that I fixed by doing: pip install --upgrade yt-dlp Actually I updated the requirements.txt with newest version and re-ran requirements.txt let me find what I changed it to. In requirements.txt I changed it to this and re-ran.... yt-dlp==2025.4.30
even after updating the library I still have the same issue raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None playwright._impl._errors.TimeoutError: Locator.screenshot: Timeout 29969ms exceeded. Call log: taking element screenshot
* waiting for fonts to load...
I have a feeling this is because the browser wasn't installed via playwright and can't see the fonts. I've not changed anything yet on mine as Reddit got back saying they would respond soon so I'll see how that goes. Maybe installing the fonts on your system that are in the /fonts folder will have them loaded already and won't need to load them for the session? Should just be able to right click them and choose install. For giggles though maybe try installing the playwright browser dependencies again?
playwright install-deps
or force just chromium with: playwright install-deps chromium
@bitburner Thanks (btw you can turn headless to True it does not matter if its false or true), yeah I saw the solution but now I'm facing another error lemme know if you have a solution for it. Error: Locator.screenshot: Timeout 29984ms exceeded. │ │ Call log: │ │ taking element screenshot │ │ - waiting for fonts to load...
I think that the same bug I had before it started blocking me that I fixed by doing: pip install --upgrade yt-dlp Actually I updated the requirements.txt with newest version and re-ran requirements.txt let me find what I changed it to. In requirements.txt I changed it to this and re-ran.... yt-dlp==2025.4.30
even after updating the library I still have the same issue raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None playwright._impl._errors.TimeoutError: Locator.screenshot: Timeout 29969ms exceeded. Call log: taking element screenshot
* waiting for fonts to load...I have a feeling this is because the browser wasn't installed via playwright and can't see the fonts. I've not changed anything yet on mine as Reddit got back saying they would respond soon so I'll see how that goes. Maybe installing the fonts on your system that are in the /fonts folder will have them loaded already and won't need to load them for the session? Should just be able to right click them and choose install. For giggles though maybe try installing the playwright browser dependencies again?
playwright install-deps
or force just chromium with: playwright install-deps chromium
I'm trying to build my own function to take screenshot and till now it seem working fine for taking screenshot, I'll test the generated video if it works fine I'll share the solution with you, just stay alert or if you have a discord we can do a quick call
so the function that I made it works but still having some issue it does not take a good screen shots for the comments, I'm still working on it, or if you find a solution lemme know
so the function that I made it works but still having some issue it does not take a good screen shots for the comments, I'm still working on it, or if you find a solution lemme know
In the config.toml there is a zoom setting if the text is really small etc.
zoom = { optional = true, default = 1, example = 1.1, explanation = "Sets the browser zoom level. Useful if you want the text larger.", type = "float", nmin = 0.1, nmax = 2, oob_error = "The text is really difficult to read at a zoom level higher than 2" }
For me it still gives the same error.When i tried switching to brave it doesn't log in and gives the fonts error,which i was unable to fix.
I tried changing line 76 in screenshots_downloader.py to firefox,which bypasses the ip ban and it works half of the time . The other half i get the error " playwright._impl._errors.Error: Page.goto: NS_BINDING_ABORTED; maybe frame was detached? " Also the switching to firefox breacks the dark/light mode settings idk why.
For me it still gives the same error.When i tried switching to brave it doesn't log in and gives the fonts error,which i was unable to fix.
I tried changing line 76 in screenshots_downloader.py to firefox,which bypasses the ip ban and it works half of the time . The other half i get the error " playwright._impl._errors.Error: Page.goto: NS_BINDING_ABORTED; maybe frame was detached? " Also the switching to firefox breacks the dark/light mode settings idk why.
Hey thanks for the feedback, for me I still got the font error from brave, I didnt switch browser yet, but I was able to implement a function to take screenshot and it works fine, but when it come for taking screenshot for comments it faild it always take the wrong screenshot of the box.
just to better understand you switched to firefox by giving it the path of the .exe or you just launch it from the playwright.
so the function that I made it works but still having some issue it does not take a good screen shots for the comments, I'm still working on it, or if you find a solution lemme know
In the config.toml there is a zoom setting if the text is really small etc.
zoom = { optional = true, default = 1, example = 1.1, explanation = "Sets the browser zoom level. Useful if you want the text larger.", type = "float", nmin = 0.1, nmax = 2, oob_error = "The text is really difficult to read at a zoom level higher than 2" }
not working at all, everytime when I try taking screenshot with the existing function it does not work, but when I implement a function to take screenshot, it works but it faild for taking screen shot of other comment as it take the wrong box or zone due the screenshot its not from the web but as it take it from my desktop view.
if you are able to by pass the error from the font please share it,
@Dofamen I launched it from playwright. It bypasses the font problem.However the NS_BINDING_ABORTED error appears to be a loading issue from the browser.Like its refusing to load content
@Dofamen I launched it from playwright. It bypasses the font problem.However the NS_BINDING_ABORTED error appears to be a loading issue from the browser.Like its refusing to load content
I fixed it
CHANGE THIS #page.goto(f"https://new.reddit.com/{comment['comment_url']}") TO page.goto(f"https://new.reddit.com{comment['comment_url']}", wait_until='domcontentloaded', timeout=15000)
@Dofamen Thanks man! I tried it and at first it didn't fix it for me .However i changed the timeout to 0 and it seems to be working. Screenshots are still off tho.
@Dofamen Thanks man! I tried it and at first it didn't fix it for me .However i changed the timeout to 0 and it seems to be working. Screenshots are still off tho.
It works for me, screenshot without changint th timeout to 0, maybe due to your network or something
@Dofamen Thanks man! I tried it and at first it didn't fix it for me .However i changed the timeout to 0 and it seems to be working. Screenshots are still off tho.
It works for me, screenshot without changint th timeout to 0, maybe due to your network or something, for the whole code works fine now, I can generate videos on story mode or not, just still have one problem is I don't know how to change the voice so that it can be using the voice from eleventLabs such as Chris
@Dofamen Could you share your working version ? I'm still experiencing the same problems.
@vo1d-null the version I cloned the master branch, also make sure to follow all the above comment and make sure to upgrade the library that the other guy mention, for python version use 3.10. If you did all those stuff and it did works share with me the error message that you got
@Dofamen So did you manage to do it with brave browser ?Also how did you fix the screenshots being off ?
@Dofamen So did you manage to do it with brave browser ?Also how did you fix the screenshots being off ?
I'll try to sum up the thread so far best I can.
First do the common fixes before this issue to rule them out. After you do a git clone of the repo and before you do anything edit the requirements.txt
change to this:
yt-dlp==2025.4.30
Run the requirements.txt after change and before running do the rest (if you've already installed just run it again with the new change).
Replace all the code from /RedditVideoMakerBot-master/video_creation/screenshot_downloader.py with the code from this comment: https://github.com/elebumm/RedditVideoMakerBot/issues/2255#issuecomment-2676910117)
Use a different browser following @Dofamen example from above (https://github.com/elebumm/RedditVideoMakerBot/issues/2333#issuecomment-2952731493)
In /Video_creation/screenshot_downloader.py on line 233
CHANGE THIS page.goto(f"https://new.reddit.com/{comment['comment_url']}") TO page.goto(f"https://new.reddit.com{comment['comment_url']}", wait_until='domcontentloaded', timeout=15000)
The timeout can be adjusted.
Did I miss anything?
@bitburner yes now I use firefox browser from the library and I don't use the path anymore and make sure to Remove the "Upgrade-Insecure-Requests": "1"
Make it like this page.set_extra_http_headers({ "Accept-Language": "en-US,en;q=0.9", })