feat(02-03): implement ZhihuAdapter for answer and zhuanlan content
- Implement ZhihuAdapter class inheriting PlatformAdapter - Support answer URL content extraction - Support zhuanlan (article) URL content extraction - Add cookie-based authentication from KBSettings - Detect login page redirects (expired cookies) - Return AuthError for missing/expired cookies - Format content with YAML frontmatter - Update package exports to include ZhihuAdapter Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,7 @@ from .config import KBSettings, get_settings
|
|||||||
from .retry import retry_on_network_error
|
from .retry import retry_on_network_error
|
||||||
from .link_parser import LinkParser, ParsedLink
|
from .link_parser import LinkParser, ParsedLink
|
||||||
from .idempotency import IdempotencyChecker
|
from .idempotency import IdempotencyChecker
|
||||||
|
from .platforms import PlatformAdapter, BilibiliAdapter, ZhihuAdapter
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
# Schemas
|
# Schemas
|
||||||
@@ -54,6 +55,10 @@ __all__ = [
|
|||||||
"ParsedLink",
|
"ParsedLink",
|
||||||
# Idempotency
|
# Idempotency
|
||||||
"IdempotencyChecker",
|
"IdempotencyChecker",
|
||||||
|
# Platform Adapters
|
||||||
|
"PlatformAdapter",
|
||||||
|
"BilibiliAdapter",
|
||||||
|
"ZhihuAdapter",
|
||||||
]
|
]
|
||||||
|
|
||||||
__version__ = "0.1.0"
|
__version__ = "0.1.0"
|
||||||
|
|||||||
@@ -12,8 +12,10 @@ Each adapter implements the PlatformAdapter interface:
|
|||||||
|
|
||||||
from .base import PlatformAdapter
|
from .base import PlatformAdapter
|
||||||
from .bilibili import BilibiliAdapter
|
from .bilibili import BilibiliAdapter
|
||||||
|
from .zhihu import ZhihuAdapter
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"PlatformAdapter",
|
"PlatformAdapter",
|
||||||
"BilibiliAdapter",
|
"BilibiliAdapter",
|
||||||
|
"ZhihuAdapter",
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user