zlib

package module
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 25 Imported by: 0

README

zlib

A CLI for Z-Library.

Go version CI Release Downloads License

English | 中文

search demo

Features

🔍 Interactive search — browse results with ↑/↓, switch pages with ←/→
📥 Book download — by book ID, from search results, with live progress
📚 Download history — paginated history browser with download support
📖 Send to Kindle — deliver files to your Kindle address
🕒 Usage profile — view daily download quota
🎨 Themes — auto, mocha, latte, dracula, tokyo, nord, gruvbox
🌐 Proxy & custom domain support for restricted networks

Install

Homebrew (macOS / Linux):

brew install heartleo/tap/zlib

winget (Windows):

winget install heartleo.zlib

curl (macOS / Linux):

curl -fsSL https://raw.githubusercontent.com/heartleo/zlib/main/install.sh | sh

Go install (requires Go 1.25+):

go install github.com/heartleo/zlib/cmd/zlib@latest

Build from source:

git clone https://github.com/heartleo/zlib
cd zlib
go build -o zlib ./cmd/zlib
Claude Code plugin

zlib ships a Claude Code plugin, so Claude can search and download books for you.

/plugin marketplace add heartleo/zlib
/plugin install zlib@zlib-plugin-cc

/zlib "the pragmatic programmer" to search and download. /zlib:kindle sends a book to your Kindle.

Codex plugin

zlib also ships a skills-only plugin for Codex:

codex plugin marketplace add heartleo/zlib
codex plugin add zlib@zlib

Ask Codex to search or download a book with zlib. Use the bundled Kindle skill when you want to send a local book file to your Kindle.

Quick Start

Set ZLIB_DOMAIN first. Z-Library mirrors change often and most of them are behind DiamWall, so there is no default that stays correct. Every command resolves its mirror from ZLIB_DOMAIN before anything else, and a wrong or stale value is the single most common cause of a login that succeeds and a next command that fails.

Most current Z-Library web domains put automated requests behind DiamWall, so the recommended setup uses EAPI. Probe the candidates first, then set ZLIB_DOMAIN to one reported as healthy or challenged:

zlib doctor --eapi
export ZLIB_DOMAIN=https://z-lib.gd     # pick one doctor reported usable
zlib login --eapi
zlib search "dune"

A successful login records that domain as ZLIB_DOMAIN in ~/.config/zlib/.env, so the setting survives a new shell and you do not have to remember it. Other keys in that file are left untouched. Two things still outrank it, and a stale value in either shadows what the login wrote: a real environment variable, and a .env in the working directory.

challenged means the domain answered with Z-Library's own JS proof-of-work page. That domain is usable: the client solves the challenge automatically, so pick it as readily as a healthy one. Only diamwall_blocked, http_error, redirect_loop and network_error are unusable.

EAPI login checks the selected domain again before asking for account credentials. If no candidate is usable, see Troubleshooting DiamWall.

Commands

login

login demo

zlib login
zlib login --email you@example.com --password secret
zlib login --cookies ~/Downloads/cookies.txt --domain https://z-lib.gd
zlib login --eapi --domain https://z-lib.gd
# or set ZLIB_DOMAIN=https://z-lib.gd, then:
zlib login --eapi

Saves session to ~/.config/zlib/session.json, and records the domain it used as ZLIB_DOMAIN in ~/.config/zlib/.env so later commands reach the same mirror without you setting anything. The interactive login remembers and prefills the last successful email address, but never stores the password. --cookies imports a user-supplied Netscape/Mozilla-format cookie file; only unexpired root cookies matching --domain are saved to the session. Cookie files contain reusable credentials, so keep the exported file private.

If you omit --domain, both HTML and EAPI login read ZLIB_DOMAIN. When neither is set, the command prints the required setting and exits. EAPI login also checks the selected domain before asking for account credentials. If the check fails, it tells you to choose another domain. Cookie imports follow the same rule.

