PlatformCrawler: 修复save_data_option值,以MediaCrawler枚举为准用postgres替换postgresql
Showing
1 changed file
with
3 additions
and
3 deletions
| @@ -173,7 +173,7 @@ postgres_db_config = {{ | @@ -173,7 +173,7 @@ postgres_db_config = {{ | ||
| 173 | # 判断数据库类型,确定 SAVE_DATA_OPTION | 173 | # 判断数据库类型,确定 SAVE_DATA_OPTION |
| 174 | db_dialect = (config.settings.DB_DIALECT or "mysql").lower() | 174 | db_dialect = (config.settings.DB_DIALECT or "mysql").lower() |
| 175 | is_postgresql = db_dialect in ("postgresql", "postgres") | 175 | is_postgresql = db_dialect in ("postgresql", "postgres") |
| 176 | - save_data_option = "postgresql" if is_postgresql else "db" | 176 | + save_data_option = "postgres" if is_postgresql else "db" |
| 177 | 177 | ||
| 178 | base_config_path = self.mediacrawler_path / "config" / "base_config.py" | 178 | base_config_path = self.mediacrawler_path / "config" / "base_config.py" |
| 179 | 179 | ||
| @@ -206,7 +206,7 @@ postgres_db_config = {{ | @@ -206,7 +206,7 @@ postgres_db_config = {{ | ||
| 206 | elif line.startswith('CRAWLER_TYPE = '): | 206 | elif line.startswith('CRAWLER_TYPE = '): |
| 207 | replaced = f'CRAWLER_TYPE = "{crawler_type}" # 爬取类型,search(关键词搜索) | detail(帖子详情)| creator(创作者主页数据)' | 207 | replaced = f'CRAWLER_TYPE = "{crawler_type}" # 爬取类型,search(关键词搜索) | detail(帖子详情)| creator(创作者主页数据)' |
| 208 | elif line.startswith('SAVE_DATA_OPTION = '): | 208 | elif line.startswith('SAVE_DATA_OPTION = '): |
| 209 | - replaced = f'SAVE_DATA_OPTION = "{save_data_option}" # csv or db or json or sqlite or postgresql' | 209 | + replaced = f'SAVE_DATA_OPTION = "{save_data_option}" # csv or db or json or sqlite or postgres' |
| 210 | elif line.startswith('CRAWLER_MAX_NOTES_COUNT = '): | 210 | elif line.startswith('CRAWLER_MAX_NOTES_COUNT = '): |
| 211 | replaced = f'CRAWLER_MAX_NOTES_COUNT = {max_notes}' | 211 | replaced = f'CRAWLER_MAX_NOTES_COUNT = {max_notes}' |
| 212 | elif line.startswith('ENABLE_GET_COMMENTS = '): | 212 | elif line.startswith('ENABLE_GET_COMMENTS = '): |
| @@ -273,7 +273,7 @@ postgres_db_config = {{ | @@ -273,7 +273,7 @@ postgres_db_config = {{ | ||
| 273 | # 判断数据库类型,确定 save_data_option | 273 | # 判断数据库类型,确定 save_data_option |
| 274 | db_dialect = (config.settings.DB_DIALECT or "mysql").lower() | 274 | db_dialect = (config.settings.DB_DIALECT or "mysql").lower() |
| 275 | is_postgresql = db_dialect in ("postgresql", "postgres") | 275 | is_postgresql = db_dialect in ("postgresql", "postgres") |
| 276 | - save_data_option = "postgresql" if is_postgresql else "db" | 276 | + save_data_option = "postgres" if is_postgresql else "db" |
| 277 | 277 | ||
| 278 | # 构建命令 | 278 | # 构建命令 |
| 279 | cmd = [ | 279 | cmd = [ |
-
Please register or login to post a comment