ThioJoe / Auto-Synced-Translated-Dubs

Automatically translates the text of a video based on a subtitle file, and then uses AI voice services to create a new dubbed & translated audio track where the speech is synced using the subtitle's timings.
GNU General Public License v3.0
1.56k stars 156 forks source link

HTTP 400 from Google (googleapiclient.errors.HttpError:) #48

Closed oriongplays closed 1 year ago

oriongplays commented 1 year ago

Hello!

I've tried using, but I'm getting error 400 from Google.

errror400

Any ideias? I've tried reseting my client secret but that didn't worked

Also here is the SRT file: subtitles.zip


Translating text using Google...
Traceback (most recent call last):
  File "D:\auto-dub\main.py", line 262, in <module>
    process_language(langData)
  File "D:\auto-dub\main.py", line 240, in process_language
    individualLanguageSubsDict = translate.translate_dictionary(individualLanguageSubsDict, langDict, skipTranslation=skipTranslation)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\auto-dub\translate.py", line 169, in translate_dictionary
    ).execute()
      ^^^^^^^^^
  File "C:\Users\pdv\AppData\Local\Programs\Python\Python311\Lib\site-packages\googleapiclient\_helpers.py", line 130, in positional_wrapper
    return wrapped(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\pdv\AppData\Local\Programs\Python\Python311\Lib\site-packages\googleapiclient\http.py", line 938, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://translation.googleapis.com/v3beta1/projects/your-project-name:translateText?alt=json returned "Invalid 'parent'.; Invalid resource name. Missing locations/ part.;  Resource type: location". Details: "Invalid 'parent'.; Invalid resource name. Missing locations/ part.;  Resource type: location"> ```  
ThioJoe commented 1 year ago

This is because you haven't set the google_project_id in the cloud_service_settings.ini file.