All of the webhooks the website uses for updates
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

26 lines
500 B

  1. import sys
  2. import os
  3. import requests
  4. import json
  5. TOKEN = os.environ["GITEA_API_KEY"]
  6. url = "https://git.crux.best/api/v1/repos/chemicalcrux/{0}/releases".format(sys.argv[1])
  7. r = requests.get(url, headers = {
  8. "authorization": "token " + TOKEN
  9. })
  10. if r.status_code != 200:
  11. print("oops...")
  12. sys.exit(1)
  13. data = json.loads(r.text)
  14. result = {}
  15. for release in data:
  16. result[release["name"]] = release["body"]
  17. with open(sys.argv[2], "w", encoding="utf-8") as file:
  18. json.dump(result, file)