feat: implement automated YouTube metadata enrichment with Gemini-driven summaries (fixed JSON handling)

This commit is contained in:
Nubenetes Bot
2026-05-22 16:52:55 +02:00
parent 0527fbe735
commit 764759bf3e
3 changed files with 348 additions and 226 deletions

View File

@@ -55,11 +55,7 @@ async def enrich_video_entry(url: str, entry: dict):
"""
try:
response = await call_gemini_with_retry(prompt, prefer_flash=True)
import json
# Extract JSON from potential markdown blocks
json_str = re.search(r'\{.*\}', response, re.DOTALL).group(0)
data = json.loads(json_str)
data = await call_gemini_with_retry(prompt, prefer_flash=True)
entry["title"] = meta['raw_title']
entry["ai_summary"] = data["summary"]