Giter Club home page Giter Club logo

mpv-autosub's Introduction

Automatic subtitle downloading for MPV

  • Cross-platform: Windows, Mac and Linux
  • Multi-language support
  • Subtitle provider login support
  • No hotkeys required: opening a video will automatically trigger subtitles to download
    (Only when the right subtitles are not yet present)

Dependencies

This Lua script uses the Python program subliminal to download subtitles. Make sure you have both installed: ย 

pip install subliminal

Setup

  1. Copy autosub.lua into:

    OS Path
    Windows [Drive]:\Users\[User]\AppData\Roaming\mpv\scripts
    Mac/Linux ~/.config/mpv/scripts/
    mkdir ~/.config/mpv/scripts
    cat > ~/.config/mpv/scripts/autosub.lua
    [Paste script contents and CTRL+D]
  2. Specify the correct subliminal location for your system:

    • To determine the correct path, use:

      OS App Command
      Windows Command Prompt where subliminal
      Mac/Linux Terminal which subliminal
    • Copy this path to the subliminal variable at the start of the script:

      local subliminal = '/path/to/your/subliminal'

      On Windows, the backslashes in the path need to be escaped, e.g.:
      C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37\\Scripts\\subliminal.exe

Customization

  • Optionally change the subtitle languages / ISO codes.

This script is under the MIT License, so you are free to modify and adapt this script to your needs:
check out the MPV Lua API for more information.

If you find yourself unable to find the correct subtitles for some niche movies/series, you might be interested in the submod command line tool I've written to manually correct subtitle timing.

Credits

Inspired by selsta's and fullmetalsheep's autosub scripts.

mpv-autosub's People

Contributors

ask1234560 avatar davidde avatar fn-ix 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.