Skip to main content

Live demo: https://pytaku.imnhan.com (db may be hosed any time, also expect bugs)

Production instance coming When It's Ready (tm).

Pytaku

Pytaku is a WIP web-based manga reader that keeps track of your reading progress and new chapter updates. Its design goals are:

  • Self-host friendly - if you have a UNIX-like server with python3.11+ and can run pip install, you're good.

  • Phone/tablet friendly - although I hardly read any webtoons these days so the phone experience may not be as polished.

  • KISSFFS, or Keep It reaSonably Simple you F-ing architecture/tooling FetishiSts! Oftentimes I have enough practice on industrial grade power tools at work so at home I want a change of pace. Flask + raw SQL has been surprisingly comfy. On the other side, mithril.js provides a good baseline of SPA functionality without having to pull in the Rube Goldberg machine that is """modern""" JS devtools.

Keyboard shortcuts

On Chapter page, press ? to show keyboard shortcuts.

Development

## Backend ##
uv sync

pytaku-generate-config > pytaku.conf.json
# fill stuff as needed

# run migration script once
pytaku-migrate

# run 2 processes:
pytaku-dev -p 8000  # development webserver
pytaku-scheduler  # scheduled tasks e.g. update titles


## Frontend ##

sudo pacman -S entr esbuild

# Listen for changes in js-src dir, automatically build minified bundle:
find src/pytaku/js-src -name '*.js' | entr -rc ./build.py js

We use build.py as a less annoying Makefile.

Optional proxy

Weebcentral's previous incarnation, mangasee, used to deploy a somewhat aggressive cloudflare protection level that cloudscraper alone couldn't bypass. So I had to send requests through a crappy GAE-based proxy. Apparently it isn't necessary anymore.

FWIW, in order to use it, you'll need to deploy your own gae-proxy on Google App Engine, then fill out OUTGOING_PROXY_NETLOC and OUTGOING_PROXY_KEY accordingly.

Yes it's not a standards-compliant http(s) proxy so you can't just use yours. I chose the cheapest (free) way to get a somewhat reliable IP-rotating proxy.

Tests

Can be run with just pytest. It needs a pytaku.conf.json as well.

Code QA tools

  • Python: ruff
  • JavaScript: jshint, prettier
sudo pacman -S ruff prettier
npm install -g --prefix ~/.node_modules jshint

Production

I'm running my instance on Debian 12, but any unix-like environment with these should work:

  • python3.11+
  • the rest are all pypi packages that should be automatically installed when you run pip install pytaku

The following is a step-by-step guide on Debian 12 using pipx for demonstration purposes. It's possible to use any python isolation technique (virtualenv, venv, etc.) - personally I'm running pytaku in production using a venv.

sudo apt install pipx
pipx install pytaku
# you now have access to pytaku commands

pytaku-generate-config > pytaku.conf.json
# fill stuff as needed

# run migration script once
pytaku-migrate

# run 2 processes:
pytaku -w 7  # production web server - args are passed as-is to gunicorn
pytaku-scheduler  # scheduled tasks e.g. update titles

# don't forget to setup your proxy, same as in development:
# https://git.sr.ht/~nhanb/gae-proxy

# upgrades:
pipx upgrade pytaku
pytaku-migrate
# then restart `pytaku` & `pytaku-scheduler` processes

If you're exposing your instance to the internet, I don't have to remind you to properly set up a firewall and a TLS-terminating reverse proxy e.g. nginx/caddy, right?

Alternatively, just setup a personal tailscale network and let them worry about access control and end-to-end encryption for you.

Optional optimization

With the setup above, you're serving static assets using gunicorn, which is not ideal performance-wise. For private usage this doesn't really matter. However, if you want to properly serve static assets using nginx and the like, you can copy all static assets into a designated directory with:

pytaku-collect-static target_dir

This will copy all assets into target_dir/static. You can now instruct nginx/caddy/etc. to serve this dir on /static/* paths.

LICENSE

Copyright (C) 2021 Bùi Thành Nhân

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Metadata

Release files for pytaku 0.8.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytaku 0.8.2
File Size Uploaded Provenance Actions
pytaku-0.8.2.tar.gz 143.1 kB Without provenance Details for pytaku-0.8.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytaku 0.8.2
File Interpreter ABI Platform Actions
pytaku-0.8.2-py3-none-any.whl Python 3 none any Details for pytaku-0.8.2-py3-none-any.whl

Total release size: 300.3 kB

Release files / pytaku-0.8.2.tar.gz

Download URL pytaku-0.8.2.tar.gz
Size 143.1 kB
Tags Source
SHA-256 checksum
How to use checksums
33bcdc239f206eb8b518156acee6b7974b340aeef64c01929e0544a0e9438013
BLAKE2b-256 checksum
How to use checksums
351dd620607a73b890d0e05053e5f18fd8810fa15f4279b037b91b4a868093ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.17

Release files / pytaku-0.8.2-py3-none-any.whl

Download URL pytaku-0.8.2-py3-none-any.whl
Size 157.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bfa16d9a980675a5a5ade2fea1c7e4768c13bdb06a121eae63fe7e137db599c
BLAKE2b-256 checksum
How to use checksums
31e3a7a199a202b068e28789024e77eda23b50df09d74706354577aae79d5026
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.17

Security for pytaku 0.8.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page