From 04dd2292ca40106ce94fe1b03ee06cd991242c38 Mon Sep 17 00:00:00 2001 From: yyyz <904108079@qq.com> Date: Wed, 12 Oct 2022 00:20:47 +0800 Subject: [PATCH] =?UTF-8?q?release=205.0.3=20-=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E5=87=BA=E7=8E=B0=E7=9A=84=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20-=20volantis=E6=8A=93=E5=8F=96=E8=A7=84?= =?UTF-8?q?=E5=88=99=E5=A2=9E=E5=8A=A0=20-=20=E6=B7=BB=E5=8A=A0=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=9B=91=E6=8E=A7=E5=8A=9F=E8=83=BD=E5=92=8C=E7=AB=8B?= =?UTF-8?q?=E5=8D=B3=E8=BF=90=E8=A1=8C=E5=8A=9F=E8=83=BD=20-=20=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E5=89=8D=E7=AB=AF=E7=AE=A1=E7=90=86=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++-- api/main.py | 9 ++++++--- hexo_circle_of_friends/scrapy_conf.py | 6 +----- hexo_circle_of_friends/utils/get_url.py | 6 ++++++ 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 15e0fdc1031a..8b6e4ae65f26 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ 部署教程:[文档](https://fcircle-doc.yyyzyyyz.cn/) | [备用地址](https://fcircle-doc.is-a.dev/) ``` -5.0.2 支持: +5.0.3 支持: - 更好的前端样式 - 新增前端管理面板,告别繁琐的配置,管理朋友圈更加方便 - 支持 gitee 和 github 上的 issues 友链获取 @@ -26,6 +26,8 @@ 最近改动: - 修复可能出现的安全问题 -- volantis抓取错位修复 +- volantis抓取规则增加 +- 添加状态监控功能和立即运行功能 +- 对应前端管理面板更新 ``` diff --git a/api/main.py b/api/main.py index 0f2968217248..c22e9de3a557 100644 --- a/api/main.py +++ b/api/main.py @@ -332,10 +332,13 @@ async def crawler_status(payload: str = Depends(login_with_token_)): else: # docker/server resp = {"code": 200, "message": "检查成功"} - res = os.popen("ps -ef | egrep 'hexo_circle_of_friends/run.py' | grep -v grep | wc -l").read().strip() - if res == "1": + # restart_api:两个run;run_crawl_now两个main + check_restart_api = int(os.popen( + "ps -ef | egrep 'hexo_circle_of_friends/run.py' | grep -v grep | wc -l").read().strip()) + check_run_crawl_now = int(os.popen("ps -ef | egrep 'api/main.py' | grep -v grep | wc -l").read().strip()) + if check_restart_api < 1 and check_run_crawl_now == 1: resp["status"] = "未运行" - elif res == "2": + elif check_restart_api == 2 or check_run_crawl_now == 2: resp["status"] = "运行中" else: resp["code"] = 500 diff --git a/hexo_circle_of_friends/scrapy_conf.py b/hexo_circle_of_friends/scrapy_conf.py index 415b5173d94d..ea531621fb01 100644 --- a/hexo_circle_of_friends/scrapy_conf.py +++ b/hexo_circle_of_friends/scrapy_conf.py @@ -1,5 +1,5 @@ ############################## 除非您了解本项目,否则请勿修改本文件 ################################ -VERSION = "5.0.2" +VERSION = "5.0.3" # debug # debug模式 @@ -23,10 +23,6 @@ # "https://www.zyoushuo.cn/friends/", # volantis # ] FRIENDPAGE_LINK = [ - { - "link": "https://akilar.top/link/", # 友链页地址1,修改为你的友链页地址 - "theme": "butterfly" - }, ] BOT_NAME = 'hexo_circle_of_friends' diff --git a/hexo_circle_of_friends/utils/get_url.py b/hexo_circle_of_friends/utils/get_url.py index bb20f2d5ef88..96718ca67817 100644 --- a/hexo_circle_of_friends/utils/get_url.py +++ b/hexo_circle_of_friends/utils/get_url.py @@ -93,12 +93,16 @@ def get_volantis_url(self, response, queue): avatar = response.css('a.site-card img::attr(src)').extract() if not avatar: avatar = response.css('a.friend-card img::attr(src)').extract() + if not avatar: + avatar = response.css('a.card-link .info img::attr(src)').extract() link = response.css('a.simpleuser::attr(href)').extract() if not link: link = response.css('a.site-card::attr(href)').extract() if not link: link = response.css('a.friend-card::attr(href)').extract() + if not link: + link = response.css('a.card-link::attr(href)').extract() name = response.css('a.simpleuser span::text').extract() if not name: @@ -107,6 +111,8 @@ def get_volantis_url(self, response, queue): name = response.css('a.friend-card span::text').extract() if not name: name = response.css('a.friend-card p.friend-name::text').extract() + if not name: + name = response.css('a.card-link .info span.title::text').extract() self.handle(avatar, link, name, queue, "volantis") def get_Yun_url(self, response, queue):