Version fallback to Beta 11.6
This commit is contained in:
parent
54437236f0
commit
446e1bf7d0
@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import glob
|
import glob
|
||||||
@ -8,20 +7,20 @@ import re
|
|||||||
import sys
|
import sys
|
||||||
from ADC_function import *
|
from ADC_function import *
|
||||||
import json
|
import json
|
||||||
import subprocess
|
|
||||||
import shutil
|
import shutil
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
|
|
||||||
version='0.11.7'
|
version='0.11.6'
|
||||||
os.chdir(os.getcwd())
|
os.chdir(os.getcwd())
|
||||||
|
|
||||||
config = ConfigParser()
|
config = ConfigParser()
|
||||||
config.read(config_file, encoding='UTF-8')
|
config.read(config_file, encoding='UTF-8')
|
||||||
input_dir=config['directory_capture']['input_directory']
|
|
||||||
|
|
||||||
def UpdateCheck():
|
def UpdateCheck():
|
||||||
if UpdateCheckSwitch() == '1':
|
if UpdateCheckSwitch() == '1':
|
||||||
html = json.loads(get_html('https://raw.githubusercontent.com/wenead99/AV_Data_Capture/master/update_check.json'))
|
html2 = get_html('https://raw.githubusercontent.com/wenead99/AV_Data_Capture/master/update_check.json')
|
||||||
|
html = json.loads(str(html2))
|
||||||
|
|
||||||
if not version == html['version']:
|
if not version == html['version']:
|
||||||
print('[*] * New update ' + html['version'] + ' *')
|
print('[*] * New update ' + html['version'] + ' *')
|
||||||
print('[*] * Download *')
|
print('[*] * Download *')
|
||||||
@ -29,32 +28,36 @@ def UpdateCheck():
|
|||||||
print('[*]=====================================')
|
print('[*]=====================================')
|
||||||
else:
|
else:
|
||||||
print('[+]Update Check disabled!')
|
print('[+]Update Check disabled!')
|
||||||
|
|
||||||
def format_path(path): # 使路径兼容Linux与MacOS
|
|
||||||
if path.find('\\'): # 是仅兼容Windows的路径格式
|
|
||||||
path_list=path.split('\\')
|
|
||||||
path='/'.join(path_list) # 转换为可移植的路径格式
|
|
||||||
return path
|
|
||||||
|
|
||||||
|
|
||||||
def movie_lists():
|
def movie_lists():
|
||||||
a2 = glob.glob( input_dir + "/*.mp4")
|
if config['directory_capture']['switch'] == '0' or config['directory_capture']['switch'] == '':
|
||||||
b2 = glob.glob( input_dir + "/*.avi")
|
a2 = glob.glob(r".\*.mp4")
|
||||||
c2 = glob.glob( input_dir + "/*.rmvb")
|
b2 = glob.glob(r".\*.avi")
|
||||||
d2 = glob.glob( input_dir + "/*.wmv")
|
c2 = glob.glob(r".\*.rmvb")
|
||||||
e2 = glob.glob( input_dir + "/*.mov")
|
d2 = glob.glob(r".\*.wmv")
|
||||||
f2 = glob.glob( input_dir + "/*.mkv")
|
e2 = glob.glob(r".\*.mov")
|
||||||
g2 = glob.glob( input_dir + "/*.flv")
|
f2 = glob.glob(r".\*.mkv")
|
||||||
h2 = glob.glob( input_dir + "/*.ts")
|
g2 = glob.glob(r".\*.flv")
|
||||||
total = a2 + b2 + c2 + d2 + e2 + f2 + g2 + h2
|
h2 = glob.glob(r".\*.ts")
|
||||||
return total
|
total = a2 + b2 + c2 + d2 + e2 + f2 + g2 + h2
|
||||||
def CreatFolder(folder_path):
|
return total
|
||||||
if not os.path.exists(folder_path): # 新建文件夹
|
elif config['directory_capture']['switch'] == '1':
|
||||||
|
directory = config['directory_capture']['directory']
|
||||||
|
a2 = glob.glob(r".\\" + directory + "\*.mp4")
|
||||||
|
b2 = glob.glob(r".\\" + directory + "\*.avi")
|
||||||
|
c2 = glob.glob(r".\\" + directory + "\*.rmvb")
|
||||||
|
d2 = glob.glob(r".\\" + directory + "\*.wmv")
|
||||||
|
e2 = glob.glob(r".\\" + directory + "\*.mov")
|
||||||
|
f2 = glob.glob(r".\\" + directory + "\*.mkv")
|
||||||
|
g2 = glob.glob(r".\\" + directory + "\*.flv")
|
||||||
|
h2 = glob.glob(r".\\" + directory + "\*.ts")
|
||||||
|
total = a2 + b2 + c2 + d2 + e2 + f2 + g2 + h2
|
||||||
|
return total
|
||||||
|
def CreatFailedFolder():
|
||||||
|
if not os.path.exists('failed/'): # 新建failed文件夹
|
||||||
try:
|
try:
|
||||||
print('[+]Creating ' + folder_path)
|
os.makedirs('failed/')
|
||||||
os.makedirs(folder_path)
|
|
||||||
except:
|
except:
|
||||||
print("[-]failed!can not be make folder '"+folder_path+"'\n[-](Please run as Administrator)")
|
print("[-]failed!can not be make folder 'failed'\n[-](Please run as Administrator)")
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
def lists_from_test(custom_nuber): #电影列表
|
def lists_from_test(custom_nuber): #电影列表
|
||||||
a=[]
|
a=[]
|
||||||
@ -108,55 +111,40 @@ def getNumber(filepath):
|
|||||||
print('[-]' + str(os.path.basename(filepath)) + ' Cannot catch the number :')
|
print('[-]' + str(os.path.basename(filepath)) + ' Cannot catch the number :')
|
||||||
print('[-]' + str(os.path.basename(filepath)) + ' :', e)
|
print('[-]' + str(os.path.basename(filepath)) + ' :', e)
|
||||||
print('[-]Move ' + os.path.basename(filepath) + ' to failed folder')
|
print('[-]Move ' + os.path.basename(filepath) + ' to failed folder')
|
||||||
#print('[-]' + filepath + ' -> ' + output_dir + '/failed/')
|
|
||||||
#shutil.move(filepath, output_dir + '/failed/')
|
shutil.move(filepath, str(os.getcwd()) + '/' + 'failed/')
|
||||||
except IOError as e2:
|
except IOError as e2:
|
||||||
print('[-]' + str(os.path.basename(filepath)) + ' Cannot catch the number :')
|
print('[-]' + str(os.path.basename(filepath)) + ' Cannot catch the number :')
|
||||||
print('[-]' + str(os.path.basename(filepath)) + ' :', e2)
|
print('[-]' + str(os.path.basename(filepath)) + ' :', e2)
|
||||||
#print('[-]' + filepath + ' -> ' + output_dir + '/failed/')
|
print('[-]Move ' + os.path.basename(filepath) + ' to failed folder')
|
||||||
#shutil.move(filepath, output_dir + '/failed/')
|
shutil.move(filepath, str(os.getcwd()) + '/' + 'failed/')
|
||||||
|
|
||||||
def RunCore(movie):
|
def RunCore():
|
||||||
# 异步调用core.py, core.py作为子线程执行, 本程序继续执行.
|
|
||||||
if os.path.exists('core.py'):
|
if os.path.exists('core.py'):
|
||||||
cmd_arg=[sys.executable,'core.py',movie,'--number',getNumber(movie)] #从py文件启动(用于源码py)
|
os.system('python core.py' + ' "' + i + '" --number "'+getNumber(i)+'"') #从py文件启动(用于源码py)
|
||||||
elif os.path.exists('core.exe'):
|
elif os.path.exists('core.exe'):
|
||||||
cmd_arg=['core.exe',movie,'--number',getNumber(movie)] #从exe启动(用于EXE版程序)
|
os.system('core.exe' + ' "' + i + '" --number "'+getNumber(i)+'"') #从exe启动(用于EXE版程序)
|
||||||
elif os.path.exists('core.py') and os.path.exists('core.exe'):
|
elif os.path.exists('core.py') and os.path.exists('core.exe'):
|
||||||
cmd_arg=[sys.executable,'core.py',movie,'--number',getNumber(movie)] #从py文件启动(用于源码py)
|
os.system('python core.py' + ' "' + i + '" --number "' + getNumber(i) + '"') #从py文件启动(用于源码py)
|
||||||
process=subprocess.Popen(cmd_arg)
|
|
||||||
return process
|
|
||||||
|
|
||||||
if __name__ =='__main__':
|
if __name__ =='__main__':
|
||||||
print('[*]===========AV Data Capture===========')
|
print('[*]===========AV Data Capture===========')
|
||||||
print('[*] Version '+version)
|
print('[*] Version '+version)
|
||||||
print('[*]=====================================')
|
print('[*]=====================================')
|
||||||
|
CreatFailedFolder()
|
||||||
UpdateCheck()
|
UpdateCheck()
|
||||||
os.chdir(os.getcwd())
|
os.chdir(os.getcwd())
|
||||||
|
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
movies = movie_lists()
|
count_all = str(len(movie_lists()))
|
||||||
count_all = str(len(movies))
|
for i in movie_lists(): #遍历电影列表 交给core处理
|
||||||
print('[+]Find ' + str(len(movies)) + ' movies.')
|
count = count + 1
|
||||||
process_list=[]
|
percentage = str(count/int(count_all)*100)[:4]+'%'
|
||||||
for movie in movies: #遍历电影列表 交给core处理
|
|
||||||
num=getNumber(movie) # 获取番号
|
|
||||||
if num is None:
|
|
||||||
movies.remove(movie) # 未获取到番号, 则将影片从列表移除
|
|
||||||
count_all=count_all-1
|
|
||||||
continue
|
|
||||||
print("[!]Making Data for [" + movie + "], the number is [" + num + "]")
|
|
||||||
process=RunCore(movie)
|
|
||||||
process_list.append(process)
|
|
||||||
print("[*]=====================================")
|
|
||||||
for i in range(len(movies)):
|
|
||||||
process_list[i].communicate()
|
|
||||||
percentage = str((i+1)/int(count_all)*100)[:4]+'%'
|
|
||||||
print('[!] - '+percentage+' ['+str(count)+'/'+count_all+'] -')
|
print('[!] - '+percentage+' ['+str(count)+'/'+count_all+'] -')
|
||||||
print("[!]The [" + getNumber(movies[i]) + "] process is done.")
|
print("[!]Making Data for [" + i + "], the number is [" + getNumber(i) + "]")
|
||||||
print("[*]=====================================")
|
RunCore()
|
||||||
|
print("[*]=====================================")
|
||||||
CEF(input_dir)
|
|
||||||
|
CEF('JAV_output')
|
||||||
print("[+]All finished!!!")
|
print("[+]All finished!!!")
|
||||||
input("[+][+]Press enter key exit, you can check the error messge before you exit.\n[+][+]按回车键结束,你可以在结束之前查看和错误信息。")
|
input("[+][+]Press enter key exit, you can check the error messge before you exit.\n[+][+]按回车键结束,你可以在结束之前查看和错误信息。")
|
25
core.py
25
core.py
@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import re
|
import re
|
||||||
@ -50,19 +49,18 @@ except:
|
|||||||
def moveFailedFolder():
|
def moveFailedFolder():
|
||||||
global filepath
|
global filepath
|
||||||
print('[-]Move to "failed"')
|
print('[-]Move to "failed"')
|
||||||
#print('[-]' + filepath + ' -> ' + output_dir + '/failed/')
|
shutil.move(filepath, str(os.getcwd()) + '/' + 'failed/')
|
||||||
#os.rename(filepath, output_dir + '/failed/')
|
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
def argparse_get_file():
|
def argparse_get_file():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("file", help="Write the file path on here")
|
|
||||||
parser.add_argument("--number", help="Enter Number on here", default='')
|
parser.add_argument("--number", help="Enter Number on here", default='')
|
||||||
|
parser.add_argument("file", help="Write the file path on here")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
return (args.file, args.number)
|
return (args.file, args.number)
|
||||||
def CreatFailedFolder():
|
def CreatFailedFolder():
|
||||||
if not os.path.exists('/failed/'): # 新建failed文件夹
|
if not os.path.exists('failed/'): # 新建failed文件夹
|
||||||
try:
|
try:
|
||||||
os.makedirs('/failed/')
|
os.makedirs('failed/')
|
||||||
except:
|
except:
|
||||||
print("[-]failed!can not be make folder 'failed'\n[-](Please run as Administrator)")
|
print("[-]failed!can not be make folder 'failed'\n[-](Please run as Administrator)")
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
@ -103,8 +101,6 @@ def getDataFromJSON(file_number): #从JSON返回元数据
|
|||||||
elif 'FC2' in file_number:
|
elif 'FC2' in file_number:
|
||||||
json_data = json.loads(fc2fans_club.main(
|
json_data = json.loads(fc2fans_club.main(
|
||||||
file_number.strip('FC2_').strip('FC2-').strip('ppv-').strip('PPV-').strip('fc2_').strip('fc2-').strip('ppv-').strip('PPV-')))
|
file_number.strip('FC2_').strip('FC2-').strip('ppv-').strip('PPV-').strip('fc2_').strip('fc2-').strip('ppv-').strip('PPV-')))
|
||||||
elif 'siro' in number or 'SIRO' in number or 'Siro' in number:
|
|
||||||
json_data = json.loads(siro.main(file_number))
|
|
||||||
# =======================javbus.py=======================
|
# =======================javbus.py=======================
|
||||||
else:
|
else:
|
||||||
json_data = json.loads(javbus.main(file_number))
|
json_data = json.loads(javbus.main(file_number))
|
||||||
@ -377,14 +373,19 @@ def cutImage():
|
|||||||
def pasteFileToFolder(filepath, path): #文件路径,番号,后缀,要移动至的位置
|
def pasteFileToFolder(filepath, path): #文件路径,番号,后缀,要移动至的位置
|
||||||
global houzhui
|
global houzhui
|
||||||
houzhui = str(re.search('[.](AVI|RMVB|WMV|MOV|MP4|MKV|FLV|TS|avi|rmvb|wmv|mov|mp4|mkv|flv|ts)$', filepath).group())
|
houzhui = str(re.search('[.](AVI|RMVB|WMV|MOV|MP4|MKV|FLV|TS|avi|rmvb|wmv|mov|mp4|mkv|flv|ts)$', filepath).group())
|
||||||
os.rename(filepath, number + houzhui)
|
try:
|
||||||
|
os.rename(filepath, number + houzhui)
|
||||||
|
except FileExistsError:
|
||||||
|
print('[-]File Exists! Please check your movie!')
|
||||||
|
print('[-]move to the root folder of the program.')
|
||||||
|
os._exit(0)
|
||||||
try:
|
try:
|
||||||
shutil.move(number + houzhui, path)
|
shutil.move(number + houzhui, path)
|
||||||
except:
|
except:
|
||||||
print('[-]File Exists! Please check your movie!')
|
print('[-]File Exists! Please check your movie!')
|
||||||
print('[-]move to the root folder of the program.')
|
print('[-]move to the root folder of the program.')
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
def moveJpgToBackdrop_copy():
|
def renameJpgToBackdrop_copy():
|
||||||
if option == 'plex':
|
if option == 'plex':
|
||||||
shutil.copy(path + '/fanart.jpg', path + '/Backdrop.jpg')
|
shutil.copy(path + '/fanart.jpg', path + '/Backdrop.jpg')
|
||||||
shutil.copy(path + '/poster.png', path + '/thumb.png')
|
shutil.copy(path + '/poster.png', path + '/thumb.png')
|
||||||
@ -402,7 +403,7 @@ if __name__ == '__main__':
|
|||||||
number = str(re.findall(r'(.+?)\.',str(re.search('([^<>/\\\\|:""\\*\\?]+)\\.\\w+$',filepath).group()))).strip("['']").replace('_','-')
|
number = str(re.findall(r'(.+?)\.',str(re.search('([^<>/\\\\|:""\\*\\?]+)\\.\\w+$',filepath).group()))).strip("['']").replace('_','-')
|
||||||
print("[!]Making Data for [" + number + "]")
|
print("[!]Making Data for [" + number + "]")
|
||||||
except:
|
except:
|
||||||
print("[-]failed!Please move the filename again!")
|
print("[-]failed!Please rename the filename again!")
|
||||||
moveFailedFolder()
|
moveFailedFolder()
|
||||||
else:
|
else:
|
||||||
number = argparse_get_file()[1]
|
number = argparse_get_file()[1]
|
||||||
@ -413,4 +414,4 @@ if __name__ == '__main__':
|
|||||||
PrintFiles(filepath) # 打印文件
|
PrintFiles(filepath) # 打印文件
|
||||||
cutImage() # 裁剪图
|
cutImage() # 裁剪图
|
||||||
pasteFileToFolder(filepath, path) # 移动文件
|
pasteFileToFolder(filepath, path) # 移动文件
|
||||||
moveJpgToBackdrop_copy()
|
renameJpgToBackdrop_copy()
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import re
|
import re
|
||||||
from lxml import etree#need install
|
from lxml import etree#need install
|
||||||
import json
|
import json
|
||||||
@ -82,4 +81,4 @@ def main(number2):
|
|||||||
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'),)#.encode('UTF-8')
|
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'),)#.encode('UTF-8')
|
||||||
return js
|
return js
|
||||||
|
|
||||||
#print(main('1051725'))
|
#print(main('1051725'))
|
@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import re
|
import re
|
||||||
import requests #need install
|
import requests #need install
|
||||||
from pyquery import PyQuery as pq#need install
|
from pyquery import PyQuery as pq#need install
|
||||||
@ -174,4 +173,4 @@ def main_uncensored(number):
|
|||||||
js2 = javdb.main(number)
|
js2 = javdb.main(number)
|
||||||
return js2
|
return js2
|
||||||
|
|
||||||
return js
|
return js
|
3
javdb.py
3
javdb.py
@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import re
|
import re
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
import json
|
import json
|
||||||
@ -138,4 +137,4 @@ def main(number):
|
|||||||
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8')
|
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8')
|
||||||
return js
|
return js
|
||||||
|
|
||||||
#print(main('061519-861'))
|
#print(main('061519-861'))
|
3
siro.py
3
siro.py
@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import re
|
import re
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
import json
|
import json
|
||||||
@ -102,4 +101,4 @@ def main(number2):
|
|||||||
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'),)#.encode('UTF-8')
|
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'),)#.encode('UTF-8')
|
||||||
return js
|
return js
|
||||||
|
|
||||||
#print(main('300maan-373'))
|
#print(main('300maan-373'))
|
Loading…
Reference in New Issue
Block a user