Skip to content

Commit

Permalink
release 5.0.3
Browse files Browse the repository at this point in the history
- 修复可能出现的安全问题
- volantis抓取规则增加
- 添加状态监控功能和立即运行功能
- 对应前端管理面板更新
  • Loading branch information
hiltay committed Oct 11, 2022
1 parent 868acff commit 04dd229
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
6 changes: 4 additions & 2 deletions README.md
Expand Up @@ -5,7 +5,7 @@
部署教程:[文档](https://fcircle-doc.yyyzyyyz.cn/) | [备用地址](https://fcircle-doc.is-a.dev/)

```
5.0.2 支持:
5.0.3 支持:
- 更好的前端样式
- 新增前端管理面板,告别繁琐的配置,管理朋友圈更加方便
- 支持 gitee 和 github 上的 issues 友链获取
Expand All @@ -26,6 +26,8 @@
最近改动:
- 修复可能出现的安全问题
- volantis抓取错位修复
- volantis抓取规则增加
- 添加状态监控功能和立即运行功能
- 对应前端管理面板更新
```

9 changes: 6 additions & 3 deletions api/main.py
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions hexo_circle_of_friends/scrapy_conf.py
@@ -1,5 +1,5 @@
############################## 除非您了解本项目,否则请勿修改本文件 ################################
VERSION = "5.0.2"
VERSION = "5.0.3"

# debug
# debug模式
Expand All @@ -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'
Expand Down
6 changes: 6 additions & 0 deletions hexo_circle_of_friends/utils/get_url.py
Expand Up @@ -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:
Expand All @@ -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):
Expand Down

0 comments on commit 04dd229

Please sign in to comment.