Ver código fonte

modified: README.md
modified: tools/resume_parse.py

sprivacy 3 anos atrás
pai
commit
699a753d5c
2 arquivos alterados com 7 adições e 0 exclusões
  1. 1 0
      README.md
  2. 6 0
      tools/resume_parse.py

+ 1 - 0
README.md

@@ -0,0 +1 @@
+apt install unrar-free

+ 6 - 0
tools/resume_parse.py

@@ -7,6 +7,7 @@ import json
 import time
 from os import walk
 import subprocess
+import rarfile
 import py7zr
 import tarfile
 from zipfile import ZipFile
@@ -1388,6 +1389,11 @@ def decode_path(path):
 def detection_type(path, system):
     tempdir = time.strftime("%Y_%m_%dT%H_%M_%S")
     os.mkdir(tempdir)
+    # 传入 rar 压缩文件
+    if os.path.isfile(path) and path.endswith('.rar'):
+        rar = rarfile.RarFile(path)
+        rar.extractall('./cache/' + tempdir)
+        path = "./cache/" + tempdir
     # 传入 tar.gz 压缩文件
     if os.path.isfile(path) and path.endswith('.tar.gz'):
         tf = tarfile.open(path)