mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2025-11-25 03:15:17 +08:00
fix: 使用 get_current_time() 替代 get_current_date() 以避免文件名因同日期而冲突
This commit is contained in:
@@ -16,7 +16,7 @@ class AsyncFileWriter:
|
||||
def _get_file_path(self, file_type: str, item_type: str) -> str:
|
||||
base_path = f"data/{self.platform}/{file_type}"
|
||||
pathlib.Path(base_path).mkdir(parents=True, exist_ok=True)
|
||||
file_name = f"{self.crawler_type}_{item_type}_{utils.get_current_date()}.{file_type}"
|
||||
file_name = f"{self.crawler_type}_{item_type}_{utils.get_current_time()}.{file_type}"
|
||||
return os.path.join(base_path, file_name)
|
||||
|
||||
async def write_to_csv(self, item: Dict, item_type: str):
|
||||
|
||||
Reference in New Issue
Block a user