Skip to main content

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

Project description

logo

KToolBox

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

Version PyPI Downloads GitHub Release Downloads BSD 3-Clause Last Commit codecov Documentation Status Platform Win | Linux | macOS

English | 中文

ko-fi

Features

  • Support concurrent downloading of multiple files
  • Automatically retry on API call or download failure
  • Support downloading a single post or all posts of a specified artist
  • Can update downloaded artist directories to the latest state
  • Support customizing the file and directory name format and directory structure for downloaded posts/artists
    • For example, the post directory can be set to the format [2025-01-02]_TheTitle, and image files can be named sequentially as 1.jpg, 2.jpg, etc.
    • If you want to store all images from an artist's posts in a single directory for preview, you can use the job.mix_posts config option with a custom filename format to get a directory with hundreds or thousands of images
      • Such as [2025-01-02]_TheTitle_1.jpg, [2025-01-02]_TheTitle_2.jpg, [2025-01-02]_TheTitle_3.jpg, etc.
  • Support excluding specified file formats or downloading only specified formats
    • For example, if you don't want to download large and duplicate PSD or archive files, you can exclude .psd and .zip files in the config
  • Support filtering downloads by file size
    • For example, if you want to avoid downloading large video files when running out of disk space, you can set a maximum file size limit in the config
    • You can also set a minimum file size to skip downloading thumbnail or preview images
  • Support filtering downloads by post title keywords
    • For example, if you only want to download posts whose titles contain "表情" or "効果音差分", you can use the sync-creator command with the --keywords option
    • You can also exclude posts with specific keywords in the title using the --keywords-exclude option
  • Support filtering downloads by post publish date range
  • Can parse and download images contained in the multi-info text of the post page HTML
    • These posts are characterized by images not loading immediately when the browser enters the page, and no preview images
  • Can collect cloud drive links listed on the post page and save them to a text file
  • Can search for artists and posts, and export results
    • If you want to process artist and post data yourself, you can use this feature to export JSON data
  • Cross-platform support, with iOS shortcuts provided
    • The pure Python branch can run on iOS a-Shell or in the browser via Pyodide
  • For Coomer.st / Coomer.su / Coomer.party support, please refer to the documentation Coomer

Dev Plan

  • GUI
  • Discord support

Tutorial

See documentation for more details.

Installation

You can use executables from releases page

Manually install:

  • Recommend

    pip3 install pipx
    
    # Windows
    pipx install "ktoolbox[urwid,winloop]"
    # Linux / macOS
    pipx install "ktoolbox[urwid,uvloop]"
    
  • For a-Shell or pyodide, or if you can only use pure Python and you cannot compile pydantic v2.x.x

    pip3 install ktoolbox-pure-py
    

Command

For more information, use the help command or goto Command page.

❓ Get general help

ktoolbox -h

❓ Get help of a command

ktoolbox download-post -h

⬇️🖼️ 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 posts from a creator

# Download all posts of the creator/artist
ktoolbox sync-creator https://kemono.su/fanbox/user/9016

# Download latest 10 posts of the creator/artist
ktoolbox sync-creator https://kemono.su/fanbox/user/9016 --length=10

# Download latest No.11-No.15 posts of the creator/artist
ktoolbox sync-creator https://kemono.su/fanbox/user/9016 --offset=10 --length=5

# Download posts from the creator/artist from 2024-1-1 to 2024-3-1
ktoolbox sync-creator https://kemono.su/fanbox/user/9016 --start-time=2024-1-1 --end-time=2024-3-1

# Download posts from the creator/artist whose title contains "表情"
ktoolbox sync-creator https://kemono.su/fanbox/user/9016 --keywords "表情"

# Download posts from the creator/artist whose title contains "表情" or "効果音差分"
ktoolbox sync-creator https://kemono.su/fanbox/user/9016 --keywords "表情,効果音差分"

Configuration

  • Download 10 files at the same time
  • Rename attachments in numerical order, e.g. 1.png, 2.png, ...
  • Prefix the post directory name with its release/publish date, e.g. [2024-1-1]HelloWorld
  • Use the post title as the prefix for file names, e.g. HelloWorld_1.png, HelloWorld_2.png, ...
  • Download revisions of posts
  • Exclude .psd and .zip files
  • Extract cloud drive links from posts and save them to a text file
  • ...

Goto Configuration-Guide page for more details.

KToolBox Configuration Editor KToolBox Configuration Editor

iOS Shortcuts

Goto Shortcuts for iOS page for more details.

Other Branches

  • Pure Python branch: 🔗pure-py
    • Use pydantic v1 so that cargo is not needed for installation
    • For example, you can use it on iOS terminal App a-Shell
    • 🔗PyPI
  • Development branch: 🔗devel

Code Coverage

codecov.io

License

KToolBox is licensed under BSD 3-Clause.

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.24.0.tar.gz (52.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ktoolbox-0.24.0-py3-none-any.whl (64.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ktoolbox-0.24.0.tar.gz
  • Upload date:
  • Size: 52.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for ktoolbox-0.24.0.tar.gz
Algorithm Hash digest
SHA256 2be1dfd17bb3633d50ca1e63d31eaf943c64cccd4a34e571435f86356ecefa73
MD5 f87c9f6bdae18fe5f8477829ad3abc9e
BLAKE2b-256 74160309023dc9414936ba3cdcedb26325d690fcb36b452d0686cff7c2b2985d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ktoolbox-0.24.0-py3-none-any.whl
  • Upload date:
  • Size: 64.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for ktoolbox-0.24.0-py3-none-any.whl
Algorithm Hash digest
SHA256 123df55a68dde46003049c47dfce1f3717dab91df2af0f4b506ca848f9b5c69b
MD5 c25872cae31c0ffab08a990a0b4b23bd
BLAKE2b-256 971b8a778a355b8fc55987a343cd8d11391527367f79d436fd52a463345aca5f

See more details on using hashes here.

Supported by

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