Compare commits

...

5 Commits

Author SHA1 Message Date
111d5fa730
Merge ceed149350 into 0739b93e3a 2024-09-09 05:18:53 +00:00
ceed149350 add keybinding options
Some checks failed
Luacheck / luacheck (push) Failing after 5s
2024-09-08 22:18:48 -07:00
f08997fb5e add new keybinding options 2024-09-08 22:18:07 -07:00
0118e4969c update readme 2024-09-08 22:14:23 -07:00
42d1f7f7d6 fix load_queue command
- fix parsing/conversion to table from json list
2024-09-08 22:12:53 -07:00
3 changed files with 21 additions and 2 deletions

View File

@ -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
@ -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
@ -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

View File

@ -3,6 +3,7 @@ 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
@ -10,6 +11,7 @@ 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

View File

@ -315,7 +315,20 @@ function YouTubeQueue.load_queue()
style.error)
return false
else
for i in result do YouTubeQueue.add_to_queue(i) end
if result.status == 0 then
-- split urls based on commas
local urls = {}
-- Remove the brackets from json list
local l = result.stdout:sub(2, -3)
local item
for turl in l:gmatch('[^,]+') do
item = turl:match("^%s*(.-)%s*$"):gsub('"', "'")
table.insert(urls, item)
end
for _, turl in ipairs(urls) do
YouTubeQueue.add_to_queue(turl)
end
end
end
end)
end