Skip to content

Commit

Permalink
Update m3u8-downloader.go
Browse files Browse the repository at this point in the history
fix bug
  • Loading branch information
llychao authored Dec 2, 2024
1 parent a6fd672 commit 95009c4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions m3u8-downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ func getM3u8Key(host, html string) (key string) {
key = ""
for _, line := range lines {
if strings.Contains(line, "#EXT-X-KEY") {
if !strings.Contains(line, "URI") {
continue
}
fmt.Println("[debug] line_key:",line)
uri_pos := strings.Index(line, "URI")
quotation_mark_pos := strings.LastIndex(line, "\"")
key_url := strings.Split(line[uri_pos:quotation_mark_pos], "\"")[1]
Expand All @@ -179,9 +183,11 @@ func getM3u8Key(host, html string) (key string) {
checkErr(err)
if res.StatusCode == 200 {
key = res.String()
break
}
}
}
fmt.Println("[debug] m3u8Host:",host,"m3u8Key:",key)
return
}

Expand Down

0 comments on commit 95009c4

Please sign in to comment.