arch:using axel to pre-download source file | info window handling list attributes better

This commit is contained in:
Vinicius Moreira
2019-09-22 01:01:11 -03:00
parent 0085f40cdf
commit 917c6ec5d7
18 changed files with 189 additions and 22 deletions

View File

@@ -38,3 +38,13 @@ class HttpClient:
def get_json(self, url: str):
res = self.get(url)
return res.json() if res else None
def get_content_length(self, url: str) -> int:
"""
:param url:
:return:
"""
res = self.session.head(url)
if res.status_code == 200:
return res.headers['content-length']