feat: integrate bilibili-extractor into obsidian-kb
- Add extractors layer with BilibiliExtractor (Playwright stealth mode) - Add outputs layer with ObsidianWriter and GitSync - Implement subtitle/no-subtitle graceful degradation - Update config with output and bilibili extraction settings - Complete integration pipeline: extract → process → output → sync - Add comprehensive tests (100% pass rate) - Update documentation (SKILL.md, README.md, requirements.txt)
This commit is contained in:
@@ -51,10 +51,20 @@ class Config:
|
||||
'max_chunk_duration_seconds': 1800, # 30 minutes
|
||||
'long_video_threshold': 1800, # 30 minutes
|
||||
},
|
||||
'output': {
|
||||
'organize_by': 'author', # author | date | topic
|
||||
'filename_format': '{date}_{title}.md',
|
||||
'auto_tags': True,
|
||||
'default_tags': ['video', 'bilibili'],
|
||||
},
|
||||
'sources': {
|
||||
'bilibili': {
|
||||
'enabled': True,
|
||||
'cookie': None,
|
||||
'extraction': {
|
||||
'headless': True,
|
||||
'timeout': 30,
|
||||
},
|
||||
},
|
||||
'youtube': {
|
||||
'enabled': False,
|
||||
@@ -254,6 +264,38 @@ class Config:
|
||||
"""Get Kimi API key (alias for ai.api_key)."""
|
||||
return self.get('ai.api_key') or ''
|
||||
|
||||
# Output configuration
|
||||
@property
|
||||
def organize_by(self) -> str:
|
||||
"""Get output organize_by strategy."""
|
||||
return self.get('output.organize_by', 'author')
|
||||
|
||||
@property
|
||||
def filename_format(self) -> str:
|
||||
"""Get output filename format."""
|
||||
return self.get('output.filename_format', '{date}_{title}.md')
|
||||
|
||||
@property
|
||||
def auto_tags(self) -> bool:
|
||||
"""Get auto_tags setting."""
|
||||
return self.get('output.auto_tags', True)
|
||||
|
||||
@property
|
||||
def default_tags(self) -> list:
|
||||
"""Get default tags list."""
|
||||
return self.get('output.default_tags', ['video', 'bilibili'])
|
||||
|
||||
# Bilibili extraction configuration
|
||||
@property
|
||||
def bilibili_headless(self) -> bool:
|
||||
"""Get bilibili extraction headless mode."""
|
||||
return self.get('sources.bilibili.extraction.headless', True)
|
||||
|
||||
@property
|
||||
def bilibili_timeout(self) -> int:
|
||||
"""Get bilibili extraction timeout in seconds."""
|
||||
return self.get('sources.bilibili.extraction.timeout', 30)
|
||||
|
||||
def ensure_dirs(self) -> None:
|
||||
"""Ensure required directories exist."""
|
||||
self.vault_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
Reference in New Issue
Block a user