A simple Python wrapper for SMPlayer that adds clickable subtitle functionality for online dictionary searching, similar to the feature in PotPlayer.
This application embeds an SMPlayer instance into a custom Qt window. Below the video, it displays the current subtitles in a text box. You can select any word or phrase from the subtitles to instantly look it up in an online dictionary using your web browser.
This project is designed for Linux and has several dependencies.
You must have the following command-line tools installed and available in your system's PATH.
poetry(https://python-poetry.org/docs/#installation)mpvsmplayer(must be configured to usempvas its multimedia engine)xdotoolsocatpstree(usually part of thepsmiscpackage)
The project uses Python ~3.13 and the dependencies are managed by Poetry.
-
Clone the repository:
git clone https://github.com/kpliuta/smplayer-sub-search.git cd smplayer-sub-search -
Install project dependencies using Poetry:
poetry install
This will create a virtual environment and install
PySide6.
Run the application from the project's root directory using Poetry:
poetry run smplayer-sub-searchThis will launch the application window with SMPlayer embedded. You can then open a video file using the SMPlayer controls (File -> Open or Ctrl+O). When subtitles are displayed, they will appear in the text box at the bottom.
To change the default web browser or the dictionary URL, you need to edit the global variables at the top of the smplayer_sub_search.py script.
-
Browser: Change the
BROWSER_BINvariable to your browser's executable.BROWSER_BIN = 'google-chrome-stable'
-
Dictionary URL: Change the
DICT_URLvariable. The{query}placeholder will be replaced with the text you select.DICT_URL = 'https://context.reverso.net/translation/spanish-english/{query}'
This project is licensed under the MIT License.