2023-08-02 10:35:46 -07:00
|
|
|
# mpv-youtube-queue
|
|
|
|
|
2023-08-06 23:30:28 -07:00
|
|
|
<div align="center">
|
|
|
|
|
|
|
|
A Lua script that implements the YouTube 'Add to Queue' functionality for mpv
|
|
|
|
|
|
|
|
</div>
|
2023-08-02 10:35:46 -07:00
|
|
|
|
|
|
|
![mpv-youtube-queue image](.assets/mpv-youtube-queue.png)
|
|
|
|
|
|
|
|
## Features
|
|
|
|
|
|
|
|
- Add YouTube videos to a queue from the clipboard
|
2023-08-04 00:54:58 -07:00
|
|
|
- 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
|
2023-08-06 02:23:12 -07:00
|
|
|
- Edit the order of videos in the queue
|
2023-08-06 20:35:33 -07:00
|
|
|
- Open the URL or channel page of the currently playing video in a new browser tab
|
2023-08-04 00:54:58 -07:00
|
|
|
- Download the currently playing video
|
2023-08-06 23:30:28 -07:00
|
|
|
- Download a video in the queue
|
2023-08-02 10:35:46 -07:00
|
|
|
|
|
|
|
## Notes
|
|
|
|
|
|
|
|
- This script uses the Linux `xclip` utility to read from the clipboard.
|
2023-08-04 00:54:58 -07:00
|
|
|
If you're on macOS or Windows, you'll need to adjust the `clipboard_command`
|
|
|
|
config variable in [mpv-youtube-queue.conf](./mpv-youtube-queue.conf)
|
2023-08-02 10:35:46 -07:00
|
|
|
- When adding videos to the queue, the script fetches the video name using
|
|
|
|
`yt-dlp`. Ensure you have `yt-dlp` installed and in your PATH.
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
This script requires the following software to be installed on the system
|
|
|
|
|
|
|
|
- [xclip](https://github.com/astrand/xclip)
|
|
|
|
- [yt-dlp](https://github.com/yt-dlp/yt-dlp)
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
- Copy the `mpv-youtube-queue.lua` script to your `~~/scripts` directory
|
2023-08-06 02:23:12 -07:00
|
|
|
(`~/.config/mpv` on Linux)
|
2023-08-02 10:35:46 -07:00
|
|
|
- Optionally copy the `mpv-youtube-queue.conf` to the `~~/script-opts` directory
|
2023-08-06 02:23:12 -07:00
|
|
|
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 queue
|
|
|
|
- `download_current_video - ctrl+d`: Download the currently playing video
|
2023-08-06 23:30:28 -07:00
|
|
|
- `download_selected_video - ctrl+D`: Download the currently selected video
|
|
|
|
in the queue
|
2023-08-07 02:17:05 -07:00
|
|
|
- `move_cursor_down - ctrl+j`: Move the cursor down one row in the queue
|
|
|
|
- `move_cursor_up - ctrl+k`- Move the cursor up one row in the queue
|
2023-08-06 02:23:12 -07:00
|
|
|
- `move_video - ctrl+m`: Mark/move the selected video in the queue
|
2023-08-06 23:30:28 -07:00
|
|
|
- `play_next_in_queue - ctrl+n`: Play the next video in the queue
|
|
|
|
- `open_video_in_browser - ctrl+o`: Open the currently playing video in the browser
|
2023-08-06 02:23:12 -07:00
|
|
|
- `open_channel_in_browser - ctrl+O`: Open the channel page for the currently
|
|
|
|
playing video in the browser
|
|
|
|
- `play_previous_in_queue - ctrl+p`: Play the previous video in the queue
|
|
|
|
- `print_current_video - ctrl+P`: Print the name and channel of the currently
|
|
|
|
playing video to the OSD
|
|
|
|
- `print_queue - ctrl+q`: Print the contents of the queue to the OSD
|
2023-08-06 17:31:05 -07:00
|
|
|
- `remove_from_queue - ctrl+x`: Remove the currently selected video from the
|
|
|
|
queue
|
2023-08-06 23:30:28 -07:00
|
|
|
- `play_selected_video - ctrl+ENTER`: Play the currently selected video in
|
|
|
|
the queue
|
2023-08-06 02:23:12 -07:00
|
|
|
|
|
|
|
### Default Option
|
|
|
|
|
|
|
|
- `browser - firefox`: The browser to use when opening a video or channel page
|
2023-08-06 20:35:33 -07:00
|
|
|
- `clipboard_command - xclip -o`: The command to use to get the contents of the clipboard
|
2023-08-06 02:23:12 -07:00
|
|
|
- `cursor_icon - ➤`: The icon to use for the cursor
|
2023-08-06 20:35:33 -07:00
|
|
|
- `display_limit - 6`: The maximum amount of videos to show on the OSD at once
|
|
|
|
- `download_directory - ~/videos/YouTube`: The directory to use when
|
|
|
|
downloading a video
|
2023-08-06 02:23:12 -07:00
|
|
|
- `download_quality 720p`: The maximum download quality
|
2023-08-06 20:35:33 -07:00
|
|
|
- `downloader - curl`: The name of the program to use to download the video
|
2023-08-06 02:23:12 -07:00
|
|
|
- `font_name - JetBrains Mono`: The name of the font to use
|
2023-08-06 03:13:13 -07:00
|
|
|
- `font_size - 12`: Size of the font
|
2023-08-06 20:35:33 -07:00
|
|
|
- `marked_icon - ⇅`: The icon to use to mark a video as ready to be moved
|
|
|
|
in the queue
|
2023-08-06 12:11:34 -07:00
|
|
|
- `show_errors - yes`: Show error messages on the OSD
|
2023-08-06 20:35:33 -07:00
|
|
|
- `ytdlp_output_template - %(uploader)s/%(title)s.%(ext)s`: The [yt-dlp output
|
|
|
|
template string](https://github.com/yt-dlp/yt-dlp#output-template)
|
2023-08-07 02:17:05 -07:00
|
|
|
- Full path with the default `download_directory`
|
|
|
|
is: `~/videos/YouTube/<uploader>/<title>.<ext>`
|
2023-08-02 10:35:46 -07:00
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
This project is licensed under the terms of the GPLv3 license.
|