feat(releases): improve collections/website/streaming service parsing (#1923)

* feat(releases): improve collections/website/streaming service parsing

* feat(releases): add more streaming services
This commit is contained in:
ze0s 2025-01-06 22:09:26 +01:00 committed by GitHub
parent 50820e6374
commit 338bcf38bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 81 additions and 0 deletions

View file

@ -1103,6 +1103,41 @@ func TestRelease_Hash(t *testing.T) {
},
want: "63b5d87abe5fb49131785de426708d31",
},
{
name: "29",
fields: fields{
TorrentName: "That Other Show 2023 S01E01 2160p WEB-DL DTS-HD 5.1 HEVC-GROUP",
},
want: "2b4fbd68007c73664cdf9c1abb33fba9",
},
{
name: "30",
fields: fields{
TorrentName: "That Other Show 2023 S01E01 2160p ATVP WEB-DL DTS-HD 5.1 HEVC-GROUP",
},
want: "a1ad6c5ef96a50e5c3df434ec118185a",
},
{
name: "31",
fields: fields{
TorrentName: "That Other Show 2023 S01E01 2160p MA WEB-DL DTS-HD 5.1 HEVC-GROUP",
},
want: "d2976631b738bcd974e02af2c0b680a1",
},
{
name: "32",
fields: fields{
TorrentName: "That Other Show 2023 S01E01 2160p DSNP WEB-DL DTS-HD MA 5.1 HEVC-GROUP",
},
want: "aff58872541a8050146375ca76ea9fe7",
},
{
name: "33",
fields: fields{
TorrentName: "That Other Show 2023 S01E01 2160p MA WEB-DL DTS-HD MA 5.1 HEVC-GROUP",
},
want: "6d97a50010e7532478f8f4f9c469b885",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {

View file

@ -7,6 +7,9 @@ import (
"fmt"
"regexp"
"strconv"
"github.com/moistari/rls"
"github.com/moistari/rls/taginfo"
)
var types map[string][]*TagInfo
@ -264,6 +267,49 @@ func init() {
info.re = regexp.MustCompile(`(?i)(?:` + info.RE() + `)`)
}
}
var extraTagInfos = map[string][]*taginfo.Taginfo{}
extraCollections := [][]string{
{"4OD", "4OD", "(?-i:4OD)", "", "", ""},
{"ABEMA", "Abema", "(?-i:ABEMA)", "", "", ""},
{"ADN", "Animation Digital Network", "(?-i:ADN)", "", "", ""},
{"AUBC", "Australian Broadcasting Corporation", "", "", "", ""},
{"AUViO", "French AUViO", "(?-i:AUViO)", "", "", ""},
{"Bilibili", "Bilibili", "(?-i:Bilibili)", "", "", ""},
{"CRiT", "Criterion Channel", "(?-i:CRiT)", "", "", ""},
{"FOD", "Fuji Television On Demand", "(?-i:FOD)", "", "", ""},
{"HIDIVE", "HIDIVE", "(?-i:HIDIVE)", "", "", ""},
{"ITVX", "ITVX aka ITV", "", "", "", ""},
{"MA", "Movies Anywhere", "(?-i:MA)", "", "", ""},
{"MY5", "MY5 aka Channel 5", "", "", "", ""},
{"MyCanal", "French Groupe Canal+", "(?-i:MyCanal)", "", "", ""},
{"NOW", "Now", "(?-i:NOW)", "", "", ""},
{"NLZ", "Dutch NLZiet", "(?-i:NLZ|NLZiet)", "", "", ""},
{"OViD", "OViD", "(?-i:OViD)", "", "", ""},
{"STRP", "Star+", "(?-i:STRP)", "", "", ""},
{"U-NEXT", "U-NEXT", "(?-i:U-NEXT)", "", "", ""},
{"TVer", "TVer", "(?-i:TVer)", "", "", ""},
{"TVING", "TVING", "(?-i:TVING)", "", "", ""},
{"VIU", "VIU", "(?-i:VIU)", "", "", ""},
{"VDL", "Videoland", "(?-i:VDL)", "", "", ""},
{"VRV", "VRV", "(?-i:VRV)", "", "", ""},
{"Pathe", "Pathé Thuis", "(?-i:Pathe)", "", "", ""},
{"SALTO", "SALTO", "(?-i:SALTO)", "", "", ""},
{"SHOWTIME", "SHOWTIME", "(?-i:SHO|SHOWTIME)", "", "", ""},
{"SYFY", "SYFY", "(?-i:SYFY)", "", "", ""},
{"QUIBI", "QUIBI", "(?-i:QIBI|QUIBI)", "", "", ""},
}
for _, collection := range extraCollections {
inf, err := taginfo.New(collection[0], collection[1], collection[2], collection[3], collection[4], collection[5])
if err != nil {
//log.Fatal(err)
}
extraTagInfos["collection"] = append(extraTagInfos["collection"], inf)
}
rls.DefaultParser = rls.NewTagParser(taginfo.All(extraTagInfos), rls.DefaultLexers()...)
}
type TagInfo struct {