mirror of
https://github.com/facefusion/facefusion.git
synced 2026-09-24 08:20:49 +02:00
Fix urllib
This commit is contained in:
@@ -10,7 +10,7 @@ import shutil
|
|||||||
import ssl
|
import ssl
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
import urllib
|
import urllib.request
|
||||||
import onnxruntime
|
import onnxruntime
|
||||||
|
|
||||||
import facefusion.globals
|
import facefusion.globals
|
||||||
@@ -198,7 +198,7 @@ def conditional_download(download_directory_path : str, urls : List[str]) -> Non
|
|||||||
@lru_cache(maxsize = None)
|
@lru_cache(maxsize = None)
|
||||||
def get_download_size(url : str) -> int:
|
def get_download_size(url : str) -> int:
|
||||||
try:
|
try:
|
||||||
response = urllib.request.urlopen(url) # type: ignore[attr-defined]
|
response = urllib.request.urlopen(url)
|
||||||
return int(response.getheader('Content-Length'))
|
return int(response.getheader('Content-Length'))
|
||||||
except (OSError, ValueError):
|
except (OSError, ValueError):
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user