diff --git a/package.json b/package.json index 030d79d..fd3d6dd 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "DoubanRank": { "name": "豆瓣榜单订阅", "description": "监控豆瓣热门榜单,自动添加订阅。", - "version": "1.1", + "version": "1.2", "icon": "movie.jpg", "color": "#01B3E3", "author": "jxxghp", diff --git a/plugins/chatgpt/__init__.py b/plugins/chatgpt/__init__.py index 51fb1bd..c91a2c2 100644 --- a/plugins/chatgpt/__init__.py +++ b/plugins/chatgpt/__init__.py @@ -96,7 +96,7 @@ class ChatGPT(_PluginBase): 'component': 'VSwitch', 'props': { 'model': 'proxy', - 'label': '使用代理', + 'label': '使用代理服务器', } } ] diff --git a/plugins/doubanrank/__init__.py b/plugins/doubanrank/__init__.py index 78f6a30..173d390 100644 --- a/plugins/doubanrank/__init__.py +++ b/plugins/doubanrank/__init__.py @@ -29,7 +29,7 @@ class DoubanRank(_PluginBase): # 主题色 plugin_color = "#01B3E3" # 插件版本 - plugin_version = "1.1" + plugin_version = "1.2" # 插件作者 plugin_author = "jxxghp" # 作者主页 @@ -64,6 +64,7 @@ class DoubanRank(_PluginBase): _vote = 0 _clear = False _clearflag = False + _proxy = False def init_plugin(self, config: dict = None): self.downloadchain = DownloadChain() @@ -72,6 +73,7 @@ class DoubanRank(_PluginBase): if config: self._enabled = config.get("enabled") self._cron = config.get("cron") + self._proxy = config.get("proxy") self._onlyonce = config.get("onlyonce") self._vote = float(config.get("vote")) if config.get("vote") else 0 rss_addrs = config.get("rss_addrs") @@ -163,6 +165,22 @@ class DoubanRank(_PluginBase): } ] }, + { + 'component': 'VCol', + 'props': { + 'cols': 12, + 'md': 6 + }, + 'content': [ + { + 'component': 'VSwitch', + 'props': { + 'model': 'proxy', + 'label': '使用代理服务器', + } + } + ] + }, { 'component': 'VCol', 'props': { @@ -292,6 +310,7 @@ class DoubanRank(_PluginBase): ], { "enabled": False, "cron": "", + "proxy": False, "onlyonce": False, "vote": "", "ranks": [], @@ -529,13 +548,15 @@ class DoubanRank(_PluginBase): self._clearflag = False logger.info(f"所有榜单RSS刷新完成") - @staticmethod - def __get_rss_info(addr) -> List[dict]: + def __get_rss_info(self, addr) -> List[dict]: """ 获取RSS """ try: - ret = RequestUtils().get_res(addr) + if self._proxy: + ret = RequestUtils(proxies=settings.PROXY).get_res(addr) + else: + ret = RequestUtils().get_res(addr) if not ret: return [] ret_xml = ret.text