Commit Graph

17 Commits

Author SHA1 Message Date
starmen1265 63dd88279c feat(05-02): implement ArchiveProcessor
- Create ArchiveProcessor with STEP_NAME = archive
- Implement process() method with idempotent execution
- Add _find_existing_archive() for duplicate detection
- Add _ask_overwrite() using rich.prompt with fallback
- Only copy md files (not json) to archive directory
- Export ArchiveProcessor in __init__.py
2026-03-16 23:18:24 +08:00
starmen1265 f358c52578 fix(zhihu): 修复文章归档格式问题
PR Test / lint (pull_request) Successful in 1s
1. author 字段清理零宽度空格和换行符,修复 Obsidian 解析
2. 扩展 content_type 条件,answer/zhuanlan 使用文章模板
3. 读取 content.md 时去除 YAML frontmatter
4. generate_frontmatter 正确推断 platform 为 zhihu

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 18:19:42 +08:00
starmen1265 84e9ada055 restore: 恢复误删的技能目录并修复导入方式
PR Test / lint (pull_request) Successful in 1s
- 恢复 kb-zhihu-metadata, kb-bilibili-metadata, kb-deep-analyzer
- 修改 zhihu.py 和 analyze.py 使用 sys.path 方式导入
- 删除符号链接 kb_zhihu_metadata

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 17:27:48 +08:00
starmen1265 c8cdcb4631 fix(bilibili): correct metadata and filename in archive
PR Test / lint (pull_request) Successful in 1s
- Add _normalize_metadata() to flatten nested metadata structure
- Fix generate_frontmatter() to use correct metadata fields
- Change _sanitize_filename() to return standardized "bilibili_{bvid}" format

Fixes: analysis.md frontmatter showing "未命名"/0/"未知" instead of actual values
Fixes: audio filename using video title instead of platform_bvid format

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 13:48:28 +08:00
starmen1265 dd9d4cdf90 fix(analyze): extract text from Whisper JSON format
- Handle Whisper transcription format (array of segments with text)
- Extract full text from transcription array before passing to DeepAnalyzer
- Fix offsets parsing to support both dict and list formats

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 00:20:25 +08:00
starmen1265 0b215dabe7 feat(download): add video download capability for videos without official subtitles
- Add download_video() to BilibiliAdapter using yt-dlp
- Add bilibili_cookie config to Settings
- Update DownloadProcessor to call video download for bilibili videos
- Add idempotency check to ASRProcessor for existing subtitle files
- Fix indentation error in asr.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 00:09:16 +08:00
starmen1265 60b0eaec93 feat(download): add video download capability for videos without official subtitles
- When content_type is video and no official subtitle available:
  - Download video using yt-dlp
  - Extract audio for Whisper fallback
- Update content_file with actual video path

This enables the pipeline to handle videos that don't have
official Bilibili subtitles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 00:04:56 +08:00
starmen1265 f24841996a fix(analyze): include original text for zhihu answer/zhuanlan types
知乎回答(answer)和专栏(zhuanlan)的原文没有被追加到分析报告中。
代码只在 content_type == "article" 时设置和追加原文。

修复:
- deep_analyzer.py: 扩展条件支持 answer, zhuanlan 类型
- analyze.py: 同步扩展原文追加条件

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 23:41:42 +08:00
starmen1265 8ad64a4d1b fix(asr): use content_dir for subtitle output instead of video_path
PR Test / lint (pull_request) Successful in 2s
- Add content_dir field to ASRInput schema
- Pass content_dir from pipeline when creating ASRInput
- Modify _try_official_subtitle to use content_dir for output
- Modify _run_whisper_basic to use content_dir for output
- Add validation for empty video_path in Whisper fallback

Root cause: DownloadProcessor sets content_file="" for video types,
causing Path("").parent to resolve to current directory instead of
content directory. Subtitle files were written to wrong location.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 22:59:24 +08:00
starmen1265 5d06056b43 fix(download): handle formatted duration strings in metadata
PR Test / lint (pull_request) Successful in 1s
Parse duration strings like "12:34" or "01:23:45" into seconds.
Previously only integer duration values were handled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 18:17:03 +08:00
starmen1265 029718e7e0 feat(04-03): export AnalyzeProcessor from processors module
- Add AnalyzeProcessor to __init__.py exports
- Update module docstring

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:32:53 +08:00
starmen1265 0b7d8707bf feat(04-03): implement AnalyzeProcessor with DeepAnalyzer integration
- AnalyzeProcessor wraps existing DeepAnalyzer for pipeline integration
- Loads metadata and content from JSON files
- Generates analysis reports as Markdown with frontmatter
- Records state on success and failure
- Supports both video and article content types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:32:31 +08:00
starmen1265 ec268f7d17 feat(04-02): add content downloading and module export for DownloadProcessor
TDD GREEN phase:
- DownloadProcessor downloads article/answer/zhuanlan content
- Video content is skipped (handled by ASR in Phase 3)
- Content files saved with correct naming convention
- DownloadProcessor exported from kb_pipeline.processors
- All 17 tests pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:24:00 +08:00
starmen1265 fc6fba76b2 feat(04-02): implement DownloadProcessor with metadata fetching
TDD GREEN phase:
- DownloadProcessor inherits from BaseProcessor
- Fetches metadata from Bilibili and Zhihu adapters
- Saves metadata to content_dir as JSON
- Records state on success/failure
- Skips step if already completed (idempotency)
- All metadata tests pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:22:48 +08:00
starmen1265 06d36fc440 feat(04-01): implement ParseProcessor and update module exports
- ParseProcessor wraps LinkParser for URL parsing
- Returns ParseOutput with platform, content_type, content_id
- Records state when state_manager is provided
- Handles unknown URLs with success=False
- Export BaseProcessor, ParseProcessor, ASRProcessor from __init__.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:14:32 +08:00
starmen1265 3ad2576aed test(04-01): add failing tests for BaseProcessor abstract class
- Test BaseProcessor cannot be instantiated directly
- Test subclass must implement process() method
- Test state_manager attribute is provided
- Test STEP_NAME class attribute requirement

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 23:10:52 +08:00
starmen1265 406c6cbbc6 feat(03-01): implement ASRProcessor with official subtitle download
- Create processors module with ASRProcessor class
- Implement _try_official_subtitle for B站字幕下载
- Support process() method with subtitle-first strategy
- Add helper functions for whisper.cpp integration

- All 5 processor tests passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 19:22:23 +08:00