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

Add an option to disable Screenshots for a capture #143

Open
jgarl opened this issue Feb 27, 2025 · 1 comment
Open

Add an option to disable Screenshots for a capture #143

jgarl opened this issue Feb 27, 2025 · 1 comment

Comments

@jgarl
Copy link

jgarl commented Feb 27, 2025

It would be really interesting to add an option for disabling screenshots when capturing urls, as sometimes takes too much time.

As a possible solution, the Capture class can have a parameter so it can evaluate here and set the "png" attribute as None or call the screenshot function. Perhaps something like this:

if self.take_screenshot:
         to_return['png'] = await self._failsafe_get_screenshot(page)
else:
        to_return['png'] = None

Besides modifying this PlaywrightCapture module, the Capture class instance in LacusCore would also need to be modified to accept this new parameter, as well as the main utilities in Lacus and the API for enqueuing new urls.

We'd be happy to help implement these changes 😃

@Rafiot
Copy link
Collaborator

Rafiot commented Feb 27, 2025

We can add that feature, that will mean updating the settings with a key called with_screenshot (so we're keeping the with_favicon naming scheme). And you're all correct on what will need to be updated (playwrightcapture, lacuscore, pylacus and lacus itself), and then, expose it in Lookyloo.

It will work, but from experience, the screenshot is generally not the (only) issue, and the page has other problems causing it to take a very long time to finish.
Have you tried to reduce the max capture time?

And if you're up for implementing it, go for it, I'll be happy to merge it all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants