Search and play YouTube videos directly from mpv media player
This Lua script for mpv media player enables you to search and play YouTube videos without leaving your player. It uses zenity/kdialog/mpinput for the user interface and youtube-dl/yt-dlp for video search and playback.
Based on mpv-zenity-open-files by alifarazz.
- Search YouTube directly from mpv
- Multiple UI options: Zenity, Kdialog, or mpinput
- Fast and lightweight
- Simple keyboard shortcuts
- Works on Linux, macOS, and Windows (mpinput version)
- mpv media player
- yt-dlp or youtube-dl
- For GUI versions: Zenity or Kdialog
wget -O ~/.config/mpv/scripts/youtube-search.lua https://github.com/rozari0/mpv-youtube-search/raw/master/youtube-search.luaFor Kdialog:
wget -O ~/.config/mpv/scripts/youtube-search.lua https://github.com/rozari0/mpv-youtube-search/raw/master/youtube-search-kdialog.luaFor mpinput:
wget -O ~/.config/mpv/scripts/youtube-search.lua https://github.com/rozari0/mpv-youtube-search/raw/master/youtube-search-mpinput.lua| Key Combination | Action |
|---|---|
| CTRL+SHIFT+S | Search YouTube videos |
Click to expand customization options
Edit the bottom of the youtube-search.lua file to change the default keybinding.
mp.add_key_binding("Ctrl+Shift+s", "youtube-search", youtube_search)Modify the limit variable in youtube-search.lua to change the number of search results displayed.
local limit = 10 -- Change this value- Windows Users: Only the mpinput version is designed to work on Windows
- Recommended: Using with mpv-gallery-view for an enhanced browsing experience
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is licensed under the MIT License - see the LICENSE file for details.
- Based on mpv-zenity-open-files by alifarazz
- Powered by yt-dlp
Made with love for the mpv community