--eapi selects the unofficial mobile app API and saves that choice in the session. Search, profile, history, book details, downloads, and Kindle delivery then use the EAPI path where needed. Book references use id:hash, for example zlib download 115066162:e9f13b --send-to-kindle. See EAPI mode for the endpoint list and stability notes.

If /eapi/user/login refuses to issue credentials, --eapi login falls back to the HTML login form and continues in EAPI mode. The EAPI authenticates on nothing but remix_userid/remix_userkey, and the HTML form hands out the same pair, so the fallback session is not degraded. See EAPI login says Authorization failed.

logout
zlib logout

search demo static

Without arguments, opens an interactive picker:

  • type a query and confirm
  • browse results with ↑/↓
  • switch pages with ←/→
  • press Enter to download
zlib search # interactive mode
zlib search "dune" --page 2 # static table
zlib search "dune" --json   # machine-readable output for scripts and plugins

Filter by file format with --ext (or its alias --format), repeatable.

zlib search "python crash course" --ext epub --ext pdf

Use --full-title to disable title truncation

zlib search "civilized to death" --full-title
download
zlib download Gz31nyAV5E
zlib download Gz31nyAV5E --dir ./books --send-to-kindle
zlib download Gz31nyAV5E --dir "~/Downloads"

--dir expands a leading ~ itself, so it works whether or not the shell expanded it.

Press Ctrl+C to cancel. Incomplete files are removed automatically.

history

history demo

Without flags, opens an interactive history browser:

  • browse with ↑/↓, switch pages with ←/→
  • press Enter to re-download
zlib history
zlib history --download Gz31nyAV5E --dir ./books
zlib history --format epub
zlib history --json   # machine-readable, always non-interactive
profile

profile demo

zlib profile
zlib profile --json
doctor

Checks all known domains without logging in or changing the active domain. --proxy overrides ZLIB_PROXY for this check only.

zlib doctor
zlib doctor --eapi
zlib doctor --proxy http://127.0.0.1:7890
zlib doctor --proxy socks5://127.0.0.1:9050 --json

--eapi checks /eapi/info/domains instead of the home page. A domain may block the website while leaving EAPI reachable, so the two checks can disagree.

