I've used many video downloaders before: atube catcher, 4k downloader, jDownloader, and currently using youtube-dl. I can't download videos, this for example, while still keeping their online chapters intact, like part1 is "intro" lasting from 00:00 to 00:45 and so on. So far I tried these parameters with youtube-dl
--write-annotations --write-description --write-info-json
--write-all-thumbnails
-f 'bestvideo[height<=720]+bestaudio/best[height<=720]/worst' --merge-output-format mp4
--add-metadata --embed-subs --embed-thumbnail
The information you want is called chapters in the youtube-dl info JSON.
There is a recent open pull request for youtube-dl that fixes a problem with this information. In the current release of youtube-dl, if you use the ---write-info-json
or --dump-json
you will see that the chapters information is null ("chapters": null
). You can use the code in the fork repository to be able to obtain the information you want.
Follow these steps:
Clone this repository:
git clone https://github.com/gschizas/youtube-dl.git
Change to the repository directory:
cd youtube-dl/
Checkout the pull request branch:
git checkout bugfix/youtube/chapters-fix-extractor
Run youtube-dl from the current location:
python -m youtube_dl --write-info-json https://youtu.be/LnO42jxJaC4
You will see information like this in the info JSON:
"chapters": [
{
"start_time": 0.0,
"end_time": 46.0,
"title": "Intro"
},
{
"start_time": 46.0,
"end_time": 72.0,
"title": "QOTD"
},
...
]
Hopefully the fix will be accepted into the youtube-dl repository and included in future releases, so there will be no need to clone any repository.