Coder Social home page Coder Social logo

courseherounblur's Introduction

CourseHeroUnblur

Download unblurred CourseHero documents as searchable PDFs


How it works

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.

In Action

preview.mp4

Installation

Tested on Python 3.8.9

Pip packages

Install using requirements.txt:

pip install -r requirements.txt

Other third-party dependencies

Optional dependenices for selectable text in PDF (add to PATH):

Using Chocolatey

Using chocolatey, you can install these dependencies by running the following command as admin:

choco install ghostscript tesseract-ocr -y

Usage

CLI

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

Disclaimer

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.

courseherounblur's People

Contributors

daijro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.