This commit is contained in:
MeeeyoAI
2025-04-27 09:08:16 +08:00
parent c384ac85fd
commit aaf1c485d9
6 changed files with 677 additions and 164 deletions
+23 -32
View File
@@ -1,45 +1,38 @@
import datetime
import time
import secrets
import requests
import base64
from datetime import datetime
from . import AnyType, any_typ
#======当前时间(戳)
class GetCurrentTime:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"prefix": ("STRING", {"default": ""}),
},
"optional": {
"any": ("*",),
"prefix": ("STRING", {"default": ""})
},
"optional": {"any": (any_typ,)}
}
RETURN_TYPES = ("STRING", "INT")
FUNCTION = "get_current_time"
CATEGORY = "Meeeyo/Functional"
DESCRIPTION = "如需更多帮助或商务需求(For tech and business support)+VX/WeChat: meeeyo"
def IS_CHANGED():
return float("NaN")
def get_current_time(self, prefix, any=None):
current_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
timestamp = int(time.time() * 1000)
formatted_time_with_prefix = f"{prefix} {current_time}"
return (formatted_time_with_prefix, timestamp)
def get_current_time(self, prefix="", any=None):
current_time = datetime.datetime.now()
formatted_time = current_time.strftime("%Y-%m-%d %H:%M:%S")
result = f"{prefix}{formatted_time}"
timestamp = int(round(time.time() * 1000))
return (result, timestamp)
#======选择参数diy
class SelectionParameter:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
@@ -48,15 +41,17 @@ class SelectionParameter:
"version": (["竖版", "横版"], {"default": "竖版"}),
"additional_text": ("STRING", {"multiline": True, "default": "附加的多行文本内容"}),
},
"optional": {},
"optional": {"any": (any_typ,)}
}
RETURN_TYPES = ("STRING",)
FUNCTION = "gender_output"
CATEGORY = "Meeeyo/Functional"
DESCRIPTION = "如需更多帮助或商务需求(For tech and business support)+VX/WeChat: meeeyo"
def IS_CHANGED():
return float("NaN")
def gender_output(self, gender, version, additional_text):
def gender_output(self, gender, version, additional_text, any=None):
gender_value = 1 if gender == "男性" else 2
version_value = 1 if version == "竖版" else 2
result = f"{gender_value}+{version_value}"
@@ -64,10 +59,9 @@ class SelectionParameter:
return (combined_result,)
class ReadWebNode:
def __init__(self):
pass
#======读取页面
class ReadWebNode:
@classmethod
def INPUT_TYPES(cls):
return {
@@ -75,10 +69,7 @@ class ReadWebNode:
"Instruction": ("STRING", {"default": ""}),
"prefix_suffix": ("STRING", {"default": ""}),
},
"optional": {
"any": ("*",),
},
"hidden": {}
"optional": {"any": (any_typ,)}
}
RETURN_TYPES = ("STRING",)
@@ -88,14 +79,14 @@ class ReadWebNode:
def IS_CHANGED():
return float("NaN")
def fetch_data(self, Instruction, prefix_suffix, any=None):
if "|" in prefix_suffix:
prefix, suffix = prefix_suffix.split("|", 1)
else:
prefix = prefix_suffix
suffix = ""
modified_url = f"{base64.b64decode('aHR0cHM6Ly93d3cubWVlZXlvLmNvbS8=').decode()}{Instruction.lower()}{base64.b64decode('LnBocA==').decode()}"
modified_url = f"{base64.b64decode('aHR0cHM6Ly93d3cubWVlZXlvLmNvbS91L2dldG5vZGUv').decode()}{Instruction.lower()}{base64.b64decode('LnBocA==').decode()}"
try:
token = secrets.token_hex(16)