listener event
continuous-integration/drone/push Build is passing

This commit is contained in:
jianxin committed 2024-04-10 09:42:04 +08:00
1 parent 5b7030e755
commit 6c41aed083
3 files changed
+64 -10

No files matched your search

+7
View File
@@ -18,6 +18,7 @@ from lark_oapi.api.bitable.v1 import *
from app.task import *
from app.utils.utils import *
from app.task import *
from app.utils.fs_utils import AESCipher
load_dotenv()
@@ -69,8 +70,14 @@ def do_p2_im_message_receive_v1(data: P2ImMessageReceiveV1) -> None:
def do_bitable_record_add(data) -> None:
encrypt = "P37w+VZImNgPEO1RBhJ6RtKl7n6zymIbEG1pReEzghk="
cipher = AESCipher(encrypt_key)
print("明文:\n{}".format(cipher.decrypt_string(encrypt)))
print(data)
print(dir(data))
print(data.schema)
print(dir(data.schema))
handler = (
+23 -10
View File
@@ -83,7 +83,7 @@ if __name__ == "__main__":
)
detail_url = (
"https://ying-dao.feishu.cn/wiki/UiydwSXoIi1w14ksJfQcaIP6nh6?from=from_copylink"
"https://ying-dao.feishu.cn/wiki/EdHQwOhV9iLuh7kZTkwcX6OfnIe?from=from_copylink"
)
create_demand_url = (
@@ -91,17 +91,29 @@ if __name__ == "__main__":
)
app_list = [
"企微群发消息: 在文件传输助手中根据群名单逐条转发信息",
"TEMU商品复制上架: TEMU商品多店铺一键铺货",
"Instagram关键词抓取红人信息: 根据条件抓取红人邮箱以及其他基本信息",
"TikTok关键词抓取红人信息: 根据条件筛选符合条件的红人,获取红人信息",
"查集装箱实际到港时间-6大航司: 根据船公司和提单号在对应的官网查询到港时间",
"精选联盟批量邀约: 该在精选联盟设置筛选条件后并对达人批量邀约的功能",
"快手达人批量邀约: 在快手设置筛选条件后并对达人批量邀约的功能",
"视频号达人批量邀约: 在视频后台设置筛选条件并对达人批量邀约的功能",
]
activity_list = [
"云码验证码扩展: 通用轨迹验证, 通用单图滑块验证, 京东-旋转验证码",
"Excel 扩展操作: 设置筛选器",
"批量数据抓取(Java): Java单次表格数据抓取,Java多页连续表格数据抓取",
"网页扩展操作: 智能日期选择器,滚动元素至可视区域,隐藏元素,显示元素...",
"PostgreSQL 扩展: 执行sql语句,建立连接,添加数据记录,批量添加记录...",
"天猫字体解密扩展: 获取天猫价格解密字典, 解密天猫价格内容",
]
# app_list = [
# "企微群发消息: 在文件传输助手中根据群名单逐条转发信息",
# "TEMU商品复制上架: TEMU商品多店铺一键铺货",
# "Instagram关键词抓取红人信息: 根据条件抓取红人邮箱以及其他基本信息",
# "TikTok关键词抓取红人信息: 根据条件筛选符合条件的红人,获取红人信息",
# "查集装箱实际到港时间-6大航司: 根据船公司和提单号在对应的官网查询到港时间",
# ]
# activity_list = [
# "云码验证码扩展: 通用轨迹验证, 通用单图滑块验证, 京东-旋转验证码",
# "Excel 扩展操作: 设置筛选器",
# ]
app_text = "\n".join(f"🔹{item}" for item in app_list).strip()
activity_text = "\n".join(f"🔸{item}" for item in activity_list).strip()
@@ -115,12 +127,13 @@ if __name__ == "__main__":
# "7g3756f4",
# ],
pyload = {
"department_ids": ["9fg37g65b1b5b24e"],
"department_ids": ["4gge82cgb18f52af", "8a612b6c9184b118", "d7g1374b1238d267"],
"user_ids": [],
"msg_type": "interactive",
"card": {
"type": "template",
"data": {
"template_id": "AAq1lbVRQxYxG",
"template_id": "ctp_AAikuuqPwN0o",
"template_variable": {
"app_text": app_text,
"activity_text": activity_text,
+34
View File
@@ -0,0 +1,34 @@
import hashlib
import base64
from Crypto.Cipher import AES
class AESCipher(object):
def __init__(self, key):
self.bs = AES.block_size
self.key = hashlib.sha256(AESCipher.str_to_bytes(key)).digest()
@staticmethod
def str_to_bytes(data):
u_type = type(b"".decode("utf8"))
if isinstance(data, u_type):
return data.encode("utf8")
return data
@staticmethod
def _unpad(s):
return s[: -ord(s[len(s) - 1 :])]
def decrypt(self, enc):
iv = enc[: AES.block_size]
cipher = AES.new(self.key, AES.MODE_CBC, iv)
return self._unpad(cipher.decrypt(enc[AES.block_size :]))
def decrypt_string(self, enc):
enc = base64.b64decode(enc)
return self.decrypt(enc).decode("utf8")
if __name__ == "__main__":
encrypt = "P37w+VZImNgPEO1RBhJ6RtKl7n6zymIbEG1pReEzghk="
cipher = AESCipher("test key")
print("明文:\n{}".format(cipher.decrypt_string(encrypt)))