Giter Club home page Giter Club logo

automkv's Introduction

automkv

Automate MKVToolNix with the power of Deno and YAML.

Prerequisites

Install MKVToolNix, or add the following executables to your path:

  • mkvpropedit
  • mkvextract

These are included with MKVToolNix. Alternatively, you can set the paths to these files directly in the MKVPROPEDIT and MKVEXTRACT environment variables, respectively.

Installation

Download the latest release for your platform, or build yourself using Deno:

git clone https://github.com/ndm13/automkv.git
deno compile --allow-run --allow-env --allow-read --allow-write automkv.ts

We require the following permissions:

  • allow-run to interface with mkvpropedit/mkvextract
  • allow-env to load alternate paths from environment variables
  • allow-read to load configuration files
  • allow-write to verify MKV files aren't locked before editing

Usage

automkv watch [automkv-yaml-file]

Watches all the directories specified in the provided automkv.yml file for new media, and will apply the edits to those files.

automkv watch [folder-name]

Scans a folder recursively for any automkv.yml files, and watches for new ones to be added. For any files it finds it will watch all the directories specified in those file for new media, and will apply the edits to those files.

automkv run [automkv-yaml-file]

Directly runs an automkv.yml script (one time) and applies the edits to the files in the script.

automkv.yml

This is the script format for automkv. When using automkv watch [folder], any file that ends in automkv.yml is monitored, so you could use tv-show-name.automkv.yml for instance.

Included is an example file (automkv.example.yml) to get you started:

batch:                                  # Every file has a root batch element
  - watch:                              # Watch as many folders as you want
      folder: Season 1                  # Folder name is static
      files: S01E\d{2}\.mkv             # but file name is a RegExp
    edits:                              # Edits are per-track
      - edit: track:a2                  # Specify using mkvpropedit syntax
        set:                            # Set values to update
          flag-commentary: 1            # Booleans are 1/0 as per spec
          name: Director's Commentary   # Strings don't need any special formatting
    chapters:                           # Chapters will only be mapped if there is
      - Opening Credits                 #  an entry for each chapter.
      - Episode                         # automkv files may include chapters, edits,
      - Ending Credits                  #  both, or neither (but why neither?)

The commands under edits use the same formatting as mkvpropedit and are passed more or less unchanged: see the guide for more details. For the chapters section, updated chapter titles will only be applied if the actual number of chapters is the same as the number provided.

automkv's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

automkv's Issues

Infinite loop while processing overlapping automkv files

When watching multiple automkv.yml files, the updates from one file will trigger the watch of another file, causing a feedback loop. To fix this, there will need to be a complete overhaul of edit tracking that spans all watched files. Perhaps the countdown latch structure can be made global.

Check if titles exist before processing

I've noticed when running automkv on a batch of files, sometimes, some files will have a second audio track for director's commentary and some won't. It would be nice if instead of reporting errors, it could simply skip say it's skipping the file.

INFO Running edits [{"edit":"track:a2","set":{"flag-commentary":1,"name":"Director's Commentary"}}] on example_file.mkv The file is being analyzed. Error: No track corresponding to the edit specification 'a2' was found. The file has not been modified.

This didn't cause any actual errors, it would just help with debugging to label them as skipped tracks as to not confuse them as real errors.

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.