mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-28 18:01:36 +00:00
Pathvalidate (#1408)
* Update requirements.txt Adding `pathvalidate` to requrements * Update __init__.py Adding `pathvalidate` to make correct filename on other then ascii encodings. * Updating with sanitize_filename * Removing unused variable.
This commit is contained in:
committed by
GitHub
parent
95beb8e62a
commit
7f51e35bd4
@@ -33,6 +33,7 @@ import http.client as http_client
|
||||
from multiprocessing import Pool as mp_pool
|
||||
from multiprocessing import Lock as mp_lock
|
||||
from urllib.parse import quote, urlencode, urlparse
|
||||
from pathvalidate import sanitize_filename
|
||||
import dateutil.parser
|
||||
|
||||
import googleapiclient
|
||||
@@ -4064,8 +4065,7 @@ def downloadDriveFile(users):
|
||||
if targetName:
|
||||
safe_file_title = targetName
|
||||
else:
|
||||
safe_file_title = ''.join(c for c in result['title']
|
||||
if c in FILENAME_SAFE_CHARS)
|
||||
safe_file_title = sanitize_filename(result['title'])
|
||||
if not safe_file_title:
|
||||
safe_file_title = fileId
|
||||
filename = os.path.join(targetFolder, safe_file_title)
|
||||
|
||||
Reference in New Issue
Block a user