yt-dlc icon indicating copy to clipboard operation
yt-dlc copied to clipboard

[Question] Can yt-dlc parse and split by video chapters?

Open vico93 opened this issue 5 years ago • 4 comments

Checklist

  • [X] I'm asking a question
  • [X] I've looked through the README and FAQ for similar questions
  • [X] I've searched the bugtracker for similar questions including closed ones

Question

I'm trying to download a video of an OST which is divided by chapters (instead of one video per song in a playlist). Reading the README file i saw three chapter-related output template tags, so i tried to adapt a command to download and split by playlist entry but it didn't work (only gives me a file named NA.mp3 - same result using youtube-dl).

Here is the command: youtube-dlc --extract-audio --audio-format mp3 -o "%(chapter)s.%(ext)s" "https://www.youtube.com/watch?v=va57LS08oOw"

How i can make the download end up with multiple audio files, one per chapter (like Intro.mp3, Story.mp3 and such)?

vico93 avatar Dec 05 '20 00:12 vico93

There is no direct way to do this. The easiest way would be to use mkvmerge as a postprocessor. youtube-dlc URL --exec "mkvmerge -o {} --split chapters:all {}"

Ref: https://stackoverflow.com/a/36708030

pukkandan avatar Dec 05 '20 03:12 pukkandan

@pukkandan unfortunately i use Windows so i dont know if the second tool is available for it.

vico93 avatar Dec 09 '20 17:12 vico93

@viko93 yes, mkvmerge is available for windows

pukkandan avatar Dec 10 '20 05:12 pukkandan

https://www.fosshub.com/MKVToolNix.html

pukkandan avatar Dec 10 '20 05:12 pukkandan