feat(08-02): implement crawl_comments method with hot sorting
- Add COMMENT_API_TEMPLATE for comment API URL - Implement crawl_comments() returning CommentsResult - Use order=hot for popular comments sorting - Only fetch first-level comments (no nested replies) - Add include_comments parameter to crawl_answer() - Export CommentAuthor, CommentData, CommentsResult in __init__.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,8 +8,17 @@ from .models import (
|
||||
ContentMetadata,
|
||||
AnswerData,
|
||||
ArticleData,
|
||||
CommentAuthor,
|
||||
CommentData,
|
||||
CommentsResult,
|
||||
CrawlResult,
|
||||
)
|
||||
from .config import (
|
||||
ProxyConfig,
|
||||
CrawlerConfig,
|
||||
get_crawler_config,
|
||||
reset_crawler_config,
|
||||
)
|
||||
from .zhihu_crawler import ZhihuCrawler, ZhihuApiInterceptor
|
||||
|
||||
__all__ = [
|
||||
@@ -17,7 +26,14 @@ __all__ = [
|
||||
"ContentMetadata",
|
||||
"AnswerData",
|
||||
"ArticleData",
|
||||
"CommentAuthor",
|
||||
"CommentData",
|
||||
"CommentsResult",
|
||||
"CrawlResult",
|
||||
"ProxyConfig",
|
||||
"CrawlerConfig",
|
||||
"get_crawler_config",
|
||||
"reset_crawler_config",
|
||||
"ZhihuCrawler",
|
||||
"ZhihuApiInterceptor",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user