初始提交:短剧库源码(含转码优化 ultrafast)

This commit is contained in:
yvan
2026-09-17 19:09:08 +08:00
commit 07dc0f1059
247 changed files with 43242 additions and 0 deletions
@@ -0,0 +1,23 @@
package app
import "testing"
func TestPlaybackHistorySourceIdentity(t *testing.T) {
for _, input := range []struct{ id, source string }{
{"hongguo:7000000000000000001", "hongguo"},
{"huangdou:123", "huangdou"},
{"huangguoai:456", "huangguoai"},
{"huangguo-video:789", "huangguo-video"},
{"legacy-123", "cloudfront"},
} {
id, source, valid := playbackHistoryIdentity(input.id)
if !valid || id != input.id || source != input.source {
t.Fatal(input, id, source, valid)
}
}
for _, invalid := range []string{"", "unsupported:123", "../data", "https://example.invalid", "123\n456"} {
if _, _, valid := playbackHistoryIdentity(invalid); valid {
t.Fatal("invalid history identity accepted", invalid)
}
}
}