Untweak parameters, it works when it wants to.
This commit is contained in:
parent
0e8f5758ef
commit
ef81b13ab2
1 changed files with 6 additions and 6 deletions
|
@ -22,13 +22,13 @@ class ScreenshotCog(commands.Cog):
|
||||||
self.log = logging.getLogger("jimmy.cogs.screenshot")
|
self.log = logging.getLogger("jimmy.cogs.screenshot")
|
||||||
|
|
||||||
self.chrome_options = ChromeOptions()
|
self.chrome_options = ChromeOptions()
|
||||||
# self.chrome_options.add_argument("--headless")
|
self.chrome_options.add_argument("--headless")
|
||||||
# self.chrome_options.add_argument("--disable-extensions")
|
self.chrome_options.add_argument("--disable-extensions")
|
||||||
self.chrome_options.add_argument("--incognito")
|
self.chrome_options.add_argument("--incognito")
|
||||||
self.chrome_options.add_argument("--remote-debugging-port=9222")
|
self.chrome_options.add_argument("--remote-debugging-port=9222")
|
||||||
if os.getuid() == 0:
|
if os.getuid() == 0:
|
||||||
self.chrome_options.add_argument("--no-sandbox")
|
self.chrome_options.add_argument("--no-sandbox")
|
||||||
# self.chrome_options.add_argument("--disable-setuid-sandbox")
|
self.chrome_options.add_argument("--disable-setuid-sandbox")
|
||||||
self.log.warning("Running as root, disabling chrome sandbox.")
|
self.log.warning("Running as root, disabling chrome sandbox.")
|
||||||
|
|
||||||
prefs = {
|
prefs = {
|
||||||
|
@ -38,9 +38,9 @@ class ScreenshotCog(commands.Cog):
|
||||||
"plugins.always_open_pdf_externally": False,
|
"plugins.always_open_pdf_externally": False,
|
||||||
"download_restrictions": 3,
|
"download_restrictions": 3,
|
||||||
}
|
}
|
||||||
# self.chrome_options.add_experimental_option(
|
self.chrome_options.add_experimental_option(
|
||||||
# "prefs", prefs
|
"prefs", prefs
|
||||||
# )
|
)
|
||||||
|
|
||||||
def compress_png(self, input_file: io.BytesIO) -> io.BytesIO:
|
def compress_png(self, input_file: io.BytesIO) -> io.BytesIO:
|
||||||
img = Image.open(input_file)
|
img = Image.open(input_file)
|
||||||
|
|
Loading…
Reference in a new issue