mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 00:04:15 +02:00
arch:using axel to pre-download source file | info window handling list attributes better
This commit is contained in:
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user