Skip to content

Commit

Permalink
Feature: Add Support for mpv-youtube-queue-server (#20)
Browse files Browse the repository at this point in the history
* Add history db

- Sends video data to backend server on configured port and inserts into
a mysql database

* add option to disable history db function

* Squash bugs

- update strip command to remove newline characters
- add history db function call to playback restart listener to catch
first video

* squash more bugs

- add debug
- fix history db for repeated calls and first play
- fix is file
- change print current video to use full file path if showing a file
- remove unused functions
- fix video title when selecting video from list

* disable history db by default

- change default config
- add back line to prevent from running when disabled

* appease the linter

* update readme

* add load-file even listener for adding to history db

* add save/load queue functions

* fix load_queue command

- fix parsing/conversion to table from json list

* update readme

* add new keybinding options

* add keybinding options

* disable debug and clean up code

- disable debug mode
- sanitize clipboard content
- clean up error handling
  • Loading branch information
ksyasuda committed Sep 9, 2024
1 parent 0739b93 commit 3bbbcae
Show file tree
Hide file tree
Showing 3 changed files with 194 additions and 36 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A Lua script that replicates and extends the YouTube "Add to Queue" feature for
## Features

- **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
- **yt-dlp Integration:** Gathers video info and allows downloading with any link supported by [yt-dlp](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md "yd-dlp supported sites page")
- **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

Expand Down Expand Up @@ -43,6 +43,8 @@ This script requires the following software to be installed on the system
in the queue
- `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
- `load_queue - ctrl+l` - Appends the videos from the most recent save point to the
queue
- `move_video - ctrl+m`: Mark/move the selected video in the queue
- `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
Expand All @@ -52,6 +54,8 @@ This script requires the following software to be installed on the system
- `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
- `save_queue - ctrl+s`: Saves the remainder of the queue (excluding the
currently playing video) to the database for retrevial at a later time
- `remove_from_queue - ctrl+x`: Remove the currently selected video from the
queue
- `play_selected_video - ctrl+ENTER`: Play the currently selected video in
Expand All @@ -63,21 +67,20 @@ This script requires the following software to be installed on the system
- `clipboard_command - xclip -o`: The command to use to get the contents of the clipboard
- `cursor_icon - ➤`: The icon to use for the cursor
- `display_limit - 10`: The maximum amount of videos to show on the OSD at once
- `download_directory - ~/videos/YouTube`: The directory to use when
downloading a video
- `download_directory - ~/videos/YouTube`: The directory to use when downloading a video
- `download_quality 720p`: The maximum download quality
- `downloader - curl`: The name of the program to use to download the video
- `font_name - JetBrains Mono`: The name of the font to use
- `font_size - 12`: Size of the font
- `marked_icon - ⇅`: The icon to use to mark a video as ready to be moved in
the queue
- `marked_icon - ⇅`: The icon to use to mark a video as ready to be moved in the queue
- `menu_timeout - 5`: The number of seconds until the menu times out
- `show_errors - yes`: Show error messages on the OSD
- `ytdlp_file_format - mp4`: The preferred file format for downloaded videos
- `ytdlp_output_template - %(uploader)s/%(title)s.%(ext)s`: The [yt-dlp output
template string](https://github.com/yt-dlp/yt-dlp#output-template)
- Full path with the default `download_directory`
is: `~/videos/YouTube/<uploader>/<title>.<ext>`
- `ytdlp_output_template - %(uploader)s/%(title)s.%(ext)s`: The [yt-dlp output template string](https://github.com/yt-dlp/yt-dlp#output-template)
- Full path with the default `download_directory` is: `~/videos/YouTube/<uploader>/<title>.<ext>`
- `use_history_db - no`: Enable watch history tracking through integration with [mpv-youtube-queue-server](https://gitea.suda.codes/sudacode/mpv-youtube-queue-server)
- `backend_host`: ip or hostname of the backend server
- `backend_port`: port to connect to for the backend server

## License

Expand Down
5 changes: 5 additions & 0 deletions mpv-youtube-queue.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ download_current_video=ctrl+d
download_selected_video=ctrl+D
move_cursor_down=ctrl+j
move_cursor_up=ctrl+k
load_queue=ctrl+l
move_video=ctrl+m
play_next_in_queue=ctrl+n
open_video_in_browser=ctrl+o
open_channel_in_browser=ctrl+O
play_previous_in_queue=ctrl+p
print_current_video=ctrl+P
print_queue=ctrl+q
save_queue=ctrl+s
remove_from_queue=ctrl+x
play_selected_video=ctrl+ENTER
browser=firefox
Expand All @@ -26,3 +28,6 @@ menu_timeout=5
show_errors=yes
ytdlp_file_format=mp4
ytdlp_output_template=%(uploader)s/%(title)s.%(ext)s
use_history_db=no
backend_host=http://localhost
backend_port=42069
Loading

0 comments on commit 3bbbcae

Please sign in to comment.