{"id":20276853,"url":"https://github.com/coolcat467/subtitle-translate","last_synced_at":"2025-06-18T18:05:02.690Z","repository":{"id":260872819,"uuid":"882590970","full_name":"CoolCat467/Subtitle-Translate","owner":"CoolCat467","description":"Translate subtitle files with google translate.","archived":false,"fork":false,"pushed_at":"2025-06-01T01:52:48.000Z","size":419,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-18T18:04:48.099Z","etag":null,"topics":["coolcat467","subtitle","subtitle-translation","subtitle-translator","subtitles","subtitles-parsing","utility"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CoolCat467.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-03T07:56:08.000Z","updated_at":"2025-06-01T01:52:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"48356499-ec96-4955-8caa-b8c5f3f54e52","html_url":"https://github.com/CoolCat467/Subtitle-Translate","commit_stats":null,"previous_names":["coolcat467/subtitle-translate"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/CoolCat467/Subtitle-Translate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoolCat467%2FSubtitle-Translate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoolCat467%2FSubtitle-Translate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoolCat467%2FSubtitle-Translate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoolCat467%2FSubtitle-Translate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CoolCat467","download_url":"https://codeload.github.com/CoolCat467/Subtitle-Translate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoolCat467%2FSubtitle-Translate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260606456,"owners_count":23035349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coolcat467","subtitle","subtitle-translation","subtitle-translator","subtitles","subtitles-parsing","utility"],"created_at":"2024-11-14T13:15:50.393Z","updated_at":"2025-06-18T18:04:57.672Z","avatar_url":"https://github.com/CoolCat467.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Subtitle-Translate\nScript for translating Subtitle (.srt and .vtt) files with google translate.\n\n[![CI](https://github.com/CoolCat467/Subtitle-Translate/actions/workflows/ci.yml/badge.svg)](https://github.com/CoolCat467/Subtitle-Translate/actions/workflows/ci.yml)\n\u003c!-- BADGIE TIME --\u003e\n\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/CoolCat467/Subtitle-Translate/main.svg)](https://results.pre-commit.ci/latest/github/CoolCat467/Subtitle-Translate/main)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)\n[![code style: black](https://img.shields.io/badge/code_style-black-000000.svg)](https://github.com/psf/black)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\n\u003c!-- END BADGIE TIME --\u003e\n\n## Installation\n```console\npip install git+https://github.com/CoolCat467/Localization-Translation-Utility.git\n```\n\n## Usage\nIf you don't already have a separate subtitle file, you can\nextract subtitles from your video file with something like this:\n```console\nffmpeg -i Movie.mkv -map 0:s:0 subtitles.srt\n```\nYou might need to change the last 0 if there is more than one subtitle\ntrack in your file.\nThis script also supports `.vtt` files as of v0.1.0.\nPlease note that this will absolutely not work at all if your video file\ndoes have a baked-in subtitle track!\n\n### Example\nSay `subtitles.srt` is in French, but you want it to be English. In that case, run\n```bash\nsubtitle_translate --source-lang fr subtitles.srt\n```\nwhich will create `subtitles.en.srt` in the current working directory because we didn't specify `--dest-file` and it used the default\noutput filename formatting.\n\nAnother example, say `subtitles.ko.vtt` is in Korean but you want it in English.\n```bash\nsubtitle_translate subtitles.ko.vtt\n```\nwhich will create `subtitles.en.vtt` in the current working directory, because in `vtt` processing mode it's smarter and\nreads the `Language: ko` tag from the file header and knows it's in Korean. Reminder, if `--source-lang` not specified and can't\nfind language from file header if in `vtt` mode, it will default to `auto` and have google translate guess what the source\nlanguage is, which while it works might not be as accurate.\n\n### Command Help Information\n```console\n\u003e subtitle_translate\nusage: subtitle_translate [-h] [--version] [--source-lang SOURCE_LANG] [--source-type SOURCE_TYPE] [--dest-lang DEST_LANG]\n                          [--dest-file DEST_FILE]\n                          source_file\n\nTranslate subtitles from one language to another.\n\npositional arguments:\n  source_file       The source subtitle file to translate.\n\noptions:\n  -h, --help        show this help message and exit\n  --version         Show the program version and exit.\n  --source-lang SOURCE_LANG\n                    The language of the source subtitles (default: 'auto'). Must be a ISO 639-1:2002 language code or 'auto' to\n                    guess.\n  --source-type SOURCE_TYPE\n                    Subtitle source type (default: 'auto'). Must be either 'srt' or 'vtt', or 'auto' to guess from filename.\n  --dest-lang DEST_LANG\n                    The language to translate the subtitles to (default: 'en'). Must be a ISO 639-1:2002 language code.\n  --dest-file DEST_FILE\n                    The destination subtitle file (default: '\u003csource-file\u003e.\u003csource-lang\u003e.\u003csource-file ext\u003e').\n```\n\nWhen run with any valid source file, program save translated results in \u003cdest-file\u003e in the current working directory.\n\n\n\nGeneral code layout:\n\n`main.py` is the command line interface handler.\n\n`subtitle_parser.py` handles reading, parsing, and writing subtitle files.\n\n`translate.py` handles talking to Google Translate.\n\n`extricate.py` (name means taking apart and putting back together) is used by the translation\nmodule to split dictionaries into a keys list and a values list so it can translate all the\nvalues and then rebuild the dictionary by re-combining the keys list and the new translated\nvalues list.\n\n`agents.py` from https://github.com/Animenosekai/useragents/blob/main/pyuseragents/data/list.py\nis by Anime no Sekai and has a ton of random user agents to use so Google Translate\ndoesn't get suspicious of us sending tens of thousands of requests without an API key\n\n\n### Links\n* Source Code - https://github.com/CoolCat467/Subtitle-Translate.git\n* Issues      - https://github.com/CoolCat467/Subtitle-Translate/issues\n\n### License\n-------\nCode and documentation are available according to the GNU General Public License v3.0 (see [LICENSE](https://github.com/CoolCat467/Subtitle-Translate/blob/HEAD/LICENSE)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoolcat467%2Fsubtitle-translate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoolcat467%2Fsubtitle-translate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoolcat467%2Fsubtitle-translate/lists"}