mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(indexers): AnimeBytes parsing (#1259)
* change test to expect correct output * fix regex * improve error message
This commit is contained in:
parent
2bd1a68a94
commit
570af0940b
2 changed files with 6 additions and 6 deletions
|
@ -25,10 +25,10 @@ func TestYamlExpectations(t *testing.T) {
|
|||
}
|
||||
|
||||
for _, parseLine := range d.IRC.Parse.Lines {
|
||||
for i, test := range parseLine.Tests {
|
||||
for _, test := range parseLine.Tests {
|
||||
parseOutput := map[string]string{}
|
||||
ParseLine(nil, parseLine.Pattern, parseLine.Vars, parseOutput, test.Line, parseLine.Ignore)
|
||||
assert.Equal(t, test.Expect, parseOutput, "error in expectation %d", i)
|
||||
assert.Equal(t, test.Expect, parseOutput, "error parsing %s", test.Line)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,9 +135,9 @@ irc:
|
|||
uploader: "Anon-Uploader"
|
||||
- line: "Awesome Live Action Special - Live Action TV Special [2021] :: Web / MKV / h264 / 848x480 / AAC 2.0 / Softsubs (Sub Group) || https://animebytes.tv/torrents.php?id=00000&torrentid=00000 || manga || Uploaded by: Some-Uploader"
|
||||
expect:
|
||||
torrentName: "Awesome "
|
||||
title: "Awesome "
|
||||
category: "Live Action Special - Live Action TV Special"
|
||||
torrentName: "Awesome Live Action Special"
|
||||
title: "Awesome Live Action Special"
|
||||
category: "Live Action TV Special"
|
||||
year: "2021"
|
||||
releaseTags: "Web / MKV / h264 / 848x480 / AAC 2.0 / Softsubs (Sub Group)"
|
||||
releaseGroup: "Sub Group"
|
||||
|
@ -193,7 +193,7 @@ irc:
|
|||
torrentId: "000000"
|
||||
tags: ""
|
||||
uploader: "Uploader"
|
||||
pattern: '((.*?)+)(?: - )?(Visual Novel|Light Novel|TV S.*|Movie|Manga|OVA|ONA|DVD Special|BD Special|Oneshot|Anthology|Manhwa|Manhua|Artbook|Game|Live Action.*|)[\s\p{Zs}]{2,}\[(\d+)\] :: (.*?(?:Hardsubs|RAW|Softsubs|Translated) \((.*?)\).*?|.*?)(?: \/ Episode (\d+).*?)?(?: \/ )?(Freeleech)?(?:.?\|\|.?)(https.+\/)torrents.*\?id=(\d+)&torrentid=(\d+)(?:.?\|\|.?)?([A-Za-z,. ]+\w)?(?:.?\|\|.?)?(?:Uploaded by: (.*))?'
|
||||
pattern: '((.*?)+)(?: - (Visual Novel|Light Novel|TV S.*|Movie|Manga|OVA|ONA|DVD Special|BD Special|Oneshot|Anthology|Manhwa|Manhua|Artbook|Game|Live Action.*|))?[\s\p{Zs}]{2,}\[(\d+)\] :: (.*?(?:Hardsubs|RAW|Softsubs|Translated) \((.*?)\).*?|.*?)(?: \/ Episode (\d+).*?)?(?: \/ )?(Freeleech)?(?:.?\|\|.?)(https.+\/)torrents.*\?id=(\d+)&torrentid=(\d+)(?:.?\|\|.?)?([A-Za-z,. ]+\w)?(?:.?\|\|.?)?(?:Uploaded by: (.*))?'
|
||||
vars:
|
||||
- torrentName
|
||||
- title
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue