reserves-lib-tsinghua-downloader: A Comprehensive Tool for Tsinghua Reserve Library
The reserves-lib-tsinghua-downloader is a convenient and efficient tool designed to facilitate the downloading of academic reference materials from the Tsinghua University's Reserve Library services. The project caters primarily to students and faculty who necessitate access to these resources in an easy and streamlined manner. This tool embodies certain technical features and operational steps, thoroughly explaining how to make the best use of its capabilities.
Purpose and Functionality
At its core, this downloader assists in retrieving the original images of book pages from https://ereserves.lib.tsinghua.edu.cn/, and seamlessly compiles them into PDF files. This function requires users to log in using their credentials to obtain a token due to the Single Sign-On (SSO) integration of the new teaching reference platform. Users can be assured that their sensitive information, such as login credentials, will not be accessed or stored by the tool.
Setup and Installation
Users can download the appropriate executable file for their operating systems from the Releases section of the GitHub repository. Alternatively, the Python script downloader.py
can be executed directly.
Token Acquisition
Upon running the tool, a webpage will open where users may log in to Tsinghua's system using SSO to acquire a token necessary for accessing resources. This token is vital for the tool's operation and is saved in a token.txt
file in the same directory as the program. Tokens are valid for one hour, necessitating re-login if they expire.
How to Use
When the application launches, users input the URL of the book details from the Tsinghua teaching reference site. The tool will automatically scrape the required pages, saving images in the clawed
folder, and subsequently generating a PDF document for the user's convenience.
Special Instructions for macOS Users
macOS users may face difficulties running the downloader due to execution permissions or security settings. These can be resolved by setting appropriate permissions using the chmod +x downloader
command or navigating to Security & Privacy
settings to grant permission.
Troubleshooting and FAQs
- Image Quality: Set image quality from 1 to 96 in the tool, where 96 means no compression.
- Python Issue: Ensure using Python version 3.9 or above to avoid errors like
'type' object is not subscriptable
. - Download Issues: Tsinghua's platform may block your IP temporarily if you download resources too quickly. Use the
-i
option to set intervals between downloads to mitigate this.
Advanced Features
Users can further control the downloading behavior with several command-line options:
- Specify multiple concurrent downloads
- Set interval times between download batches
- Opt-out of PDF generation if only images are needed
Upcoming Enhancements
The project plans to incorporate additional features, such as translations, extracting pure text from the website, and adding bookmarks to PDFs.
Contributing and Community
Contributions from the community are greatly appreciated. Interested individuals can check out the contribution guidelines. The project also welcomes new maintainers, and interested parties are encouraged to contact via email.
The reserves-lib-tsinghua-downloader tool is designed for use at one's own discretion and risk. For more Tsinghua University-related services, users can explore further resources provided here.