FanFicFare Documentation

repository·main·Indexed 21 days ago

https://github.com/jimmxinu/fanficfare

FanFicFare is a tool for downloading fanfiction and original stories from over 100 different websites and converting them into eBook formats such as EPUB, MOBI, HTML, and plain text. It is available as a Calibre plugin and a Python-based Command Line Interface (CLI). Key features include updating existing ebooks with new chapters, handling story images and covers, and flexible configuration via .ini files or CLI options.

Tokens
2.8K
Snippets
8
Records
12
Agent score
77%

What's inside FanFicFare

  1. What is FanFicFare (FFF)?

    main
    FanFicFare (FFF) is a tool designed to download fanfiction and original stories from over 100 different websites and convert them into ebook formats. It is the successor to the project formerly known as FanFictionDownLoader (FFDL).
  2. Install FanFicFare CLI via pip

    main

    You can install the FanFicFare Command Line Interface (CLI) as a Python package using pip. This is the standard way to use FanFicFare outside of the Calibre plugin environment.

    pip install FanFicFare
  3. Install FanFicFare test versions via testpypi

    main

    If you need to test the latest changes before an official release, you can install the test version of the CLI from the testpypi repository.

    pip install --extra-index-url https://test.pypi.org/simple/ --upgrade FanFicFare
  4. Install FanFicFare with image processing support

    main

    To enable support for downloading images within story text (for EPUB and HTML formats), you must install the image_processing extra, which includes the Pillow library.

    pip install FanFicFare[image_processing]
  5. How FanFicFare handles configuration files

    main

    FanFicFare loads configuration from multiple sources with a specific priority order. Settings in files with higher priority override those in lower priority files.

    Priority Order (Lowest to Highest):

    1. defaults.ini (in the FanFicFare directory)
    2. defaults.ini in ~/.fanficdownloader/ or ~/.fanficfare/
    3. defaults.ini in $XDG_CONFIG_HOME/fanficfare/
    4. defaults.ini in the current directory (./)
    5. personal.ini in ~/.fanficdownloader/ or ~/.fanficfare/
    6. personal.ini in $XDG_CONFIG_HOME/fanficfare/
    7. personal.ini in the current directory (./)
    8. Files explicitly provided via the -c or --config flag (these take the highest priority).

    Note: The CLI also allows overriding any setting via --option NAME=VALUE.

  6. Use the FanFicFare CLI to download stories

    main

    The FanFicFare CLI allows you to download fanfiction stories from various sites into formats like EPUB, MOBI, TXT, or HTML. You can provide a single story URL or a list of URLs from a file.

    Basic Usage:

    fanficfare [STORYURL]...

    Common Tasks:

    • Download in a specific format: Use -f or --format (default is epub).
    • Download a range of chapters: Use -b or --begin and -e or --end, or append the range to the URL like STORYURL[1-5].
    • Update an existing EPUB: Use -u or --update-epub to add new chapters to an existing file.
    • Download from a file list: Use -i or --infile to specify a file containing URLs.
    • Get metadata only: Use -m or --meta-only to retrieve metadata without downloading chapters.
    fanficfare https://example.com/story/123 -f epub
  7. Configure FanFicFare via CLI options

    main

    You can override any configuration setting defined in your .ini files using the --option flag. This is useful for one-off changes like setting authentication or behavior without modifying permanent config files.

    Format:

    --option NAME=VALUE

    Example (setting adult check):

    fanficfare --option is_adult=true [STORYURL]
    --option NAME=VALUE
  8. Reference: Metadata and List Operations

    main

    Use these flags to inspect stories or extract URLs without performing a full download.

    -l, --list URL
          Get list of valid story URLs from page given.
    -n, --normalize-list URL
          Get list of valid story URLs from page given, but normalized to standard forms.
    --download-list URL
          Download story URLs retrieved from page given.
    --imap
          Get list of valid story URLs from unread email from IMAP account configured in ini.
    --download-imap
          Download valid story URLs from unread email from IMAP account configured in ini.
    -m, --meta-only
          Retrieve and write metadata to stdout without downloading or saving chapters.
    -j, --json-meta
          Output metadata as JSON with download, or with --meta-only flag.
    --json-meta-file
          Output metadata for each download as JSON to an individual file named by appending ".json" to the output_filename.
  9. Reference: FanFicFare CLI Options

    main

    The following command-line options are available for the FanFicFare CLI.

    -f, --format FORMAT
          Write story as FORMAT, epub(default), mobi, txt or html.
    -c, --config CONFIG
          Read config from specified file(s) in addition to (ordered lowest to highest priority): calibre plugin defaults.ini, calibre plugin personal.ini, ~/.fanficfare/defaults.ini, $XDG_CONFIG_HOME/fanficfare/defaults.ini, ./defaults.ini, ~/.fanficfare/personal.ini, $XDG_CONFIG_HOME/fanficfare/personal.ini, and ./personal.ini.  -c/--config files take highest priority
    -b, --begin START
          Begin story with Chapter START.
    -e, --end END
          End story with Chapter END.
    -o, --option NAME=VALUE
          Set config option NAME=VALUE  Overrides config file setting.
    -m, --meta-only
          Retrieve and write metadata to stdout without downloading or saving chapters; saves story file with titlepage only.
    -z, --no-meta-chapters
          Exclude list of chapters("zchapters") from metadata stdout output.
    -j, --json-meta
          Output metadata as JSON with download, or with --meta-only flag.
    --json-meta-file
          Similar to --json-meta, but output metadata for each download as JSON to an individual file named by appending ".json" to the output_filename.
    --no-output
          Do not download chapters and do not write output file.
    -u, --update-epub
          Update an existing epub(if present) with new chapters.  Give either epub filename or story URL.
    -U, --update-epub-always
          Update an existing epub(if present) even if there aren't new chapters.  Give either epub filename or story URL.
    --update-cover
          Update cover in an existing epub, otherwise existing cover (if any) is used on update.
    --unnew
          Remove (new) chapter marks left by mark_new_chapters setting.
    --force
          Force overwrite of an existing epub, download and overwrite all chapters.
    -i, --infile INFILE
          Give a filename to read for URLs (and/or existing EPUB files with --update-epub).
    -l, --list URL
          Get list of valid story URLs from page given.
    -n, --normalize-list URL
          Get list of valid story URLs from page given, but normalized to standard forms.
    --download-list URL
          Download story URLs retrieved from page given.
    --imap
          Get list of valid story URLs from unread email from IMAP account configured in ini.
    --download-imap
          Download valid story URLs from unread email from IMAP account configured in ini.
    -s, --sites-list
          Get list of valid story URLs examples.
    --non-interactive
          Prevent interactive prompts (for scripting).
    -d, --debug
          Show debug and notice output.
    -p, --progressbar
          Display a simple progress bar while downloading--one dot(.) per network fetch.
    --color
          Display a errors and warnings in a contrasting color.
    --mozilla-cookies COOKIEFILE
          Read and use cookies from COOKIEFILE in Mozilla/Netscape cookies.txt format.
    -v, --version
          Display version and quit.