Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I meant, a way to get the file-size when chunked transfer-encoding is used. I cannot imagine any, and I don't think requests has some magic way to calculate it (or more likely STOP after downloading n bytes).

Maybe `stream=True` and `.read(5 * 1024 * 1024)` and check EOF, if not, abort.



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: