How heartleo/zlib works
zlib is a terminal client for Z-Library. Its principal workflow is login or import cookies, persist a session, then search interactively or statically, select a book, and download it; history, profile, domain diagnostics, themes, and Kindle delivery are additional capabilities. The CLI coordinates the domain client, which supports HTML and EAPI modes and challenge handling. Several command implementations are represented by their exact tree paths, but their source was not sampled; those relationships are included only where the README documents them.
Main entry points: login.go Login · search.go Search · client.go HTTP client · main.go CLI entry
Components 24
Terminal workflows
- CLI entry
cmd/zlib/main.go - Login
internal/cli/login.go - Search
internal/cli/search.go - Search picker
internal/cli/search_interactive.go - Download command
internal/cli/download.go - History browser
internal/cli/history.go - Profile command
internal/cli/profile.go - Domain doctor
internal/cli/doctor.go - Kindle delivery
internal/cli/kindle.go - Themes
internal/cli/theme.go
Z-Library access
- HTTP client
client.go - EAPI access
eapi.go - Domain probing
domain_probe.go - Challenge solver
challenge.go
Book operations
- Search engine
search.go - Page parser
parser.go - Book details
book.go - File download
download.go - Usage profile
profile.go - Kindle sender
kindle.go
Local settings
- Session settings
internal/config/session.go
Other components
- User
- Z-Library service
- SMTP service
Connections 25
- User → CLI entry: runs commands
README.md - CLI entry → Login: routes login
- User → Search: searches books
README.md - Search → Search engine: queries
internal/cli/search.go - Search → Search picker: opens picker
internal/cli/search.go - Search picker → File download: starts download
README.md - User → Download command: requests download
README.md - Download command → File download: downloads book
README.md - User → History browser: browses history
README.md - User → Profile command: checks quota
README.md - User → Domain doctor: checks domains
README.md - User → Kindle delivery: sends book
README.md - Kindle delivery → Kindle sender: sends file
internal/cli/kindle.go - Kindle sender → SMTP service: emails file
README.md - User → Themes: sets theme
README.md - Login → Session settings: saves session
internal/cli/login.go - Login → HTTP client: authenticates
internal/cli/login.go - HTTP client → Z-Library service: sends requests
- HTTP client → Challenge solver: solves challenge
client.go - Search engine → Page parser: parses results
- Book details → Z-Library service: loads details
- EAPI access → Z-Library service: calls API
- Domain probing → Z-Library service: probes domains
- Profile command → Usage profile: loads profile
- History browser → Z-Library service: loads history