sinedie / SRTranslator

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

an idea about deepl #50

Closed ghost closed 1 year ago

ghost commented 1 year ago

using this with proxies probably would be more quick, what about implement this idea?

sinedie commented 1 year ago

Had been kind of busy but I did another built-in translator with PyDeepX, But... it gets banned and proxy won't work. Working on it.

sinedie commented 1 year ago

Already tried, even contribute on PyDeepX, but got banned after even one request. It is a DeepL API limitation

ghost commented 1 year ago

@sinedie Weird i had no prob after resetting router once this one is also fast qnd good there should be no banning on this https://github.com/eggplants/deepl-cli

sinedie commented 1 year ago

I just saw it and could work, but maybe won't be too fast.

  1. It uses playwright (another puppeteer as selenium) with the same 3000 character limit
  2. It opens and closes the browser for each request, we don't do that here.

May be worth the try, but I don't think I'll make put like a built-in translator.

There is the -untested- code if you wanna use it tho:

from deepl import DeepLCLI
from srtranslator.translators.base import Translator

class DeeplCli(Translator):
    max_char = 3000

    def translate(self, text: str, source_language: str, destination_language: str):
        deepl = DeepLCLI(source_language, destination_language)
        return deepl.translate(text)

Also, didn't notice any way to use a proxy

ghost commented 1 year ago

@sinedie deeplx working on me, could you find a way to use proxy? also using chunks method on deeplx probably fix quick ban problem imo. lets dont give up on deeplx!

sinedie commented 10 months ago

@toprak #72 should work for your use case. Give it a try

ghost commented 9 months ago

@sinedie hell yeah! thanks!