Skip to content

Conversation

andros21
Copy link
Owner

@andros21 andros21 commented Jun 15, 2023

browse chapter list and jump to a particular one

breaking changes:

  • two new required deps added: jq and iconv
  • new cols inside cache DB so a flush is needed!

Description

A few part (sadly) of yt videos uploaded, usually long
video, are uploaded with chapters ... What does it
mean? That the video contains its list of chapters, so the
real number of tracks that the video id it contains

yt-dlp is able to fetch these metadata and mpv too,
the ability to browse this kind of content during playback,
gives a tremendous degree of freedom, especially when a track
longs about 2/3h. Adding the possibility to:

  • append tracks to the playlist only if uploaded with chapters
  • browse the chapters list
  • pick up a particular chapter e.g. a next song in the album
  • nx/pv action can now jump forward/backward naturally
    respecting the internal chapters of a track if available

This initial support was possible adding jq
as require deps, that also has permited to:

  • refactor core logic of ipc-json in mpvctl
  • refactor yt-dlp search query filtering
  • convert the final response in csv format ready to be
    injected in sqlite3 cache db (with double quotes correctly escaped!)

An additional dependency that I decide to add was iconv
Reason: stupid unicode chars contained sometimes in the titles
It try to translit between utf8 encoding to ascii easily

An additional misc change addded was:
to respect $XDG_RUNTIME_DIR env if is set
to place mpv socket and yt-dlp queries in it,
instead cache and db remain in $HOME to ensure persistence

browse chapter list and jump to a particular one

**breaking changes:**
 * two new required deps added: `jq` and `iconv`
 * new cols inside cache DB so a flush is needed!
explore track chapters using "Alt+Enter"
if available, otherwise play as usual
between chapters of different tracks, await until switch
with a safer counter for loop break
@andros21 andros21 merged commit e5d6d4b into master Nov 11, 2023
@andros21 andros21 deleted the chapters branch November 11, 2023 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant