Documentation
¶
Overview ¶
Package douban is the library behind the douban command: the HTTP client, request shaping, and typed data models for Douban (豆瓣).
The client fetches Douban subject-search pages over HTTPS and extracts structured results from the embedded window.__DATA__ JSON. No API key or authentication is required. It sets a real User-Agent, paces requests, and retries transient 429/5xx errors with exponential backoff.
Index ¶
Constants ¶
View Source
const DefaultUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
DefaultUserAgent is the browser-like User-Agent sent with every request.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to Douban's search pages.
Click to show internal directories.
Click to hide internal directories.