1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2025-12-25 09:45:39 +01:00
No description
Find a file
Will Oursler b78f3c0c77 Fix up the FictionPress site handler.
Updates the comment to a valid fictionpress story. Changes the matches method so it works like the one for FFN. As it is now, it didn't work for me. After this, works on the provided URL and several variants.
2017-10-06 12:28:31 -04:00
sites Fix up the FictionPress site handler. 2017-10-06 12:28:31 -04:00
.editorconfig Set up for Travis 2017-02-08 13:20:14 -06:00
.flake8 Set up for Travis 2017-02-08 13:20:14 -06:00
.gitignore Changed mind for arbitrary: JSON definitions 2017-04-24 22:02:16 -05:00
.travis.yml Force latest node in Travis 2017-04-24 01:42:50 -05:00
cover.py Cover text: outlined 2017-02-23 14:40:55 -06:00
epub.py Set up for Travis 2017-02-08 13:20:14 -06:00
leech.py Fix travis eclint call 2017-04-24 01:24:13 -05:00
README.markdown Support FictionPress 2017-02-03 11:00:25 -06:00
requirements.txt Upgrade requirements 2017-09-08 11:49:30 -05:00

Leech

Let's say you want to read some sort of fiction. You're a fan of it, perhaps. But mobile websites are kind of non-ideal, so you'd like a proper ebook made from whatever you're reading.

Setup

You need Python 3.

My recommended setup process is:

$ pyvenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

...adjust as needed. Just make sure the dependencies from requirements.txt get installed somehow.

Usage

$ python3 leech.py [[URL]]

A new file will appear named Title of the Story.epub.

If you want to put it on a Kindle you'll have to convert it. I'd recommend Calibre, though you could also try using kindlegen directly.

Supports

  • Fanfiction.net
  • FictionPress
  • ArchiveOfOurOwn
    • Yes, it has its own built-in EPUB export, but the formatting is horrible
  • Various XenForo-based sites: SpaceBattles and SufficientVelocity, most notably
  • DeviantArt galleries/collections
  • Sta.sh

Configuration

A very small amount of configuration is possible by creating a file called leech.json in the project directory. Currently you can define login information for sites that support it.

Example:

{
    "logins": {
        "QuestionableQuesting": ["username", "password"]
    }
}

Extending

To add support for a new site, create a file in the sites directory that implements the Site interface. Take a look at ao3.py for a minimal example of what you have to do.

Contributing

If you submit a pull request to add support for another reasonably-general-purpose site, I will nigh-certainly accept it.

Run EpubCheck on epubs you generate to make sure they're not breaking.