Skip to content

Commit

Permalink
Merge pull request NanmiCoder#64 from NanmiCoder/feat/article_url
Browse files Browse the repository at this point in the history
feat: add article url for issue NanmiCoder#63
  • Loading branch information
NanmiCoder authored Nov 5, 2023
2 parents 7698c41 + d0ded66 commit 68c7139
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions models/douyin.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class DouyinAweme(DouyinBaseModel):
comment_count = fields.CharField(null=True, max_length=16, description="视频评论数")
share_count = fields.CharField(null=True, max_length=16, description="视频分享数")
collected_count = fields.CharField(null=True, max_length=16, description="视频收藏数")
aweme_url = fields.CharField(null=True, max_length=255, description="视频详情页URL")

class Meta:
table = "douyin_aweme"
Expand Down Expand Up @@ -85,6 +86,7 @@ async def update_douyin_aweme(aweme_item: Dict):
"share_count": interact_info.get("share_count"),
"ip_location": aweme_item.get("ip_label", ""),
"last_modify_ts": utils.get_current_timestamp(),
"aweme_url": f"https://www.douyin.com/video/{aweme_id}"
}
print(f"douyin aweme id:{aweme_id}, title:{local_db_item.get('title')}")
if config.IS_SAVED_DATABASED:
Expand Down
2 changes: 2 additions & 0 deletions models/xiaohongshu.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class XHSNote(XhsBaseModel):
comment_count = fields.CharField(null=True, max_length=16, description="笔记评论数")
share_count = fields.CharField(null=True, max_length=16, description="笔记分享数")
image_list = fields.TextField(null=True, description="笔记封面图片列表")
note_url = fields.CharField(null=True, max_length=255, description="笔记详情页的URL")

class Meta:
table = "xhs_note"
Expand Down Expand Up @@ -83,6 +84,7 @@ async def update_xhs_note(note_item: Dict):
"ip_location": note_item.get("ip_location", ""),
"image_list": ','.join([img.get('url', '') for img in image_list]),
"last_modify_ts": utils.get_current_timestamp(),
"note_url": f"https://www.xiaohongshu.com/explore/{note_id}"
}
print("xhs note:", local_db_item)
if config.IS_SAVED_DATABASED:
Expand Down

0 comments on commit 68c7139

Please sign in to comment.