fdf
This commit is contained in:
@@ -38,6 +38,9 @@ from API.httpx_shared import get_shared_httpx_client
|
||||
|
||||
# Default configuration
|
||||
DEFAULT_TIMEOUT = 30.0
|
||||
_CONTENT_DISPOSITION_FILENAME_RE = re.compile(
|
||||
r'filename\*?=(?:"([^"]*)"|([^;\s]*))'
|
||||
)
|
||||
DEFAULT_RETRIES = 3
|
||||
DEFAULT_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
|
||||
|
||||
@@ -661,7 +664,7 @@ def download_direct_file(
|
||||
content_type = ""
|
||||
|
||||
if content_disposition:
|
||||
match = re.search(r'filename\*?=(?:"([^"]*)"|([^;\s]*))', content_disposition)
|
||||
match = _CONTENT_DISPOSITION_FILENAME_RE.search(content_disposition)
|
||||
if match:
|
||||
extracted_name = match.group(1) or match.group(2)
|
||||
if extracted_name:
|
||||
|
||||
Reference in New Issue
Block a user