Add check to see if instances can fetch videos.

This commit is contained in:
Kavin 2023-07-02 00:41:09 +01:00
parent fab1a5b01c
commit 53e860be10
No known key found for this signature in database
GPG key ID: 6E4598CA5C92C41F

10
main.go
View file

@ -183,6 +183,16 @@ func monitorInstances() {
} }
} }
// check if instance can fetch videos
resp, err = http.Get(ApiUrl + "/streams/jNQXAC9IVRw")
if err != nil {
log.Print(err)
continue
}
if resp.StatusCode != 200 {
continue
}
instances = append(instances, Instance{ instances = append(instances, Instance{
Name: strings.TrimSpace(split[0]), Name: strings.TrimSpace(split[0]),
ApiUrl: ApiUrl, ApiUrl: ApiUrl,