subclean
1.8.1
功能强大的CLI工具和节点模块,可从字幕文件中删除广告。为个人媒体服务器制作,并全力支持Bazarr等自动化工具。易于使用,并经常使用新过滤器更新。
Windows,Linux和Mac的下载可以在“版本”页面上找到。
另外,您可以使用nodejs安装:
npm install -g subclean或者您可以自己构建: npm install && npm run build
如果您将其用作节点模块向下滚动到节点模块/NPM部分。
如果使用Bazarr,请参阅Wiki页面。
Usage: subclean [options]
Example: subclean subtitle.srt -w
Bulk: subclean --sweep "path/to/media"
Options:
-i, --input The file you want to clean
-o, --output Where to write the cleaned file (defaults to input)
-w, --overwrite Overwrite the output file if it already exists
-c, --clean Delete the input file before writing the output
-v, --version Display current version
-n, --no-check Don't check for a new package version
-s, --silent Silent mode. Nothing logged to console
--update Download the latest filters from GitHub
This will not update subclean, only the filters!
--sweep Bulk subtitle cleaning. Searches for subtitles
in multiple directories (and sub-directories)
This will enable --overwrite!
--nochains Attempt to match and remove chained nodes. Experimental.
--depth How many sub-directories to look when sweep cleaning
--debug Display extra debugging information
--help Show the text you're reading now
--ne No Empty (nodes). Deletes empty nodes after cleaning.
--testing Testing mode. Will not modify files.
--uf Use Filter: internal or appdata
扫描字幕文件并一一清洁。
深度是可选的。查看深度图以获取可视化指南,了解要使用的深度。
subclean --sweep " path/to/media " --depth 5
// or
subclean --sweep当您运行subclean --update将从github下载新过滤器。这些文件的位置可能会根据您使用的操作系统而有所不同。如果下载的过滤器不存在或无法访问,则将使用内部过滤器
您可以与下载的过滤器一起创建custom.json 。 SubClean将自动加载它并在清洁时应用。您可以通过运行subclean --debug验证这将加载。您应该Loaded n filters from custom消息
从1.6.2及以上开始,现在可以用作节点模块,从而使您可以通过cleanRaw函数将原始文本传递。用法如下:
npm install subclean --save
import { subclean } from 'subclean' ;
const testdata = `1
00:00:06,000 --> 00:00:12,074
Watch Movies, TV Series and Live Sports
Signup Here -> WWW.ADMITME.APP
2
00:00:27,319 --> 00:00:28,820
Or you can remove that annoying ad using subclean!
3
00:00:28,903 --> 00:00:30,447
Now with support for node modules.` ;
subclean . cleanRaw ( testdata ) . then ( console . log ) ;结果:
1
00:00:27,319 --> 00:00:28,820
Or you can remove that annoying ad using subclean!
2
00:00:28,903 --> 00:00:30,447
Now with support for node modules.
您仍然可以通过参数自定义该过程。
const config = { nochains : true , ne : true } ;
subclean . cleanRaw ( testdata , config ) . then ( console . log ) ;如果数据无效,您将收到错误
const testdata = `this is invalid data` ;
subclean . cleanRaw ( testdata ) . then ( console . log ) . catch ( console . log ) ;
// Error: Unable to parse subtitles 该项目由Kain(ksir.pw)制定
欢迎贡献,问题和功能请求。
请随时检查问题页面。
如果这个项目对您有所帮助,请给!
版权所有©2021 Kain(ksir.pw)。该项目已获得MIT许可。