dongzhaorui 3 năm trước cách đây
mục cha
commit
e118240f9f
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  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