fix: use --disable-software-rasterizer only on ARM

This commit is contained in:
Eduard Tykhoniuk 2024-11-01 14:02:52 +01:00
parent 54668a11e7
commit 4ba487051b

View File

@ -6,6 +6,7 @@ import shutil
import urllib.parse import urllib.parse
import tempfile import tempfile
import sys import sys
import platform
from selenium.webdriver.chrome.webdriver import WebDriver from selenium.webdriver.chrome.webdriver import WebDriver
import undetected_chromedriver as uc import undetected_chromedriver as uc
@ -135,8 +136,11 @@ def get_webdriver(proxy: dict = None) -> WebDriver:
# this option removes the zygote sandbox (it seems that the resolution is a bit faster) # this option removes the zygote sandbox (it seems that the resolution is a bit faster)
options.add_argument('--no-zygote') options.add_argument('--no-zygote')
# attempt to fix Docker ARM32 build # attempt to fix Docker ARM32 build
options.add_argument('--disable-gpu-sandbox') IS_ARMARCH = platform.machine().startswith(('arm', 'aarch'))
options.add_argument('--disable-software-rasterizer') if IS_ARMARCH:
options.add_argument('--disable-gpu-sandbox')
options.add_argument('--disable-software-rasterizer')
options.add_argument('--ignore-certificate-errors') options.add_argument('--ignore-certificate-errors')
options.add_argument('--ignore-ssl-errors') options.add_argument('--ignore-ssl-errors')
# fix GL errors in ASUSTOR NAS # fix GL errors in ASUSTOR NAS