Skip to main content

Translate a subtitle file

Project description

subt

PyPI version Maintainability pre-commit.ci status

Test Coverage Test

ghcr latest ghcr size

Translate a subtitle file

Install

pip install subt
# or
pipx install subt

Run

Generate `.srt` file from [Me at the zoo](https://www.youtube.com/watch?v=jNQXAC9IVRw)
$ yt-dlp 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
$ whisper-ctranslate2 'Me at the zoo [jNQXAC9IVRw].mp4'
$ cat 
1
00:00:00,000 --> 00:00:05,000
Alright, so here we are, one of the elephants.

2
00:00:05,000 --> 00:00:13,000
The cool thing about these guys is that they have really, really, really long trunks.

3
00:00:13,000 --> 00:00:16,000
And that's cool.

4
00:00:16,000 --> 00:00:19,000
And that's pretty much all there is to say.
$ subt 'Me at the zoo [jNQXAC9IVRw].srt' -d ja
Saved: './Me at the zoo [jNQXAC9IVRw].translated.srt'
$ cat 'Me at the zoo [jNQXAC9IVRw].translated.srt'
1
00:00:00,000 --> 00:00:05,000
さて、ここに私たちは象の一人です。

2
00:00:05,000 --> 00:00:13,000
これらの人のクールなことは、彼らが本当に、本当に、本当に長い幹を持っているということです。

3
00:00:13,000 --> 00:00:16,000
そして、それはクールです。

4
00:00:16,000 --> 00:00:19,000
そして、それはほとんどすべてです。

Help

$ subt -h
usage: subt [-h] [-S SERVICE] [-s LANG] [-d LANG] [-V] sub_file

Translate a subtitle file

positional arguments:
  sub_file

options:
  -h, --help     show this help message and exit
  -S SERVICE     service to translate (default: google)
  -s LANG        source language (default: auto)
  -d LANG        destination language (default: en)
  -V, --version  show program's version number and exit

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

subt-0.0.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

subt-0.0.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file subt-0.0.0.tar.gz.

File metadata

  • Download URL: subt-0.0.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.1 Linux/6.5.0-1024-azure

File hashes

Hashes for subt-0.0.0.tar.gz
Algorithm Hash digest
SHA256 bfdab45e33060876929db664379af203f9c3f82d5dfb6b460e087598f124a43b
MD5 ff72c7a427ac94b9796b2004f3f4a10e
BLAKE2b-256 8091edbe4537bf3fe5de2a66d193877f2fb8315da1f0d764595f172ccb295ed8

See more details on using hashes here.

File details

Details for the file subt-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: subt-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.1 Linux/6.5.0-1024-azure

File hashes

Hashes for subt-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae13c7b0f74a4d7b9b719d0b59e76d9e9dd539b5083ad312721b72d51ac34f90
MD5 a025f4660975ab8419c1b46e84330e90
BLAKE2b-256 6c5b62bd8fea8737ddbb0ab8168f0e95dc92c093dd020fb2ec2d43217e459a00

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