FreeTubeApp / FreeTube

An Open Source YouTube app for privacy
https://freetubeapp.io/
GNU Affero General Public License v3.0
13.63k stars 861 forks source link

Add support for Key Moments with the local API #6171

Closed absidue closed 3 days ago

absidue commented 6 days ago

Add support for Key Moments with the local API

Pull Request Type

Related issue

closes #4237

Description

Key Moments on YouTube videos are chapters but auto-generated by YouTube instead of written in the description by the uploader. This pull request adds support for them with the local API.

Screenshots

key-moments

Testing

Example video from the feature request: https://www.youtube.com/watch?v=90ihiTwJPCc

Desktop

ChunkyProgrammer commented 3 days ago

Are there ever any cases where chapters and key moments exist for a video? i'm guessing not

absidue commented 3 days ago

I'm not sure, although if it were to happen, this code would only use the chapters that the uploader added. chapters -> key moments -> try extracting from the description with regex -> empty array.