mirror of
https://github.com/rachelos/we-mp-rss.git
synced 2026-08-30 18:01:55 +08:00
1.5.2-Fix
This commit is contained in:
+2
-2
@@ -147,13 +147,13 @@ class Db:
|
||||
art.id=f"{str(art.mp_id)}-{art.id}".replace("MP_WXS_","") # type: ignore
|
||||
if check_exist:
|
||||
# 检查文章是否已存在
|
||||
existing_article = session.query(Article.id,Article.publish_time,Article.status,Article.description,Article.title).filter(
|
||||
existing_article = session.query(Article.id,Article.publish_time,Article.status,Article.show_type,Article.description,Article.title).filter(
|
||||
(Article.url == art.url) | (Article.id == art.id)
|
||||
).first()
|
||||
if existing_article is not None:
|
||||
# 当更新时间和状态都相同时,不需要更新
|
||||
if art.status == existing_article.status and existing_article.publish_time==art.publish_time \
|
||||
and existing_article.show_type==art.show_type \
|
||||
and existing_article.show_type==art.show_type\
|
||||
and existing_article.status!=DATA_STATUS.DELETED \
|
||||
and art.title==existing_article.title: # type: ignore
|
||||
return False
|
||||
|
||||
@@ -21,7 +21,8 @@ class ArticleBase(Base):
|
||||
publish_src = Column(Integer,index=True) # 发布来源
|
||||
publish_status = Column(Text,index=True) # 发布状态
|
||||
art_type = Column(Integer,index=True) # 内容类型(1=图文/视频/音频, 9=贴图等)
|
||||
show_type = Column(Text) # 展示类型(0=图文, 5=视频, 7=音频, 10=贴图)
|
||||
show_type = Column(Integer,index=True) # 展示类型(0=图文, 5=视频, 7=音频, 10=贴图)
|
||||
publish_info=Column(Text) # 发布信息(JSON格式,包含文章的详细发布数据,如阅读数、点赞数等)
|
||||
# 状态与类型标识
|
||||
original_check_type = Column(Integer,index=True) # 原创检测类型
|
||||
in_profile = Column(Integer,index=True) # 是否在主页展示
|
||||
@@ -65,9 +66,11 @@ class Article(ArticleBase):
|
||||
'in_profile': self.in_profile,
|
||||
'pre_publish_status': self.pre_publish_status,
|
||||
'service_type': self.service_type,
|
||||
'show_type': self.show_type,
|
||||
'item_show_type': self.item_show_type,
|
||||
'copyright_stat': self.copyright_stat,
|
||||
'has_red_packet_cover': self.has_red_packet_cover,
|
||||
'publish_info': self.publish_info,
|
||||
# 内容
|
||||
'content': self.content,
|
||||
'content_html': self.content_html,
|
||||
|
||||
+5
-2
@@ -224,6 +224,7 @@ class WxGather:
|
||||
"copyright_stat":data.get("copyright_stat",0), # 版权/原创状态(0非原创,1原创)
|
||||
"has_red_packet_cover":data.get("has_red_packet_cover",0), # 封面是否有红包挂件
|
||||
"status": DATA_STATUS.DELETED if data.get("is_deleted",False) else DATA_STATUS.ACTIVE, # 数据状态(已删除/正常)
|
||||
"publish_info":data.get("publish_info",{}), # 发布信息(可能包含群发消息等复杂结构)
|
||||
}
|
||||
if 'digest' in data:
|
||||
art['description']=data['digest']
|
||||
@@ -258,7 +259,7 @@ class WxGather:
|
||||
url,
|
||||
params=params,
|
||||
headers=headers,
|
||||
proxies=proxies,
|
||||
proxies=proxies, #type: ingnore
|
||||
) #type: ignore
|
||||
response.raise_for_status() # 检查状态码是否为200
|
||||
data = response.text # 解析JSON数据
|
||||
@@ -287,7 +288,9 @@ class WxGather:
|
||||
return
|
||||
import time
|
||||
self.start_time = time.time() # 记录开始执行时间
|
||||
self.update_mps(mp_id,Feed(
|
||||
self.update_mps(
|
||||
mp_id, #type: ingnore
|
||||
Feed(
|
||||
sync_time=int(time.time()),
|
||||
update_time=int(time.time()),
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user