mirror of
https://github.com/ksyasuda/mpv-youtube-queue.git
synced 2025-12-05 02:53:38 -08:00
33918e87d02839f9fd1f46427bb7869e9d8f495c
mpv-youtube-queue
A Lua script that implements the YouTube 'Add to Queue' functionality in MPV
Features
- Add YouTube videos to a queue from the clipboard
- Fetch and display the video and channel names of the videos in the queue
- Select a video to play from the queue with an interactive menu, or navigate through the queue with keyboard shortcuts
- Edit the order of videos in the queue
- Open the URL or channel page of the currently playing video in a new browser tab
- Download the currently playing video
Notes
- This script uses the Linux
xcliputility to read from the clipboard. If you're on macOS or Windows, you'll need to adjust theclipboard_commandconfig variable in mpv-youtube-queue.conf - When adding videos to the queue, the script fetches the video name using
yt-dlp. Ensure you haveyt-dlpinstalled and in your PATH.
Requirements
This script requires the following software to be installed on the system
Installation
- Copy the
mpv-youtube-queue.luascript to your~~/scriptsdirectory (~/.config/mpvon Linux) - Optionally copy the
mpv-youtube-queue.confto the~~/script-optsdirectory to customize the script configuration as described in the next section
Configuration
Default Keybindings
add_to_queue - ctrl+a: Add a video in the clipboard to the queuedownload_current_video - ctrl+d: Download the currently playing videomove_cursor_down - ctrl+DOWN: Move the cursor down one row in the queuemove_cursor_up - ctrl+UP- Move the cursor up one row in the queuemove_video - ctrl+m: Mark/move the selected video in the queueopen_channel_in_browser - ctrl+O: Open the channel page for the currently playing video in the browseropen_video_in_browser - ctrl+o: Open the currently playing video in the browserplay_next_in_queue - ctrl+n: Play the next video in the queueplay_previous_in_queue - ctrl+p: Play the previous video in the queueplay_selected_video - ctrl+ENTER: Play the currently selected video in the queueprint_current_video - ctrl+P: Print the name and channel of the currently playing video to the OSDprint_queue - ctrl+q: Print the contents of the queue to the OSDremove_from_queue - ctrl+x: Remove the currently selected video from the queue
Default Option
browser - firefox: The browser to use when opening a video or channel pageclipboard_command - xclip -o: The command to use to get the contents of the clipboardcursor_icon - ➤: The icon to use for the cursordisplay_limit - 6: The maximum amount of videos to show on the OSD at oncedownload_directory - ~/videos/YouTube: The directory to use when downloading a videodownload_quality 720p: The maximum download qualitydownloader - curl: The name of the program to use to download the videofont_name - JetBrains Mono: The name of the font to usefont_size - 12: Size of the fontmarked_icon - ⇅: The icon to use to mark a video as ready to be moved in the queueshow_errors - yes: Show error messages on the OSDytdlp_output_template - %(uploader)s/%(title)s.%(ext)s: The yt-dlp output template string
License
This project is licensed under the terms of the GPLv3 license.
Languages
Lua
100%
