How submato/xhscrawl works
Main Components
• Client/Demo Environment: Include two demo examples – one in Python (demo/xhs.py) and one in JavaScript (demo/xhs.js) – which showcase how a user might interact with the APIs.
• API Service Layer: Represent the “service” directory as the core of your application. Inside this, the “service_index” folder contains individual markdown files representing separate API endpoints (e.g., comment, note_detail, search, user_info, etc.). Each API is essentially a separate component or module responsible for a specific functionality.
• Encryption/Algorithm Engine: Although not explicitly visible as code in the file tree, the README mentions that “js计算” (JavaScript computation) is used, and the dependency on PyExecJS indicates that there is a module that executes JavaScript (likely for processing the “x-s” encryption logic). Place this component as a shared utility or engine that the service components invoke.
• External Dependencies: Highlight the role of external services – note the provided online API server (e.g., “apiserver.top”) and the offline API documentation. Also mention that various runtime environments (Python, Node.js, and Java) need to be supported.
• Source Package: Include the “source” directory as likely housing additional supporting libraries or common logic shared across the application.
Architectural and Design Patterns
• Service-Oriented Design: Emphasize that each API endpoint is self-contained and operates somewhat like a microservice (even if not deployed separately).
• Separation of Concerns: Note the clear distinction between the demonstration layer (demo folder), the service layer (service folder), and the supporting libraries/utilities (source folder and the external JavaScript execution environment).