Skip to content

v0.1.6: gutenberg_get_text sources from the PG-sanctioned mirror

Latest

Choose a tag to compare

@cyanheads cyanheads released this 11 Jul 20:28
v0.1.6
e5d2f00

gutenberg_get_text sources from the PG-sanctioned mirror

Text fetches now go through gutenberg.pglaf.org instead of the ToS-restricted www.gutenberg.org, and has_plain_text no longer advertises un-fetchable books.

Fixed:

  • gutenberg_get_text builds fetch URLs from the book ID against the PG-sanctioned mirror (GUTENBERG_TEXT_BASE_URL, default gutenberg.pglaf.org), never from Gutendex's raw format URLs, which point at the ToS-restricted www.gutenberg.org. (#1)
  • has_plain_text requires a UTF-8 text/plain format; us-ascii-only books now report has_plain_text: false instead of promising a gutenberg_get_text call that always failed. (#7)
  • resolveTextUrl returns null for us-ascii-only books; fetchAndCacheText throws notFound (no_text_format) instead of serviceUnavailable, and the tool's own format guard matches.

Changed:

  • GUTENBERG_TEXT_BASE_URL default: https://www.gutenberg.orghttps://gutenberg.pglaf.org
  • README / docs/design.md updated for the mirror-sourced UTF-8/HTML fallback chain

76 tests pass; bun run devcheck clean.

CHANGELOG v0.1.6