How lithops-zty/hsrequest works
This is a Python downloader library with a Tkinter progress interface. A caller supplies a URL, destination, headers, and options; the public download workflow checks response size and range support, schedules concurrent byte-range retrieval, assembles temporary pieces into the destination, and reports per-worker progress and status. The range tracker reallocates unfinished spans, supporting recovery during a running download, while the interface derives speed and timing statistics. The excerpts omit some function bodies, so links for undocumented resume behavior and UI lifecycle details are limited to the documented capabilities and visible calls.
Main entry points: __init__.py Download dispatcher · interface.py Tk progress UI · Speedometer.py Speed and timing · utils.py Download utilities
Components 13
Download API
- Download entry point
__init__.py - Request preflight
__init__.py
Download engine
- Download dispatcher
__init__.py - Range tracker
__init__.py - Range worker
__init__.py - Temporary chunks
__init__.py - Chunk assembly
__init__.py
Progress interface
- Tk progress UI
interface.py - Speed and timing
Speedometer.py
Runtime support
- Download utilities
utils.py
Other components
- Application caller
- HTTP service
- Downloaded file
Connections 16
- Application caller → Download entry point: calls
- Download entry point → Request preflight: preflights
- Request preflight → HTTP service: checks response
- Request preflight → Download dispatcher: dispatches download
- Request preflight → Download utilities: validates response
- Download dispatcher → Range tracker: initializes ranges
- Download dispatcher → Range worker: starts workers
- Download dispatcher → Tk progress UI: opens progress UI
- Range worker → Range tracker: claims next span
- Range worker → HTTP service: requests byte ranges
- Range worker → Temporary chunks: writes chunks
- Range worker → Tk progress UI: reports progress
- Download dispatcher → Chunk assembly: assembles chunks
- Chunk assembly → Temporary chunks: reads chunks
- Chunk assembly → Downloaded file: writes result
- Tk progress UI → Speed and timing: records progress