Komiflo Image Unscrambler
komiflo_unscrambler.py is a small Python script for restoring Komiflo scrambled page images using:
user.jsoncontent_response.json- the scrambled page image itself
The implementation is pure Python and only depends on Pillow for image processing.
| Scrambled | Unscrambled |
|---|---|
![]() |
![]() |
- Python 3.10 or later
- See
requirements.txtfor Python dependencies
This script expects the following files:
Get this from:
https://api.komiflo.com/session/user
Get this from:
https://api.komiflo.com/content/id/<target_content_id>
This is the scrambled page image that corresponds to the page you want to restore.
If you do not specify --image, the script will try to infer the local filename from content_response.json.
For example, if imgs[0].filename is https://.../abcdef.jpg?..., the script will look for:
abcdef.jpg
in the output directory or script directory.
pip install -r requirements.txtPlace these files in the same directory as komiflo_unscrambler.py, or pass their paths explicitly:
user.jsoncontent_response.json- scrambled image file such as
abcdef.jpg
Default file names:
user.json
content_response.json
Before restoring an image, you can inspect the available page indices:
python komiflo_unscrambler.py --list-pagesIf your JSON files are stored elsewhere:
python komiflo_unscrambler.py --user-json path/to/user.json --content-json path/to/content_response.json --list-pagesBasic example:
python komiflo_unscrambler.py --page 0 --image scrambled_page0.jpgSpecify an output file:
python komiflo_unscrambler.py --page 0 --image scrambled_page0.jpg --output output/unscrambled_page0.jpgSpecify JPEG quality:
python komiflo_unscrambler.py --page 0 --image scrambled_page0.jpg --quality 100 --output output/unscrambled_page0.jpgUse custom JSON paths:
python komiflo_unscrambler.py --user-json data/user.json --content-json data/content_response.json --page 1 --image images/page1.jpg --output output/page1_restored.jpgIf the image filename already matches the filename in content_response.json, --image can be omitted:
python komiflo_unscrambler.py --page 0 --output-dir outputIn that case, the script searches for the input image using the filename stored in content_response.json, rooted at --output-dir.
import json
from komiflo_unscrambler import decrypt
with open("user.json", "r", encoding="utf-8") as f:
user = json.load(f)
with open("content_response.json", "r", encoding="utf-8") as f:
content = json.load(f)
result = decrypt(
user_dict=user,
content_dict=content,
page="0",
image_path="scrambled_page0.jpg",
output_path="output/unscrambled_page0.jpg",
quality=100,
)
print(result["output_path"])pageis handled as the page index found in the decrypted page map and usually corresponds tocontent_response.jsoninsideimgs.qualityis the JPEG save quality. The default is95.--list-pagesis useful when you want to confirm page numbers, width, height, and seed before running the actual restore.- The script does not download images by itself. Prepare the scrambled image file beforehand.
If the script fails, first check:
user.jsonreally comes fromhttps://api.komiflo.com/session/usercontent_response.jsonreally comes fromhttps://api.komiflo.com/content/id/<target_content_id>- the scrambled image matches the selected page
- the local image filename matches the filename recorded in
content_response.jsonwhen--imageis omitted

