吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1305|回复: 5
收起左侧

[其他原创] 检测开封菜app点单状态

[复制链接]
lineulb 发表于 2022-4-11 14:04
本帖最后由 lineulb 于 2022-4-11 14:23 编辑

本人写的,转帖请写明来自吾爱。
上海或是南京kfc手机平台软件外卖是否支持点单的检测脚本,不建议不能自己取餐的小伙伴使用!不建议不能自己取餐的小伙伴使用!不建议不能自己取餐的小伙伴使用!




[Python] 纯文本查看 复制代码
from time import sleep

import requests
import json
from datetime import datetime
from datetime import timedelta
from datetime import timezone

from corpwechatbot import AppMsgSender

# 访问该地址转经纬度地址
# https://lbs.amap.com/tools/picker
#按关键字搜索栏目下填入你的地址 如 上海黄浦区人名广场
# 默认通知使用的是企业微信接口,如果您有企业微信接口填入您的信息即可使用
# 通知方式可以是邮箱、微信接口或是qq接口,请自行添加,可以搜索todo,在todo之后适合地方添加即可

def appMsgSender(content):
  app = AppMsgSender(corpid='',  # 你的企业id
                     corpsecret='',  # 你的应用凭证密钥
                     agentid='')  # 你的应用id
  app.send_text(content)

def btime():
    SHA_TZ = timezone(
      timedelta(hours=8),
      name='Asia/Shanghai',
    )
    # 协调世界时
    utc_now = datetime.utcnow().replace(tzinfo=timezone.utc)
    # print(utc_now, utc_now.tzname())
    # 北京时间
    beijing_now = utc_now.astimezone(SHA_TZ)
    # print(beijing_now, beijing_now.tzname())

    # 系统默认时区
    local_now = utc_now.astimezone()
    # print(local_now, local_now.tzname())
    return beijing_now

def checkkfcinit():
  url = "https://m.4008823823.com.cn/taroapi/base/v2/initial"

  payload = json.dumps({
    "body": {},
    "portalType": "kfc_delivery_h5",
    "portalSource": "KFC_WEB",
    "appVerParams": {
      "hotUpdateLabel": "updateLabel"
    },
  })
  headers = {
    'Content-Type': 'application/json',
    'Accept': '*/*',
    'host': 'm.4008823823.com.cn',
  }

  response = requests.request("POST", url, headers=headers, data=payload.encode(), timeout=10000)
  resjson = json.loads(response.text)
  # print(resjson['userUniqueId'])
  # print(response.text)
  if len(resjson['userUniqueId']) == 36:
    uuid = str(resjson['userUniqueId'])
  else:
      print(f"{btime()} :  unable get uuid")
      # [i]todo Notify you of status changes
[/i][i]      [/i]appMsgSender(f"{btime()} :  unable get uuid")
  return uuid

def checkkfcstatus(city,longitude,latitude,uuid):
    url = "https://m.4008823823.com.cn/taroapi/misc/v2/getNearestStore"
    if city == 'shanghai':
        citycode = "00010"
    elif city == 'nanjing':
        citycode = "00008"
    else:
        return None

    payload = json.dumps({
      # "body": {
      #   "webValidateCustomerAddress": {
      #     "cityCode": "00008",
      #     "longitude": "",
      #     "latitude": "",
      #     "mainAddress": "1",
      #     "supplementalAddress": "1"
      #   }
      "body": {
          "webValidateCustomerAddress": {
              "cityCode": citycode,
              "longitude": longitude,
              "latitude": latitude,
              "mainAddress": "1",
              "supplementalAddress": "1"
          }
      },
      "portalType": "kfc_delivery_h5",
      "portalSource": "KFC_WEB",
      "userUniqueId": uuid,
      "appVerParams": {
        "hotUpdateLabel": "updateLabel"
      },
    })
    headers = {
      'Content-Type': 'application/json',
      'Accept': '*/*',
      'host': 'm.4008823823.com.cn',
    }
    responseall = requests.request("POST", url, headers=headers, data=payload.encode(), timeout=10000)
    resjson = json.loads(responseall.text)
    print(responseall.text)
    # print(resjson["data"]["webNearestStore"])
    if resjson["data"]["webNearestStore"] != None:
        print(f"{btime()},{city},{longitude},{latitude},status : True")
        print("快去打开app点餐吧!")
        # [i]todo Notify you of status changes
[/i][i]        [/i]appMsgSender(f"{btime()} :  success!!!!!!!!!!")
        # Stop after notify you
        return True
    else:
        print(f"{btime()},{city},{longitude},{latitude},status : False")
        print("没开门呢!")
        return False

if __name__ == '__main__':
    # [i]todo Notify you of status changes
[/i][i]    [/i]appMsgSender(f"{btime()} :  task begin")
    # 要改的参数就三个值 城市名 上海 = shanghai 南京 = nanjing,其他城市不支持,经纬度自己填,先是精度再是纬度。
    # Stop after notify you
    # while checkkfcstatus("shanghai",121.627531,31.181985,checkkfcinit()) == False:
    # Always check
    while 1 == 1:
        checkkfcstatus("shanghai",121.627531,31.181985,checkkfcinit())
        #300秒一次,自行修改,不要小于60秒
        sleep(300)



requirements.txt

[Python] 纯文本查看 复制代码
certifi==2021.10.8
charset-normalizer==2.0.12
corpwechatbot==0.6.2
cptools==1.4.7
idna==3.3
requests==2.27.1
tqdm==4.64.0
urllib3==1.26.9


查询自己的经纬度
截屏2022-04-11 下午1.46.26.png

有问题可以跟帖,支持维护到4.15日

免费评分

参与人数 2吾爱币 +6 热心值 +1 收起 理由
wushaominkk + 5 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
小飞虫 + 1 热心回复!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

q-147483 发表于 2022-4-11 15:14
哈哈  这个我太喜欢了!
小飞虫 发表于 2022-4-11 18:16
 楼主| lineulb 发表于 2022-4-11 19:18
小飞虫 发表于 2022-4-11 18:16
建议增加推送功能

todo后面就是自己写推送的地方,最简单就是用yagmail发邮箱嘛,到时候看需要的人多不多,多的话就之后把这个简单功能加上。
头像被屏蔽
xiadongming 发表于 2022-4-11 20:52
提示: 作者被禁止或删除 内容自动屏蔽
东方星雨 发表于 2022-4-12 15:15
xiadongming 发表于 2022-4-11 20:52
开封人必须支持一下,,

KFC跟开封啥关系
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-23 21:57

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表