Giter VIP home page Giter VIP logo

subtitles-cleaning's Introduction

Setup for MS Windows

Description

This script removes all brackets areas (e.g. [scary music]) on subtitles located within .mkv files as well as in the same directory (provided the basename of the .mkv is contained in the .srt file). It also selects a set of languages to keep and discards the others.
The input is a folder on your computer, and will clean all .mkv in it (in all subfolders as well).

Setup

  1. Requirements listed in the requirements.txt file

  2. The script is built upon MKVToolNix that can be downloaded there: https://mkvtoolnix.download/downloads.html

  3. Once it is downloaded, you might have to change the 3 following files of the repo located in the batch_files folder:

  • mkvextract.bat
  • mkvinfo.bat
  • mkvmerge.bat
    In each of them, you will find a path to where the MKVToolNix got installed. If it is located in a different place in your computer, change the paths in those files.

Run

Simply run the script with python.
3 flags are available:
--videos_dirpath: folder where the .mkv files are located
--languages: list of languages you want to keep and clean (as ISO 639-1 Format of Language Name, e.g. "French") --overwrite_all_files: bool to overwrite all original files instead of deciding individually

Expected use:

Image of logs

Warning:

MKVToolNix does not allow overwriting files, so make sure you have enough space to run the script (~2x the size of your biggest .mkv file).

subtitles-cleaning's People

Contributors

lrenaux-bdai avatar renauxlouis avatar

Stargazers

t3nzin avatar

Watchers

James Cloos avatar  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.