GithubHelp home page GithubHelp logo

m-krastev / mtl_agent Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 2.4 MB

MTL Agent for Media Processing

Home Page: https://pypi.org/project/mtl-agent/

Python 100.00%
aegisub deepl ffmpeg media pyppeteer translation

mtl_agent's Introduction

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.

mtl_agent's People

Contributors

m-krastev avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.