Skip to main content

MTL Agent for Media Processing

This repository contains the code for a Machine Translation (MTL) agent that can perform automatic translation, subtitle extraction, video encoding, and thumbnail generation. Contrary to its name, it does not contain formal code for MTL (yet), it only interacts with API services to perform the translation.

Features

  • Automatic Translation: Translates text from one language (usually English) to another (Bulgarian).
  • Subtitle Extraction: Uses FFmpeg to extract subtitles from video files.
  • Video Encoding: Encodes videos in different formats.
  • Thumbnail Generation: Automatically generates thumbnails from videos.
  • Video upload: Uploads videos to Vbox7 currently.
  • Full pipeline: All of the above features can be used in a single pipeline.

To get a feel for it, run mtl_agent --help

Currently a hobby project that combines most of my post-translation workflow into a single tool that automates away encode and upload!

Installation

To install the package, run:

pip install mtl_agent

Additionally, if the upload functionality is to be used, you must install the playwright browser:

playwright install

Configuration

The agent is configurable and may need credentials. Those are stored by default under the user's home directory at ~/.config/mtl_agent, but can be adjusted using the --root flag before all options. If you opt to use DeepL's API, you must provide an API key, which can be obtained from their website. The key can be provided as a field inside the secrets.json file located at the project settings/root directory. The file should look like this:

{
    "deepl_api_key": "YOUR_API_KEY"
}

If Google's translation service is used, your secrets.json file should include the project_id field.

[!TIP] The file can contain both.


For automatic upload to the available websites, Playwright is used to orchestrate the uploading functionality.

The program will look for a profile_default.json file at the configuration root. You must manually copy the cookies from your browser into the file. The cookies are used to authenticate the user and allow the program to upload videos to the services.

The file (currently) should look like the following:

{
    "vbox7remember": "VBOX7REMEMBER_COOKIE,
    "larabox_session": "LARABOX_SESSION_COOKIE",
    "ukey": "ANIMES_PORTAL_UKEY",
}

[!NOTE] The available websites to upload to are currently limited, but more eager contributors are welcome to add more!

[!CAUTION] Be very careful if you are storing your credentials in a public repository/dotfiles store.


As a hobby project, this is not actively maintained, and extensive instructions might not be available. If you have any questions on how to get started or how to contribute, feel free to open a PR, or simply reach out.

Metadata

Release files for mtl-agent 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mtl-agent 0.3.4
File Size Uploaded
mtl_agent-0.3.4.tar.gz 12.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mtl-agent 0.3.4
File Interpreter ABI Platform
mtl_agent-0.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 25.9 kB

Release files / mtl_agent-0.3.4.tar.gz

Download URL mtl_agent-0.3.4.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bfd61ae632796fea8391bda489a79c36b8a426184df29dc377b98cd8a92f57b7
BLAKE2b-256 checksum
How to use checksums
c6e0873da6a9b829254e4d29108a1c9cc4fe42e146165e4d2fbf21718e9821d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release files / mtl_agent-0.3.4-py3-none-any.whl

Download URL mtl_agent-0.3.4-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f36b195879647f9f1765d0754159240bbdbdf50e90509b3783b23ab3da97592d
BLAKE2b-256 checksum
How to use checksums
2a126d68c83cfe10364ea941cc3677fd33343e36ad98f194e4a06a960b48ea43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release history Release notifications | RSS feed

This release

0.3.4 This release

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page