{"id":15357539,"url":"https://github.com/drkain/subclean","last_synced_at":"2025-04-10T18:32:11.269Z","repository":{"id":41902769,"uuid":"307462375","full_name":"DrKain/subclean","owner":"DrKain","description":"A cross-platform CLI tool and node module to remove advertising from subtitles. Supports Bazarr and bulk cleaning!","archived":false,"fork":false,"pushed_at":"2024-05-16T15:21:41.000Z","size":406,"stargazers_count":57,"open_issues_count":5,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-08T15:50:46.113Z","etag":null,"topics":["ads","advertising","bazarr","bulk","cli","command-line","emby","help-wanted","linux","mac","node","node-package","nodejs","npm","plex","plex-media-server","srt","subtitle","subtitle-files","windows"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/DrKain.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":"2020-10-26T18:05:23.000Z","updated_at":"2025-02-22T16:44:36.000Z","dependencies_parsed_at":"2024-05-16T16:52:07.963Z","dependency_job_id":null,"html_url":"https://github.com/DrKain/subclean","commit_stats":{"total_commits":126,"total_committers":3,"mean_commits":42.0,"dds":"0.023809523809523836","last_synced_commit":"e3cae14413beea5c1603bbad5e989f6879b2e4cd"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrKain%2Fsubclean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrKain%2Fsubclean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrKain%2Fsubclean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrKain%2Fsubclean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DrKain","download_url":"https://codeload.github.com/DrKain/subclean/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248271811,"owners_count":21075800,"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":["ads","advertising","bazarr","bulk","cli","command-line","emby","help-wanted","linux","mac","node","node-package","nodejs","npm","plex","plex-media-server","srt","subtitle","subtitle-files","windows"],"created_at":"2024-10-01T12:36:07.280Z","updated_at":"2025-04-10T18:32:11.243Z","avatar_url":"https://github.com/DrKain.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [![subclean](https://raw.githubusercontent.com/DrKain/subclean/main/text-logo.png)](#)\n\n[![NPM](https://img.shields.io/npm/v/subclean)](https://www.npmjs.com/package/subclean) [![NPM](https://img.shields.io/npm/dt/subclean)](https://www.npmjs.com/package/subclean)\n[![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg)](https://github.com/DrKain/subclean/wiki)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/DrKain/subclean/graphs/commit-activity)\n[![License: MIT](https://img.shields.io/github/license/DrKain/subclean)](https://github.com/DrKain/subclean/blob/master/LICENSE)\n\n\u003e A powerful CLI tool and node module to remove advertising from subtitle files. Made for personal media servers with full support for automation tools like Bazarr. Simple to use and frequently updated with new filters.\n\n![Preview](https://i.imgur.com/iM9UWzw.png)\n\n## Download\n\nDownloads for Windows, Linux and Mac can be found on the [releases](https://github.com/DrKain/subclean/releases) page.  \nAlternatively, you can install using NodeJS:\n\n```sh\nnpm install -g subclean\n```\n\nOr you can build it yourself: `npm install \u0026\u0026 npm run build`\n\n## Usage\n\n\u003e If you are using this as a node module scroll down to the [node module/npm](#node-module) section.\n\nIf using Bazarr, please see the [wiki page](https://github.com/DrKain/subclean/wiki/Bazarr).\n\n```\nUsage: subclean [options]\nExample: subclean subtitle.srt -w\nBulk: subclean --sweep \"path/to/media\"\n\nOptions:\n  -i, --input      The file you want to clean\n  -o, --output     Where to write the cleaned file (defaults to input)\n  -w, --overwrite  Overwrite the output file if it already exists\n  -c, --clean      Delete the input file before writing the output\n  -v, --version    Display current version\n  -n, --no-check   Don't check for a new package version\n  -s, --silent     Silent mode. Nothing logged to console\n      --update     Download the latest filters from GitHub\n                   This will not update subclean, only the filters!\n\n      --sweep      Bulk subtitle cleaning. Searches for subtitles\n                   in multiple directories (and sub-directories)\n                   This will enable --overwrite!\n\n      --nochains   Attempt to match and remove chained nodes. Experimental.\n      --depth      How many sub-directories to look when sweep cleaning\n      --debug      Display extra debugging information\n      --help       Show the text you're reading now\n      --ne         No Empty (nodes). Deletes empty nodes after cleaning.\n      --testing    Testing mode. Will not modify files.\n      --uf         Use Filter: internal or appdata\n```\n\n## 🧹 Bulk Cleaning\n\nScans for subtitle files and cleans them one by one.  \nDepth is optional. Take a look at the [depth map](https://github.com/DrKain/subclean/wiki/Bulk-Cleaning#depth-map) for a visual guide on what depth to use.\n\n```sh\nsubclean --sweep \"path/to/media\" --depth 5\n// or\nsubclean --sweep\n```\n\n## 📝 Filters\n\nWhen you run `subclean --update` new filters will be downloaded from GitHub.\nThe location of these files may differ depending on what OS you are using.\nIf the downloaded filters do not exist or can not be accessed the internal filters will be used instead\n\nYou can create `custom.json` alongside the downloaded filters. Subclean will automatically load this and apply it when cleaning. You can verify this is being loaded by running `subclean --debug`. You should see a message similar to `Loaded n filters from custom`\n\n## Node Module\n\nAs of 1.6.2 and above this can now be used as a node module, allowing you to pass raw text through the `cleanRaw` function. Usage is as follows:\n\n```npm\nnpm install subclean --save\n```\n\n```ts\nimport { subclean } from 'subclean';\n\nconst testdata = `1\n00:00:06,000 --\u003e 00:00:12,074\nWatch Movies, TV Series and Live Sports\nSignup Here -\u003e WWW.ADMITME.APP\n\n2\n00:00:27,319 --\u003e 00:00:28,820\nOr you can remove that annoying ad using subclean!\n\n3\n00:00:28,903 --\u003e 00:00:30,447\nNow with support for node modules.`;\n\nsubclean.cleanRaw(testdata).then(console.log);\n```\n\nResult:\n\n```\n1\n00:00:27,319 --\u003e 00:00:28,820\nOr you can remove that annoying ad using subclean!\n\n2\n00:00:28,903 --\u003e 00:00:30,447\nNow with support for node modules.\n```\n\nYou can still pass arguments to customize the process.\n\n```ts\nconst config = { nochains: true, ne: true };\nsubclean.cleanRaw(testdata, config).then(console.log);\n```\n\nIf the data is invalid you will receive an error\n\n```ts\nconst testdata = `this is invalid data`;\nsubclean.cleanRaw(testdata).then(console.log).catch(console.log);\n// Error: Unable to parse subtitles\n```\n\n## 👤 Author\n\nThis project was made by **Kain (ksir.pw)**\n\n-   Website: [ksir.pw](https://ksir.pw)\n-   Github: [@DrKain](https://github.com/DrKain)\n-   Discord: drkain\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome and greatly appreciated.  \nFeel free to check [issues page](https://github.com/DrKain/subclean/issues).\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n## 📝 License\n\nCopyright © 2021 [Kain (ksir.pw)](https://github.com/DrKain).\nThis project is [MIT](https://github.com/DrKain/subclean/blob/master/LICENSE) licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrkain%2Fsubclean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrkain%2Fsubclean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrkain%2Fsubclean/lists"}