soraxas / echo360

Commandline tool for automated downloads of echo360 videos hosted by university
https://cs.tinyiu.com/echo360
MIT License
280 stars 53 forks source link

Update auto-downloaded chromedriver and geckodriver versions? #51

Closed Ace4896 closed 3 years ago

Ace4896 commented 3 years ago

Hi, I've recently encountered an issue with the downloader not being able to start either Chrome or Firefox. I'm using:

When running .\run.bat --chrome <url>:

chromedriver output

``` > Echo360 Cloud platform detected > This implies setup_credential, and using web_driver >> Please login with your SSO details and type continue when logged in. ----------------------------------------------------------------- ================================================================= Binary file of chromedriver not found, will initiate a download process now... >> Downloading chromedriver binary file for "win32" 100% [..........................................................................] 3378230 / 3378230 >> Extracting archive file "chromedriver_win32.zip" Done! ================================================================= Traceback (most recent call last): File "echo360.py", line 7, in sys.exit(main()) File "C:\Users\Jon\Documents\Repositories\GitHub\Clones\echo360\echo360\main.py", line 337, in main downloader = EchoDownloader( File "C:\Users\Jon\Documents\Repositories\GitHub\Clones\echo360\echo360\downloader.py", line 87, in __init__ self._driver = webdriver.Chrome(**kwargs) File "C:\Users\Jon\Documents\Repositories\GitHub\Clones\echo360\_echo360venv\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 70, in __init__ super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog", File "C:\Users\Jon\Documents\Repositories\GitHub\Clones\echo360\_echo360venv\lib\site-packages\selenium\webdriver\chromium\webdriver.py", line 93, in __init__ RemoteWebDriver.__init__( File "C:\Users\Jon\Documents\Repositories\GitHub\Clones\echo360\_echo360venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 268, in __init__ self.start_session(capabilities, browser_profile) File "C:\Users\Jon\Documents\Repositories\GitHub\Clones\echo360\_echo360venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 359, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Users\Jon\Documents\Repositories\GitHub\Clones\echo360\_echo360venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 424, in execute self.error_handler.check_response(response) File "C:\Users\Jon\Documents\Repositories\GitHub\Clones\echo360\_echo360venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary (Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT 10.0.19042 x86_64) ```

And for .\run.bat --firefox <url>:

geckodriver output

``` > Echo360 Cloud platform detected > This implies setup_credential, and using web_driver >> Please login with your SSO details and type continue when logged in. ----------------------------------------------------------------- ================================================================= Binary file of geckodriver not found, will initiate a download process now... >> Downloading geckodriver binary file for "win64" 100% [..........................................................................] 1532274 / 1532274 >> Extracting archive file "geckodriver-v0.26.0-win64.zip" Done! ================================================================= Traceback (most recent call last): File "echo360.py", line 7, in sys.exit(main()) File "C:\Users\Jon\Documents\Repositories\GitHub\Clones\echo360\echo360\main.py", line 337, in main downloader = EchoDownloader( File "C:\Users\Jon\Documents\Repositories\GitHub\Clones\echo360\echo360\downloader.py", line 99, in __init__ self._driver = webdriver.Firefox(profile, **kwargs) File "C:\Users\Jon\Documents\Repositories\GitHub\Clones\echo360\_echo360venv\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 174, in __init__ self.service.start() File "C:\Users\Jon\Documents\Repositories\GitHub\Clones\echo360\_echo360venv\lib\site-packages\selenium\webdriver\common\service.py", line 98, in start self.assert_process_still_running() File "C:\Users\Jon\Documents\Repositories\GitHub\Clones\echo360\_echo360venv\lib\site-packages\selenium\webdriver\common\service.py", line 110, in assert_process_still_running raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: Service C:\Users\Jon\Documents\Repositories\GitHub\Clones\echo360/bin/geckodriver.exe unexpectedly exited. Status code was: 64 ```

I found that manually downloading the latest versions of chromedriver and geckodriver and placing them in the bin folder fixes the two errors mentioned above.

Would it be worth updating the auto-downloaded chromedriver and geckodriver versions? After looking at the supported browser versions for each, it seems that geckodriver is safe to update since it supports a wide range of Firefox versions, but the newer chromedrivers only support one major version of Chrome. Maybe the script could download the latest versions instead of using a particular version?

soraxas commented 3 years ago

Hi @Ace4896 thanks for the feedback on the version issue and investigating the supported version of the newer drivers!

Feel free to send in a PR with an updated https://github.com/soraxas/echo360/blob/19ff0ff0d7b7259938b407d3479351e30db920fc/echo360/binary_downloader/firefoxdriver.py#L10 for the version that you had tested. I still think it's better to have a specfiied version tag instead of always grabbing latest version to avoid unknown breakage

Ace4896 commented 3 years ago

Sure, I can send a PR for updating geckodriver in a bit. I'll leave chromedriver alone since I just tried it on Ubuntu 20.04 and oddly enough it worked there... maybe it's just a path-related thing on Windows.