Troubleshooting DiamWall (issue #16)

In issue #16, the mirror serves a DiamWall challenge where the CLI expects Z-Library HTML or JSON. You may see an HTTP 307 redirect loop, HTTP 517, or Access Denied | DiamWall. Older CLI versions may instead fail with searchResultBox not found, dstats-info not found, or invalid character '<' while decoding login JSON.

  1. Check both website and EAPI connectivity:

    zlib doctor --json
    zlib doctor --eapi --json
    
  2. Set ZLIB_DOMAIN to a domain reported as healthy or challenged, then log in with EAPI:

    export ZLIB_DOMAIN=https://z-lib.gd
    zlib login --eapi
    zlib search "golang"
    
  3. If your network requires a proxy, run the check through that proxy before setting it for other commands:

    zlib doctor --eapi --proxy http://127.0.0.1:7890
    export ZLIB_PROXY=http://127.0.0.1:7890
    

challenged means the domain served Z-Library's own JS proof-of-work page; the client clears it automatically, so the domain is usable. diamwall_blocked means DiamWall intercepted the request. redirect_loop means the redirects never reached content. http_error covers responses such as 403; network_error covers DNS, TLS, timeout, reset, and EOF failures. Changing the User-Agent or importing login cookies does not solve a DiamWall JS/TLS challenge. Use a healthy or challenged EAPI domain, or a different network route.

EAPI login says Authorization failed
Error: login failed: zlibrary: login failed: Authorization failed

Z-Library gates /eapi/user/login separately from the rest of the EAPI. An account it refuses this way still drives /eapi/user/profile, /eapi/book/search and /eapi/user/book/downloaded normally. The message is also not a wrong password: a wrong one comes back Incorrect email or password instead.

The CLI handles this on its own by logging in through the HTML form and continuing in EAPI mode, so on a current build the login simply succeeds. If you see the message, you are on a build older than that fallback — upgrade, or import a browser cookie file instead:

zlib login --cookies ~/Downloads/cookies.txt --domain https://z-lib.gd

Incorrect email or password really is a credential failure. Note that a password containing shell metacharacters can be mangled by --password; omit the flag and let the prompt take it.

Commands fail after a successful login
Error: zlibrary: blocked by anti-bot protection (HTTP 517) at https://z-lib.sk/...
Error: zlibrary: unexpected HTTP status 503 at https://z-lib.gd/users/downloads

A ZLIB_DOMAIN left over from an earlier setup overrides the domain the login just saved, so zlib login --domain https://z-lib.gd can succeed and the very next command still target the old mirror. Check the effective value before suspecting anything else — .env files in the working directory and in ~/.config/zlib/ both feed it:

echo "$ZLIB_DOMAIN"
grep -r ZLIB_DOMAIN .env ~/.config/zlib/.env 2>/dev/null

Point it at a domain zlib doctor --eapi reports as healthy or challenged, or remove it entirely to fall back to the domain saved in the session.

A bare 503 from a healthy or challenged domain means the build predates the challenge fix and is treating Z-Library's own proof-of-work page as an error. Upgrade.

Measured 2026-09-04 by probing /eapi/user/login on each host. The list is maintained from measurement rather than from Z-Library's own /eapi/info/domains, which advertises hosts that are DiamWall-fronted and omits several that work.

Allowed domain EAPI (measured 2026-09-04)
z-lib.gd works (EAPI default)
z-lib.gl works
z-library.ec works (EAPI only; the HTML site is Cloudflare-blocked)
zlib.bz works
article.sk works
articles.sk works
zliba.ru redirects to zlib.bz; login --eapi follows it
1lib.sk DiamWall-blocked
z-lib.fm DiamWall-blocked
z-lib.sk DiamWall-blocked

z-library.gs was removed: its TLS handshake fails. Run zlib doctor --eapi for the current picture rather than trusting this table, which ages.

kindle

kindle demo

Configure Kindle delivery settings:

  • recipient Kindle address
  • sender address
  • SMTP host and port

SMTP password is never stored on disk — set ZLIB_SMTP_PWD instead.

zlib kindle                  # configure
zlib kindle send             # pick a file interactively
zlib kindle send ./dune.epub # send a local file

Supported formats: EPUB PDF MOBI TXT DOC DOCX RTF HTML

theme
zlib theme           # show current
zlib theme auto      # follow terminal background
zlib theme nord      # set globally

Available: auto · mocha · latte · dracula · tokyo · nord · gruvbox

Configuration

Keep secrets like ZLIB_SMTP_PWD out of your shell history — put them in an .env file instead of exporting them inline. zlib reads env vars with this precedence: real environment > working-directory .env > ~/.config/zlib/.env. The global file is the recommended home for machine-wide values.

HTML and EAPI both read ZLIB_DOMAIN. It overrides the domain saved in ~/.config/zlib/session.json; if you unset it, the CLI uses the saved domain. A new login without --domain requires ZLIB_DOMAIN. EAPI login checks that domain before requesting account credentials.

A successful login writes ZLIB_DOMAIN into ~/.config/zlib/.env, replacing the assignment already there and leaving every other line alone. That is the lowest-precedence of the three sources, so an exported variable or a working-directory .env still wins over it — check those first when a command targets a mirror you did not choose.

Variable Description
ZLIB_DOMAIN Domain for HTML and EAPI; used when login omits --domain
ZLIB_PROXY Proxy URL, e.g. http://127.0.0.1:7890
ZLIB_SMTP_PWD SMTP password for Kindle delivery
ZLIB_THEME Override theme without changing config
ZLIB_DOWNLOAD_RETRIES Retries for dropped connections and 502/503/504 responses

ZLIB_DOWNLOAD_RETRIES defaults to 3.

Edit the global env file (~/.config/zlib/.env, one KEY=value per line):

mkdir -p ~/.config/zlib && touch ~/.config/zlib/.env && chmod 600 ~/.config/zlib/.env
# open it in your editor:
notepad "$env:USERPROFILE\.config\zlib\.env"   # Windows (PowerShell)
open -t ~/.config/zlib/.env                       # macOS
${EDITOR:-nano} ~/.config/zlib/.env               # Linux

Documentation

Index

Constants

View Source
const (
	DefaultDomain = "https://z-lib.sk"
	TorDomain     = "http://bookszlibb74ugqojhzhg2a63w5i2atv5bqarulgczawnbmsb6s6qead.onion"
	EnvDomain     = "ZLIB_DOMAIN"
	EnvProxy      = "ZLIB_PROXY"
	EnvRetries    = "ZLIB_DOWNLOAD_RETRIES"
)
View Source
const DefaultDownloadRetries = 3

DefaultDownloadRetries is how many times a download request is reissued after a transient failure — a connection error, or one of the gateway statuses isRetryableStatus accepts. Other failures are never retried. EnvRetries overrides it, and 0 disables retrying.

View Source
const (
	DefaultEAPIDomain = "https://z-lib.gd"
)

Variables

View Source
var (
	ErrLoginFailed    = errors.New("zlibrary: login failed")
	ErrNotLoggedIn    = errors.New("zlibrary: not logged in, call Login first")
	ErrNoDomain       = errors.New("zlibrary: no working domain found")
	ErrEmptyQuery     = errors.New("zlibrary: search query is empty")
	ErrNoID           = errors.New("zlibrary: no book ID provided")
	ErrInvalidProxy   = errors.New("zlibrary: proxy_list must be a non-empty slice")
	ErrParseFailed    = errors.New("zlibrary: failed to parse page")
	ErrSessionExpired = errors.New("zlibrary: session expired, run `zlib login` to re-authenticate")
	ErrPhraseMinWords = errors.New("zlibrary: phrase search requires at least 2 words")
	ErrDownloadFailed = errors.New("zlibrary: download failed")
	// ErrBotProtection is returned when an upstream anti-bot page is served
	// instead of the requested Z-Library response.
	ErrBotProtection = errors.New("zlibrary: blocked by anti-bot protection")
	// ErrRedirectLoop is returned when an upstream keeps redirecting a request
	// beyond the client's redirect limit.
	ErrRedirectLoop = errors.New("zlibrary: too many redirects")
	// ErrChallengeFailed is returned when the JS challenge could not be cleared
	// within the client's attempt budget.
	ErrChallengeFailed = errors.New("zlibrary: could not clear the browser challenge")
)
View Source
var (
	Version = "dev"
	Commit  = "none"
	Date    = "unknown"
)

Functions

func AllowedDomainSuffixes added in v0.0.7

func AllowedDomainSuffixes() []string

AllowedDomainSuffixes returns the only upstream hostname suffixes accepted by the CLI. A hostname must equal a suffix or be one of its subdomains.

func BuildBookURL

func BuildBookURL(domain, bookID string) string

func BuildDownloadsPageURL

func BuildDownloadsPageURL(domain string, page int) string

func BuildDownloadsURL

func BuildDownloadsURL(domain string) string

func BuildFullTextSearchURL

func BuildFullTextSearchURL(domain, query, searchType string) string

func BuildHistoryURL

func BuildHistoryURL(domain string, page int) string

func BuildSearchURL

func BuildSearchURL(domain, query string) string

func CurrentDefaultDomain

func CurrentDefaultDomain() string

CurrentDefaultDomain resolves the domain new clients start from: SetDefaultDomain > ZLIB_DOMAIN > DefaultDomain.

ZLIB_DOMAIN is read on every call rather than in an init function: the CLI loads .env after all init functions have run, so an init-time read would never observe a .env-supplied value.

func KnownDomains added in v0.0.7

func KnownDomains() []string

KnownDomains returns the domains checked by the CLI doctor command.

func ParseAllowedDomain added in v0.0.7

func ParseAllowedDomain(raw string) (string, error)

ParseAllowedDomain validates an HTTPS origin against AllowedDomainSuffixes and returns its normalized origin.

func SendToKindle

func SendToKindle(filePath string, cfg KindleConfig, smtpPassword string) error

func SetDefaultDomain

func SetDefaultDomain(domain string)

SetDefaultDomain overrides the default domain for clients created afterwards. Passing an empty string clears the override, restoring ZLIB_DOMAIN-or-default resolution.

Types

type Book

type Book struct {
	ID          string   `json:"id"`
	Hash        string   `json:"hash,omitempty"`
	ISBN        string   `json:"isbn,omitempty"`
	URL         string   `json:"url"`
	Cover       string   `json:"cover,omitempty"`
	Name        string   `json:"name"`
	Authors     []string `json:"authors,omitempty"`
	Publisher   string   `json:"publisher,omitempty"`
	Year        string   `json:"year,omitempty"`
	Language    string   `json:"language,omitempty"`
	Extension   string   `json:"extension,omitempty"`
	Size        string   `json:"size,omitempty"`
	Rating      string   `json:"rating,omitempty"`
	Quality     string   `json:"quality,omitempty"`
	Description string   `json:"description,omitempty"`
	Categories  string   `json:"categories,omitempty"`
	Edition     string   `json:"edition,omitempty"`
	DownloadURL string   `json:"download_url,omitempty"`
}

type Booklist

type Booklist struct {
	Name        string `json:"name"`
	URL         string `json:"url"`
	Description string `json:"description,omitempty"`
	Author      string `json:"author,omitempty"`
	Count       string `json:"count,omitempty"`
	Views       string `json:"views,omitempty"`
}

type BooklistResult

type BooklistResult struct {
	Lists      []Booklist `json:"lists"`
	Page       int        `json:"page"`
	TotalPages int        `json:"total_pages"`
}

type BotProtectionError added in v0.0.7

type BotProtectionError struct {
	StatusCode int
	URL        string
}

BotProtectionError describes an anti-bot response returned by the upstream. It unwraps to ErrBotProtection so callers can classify it with errors.Is.

func (*BotProtectionError) Error added in v0.0.7

func (e *BotProtectionError) Error() string

func (*BotProtectionError) Unwrap added in v0.0.7

func (e *BotProtectionError) Unwrap() error

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opts ...ClientOption) *Client

