Simply message output
This commit is contained in:
@@ -100,7 +100,6 @@ def cutImage(imagecut, path, fanart_path, poster_path, skip_facerec=False):
|
||||
|
||||
|
||||
def face_center(filename, model):
|
||||
print('[+]Use model ' + model)
|
||||
try:
|
||||
mod = importlib.import_module('.' + model, 'ImageProcessing')
|
||||
return mod.face_center(filename, model)
|
||||
|
||||
@@ -4,7 +4,7 @@ import face_recognition
|
||||
def face_center(filename, model):
|
||||
image = face_recognition.load_image_file(filename)
|
||||
face_locations = face_recognition.face_locations(image, 1, model)
|
||||
print('[+]Found person ' + str(len(face_locations)))
|
||||
print('[+]Found person [' + str(len(face_locations)) + '] By model hog')
|
||||
maxRight = 0
|
||||
maxTop = 0
|
||||
for face_location in face_locations:
|
||||
|
||||
3
core.py
3
core.py
@@ -473,9 +473,8 @@ def add_mark(poster_path, thumb_path, cn_sub, leak, uncensored, hack) -> None:
|
||||
if mark_type == '':
|
||||
return
|
||||
add_mark_thread(thumb_path, cn_sub, leak, uncensored, hack)
|
||||
print('[+]Thumb Add Mark: ' + mark_type.strip(','))
|
||||
add_mark_thread(poster_path, cn_sub, leak, uncensored, hack)
|
||||
print('[+]Poster Add Mark: ' + mark_type.strip(','))
|
||||
print('[+]Add Mark: ' + mark_type.strip(','))
|
||||
|
||||
|
||||
def add_mark_thread(pic_path, cn_sub, leak, uncensored, hack):
|
||||
|
||||
@@ -6,12 +6,14 @@ from requests.adapters import HTTPAdapter
|
||||
from urllib3.util.retry import Retry
|
||||
from cloudscraper import create_scraper
|
||||
|
||||
import config
|
||||
|
||||
G_USER_AGENT = r'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.133 Safari/537.36'
|
||||
G_DEFAULT_TIMEOUT = 10
|
||||
|
||||
|
||||
def get(url: str, cookies=None, ua: str=None, extra_headers=None, return_type: str=None, encoding: str=None,
|
||||
retry: int=3, timeout: int=G_DEFAULT_TIMEOUT, proxies=None, verify=None):
|
||||
def get(url: str, cookies=None, ua: str = None, extra_headers=None, return_type: str = None, encoding: str = None,
|
||||
retry: int = 3, timeout: int = G_DEFAULT_TIMEOUT, proxies=None, verify=None):
|
||||
"""
|
||||
网页请求核心函数
|
||||
|
||||
@@ -33,14 +35,16 @@ def get(url: str, cookies=None, ua: str=None, extra_headers=None, return_type: s
|
||||
result.encoding = encoding or result.apparent_encoding
|
||||
return result.text
|
||||
except Exception as e:
|
||||
print(f"[-]Connect: {url} retry {i + 1}/{retry}")
|
||||
if config.getInstance().debug():
|
||||
print(f"[-]Connect: {url} retry {i + 1}/{retry}")
|
||||
errors = str(e)
|
||||
if "getaddrinfo failed" in errors:
|
||||
print("[-]Connect Failed! Please Check your proxy config")
|
||||
print("[-]" + errors)
|
||||
else:
|
||||
print("[-]" + errors)
|
||||
print('[-]Connect Failed! Please check your Proxy or Network!')
|
||||
if config.getInstance().debug():
|
||||
if "getaddrinfo failed" in errors:
|
||||
print("[-]Connect Failed! Please Check your proxy config")
|
||||
print("[-]" + errors)
|
||||
else:
|
||||
print("[-]" + errors)
|
||||
print('[-]Connect Failed! Please check your Proxy or Network!')
|
||||
raise Exception('Connect Failed')
|
||||
|
||||
|
||||
@@ -64,15 +68,17 @@ def post(url: str, data: dict=None, files=None, cookies=None, ua: str=None, retu
|
||||
result.encoding = encoding or result.apparent_encoding
|
||||
return result
|
||||
except Exception as e:
|
||||
print(f"[-]Connect: {url} retry {i + 1}/{retry}")
|
||||
if config.getInstance().debug():
|
||||
print(f"[-]Connect: {url} retry {i + 1}/{retry}")
|
||||
errors = str(e)
|
||||
if "getaddrinfo failed" in errors:
|
||||
print("[-]Connect Failed! Please Check your proxy config")
|
||||
print("[-]" + errors)
|
||||
else:
|
||||
print("[-]" + errors)
|
||||
print('[-]Connect Failed! Please check your Proxy or Network!')
|
||||
raise Exception('Connect Failed')
|
||||
if config.getInstance().debug():
|
||||
if "getaddrinfo failed" in errors:
|
||||
print("[-]Connect Failed! Please Check your proxy config")
|
||||
print("[-]" + errors)
|
||||
else:
|
||||
print("[-]" + errors)
|
||||
print('[-]Connect Failed! Please check your Proxy or Network!')
|
||||
raise Exception('Connect Failed')
|
||||
|
||||
|
||||
class TimeoutHTTPAdapter(HTTPAdapter):
|
||||
|
||||
Reference in New Issue
Block a user