sinedie / SRTranslator

SRT files translator
Do What The F*ck You Want To Public License
219 stars 27 forks source link

deepl scraper fails on MacM1 due to malformed download link. #52

Closed zackees closed 11 months ago

zackees commented 1 year ago

Hi I ran into this bug about a month ago (haven't tried to repro it since).

The bug is in the webdriverdownload dependency that fails to find the download link for the chrome driver when on mac m1 due to the way the download url is constructed, which will 404 on the mac m1.

A proper fix ideally would be applied in the webdriverdownload dependency itself. However there is an explicit override that could be used at your layer to set the download link explicitly. The x86 version should work with the Mac M1 arm processor.

Another fix would be to use my package called https://github.com/zackees/open-webdriver which has automated platform tests to ensure proper functioning on all platforms.

Thank you for an excellent library. I use it extensively.

sinedie commented 1 year ago

Hey. Yeah, some people are having trouble with the driver download. This weekend I'll check your package and probably make a patch.

Thank you for using it :D

sinedie commented 1 year ago

Ok, I'm back.

I took a look on your repo and it is really easy to use, but I don't think I'll use it, at least yet. This is why:

  1. I really can't see if you are downloading the driver on each run -Are your are saving that file?-
  2. There is no simple way to set a proxy to the driver without changing some code, and proxy is a must

It think we could solve this issues if you wanna.

zackees commented 1 year ago

It should only download once. Are you seeing it download multiple times?

Your status quo solution almost works, you can just override the download link by monkey patching sys.machine or whatever is being used to determine the CPU type so that it returns x86 on mac.

zackees commented 1 year ago

Went ahead and forked it and setting the bitness to the proper value does indeed download the correct firefox but the next error that occurs is that the binary can't be found. So there are multiple problems on mac, beside this.

sinedie commented 1 year ago

Hey, sry for the late reply.

Maybe you could create your own custom chrome driver and pass it to DeepLTranslator. No need to use the firefox one.

You still get all the benefits of this package. Just need a way to rotate the proxy to avoid getting banned if you use it in a really large file.