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

Method store_content

store/excel_store_base.py:237–257  ·  view source on GitHub ↗

Store content data to Excel Args: content_item: Content data dictionary

(self, content_item: Dict)

Source from the content-addressed store, hash-verified

235 )
236
237 async def store_content(self, content_item: Dict):
238 """
239 Store content data to Excel
240
241 Args:
242 content_item: Content data dictionary
243 """
244 # Define headers (customize based on platform)
245 headers = list(content_item.keys())
246
247 # Write headers if first time
248 if not self.contents_headers_written:
249 self._write_headers(self.contents_sheet, headers)
250 self.contents_headers_written = True
251
252 # Write data row
253 self._write_row(self.contents_sheet, content_item, headers)
254
255 # Get ID from various possible field names
256 content_id = content_item.get('note_id') or content_item.get('aweme_id') or content_item.get('video_id') or content_item.get('content_id') or 'N/A'
257 utils.logger.info(f"[ExcelStoreBase] Stored content to Excel: {content_id}")
258
259 async def store_comment(self, comment_item: Dict):
260 """

Callers

nothing calls this directly

Calls 4

_write_headersMethod · 0.95
_write_rowMethod · 0.95
keysMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected