update patcher, so it does not use older chromedriver binary.

This commit is contained in:
Leon 2023-08-08 00:55:40 +02:00 committed by GitHub
parent 1c704a71cf
commit 47234b0b13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 7 deletions

View File

@ -116,12 +116,13 @@ class Patcher(object):
# # -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
@ -202,7 +203,11 @@ class Patcher(object):
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()