Giter Site home page Giter Site logo

bulk-pdf's Introduction

Bulk PDF downloader



* will with work for local and non-hosted PDF's *

a cli for downloading external pdf's (for lazy people like me)


Demo

Alt text


Motivation

One day I was downloading what felt like millions of PDF packages of CS notes. A couple minutes in, I got really tired of right clicking Save Link As. So I decided to build this :)

Requirements

argparse
urllib
requests
wget
python >= 3.5

Install

$ git clone https://github.com/therealAJ/bulk-pdf
$ cd bulk-pdf
$ pip install -r reqs.txt

Usage

$ python pdf.py <URL-CONTAINING-DESIRED-PDFS> <dest/which/you/want/to/download/to> [OPTIONAL-BASE-URL-FOR-HOSTED-PDFS]

Downloads discovered PDFs to specified path.


For example:

$ python pdf.py https://www.cs.ubc.ca/~schmidtm/Courses/340-F16/ ~/Desktop/Lectures
# downloads all PDFs to your `~/Desktop/Lectures` folder

Notes

Webpages have different ways of hosting PDFs, some use an absolute url, like https://hosting-site.com/hello.pdf, others host locally and have href tags looking something like \courses\cs101\hello.pdf. The second case is the reason I added the ability to give the optional url for the parent hosting site.

You may run into a url that looks like https://site.com/lectures.html. More often than not, this is where you want to use the full url to parse the entire webpage and then use https://site.com as the optional parameter to do the wget requests with.

So, an example would look like:

$ python pdf.py https://site.com/lectures.html ~/Desktop/Test https://site.com


Hopefully I haven't confused you :) File an issue if you run into anything of interest. PRs welcome :)

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.