Browse Source

修改seo并发数为1,修复豆包解析报错

master
zhurunlin 4 months ago
parent
commit
e805cf0c84
  1. 2
      config.py
  2. 2
      spiders/ai_seo/doubao.py

2
config.py

@ -34,7 +34,7 @@ AI_SEO_JOB_INTERVAL = 5
# aiseo任务获取平台 # aiseo任务获取平台
AI_SEO_JOB_PLATFORM_IDS = [ '2', '3', '4', '5', '7', '13'] AI_SEO_JOB_PLATFORM_IDS = [ '2', '3', '4', '5', '7', '13']
# aiseo任务最大并发量 # aiseo任务最大并发量
AI_SEO_JOB_MAX_INSTANCES = 2
AI_SEO_JOB_MAX_INSTANCES = 1
DEEPSEEK_SEO_JOB_RANGE = { DEEPSEEK_SEO_JOB_RANGE = {

2
spiders/ai_seo/doubao.py

@ -138,6 +138,7 @@ class DouBaoSpider(AbstractAiSeoSpider):
if '/samantha/chat/completion' in response.url: if '/samantha/chat/completion' in response.url:
answer = '' answer = ''
datas = [] datas = []
index_data = list()
response_text = ftfy.fix_text(await response.text()) response_text = ftfy.fix_text(await response.text())
lines = response_text.split("\n\n") lines = response_text.split("\n\n")
for line in lines: for line in lines:
@ -154,6 +155,7 @@ class DouBaoSpider(AbstractAiSeoSpider):
except JSONDecodeError: except JSONDecodeError:
continue continue
logger.debug(f"ai回复: {answer}") logger.debug(f"ai回复: {answer}")
self.index_data = list(set(index_data))
self.ai_answer.answer = answer self.ai_answer.answer = answer
self.completed_event.set() self.completed_event.set()

Loading…
Cancel
Save