Skip to content

Commit

Permalink
Fix reorder queue (#19)
Browse files Browse the repository at this point in the history
* Fix reorder queue function for when from_index < to_index

* update default config

* Fix clipboard function and linting errors

* Update README.md with improved descriptions and installation instructions
  • Loading branch information
ksyasuda authored Aug 29, 2024
1 parent 84a860f commit 870f747
Show file tree
Hide file tree
Showing 3 changed files with 497 additions and 471 deletions.
40 changes: 15 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,36 @@

<div align="center">

A Lua script that implements the YouTube 'Add to Queue' functionality for mpv
A Lua script that replicates and extends the YouTube "Add to Queue" feature for mpv

</div>

![mpv-youtube-queue image](.assets/mpv-youtube-queue.png)

## Features

- Add videos to a queue from the clipboard
- Works with links from any site
[supported by yt-dlp](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md "yd-dlp supported sites page")
- An interactive menu to show the queue, to select a video to play, or to edit the order of the queue
- Customizable keybindings to interact with the currrently playing video and the
queue
- Open the URL or channel page of the currently playing video in a new browser tab
- Download a video in the queue using yt-dlp
- Customizable download options
- Integrates with the internal mpv playlist

## Notes

- This script uses the Linux `xclip` utility to read from the clipboard.
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)
- 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.
- **Interactive Queue Management:** A menu-driven interface for adding, removing, and rearranging videos in your queue
- **yt-dlp Integration:** Works with any link supported by [yt-dlp](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md "yd-dlp supported sites page") and supports downloading a supported video in the queue
- **Internal Playlist Integration:** Seamlessly integrates with mpv's internal playlist for a unified playback experience
- **Customizable Keybindings:** Assign your preferred hotkeys to interact with the currently playing video and queue

## Requirements

This script requires the following software to be installed on the system

- [xclip](https://github.com/astrand/xclip)
- One of [xclip](https://github.com/astrand/xclip), [wl-clipboard](https://github.com/bugaevc/wl-clipboard), or any command-line utility that can paste from the system clipboard
- Windows users can utilize `Get-Clipboard` from powershell by setting the `clipboard_command` in `mpv-youtube-queue.conf` file to the following: `clipboard_command=powershell -command Get-Clipboard`
- [yt-dlp](https://github.com/yt-dlp/yt-dlp)

## Installation

- Copy the `mpv-youtube-queue.lua` script to your `~~/scripts` directory
(`~/.config/mpv` on Linux)
- Optionally copy the `mpv-youtube-queue.conf` to the `~~/script-opts` directory
to customize the script configuration as described in the next section
- Copy `mpv-youtube-queue.lua` script to your `~~/scripts` directory
- `~/.config/mpv/scripts` on Linux
- `%APPDATA%\mpv\scripts` on Windows
- Optionally copy `mpv-youtube-queue.conf` to the `~~/script-opts` directory
- `~/.config/mpv/script-opts` on Linux
- `%APPDATA%\mpv\script-opts` on Windows
to customize the script configuration as described in the next section

## Configuration

Expand All @@ -67,7 +57,7 @@ This script requires the following software to be installed on the system
- `play_selected_video - ctrl+ENTER`: Play the currently selected video in
the queue

### Default Option
### Default Options

- `browser - firefox`: The browser to use when opening a video or channel page
- `clipboard_command - xclip -o`: The command to use to get the contents of the clipboard
Expand Down
2 changes: 1 addition & 1 deletion mpv-youtube-queue.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ display_limit=10
download_directory=~/videos/YouTube
download_quality=720p
downloader=curl
font_name=JetBrains Mono
font_name=JetBrainsMono
font_size=12
marked_icon=⇅
menu_timeout=5
Expand Down
Loading

0 comments on commit 870f747

Please sign in to comment.