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許可。