Skip to content

Commit

Permalink
预处理更新
Browse files Browse the repository at this point in the history
①视频源文件夹内文件移动到AV_Data_Capture文件夹后处理。
②config.ini内增加[movie][path]设置
  • Loading branch information
ninjadogz committed Oct 26, 2019
1 parent bab350e commit 5a63618
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 31 deletions.
Binary file removed 1.png
Binary file not shown.
20 changes: 18 additions & 2 deletions AV_Data_Capture.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import glob
Expand All @@ -10,6 +10,7 @@
import json
import shutil
from configparser import ConfigParser
import fnmatch
os.chdir(os.getcwd())

# ============global var===========
Expand All @@ -18,11 +19,25 @@

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')
Expand Down Expand Up @@ -128,6 +143,7 @@ def RunCore():
print('[*]=====================================')
CreatFailedFolder()
UpdateCheck()
moveMovies(fromPath)
os.chdir(os.getcwd())

count = 0
Expand Down
3 changes: 3 additions & 0 deletions config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ directory=

[escape]
literals=\()

[movie]
path=/root/sort/test
29 changes: 0 additions & 29 deletions moveVideos.ps1

This file was deleted.

0 comments on commit 5a63618

Please sign in to comment.