mxpv / podsync

Turn YouTube or Vimeo channels, users, or playlists into podcast feeds
MIT License
1.5k stars 263 forks source link

Generate chapter marks from youtube description #222

Open clawoflight opened 3 years ago

clawoflight commented 3 years ago

Youtube parses timestamps from the description to show "chapters", it would be great to generate chapter marks from that!

Example:

00:00 - Intro
12:00:00 - Outro
Rpsl commented 3 years ago

can you describe how it will work? what should change in the result file?

clawoflight commented 3 years ago

I have seen several extensions to rss/atom for chapters, such as `, but I think the widest support is based on ID3 chapter metadata. That should work with both mp3 and mp4.

I guess you would prefer doing that in-process rather than calling another tool - the best go id3 library might get support for chapters soon: https://github.com/bogem/id3v2/pull/62

Contextualist commented 1 year ago

yt-dlp alone can embed the chapters, and here's what I found to be a working solution for audio and iOS Apple Podcast:

# ...
[feeds]
    [feeds.feed1]
    # ...
    # Embed YouTube timestamps as ID3 chapter metadata
    youtube_dl_args = ["--embed-chapters"]
    # If you are using Apple Podcast, mp3 files' chapter metadata is not supported.
    format = "custom"
    custom_format = { youtube_dl_format = "bestaudio[ext=m4a]", extension = "m4a" }