fix(indexers): AnimeBytes parsing (#1259)

* change test to expect correct output

* fix regex

* improve error message
This commit is contained in:
Frederick Robinson 2023-11-18 14:07:50 -08:00 committed by GitHub
parent 2bd1a68a94
commit 570af0940b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -25,10 +25,10 @@ func TestYamlExpectations(t *testing.T) {
} }
for _, parseLine := range d.IRC.Parse.Lines { for _, parseLine := range d.IRC.Parse.Lines {
for i, test := range parseLine.Tests { for _, test := range parseLine.Tests {
parseOutput := map[string]string{} parseOutput := map[string]string{}
ParseLine(nil, parseLine.Pattern, parseLine.Vars, parseOutput, test.Line, parseLine.Ignore) 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)
} }
} }
} }

View file

@ -135,9 +135,9 @@ irc:
uploader: "Anon-Uploader" 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" - 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: expect:
torrentName: "Awesome " torrentName: "Awesome Live Action Special"
title: "Awesome " title: "Awesome Live Action Special"
category: "Live Action Special - Live Action TV Special" category: "Live Action TV Special"
year: "2021" year: "2021"
releaseTags: "Web / MKV / h264 / 848x480 / AAC 2.0 / Softsubs (Sub Group)" releaseTags: "Web / MKV / h264 / 848x480 / AAC 2.0 / Softsubs (Sub Group)"
releaseGroup: "Sub Group" releaseGroup: "Sub Group"
@ -193,7 +193,7 @@ irc:
torrentId: "000000" torrentId: "000000"
tags: "" tags: ""
uploader: "Uploader" 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: vars:
- torrentName - torrentName
- title - title