Skip to main content

A simple tool that translates video subtitles

Project description

About

Translate Video Subtitles

subtrs is a simple tool that translates subtitles from files.

The main idea came when using the YouTube auto-tool to translate my videos subtitles, I saw that the translation sucked.
So I decided to create this simple tool and translate my subtitles more successfully.

Enjoy!

https://gitlab.com/dslackw/images/raw/master/subtrs/subtrs.gif

Installing

$ pip3 install subtrs --upgrade

Command line usage

Usage: subtrs [subtitles_file] [destination languages]

       Simple tool that trlanslates video subtitles

       Support subtitles files [*.sbv, *.vtt, *.srt]
       Destination languages [en,de,ru] etc.

Optional arguments:
       --color      View translated text with colour.
       --progress   Show progress bar.
  -l,  --languages  Show all supported languages.
  -v,  --version    Print the version and exit.
  -h,  --help       Show this message and exit.

Example

$ subtrs subtitles.srt el --progress
[1/1] Subtitles 'captions.srt' translate to greek
Processing |########                        | 27% - 24s

An example which create multiple subtitles files:

$ subtrs subtitles.srt zh-cn,de,ru --color
[1/3] Subtitles 'captions.srt' translate to chinese

[en] << - Did you hear that?

[zh-cn] >> - 你听到了吗?

[en] << - Hear what?

[zh-cn] >> - 听到什么?

[en] << Are you sure this line is clean?

[zh-cn] >> 你确定这条线是干净的吗?

[en] << Yeah, of course I'm sure.

[zh-cn] >> 是的,我当然确定。

[en] << I better go.

[zh-cn] >> 我最好去。

[en] << - Freeze! Police!

[zh-cn] >> - 冻结!警察!

[en] << - Hands on your head!

[zh-cn] >> - 把手放在你的头上!

[en] << Do it! Do it now!

[zh-cn] >> 去做吧!现在做
.
.
.

This command should translate and create three different files, one with Chinese subtitles, one with German and one with Russia subtitles.

Project layout

├── CHANGES.md
├── LICENSE.txt
├── README.rst
├── bin
   ├── __init.py__
   └── subtrs
├── requirements.txt
├── setup.py
└── subtrs
    ├── __init__.py
    ├── __metadata__.py
    └── main.py

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

subtrs-2.0.tar.gz (12.1 kB view details)

Uploaded Source

File details

Details for the file subtrs-2.0.tar.gz.

File metadata

  • Download URL: subtrs-2.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for subtrs-2.0.tar.gz
Algorithm Hash digest
SHA256 291f8b7ee0887248237028daa1e79848de744f73389ab956770257d7d9ea0043
MD5 bd297d9e7ec1f42d349756670d08c0bd
BLAKE2b-256 f2688848bfcc7e63a1360749158e44fea9a622898fc818c18a128ca0cccad6e6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page