mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(indexers): animebytes parse group and category (#327)
* refactor(AB): get releaseGroup * feat(AB): match category
This commit is contained in:
parent
97020a957c
commit
95ff83cd3a
3 changed files with 37 additions and 6 deletions
|
@ -190,7 +190,6 @@ func (r *Release) ParseString(title string) {
|
||||||
r.Resolution = rel.Resolution
|
r.Resolution = rel.Resolution
|
||||||
r.Season = rel.Series
|
r.Season = rel.Series
|
||||||
r.Episode = rel.Episode
|
r.Episode = rel.Episode
|
||||||
r.Group = rel.Group
|
|
||||||
r.Region = rel.Region
|
r.Region = rel.Region
|
||||||
r.Audio = rel.Audio
|
r.Audio = rel.Audio
|
||||||
r.AudioChannels = rel.Channels
|
r.AudioChannels = rel.Channels
|
||||||
|
@ -204,6 +203,10 @@ func (r *Release) ParseString(title string) {
|
||||||
r.Year = rel.Year
|
r.Year = rel.Year
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if r.Group == "" {
|
||||||
|
r.Group = rel.Group
|
||||||
|
}
|
||||||
|
|
||||||
r.ParseReleaseTagsString(r.ReleaseTags)
|
r.ParseReleaseTagsString(r.ReleaseTags)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
@ -466,6 +469,10 @@ func (r *Release) MapVars(def *IndexerDefinition, varMap map[string]string) erro
|
||||||
r.Resolution = resolution
|
r.Resolution = resolution
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if releaseGroup, err := getStringMapValue(varMap, "releaseGroup"); err == nil {
|
||||||
|
r.Group = releaseGroup
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -426,6 +426,24 @@ func TestRelease_MapVars(t *testing.T) {
|
||||||
definition: IndexerDefinition{Parse: &IndexerParse{ForceSizeUnit: "MB"}},
|
definition: IndexerDefinition{Parse: &IndexerParse{ForceSizeUnit: "MB"}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "9",
|
||||||
|
fields: &Release{},
|
||||||
|
want: &Release{
|
||||||
|
TorrentName: "Greatest Anime Ever",
|
||||||
|
Year: 2022,
|
||||||
|
Group: "GROUP1",
|
||||||
|
Tags: []string{"comedy", "fantasy", "school.life", "shounen", "slice.of.life"},
|
||||||
|
Uploader: "Tester",
|
||||||
|
},
|
||||||
|
args: args{varMap: map[string]string{
|
||||||
|
"torrentName": "Greatest Anime Ever",
|
||||||
|
"year": "2022",
|
||||||
|
"releaseGroup": "GROUP1",
|
||||||
|
"tags": "comedy, fantasy, school.life, shounen, slice.of.life",
|
||||||
|
"uploader": "Tester",
|
||||||
|
}},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|
|
@ -49,15 +49,21 @@ parse:
|
||||||
type: single
|
type: single
|
||||||
lines:
|
lines:
|
||||||
- test:
|
- test:
|
||||||
- "Other Show! 3rd Season - TV Series [2020] :: Blu-ray / MKV / h265 10-bit / 1080p / FLAC 5.0 / RAW (LoliHouse) / Freeleech || https://animebytes.tv/torrents.php?id=000000&torrentid=00000000 || music || Uploaded by: Anonymous"
|
- "Aweomse Raw Novel - Light Novel [2005] :: Raw / EPUB || https://animebytes.tv/torrents.php?id=00000&torrentid=00000 || supernatural || Uploaded by: Test-Uploader"
|
||||||
- "Show 1 - TV Series [2004] :: DVD / MKV / h264 10-bit / 712x478 / FLAC 2.0 / Dual Audio / Softsubs (WSE) || https://animebytes.tv/torrents.php?id=0000&torrentid=000000 || coming.of.age, romance, seinen, slice.of.life, tragedy || Uploaded by: Uploader"
|
- "Awesome Translated Novel - Light Novel [2018] :: Translated (Translation Group) / EPUB || https://animebytes.tv/torrents.php?id=00000&torrentid=000000 || adventure, comedy, fantasy, harem, school.life, magic, action || Uploaded by: UPLOADER"
|
||||||
- "Artist - Album! Original Sound Track [2011] :: MP3 / V0 (VBR) / CD || https://animebytes.tv/torrents2.php?id=000000&torrentid=0000000 || soundtrack || Uploaded by: Test-Uploader"
|
- "Great BluRay SoftSubbed Anime - TV Series [2020] :: Blu-ray / MKV / h264 10-bit / 1080p / FLAC 2.0 / Dual Audio / Softsubs (Sub Group) / Freeleech || https://animebytes.tv/torrents.php?id=00008&torrentid=000000 || comedy, drama, school.life, sports || Uploaded by: Uploader"
|
||||||
- "Cool Movie - Movie [2020] :: Blu-ray / MKV / h265 10-bit / 1929x804 / AC3 5.1 / Dual Audio / Softsubs (CBM) || https://animebytes.tv/torrents.php?id=000000&torrentid=0000000 || drama, romance, slice.of.life || Uploaded by: Anonymous"
|
- "Awesome Translated Manga - Manga [2019] :: Translated (Translation Group) / Digital / Ongoing || https://animebytes.tv/torrents.php?id=00000&torrentid=000000 || comedy, fantasy, school.life, shounen, slice.of.life"
|
||||||
pattern: '(.*)[\s\p{Zs}]{2,}\[(\d+)\] :: (.*) \|\| (https.*)\/torrents.*\?id=\d+&torrentid=(\d+) \|\| (.+?(?:(?:\|\| Uploaded by|$))?)(?:\|\| Uploaded by: (.*))?$'
|
- "Cool Movie - Movie [2020] :: Blu-ray / MKV / h265 10-bit / 1929x804 / AC3 5.1 / Dual Audio / Softsubs (Sub Group) || https://animebytes.tv/torrents.php?id=000000&torrentid=0000000 || drama, romance, slice.of.life || Uploaded by: Anon-Uploader"
|
||||||
|
- "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"
|
||||||
|
- "Best Visual Novel - Visual Novel [2006] :: Game / PC / Unarchived / Hentai (Censored) || https://animebytes.tv/torrents.php?id=00000&torrentid=00000 || nukige || Uploaded by: Uploader"
|
||||||
|
- "Artist Name - Album of awesome Music [1991] :: MP3 / V0 (VBR) / CD || https://animebytes.tv/torrents2.php?id=00000&torrentid=000000 || ambient, folk || Uploaded by: Uploader"
|
||||||
|
pattern: '(.*?(Visual Novel|Light Novel|TV.*|Movie|Manga|OVA|ONA|DVD Special|BD Special|Oneshot|Anthology|Manhwa|Manhua|Artbook|Game|Live Action.*|))[\s\p{Zs}]{2,}\[(\d+)\] :: (.*(?:RAW|Softsubs|Hardsubs|Translated)\s\((.+)\).*|.*)\|\| (https.*)\/torrents.*\?id=\d+&torrentid=(\d+) \|\| (.+?(?:(?:\|\| Uploaded by|$))?)(?:\|\| Uploaded by: (.*))?$'
|
||||||
vars:
|
vars:
|
||||||
- torrentName
|
- torrentName
|
||||||
|
- category
|
||||||
- year
|
- year
|
||||||
- releaseTags
|
- releaseTags
|
||||||
|
- releaseGroup
|
||||||
- baseUrl
|
- baseUrl
|
||||||
- torrentId
|
- torrentId
|
||||||
- tags
|
- tags
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue