Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
fix bug that header does not take effect
  • Loading branch information
Greyh4t committed Jul 20, 2021
1 parent 44ac42f commit f621009
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ var (
conf *Conf
keyCache = map[string][]byte{}
keyCacheLock sync.Mutex
headers map[string]string
)

type Conf struct {
Expand Down Expand Up @@ -171,7 +170,7 @@ func getKey(url string) ([]byte, error) {
return key, nil
}

statusCode, key, err := ZHTTP.Get(url, headers, conf.Retry)
statusCode, key, err := ZHTTP.Get(url, conf.headers, conf.Retry)
if err != nil {
return nil, err
}
Expand All @@ -190,7 +189,7 @@ func download(args ...interface{}) {
segment := args[1].(*m3u8.MediaSegment)
globalKey := args[2].(*m3u8.Key)

statusCode, data, err := ZHTTP.Get(segment.URI, headers, conf.Retry)
statusCode, data, err := ZHTTP.Get(segment.URI, conf.headers, conf.Retry)
if err != nil {
log.Fatalln("[-] Download failed:", id, err)
}
Expand Down

0 comments on commit f621009

Please sign in to comment.