8

Some YouTube content creators split their videos into chapters. A subset of them kindly offer the list of chapters titles on description video, with their starting timestamp. Sometimes they decide not to show them.

How can I get the list of chapters titles?

Pablo A
  • 2,307
  • 1
  • 22
  • 34
  • "Some YouTube content creators split their videos into chapters." Note that sometimes chapters are generated automatically by YouTube: https://support.google.com/youtube/answer/9884579?hl=en – Franck Dernoncourt Jul 24 '22 at 06:53

1 Answers1

6

Onliner to do this using youtube-dl (or maybe better yt-dlp instead) and jq JSON processor:

youtube-dl --dump-json  videoIDorURL | jq --raw-output ".chapters[].title"

With a little extra magic should be possible to add the starting timestamps. To get them:

| jq --raw-output ".chapters[].start_time" | awk '{printf("%d:%02d:%02d\n",($1/60/60%24),($1/60%60),($1%60))}'

Use yt-dlp --split-chapters to download each chapter.

Pablo A
  • 2,307
  • 1
  • 22
  • 34