muse-dl/README.md

89 lines
3.9 KiB
Markdown
Raw Permalink Normal View History

2020-04-21 14:04:39 +00:00
# muse-dl ![Travis (.org)](https://img.shields.io/travis/captn3m0/muse-dl) ![GitHub issues](https://img.shields.io/github/issues/captn3m0/muse-dl) ![GitHub issues by-label](https://img.shields.io/github/issues/captn3m0/muse-dl/bug?color=red&label=open%20bugs) ![GitHub](https://img.shields.io/github/license/captn3m0/muse-dl) ![GitHub top language](https://img.shields.io/github/languages/top/captn3m0/muse-dl) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com) ![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/captn3m0/muse-dl) ![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/captn3m0/muse-dl) ![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/captn3m0/muse-dl)
2020-03-28 19:29:47 +00:00
2020-03-29 18:52:59 +00:00
Download PDFs from Project MUSE and stitch them together into a single-file using [`pdftk`](https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/).
2020-03-29 21:09:49 +00:00
# :warning: WARNING :warning:
Any downloads you perform with this tool are for your own usage. I personally hate reading PDFs on a browser, this lets me read them much more easily offline. This is just for personal use.
2020-03-28 19:29:47 +00:00
# Installation
2020-04-03 22:09:46 +00:00
## Linux / Build
2020-03-29 18:52:59 +00:00
```
git clone https://github.com/captn3m0/muse-dl.git
cd muse-dl
shards install
shards build
./bin/muse-dl --help
```
2020-04-03 22:09:46 +00:00
## Linux / Download
A linux x86_64 static build is available in the latest release: <https://github.com/captn3m0/muse-dl/releases/latest>. Save the file as `muse-dl` and remember to mark it as executable (`chmod +x`).
## Docker
A docker image is available at `captn3m0/muse-dl` on Docker Hub. The working directory for the image is set as `/data`, so you'll need to mount your output-directory as `/data` for it to work. Sample invocations;
```
# Download the book, and put it in your Downloads directory
2020-04-04 23:11:49 +00:00
docker run -it /home/nemo/Downloads:/data captn3m0/muse-dl:edge https://muse.jhu.edu/book/875
2020-04-03 22:09:46 +00:00
2020-05-13 20:01:38 +00:00
# If you have a list.txt file in your Downloads directory, then you can run
2020-04-04 23:11:49 +00:00
docker run -it /home/nemo/Downloads:/data captn3m0/muse-dl:edge /data/list.txt
2020-04-03 22:09:46 +00:00
# If you want to keep the temporary files with your host, and not delete them
2020-04-04 23:11:49 +00:00
docker run -it /home/nemo/Downloads:/data /tmp:/musetmp captn3m0/muse-dl:edge --tmp-dir /musetmp --no-cleanup https://muse.jhu.edu/book/875
2020-04-03 22:09:46 +00:00
```
2020-04-04 23:11:49 +00:00
Replace edge with the latest version number if you'd like to run a tagged release.
2020-04-03 22:21:18 +00:00
### Docker Images
The following images are available:
- `edge`: Run `muse-dl` against latest master.
- `edge-static`: Get the pre-built static-binary against latest master.
2021-06-04 08:26:51 +00:00
- `v1.3.1`: Run `muse-dl` against the specific release.
- `v1.3.1-static`: Get the pre-built static binary against the specific release.
2020-04-03 22:21:18 +00:00
2020-03-29 18:52:59 +00:00
## Requirements
2020-04-03 22:09:46 +00:00
Please ensure you have `pdftk` installed, unless you're running via docker.
2020-03-28 19:29:47 +00:00
## Usage
```
2020-03-29 21:03:55 +00:00
Usage: muse-dl [--flags] [URL|INPUT_FILE]
URL: A link to a book on the Project MUSE website, eg https://muse.jhu.edu/book/875
INPUT_FILE: Path to a file containing a list of links
2020-03-29 14:04:51 +00:00
--no-cleanup Don't cleanup temporary files
--tmp-dir PATH Temporary Directory to use
--output FILE Output Filename
--no-bookmarks Don't add bookmarks in the PDF
2020-07-01 12:59:22 +00:00
--clobber Overwrite the output file, if it already exists.
2020-05-13 20:01:38 +00:00
--dont-strip-first-page Disables first page from being stripped. Use carefully
2020-03-29 21:03:55 +00:00
--cookie COOKIE Cookie-header
2020-03-29 14:04:51 +00:00
-h, --help Show this help
2020-03-28 19:29:47 +00:00
```
2020-03-29 18:52:59 +00:00
## Sample Run
```
muse-dl https://muse.jhu.edu/book/875
Saved final output to Accommodating Revolutions- Virginia's Northern Neck in an Era of Transformations, 1760-1810.pdf
```
2020-03-29 21:03:55 +00:00
Alternatively, if you pass a `input-file.txt` ([sample](https://paste.ubuntu.com/p/myBkNn6DSP/)), you can pass it as the sole parameter.
`muse-dl input.txt`
And it will download all the links in that file.
2020-03-28 19:29:47 +00:00
## License
2020-05-13 20:01:38 +00:00
Licensed under the [MIT License](https://nemo.mit-license.org/). See LICENSE file for details.