A cross-language (Python/Go) tool for batch downloading academic PDFs from DOIs
Currently supports extracting DOIs from Web of Science (WoS) exported TXT files and downloading PDFs via Sci-Hub
δΈζζζ‘£ β’ English
DoiHive automates the process of extracting DOIs from bibliographic data files and downloading corresponding PDFs. The project aims to eventually support automatic DOI retrieval from search queries, but currently focuses on processing existing DOI data.
Current Status: Both Python and Go implementations are complete with core functionality. Go version offers superior performance for large-scale downloads.
Vision:
π Topic β π OpenAlex β π DOI List β π― Sci-Hub β πΎ Harvest β π PDF β π€ AI PipelineEnd-to-end academic literature collection: from topic search to AI training data
- β Extract DOIs from WoS TXT files, batch download PDFs
- β Anti-crawl: Browser headers, random delays, auto-retry
- β DOI cache: Resume support, skip processed DOIs
- β Safe harvest: Gradual downloading, auto-stop on anomalies
- β Real-time progress: Progress bar, statistics, log persistence
- Python 3.13+ - Basic implementation
- Go 1.25+ - High-performance implementation (recommended)
| Metric | Python | Go (default 3 workers) |
|---|---|---|
| Time per task | - | ~400-600ms |
| Concurrency | Single-threaded | Goroutines |
| Throughput | - | ~2 DOI/s |
| Cache/Anti-crawl | β | β |
| Recommended for | Small-scale testing | Large-scale batch downloads |
β οΈ Python version lacks cache and anti-crawl mechanisms, not recommended for large-scale downloads
For Python:
- Python 3.13 or higher
- uv (recommended) or pip
For Go:
- Go 1.25 or higher
-
Clone the repository:
git clone https://github.com/SJRnhqh/DoiHive.git cd DoiHive -
For Python: Install dependencies using uv:
uv sync
Or using pip:
pip install -e . -
For Go: Install dependencies:
go mod download
Build the executable:
./build.sh
Or build manually:
go build -o bin/doihive ./cmd
-
Prepare WoS TXT files: Place your Web of Science exported TXT files in the
archive/directory. -
Run the script:
cd python python main.py -
Output:
- PDFs are saved to
pdf/directory - Error logs are saved to
error/directory (JSON format) - Application logs are saved to
logs/directory
- PDFs are saved to
./bin/doihive-darwin-arm64 -a archive -b 100 -w 2| Option | Description | Default |
|---|---|---|
-a |
Archive directory (required) | - |
-b |
Limit download count (0=all) | 0 |
-w |
Concurrent workers | 3 |
-pdf |
PDF output directory |
Output directories: pdf/ (PDFs), pdf/logs/ (logs), pdf/debug/ (debug)
./scripts/harvest.sh -a ./archive # Default settings
./scripts/harvest.sh -a ./archive -b 50 -r 10 # 50 per batch, 10 rounds| Option | Description | Default |
|---|---|---|
-a |
Archive directory (required) | - |
-b |
Batch size per round | 30 |
-r |
Max rounds (0=unlimited) | 0 |
-w |
Concurrent workers | 3 |
-d |
Min delay between batches (sec) | 60 |
-D |
Max delay between batches (sec) | 180 |
DoiHive/
βββ python/ # Python implementation
β βββ main.py # Main entry point
β βββ utils/ # Utility modules
β βββ analyze.py # DOI extraction and validation
β βββ hive.py # PDF download logic
β βββ logger.py # Logging configuration
βββ cmd/ # Go implementation
β βββ main.go # Main entry point (CLI)
βββ core/ # Go core logic
β βββ check.go # DOI checking and extraction
β βββ hive.go # PDF download logic (with cache & anti-crawl)
β βββ logger.go # Log persistence
βββ scripts/ # Automation scripts
β βββ harvest.sh # Safe gradual batch download script
βββ bin/ # Compiled binaries (generated)
βββ archive/ # Input: WoS TXT files
βββ pdf/ # Output: Downloaded PDFs
β βββ downloaded.txt # Cache: successfully downloaded DOIs
β βββ not_available.txt # Cache: unavailable DOIs on Sci-Hub
β βββ logs/ # Output: Download logs (Go)
β βββ debug/ # Output: Debug HTML files
βββ error/ # Output: Error logs (Python)
βββ logs/ # Output: Application logs (Python)
βββ build.sh # Cross-platform build script
βββ pyproject.toml # Python dependencies
βββ go.mod # Go dependencies- WoS TXT file DOI extraction & validation
- Sci-Hub batch download (Python/Go dual implementation)
- Anti-crawl: browser headers, random delays, auto-retry
- DOI cache & resume support
- Safe harvest script (gradual downloading)
- Real-time progress bar & log persistence
- Multiple Sci-Hub mirror support
- Other bibliographic data sources
- Configuration file support
Contributions are welcome! Please feel free to submit a Pull Request.
This tool is for educational and research purposes only. Please respect copyright laws and publisher terms of service when downloading academic papers.

