media-filename-parser
v0.2.33
Published
Extract information from media filename
Readme
media-filename-parser
A serie of regex & string manipulations to extract media information from file path.
motivation
Media files names come in all types and forms. Not alwayin in the simple my show/S01E01.mp4;
Changing all file names is tedious work.
Embedded media information are often unreliable, and ads.
This library tries to extract the information from the file path, instead of relying on meta data.
Informatio extracted
Title
title of the show
Season
season number
Episode
- Special episodes information, such as: nced, ncop, extra, oad
- episode number
Year
year information
help wanted
If any information extracted is incorrect, please add a new case to ./src/test-names.json
install
(p)npm i media-filename-parserexample use
import {
episode as getEpisode,
season as getSeason,
title as getTitle,
} from 'media-filename-parser';
const fileName = "NieR Automata Ver1.1a S01 1080p Dual Audio WEBRip DD+ x265-EMBER/S01E01-or not to [B]e [268B933B].mkv";
const title = getTitle(fileName); // NieR Automata Ver1 1a
const season = getSeason(fileName); // 1
const { episode } = getEpisode(fileName); // 1
...