func (*Client) Cookies

func (c *Client) Cookies() map[string]string

func (*Client) Domain

func (c *Client) Domain() string

func (*Client) Download

func (c *Client) Download(downloadURL, destDir string, progressFn func(written, total int64)) (DownloadResult, error)

func (*Client) DownloadHistory

func (c *Client) DownloadHistory(page int) (DownloadHistoryResult, error)

func (*Client) DownloadWithContext

func (c *Client) DownloadWithContext(ctx context.Context, downloadURL, destDir string, progressFn func(written, total int64)) (DownloadResult, error)

func (*Client) FetchBook

func (c *Client) FetchBook(id string) (Book, error)

func (*Client) FetchBookDetails

func (c *Client) FetchBookDetails(ids []string) map[string]Book

FetchBookDetails resolves ids concurrently, returning an entry for every id; ids that fail map to a zero Book.

The first id is fetched alone as a warm-up. Z-Library challenges /book/ pages harder than list pages, so a cold burst makes each goroutine solve its own challenge and serve out its own backoff; clearing one first lets the rest share the c_token.

If that warm-up fails, the remaining ids are skipped. When the server is in that mood every fetch fails the same slow way and backfills nothing — measured on a live account: 21 ids, 21 failures, zero fields filled — so paying the backoff N more times buys nothing.

