Skip to main content

A useful CLI tool for downloading posts in Kemono.party / .su

Project description

logo

KToolBox

KToolBox is a useful CLI tool for downloading posts content in Kemono.party / Kemono.su

Version MIT Last Commit codecov Platform Win | Linux | macOS

English | 中文

Preview

Features

  • You can download all files from a specific post from Kemono
  • Or download all post from a specific creator / artist from Kemono
  • Sync the downloaded creator / artist directory to latest,
    download the posts that recently updated or published only
  • Search creator and post, then dump the results
  • Concurrently download the files
  • Support all platform

Dev Plan

  • Add a Fluent Design style GUI
  • Add uvloop support for Unix platform

Tutorial

iOS Shortcuts (Optional)

  • You can run KToolBox using iOS terminal App a-Shell
  • These shortcuts can automatically install KToolBox and download posts in a-Shell
    • You can trigger "Download Kemono Post" by web page share view, or run directly in Shortcuts App
  • Visit shortcut URLs below or download shortcut files at shortcuts/

English

Chinese

Command

For more information, use the help command.

[!Warning] The return text here are only demo, some of them may be outdated.

  • Install KToolBox:

    pip3 install ktoolbox
    
    • For a-Shell:
      pip3 install ktoolbox-pure-py
      
  • Get general help:

    ktoolbox -h
    
    Return
          
    INFO: Showing help with the command '__main__.py -- --help'.
    
    NAME __main__.py
    SYNOPSIS __main__.py COMMAND | -
    COMMANDS COMMAND is one of the following:
    download_post Download a specific post
    ...
    sync_creator Sync all posts from a creator
    version Show KToolBox version

    To get more information, see KToolBoxCli in ktoolbox/cli.py.

  • Get help of a command:

    ktoolbox download-post -h
    
    Return
          
    NAME
        __main__.py sync-creator - Sync all posts from a creator
    
    SYNOPSIS __main__.py sync-creator <flags>
    DESCRIPTION You can update the directory anytime after download finished, such as to update after creator published new posts. * If `update_from` was provided, it should be located **inside the creator directory**.
    FLAGS -u, --url=URL Type: Optional[str] Default: None The post URL ...
  • Download a specific post:

    ktoolbox download-post https://kemono.su/fanbox/user/49494721/post/6608808
    

    If some files failed to download, you can try to execute the command line again,
    the downloaded files will be skipped.

  • Download all posts from a creator:

    ktoolbox sync-creator https://kemono.su/fanbox/user/9016
    

    By default, you will get a creator-indices.ktoolbox file in the creator directory,
    you can use it to update the directory anytime.

  • Update a downloaded creator directory:

    ktoolbox sync-creator https://kemono.su/fanbox/user/641955 --update-with=./xxx/creator-indices.ktoolbox
    

    The creator-indices.ktoolbox file contains the information and filepath of posts inside the directory.

Configuration

  • KToolBox read prod.env file in the work folder or environment variables to store configuration
  • All configuration options defined in ktoolbox/configuration.py
  • Use __ to specify the sub option, like KTOOLBOX_API__SCHEME means api.scheme
  • All configuration options are optional

prod.env file example

# Download 10 files at the same time.
KTOOLBOX_JOB__COUNT=10

# Allocate 102400 Bytes as buffer for each download job
KTOOLBOX_DOWNLOADER__BUFFER_SIZE=102400

# Set post attachments directory path as `./`, it means to save all attachments files in post directory
# without making a new sub directory to storage them
KTOOLBOX_JOB__POST_STRUCTURE__ATTACHMENTS=./

# Disable SSL certificate verification for Kemono API server and download server
# It's useful when certificate on Kemono server expired. (SSL: CERTIFICATE_VERIFY_FAILED)
KTOOLBOX_SSL_VERIFY=False

Other Branches

About Kemono

Description from https://kemono.su :

Kemono is a public archiver for:

  • Patreon
  • Pixiv Fanbox
  • Discord
  • Fantia
  • Afdian
  • Boosty
  • DLsite
  • Gumroad
  • SubscribeStar

Contributors here upload content and share it here for easy searching and organization.
To get started viewing content, either search for creators on the artists page, or search for content on the posts page.

Code Coverage

codecov.io

License

KToolBox is licensed under MIT.

Copyright © 2023 by Ljzd-PRO.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ktoolbox-0.2.2.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

ktoolbox-0.2.2-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file ktoolbox-0.2.2.tar.gz.

File metadata

  • Download URL: ktoolbox-0.2.2.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1016-azure

File hashes

Hashes for ktoolbox-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ff4d9b1a822a5fb29ba26648fbee66f4f11810ca7d3033ad3e96ee7ca3861641
MD5 c3737adba94fc0c472c9aaf3e8cbc967
BLAKE2b-256 da5c65ae0300c8f7f82c937c3008d00d49fb2561740e138ff253ee14a9d7cba4

See more details on using hashes here.

Provenance

File details

Details for the file ktoolbox-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: ktoolbox-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/6.2.0-1016-azure

File hashes

Hashes for ktoolbox-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a89d6d1f1dd1397d926512cac3677f08f52c4d8a9d9afa847c155483195eb477
MD5 d93f2dec2a8901c20e3f2ca5ad290f31
BLAKE2b-256 5a7e07ad655b7b066fdeb4e73189d25b696747341bcb5a57138dc08d4a3e5eeb

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page