Skip to content

Interactive subtitles for mpv. Instantly translate selected word/sentence.

License

Notifications You must be signed in to change notification settings

mujeebcpy/interSubs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

interSubs

Interactive subtitles for mpv, that was made to help study languages.
Easily tweaked and customizable.

This is a fork of this plugin This is especially configured for Malayalam Dictionary. There are so many dictionaries are available as given below. dictml.dict is an english to malayalam offline tab divided dictionary. you can also enable google translate too. but it will take more time and need good internet connection, so it is not activated by default. you can edit and activate it in interSubs_config.py open interSubs_config.py and go to line number 28. change it into translation_function_names = ['tab_divided_dict','google']

    00:02:23,046 --> 00:02:25,990
    bla bla
    00:02:28,020 --> 00:02:33,084
    waka waka
    
    00:02:23,046 --> 00:02:28,020
    bla bla
    00:02:28,020 --> 00:02:33,084
    waka waka

Requirements

  • mpv 0.27 (I don't know if it will work with mpv front-ends.)
  • python 3
  • pyqt5 (pip/pacman/etc)
  • composite manager; xcompmgr or sth.
  • numpy (pip/pacman/etc)
  • beautifulsoup4 (pip/pacman/etc)
  • lua
  • socat
  • pkill
  • xdotool (for hiding subtitles when minimizing mpv or switching window)
  • optional: chromium (for external translation, other browser can be specified)
  • optional: wget (for listening to pronunciation)

Installation

  • mv interSubs.py interSubs.lua interSubs_config.py dicml.dict ~/.config/mpv/scripts/; For any Additional Changes do the following
  • Edit configuration file interSubs_config.py
  • Edit interSubs.lua to add option where interSubs will start automatically.
  • For Mac also edit configuration at interSubs.lua
  • On KDE(kwin) go to composite and uncheck "Allow applications to block compositing". Screenshot.
  • For Windows - port it yourself.

Usage

  • Start video with mpv & select subtitles.
  • Press F5 to start/stop interSubs.
    • Starts automatically with files/paths specified in interSubs.lua
  • Point cursor over the word to get popup with translation.

Buttons bellow may be reassigned in config

  • Click on the word to look it up on another translator in the browser.
  • Right-click on the word to hear its pronunciation.
  • Wheel - scroll through transitions in popup.
  • Wheel+Ctrl - resize subtitles.
  • Wheel+Shift - change subtitles' vertical position.
  • Wheel-click - cycle through auto_pause options.
  • Wheel-click-left/right - +/- auto_pause_min_words. (fancy mouses)
  • Back-click - translate whole sentence. (fancy mouses)

Important

  • May have issues working in a multi-monitor system.

About

Interactive subtitles for mpv. Instantly translate selected word/sentence.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.6%
  • Lua 4.4%