- Added an anchorless removal pass. Some producers inject the stamp as plain
text with the URL not linked (no
<a>to anchor on), e.g.<p>ABC Amber LIT Converter http://www.processtext.com/abclit.html</p>or nested in a<div type="FOOTER">. A text pass now locates the stamp by atext_sigand removes the outermost wrapper whose entire text is the stamp (allowing it to repeat), with the same balanced-element safety. A real sentence that merely mentions the URL is preserved (its wrapper's text is not only the stamp). - Watermark entries gained
text_sig(a visible-text substring) andphrase(a regex for the stamp's text);href_sigis now optional (a producer may be anchorless-only). Detection keys on both signatures. - Found by the first full-library sweep: Jack Ketchum's Off Season and Julia Quinn's The Duke and I both carried the anchorless ABC Amber form that v0.2.0 could not remove.
- Three new tests: anchorless
<p>, anchorless<div type="FOOTER">, and the URL-in-real-prose safety case.
-
Generalized the single hardcoded OceanofPDF signature into a small watermark registry (
WATERMARKS). Each entry is anhrefsignature plus the stamp's visible text; the balanced-element engine, archive rewrite, and detection are now signature-agnostic. Adding a producer is one table entry. -
Added ABC Amber LIT Converter support (
processtext.com/abclit). Its stamp wraps the text in a<b>with the word "Converter" split across the<b>and its inner<a>, so removing only the<a>would orphan "Generated by ABC Amber LIT Conv". The removable-wrapper set now includes the inline elementsb/i/em/strong; the "wrapper text must equal the watermark exactly" guard keeps real bold/italic prose safe. -
Tests cover the ABC Amber
<b>removal, a real<b>phrase surviving next to a watermark, and both producers' stamps in one document. -
--outand-n/--dry-runare now rejected with a clear error (exit 2) in single-file mode instead of being silently ignored. Both flags only ever applied to--batch; in single-file modeoceanstrip book.epub --out dirquietly ignored--outand wrote<name> (cleaned).epubnext to the source, which is an easy way to leave a stray file in an import directory. The error points at the fix (positional output path for one file, or--batch). -
Added a CLI test suite (
tests/test_cli.py) covering the guard and the still-valid single-file and batch paths.
First release. Extracted from a one-off script into a standalone tool.
- Remove OceanofPDF.com watermark links from EPUB content documents using balanced element matching, so nested wrappers are handled without corrupting the XML.
- Remove the stray
oceanofpdf.commarker file from the archive root. - Repair
mimetypeordering and compression on rewrite (fixes epubcheck PKG-006 that OceanofPDF's repackaging introduces). - Single-file and batch (
--batch) modes;--dry-runto report without writing. - Originals are never modified.
- stdlib
unittestsuite; no third-party dependencies.
Validated on a 3713-book Calibre library: 12 watermarked books found and cleaned with zero epubcheck regressions (three came out with fewer errors than the source, because the watermark link was itself a flagged issue).