Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Videos with chapters? #625

Closed
Protected opened this issue May 10, 2020 · 7 comments · Fixed by #913
Closed

Videos with chapters? #625

Protected opened this issue May 10, 2020 · 7 comments · Fixed by #913

Comments

@Protected
Copy link

Youtube videos can now have chapters. For example:

https://www.youtube.com/watch?v=BvyQ70PVI4s

youtube-dl -j gives me information on said chapters:

{
    ...
    "chapters": [
        {
            "start_time": 0,
            "end_time": 46,
            "title": "Are you a Creator-focused YouTuber?"
        },
        {
            "start_time": 46,
            "end_time": 83,
            "title": "Recent Subs to 100% Launch"
        },
        {
            "start_time": 83,
            "end_time": 105,
            "title": "Sneak Peeks Coming Soon!"
        },
        {
            "start_time": 105,
            "end_time": 139,
            "title": "Video Chapters Experiment (iOs coming soon!)"
        },
        {
            "start_time": 139,
            "end_time": 203,
            "title": "Channel Memberships Highlighted Comments Experiment"
        },
        {
            "start_time": 203,
            "end_time": 223,
            "title": "Monetization of COVID-19 Content Launch"
        },
        {
            "start_time": 223,
            "end_time": 241,
            "title": "Giving Creator Expansion"
        },
        {
            "start_time": 241,
            "end_time": 322,
            "title": "Music Policy Directory Deprecation"
        },
        {
            "start_time": 322,
            "end_time": 397,
            "title": "Trivia Winner"
        },
        {
            "start_time": 397,
            "end_time": 471,
            "title": "Trivia"
        }
    ]
    ...
}

But as of now ytdl doesn't appear to do so. May I request this as an improvement for getInfo?

@Protected
Copy link
Author

Oh, I should have watched this specific video (I retrieved it just now as an example). Apparently they're just parsing the video description. I can probably do that myself, although it would still be useful to have something guaranteed to mirror youtube's own behavior.

@ImUrX
Copy link

ImUrX commented Nov 1, 2020

i saw youtube-dl and they fetch a json too now, is there any info on this?
youtube even has thumbnails for the chapters!
thumbnails

@zardoy
Copy link

zardoy commented Jan 17, 2021

@fent Please can you reopen this issue as a feature request? It would be REALLY good to have videoDetails.chapters here

@fent
Copy link
Owner

fent commented Jan 17, 2021

sure, but this information is in the description like @Protected posted. so ytdl-core would simply parse the description and then add a chapters array to videoDetails with a structure similar to youtube-dl's

@fent fent reopened this Jan 17, 2021
@fent fent added the feature label Jan 17, 2021
@Protected
Copy link
Author

To be clear, since youtube themselves are displaying the chapters on the video's timeline, there must be an "official" set of rules for how chapters are detected and extracted from the description... Currently on my project I'm simply embedding youtube-dl to do this for me and trust that they're keeping up to date.

@zardoy
Copy link

zardoy commented Jan 17, 2021

@Protected Yeah, I'm using youtube-dl too, but I want to replace it in favor of this lib, because youtube-dl requires Python to be installed on the end user machine. That's why I think it would be good to implement all youtube-dl features here e,g, auto-merge for high quality formats.

TimeForANinja pushed a commit that referenced this issue May 4, 2021
* feat: add `videoDetails.chapters`

closes #625

* docs(example): Update `info.json`

* doc(typings): Add `videoDetails.chapters`
@github-actions
Copy link

github-actions bot commented May 4, 2021

🎉 This issue has been resolved in version 4.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants