Skip to content

Commit

Permalink
add additional sources (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
aidan- authored Apr 22, 2023
1 parent dacd5fe commit 1c88bd5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ func TestParser_Parse(t *testing.T) {
Group: "cookiemonster",
Title: "stephen colbert",
Date: "2019-02-03",
Source: "web",
ContentType: TV,
},
},
Expand Down Expand Up @@ -360,6 +361,7 @@ func TestParser_Parse(t *testing.T) {
Resolution: "4k",
Codec: "x265",
Group: "NAHOM",
Source: "bdremux",
Languages: []string{"ita", "eng"},
Hdr: true,
Season: -1,
Expand Down
2 changes: 1 addition & 1 deletion source.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var (
)

func init() {
sourceGeneral = regexp.MustCompile(`(?i)\b(?:(?:HD-?)?CAM|HD-?Rip|HDTV|BRRip|BDRip|DVDRip|DVDscr|(?:HD-?)?TVRip|TC|PPVRip|R5|VHSSCR|Bluray|WEB-?DL|WEB-?Rip|(?:DL|WEB|BD|BR)MUX)\b`)
sourceGeneral = regexp.MustCompile(`(?i)\b(?:(?:HD-?)?CAM|HD-?Rip|HDTV|BRRip|BDRip|DVDRip|DVDscr|(?:HD-?)?TVRip|TC|PPVRip|R5|VHSSCR|Blu-?ray|WEB-?DL|WEB-?Rip|(?:DL|WEB|BD|BR|BDRE|RE)MUX)|WEB\b`)
sourceTelesync = regexp.MustCompile("(?i)\b(?:HD-?)?T(?:ELE)?S(?:YNC)?\b")
sourceDvd = regexp.MustCompile("(?i)(DVD)(?:R[0-9])?")
}
Expand Down
20 changes: 20 additions & 0 deletions source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,26 @@ func TestParser_GetSource(t *testing.T) {
name: "Pitch.Perfect.2.2015.REPACK.1080p.BluRay.DTS.x264-VietHD.mkv",
want: "bluray",
},
{
desc: "bdremux extracted",
name: "Pitch.Perfect.2.2015.REPACK.1080p.BDRemux.DTS.x264-VietHD.mkv",
want: "bdremux",
},
{
desc: "remux extracted",
name: "Pitch.Perfect.2.2015.REPACK.1080p.REMUX.DTS.x264-VietHD.mkv",
want: "remux",
},
{
desc: "blu-ray extracted",
name: "Pitch.Perfect.2.2015.REPACK.1080p.Blu-Ray.DTS.x264-VietHD.mkv",
want: "blu-ray",
},
{
desc: "extract web",
name: "Stephen.Colbert.2023.02.15.Jim.Gaffigan.1080p.WEB.H264-JEBAITED.mkv",
want: "web",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 1c88bd5

Please sign in to comment.