dongzhaorui 3 年 前
コミット
e118240f9f
1 ファイル変更4 行追加2 行削除
  1. 4 2
      zbytb/utils/clean_file.py

+ 4 - 2
zbytb/utils/clean_file.py

@@ -69,8 +69,10 @@ def discern_file_format(text):
             if result is not None:
                 return t
     else:
-        unknown_type = re.findall('[^.\\/:*?"<>|\r\n]+$', text, re.S)
-        logger.warning(f'[附件类型识别]未定义的文件类型{unknown_type}')
+        # unknown_type = re.findall('[^.\\/:*?"<>|\r\n]+$', text, re.S)
+        non_type = re.search('([.][a-zA-Z]{3,5})$', text)
+        if non_type is not None:
+            logger.warning(f'[未知附件类型]{non_type.group()}')
         return None