invidious-instances.py 425 B

12345678910111213
  1. #!/usr/bin/env python
  2. # Using the invidious instance API it prints out most likely working
  3. # and healthy HTTPS invidious instances.
  4. import requests
  5. url = "https://api.invidious.io/instances.json"
  6. data = requests.get(url).json()
  7. for i, instance in enumerate(data):
  8. if instance[1]["type"] == "onion":
  9. pass
  10. elif float(instance[1]["monitor"]["30dRatio"]["ratio"]) > float(90):
  11. print(instance[1]["uri"])