mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-05-07 03:48:44 +08:00
update
This commit is contained in:
parent
229727d4b1
commit
b1759d0018
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
47
jd_ppdt.js
47
jd_ppdt.js
@ -41,6 +41,8 @@ if ($.isNode()) {
|
||||
}
|
||||
continue
|
||||
}
|
||||
await xxx9();
|
||||
await $.wait(1000);
|
||||
await xxx8();
|
||||
await $.wait(1000);
|
||||
await xxx7();
|
||||
@ -426,6 +428,51 @@ async function xxx8() {
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
async function xxx9() {
|
||||
let opt = {
|
||||
url: `https://api.m.jd.com/?client=wh5&appid=ProductZ4Brand&functionId=superBrandDoTask&t=1674924479339&body=%7B%22source%22:%22hall_1111%22,%22activityId%22:1012484,%22completionFlag%22:1,%22encryptProjectId%22:%222AN5xMLxaTnvp8ienwesrM8d3ksF%22,%22encryptAssignmentId%22:%223V5ANrek6PQBNSkjtgwPBhyGNey7%22,%22assignmentType%22:0,%22actionType%22:0%7D`,
|
||||
headers: {
|
||||
'Origin': 'https://prodev.m.jd.com',
|
||||
'User-Agent': $.UA,
|
||||
'Cookie': cookie
|
||||
}
|
||||
}
|
||||
return new Promise(async (resolve) => {
|
||||
$.post(opt, async (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`)
|
||||
console.log(` API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
data = JSON.parse(data)
|
||||
if (data.code == 0) {
|
||||
if (data.data.bizCode == 0) {
|
||||
if (data.data?.result?.rewards.length != 0) {
|
||||
if (data.data?.result?.rewards[0].awardType === 3) {
|
||||
console.log(` 恭喜获得 ${data.data?.result?.rewards[0].beanNum} 京豆`);
|
||||
} else {
|
||||
console.log(JSON.stringify(data.data?.result?.rewards));
|
||||
}
|
||||
} else {
|
||||
console.log(JSON.stringify(data.data?.result));
|
||||
}
|
||||
} else {
|
||||
console.log(data.data.bizMsg);
|
||||
}
|
||||
} else {
|
||||
console.log(data.msg)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp)
|
||||
} finally {
|
||||
resolve(data)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function TotalBean() {
|
||||
return new Promise((resolve) => {
|
||||
const options = {
|
||||
|
163
magic.json
163
magic.json
@ -18,7 +18,8 @@
|
||||
"monitor_cache_size": 100,
|
||||
"monitor_cars 是你要监控的对象,需要填上自己bot的id和线报频道或群组id": 1,
|
||||
"monitor_cars": [
|
||||
-1001718319262
|
||||
-1001718319262,
|
||||
-1001718319261
|
||||
],
|
||||
|
||||
"monitor_auto_stops": [
|
||||
@ -34,6 +35,24 @@
|
||||
],
|
||||
"monitor_converters 转换关键词基于正则表达式实现": 1,
|
||||
"monitor_converters": {
|
||||
"((?=.*jd_task_lzzd_custom)(?=.*https)^.*$)": {
|
||||
"env": "export M_WX_TEAM_URL=\"%s\""
|
||||
},
|
||||
"(jd_lzkj_activityId|jd_task_lzzd_custom)": {
|
||||
"env": "export M_WX_TEAM_URL=\"https://lzkjdz-isv.isvjcloud.com/wxTeam/activity2/875406?activityId=%s\""
|
||||
},
|
||||
"((?=.*jd_task_cjzd_custom)(?=.*https)^.*$)": {
|
||||
"env": "export M_WX_TEAM_URL=\"%s\""
|
||||
},
|
||||
"(jd_task_cjzd_custom|jd_cjhy_activityId)": {
|
||||
"env": "export M_WX_TEAM_URL=\"https://cjhydz-isv.isvjcloud.com/wxTeam/activity?activityId=%s\""
|
||||
},
|
||||
"^(?=(.|\\n)*jd_zdjr_activityId)(?=(.|\\n)*cjhy)(.|\\n)(?=(.|\\n)*积分)(.|\\n)*$": {
|
||||
"env": "export M_WX_TEAM_URL=\"https://cjhydz-isv.isvjcloud.com/wxTeam/activity?activityId=%s\""
|
||||
},
|
||||
"^(?=(.|\\n)*jd_zdjr_activityId)(?=(.|\\n)*lzkj)(.|\\n)(?=(.|\\n)*积分)(.|\\n)*$": {
|
||||
"env": "export M_WX_TEAM_URL=\"https://lzkjdz-isv.isvjcloud.com/wxTeam/activity2/875406?activityId=%s\""
|
||||
},
|
||||
"^(?=(.|\\n)*jd_zdjr_activityId)(?=(.|\\n)*cjhy)(.|\\n)*$": {
|
||||
"env": "export M_WX_TEAM_URL=\"https://cjhydz-isv.isvjcloud.com/wxTeam/activity?activityId=%s\""
|
||||
},
|
||||
@ -284,5 +303,147 @@
|
||||
"queue_name": "M_WX_DADOUDOU_URL",
|
||||
"enable": true
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"/wxTeam/": {
|
||||
"name": "M组队瓜分",
|
||||
"env": "export jd_zdjr_activityId=\"%s\"\nexport jd_zdjr_activityUrl=\"%s\"\nexport jd_zdjr_type=\"%s\""
|
||||
},
|
||||
"/wxFansInterActionActivity/": {
|
||||
"name": "M粉丝互动",
|
||||
"env": "export M_WX_FANS_DRAW_URL=\"%s\""
|
||||
},
|
||||
"/wxMcLevelAndBirthGifts/": {
|
||||
"name": "M等级生日礼包",
|
||||
"env": "export M_WX_LEVEL_BIRTH_URL=\"%s\""
|
||||
},
|
||||
"(/wxCollectionActivity/|^(?=.*lorealjdcampaign)(?=.*activityType=10024).*$)": {
|
||||
"name": "M加购有礼",
|
||||
"env": "export M_WX_ADD_CART_URL=\"%s\""
|
||||
},
|
||||
"(^(?=.*lorealjdcampaign)(?=.*activityType=10024).*$|^(?=.*prod/cc/interactsaas)(?=.*activityType=10024).*$)": {
|
||||
"name": "M加购有礼",
|
||||
"env": "export M_WX_ADD_CART_URL=\"%s\""
|
||||
},
|
||||
"(^(?=.*dVF7gQUVKyUcuSsVhuya5d2XD4F)(?=.*code).*$)": {
|
||||
"name": "M邀请有礼JOY",
|
||||
"env": "export invite_code=\"%s\""
|
||||
},
|
||||
"(wxCollectCard)": {
|
||||
"name": "M集卡有礼",
|
||||
"env": "export M_WX_COLLECT_CARD_URL=\"%s\""
|
||||
},
|
||||
"(/wxKnowledgeActivity/)": {
|
||||
"name": "知识超人",
|
||||
"env": "export M_WX_KNOWLEDGE_URL=\"%s\""
|
||||
},
|
||||
"/microDz/": {
|
||||
"name": "微定制开卡",
|
||||
"env": "#微定制\nexport WDZactivityId=\"%s\""
|
||||
},
|
||||
"^(?=.*lorealjdcampaign)(?=.*activityType=10006).*$": {
|
||||
"name": "M邀请有礼LOREAL",
|
||||
"env": "export M_LOREAL_INVITE_URL=\"%s\""
|
||||
},
|
||||
"^(?=.*prod/cc/interactsaas)(?=.*activityType=10006).*$": {
|
||||
"name": "M邀请有礼INTERACT",
|
||||
"env": "export M_INTERACT_INVITE_URL=\"%s\""
|
||||
},
|
||||
"^(?=.*prod/cc/interactsaas)(?=.*activityType=10070).*$": {
|
||||
"name": "M邀请有礼INTERACT",
|
||||
"env": "export M_INTERACT_INVITE_URL=\"%s\""
|
||||
},
|
||||
"(/lzclient/|/wxDrawActivity/|^(?=.*gzsl-isv)(?=.*game).*$)": {
|
||||
"name": "M幸运抽奖",
|
||||
"env": "export M_WX_LUCK_DRAW_URL=\"%s\""
|
||||
},
|
||||
"(^(?=.*prod/cc/interactsaas)(?=.*activityType=10020).*$|^(?=.*prod/cc/interactsaas)(?=.*activityType=10021).*$|^(?=.*prod/cc/interactsaas)(?=.*activityType=10026).*$|^(?=.*prod/cc/interactsaas)(?=.*activityType=10031).*$|^(?=.*prod/cc/interactsaas)(?=.*activityType=10063).*$|^(?=.*prod/cc/interactsaas)(?=.*activityType=10080).*$)": {
|
||||
"name": "M幸运抽奖",
|
||||
"env": "export M_WX_LUCK_DRAW_URL=\"%s\""
|
||||
},
|
||||
"/completeInfoActivity/": {
|
||||
"name": "M完善有礼",
|
||||
"env": "export M_WX_COMPLETE_DRAW_URL=\"%s\""
|
||||
},
|
||||
"^(?=.*prod/cc/interactsaas)(?=.*activityType=10049).*$": {
|
||||
"name": "M完善有礼",
|
||||
"env": "export M_WX_COMPLETE_DRAW_URL=\"%s\""
|
||||
},
|
||||
"/drawCenter/": {
|
||||
"name": "M老虎机抽奖",
|
||||
"env": "export M_WX_CENTER_DRAW_URL=\"%s\""
|
||||
},
|
||||
"/wxGameActivity/": {
|
||||
"name": "M无线游戏",
|
||||
"env": "export M_WX_GAME_URL=\"%s\""
|
||||
},
|
||||
"(/wxShopGift/|shopGiftBag.html|newShopGiftBag.html)": {
|
||||
"name": "M关注特效",
|
||||
"env": "export M_WX_SHOP_GIFT_URL=\"%s\""
|
||||
},
|
||||
"^(?=.*prod/cc/interactsaas)(?=.*activityType=10058).*$": {
|
||||
"name": "M无线关注",
|
||||
"env": "export M_WX_SHOP_GIFT_URL=\"%s\""
|
||||
},
|
||||
"(/wxUnPackingActivity/)": {
|
||||
"name": "M分享福袋",
|
||||
"env": "export M_WX_UNPACK_DRAW_URL=\"%s\""
|
||||
},
|
||||
"/daily/": {
|
||||
"name": "M每日领奖",
|
||||
"env": "export M_WX_DAILY_GIFT_URL=\"%s\""
|
||||
},
|
||||
"/signActivity?": {
|
||||
"name": "M签到有礼",
|
||||
"env": "export M_WX_SHOP_SIGN_URL=\"%s\""
|
||||
},
|
||||
"(^(?=.*prod/cc/interactsaas)(?=.*activityType=10023).*$|^(?=.*prod/cc/interactsaas)(?=.*activityType=10040).*$)": {
|
||||
"name": "M签到有礼",
|
||||
"env": "export M_WX_SHOP_SIGN_URL=\"%s\""
|
||||
},
|
||||
"(/wxPointShopView/point)": {
|
||||
"name": "M积分兑换",
|
||||
"env": "export M_WX_POINT_DRAW_URL=\"%s\""
|
||||
},
|
||||
"/wxBuildActivity/": {
|
||||
"name": "M盖楼领奖",
|
||||
"env": "export M_WX_BUILD_DRAW_URL=\"%s\""
|
||||
},
|
||||
"/wxCartKoi/": {
|
||||
"name": "M购物车锦鲤",
|
||||
"env": "export M_WX_CARTKOI_URL=\"%s\""
|
||||
},
|
||||
"^(?=.*prod/cc/interactsaas)(?=.*activityType=10036).*$": {
|
||||
"name": "M购物车锦鲤",
|
||||
"env": "export M_WX_CARTKOI_URL=\"%s\""
|
||||
},
|
||||
"(/fansactiveall/|/videofangrowth/|/fansactivecopy/)": {
|
||||
"name": "M粉丝红包",
|
||||
"env": "export M_FANS_RED_PACKET_URL=\"%s\""
|
||||
},
|
||||
"(/wxSecond/)": {
|
||||
"name": "M读秒手速",
|
||||
"env": "export M_WX_SECOND_DRAW_URL=\"%s\""
|
||||
},
|
||||
"(/wxShopFollowActivity/)": {
|
||||
"name": "M关注抽奖",
|
||||
"env": "export M_WX_FOLLOW_DRAW_URL=\"%s\""
|
||||
},
|
||||
"(^(?=.*prod/cc/interactsaas)(?=.*activityType=10053).*$|^(?=.*prod/cc/interactsaas)(?=.*activityType=10069).*$)": {
|
||||
"name": "M无线关注",
|
||||
"env": "export M_WX_FOLLOW_DRAW_URL=\"%s\""
|
||||
},
|
||||
"/wxCollectCard/": {
|
||||
"name": "M集卡有礼",
|
||||
"env": "export M_WX_COLLECT_CARD_URL=\"%s\""
|
||||
},
|
||||
"/wxShareActivity/": {
|
||||
"name": "M分享有礼",
|
||||
"env": "export M_WX_SHARE_URL=\"%s\""
|
||||
},
|
||||
"/wxgame/activity/": {
|
||||
"name": "M打豆豆",
|
||||
"env": "export M_WX_DADOUDOU_URL=\"%s\""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
64
magic.py
64
magic.py
@ -67,6 +67,8 @@ logger.info(f"黑名单关键字-->{monitor_black_keywords}")
|
||||
monitor_scripts = properties.get("monitor_scripts")
|
||||
monitor_auto_stops = properties.get("monitor_auto_stops")
|
||||
logger.info(f"监控的自动停车-->{monitor_auto_stops}")
|
||||
rules = properties.get("rules")
|
||||
logger.info(f"监控的自动解析-->{monitor_auto_stops}")
|
||||
|
||||
if properties.get("proxy"):
|
||||
if properties.get("proxy_type") == "MTProxy":
|
||||
@ -161,6 +163,68 @@ async def handler(event):
|
||||
await client.send_message(bot_id, f'老板啥事?')
|
||||
|
||||
|
||||
# 提取多行转换
|
||||
async def converter_lines(text):
|
||||
before_eps = text.split("\n")
|
||||
after_eps = [elem for elem in before_eps if elem.startswith("export")]
|
||||
return await converter_handler("\n".join(after_eps))
|
||||
|
||||
|
||||
# 设置变量
|
||||
@client.on(events.NewMessage(from_users=[user_id], pattern='^(run|Run)$'))
|
||||
async def handler(event):
|
||||
try:
|
||||
reply = await event.get_reply_message()
|
||||
if event.is_reply is False:
|
||||
return
|
||||
if "export" in reply.text:
|
||||
# 提取变量
|
||||
text = await converter_lines(reply.text)
|
||||
text = re.findall(r'(export.*)', text)[0]
|
||||
await export(text)
|
||||
kv = text.replace("export ", "")
|
||||
logger.info(kv)
|
||||
key = kv.split("=")[0]
|
||||
action = monitor_scripts.get(key)
|
||||
command = action.get("task", "")
|
||||
await cmd(command)
|
||||
else:
|
||||
# 提取变量
|
||||
activity_id, url = await get_activity_info(reply.text)
|
||||
if activity_id is None:
|
||||
logger.info(f"未找到id [%s],退出", url)
|
||||
return
|
||||
is_break = False
|
||||
for rule_key in rules:
|
||||
if is_break:
|
||||
break
|
||||
result = re.search(rule_key, url)
|
||||
if result is None:
|
||||
logger.info(f"不匹配%s,下一个", rule_key)
|
||||
continue
|
||||
value = rules.get(rule_key)
|
||||
env = value.get("env")
|
||||
argv_len = len(re.findall("%s", env))
|
||||
env_key = re.findall("export (.*)=", env)[0]
|
||||
if argv_len == 1:
|
||||
env = env % url
|
||||
elif argv_len == 2:
|
||||
env = env % (activity_id, url)
|
||||
elif argv_len == 3:
|
||||
domain = re.search('(https?://[^/]+)', url)[0]
|
||||
env = env % (activity_id, domain, "None")
|
||||
else:
|
||||
logger.info("还不支持")
|
||||
break
|
||||
await export(env)
|
||||
action = monitor_scripts.get(env_key)
|
||||
command = action.get("task", "")
|
||||
await cmd(command)
|
||||
break
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
|
||||
|
||||
# 设置变量
|
||||
@client.on(events.NewMessage(chats=[bot_id], pattern='^清理缓存$'))
|
||||
async def handler(event):
|
||||
|
Loading…
Reference in New Issue
Block a user