pyhttpx icon indicating copy to clipboard operation
pyhttpx copied to clipboard

stream模式的支持

Open alfredtofu opened this issue 2 years ago • 4 comments

经常遇到需要下载文件,如果不支持stream模式,经常下载会卡住,请问可以添加支持吗?

alfredtofu avatar Aug 16 '23 09:08 alfredtofu

先用第三方超时函数装饰处理吧

Zhujin Liang @.***> 于2023年8月16日周三 17:19写道:

经常遇到需要下载文件,如果不支持stream模式,经常下载会卡住,请问可以添加支持吗?

— Reply to this email directly, view it on GitHub https://github.com/zero3301/pyhttpx/issues/26, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ53XMMR4AS2VSEA4ZJXMB3XVSGB7ANCNFSM6AAAAAA3SHJHNE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

zero3301 avatar Aug 17 '23 12:08 zero3301

请问有什么推荐吗?

alfredtofu avatar Aug 17 '23 13:08 alfredtofu

from timeout_decorator import timeout @timeout(seconds=5) def some_function(): pass

zero3301 avatar Aug 18 '23 02:08 zero3301

这样会导致一直下载不了,可能最好的方式是支持requests的stream模式

alfredtofu avatar Aug 18 '23 02:08 alfredtofu