预处理更新

①视频源文件夹内文件移动到AV_Data_Capture文件夹后处理。
②config.ini内增加[movie][path]设置
This commit is contained in:
ninjadogz
2019-10-27 00:09:41 +09:00
parent bab350e8dd
commit 5a6361897a
4 changed files with 21 additions and 31 deletions

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import glob
@@ -10,6 +10,7 @@ from ADC_function import *
import json
import shutil
from configparser import ConfigParser
import fnmatch
os.chdir(os.getcwd())
# ============global var===========
@@ -18,11 +19,25 @@ version='1.3'
config = ConfigParser()
config.read(config_file, encoding='UTF-8')
fromPath=config['movie']['path']
Platform = sys.platform
# ==========global var end=========
def moveMovies(fromPath):
movieFiles = []
if Platform == 'win32':
movieFormat = ["avi", "rmvb", "wmv", "mov", "mp4", "mkv", "flv", "ts"]
else:
movieFormat = ["AVI", "RMVB", "WMV", "MOV", "MP4", "MKV", "FLV", "TS","avi", "rmvb", "wmv", "mov", "mp4", "mkv", "flv", "ts"]
for fm in movieFormat:
movieFiles = movieFiles + [os.path.join(dirpath, f)
for dirpath, dirnames, files in os.walk(fromPath)
for f in fnmatch.filter(files, '*.' + fm)]
print(movieFiles)
for movie in movieFiles:
print("Move file " + movie)
shutil.move(movie, os.path.curdir)
def UpdateCheck():
if UpdateCheckSwitch() == '1':
html2 = get_html('https://raw.githubusercontent.com/yoshiko2/AV_Data_Capture/master/update_check.json')
@@ -128,6 +143,7 @@ if __name__ =='__main__':
print('[*]=====================================')
CreatFailedFolder()
UpdateCheck()
moveMovies(fromPath)
os.chdir(os.getcwd())
count = 0