Skip to main content

Wuxia-themed terminal client for streaming Chinese animation

Project description

Donghua CLI

A fast, Wuxia-themed terminal client for streaming and downloading Chinese animation (Donghua). Searches multiple sources simultaneously, auto-selects the best server, and plays via MPV/VLC.

PyPI Python 3.9+ License: MIT


Install

pip install donghua-cli

That's it. Works on Linux, macOS, Windows, and Android (Termux).

You also need a video player:

OS Install player
Ubuntu/Debian sudo apt install mpv
Fedora sudo dnf install mpv
Arch sudo pacman -S mpv
macOS brew install mpv
Windows winget install mpv
Termux pkg install mpv

VLC works too, but MPV is recommended.


Usage

# Launch the full-screen TUI (default)
dhua

# Classic terminal mode
dhua --classic

# Direct search
dhua "Battle Through the Heavens"

# Set quality
dhua "Soul Land" -q 1080

# Download instead of stream
dhua "Perfect World" -d

# Show version
dhua -V

Aliases

The install scripts set up shortcuts:

Command What it does
dhua Interactive mode
donghua Same thing
dhua720 Stream at 720p
dhua1080 Stream at 1080p
dhuadl Download mode

Playback Controls

Key Action
N / Enter Next episode
P Previous episode
S Skip to episode #
R Replay current
D Download current
Q Quit

Platform Setup

Linux
# Install
pip install donghua-cli

# Dependencies
sudo apt install mpv ffmpeg    # Debian/Ubuntu
sudo dnf install mpv ffmpeg    # Fedora
sudo pacman -S mpv ffmpeg      # Arch

# Optional: add shell aliases
bash <(curl -s https://raw.githubusercontent.com/Thanukamax/donghua-cli/main/scripts/install.sh)

# Optional: add to app menu
bash packaging/desktop/install-desktop.sh
Windows
# Install Python (if needed)
winget install Python.Python.3.12

# Install donghua-cli
pip install donghua-cli

# Install mpv
winget install mpv

# Optional: run installer for PowerShell aliases
irm https://raw.githubusercontent.com/Thanukamax/donghua-cli/main/scripts/install.ps1 | iex

Or download donghua.exe from Releases -- no Python needed.

macOS
# Install
pip3 install donghua-cli

# Dependencies
brew install mpv

# Optional: aliases
bash <(curl -s https://raw.githubusercontent.com/Thanukamax/donghua-cli/main/scripts/install.sh)
Android (Termux)
pkg install python mpv ffmpeg
pip install donghua-cli

# Run
dhua

Platform is auto-detected. Quality defaults to 360p, playback uses Android intents (MPV, VLC, MX Player).

From source
git clone https://github.com/Thanukamax/donghua-cli.git
cd donghua-cli
pip install -e ".[dev]"

# Run tests
pytest

# Run
dhua

How It Works

  1. Search -- queries LuciferDonghua + AnimeXin concurrently, merges results by fuzzy title match
  2. Episodes -- fetches episode lists from all available servers, merges by episode number
  3. Extraction -- fast regex on partial HTML, falls back to full parse, then yt-dlp
  4. Playback -- launches MPV/VLC with the resolved stream URL
  5. Preloading -- background thread resolves the next 2-3 episodes while you watch
  6. Cache -- LRU cache makes repeat plays instant
  7. Fallback -- if one server fails, silently tries the next

Movies and series are detected automatically. Movie parts (PT-01, Part 01) are handled correctly.


All CLI Options

donghua [query] [-q QUALITY] [-d] [--classic] [--logs] [--verbose]
                [--clear-cache] [--features] [-V]

positional:
  query              Series to search for

options:
  -q, --quality      Video quality (360, 480, 720, 1080)
  -d, --download     Download instead of stream
  --classic          Classic Rich terminal output (no TUI)
  --logs             Write debug log to file
  --verbose          Print debug output to stderr
  --clear-cache      Clear the stream cache
  --features         Show features and capabilities
  -V, --version      Show version

Troubleshooting

Problem Fix
command not found: dhua Restart your shell, or run pip install donghua-cli again
No video plays Install mpv: see platform table above
Search returns nothing Try a simpler query, or check your internet
Slow search Normal -- source sites take 3-4s to respond
Download fails Install yt-dlp: pip install yt-dlp
TUI looks broken Your terminal needs 256-color support. Try --classic mode
Windows colors broken Use Windows Terminal (not cmd.exe)

Contributing

PRs welcome. Run pytest and ruff check src/ before submitting.

License

MIT -- see LICENSE.

Disclaimer

Educational purposes only. Support official releases when available. Not affiliated with any streaming sites.


Made by Thanukamax

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

donghua_cli-3.2.1.tar.gz (390.8 kB view details)

Uploaded Source

Built Distribution

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

donghua_cli-3.2.1-py3-none-any.whl (52.8 kB view details)

Uploaded Python 3

File details

Details for the file donghua_cli-3.2.1.tar.gz.

File metadata

  • Download URL: donghua_cli-3.2.1.tar.gz
  • Upload date:
  • Size: 390.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for donghua_cli-3.2.1.tar.gz
Algorithm Hash digest
SHA256 3a810fde870cc521f41745673469874915b122e584dc953d9e811343fb72acda
MD5 dda2e6a9687f6805ce7af14c2ee56efc
BLAKE2b-256 1c20d3fab4f7b8029e35d7a05d40686d69f5efb962c446488f1c789a448ca08f

See more details on using hashes here.

File details

Details for the file donghua_cli-3.2.1-py3-none-any.whl.

File metadata

  • Download URL: donghua_cli-3.2.1-py3-none-any.whl
  • Upload date:
  • Size: 52.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for donghua_cli-3.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ff4527a20f42fc1630e4e374521acce1d3d0a69fc433ec6e4594afc1c6a7bf8
MD5 59f2d3e252322bd95ef7bff7b7b414c7
BLAKE2b-256 f403912b67aa0ba7e6f700f751c8fda76e6c4acd13a11ef29c84c58131079d95

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