feat: bypass Cloudflare block & convert close/mark issue shell scripts to Python
This commit is contained in:
@@ -157,6 +157,7 @@ def api_request(method, url, auth_header, payload=None):
|
||||
req = urllib.request.Request(url, data=data, method=method)
|
||||
req.add_header("Authorization", auth_header)
|
||||
req.add_header("Content-Type", "application/json")
|
||||
req.add_header("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36")
|
||||
try:
|
||||
with urllib.request.urlopen(req) as resp:
|
||||
body = resp.read().decode("utf-8")
|
||||
|
||||
Reference in New Issue
Block a user