soraxas / echo360

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

chromedriver for M1 mac? #75

Closed yihuanlin closed 9 months ago

yihuanlin commented 1 year ago

Hello. I had an error that I think is due to Chrome binary that cannot be downloaded. I am using arm64 mac and I found that chromedriver.py and downloader.py only include mac64. The latest version of Chrome (self._version = "112.0.5615.49") should support M1 mac.

self._os_darwin_32 = "mac64"
self._os_darwin_64 = "mac64"

Below is the error message I got:

> Echo360 Cloud platform detected
> This implies setup_credential, and using web_driver
>> Please login with your SSO details and type continue when logged in.
-----------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/Home/echo360/echo360.py", line 7, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/Home/echo360/echo360/main.py", line 337, in main
    downloader = EchoDownloader(
                 ^^^^^^^^^^^^^^^
  File "/Users/Home/echo360/echo360/downloader.py", line 99, in __init__
    self._driver = webdriver.Chrome(**kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Home/echo360/_echo360venv/lib/python3.11/site-packages/selenium/webdriver/chrome/webdriver.py", line 70, in __init__
    super(WebDriver, self).__init__(DesiredCapabilities.CHROME['browserName'], "goog",
  File "/Users/Home/echo360/_echo360venv/lib/python3.11/site-packages/selenium/webdriver/chromium/webdriver.py", line 93, in __init__
    RemoteWebDriver.__init__(
  File "/Users/Home/echo360/_echo360venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 269, in __init__
    self.start_session(capabilities, browser_profile)
  File "/Users/Home/echo360/_echo360venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 360, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Home/echo360/_echo360venv/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 425, in execute
    self.error_handler.check_response(response)
  File "/Users/Home/echo360/_echo360venv/lib/python3.11/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.552518 (183d19265345f54ce39cbb94cf81ba5f15905011),platform=Mac OS X 10.16.0 x86_64)
soraxas commented 1 year ago

The latest version of Chrome (self._version = "112.0.5615.49") should support M1 mac.

When you say it "should support", did you mean that you've tried and it works for your case?

Or did you meant you've tried and still got the error you've posted?

soraxas commented 1 year ago

related #72

yihuanlin commented 1 year ago

The latest version of Chrome (self._version = "112.0.5615.49") should support M1 mac.

When you say it "should support", did you mean that you've tried and it works for your case?

Or did you meant you've tried and still got the error you've posted?

Thank you for your reply.

I mean the latest version of chromedriver has an arm64 version for mac. I edited the line "self._version = " but I am still getting the old version. I don't know about python but I guess it was to do with checking.

Even if I have the version change I think your code "self._os_darwin" will select the version for intel (mac64) rather than m1 (mac_arm)

soraxas commented 1 year ago

You need to delete the previously downloaded one to trigger the download. Probably in the bin folder.

paulpall commented 9 months ago

I looked into it and managed to get it working. PR #76 contains my changes.

yihuanlin commented 9 months ago

I looked into it and managed to get it working. PR #76 contains my changes.

Thank you very much for the update. Unfortunately, my uni dropped support for echo360 and switched to an internal platform this year so I cannot test if it works on my Macbook.

soraxas commented 9 months ago

closes by #76