Timeline for Get size of a file before downloading in Python
Current License: CC BY-SA 4.0
2 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 26, 2022 at 20:38 | comment | added | Eugene Chabanov |
Otherwise it will be None . Still +1 for your answer. Note: If you want it to return e.g. 0 if there's no Content-Length - do meta.get('Content-Length', 0) . Overall, my one-liner is urllib.request.urlopen(url).info().get('Content-Length', 0)
|
|
Jul 17, 2022 at 3:36 | history | answered | Harshana | CC BY-SA 4.0 |