fix: add missing test helpers and fix interface assertion

This commit is contained in:
2026-05-13 12:59:05 +02:00
parent 5a4d48f1b7
commit 0a5ed4ae76
2 changed files with 12 additions and 1 deletions

View File

@@ -730,6 +730,17 @@ func detectStreamType(sourceURL string) string {
return "unknown"
}
func isLikelyM3U8(data []byte) bool {
return bytes.HasPrefix(bytes.TrimSpace(data), []byte("#EXTM3U"))
}
func isLikelyMP4(data []byte) bool {
if len(data) < 8 {
return false
}
return string(data[4:8]) == "ftyp"
}
func detectEmbedType(rawURL string) string {
lower := strings.ToLower(rawURL)
embedHosts := []string{"streamwish", "streamsb", "mp4upload", "ok.ru", "gogoplay", "streamlare"}

View File

@@ -441,7 +441,7 @@ func TestAllAnimeClientImplementsInterfaces(t *testing.T) {
var (
_ interface {
GetStreams(context.Context, int, string, string) (*domain.StreamResult, error)
GetStreams(context.Context, int, []string, string, string) (*domain.StreamResult, error)
} = &AllAnimeProvider{}
)