Keresés

Új hozzászólás Aktív témák

  • Archttila

    veterán

    válasz sh4d0w #4056 üzenetére

    megprobaltam script formajaban is (mindharom forditasi lehetoseggel) de egyik sem mukodik

    script
    import os
    from srtranslator import SrtFile
    #from srtranslator.translators.deepl_api import DeeplApi
    #from srtranslator.translators.deepl_scrap import DeeplTranslator
    from srtranslator.translators.translatepy import TranslatePy
    translator = TranslatePy()
    filepath = "/home/alucard/Downloads/film.srt"
    srt = SrtFile(filepath)
    srt.translate(translator, "nl", "hu")
    # Making the result subtitles prettier
    srt.wrap_lines()
    srt.save(f"{os.path.splitext(filepath)[0]}_translated.srt")

    result
    [alucard@arch ~/Downloads]$ python translate.py
    Loading /home/alucard/Downloads/film.srt
    ... Translating chunk. 0 %
    Traceback (most recent call last):
    File "/home/alucard/Downloads/translate.py", line 9, in <module>
    srt.translate(translator, "nl", "hu")
    File "/home/alucard/.local/lib/python3.11/site-packages/srtranslator/srt_file.py", line 154, in translate
    translation = translator.translate(
    ^^^^^^^^^^^^^^^^^^^^^
    File "/home/alucard/.local/lib/python3.11/site-packages/srtranslator/translators/translatepy.py", line 14, in translate
    result = self.translator.translate(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/alucard/.local/lib/python3.11/site-packages/translatepy/translate.py", line 135, in translate
    raise NoResult("No service has returned a valid result")
    translatepy.exceptions.NoResult: No service has returned a valid result

    deepl api-val is neztem ott SyntaxError: invalid decimal literal uzenettel fosta ossze magat.

    Megnezem ezeket hatha [link]

    [ Szerkesztve ]

    Passionate about minimalistic software, the Linux philosophy, and having fun. SFF and AV enthusiast, APU retro gamer.

Új hozzászólás Aktív témák