Skip to content

Commit

Permalink
update patcher, so it does not use older chromedriver binary.
Browse files Browse the repository at this point in the history
  • Loading branch information
ultrafunkamsterdam authored Aug 7, 2023
1 parent 1c704a7 commit 47234b0
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions undetected_chromedriver/patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,13 @@ def auto(self, executable_path=None, force=False, version_main=None, _=None):
# # -1 being a skip value used later in this block
#
p = pathlib.Path(self.data_path)
with Lock():
files = list(p.rglob("*chromedriver*?"))
for file in files:
if self.is_binary_patched(file):
self.executable_path = str(file)
return True
if self.user_multiprocs:
with Lock():
files = list(p.rglob("*chromedriver*?"))
for file in files:
if self.is_binary_patched(file):
self.executable_path = str(file)
return True

if executable_path:
self.executable_path = executable_path
Expand Down Expand Up @@ -202,7 +203,11 @@ def driver_binary_in_use(self, path: str = None) -> bool:
def cleanup_unused_files(self):
p = pathlib.Path(self.data_path)
items = list(p.glob("*undetected*"))
print(items)
for item in items:
try:
item.unlink()
except:
pass

def patch(self):
self.patch_exe()
Expand Down

0 comments on commit 47234b0

Please sign in to comment.