mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 22:04:15 +02:00
[api] fix: crashing when trying to retrieve a file size without proving its URL
This commit is contained in:
@@ -69,6 +69,9 @@ class HttpClient:
|
||||
return yaml.safe_load(res.text) if res else None
|
||||
|
||||
def get_content_length_in_bytes(self, url: str, session: bool = True) -> Optional[int]:
|
||||
if not url:
|
||||
return None
|
||||
|
||||
params = {'url': url, 'allow_redirects': True, 'stream': True}
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user