{"id":14979890,"url":"https://github.com/guuzzeji/yt-scissors","last_synced_at":"2026-02-15T19:09:53.098Z","repository":{"id":55487930,"uuid":"522687853","full_name":"Guuzzeji/yt-scissors","owner":"Guuzzeji","description":"[ YouTube-Scissors ] A simple API (npm library) that allows you to divide a YouTube video into multiple separate videos base on a video's time stamps. Created using FFmpeg and Node.js.","archived":false,"fork":false,"pushed_at":"2023-05-01T21:58:11.000Z","size":72907,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-11T20:03:07.246Z","etag":null,"topics":["ffmpeg","javascript","nodejs","npm","video-processing","youtube","youtube-api","youtube-dl","youtube-downloader","youtube-video"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/yt-scissors","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Guuzzeji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-08T19:53:25.000Z","updated_at":"2024-02-04T15:32:02.000Z","dependencies_parsed_at":"2024-09-19T03:02:38.710Z","dependency_job_id":"e3a8b343-d6b0-4f8d-881e-973cd406d1ad","html_url":"https://github.com/Guuzzeji/yt-scissors","commit_stats":{"total_commits":93,"total_committers":4,"mean_commits":23.25,"dds":0.4946236559139785,"last_synced_commit":"91630dc66ab1be988add3be032b50ca576eb3064"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guuzzeji%2Fyt-scissors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guuzzeji%2Fyt-scissors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guuzzeji%2Fyt-scissors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guuzzeji%2Fyt-scissors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Guuzzeji","download_url":"https://codeload.github.com/Guuzzeji/yt-scissors/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219858899,"owners_count":16556039,"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":["ffmpeg","javascript","nodejs","npm","video-processing","youtube","youtube-api","youtube-dl","youtube-downloader","youtube-video"],"created_at":"2024-09-24T14:00:51.134Z","updated_at":"2025-10-28T20:30:17.297Z","avatar_url":"https://github.com/Guuzzeji.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./assets/logo-upscale.jpeg\" height=\"100%\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eYouTube-Scissors\u003c/h1\u003e\n\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/Guuzzeji/yt-scissors\"\u003e\n    \u003cimg alt=\"GitHub release (latest by date)\" src=\"https://img.shields.io/github/v/release/Guuzzeji/yt-scissors\"\u003e\n    \u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/dm/yt-scissors\"\u003e\n    \u003cimg alt=\"node-current\" src=\"https://img.shields.io/node/v/yt-scissors\"\u003e\n    \u003cimg alt=\"GitHub contributors\" src=\"https://img.shields.io/github/contributors/Guuzzeji/yt-scissors\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"GitHub Repo stars\" src=\"https://img.shields.io/github/stars/Guuzzeji/yt-scissors?style=social\"\u003e\n    \u003ca href=\"https://twitter.com/intent/tweet?url=https://github.com/Guuzzeji/yt-scissors/\u0026hashtags=youtube,github,cli,ffmpeg,programming\"\u003e\n        \u003cimg alt=\"Twitter URL\" src=\"https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Fgithub.com%2FGuuzzeji%2Fyt-scissors\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nA simple npm library that allows you to divide a YouTube video into multiple separate videos base on a video's time stamps. Built on top of FFmpeg and JavaScript.\n\nIf you are looking for a CLI version of this library look [here](https://github.com/Guuzzeji/youtube-scissors-cli).\n\n## 💡 Features\n\n- Can generate multiple videos or extract a single video, based on a YouTube video's time stamps (time stamps from a comment, video description, or chapters)\n  - **Important:** For this library to work, you must either have the YouTube video already downloaded or have a Buffer of the YouTube video\n  \n  - **Note:** For comments, follow this [tutorial](https://www.youtube.com/watch?v=PnmfkLiMLHs) to figure out how to get a YouTube comment's URL.\n\n- Will automatically download ffmpeg for your current operating system\n  - **Note:** Cannot automatically download ffmpeg for MacOS. You have to download and add it yourself. [FFmpeg Downloads]( https://ffmpeg.org/download.html)\n\n- Can generate time stamps from a YouTube video's chapters, comment, or description.\n\n- You can use this library on top of any YouTube download library / API.\n\n- 100% Open Source (MIT license)\n\n## 🚀 Install\n\n```console\nnpm install yt-scissors\n```\n\n## Example \u0026 Usage\n\n```js\nconst { getTimeStampList, cutVideo } = require('yt-scissors');\nconst fs = require('fs');\n\nasync function main() {\n\n    // == Different Videos == \n    // Chapters: \"https://www.youtube.com/watch?v=iPtPo8Sa3NE\"\n    // Comment: \"https://www.youtube.com/watch?v=89UEYbkHKvg\u0026lc=UgzcUK560Nm4FAxF8-d4AaABAg\"\n    // Description: \"https://www.youtube.com/watch?v=GdzrrWA8e7A\"\n\n    let list = await getTimeStampList({ \n        url: \"https://www.youtube.com/watch?v=iPtPo8Sa3NE\", \n        type: \"chapters\" });\n    \n    //Will output a array of time stamps and video titles\n    console.log(list);\n\n    //Will generate a video from the 5th video in the array\n    let chapter_videos = await cutVideo({\n        video: Buffer.from(fs.readFileSync(\"./Death Grips - Exmilitary [Full Mixtape].mp4\")),\n        // ffmpegPath: \"\", (Give it a path to your ffmpeg executable)\n        DisableDownloadLogs: false,\n        chapters: [list[4]],\n        ffmpegOptions: {\n            crf: \"3\"\n        },\n    });\n\n    fs.writeFileSync(\"./test.mp4\", chapter_videos[0].videoData);\n}\n\nmain();\n```\n\n\u003cbr\u003e\n\n# 📖 API Documentation\n\n\u003cbr\u003e\n\n## getTimeStampList(...)\n\n**Description:**\n\u003e**Important:** Generated time stamps from the description and comments works about 85% of the time. Make sure the video's time stamps are spaced out and have nothing that would make it hard to find them. There is also a bug with any video that is +10 hours long, so video length should be below 10 hours.\n\n- Picks where to get video time stamps and generate array of time stamps from that.\n  \n- Can generate time stamps from a video's chapters, comment, or description.\n\n- **Returns** an array of start and end time for each chapter video.\n\n```js\n// getTimeStampList(...) all default values\ngetTimeStampList({\n    url: String,\n    type: \"chapters\" | \"comment\" | \"description\" // default is \"chapters\"  \n})\n```\n\n| Required      | Name | Data Type | Description |\n| ----------- | ----------- | ----------- | -----------\n| Yes      | url       | String | URL of YouTube video\n| Yes      | type        | \"chapters\" or \"comment\" or \"description\" | The data you want to parse to get video time stamps. **(default is \"chapters\")**\n\n### Returns { Promise\u003cArray\u003cListVideo_Object\u003e\u003e }\n\n- Returns an array of start and end time for each chapter video.\n\n- **Note:** Will return a empty array if time stamps couldn't be generated\n\n**ListVideo_Object Example:**\n\n```js\n\"ListVideo_Object\": {\n    title: \"{String}\", // Title of the chapter\n    start_time: \"{String or Number}\", // Start time stamps of the chapter\n    end_time: \"{String or Number}\" // End time stamps of the chapter\n}\n```\n\n\u003cbr\u003e\n\n## cutVideo(...)\n\n**Description:**\n\u003e **Important:** Cannot automatically download ffmpeg for MacOS. You have to download and add it yourself. [FFmpeg Downloads]( https://ffmpeg.org/download.html)\n\n- Using FFmpeg, trims videos into different chapters and encodes theme base on the time stamps given.\n  \n- Can automatically download ffmpeg for current operating system, or you can manually install ffmpeg, and give the path to it.\n  \n- **Returns** an array of videos with title and a buffer of the trim down video\n\n```js\n// cutVideo(...) all default values\ncutVideo ({\n    video,\n    ffmpegPath = undefined,\n    chapters,\n    DisableDownloadLogs = false,\n    ffmpegOptions = {\n        crf: \"25\",\n        preset: \"ultrafast\",\n        ffmpegCmds: undefined,\n        ffmpegHide: false\n    } })\n```\n\n| Required      | Name        | Data Type   | Description\n| ----------- | ----------- | ----------- | ----------- |\n| Yes      | video       | String or Buffer | Video path as a string or a buffer of the video\n| No      | ffmpegPath     | String | Path to ffmpeg executable. If none is given then will automatically download ffmpeg. FFmpeg will be downloaded if variable is set to undefined, null, or you don't pass in a string path. **(default is undefined)**\n| Yes      | chapters       | Array\u003cListVideo_Object\u003e| List of chapters you want to extract from original video get this from getVideoList(...) function\n| No   | DisableDownloadLogs | Boolean | True = disable download logs, false = show download logs. **(default is false)**\n| No    | ffmpegOptions | Object | FFmpeg commands and options.\n| No    | ffmpegOptions.crf | String | Quality of the video. Lower numbers the better looking the video. **(default is 25)**\n| No    | ffmpegOptions.preset | String | Speed of encoding video. **(default is ultrafast)**\n| No    | ffmpegOptions.ffmpegCmds | Array | Add any other ffmpeg commands as a array. Make sure they are String values.\n| No    | ffmpegOptions.ffmpegHide | Boolean | Hide ffmpeg process from being shown in the terminal. **(default is false)**\n\n### Returns { Promise\u003cArray\u003cSaveVideos_Object\u003e\u003e }\n\n- Returns an array object of videos. Videos are store as buffers.\n\n**SaveVideos_Object Example:**\n\n```js\n\"SaveVideos_Object\": {\n    title: \"{String}\", // Title of the chapter\n    videoData: \"{Buffer}\" // A buffer of the chapter video\n}\n```\n\n\u003cbr\u003e\n\n# 🗿 Helpful Infomation \u0026 Example Code\n\n### Example Code\n\n```js\n// ( Example 1 ) Using the ffmpegCmds in cutVideo(...) \nawait cutVideo({\n    video: \"Some Buffer of YouTube Video\",\n    DisableDownloadLogs: false,\n    chapters: [list[4]],\n    ffmpegOptions: {\n        crf: \"3\",\n        //Note: What \"-hide_banner -loglevel debug\" commands will look like in the array\n        ffmpegCmds: [\"-hide_banner\", \"-loglevel\", \"debug\"]\n    },\n});\n```\n\n### Helpful Infomation\n\n- [How to find a YouTube comment URL from a video](https://www.youtube.com/watch?v=PnmfkLiMLHs)\n\n### License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguuzzeji%2Fyt-scissors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguuzzeji%2Fyt-scissors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguuzzeji%2Fyt-scissors/lists"}