func (*Client) FullTextSearch

func (c *Client) FullTextSearch(query string, page, count int, opts *FullTextSearchOptions) (SearchResult, error)

func (*Client) GetLimits

func (c *Client) GetLimits() (DownloadLimit, error)

func (*Client) Login

func (c *Client) Login(email, password string) error

func (*Client) LoginEAPI added in v0.0.7

func (c *Client) LoginEAPI(email, password string) error

func (*Client) Logout

func (c *Client) Logout()

func (*Client) Mode added in v0.0.7

func (c *Client) Mode() ClientMode

func (*Client) Search

func (c *Client) Search(query string, page, count int, opts *SearchOptions) (SearchResult, error)

func (*Client) SetCookies

func (c *Client) SetCookies(cookies map[string]string)

func (*Client) SetDomain

func (c *Client) SetDomain(domain string)

func (*Client) SetMode added in v0.0.7

func (c *Client) SetMode(mode ClientMode)

type ClientMode added in v0.0.7

type ClientMode string

ClientMode selects the upstream transport used by high-level operations.

const (
	ClientModeHTML ClientMode = "html"
	ClientModeEAPI ClientMode = "eapi"
)

type ClientOption

type ClientOption func(*Client)

func WithDomain

func WithDomain(domain string) ClientOption

