mirror of
https://github.com/teacat/chaturbate-dvr.git
synced 2025-10-29 16:59:59 +00:00
Adds more check for resp == nil, v0.93
This commit is contained in:
parent
67bb63ce0b
commit
029f471477
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4
main.go
4
main.go
@ -120,7 +120,7 @@ func parseHLSSource(url string, baseURL string) string {
|
||||
if len(errs) > 0 {
|
||||
log.Println(color.Colorize(color.Red, errs[0].Error()))
|
||||
}
|
||||
if resp.StatusCode == 403 {
|
||||
if resp == nil || resp.StatusCode == 403 {
|
||||
return ""
|
||||
}
|
||||
p, _, _ := m3u8.DecodeFrom(strings.NewReader(body), true)
|
||||
@ -138,7 +138,7 @@ func parseM3U8Source(url string) (chunks []*m3u8.MediaSegment, wait float64, err
|
||||
log.Println(color.Colorize(color.Red, errs[0].Error()))
|
||||
}
|
||||
// Retry after 3 seconds if the connection lost or status code returns 403 (the channel might went offline).
|
||||
if len(errs) > 0 || resp.StatusCode == http.StatusForbidden {
|
||||
if len(errs) > 0 || resp == nil || resp.StatusCode == http.StatusForbidden {
|
||||
return nil, 3, errInternal
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user