Containerized pipeline for validating HTTP/HTTPS links extracted from PDF documents. Uses linkchecker under the hood with structured CSV reporting.
- Validates HTTP/HTTPS links from a plain-text URL list
- Generates structured CSV reports with status codes, redirect counts, and PDF detection
- Tracks redirect chains and identifies broken links
- Recognizes SSL/TLS errors and rate-limit responses
- Fully containerized -- single
docker runcommand - Zero Python dependencies beyond the standard library
pdf_links_check.txt (input: one URL per line)
|
make_html.py -> converts URLs to an HTML document
|
linkchecker -> validates every link, writes output.log
|
parse_output.py -> parses the log, generates results.csv
|
results.csv (output)
| Component | Purpose |
|---|---|
make_html.py |
Converts URL list into an HTML file with clickable links |
linkchecker |
CLI tool that crawls the HTML and validates all links |
parse_output.py |
Parses linkchecker output into structured CSV |
run_checker.sh |
Orchestrates the full pipeline |
# Clone git clone https://github.com/mazamaka/pdf_linkchecker_docker.git cd pdf_linkchecker_docker # Build docker build -t pdf-linkchecker . # Prepare input -- one URL per line echo "https://example.com/doc.pdf" > my_links.txt # Run docker run --rm \ -v $(pwd)/my_links.txt:/app/pdf_links_check.txt \ -v $(pwd)/output:/app \ pdf-linkchecker
Results are saved to results.csv in the mounted directory.
Plain text file, one URL per line:
https://example.com/document.pdf
https://another.site.com/report.pdf
| Column | Description | Example |
|---|---|---|
url |
Validated URL | https://example.com/doc.pdf |
status |
HTTP status code or error text | 200, 404, SSL error |
is_valid |
Link is reachable | True / False |
is_pdf |
URL points to a PDF file | True / False |
redirects_count |
Number of redirects | 0, 2 |
The parser treats these codes as valid: 200-204, 206, 301-303, 307-308, 401, 403, 416, 429.
Edit run_checker.sh to customize:
linkchecker temp_links.html \ --check-extern \ --no-status \ --verbose \ --timeout=10
See linkchecker docs for all flags.
.
├── Dockerfile # Image definition (python:3.13-slim + linkchecker)
├── run_checker.sh # Pipeline orchestrator
├── make_html.py # URL list -> HTML converter
├── parse_output.py # Log parser -> CSV generator
├── pdf_links_check.txt # Sample input
└── README.md
| Problem | Solution |
|---|---|
| No links in output | Check pdf_links_check.txt encoding (UTF-8) and format |
| SSL/TLS errors | Logged as invalid; some servers have bad certificates |
| Timeouts | Increase --timeout in run_checker.sh |
| Permission errors | Use docker run --user $(id -u):$(id -g) ... |
MIT