@@ -4,7 +4,7 @@ import config
|
|||||||
import importlib
|
import importlib
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
import shutil
|
import shutil
|
||||||
|
from ADC_function import file_not_exist_or_empty
|
||||||
|
|
||||||
def face_crop_width(filename, width, height):
|
def face_crop_width(filename, width, height):
|
||||||
# 新宽度是高度的2/3
|
# 新宽度是高度的2/3
|
||||||
@@ -57,6 +57,8 @@ def face_crop_height(filename, width, height):
|
|||||||
def cutImage(imagecut, path, fanart_path, poster_path):
|
def cutImage(imagecut, path, fanart_path, poster_path):
|
||||||
fullpath_fanart = os.path.join(path, fanart_path)
|
fullpath_fanart = os.path.join(path, fanart_path)
|
||||||
fullpath_poster = os.path.join(path, poster_path)
|
fullpath_poster = os.path.join(path, poster_path)
|
||||||
|
if config.getInstance().download_only_missing_images() and not file_not_exist_or_empty(fullpath_poster):
|
||||||
|
return
|
||||||
if imagecut == 1: # 剪裁大封面
|
if imagecut == 1: # 剪裁大封面
|
||||||
try:
|
try:
|
||||||
img = Image.open(fullpath_fanart)
|
img = Image.open(fullpath_fanart)
|
||||||
@@ -92,4 +94,3 @@ def face_center(filename, model):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
cutImage(1,'H:\\test\\','12.jpg','test.jpg')
|
cutImage(1,'H:\\test\\','12.jpg','test.jpg')
|
||||||
|
|
||||||
@@ -514,8 +514,8 @@ def main():
|
|||||||
print(f"[+]Load Config file '{conf.ini_path}'.")
|
print(f"[+]Load Config file '{conf.ini_path}'.")
|
||||||
if conf.debug():
|
if conf.debug():
|
||||||
print('[+]Enable debug')
|
print('[+]Enable debug')
|
||||||
if conf.link_mode():
|
if conf.link_mode() in (1, 2):
|
||||||
print('[!]Enable soft link')
|
print('[!]Enable {} link'.format(('soft', 'hard')[conf.link_mode() - 1]))
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
print('[!]CmdLine:', " ".join(sys.argv[1:]))
|
print('[!]CmdLine:', " ".join(sys.argv[1:]))
|
||||||
print('[+]Main Working mode ## {}: {} ## {}{}{}'
|
print('[+]Main Working mode ## {}: {} ## {}{}{}'
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ mode=1
|
|||||||
vars=outline,series,studio,tag,title
|
vars=outline,series,studio,tag,title
|
||||||
|
|
||||||
[javdb]
|
[javdb]
|
||||||
sites=33,34
|
sites=37,38
|
||||||
|
|
||||||
; 人脸识别 hog:方向梯度直方图(不太准确,速度快) cnn:深度学习模型(准确,需要GPU/CUDA,速度慢)
|
; 人脸识别 hog:方向梯度直方图(不太准确,速度快) cnn:深度学习模型(准确,需要GPU/CUDA,速度慢)
|
||||||
[face]
|
[face]
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ class Config:
|
|||||||
def actor_gender(self) -> str:
|
def actor_gender(self) -> str:
|
||||||
return self.conf.get("common", "actor_gender")
|
return self.conf.get("common", "actor_gender")
|
||||||
|
|
||||||
def link_mode(self) -> bool:
|
def link_mode(self) -> int:
|
||||||
return self.getint_override("common", "link_mode")
|
return self.getint_override("common", "link_mode")
|
||||||
|
|
||||||
def scan_hardlink(self) -> bool:
|
def scan_hardlink(self) -> bool:
|
||||||
|
|||||||
10
core.py
10
core.py
@@ -354,8 +354,13 @@ def print_files(path, leak_word, c_word, naming_rule, part, cn_sub, json_data, f
|
|||||||
print(" <premiered>" + release + "</premiered>", file=code)
|
print(" <premiered>" + release + "</premiered>", file=code)
|
||||||
print(" <releasedate>" + release + "</releasedate>", file=code)
|
print(" <releasedate>" + release + "</releasedate>", file=code)
|
||||||
print(" <release>" + release + "</release>", file=code)
|
print(" <release>" + release + "</release>", file=code)
|
||||||
if 'userrating' in json_data:
|
try:
|
||||||
print(" <userrating>" + json_data['userrating'] + "</userrating>", file=code)
|
f_rating = float(json_data['userrating'])
|
||||||
|
print(f" <userrating>{round(f_rating * 2.0)}</userrating>", file=code)
|
||||||
|
print(f" <rating>{round(f_rating * 2.0, 1)}</rating>", file=code)
|
||||||
|
print(f" <criticrating>{round(f_rating * 20.0, 1)}</criticrating>", file=code)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
print(" <cover>" + cover + "</cover>", file=code)
|
print(" <cover>" + cover + "</cover>", file=code)
|
||||||
if config.getInstance().is_trailer():
|
if config.getInstance().is_trailer():
|
||||||
print(" <trailer>" + trailer + "</trailer>", file=code)
|
print(" <trailer>" + trailer + "</trailer>", file=code)
|
||||||
@@ -692,7 +697,6 @@ def core_main(file_path, number_th, oCC):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 裁剪图
|
# 裁剪图
|
||||||
cutImage(imagecut, path , fanart_path, poster_path)
|
cutImage(imagecut, path , fanart_path, poster_path)
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
main_mode=1
|
main_mode=1
|
||||||
failed_output_folder=data/failure_output
|
failed_output_folder=data/failure_output
|
||||||
success_output_folder=data/organized
|
success_output_folder=data/organized
|
||||||
soft_link=0
|
link_mode=0
|
||||||
|
|
||||||
[proxy]
|
[proxy]
|
||||||
proxy=
|
proxy=
|
||||||
|
|||||||
Reference in New Issue
Block a user