Skip to main content

Python wrapper for MakeMKV

Project description

python-makemkv

python-makemkv is a simple python wrapper for MakeMKV (written by GuinpinSoft inc.). While it can be imported as a module, it also offers a command-line interface that tries to be more intuitive than makemkvcon.

Requirements

python-makemkv requires Python 3.9 or later.

Additionally, a copy of MakeMKV is required, which can be downloaded from their website. You also need to ensure that makemkvcon can be run from the terminal, e. g. by adding its location to your PATH environment variable.

Installation

python-makemkv can be installed using pip.

pip install makemkv

If you want to use the CLI, you need to install it with

pip install makemkv[cli]

or install click and rich manually.

Usage

See full documentation on Read the Docs.

To get information about discs, you need to instantiate a makemkv.MakeMKV object which provides its makemkv.MakeMKV.info() method.

from pprint import pp
from makemkv import MakeMKV

makemkv = MakeMKV('/dev/sr0')
disc_info = makemkv.info()
pp(disc_info)

To create a mkv file from the first title of the first disc you can use makemkv.MakeMKV.mkv(). Since this will take some time you can define a function that analyzes the program's progress or you can use the makemkv.ProgressParser class to show pretty progress bars.

from makemkv import MakeMKV, ProgressParser

with ProgressParser() as progress:
    makemkv = MakeMKV(0, progress_handler=progress.parse_progress)
    makemkv.mkv(0, '~/Videos/Really Cool Movie (2021)')

python-makemkv uses the logging module from Python's standard library, see Logging HOWTO to change the output format or verbosity. To change the verbosity of specific messages, you can modify the makemkv.output_codes.MESSAGE_CODES dictionary accordingly. If you think that the log level of a specific message isn't appropriate for most users, feel free to open an issue or a pull request.

Command-line interface

Usage: pymakemkv COMMAND [OPTIONS]

Options:
  -n, --disc-nr NR      Specify disc number. Alternatively you can specify an
                        input with -i/--input. Defaults to 0.
  -i, --input PATH      Specify input, can be either a device, a .IFO file or
                        a VIDEO_TS folder.
  -l, --minlength SECS  Specify minimum title length in seconds.
  -c, --cache MB        Specify size of read cache in megabytes.
  -f, --info-file FILE  Write disc info to file.
  -j, --json            Show disc info in JSON format.
  -v, --verbose         Show more detailed logs.
  -q, --quiet           Don't show logs.
  --no-bar              Don't show progress bars.
  --no-info             Don't show disc info.
  --help                Show this message and exit.
  -t, --title NR        Select title to be ripped, can be either an integer
                        starting with 0 or the keyword "all". Defaults to 0.
                        [Commands: mkv]
  -o, --output DIR      Specify output directory for created mkv files.
                        Defaults to current directory. [Commands: mkv, backup]
  -d, --decrypt         Decrypt stream files during backup. [Commands: backup]

Commands:
  backup  Backup whole disc.
  info    Display information about a disc.
  mkv     Copy titles from disc.

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

makemkv-0.2.1.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

makemkv-0.2.1-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file makemkv-0.2.1.tar.gz.

File metadata

  • Download URL: makemkv-0.2.1.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.27.1

File hashes

Hashes for makemkv-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f2c7df6c6ba440609dc0cee3beb2f6386a54d523202f740b46fd62e4023d491e
MD5 75554597bcd97d0ab67f1e8e4682ad0c
BLAKE2b-256 f6064e855067fd43393d849f8811cf3c015547edd126359b88c5b8fe92703865

See more details on using hashes here.

File details

Details for the file makemkv-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: makemkv-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.27.1

File hashes

Hashes for makemkv-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0d771d5071ba515a1c9835015241dada5e813e4e122b4bfa57ec14f0557d5c2
MD5 f97d63173b10464491a246afc01be0aa
BLAKE2b-256 8c7e9e771cef5e6968a37586b1519fe598819cc1280a7b98da2c4d4c586c0ed9

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