Skip to content

Commit

Permalink
Remove undetected-chromedriver from dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
DevilXD committed Apr 23, 2023
1 parent 2579301 commit 330eb4f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
aiohttp>2.0,<4.0
Pillow
pystray
selenium-wire
# use a fork that has an extra option of hiding the unneeded Chrome's console cmd window
git+https://github.com/sebdelsol/undetected-chromedriver
# selenium-wire
# undetected-chromedriver
# this is installed only on windows
pywin32; sys_platform == "win32"
1 change: 1 addition & 0 deletions setup_env.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if not exist "%dirpath%\env" (
)
echo:
echo Installing requirements.txt...
"%dirpath%\env\scripts\python" install -U pip
"%dirpath%\env\scripts\pip" install wheel
"%dirpath%\env\scripts\pip" install -r "%dirpath%\requirements.txt"
goto DONE
Expand Down
17 changes: 11 additions & 6 deletions twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@
from seleniumwire.request import Request
from selenium.common.exceptions import WebDriverException
from seleniumwire.undetected_chromedriver import Chrome, ChromeOptions
except ModuleNotFoundError:
# the dependencies weren't installed, but they're not used either, so skip them
pass
except ImportError as exc:
raise ImportError(
"You need to install Visual C++ Redist (x86 and x64): "
"https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads"
) from exc
if "_brotli" in exc.msg:
raise ImportError(
"You need to install Visual C++ Redist (x86 and x64): "
"https://support.microsoft.com/en-gb/help/2977003/"
"the-latest-supported-visual-c-downloads"
) from exc
raise

from translate import _
from gui import GUIManager
Expand Down Expand Up @@ -162,8 +168,6 @@ async def _chrome_login(self) -> None:
options.add_argument("--disable-web-security")
options.add_argument("--allow-running-insecure-content")
options.add_argument("--lang=en")
options.add_argument("--no-sandbox")
options.add_argument("--test-type")
options.add_argument("--disable-gpu")
options.set_capability("pageLoadStrategy", "eager")
try:
Expand All @@ -174,6 +178,7 @@ async def _chrome_login(self) -> None:
None,
lambda: Chrome(
options=options,
no_sandbox=True,
suppress_welcome=True,
version_main=version_main,
seleniumwire_options=wire_options,
Expand Down

1 comment on commit 330eb4f

@guihkx
Copy link
Contributor

@guihkx guihkx commented on 330eb4f Apr 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe update build.spec as well to remove files referencing seleniumwire?

Please sign in to comment.