Download unblurred CourseHero documents as searchable PDFs
This tool gathers all the avaliable previews of a document in CourseHero, then uses image manipulation to identify and switch together the unblurred parts of each page to recreate the file behind the paywall. These images are then (optionally) upscaled and saved to a OCR-scanned searchable PDF file.
preview.mp4
Tested on Python 3.8.9
Install using requirements.txt
:
pip install -r requirements.txt
Optional dependenices for selectable text in PDF (add to PATH):
Using chocolatey, you can install these dependencies by running the following command as admin:
choco install ghostscript tesseract-ocr -y
Command line arguments:
usage: CourseHeroUnblur.py [-h] -l URL [-o OUTPUT] [-n] [-s] [-p PAGES] [--open] [--debug]
Bypass the coursehero paywall
optional arguments:
-h, --help show this help message and exit
-l URL, --url URL The coursehero url to bypass
-o OUTPUT, --output OUTPUT
Output file (default file name from CourseHero)
-n, --no-ocr Don't scan PDF with OCR, won't break without GhostScript and Tesseract
-s, --sharpen Sharpens the image for better OCR output (makes images grayscale)
-p PAGES, --pages PAGES
Specify a page range (example: 1,2,3-5)
--open Opens the PDF in the default web browser
--debug Show error traceback
The purpose of this program is to provide an example of asynchronous webscraping and data gathering in Python. I am not responsible for any misuse of this tool. This tool was created strictly for educational purposes only.