feat(latest): poll novelfull via headless browser, lightnovelworld via TLS

This commit is contained in:
2026-08-06 03:10:50 +07:00
parent c81e50c7f1
commit 92f1fbf6ec
4 changed files with 141 additions and 29 deletions
+21
View File
@@ -36,3 +36,24 @@ func TestKaganeAPIURL(t *testing.T) {
})
}
}
func TestNovelfullSeriesURL(t *testing.T) {
cases := []struct {
name string
url string
want bool
}{
{"series page", "https://novelfull.com/reverend-insanity.html", true},
{"foreign host", "https://evil.example/reverend-insanity.html", false},
{"not https", "http://novelfull.com/reverend-insanity.html", false},
{"not a series page", "https://novelfull.com/genre/Fantasy", false},
{"garbage", "://nope", false},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
if got := novelfullSeriesURL(tc.url); got != tc.want {
t.Fatalf("novelfullSeriesURL(%q) = %v, want %v", tc.url, got, tc.want)
}
})
}
}