Add archive.org download support to download.py#25
Merged
Conversation
Auto-detect source from URL: archive.org/details/ routes to the new internetarchive-backed downloader; all other URLs use the existing World Radio History scrape path unchanged. New flags: --pdf-format (text/image/both, default text), --year-from, --year-to. Adds requirements.txt and updates README with archive.org usage examples. Closes #4. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
archive.org/details/routes to the new archive.org downloader; all other URLs use the existing World Radio History scrape path unchanged — no behaviour change for existing usage--pdf-format {text,image,both}flag (defaulttext) selects between*_text.pdf(Abbyy OCR layer, whatconvert.pyextracts from) and plain image PDFs--year-from/--year-toflags filter by year extracted from the filename, so a decade slice like--year-from 1974 --year-to 1989works without a full-collection downloadrequirements.txtlisting bothpymupdfandinternetarchive; updates README with archive.org usage examples and a flag reference tableCloses #4.
Test plan
python3 download.py --helpshows all new flagspython3 download.py "https://archive.org/details/ElektorMagazine" --year-from 1974 --year-to 1974 --dry-runlists only 1974_text.pdffiles without downloadingpython3 download.py "https://archive.org/details/ElektorMagazine" --pdf-format image --dry-runlists only plain.pdffiles (no_textsuffix)python3 download.py "https://www.worldradiohistory.com/ETI_Magazine.htm" --dry-runstill works as beforemarkdownlint README.mdpasses with zero warnings🤖 Generated with Claude Code