@@ -44,8 +44,10 @@ def download_and_extract_extension(driver, extension_id, crx_download_url):
44
44
45
45
try :
46
46
if crx_download_url .startswith ('https://chromewebstore.google.com' ):
47
+ logging .info ('Downloading the extension from the Chrome Web Store...' )
47
48
crx_file_path = download_from_chrome_webstore (extension_id , extension_dir )
48
49
else :
50
+ logging .info ('Downloading the extension from the provider website...' )
49
51
crx_file_path = download_from_provider_website (driver , extension_id , crx_download_url , extension_dir )
50
52
51
53
logging .info (f"Extension extracted to { crx_file_path } " )
@@ -70,13 +72,14 @@ def download_from_chrome_webstore(extension_id, extension_dir):
70
72
Raises:
71
73
subprocess.CalledProcessError: If there is an error during the download process.
72
74
"""
73
- GIT_USERNAME = 'warren-bank '
74
- GIT_REPO = 'chrome-extension-downloader '
75
+ GIT_USERNAME = 'sryze '
76
+ GIT_REPO = 'crx-dl '
75
77
logging .info (f'Using { GIT_USERNAME } /{ GIT_REPO } to download the extension CRX file from the Chrome Web Store...' )
76
78
subprocess .run (["git" , "clone" , f"https://github.com/{ GIT_USERNAME } /{ GIT_REPO } .git" ], check = True )
77
- subprocess .run (["chmod" , "+x" , f"./{ GIT_REPO } /bin/* " ], check = True )
79
+ subprocess .run (["chmod" , "+x" , f"./{ GIT_REPO } /crx-dl.py " ], check = True )
78
80
crx_file_path = os .path .join (extension_dir , f"{ extension_id } .crx" )
79
- subprocess .run ([f"./{ GIT_REPO } /bin/crxdl" , extension_id , crx_file_path ], check = True )
81
+ os .makedirs (extension_dir , exist_ok = True )
82
+ subprocess .run (["python3" , f"./{ GIT_REPO } /crx-dl.py" , f"-o={ crx_file_path } " , extension_id ], check = True )
80
83
return crx_file_path
81
84
82
85
0 commit comments