Skip to content

feat(settings): pick and add Z-Library domains - #49

Merged
audemed44 merged 3 commits into
mainfrom
feat/zlibrary-domains
Oct 11, 2026
Merged

audemed44 merged 3 commits into
mainfrom
feat/zlibrary-domains

Conversation

@audemed44

@audemed44 audemed44 commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

What

Z-Library moves domains and puts some behind a bot check, so the domain is now chosen in Settings → Z-Library instead of only through an env var.

  • Official domains are built in: z-lib.sk, z-library.im, z-library.sk, z-library.hn and the mirror libb.la.
  • Z-Library's own list: the API publishes its current domains at /eapi/info/domains. Opening Settings fetches that list, asking the domain in use first and then the others until one answers, and stores it. Those domains appear as From Z-Library. If no domain answers, the last list fetched stays.
  • Live checks: each domain is checked from the server with a one-result search, and the row shows Works · N ms or the reason it fails (bot check, unreachable, not answering like Z-Library).
  • Choosing and custom domains: pick the domain in use. You can add your own domains (pasted URLs are fine) and remove them again. Removing the domain in use falls back to the default.
  • Storage: the choice and the lists live in a new settings table (migration 0002_settings.sql) and apply immediately; the client logs in again on the new domain. SHELFLOOM_ZLIBRARY_DOMAIN is now only the starting choice, and its default changes to z-library.hn.
  • z-library.ec dropped: it was the old default but is a phishing lookalike, not a Z-Library domain. The README warns to take domains only from Z-Library's own channels.
  • Errors: a redirect-loop bot check now reports as one, and search errors about the domain link to Settings.

API: GET/POST /api/zlibrary/domains, POST /api/zlibrary/domains/refresh, PUT /api/zlibrary/domain, DELETE /api/zlibrary/domains/{domain}, GET /api/zlibrary/domains/check?domain=.

Live check from the homelab host (2026-10-11)

Domain Source Result
z-library.hn, libb.la official Work
article.sk, articles.sk, proxy.zlibraryproxies.workers.dev from Z-Library Work
z-lib.sk, z-library.im, z-library.sk, 1lib.sk official / from Z-Library DiamWall denies automated clients (also through Cloudflare WARP, and also a real headless Chromium)

Testing

  • Go: domain normalising; list / add / duplicate / select / search through the selected domain; fetching Z-Library's list (skipping domains with no content and ones already listed) and selecting from it; check; remove-in-use fallback.
  • Vitest: per-domain status, the fetched list and checks of its new domains, switching, adding and removing, and the notice when no account is set.
  • Ran the app: Settings fetched the real list from z-library.hn and checked every domain (phone and desktop screenshots).

Z-Library moves domains and puts some behind a bot check, so the domain is
now chosen in Settings instead of only by environment variable.

- Settings → Z-Library lists the published domains (z-lib.sk, z-library.im,
  z-library.sk, z-library.hn, libb.la) plus z-library.ec, checks each one
  from the server (a one-result search) and shows whether it works.
- Pick the domain in use; add your own domains and remove them again.
- The choice is kept in a new settings table and applies at once (the client
  logs in afresh on the new domain). SHELFLOOM_ZLIBRARY_DOMAIN is now only the
  starting choice, defaulting to z-library.hn.
- A redirect-loop bot check reads as such instead of a generic error, and
  search errors about the domain link to Settings.
z-library.ec is not one of Z-Library's domains: it proxies the real API to
collect account logins. Only the published domains stay built in, and the
README warns to take new domains from Z-Library's own channels.
Z-Library's app API publishes its current domains (/eapi/info/domains).
Opening Settings → Z-Library now fetches that list (asking the domain in use
first, then the others until one answers), keeps it, and shows those domains
as "From Z-Library" next to the official ones, each with its live check. The
list stays as last fetched when no domain answers.
@audemed44
audemed44 merged commit 41b95de into main Oct 11, 2026
2 checks passed
@audemed44
audemed44 deleted the feat/zlibrary-domains branch October 11, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant