A tool that helps you download documents from StudyLib websites for educational purposes only. Available as a browser extension, Tampermonkey script, and a bash script. Please respect copyright laws and the terms of service of StudyLib.
The downloader is now fully working on both studylib.es and studylib.net! Sorry for the delay in getting this fixed.
-
First, install the Tampermonkey browser extension if you don't have it already:
-
Install the StudyLib Downloader script:
- Click here to install StudyLib Downloader script
- When prompted by Tampermonkey, click "Install"
- Navigate to any StudyLib document page
- A "Download Document" button will automatically appear in the top-right corner
- Click the button to begin the document detection process
- A new tab will open with the document viewer
- In the document viewer, click the "Download Document" button that appears in the top-right corner
- Download the latest release and extract it
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top-right corner
- Click "Load unpacked" and select the
StudyLib-Downloader-Extensionfolder - The extension should now appear in your browser toolbar
- Download the latest release and extract it
- Open Firefox and navigate to
about:debugging#/runtime/this-firefox - Click "Load Temporary Add-on" and select any file in the
StudyLib-Downloader-Extensionfolder - The extension should now appear in your browser toolbar
- Navigate to any StudyLib document page
- Click the StudyLib Downloader icon in your browser toolbar
- Click the "Download Document" button
- The extension will automatically detect the document and begin the download
- Requires installation of Node.js and npm (additional dependencies)
- More complex setup process
- Browser-based solutions are more reliable and user-friendly
- Maintenance burden for multiple platforms
Requirements, Installation & Usage (Click to expand)
- Bash shell
- Node.js (v14+)
- npm
- Download the latest release and extract the
scraper.shscript - Make it executable:
chmod +x scraper.sh
./StudyLib-Downloader-Bash.sh <StudyLib-URL>The tools in this repository automate what could be done manually. Here's how the document extraction process works:
StudyLib documents are displayed in embedded document viewers. The actual document URL is hidden within the page. Here's how to find and download documents manually:
-
Find the document viewer URL:
- Open a StudyLib document page
- Right-click and select "View Page Source" (or press Ctrl+U)
- Search (Ctrl+F) for
viewer_next/web/study - You should find a URL that contains this pattern, often within an iframe or JavaScript code
-
Alternative method - using Developer Tools:
- Open Developer Tools (F12 or Ctrl+Shift+I)
- Go to the "Network" tab
- Reload the page (F5)
- Filter requests by typing
viewerin the filter box - Look for requests containing
viewer_next/web/study
-
Access the document viewer directly:
- Copy the complete URL you found
- Open it in a new tab
- This will take you to the document viewer page
-
Download the document:
- In the document viewer, look for the "Download" button (usually in the top-right corner)
- Click it to start the download
- The document will download in its original format (usually PDF)
- If the download button is hidden, run the following command in the developer tools console to emulate a button press:
document.getElementById("download").click();
Different StudyLib regional sites implement document delivery differently:
StudyLib.net:
- Documents are embedded in a viewer accessible via
viewer_next/web/studyURLs - Requires navigating to the viewer and clicking the download button
- The tools detect the viewer URL and automate this process
StudyLib.es:
- Implements direct PDF downloads with session-specific tokens
- The PDF URL is stored in a
<link rel="preconnect" href="...">tag in the page source - Example:
https://s2p.studylib.es/store/data/008276655.pdf?k=AwAAAZwyqMXKAAACWIoEQpaDsCYfnRGT8cXO8qcUsn4k - The session key parameter (after
?k=) changes for each access - The tools detect these direct URLs and download them directly without needing the viewer
The extension and Tampermonkey script automate this process by:
- Scanning the page for the document viewer URL using multiple detection methods
- Navigating to the document viewer URL
- Simulating a click on the download button
- Handling the download process
This automation saves time and works even on pages where the document viewer is loaded dynamically or hidden in complex JavaScript.
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC-SA 4.0) - see the LICENSE.md file for details.
