{"id":16323809,"url":"https://github.com/david-else/simple-youtube-chapter-extractor","last_synced_at":"2025-10-27T17:05:00.302Z","repository":{"id":57675434,"uuid":"308321985","full_name":"David-Else/simple-youtube-chapter-extractor","owner":"David-Else","description":"Copy the text containing chapter information directly from YouTube and convert it into simple mkvmerge chapter format to embed in your downloaded YouTube video.","archived":false,"fork":false,"pushed_at":"2021-11-26T08:05:05.000Z","size":4837,"stargazers_count":20,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T15:16:05.415Z","etag":null,"topics":["deno","mkvmerge","mkvtoolnix","youtube","youtube-chapter-extractor"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/David-Else.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-29T12:31:17.000Z","updated_at":"2024-09-27T06:09:36.000Z","dependencies_parsed_at":"2022-09-26T16:40:20.588Z","dependency_job_id":null,"html_url":"https://github.com/David-Else/simple-youtube-chapter-extractor","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Else%2Fsimple-youtube-chapter-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Else%2Fsimple-youtube-chapter-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Else%2Fsimple-youtube-chapter-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Else%2Fsimple-youtube-chapter-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/David-Else","download_url":"https://codeload.github.com/David-Else/simple-youtube-chapter-extractor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245023362,"owners_count":20548713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","mkvmerge","mkvtoolnix","youtube","youtube-chapter-extractor"],"created_at":"2024-10-10T22:55:43.689Z","updated_at":"2025-10-27T17:05:00.199Z","avatar_url":"https://github.com/David-Else.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple YouTube Chapter Extractor\n\nCopy the text containing chapter information directly from YouTube and convert it into [simple mkvmerge chapter format](https://mkvtoolnix.download/doc/mkvmerge.html#mkvmerge.chapters) to embed in your downloaded YouTube video.\n\n# Requirements\n\n- [Deno](https://deno.land/) installed (tested on 1.5.3)\n- `mkvmerge` command line tool or `MKVToolNix GUI` installed\n\n# Installation\n\n## Install or update:\n\n```\ndeno install -Af https://deno.land/x/simple_youtube_chapter_extractor@v1.0.0/youtube-chapter-extractor.ts\n```\n\n## Uninstall\n\nhttps://github.com/denoland/deno/issues/3139\n\n`rm $(which youtube-chapter-extractor)`\n\n# Usage\n\n- Find a video that uses the recent YouTube chapters feature:\n\n![example](images/video-chapters.gif)\n\n- You can download YouTube videos using [youtube-dl](https://youtube-dl.org/) or one of many browser extensions\n- Under the video in the description there should be text including chapters. Copy and paste all the text into a file for use with this program. It might look like:\n\n```\n⭐️ Course Contents ⭐️\nIntroduction\n---------------------\n⌨️ (00:00:00) Introduction\n⌨️ (00:02:02) Course overview\n⌨️ (00:04:38) Course Project\n⌨️ (00:05:51) What is Deno\n⌨️ (00:08:19) Course project (Survey app) demo\n⌨️ (00:11:54) Install and Getting started\n⌨️ (00:14:34) Write \"Hello World\"\n⌨️ (00:15:50) Main Features\n```\n\n# Text file source formats allowed\n\nYouTubers can create the list of chapters in any way they like, the following are some common ones supported:\n\nThe time stamp in either `00:00` or `00:00:00` format followed by either:\n\n`space` `title`:\n\n```\n03:00:00 Introduction\n```\n\n`)` `space` `title`:\n\n```\n⌨️ (00:00:00) Introduction\n```\n\n`space` `-` `space` `title`\n\n```\n02:00 - Introduction\n```\n\nThe current regex used is:\n\n`/(?\u003ctime\u003e\\d{2}:\\d{2}:\\d{2}|\\d{2}:\\d{2})\\)?\\s(\\-)?(\\s)?(?\u003cchapterTitle\u003e.*)/g;`.\n\nTo see what it does paste it into [regex101.com](https://regex101.com/). Please contribute more formats to help others use this program!\n\n## Extract chapters from text file\n\n```\nyoutube-chapter-extractor [name of text file to process]\n```\n\nor if you did not install it and running from source file:\n\n```\n./youtube-chapter-extractor.ts [name of text file to process]\n```\n\n## Merge chapters into video file\n\n- Use `MKVToolNix GUI` which contains all the functionality of `mkvmerge`\n\n![chapter-file](images/chapter-file.png)\n\nor\n\n- Download `mkvmerge` from [the home site](https://mkvtoolnix.download/downloads.html) and use:\n\n```\nmkvmerge \\\n  --chapters originalfilename_chapters.txt \\\n  -o output-file.mkv \\\n  input-file.mkv\n```\n\nor\n\n- [Flathub](https://flathub.org/apps/details/org.bunkus.mkvtoolnix-gui) and use:\n\n```\nflatpak run --command=mkvmerge org.bunkus.mkvtoolnix-gui --chapters originalfilename_chapters.txt -o output-file.mkv input-file.mkv\n```\n\n# Development\n\n`deno test` to run tests.\n\n`deno --unstable lint youtube-chapter-extractor.ts` to lint.\n\n## Suggested contributions\n\n- Add more text chapter formats\n- Add more tests\n- Automate `mkvmerge` usage\n- Automate `youtube-dl` chapter extraction from JSON file. The feature is currently broken in `2020.11.17`, `youtube-dl --write-info-json` results in `\"chapters\": null`\n\n## Suggested things not to bother with\n\n- Automating everything using the YouTube API. It has been done by https://github.com/gabrielfroes/youtube-chapter-extractor, and it seems to keep breaking and be too complex.\n\n# The future of video sharing\n\nThe future of video sharing is federated peer to peer, we must be free to express ourselves without corporate or government censorship. Have a look at https://joinpeertube.org/.\n\n# FAQ\n\n**Q**: Is it possible to save as XML?\n\n**A**: You can use chapterEditor for those who are interested.\n\nhttps://forum.doom9.org/showthread.php?t=169984\n\nhttps://www.videohelp.com/software/chapterEditor\n\nJust drag the text file generated by simple-youtube-chapter-extractor into chapterEditor and use Save as\nhttps://i.imgur.com/mcmRMny.png\n\n**Q**: Any other solutions?\n\n**A**: Try https://github.com/yt-dlp/yt-dlp/ and `yt-dlp --embed-chapters [URL]`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavid-else%2Fsimple-youtube-chapter-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavid-else%2Fsimple-youtube-chapter-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavid-else%2Fsimple-youtube-chapter-extractor/lists"}