MCPcopy Create free account
hub / github.com/NanmiCoder/MediaCrawler / add_comment

Method add_comment

store/xhs/_store_impl.py:194–211  ·  view source on GitHub ↗
(self, session: AsyncSession, comment_item: Dict)

Source from the content-addressed store, hash-verified

192 await self.add_comment(session, comment_item)
193
194 async def add_comment(self, session: AsyncSession, comment_item: Dict):
195 add_ts = int(get_current_timestamp())
196 last_modify_ts = int(get_current_timestamp())
197 comment = XhsNoteComment(
198 creator_hash=comment_item.get("creator_hash"),
199 nickname=comment_item.get("nickname"),
200 add_ts=add_ts,
201 last_modify_ts=last_modify_ts,
202 comment_id=comment_item.get("comment_id"),
203 create_time=comment_item.get("create_time"),
204 note_id=comment_item.get("note_id"),
205 content=comment_item.get("content"),
206 sub_comment_count=int(comment_item.get("sub_comment_count", 0) or 0),
207 pictures=json.dumps(comment_item.get("pictures")),
208 parent_comment_id=str(comment_item.get("parent_comment_id", "")),
209 like_count=str(comment_item.get("like_count"))
210 )
211 session.add(comment)
212
213 async def update_comment(self, session: AsyncSession, comment_item: Dict):
214 comment_id = comment_item.get("comment_id")

Callers 1

store_commentMethod · 0.95

Calls 3

get_current_timestampFunction · 0.90
XhsNoteCommentClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected