Ver código fonte

微信发文回收新增 send_time

luojunhui 3 meses atrás
pai
commit
4c92dee2bb

+ 4 - 2
applications/pipeline/data_recycle_pipeline.py

@@ -65,6 +65,7 @@ async def insert_article_into_recycle_pool(
                     content_url.split("&sn=")[1].split("&")[0] if content_url else None
                 )
                 status = account_info["using_status"]
+                send_timestamp = article.get("send_time", 0)
                 info_tuple = (
                     account_info["gh_id"],
                     account_info["name"],
@@ -92,13 +93,14 @@ async def insert_article_into_recycle_pool(
                     json.dumps(base_info, ensure_ascii=False),
                     str_to_md5(title),
                     status,
+                    send_timestamp,
                 )
                 try:
                     insert_query = f"""
                             insert into {table_name}
-                            (ghId, accountName, appMsgId, title, Type, createTime, updateTime, Digest, ItemIndex, ContentUrl, SourceUrl, CoverImgUrl, CoverImgUrl_1_1, CoverImgUrl_255_1, ItemShowType, IsOriginal, ShowDesc, ori_content, show_view_count, show_like_count, show_zs_count, show_pay_count, wx_sn, baseInfo, title_md5, status)
+                            (ghId, accountName, appMsgId, title, Type, createTime, updateTime, Digest, ItemIndex, ContentUrl, SourceUrl, CoverImgUrl, CoverImgUrl_1_1, CoverImgUrl_255_1, ItemShowType, IsOriginal, ShowDesc, ori_content, show_view_count, show_like_count, show_zs_count, show_pay_count, wx_sn, baseInfo, title_md5, status, publish_timestamp)
                             values
-                            (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);
+                            (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);
                             """
                     await pool.async_save(
                         query=insert_query,

+ 3 - 0
applications/tasks/data_recycle_tasks/recycle_daily_publish_articles.py

@@ -140,6 +140,7 @@ class RecycleDailyPublishArticlesTask(Const):
                         },
                     )
                     return
+
                 case self.ARTICLE_SUCCESS_CODE:
                     msg_list = response.get("data", {}).get("data", [])
                     if not msg_list:
@@ -160,6 +161,7 @@ class RecycleDailyPublishArticlesTask(Const):
                     cursor = response["data"].get("next_cursor")
                     if not cursor:
                         return
+
                 case self.CRAWL_CRASH_CODE:
                     await self.log_client.log(
                         contents={
@@ -171,6 +173,7 @@ class RecycleDailyPublishArticlesTask(Const):
                             "status": "fail",
                         }
                     )
+
                 case _:
                     return