mirror of
https://github.com/TeamPiped/instances-api.git
synced 2024-08-14 23:57:19 +00:00
Add check to see if instances can fetch videos.
This commit is contained in:
parent
fab1a5b01c
commit
53e860be10
1 changed files with 10 additions and 0 deletions
10
main.go
10
main.go
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue