demo_send_gotify.py 558 B

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. import subprocess
  3. token = 'AdVsmticWy_cnF6'
  4. title = '测试标题'
  5. message = '这是一条通过 Webhook 推送的消息'
  6. priority = 5
  7. # 推送消息
  8. result = subprocess.run(['curl',
  9. f'https://gotify.erhe.top/message?token={token}',
  10. '-F',
  11. f'title={title}',
  12. '-F',
  13. f'message={message}',
  14. '-F',
  15. f'priority={priority}'
  16. ])
  17. print(result)