mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-02-13 07:16:43 +08:00
重命名推送函数
This commit is contained in:
@@ -8,7 +8,7 @@ from .download_client import DownloadClient
|
||||
|
||||
from module.conf import settings
|
||||
from module.parser import TitleParser
|
||||
from ..network import PostNotification, FtqqNotification
|
||||
from ..network import PostNotification, ServerChanNotification
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -54,7 +54,7 @@ class Renamer:
|
||||
return path_name, season, folder_name, suffix, download_path
|
||||
|
||||
def run(self):
|
||||
notification = FtqqNotification()
|
||||
notification = ServerChanNotification()
|
||||
recent_info, torrent_count = self.get_torrent_info()
|
||||
rename_count = 0
|
||||
for info in recent_info:
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
from .request_contents import RequestContent
|
||||
from .notification import PostNotification, FtqqNotification
|
||||
from .notification import PostNotification, ServerChanNotification
|
||||
|
||||
@@ -19,7 +19,7 @@ class PostNotification:
|
||||
return response.status_code == 200
|
||||
|
||||
|
||||
class FtqqNotification:
|
||||
class ServerChanNotification:
|
||||
"""Server酱推送"""
|
||||
|
||||
def __init__(self):
|
||||
@@ -35,12 +35,12 @@ class FtqqNotification:
|
||||
resp = requests.post(self.notification_url, json=data, timeout=3)
|
||||
resp.raise_for_status()
|
||||
except requests.RequestException as e:
|
||||
logging.error("[FtqqNotification] send fail, error: %s" % e)
|
||||
logging.error("[ServerChanNotification] send fail, error: %s" % e)
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
name = "勇者、辞职不干了"
|
||||
notification = FtqqNotification()
|
||||
notification = ServerChanNotification()
|
||||
notification.send_msg(f"《{name[:10]}》缓存成功", f"[Auto Bangumi]《{name}》缓存成功")
|
||||
|
||||
Reference in New Issue
Block a user