Files
Auto_Bangumi/module/network/notification.py
EstrellaXD f31acc70ff 2.6.0
- refactor
- change config from config.ini to config.json
2023-03-04 20:33:57 +08:00

14 lines
413 B
Python

import requests
from module.conf import settings
class PostNotification:
def __init__(self):
self.token = settings.notification_token
self.notification_url = lambda message: f"https://api.pushbullet.com/v2/{self.token}/{message}"
def ifttt_post(self, message):
url = self.notification_url(message)
response = requests.get(url)
return response.status_code == 200