|
@@ -8,6 +8,7 @@ import time
|
|
|
import requests
|
|
import requests
|
|
|
from uuid import uuid4
|
|
from uuid import uuid4
|
|
|
|
|
|
|
|
|
|
+from spider.baidu_imgs import get_img_list
|
|
|
from applications.config import db_config
|
|
from applications.config import db_config
|
|
|
from applications.functions import whisper
|
|
from applications.functions import whisper
|
|
|
from applications.pipeline import question_fission, search_materials, summary_articles, generate_text
|
|
from applications.pipeline import question_fission, search_materials, summary_articles, generate_text
|
|
@@ -99,10 +100,8 @@ class MatchArticlesTask(object):
|
|
|
|
|
|
|
|
async def ai_generate_text(task_tuple, mysql_client):
|
|
async def ai_generate_text(task_tuple, mysql_client):
|
|
|
task_id, video_title, materials = task_tuple
|
|
task_id, video_title, materials = task_tuple
|
|
|
- imgs, ai_title, ai_text = summary_articles(materials)
|
|
|
|
|
- print(imgs)
|
|
|
|
|
- print(ai_text)
|
|
|
|
|
- print(ai_text)
|
|
|
|
|
|
|
+ ai_title, ai_text = summary_articles(materials)
|
|
|
|
|
+ imgs = get_img_list(video_title)
|
|
|
update_sql = f"""
|
|
update_sql = f"""
|
|
|
UPDATE {db_config}
|
|
UPDATE {db_config}
|
|
|
SET ai_text = '{ai_text}', ai_title = '{ai_title}', img_list = '{json.dumps(imgs, ensure_ascii=False)}',status_code = 3
|
|
SET ai_text = '{ai_text}', ai_title = '{ai_title}', img_list = '{json.dumps(imgs, ensure_ascii=False)}',status_code = 3
|
|
@@ -226,9 +225,7 @@ class MatchArticlesV2(object):
|
|
|
FROM {db_config}
|
|
FROM {db_config}
|
|
|
WHERE task_id = '{self.task_id}';
|
|
WHERE task_id = '{self.task_id}';
|
|
|
"""
|
|
"""
|
|
|
- print(select_sql)
|
|
|
|
|
result = await self.mysql_client.select(select_sql)
|
|
result = await self.mysql_client.select(select_sql)
|
|
|
- print(result)
|
|
|
|
|
video_id, cover, images, ai_text, ai_title, status_code = result[0]
|
|
video_id, cover, images, ai_text, ai_title, status_code = result[0]
|
|
|
match status_code:
|
|
match status_code:
|
|
|
case 0:
|
|
case 0:
|