Add comics-downloader parser (#611)

* Add comics-downloader parser

The utility comics-downloader can be used to download comics
and produces files of the type "seriesname-chapternumberpadded".
This adds support for that format.

For more info https://github.com/Girbons/comics-downloader

* Adjusted the test cases and added .+? to consume less characters.

Co-authored-by: Joseph Milazzo <joseph.v.milazzo@gmail.com>
This commit is contained in:
Christoffer Green 2021-10-03 14:42:40 +02:00 committed by GitHub
parent 8d2bd45073
commit 63d7439938
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -327,6 +327,11 @@ namespace API.Parser
@"^(?<Series>.*)(?: |_)(?!\(\d{4}|\d{4}-\d{2}\))\(",
MatchOptions,
RegexTimeout),
// spawn-123 (from https://github.com/Girbons/comics-downloader)
new Regex(
@"^(?<Series>.+?)-(?<Chapter>\d+)",
MatchOptions,
RegexTimeout),
// MUST BE LAST: Batman & Daredevil - King of New York
new Regex(
@"^(?<Series>.*)",
@ -423,6 +428,11 @@ namespace API.Parser
@"^(?!Vol)(?<Series>.+?)( |_)i(ssue)( |_) #(?<Chapter>\d*)",
MatchOptions,
RegexTimeout),
// spawn-123 (from https://github.com/Girbons/comics-downloader )
new Regex(
@"^(?<Series>.+?)-(?<Chapter>\d+)",
MatchOptions,
RegexTimeout),
};
private static readonly Regex[] ReleaseGroupRegex = new[]