func WithOnion

func WithOnion(proxyURL string) ClientOption

func WithProxy

func WithProxy(proxyURL string) ClientOption

WithProxy routes requests through proxyURL. It clones http.DefaultTransport so the connection pooling, HTTP/2 negotiation, and dial timeouts the stdlib tunes for us survive; only the proxy function is replaced.

type DomainCheck added in v0.0.7

type DomainCheck struct {
	Domain     string       `json:"domain"`
	Status     DomainStatus `json:"status"`
	HTTPStatus int          `json:"http_status,omitempty"`
	FinalURL   string       `json:"final_url,omitempty"`
	Detail     string       `json:"detail,omitempty"`
}

DomainCheck contains the result of a read-only unauthenticated domain probe.

func ProbeDomain added in v0.0.7

func ProbeDomain(ctx context.Context, domain string) DomainCheck

ProbeDomain checks whether an unauthenticated GET to a domain reaches a successful response. Redirects are followed manually so self-redirects and DiamWall's __diamwall cookie can be reported precisely.

func ProbeDomainWithOptions added in v0.0.7

func ProbeDomainWithOptions(ctx context.Context, domain string, opts DomainProbeOptions) DomainCheck

ProbeDomainWithOptions checks a single domain using opts.

func ProbeDomains added in v0.0.7

func ProbeDomains(ctx context.Context, domains []string) []DomainCheck

ProbeDomains checks domains concurrently. It makes only unauthenticated GET requests and never changes the client's configured default domain.

func ProbeDomainsWithOptions added in v0.0.7

func ProbeDomainsWithOptions(ctx context.Context, domains []string, opts DomainProbeOptions) []DomainCheck

ProbeDomainsWithOptions checks domains concurrently using opts.

type DomainProbeOptions added in v0.0.7

type DomainProbeOptions struct {
	// ProxyURL overrides ZLIB_PROXY for this probe when non-empty.
	ProxyURL string
	// Path selects an endpoint below each candidate origin. Empty probes root.
	Path string
}

DomainProbeOptions controls how doctor probes reach candidate domains.

type DomainStatus added in v0.0.7

type DomainStatus string

DomainStatus is the health classification returned by ProbeDomain.

const (
	DomainStatusHealthy DomainStatus = "healthy"
	// DomainStatusChallenged means the domain answered with Z-Library's own JS
	// proof-of-work interstitial. It is a USABLE domain: Client.get() solves the
	// challenge transparently. The interstitial arrives with HTTP 503, so
	// without this status the most usable mirrors were reported as http_error.
	DomainStatusChallenged      DomainStatus = "challenged"
	DomainStatusDiamWallBlocked DomainStatus = "diamwall_blocked"
	DomainStatusRedirectLoop    DomainStatus = "redirect_loop"
	DomainStatusHTTPError       DomainStatus = "http_error"
	DomainStatusNetworkError    DomainStatus = "network_error"
	DomainStatusInvalidDomain   DomainStatus = "invalid_domain"
)

