From abcf1a49e74451aba2de961ec4735fa1e57ded1e Mon Sep 17 00:00:00 2001 From: wenead99 <42309414+wenead99@users.noreply.github.com> Date: Tue, 28 May 2019 19:45:57 +0800 Subject: [PATCH] =?UTF-8?q?0.3=20Beta=20=E6=96=B0=E5=A2=9E=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=A9=BA=E7=9B=AE=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AV_Data_Capture.py | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/AV_Data_Capture.py b/AV_Data_Capture.py index 9bb0142..5ca95d8 100644 --- a/AV_Data_Capture.py +++ b/AV_Data_Capture.py @@ -4,28 +4,21 @@ import time def movie_lists(): #MP4 - a1 = glob.glob(os.getcwd() + r"\*\**\*.mp4") a2 = glob.glob(os.getcwd() + r"\*.mp4") # AVI - b1 = glob.glob(os.getcwd() + r"\*\**\*.avi") b2 = glob.glob(os.getcwd() + r"\*.avi") # RMVB - c1 = glob.glob(os.getcwd() + r"\*\**\*.rmvb") c2 = glob.glob(os.getcwd() + r"\*.rmvb") # WMV - d1 = glob.glob(os.getcwd() + r"\*\**\*.wmv") d2 = glob.glob(os.getcwd() + r"\*.wmv") # MOV - e1 = glob.glob(os.getcwd() + r"\*\**\*.mov") e2 = glob.glob(os.getcwd() + r"\*.mov") # MKV - f1 = glob.glob(os.getcwd() + r"\*\**\*.mkv") f2 = glob.glob(os.getcwd() + r"\*.mkv") # FLV - g1 = glob.glob(os.getcwd() + r"\*\**\*.flv") g2 = glob.glob(os.getcwd() + r"\*.flv") - total = a1+a2+b1+b2+c1+c2+d1+d2+e1+e2+f1+f2+g1+g2 + total = a2+b2+c2+d2+e2+f2+g2 return total def lists_from_test(custom_nuber): @@ -33,7 +26,20 @@ def lists_from_test(custom_nuber): a.append(custom_nuber) return a -os.chdir(os.getcwd()) -for i in movie_lists(): - os.system('python core.py'+' "'+i+'"') -print("[+]All finished!!!") +def CEF(path): + files = os.listdir(path) # 获取路径下的子文件(夹)列表 + for file in files: + try: #试图删除空目录,非空目录删除会报错 + os.removedirs(path + '/' + file) # 删除这个空文件夹 + print('[+]Deleting empty folder',path + '/' + file) + except: + a='' + +if __name__ =='__main__': + os.chdir(os.getcwd()) + for i in movie_lists(): + os.system('python core.py' + ' "' + i + '"') + print("[!]Cleaning empty folders") + CEF('JAV_output') + print("[+]All finished!!!") + time.sleep(3)