https://github.com/robertklep/node-nzb-cleanup
Clean up NZB file names
https://github.com/robertklep/node-nzb-cleanup
Last synced: 9 months ago
JSON representation
Clean up NZB file names
- Host: GitHub
- URL: https://github.com/robertklep/node-nzb-cleanup
- Owner: robertklep
- Created: 2016-12-06T11:28:11.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-03-14T13:38:34.000Z (over 4 years ago)
- Last Synced: 2025-02-15T02:43:08.365Z (over 1 year ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NZB file name cleanup
Library and CLI tool to help clean up NZB file names.
## Installation
```
# library only
$ npm i nzb-cleanup
# cli tool
$ npm i nzb-cleanup -g
```
## Library
The library exports a single function that will take an NZB file name, and return a cleaned up version of it:
```
const cleanup = require('nzb-cleanup');
let NZBNAME = '[Gr0uP] my tv show season 3 episode 8 awesome title HDTV H.264.nzb';
console.log( cleanup(NZBNAME) );
// → My.Tv.Show.S03E08.Awesome.Title.HDTV.x264-Gr0uP.nzb
```
The function takes an optional numerical argument to specify a score threshold, below which the original file name will be returned (to prevent mis-parsing particularly badly formatted file names). The default threshold is 100 (a typical successful parse yields a score of about 300 or higher).
## CLI
The CLI tool accepts one or more NZB file names to clean up, and optionally an option to set the threshold (see _Library_):
```
$ nzb-cleanup [-t threshold] NZBNAME [NZBNAME ...]
```
## Thanks
Thanks to @skerit for their awesome [`epinfer`](https://github.com/skerit/epinfer) module!