{"id":17238518,"url":"https://github.com/gielcobben/caption-core","last_synced_at":"2025-04-14T02:31:35.246Z","repository":{"id":52152015,"uuid":"109585303","full_name":"gielcobben/caption-core","owner":"gielcobben","description":"Caption Core acts as an abstraction layer for Caption’s core functionality.","archived":false,"fork":false,"pushed_at":"2022-12-06T18:36:18.000Z","size":3305,"stargazers_count":36,"open_issues_count":4,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-27T16:49:38.795Z","etag":null,"topics":["caption","javascript","nodejs","npm","package","subtitles"],"latest_commit_sha":null,"homepage":"","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/gielcobben.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}},"created_at":"2017-11-05T14:12:43.000Z","updated_at":"2024-03-18T02:55:19.000Z","dependencies_parsed_at":"2023-01-24T11:03:16.989Z","dependency_job_id":null,"html_url":"https://github.com/gielcobben/caption-core","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gielcobben%2Fcaption-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gielcobben%2Fcaption-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gielcobben%2Fcaption-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gielcobben%2Fcaption-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gielcobben","download_url":"https://codeload.github.com/gielcobben/caption-core/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248810883,"owners_count":21165195,"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":["caption","javascript","nodejs","npm","package","subtitles"],"created_at":"2024-10-15T05:45:54.788Z","updated_at":"2025-04-14T02:31:32.540Z","avatar_url":"https://github.com/gielcobben.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"https://gielcobben.com/github/caption-core/icon_256x256.png\" width=\"100\" alt=\"icon\" draggable=\"false\"\u003e\u003cbr\u003e\n  Caption Core\n  \u003cbr\u003e\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e  \n  \u003cimg src=\"https://gielcobben.com/github/caption-core/github_cover.png?v=2\" width=\"840\" alt=\"banner\" draggable=\"false\"\u003e\n  \u003cbr\u003e\n  \u003ch6 align=\"center\"\u003eINTRODUCTION\u003c/h6\u003e\n  \u003cp align=\"center\"\u003eCaption Core acts as an abstraction layer for Caption’s core functionality. This allows third parties to add new sources or update existing ones. By introducing a simple but powerful API, all other modules that rely on Caption’s core will be able to upgrade smoothly.\u003c/p\u003e\n  \u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/gielcobben/caption\"\u003eView Caption.\u003c/a\u003e\u003c/p\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n## 🛠 Install\n\n###### Setup:\n\n```\nnpm install --save caption-core\n```\n\n###### ES6\n\n```js\nimport Caption from \"caption-core\";\n```\n\n###### CommonJS\n\n```js\nconst Caption = require(\"caption-core\");\n```\n\n\u003cbr\u003e\n\n## ⚡️ Contribute\n\nCaption Core is completely open-source. We've tried to make it as easy as possible to\ncontribute. If you'd like to help out by adding sources or assisting in other parts of development, here's how to get started:\n\n###### To begin working locally:\n\n1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your\n   own GitHub account\n2. [Clone](https://help.github.com/articles/cloning-a-repository/) it to your\n   local device: `git clone git@github.com:gielcobben/caption-core.git`\n3. Install the dependencies: `npm install`\n4. Build the module using Rollup:\n   `npm run build`\n5. Run one of the examples: `node examples/search.js`.\n\n\u003cbr\u003e\n\n## 📦 Sources\n\nCaption currently uses 2 sources to gather subtitles. We're continuously adding\nsources, but the app's open-source nature also allows you to add your own when\ndesired.\n\n###### Standard sources:\n\n* [x] OpenSubtitles\n* [x] Addic7ed\n\n\u003cbr\u003e\n\n## 🔎 Search by query\n\n###### Code:\n\n```js\nconst Caption = require(\"caption-core\");\n\nconst ENGLISH = \"eng\";\nconst LIMIT = 10;\n\nCaption.searchByQuery(\"Comedians in Cars\", ENGLISH, LIMIT)\n  .on(\"fastest\", subtitles =\u003e {\n    // Fastest source has been checked.\n  })\n  .on(\"completed\", subtitles =\u003e {\n    // All sources are checked.\n  });\n```\n\n###### Output:\n\n```js\n[\n  {\n    name: \"Comedians in Cars.HDTV.x264.srt\",\n    download: \"http://dl.opensubtitles.org/en/download/...\",\n    extention: \"\",\n    source: \"opensubtitles\",\n    size: \"\",\n    score: 4,\n  },\n  {\n    name: \"Comedians in Cars.1080p.WEB-DL.H264.srt\",\n    download: \"http://dl.opensubtitles.org/en/download/...\",\n    extention: \"\",\n    source: \"opensubtitles\",\n    size: \"\",\n    score: 3,\n  },\n];\n```\n\n\u003cbr\u003e\n\n## 🎞 Search by file\n\n###### Code:\n\n```js\nconst Caption = require(\"caption-core\");\n\nconst ENGLISH = \"eng\";\nconst LIMIT = 10;\n\nCaption.searchByFiles(\n  [\n    \"~/Movies/Comedians in Cars.S01E01.mp4\",\n    \"~/Movies/Comedians in Cars.S01E02.mp4\",\n  ],\n  ENGLISH,\n  LIMIT,\n).on(\"completed\", subtitles =\u003e {\n  // All sources are checked.\n});\n```\n\n###### Output:\n\n```js\n[\n  {\n    name: \"Comedians in Cars.HDTV.x264.srt\",\n    download: \"http://dl.opensubtitles.org/en/download/...\",\n    extention: \"\",\n    source: \"opensubtitles\",\n    size: \"\",\n    score: 4,\n  },\n  {\n    name: \"Comedians in Cars.1080p.WEB-DL.H264.srt\",\n    download: \"http://dl.opensubtitles.org/en/download/...\",\n    extention: \"\",\n    source: \"addic7ed\",\n    size: \"\",\n    score: 3,\n  },\n];\n```\n\n\u003cbr\u003e\n\n## 📺 Download subtitle\n\n###### Code:\n\n```js\nconst Caption = require(\"caption-core\");\n\nCaption.download(\n  {\n    name: \"Comedians in Cars.HDTV.x264.srt\",\n    download: \"http://dl.opensubtitles.org/en/download/...\",\n    extention: \"\",\n    source: \"opensubtitles\",\n    size: \"\",\n    score: 4,\n  },\n  \"opensubtitles\",\n  \"~/Movies/Comedians in Cars.S01E01.srt\",\n);\n```\n\n\u003cbr\u003e\n\n## ⭐️ Links\n\n###### Authors:\n\n* [Giel Cobben](https://github.com/gielcobben)\n* [Vernon de Goede](https://github.com/vernondegoede)\n\n###### Repositories:\n\n* [Caption](https://github.com/gielcobben/caption)\n* [Caption Website](https://github.com/gielcobben/getcaption.co)\n\n\u003cbr\u003e\n\n## 🔑 License\n\n[MIT](https://github.com/gielcobben/Caption/blob/master/LICENSE) © [Giel Cobben](https://twitter.com/gielcobben) \u0026 [Vernon de Goede](https://twitter.com/vernon_dg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgielcobben%2Fcaption-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgielcobben%2Fcaption-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgielcobben%2Fcaption-core/lists"}