Skip to content

Add image download, config file support, and CLI improvements#187

Open
chenxiccc wants to merge 2 commits intokepano:mainfrom
chenxiccc:main
Open

Add image download, config file support, and CLI improvements#187
chenxiccc wants to merge 2 commits intokepano:mainfrom
chenxiccc:main

Conversation

@chenxiccc
Copy link

Add --download-images flag to download remote images in markdown and rewrite links to local paths
Add --image-dir and --image-dir-from-output options to control image save location (default: attachments/)
Auto-generate output filename from URL when --download-images is set without --output
Add defuddle.config.json / .defuddlerc config file support for default CLI options (loaded when no manual flags are passed)
Update README with new options and config file documentation

admin and others added 2 commits March 17, 2026 16:57
- Add --download-images flag to download remote images in markdown and rewrite links to local paths
- Add --image-dir and --image-dir-from-output options to control image save location (default: attachments/)
- Auto-generate output filename from URL when --download-images is set without --output
- Add defuddle.config.json / .defuddlerc config file support for default CLI options (loaded when no manual flags are passed)
- Fix getPageName URL path extraction (use basename instead of broken regex)
- Add defuddle.config.json with markdown + download-images + attachments defaults
- Update README with new options and config file documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…pixel filter

- Add fetchImageWithRetry to replace bare fetch calls:
  - Send Referer and browser User-Agent headers to bypass hotlink protection
  - Retry up to 3 times with 1500ms delay on transient errors; skip retry on 4xx
  - Validate Content-Type to reject non-image responses (e.g. HTML error pages)
  - Skip files smaller than 1KB to filter out tracking pixels

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.

1 participant