Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Greyh4t committed Oct 14, 2020
1 parent 722b4cb commit 586ba1c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func start(mpl *m3u8.MediaPlaylist) {
go func() {
var count = int(mpl.Count())
for i := 0; i < count; i++ {
pool.Push([]interface{}{i, mpl.Segments[i], mpl.Key})
pool.Push(i, mpl.Segments[i], mpl.Key)
}
pool.CloseQueue()
}()
Expand Down Expand Up @@ -185,11 +185,10 @@ func getKey(url string) ([]byte, error) {
return key, nil
}

func download(in interface{}) {
params := in.([]interface{})
id := params[0].(int)
segment := params[1].(*m3u8.MediaSegment)
globalKey := params[2].(*m3u8.Key)
func download(args ...interface{}) {
id := args[0].(int)
segment := args[1].(*m3u8.MediaSegment)
globalKey := args[2].(*m3u8.Key)

statusCode, data, err := ZHTTP.Get(segment.URI, headers, conf.Retry)
if err != nil {
Expand Down

0 comments on commit 586ba1c

Please sign in to comment.