From 1b50481d27cb2a764c1ff108b8210f4b25e60c75 Mon Sep 17 00:00:00 2001 From: hiltay <904108079@qq.com> Date: Sat, 11 Feb 2023 00:50:13 +0800 Subject: [PATCH] release 5.0.8 --- README.md | 7 +++---- api_dependencies/items.py | 1 + hexo_circle_of_friends/fc_settings.yaml | 17 +++++++++-------- hexo_circle_of_friends/scrapy_conf.py | 2 +- .../spiders/hexo_circle_of_friends.py | 3 ++- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4b1bc8e6de61..68c57faa88f7 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ 部署教程:[文档](https://fcircle-doc.yyyzyyyz.cn/) | [备用地址](https://fcircle-doc.is-a.dev/) ``` -5.0.7 支持: +5.0.8 支持: - 更好的前端样式 - 极简模式 - 新增前端管理面板,告别繁琐的配置,管理朋友圈更加方便 @@ -26,9 +26,8 @@ - 提供一个简单的快速部署脚本 最近改动: -- 新增管理面板可下载运行日志 -- 前端默认加载文章数量可配置 -- docker镜像对多种架构的支持 +- 新增主页爬取文章数量可配置 +- 在开启配置项友链情况下,LINK可以置空 ``` [![Stargazers over time](https://starchart.cc/Rock-Candy-Tea/hexo-circle-of-friends.svg)](https://starchart.cc/Rock-Candy-Tea/hexo-circle-of-friends) diff --git a/api_dependencies/items.py b/api_dependencies/items.py index dbd43dd4b006..d996d0473139 100644 --- a/api_dependencies/items.py +++ b/api_dependencies/items.py @@ -33,6 +33,7 @@ class FcSettings(BaseModel): GITEE_FRIENDS_LINKS: GitFriendsLinks = get_user_settings()["GITEE_FRIENDS_LINKS"] GITHUB_FRIENDS_LINKS: GitFriendsLinks = get_user_settings()["GITHUB_FRIENDS_LINKS"] BLOCK_SITE: List[str] = get_user_settings()["BLOCK_SITE"] + MAX_POSTS_NUM: int = get_user_settings()["MAX_POSTS_NUM"] HTTP_PROXY: bool = get_user_settings()["HTTP_PROXY"] OUTDATE_CLEAN: int = get_user_settings()["OUTDATE_CLEAN"] DATABASE: str = get_user_settings()["DATABASE"] diff --git a/hexo_circle_of_friends/fc_settings.yaml b/hexo_circle_of_friends/fc_settings.yaml index 8246b935f0ad..0a9d467e7a75 100644 --- a/hexo_circle_of_friends/fc_settings.yaml +++ b/hexo_circle_of_friends/fc_settings.yaml @@ -13,16 +13,17 @@ # - volantis:volantis主题 # - Yun:Yun主题 # - stellar:stellar主题 -# 支持配置多个友链页面并指定不同主题策略,每个用{}分隔,它们会被同时爬取,数据保存在一起。***至少配置一个*** -LINK: - - {link: "https://www.yyyzyyyz.cn/link/", theme: "butterfly"} # 友链页地址1,修改为你的友链页地址 -# - {link: "https://noionion.top/link/", theme: "butterfly"} # 友链页地址2 -# - {link: "https://immmmm.com/about/", theme: "common1"} # 友链页地址3 - +# 支持配置多个友链页面并指定不同主题策略,每个用{}分隔,它们会被同时爬取,数据保存在一起。 +LINK: [ + { link: "https://www.yyyzyyyz.cn/link/", theme: "butterfly" }, # 友链页地址1,修改为你的友链页地址 +# { link: "https://noionion.top/link/", theme: "butterfly" }, # 友链页地址2 +# { link: "https://immmmm.com/about/", theme: "common1" }, # 友链页地址3 +# ... +] # 配置项友链 # enable:# 是否启用配置项友链 true/false(针对还未适配主题或者有定制需求的用户) -# json_api:通过json格式配置友链,详见:https://fcircle-doc.js.cool/#/developmentdoc?id=配置项json友链 +# json_api:通过json格式配置友链,详见:https://fcircle-doc.yyyzyyyz.cn/#/developmentdoc?id=配置项json友链 # list字段填写格式:["name", "link", "avatar","suffix"],其中: # name:必填,友链的名字 # link:必填,友链主页地址 @@ -72,7 +73,7 @@ BLOCK_SITE: [ # ^http://, # http开头的全部屏蔽 ] -# 每个link主页最多获取几篇文章,此值越大,则抓取的文章上限越多,相应地运行速度也会降低,反之亦然 +# 每个友链最多获取几篇文章,此值越大,则抓取的文章上限越多,相应地运行速度也会降低,反之亦然 # 请设置一个正整数 MAX_POSTS_NUM: 5 diff --git a/hexo_circle_of_friends/scrapy_conf.py b/hexo_circle_of_friends/scrapy_conf.py index 266ae4e78764..c2fd03402a6d 100644 --- a/hexo_circle_of_friends/scrapy_conf.py +++ b/hexo_circle_of_friends/scrapy_conf.py @@ -1,5 +1,5 @@ ############################## 除非您了解本项目,否则请勿修改本文件 ################################ -VERSION = "5.0.7" +VERSION = "5.0.8" # debug # debug模式 diff --git a/hexo_circle_of_friends/spiders/hexo_circle_of_friends.py b/hexo_circle_of_friends/spiders/hexo_circle_of_friends.py index b70d36a8154e..c85d82cb5e02 100644 --- a/hexo_circle_of_friends/spiders/hexo_circle_of_friends.py +++ b/hexo_circle_of_friends/spiders/hexo_circle_of_friends.py @@ -81,7 +81,8 @@ def start_requests(self): logger.info(f"起始url: {url}") yield Request(url, callback=self.friend_poor_parse, meta={"theme": friendpage_theme[i]}) elif not self.friend_poor.empty(): - yield Request(li[1], callback=self.friend_poor_parse) + # 开启配置项友链且未配置link url + yield Request(self.settings.get("SETTINGS_FRIENDS_LINKS").get("list")[0][1], callback=self.friend_poor_parse) def init_start_urls(self):