feat(database): add PostgreSQL support and fix Windows subprocess encoding

This commit is contained in:
Doiiars
2026-01-09 00:41:59 +08:00
parent 57b688fea4
commit 70a6ca55bb
23 changed files with 221 additions and 27 deletions

View File

@@ -34,6 +34,7 @@ class KuaishouStoreFactory:
STORES = {
"csv": KuaishouCsvStoreImplement,
"db": KuaishouDbStoreImplement,
"postgres": KuaishouDbStoreImplement,
"json": KuaishouJsonStoreImplement,
"sqlite": KuaishouSqliteStoreImplement,
"mongodb": KuaishouMongoStoreImplement,

View File

@@ -109,7 +109,8 @@ class KuaishouDbStoreImplement(AbstractStore):
session.add(new_content)
else:
for key, value in content_item.items():
setattr(video_detail, key, value)
if hasattr(video_detail, key):
setattr(video_detail, key, value)
await session.commit()
async def store_comment(self, comment_item: Dict):
@@ -130,7 +131,8 @@ class KuaishouDbStoreImplement(AbstractStore):
session.add(new_comment)
else:
for key, value in comment_item.items():
setattr(comment_detail, key, value)
if hasattr(comment_detail, key):
setattr(comment_detail, key, value)
await session.commit()