Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
canhlinh committed Dec 15, 2020
1 parent 94f53fd commit 390c681
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hlsdl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ func TestDescrypt(t *testing.T) {
t.Fatal(err)
}

hlsDl := New("https://cdn.theoplayer.com/video/big_buck_bunny_encrypted/stream-800/index.m3u8", "./download", 2, false)
hlsDl := New("https://cdn.theoplayer.com/video/big_buck_bunny_encrypted/stream-800/index.m3u8", "./", 2, false)

seg := segs[0]
seg.Path = fmt.Sprintf("%s/seg%d.ts", hlsDl.dir, seg.SeqId)
if err := hlsDl.downloadSegment(seg); err != nil {
t.Fatal(err)
}
defer os.Remove(seg.Path)

if _, err := hlsDl.Decrypt(seg); err != nil {
if _, err := hlsDl.decrypt(seg); err != nil {
t.Fatal(err)
}
}

func TestDownload(t *testing.T) {

hlsDl := New("https://cdn.theoplayer.com/video/big_buck_bunny_encrypted/stream-800/index.m3u8", "./download", 2, false)
hlsDl := New("https://cdn.theoplayer.com/video/big_buck_bunny_encrypted/stream-800/index.m3u8", "./", 2, false)
filepath, err := hlsDl.Download()
if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 390c681

Please sign in to comment.