This commit is contained in:
@@ -15,6 +15,15 @@ func TestExtractVideoPreviewURLFindsEnvatoPreview(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestExtractVideoPreviewURLFindsGenericM3U8(t *testing.T) {
|
||||
html := `<script>window.preview="https:\/\/cdn.example.com\/preview\/master.m3u8?token=abc"</script>`
|
||||
got := extractVideoPreviewURL(html)
|
||||
want := "https://cdn.example.com/preview/master.m3u8?token=abc"
|
||||
if got != want {
|
||||
t.Fatalf("expected %q, got %q", want, got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDeriveEnvatoPreviewFromThumbnail(t *testing.T) {
|
||||
thumb := "https://elements-resized.envatousercontent.com/elements-video-cover-images/ad0a3abc-7eb0-4075-8f68-8198f9a08777/video_preview/video_preview_0000.jpg?w=1200&h=630"
|
||||
got := deriveEnvatoPreviewFromThumbnail(thumb)
|
||||
|
||||
Reference in New Issue
Block a user