From 871f49cdf528fffe9a3403ef1347944c854c1214 Mon Sep 17 00:00:00 2001 From: wafwoof Date: Thu, 20 Jul 2023 20:31:23 -0700 Subject: [PATCH 1/2] Fixed edgecase on mac, download chromedriver = 404 --- .gitignore | 2 +- youtubeviewer/download_driver.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index a74324a..7a4d966 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,6 @@ patched_drivers/ database.db database_backup.db config.json -chromedriver.exe +chromedriver* version.txt *.log diff --git a/youtubeviewer/download_driver.py b/youtubeviewer/download_driver.py index 230eba1..c5f4fd1 100644 --- a/youtubeviewer/download_driver.py +++ b/youtubeviewer/download_driver.py @@ -28,7 +28,10 @@ import undetected_chromedriver._compat as uc -from .colors import * +try: + from .colors import * +except Exception: + from colors import * CHROME = ['{8A69D345-D564-463c-AFF1-A69D9E530F96}', '{8237E44A-0054-442C-B6B6-EA0509993955}', @@ -104,10 +107,11 @@ def download_driver(patched_drivers): pass shutil.rmtree(patched_drivers, ignore_errors=True) - - major_version = version.split('.')[0] - - uc.TARGET_VERSION = major_version + + if osname != 'mac': + # these 2 lines break on my macbook + major_version = version.split('.')[0] + uc.TARGET_VERSION = major_version uc.install() From 7907163c96ac9259222fb4f45e423ff6c48d621b Mon Sep 17 00:00:00 2001 From: wafwoof Date: Fri, 21 Jul 2023 12:13:07 -0700 Subject: [PATCH 2/2] 404 chromedriver download is a mac/windows problem --- youtubeviewer/download_driver.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/youtubeviewer/download_driver.py b/youtubeviewer/download_driver.py index c5f4fd1..7f08dae 100644 --- a/youtubeviewer/download_driver.py +++ b/youtubeviewer/download_driver.py @@ -28,10 +28,7 @@ import undetected_chromedriver._compat as uc -try: - from .colors import * -except Exception: - from colors import * +from .colors import * CHROME = ['{8A69D345-D564-463c-AFF1-A69D9E530F96}', '{8237E44A-0054-442C-B6B6-EA0509993955}', @@ -108,10 +105,9 @@ def download_driver(patched_drivers): shutil.rmtree(patched_drivers, ignore_errors=True) - if osname != 'mac': - # these 2 lines break on my macbook - major_version = version.split('.')[0] - uc.TARGET_VERSION = major_version + # seems like the url naming convention has changed + #major_version = version.split('.')[0] + #uc.TARGET_VERSION = major_version uc.install()