|
|
|
@ -16,10 +16,11 @@ def message2telegram(tg_api_host, tg_proxy, tg_bot_token, tg_user_id, content):
@@ -16,10 +16,11 @@ def message2telegram(tg_api_host, tg_proxy, tg_bot_token, tg_user_id, content):
|
|
|
|
|
} |
|
|
|
|
else: |
|
|
|
|
proxies = None |
|
|
|
|
if requests.post(url=url, data=send_data, proxies=proxies) == 200: |
|
|
|
|
try : |
|
|
|
|
requests.post(url=url, data=send_data, proxies=proxies) |
|
|
|
|
print("推送成功") |
|
|
|
|
return 1 |
|
|
|
|
else: |
|
|
|
|
except: |
|
|
|
|
print("推送失败") |
|
|
|
|
return 0 |
|
|
|
|
|
|
|
|
@ -30,4 +31,4 @@ def send(content):
@@ -30,4 +31,4 @@ def send(content):
|
|
|
|
|
tg_bot_token = os.environ.get('TG_BOT_TOKEN') |
|
|
|
|
tg_user_id = os.environ.get('TG_USER_ID') |
|
|
|
|
message2telegram(tg_api_host=tg_api_host, tg_proxy=tg_proxy, tg_bot_token=tg_bot_token, tg_user_id=tg_user_id, |
|
|
|
|
content=content) |
|
|
|
|
content=content) |