sprint: fixes batch — saveNote history, DeepSeek retry, channel rotation, test fixes, docker env, blocking transcript, sync errors
This commit is contained in:
@@ -62,9 +62,9 @@ def download_transcript(video_id: str) -> str:
|
||||
log.warning(f"Failed to fetch transcript for {video_id}: {e}")
|
||||
return None
|
||||
|
||||
async def summarize_video(video_id: str) -> str:
|
||||
# 1. Try transcript, fall back to description
|
||||
transcript = download_transcript(video_id)
|
||||
async def summarize_video(video_id: str) -> str | None:
|
||||
# 1. Try transcript, fall back to description (offload sync call to thread)
|
||||
transcript = await asyncio.to_thread(download_transcript, video_id)
|
||||
|
||||
if not transcript:
|
||||
# Fallback: use video description from YouTube API
|
||||
@@ -120,7 +120,7 @@ async def summarize_video(video_id: str) -> str:
|
||||
summary = data["choices"][0]["message"]["content"]
|
||||
except Exception as e:
|
||||
log.error(f"DeepSeek API request failed for {video_id}: {e}")
|
||||
summary = f"Error generating summary: {e}"
|
||||
return None # Leave summary NULL for retry on next sync
|
||||
|
||||
# 3. Save transcript & summary to db
|
||||
async with aiosqlite.connect(DB_PATH) as db:
|
||||
|
||||
Reference in New Issue
Block a user