Skip to content

Improve reliability + path-agnostic fresh install - #4

Draft
draesthetic wants to merge 2 commits into
mainfrom
cursor/fresh-install-improvements-c68a
Draft

Improve reliability + path-agnostic fresh install#4
draesthetic wants to merge 2 commits into
mainfrom
cursor/fresh-install-improvements-c68a

Conversation

@draesthetic

@draesthetic draesthetic commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

Reviewed the Substack PDF archiver and applied high-value reliability/setup improvements before documenting a clean fresh-install path.

Code improvements

  • Auth on archive API — listing requests now send cookies from storageState.json
  • Paywall detection — abort/retry if a rendered page looks paywalled
  • Lazy image wait — after scroll-loading, wait for images to finish before PDF
  • No half-written PDFs — delete the file on failed render attempts
  • Dashboard binds to 127.0.0.1 — session cookies stay local-only by default
  • Login idle timeout + SSE keepalive
  • npm run setup — one command for npm install + Playwright Chromium

Fresh-install folders

  • pdfs/ plus known publication host folders are now in the repo (empty, via .gitkeep)
  • PDFs themselves stay gitignored — copy your existing archive into these folders

Local setup (after pulling this branch)

git clone https://github.com/draesthetic/substack-pdf-archiver.git
cd substack-pdf-archiver
git checkout cursor/fresh-install-improvements-c68a
npm run setup

Then paste your old machine’s pdfs/<host>/… contents into this repo’s matching pdfs/ folders, then:

npm run login
npm run dashboard   # http://127.0.0.1:4321
Open in Web Open in Cursor 

Bind the dashboard to localhost, authenticate archive API requests,
detect paywalled pages, wait for lazy images, and add npm run setup
so a fresh clone is one command away from ready.

Co-authored-by: Sahil Agarwal <draesthetic@users.noreply.github.com>
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

🔐 PR security & bug review

Blocking-severity findings: 0 (Semgrep: 0, Trivy: 0)

✅ No error-severity Semgrep findings or high/critical Trivy findings detected.

Observation mode until 2026-07-31T08:15:10Z. After that, unresolved blocking-severity findings fail the required gate.

Open workflow run

Track pdfs/.gitkeep (and known publication host folders) so a fresh clone
has a clear place to copy an existing archive without committing PDFs.

Co-authored-by: Sahil Agarwal <draesthetic@users.noreply.github.com>
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.

2 participants