Skip to content

Commit

Permalink
Add a docker image & documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasBora committed Jan 31, 2018
1 parent b99d034 commit b42228d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
FROM ubuntu:16.04
# To build this image, run:
# To use the online image, use:
# $ sudo docker run -it --shm-size 2g -v $(pwd):/host -w /host tobiasbora/scribd-downloader:18.01 bash
# And then inside the container (don't forget xvfb):
# $ xvfb-run ./scribd_downloader_3.py "https://www.scribd.com/doc/63942746/chopin-nocturne-n-20-partition" out.pdf

# If you want to build this image, run:
# $ sudo docker build -t scribd-d .
# And to run it:
# $ docker run -it --shm-size 2g scribd-d bash
# $ sudo docker run -it --shm-size 2g -v $(pwd):/host -w /host scribd-d bash
# And then inside the container (don't forget xvfb):
# $ xvfb-run ./scribd_downloader_3.py "https://www.scribd.com/doc/63942746/chopin-nocturne-n-20-partition" out.pdf

Expand Down
28 changes: 27 additions & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,28 @@ This script is a very short python script whose aim is to download scribd docume

** Installation

To use this script you first need to make sure that =firefox=, =python3= and the python libraries =selenium= and =fpdf= are installed (sorry, I may forget one library, if you have a problem, contact me to [email protected]):
Depending on what you need, you have several ways to install this script. Or you can use the online docker image (slower, but you are sure to have the good firefox/selenium/geckodriver version), or you can just install the python deps yourself and run it.

*** Method 1: classic install with pip

To use this script you first need to make sure that =firefox=, =python3= and the python libraries =selenium= and =fpdf= are installed. Note that it may be better to setup all of these library inside a =virtualenv= to avoid version clash.

On debian-like systems, you can proceed using something like this:
: sudo apt install firefox python3 python3-pip
: sudo pip3 install selenium
: sudo pip3 install fpdf
: sudo pip3 install Pillow

And if you prefer the =virtualenv= version (make sure you are in an empty folder):
: sudo apt install firefox python3 python3-pip
: pip3 install --user virtualenv
: pip3 install --upgrade virtualenv
: virtualenv -p python3 venv
: source venv/bin/activate
: pip3 install selenium
: pip3 install fpdf
: pip3 install Pillow

Then, download this script :
: git clone https://github.com/tobiasBora/scribd-downloader-3.git

Expand All @@ -24,6 +38,18 @@ as well as the last driver geckodriver available at https://github.com/mozilla/g

Great, you can now use the script !

*** Method 2: docker (only on 64bit systems)

First, make sure you have a recent [[https://docs.docker.com/install/][docker installed]] (the docker in the repository are outdated most of the time). Then, just run:
: sudo docker run -it --shm-size 2g -v $(pwd):/host -w /host tobiasbora/scribd-downloader:18.01 bash

It will download the online docker image, mount your local folder in =/host=, and run a bash in this folder (the =--shm-size= is very important if you don't want firefox to crash). Then, you can simply run this command (don't forget the =xvfb-run=):
: xvfb-run scribd_downloader_3.py <your url> <your pdf.pdf>

Ex:
: xvfb-run scribd_downloader_3.py "https://www.scribd.com/doc/63942746/chopin-nocturne-n-20-partition" out.pdf


** Features
- convert into a pdf file an online scribd document
- deal with blured pages that would require an account
Expand Down

0 comments on commit b42228d

Please sign in to comment.