葫芦娃活动预约监控,有活动第一时间提醒你抢茅台必备神器

方便在葫芦娃系列有活动时候第一时间通知提醒你!避免错过最佳的活动时间,坚持预约申请才有机会中签,才能购买1499的飞天茅台酒!

本代码是python开发,使用起来很简单!自己再对接个push就行了!可以放青龙里面跑!设置个定时就行!


import requests, time, logging


def get_proxy():
    ip = ''
    proxies = {'http': ip, 'https': ip}
    return proxies


proxies = get_proxy()
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'}


def log(message, level=logging.INFO):
    logging.basicConfig(level=level, format='%(asctime)s %(levelname)s: %(message)s')
    logging.log(level, message)

def pushplus(text):
    headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36'}
    url = 'http://www.pushplus.plus/send/'
    data = {
        "token": "",
        "title": f"葫芦娃预约提醒!",
        "content": f'{text}\n',
        "topic": "maotai",
        "template": "html"
    }
    requests.post(url, data=data, headers=headers)
def get():
    url = 'https://api.weare666.cn/getAppointInfo'
    r = requests.post(url, headers=headers, proxies=proxies)
    a=r.json()
    data=''
    for i  in a['gridItems']:
        miniLink=i['miniLink']
        title=i['title']
        status=i.get('status','')
        if status !='':
            data+=f'{miniLink}  {title} {status}\n'
    print(data)
def hlw():
    headers={'Host':'huluwa.allpusher.com',
'Connection':'keep-alive',
'xweb_xhr':'1',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781 NetType/WIFI ',
'Content-Type':'application/json',
'Accept':'*/*',
'Sec-Fetch-Site':'cross-site',
'Sec-Fetch-Mode':'cors',
'Sec-Fetch-Dest':'empty',
'Referer':'https://servicewechat.com/wxb1fcbc0717d613e3/50/page-frame.html',
'Accept-Encoding':'gzip, deflate, br',
'Accept-Language':'zh-CN,zh;q=0.9',}
    url='https://huluwa.allpusher.com/api/getAppointInfo'
    r = requests.get(url, headers=headers,proxies=proxies)
    try:
        a=r.json()
        data=''
        for i  in a['data']:
            title=i['title']#名称
            miniLink=i['miniLink']#小程序链接
            isAppoint=i['isAppoint']#是否有活动
            remark=i['remark']#活动日期
            appointCounts=i['appointCounts']#数量
            print(f"{miniLink} {title} {isAppoint} 最近日期:{remark} 数量:{appointCounts}")
            if isAppoint !='无活动':
                data+=f"{miniLink} {title} {isAppoint} 最近日期:{remark} 数量:{appointCounts}\n"
        if data=='':
            print(f"近期无活动")
        else:
            print(data)
            pushplus(data)
        return data
    except Exception as e:
        print(f"未获取到数据{e}")
if __name__ == '__main__':
    hlw()

 

THE END