Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
dlsite-rs-next
A high-performance Rust client library for the DLsite platform, providing access to product information, search, circle data, and more.
Stability: This library is in early development (0.x). The public API may change between releases. Features marked as "stub" or "requires feature flag" are not yet production-ready.
Installation
Add this to your Cargo.toml:
[]
= "0.2"
Feature Flags
| Feature | Description |
|---|---|
| (default) | unknown-field-log + reqwest-rustls-tls |
search-html |
HTML scraping-based search and circle functionality (adds scraper, rayon) |
cookie-store |
Session/auth support (adds reqwest/cookies) |
reqwest-native-tls |
Use native TLS instead of rustls |
Important: The search-html feature flag controls API visibility:
- Without
search-html:DlsiteClient::search()andDlsiteClient::circle()methods are not available - Types like
SearchProductQuery,SearchResult,CircleClient, etc. are not accessible - This ensures the public API surface matches the actual feature requirements
To use search or circle functionality:
[]
= { = "0.2", = ["search-html"] }
TLS Backend: By default, this crate uses rustls (pure Rust TLS). To use native TLS:
[]
= { = "0.2", = false, = ["reqwest-native-tls", "unknown-field-log"] }
Performance
The library includes several performance optimizations that provide significant speedups:
| Optimization | Speedup | Use Case |
|---|---|---|
| Parallel Parsing | 3-4x | Large result sets (50+ items) |
| Result Caching | 10-100x | Repeated queries |
| Batch Queries | 2-3x | Multi-page queries |
| Streaming API | -50% memory | Large result processing |
| Selector Caching | 5-10% | All queries |
| Combined | 10-100x | Typical usage |
See docs/dlsite_endpoint_inventory.md for the full endpoint coverage matrix.
Implemented features
- Get product information by scraping html and using ajax api for web.
- Basic information
- Additional information
- Multi-language support via
Languageenum (Jp,En,Ko,ZhCn,ZhTw) (HTML scraping still uses Japanese page; locale applies to review and API calls)
- Get product review (with locale support via
get_review_with_locale) - Get product information using api (with locale support via
get_with_locale) - Get product thumbnail (
ProductApiClient::get_product_thumbnail) - Get product screenshots (
ProductApiClient::list_product_screenshots) - Search product (all documented parameters now implemented)
- Site abstraction via
Siteenum (Maniax,Books,Soft,Pro,Appx,Comic,Home,Custom) - Get circle info
- Get circle product list
- Get circle profile metadata (
get_circle_profile) - Get circle games only (
CircleClient::list_circle_games) - Resolve circle name to maker_id (
CircleClient::resolve_circle_name) - Get circle sale list (needs network capture)
- Work type helpers (
WorkType::is_game()) - Login and user related feature (stubs behind
cookie-storefeature) - Get ranking (stub — endpoint URL needs network capture verification)
Features
Performance Optimizations
- Parallel Parsing: 3-4x faster search result parsing using rayon
- Result Caching: 10-100x faster repeated queries with LRU cache
- Batch Queries: 2-3x faster multi-page queries with concurrent requests
- Streaming API: 50% less memory usage for large result sets
- Selector Caching: 5-10% faster parsing with pre-compiled CSS selectors
Reliability Features
- Rate Limiting: Automatic 2 requests/second to prevent IP bans
- Retry Logic: Automatic retry with exponential backoff for transient failures
- Connection Pooling: Configurable connection pool for better resource usage
Maintainability
- Unified Selector Architecture: All CSS selectors are centralized in a single module with caching for consistent parsing behavior
- Comprehensive Test Coverage: Fixture-based parser tests and wiremock-based integration tests ensure reliability without network dependencies
Code Quality
- Centralized Selectors: All CSS selectors are defined in a single module with caching for consistency
- Comprehensive Testing: HTML fixture-based parser tests with snapshot testing for regression detection
- Mock Integration Tests: Network-free tests using wiremock for reliable CI/CD
Example
Basic Usage
-
Get product by api
use DlsiteClient; async -
Get product thumbnail and screenshots
use DlsiteClient; async -
Search products (with automatic parallel parsing and caching) Note: Requires
search-htmlfeature flaguse ; async
Advanced Usage
-
Batch query multiple pages concurrently Note: Requires
search-htmlfeature flaguse ; async -
Stream large result sets with callback Note: Requires
search-htmlfeature flaguse ; async -
Get circle games and resolve circle name Note: Requires
search-htmlfeature flaguse DlsiteClient; async -
Custom client configuration
use ; use Duration; async
Development
Before submitting a PR or publishing, run the verification checks:
# Individual checks
RUSTDOCFLAGS="-D warnings"
# Or use the convenience script
License
Licensed under the MIT License. See [LICENSE](LICENSE) for details.