type DownloadHistoryItem

type DownloadHistoryItem struct {
	// ID is the alphanumeric book ID extracted from URL. The parser leaves it
	// empty; consumers that need it (e.g. the CLI's --json output) derive it
	// from URL.
	ID          string `json:"id,omitempty"`
	Hash        string `json:"hash,omitempty"`
	Name        string `json:"name"`
	URL         string `json:"url"`
	DownloadURL string `json:"download_url,omitempty"`
	Extension   string `json:"extension,omitempty"`
	Size        string `json:"size,omitempty"`
	Date        string `json:"date"`
}

type DownloadHistoryResult

type DownloadHistoryResult struct {
	Items      []DownloadHistoryItem `json:"items"`
	Page       int                   `json:"page"`
	TotalPages int                   `json:"total_pages"`
}

type DownloadLimit

type DownloadLimit struct {
	DailyAmount    int    `json:"daily_amount"`
	DailyAllowed   int    `json:"daily_allowed"`
	DailyRemaining int    `json:"daily_remaining"`
	DailyReset     string `json:"daily_reset"`
}

type DownloadResult

type DownloadResult struct {
	FilePath string
	Size     int64
}

type Extension

type Extension string
const (
	ExtTXT  Extension = "TXT"
	ExtPDF  Extension = "PDF"
	ExtFB2  Extension = "FB2"
	ExtEPUB Extension = "EPUB"
	ExtLIT  Extension = "LIT"
	ExtMOBI Extension = "MOBI"
	ExtRTF  Extension = "RTF"
	ExtDJV  Extension = "DJV"
	ExtDJVU Extension = "DJVU"
	ExtAZW  Extension = "AZW"
	ExtAZW3 Extension = "AZW3"
)

func (Extension) String

func (e Extension) String() string

type FullTextSearchOptions

type FullTextSearchOptions struct {
	SearchOptions
	Phrase bool
}

type HTTPStatusError added in v0.0.7

type HTTPStatusError struct {
	StatusCode int
	URL        string
}

HTTPStatusError describes an unexpected non-success HTTP response.

func (*HTTPStatusError) Error added in v0.0.7

func (e *HTTPStatusError) Error() string

type KindleConfig

type KindleConfig struct {
	To       string `json:"to"`
	From     string `json:"from"`
	SMTPHost string `json:"smtp_host"`
	SMTPPort int    `json:"smtp_port"`
}

func (KindleConfig) Validate

func (c KindleConfig) Validate() error

type Language

type Language string
const (
	LangEnglish    Language = "english"
	LangChinese    Language = "chinese"
	LangRussian    Language = "russian"
	LangFrench     Language = "french"
	LangGerman     Language = "german"
	LangSpanish    Language = "spanish"
	LangJapanese   Language = "japanese"
	LangKorean     Language = "korean"
	LangItalian    Language = "italian"
	LangPortuguese Language = "portuguese"
	LangArabic     Language = "arabic"
	LangDutch      Language = "dutch"
	LangPolish     Language = "polish"
	LangTurkish    Language = "turkish"
	LangHindi      Language = "hindi"
)

type OrderOption

type OrderOption string
const (
	OrderPopular OrderOption = "popular"
	OrderNewest  OrderOption = "date_created"
	OrderRecent  OrderOption = "date_updated"
)

func (OrderOption) String

func (o OrderOption) String() string

type SearchOptions

type SearchOptions struct {
	Exact      bool
	FromYear   int
	ToYear     int
	Languages  []Language
	Extensions []Extension
}

type SearchResult

type SearchResult struct {
	Books      []Book `json:"books"`
	Page       int    `json:"page"`
	TotalPages int    `json:"total_pages"`
}

Directories

Path Synopsis
cmd
zlib command
internal
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL