A fiction downloader, capable of retrieving works of fiction from the net and saving them in afew common file formats.
Project description
fiction-dl (1.5.0)
fiction-dl is a command-line utility made for downloading works of fiction from the web, capable of auto-formatting and saving them in a few common file formats. It requires a Python interpreter installed, version 3.8 or higher.
The application supports more than a dozen websites, generates HTML, EPUB, MOBI, ODT and PDF output files, applies typographic corrections to the extracted content and is able to embed downloaded images within it.
Table of Contents
Features
Downloading stories
fiction-dl can download stories from a multitude of sites - in some cases, it also supports downloading all stories published by any specific user (which is called downloading stories from a channel).
Category | Site | Authentication support | Channel support |
---|---|---|---|
fanfiction | Archive of Our Own | ✗ no | ✓ yes |
fanfiction | FanFiction.net | ✗ no | ✓ yes |
fanfiction | FicWad.com | ✗ no | ✓ yes |
fanfiction | SpaceBattles.com | ✓ yes | ✗ no |
fanfiction | SufficientVelocity.com | ✓ yes | ✗ no |
fanfiction | AlternateHistory.com | ✓ yes | ✗ no |
fanfiction | QuestionableQuesting.com | ✗ no | ✗ no |
original fiction | Fiction Press | ✗ no | ✓ yes |
original fiction | ✓ yes | ✗ no | |
erotica | AdultFanFiction | ✗ no | ✗ no |
erotica | Literotica | ✗ no | ✓ yes |
erotica | Hentai Foundry | ✗ no | ✓ yes |
erotica | NajlepszaErotyka.com.pl | ✗ no | ✗ no |
It is also capable of reading stories saved in text files. You can put the HTML-formatted story in a raw text file and use fiction-dl to translate it to some more civilized format.
Formatting stories
Downloaded stories are auto-formatted and saved in a few file formats:
File Format | Requirements |
---|---|
HTML (.html) | None. |
EPUB (.epub) | None. |
MOBI (.mobi) | Calibre installed on the machine. |
OpenDocument (.odt) | None. |
Portable Document Format (.pdf) | LibreOffice installed on the machine. |
Embedding images
The application can download images found in story content and embed them in output files.
Typographic corrections
fiction-dl automatically applies basic typographic corrections to the content of downloaded stories.
Source Text | Corrected Text |
---|---|
Lorem ipsum... dolor. | Lorem ipsum… dolor. |
Lorem ipsum...dolor. | Lorem ipsum… dolor. |
Lorem ipsum...... dolor. | Lorem ipsum… dolor. |
Lorem ipsum , dolor. | Lorem ipsum, dolor. |
Lorem ipsum????? Dolor. | Lorem ipsum? Dolor. |
Lorem ipsum - dolor. | Lorem ipsum — dolor. |
Installation
You can install fiction-dl using pip:
python3 -m pip install --upgrade fiction-dl
(If the package's already installed, this command will also update it.)
If you're running a Debian-derived Linux distribution, you might also need to install the following packages:
apt-get install libgl1-mesa-glx libglib2.0-0 libmupdf-dev
(fiction-dl uses OpenCV for processing downloaded images, which requires them to be installed. PyMuPDF requires libmupdf-dev when it's being built from the source.)
Usage
To download a story from a URL, simply type:
fiction-dl URL
In order to download multiple stories, create a text file and place the URLs in it, each one in a separate line. Then type:
fiction-dl YourFilesName
Options
Option | Result |
---|---|
-h | shows the overview of command-line options |
-a | authenticates the user to supported sites using interactive mode |
-c | clears the cache before launching the application |
-v | enables the (more) verbose mode |
-f | overwrites output files (in case they already exist) |
-d | enables debug mode (saves some data useful for debugging) |
-no-images | disables downloading images found in story content |
-persistent-cache | preserves the cache after the application quits |
-lo | used to specify the path to the LibreOffice executable (soffice.exe) |
-o | used to specify the output directory path |
Text File Extractor
Create a text file meant to contain the story. In its first lines type:
LOCAL TEXT STORY
*URL*
*The Title of the Story*
*The Author*
*The One-Line Summary*
Follow it by the story's content, wrapped in HTML tags. Then call:
fiction-dl FilePath.txt
You can insert chapter-breaks in the story by typing "CHAPTER BREAK LINE" in an empty line.
License
GNU GPL 3. The text of the license is provided in the LICENSE file.
Technical
Changelogs
All the changelogs can be found in the Docs/Changelogs.md file.
Documentation
You can generate code documentation using Doxygen; the relevant configuration file is Docs/Docs.doxygen. Generated files will appear in the Docs/Code Documentation directory.
Tests
Launching the Integration Test can be done by entering the Tests directory and executing the following code:
python "Integration Test.py"
In order to launch unit tests, enter the Tests directory and execute:
python "Unit Tests.py"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for fiction_dl-1.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbe459d01ede6e44de9b92df1ccf1138ace65db0f6e38f0f2028ed9c118c951a |
|
MD5 | 7e465b4b01a4ba101907338235a5885b |
|
BLAKE2b-256 | 482eaf02ca9d37c0635614f573982025e950a5cb5b9f044ce36dba3548b397ea |