How dan3oft/zhtext works
zhtext is an offline-first Mandarin study tool: a learner supplies links or local media, the CLI obtains audio and captions, uses captions or speech recognition to produce Chinese segments, adds pinyin and optional translation, then displays and saves the results. The graph preserves separate source-handling, transcription, language-enrichment, and presentation stages. Source excerpts show the main calls and integrations; other relationships are included only where the README documents them.
Main entry points: cli.py CLI workflow · download.py Generic media fetch · transcribe.py Whisper transcription · translate.py Translation workflow
Components 21
Media input
- Source resolver
zhtext/download.py - Generic media fetch
zhtext/download.py - Kaltura fetch
zhtext/download.py - Audio extraction
zhtext/download.py - Caption parsing
zhtext/download.py - Audio file
- Caption segments
Chinese transcription
- Whisper transcription
zhtext/transcribe.py - Chinese segments
zhtext/download.py
Language enrichment
- Pinyin conversion
zhtext/translate.py - Translation workflow
zhtext/translate.py - Argos models
zhtext/translate.py - Model index and cache
zhtext/translate.py
Results
- CLI workflow
zhtext/cli.py - Terminal display
zhtext/cli.py - Transcript and subtitles
zhtext/cli.py
Other components
- Learner
- Media services
- Local media
- faster-whisper
- Argos model index
Connections 25
- Learner → CLI workflow: supplies sources
README.md - CLI workflow → Source resolver: fetches links
zhtext/cli.py - Source resolver → Kaltura fetch: routes Kaltura
zhtext/download.py - Source resolver → Generic media fetch: routes others
zhtext/download.py - Kaltura fetch → Media services: requests media
zhtext/download.py - Generic media fetch → Media services: downloads media
zhtext/download.py - Kaltura fetch → Audio extraction: extracts audio
zhtext/download.py - Generic media fetch → Audio file: produces audio
zhtext/download.py - Audio extraction → Audio file: produces audio
zhtext/download.py - Kaltura fetch → Caption parsing: parses captions
zhtext/download.py - Generic media fetch → Caption parsing: parses subtitles
zhtext/download.py - Caption parsing → Caption segments: returns segments
zhtext/download.py - CLI workflow → Whisper transcription: transcribes audio
zhtext/cli.py - Whisper transcription → faster-whisper: runs recognition
zhtext/transcribe.py - Whisper transcription → Audio file: reads audio
zhtext/transcribe.py - Whisper transcription → Chinese segments: returns segments
zhtext/transcribe.py - CLI workflow → Caption segments: uses when available
zhtext/cli.py - CLI workflow → Pinyin conversion: converts text
zhtext/cli.py - CLI workflow → Translation workflow: translates segments
zhtext/cli.py - Translation workflow → Model index and cache: loads packages
zhtext/translate.py - Model index and cache → Argos model index: fetches index
zhtext/translate.py - Translation workflow → Argos models: runs translation
zhtext/translate.py - Argos models → Model index and cache: loads cached models
zhtext/translate.py - CLI workflow → Terminal display: prints results
zhtext/cli.py - CLI workflow → Transcript and subtitles: writes TXT and SRT
zhtext/cli.py