From 5299bf002d63c0d04b3e7a94f793241adb3c06a0 Mon Sep 17 00:00:00 2001 From: thsrite Date: Sat, 14 Sep 2024 12:41:58 +0800 Subject: [PATCH] =?UTF-8?q?fix=20Emby=E8=A7=82=E5=BD=B1=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=20v1.7=20=E5=88=86=E5=9D=97=E5=8F=91=E9=80=81=EF=BC=8C?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E5=BE=AE=E4=BF=A1=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/EmbyReporter.md | 10 ------- package.json | 3 +- plugins/embyreporter/__init__.py | 47 +++++--------------------------- 3 files changed, 8 insertions(+), 52 deletions(-) diff --git a/docs/EmbyReporter.md b/docs/EmbyReporter.md index 034b2f6..6d2847d 100644 --- a/docs/EmbyReporter.md +++ b/docs/EmbyReporter.md @@ -19,13 +19,3 @@ ![img.png](../img/EmbyReporter/img.png) ![img_1.png](../img/EmbyReporter/img_1.png) -每日一言推荐 -`` -https://v.api.aa1.cn/api/yiyan/index.php -https://yijuzhan.com/api/word.php -`` - -点点推荐舔狗 -`` -https://v.api.aa1.cn/api/tiangou/index.php -`` diff --git a/package.json b/package.json index 5517ee9..9eeccbc 100644 --- a/package.json +++ b/package.json @@ -204,12 +204,11 @@ "name": "Emby观影报告", "description": "推送Emby观影报告,需Emby安装Playback Report 插件。", "labels": "Emby", - "version": "1.7.1", + "version": "1.8", "icon": "Pydiocells_A.png", "author": "thsrite", "level": 1, "history": { - "v1.7.1": "分块发送,带每日一言", "v1.7": "分块发送,兼容微信推送", "v1.6": "fix #67", "v1.5": "按观影市场排序", diff --git a/plugins/embyreporter/__init__.py b/plugins/embyreporter/__init__.py index f62e5e6..4e4fba3 100644 --- a/plugins/embyreporter/__init__.py +++ b/plugins/embyreporter/__init__.py @@ -33,7 +33,7 @@ class EmbyReporter(_PluginBase): # 插件图标 plugin_icon = "Pydiocells_A.png" # 插件版本 - plugin_version = "1.7.1" + plugin_version = "1.7" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -56,7 +56,6 @@ class EmbyReporter(_PluginBase): _mp_host = None _emby_host = None _emby_api_key = None - _text_url = None show_time = True _scheduler: Optional[BackgroundScheduler] = None @@ -82,7 +81,6 @@ class EmbyReporter(_PluginBase): self._type = config.get("type") or "tg" self._mp_host = config.get("mp_host") self.show_time = config.get("show_time") - self._text_url = config.get("text_url") self._emby_host = config.get("emby_host") self._emby_api_key = config.get("emby_api_key") if self._emby_host and self._emby_api_key: @@ -160,29 +158,17 @@ class EmbyReporter(_PluginBase): self.__split_image_by_height(report_path, "/public/report", [250, 330, 335]) # 分块推送 - for i in range(1, 4): - report_path_part = report_path + f"_part_{i}.jpg" + for i in range(2, 4): + report_path_part = f"/public/report_part_{i}.jpg" report_url = self._mp_host + report_path_part.replace("/public", "") mtype = NotificationType.MediaServer if self._type: mtype = NotificationType.__getitem__(str(self._type)) or NotificationType.MediaServer - # 每日一言 - report_text = None - if self._text_url: - try: - resp = RequestUtils().get_res(url=self._text_url) - if resp.status_code == 200: - report_text = resp.text - - if report_text: - report_text = str(report_text).replace("

", "").replace("

", "") - except Exception as e: - print(e) - self.post_message(mtype=mtype, - image=report_url, - text=report_text) - logger.info(f"Emby观影记录推送成功") + self.post_message(title='Movies观影排行' if i == 2 else 'TV Shows观影排行', + mtype=mtype, + image=report_url) + logger.info(f"Emby观影记录推送成功 {report_url}") @staticmethod def __split_image_by_height(image_path, output_path_prefix, heights): @@ -230,7 +216,6 @@ class EmbyReporter(_PluginBase): "cnt": self._cnt, "type": self._type, "mp_host": self._mp_host, - "text_url": self._text_url, "show_time": self.show_time, "emby_host": self._emby_host, "emby_api_key": self._emby_api_key, @@ -441,23 +426,6 @@ class EmbyReporter(_PluginBase): } ] }, - { - 'component': 'VCol', - 'props': { - 'cols': 12, - 'md': 6 - }, - 'content': [ - { - 'component': 'VTextField', - 'props': { - 'model': 'text_url', - 'label': '每日一言api', - 'placeholder': '空则不发送' - } - } - ] - } ] }, { @@ -553,7 +521,6 @@ class EmbyReporter(_PluginBase): "emby_api_key": "", "mp_host": "", "show_time": True, - "text_url": "", "type": "" }