Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: stream downloading and progress #607

Merged
merged 4 commits into from
May 25, 2022
Merged

feat: stream downloading and progress #607

merged 4 commits into from
May 25, 2022

Conversation

MingxuanGame
Copy link
Contributor

@MingxuanGame MingxuanGame commented May 24, 2022

Add stream=True to use stream downloading

Need dependent rich

Example:

await AsyncHttpx.download_file(
    "https://speed.hetzner.de/100MB.bin", "100MB.bin", stream=True
)

Stdout:

05-25 00:53:56 [INFO] utils | 开始下载 100MB.bin.. Path: E:\Code\test\zhenxun_bot\100MB.bin
100MB.bin 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 104.9/104.9 MB 5.5 MB/s
05-25 00:54:21 [INFO] utils | 下载 https://speed.hetzner.de/100MB.bin 成功.. Path:E:\Code\test\zhenxun_bot\100MB.bin

@HibiKier HibiKier merged commit 28a58df into HibiKier:main May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants