|
@@ -224,7 +224,7 @@ class AttachmentDownloader(AliYunService):
|
|
|
if show_error_log:
|
|
|
logger.exception(why)
|
|
|
|
|
|
- return b''
|
|
|
+ return b"", ""
|
|
|
|
|
|
def fetch_attachment(
|
|
|
self,
|
|
@@ -236,13 +236,7 @@ class AttachmentDownloader(AliYunService):
|
|
|
if not file_name or not download_url:
|
|
|
raise AttachmentNullError
|
|
|
|
|
|
- results = self.fetch_data(callback, download_url, **kwargs)
|
|
|
- if len(results) == 2:
|
|
|
- filetype = results[-1]
|
|
|
- else:
|
|
|
- filetype = ""
|
|
|
-
|
|
|
- filestream = results[0] # 文件数据流
|
|
|
+ filestream, filetype = self.fetch_data(callback, download_url, **kwargs)
|
|
|
filename = clear_file_type_suffix(file_name, filetype)
|
|
|
download_url = judge_file_url(download_url)
|
|
|
|