It parses a file name like this
into an object with the following possible properties:
show, string: The name of the show,
year, integer: The release year,
season, integer: The season number,
episode, integer: The episode number,
episodeCount, integer: The count of episodes this file name includes,
name, string: The name of the episode,
quality, integer: The quality taken from
1080p. In this case
source, string: Available values are
'webdl', In this case
codec, string: Codec used,
group, string: Release group,
ext, string: File extension,
Take a look in the tests for examples of what file name formats are supported.
Simply require the module and you get a parsing function that you invoke with the file name to parse:
var parser =var filename = 'Fake Blood 2x06 I Need Blood.srt'var result =console //= 'Fake Blood'console //= undefinedconsole //= 2console //= undefined
If the parser can't parse the file name,
null will be returned. If the parser
can't parse out a specific details, the property for that detail will be missing
from the result.
npm install episode-parser
This package uses semver.
If you feel something is missing, which is highly probable since I made this for my personal needs, please create a pull request, with tests covering your case. If you feel somewhat lazy, create an issue instead and I might look into it.
Building good software and tools takes time. Please do support a future for this project if you are using it. Thank you!