import requests
import time
url = 'https://promotion.waimai.meituan.com/lottery/limitcouponcomponent/fetchcoupon'
cookies = '_lxsdk_s=188856c82a3-ff7-799-ecc%7C3993580001%7C12; isUuidUnion=true; iuuid=23e68aec-dac2-4446-8b01-6170670c4895; _lx_utm=utm_source%3Dwxshare; WEBDFPID=871u410ux9xz5xvv1wzx45v40y7v34uy811584z3v42979586w64x27z-2000083625348-1684723624935QIUEUQS868c0ee73ab28e1d0b03bc83148500068161; openid=oOpUI0aVqTmBLdOwYPpxOf0h8g7Y; token=AgFMIlC0qNMPrs_jfyqe-L0EndRTrsrTixAQjAbCboMnDqbOlB42CKaXWKK9RdYRnpNA-h4Kt1eyEAAAAADgGAAAkXP-eNSGTltrF41RNdLPG84hA1IER1bfHDn2nOrEkvM90hdek-c6zdJpddKwbLGS; userInfo=%7B%22openidCipher%22%3A%22AwQAAABJAgAAAAEAAAAyAAAAPLgC95WH3MyqngAoyM%2Fhf1hEoKrGdo0pJ5DI44e1wGF9AT3PH7Wes03actC2n%2FGVnwfURonD78PewMUppAAAADjskzw9F7RVGz91ZrUiWqXbz4%2Bxf2VgLFn7MYkC4GDPbW7ZI7j9NKijceLO00FIuQRIEp0BJWqWjQ%3D%3D%22%2C%22unionid%22%3A%22oNQu9t_LCP_SnAKbz6qKF_EA69d4%22%2C%22avatarUrl%22%3A%22https%3A%2F%2Fimg.meituan.net%2Favatar%2F5e02bd384ecd3bcdd3ba3c0bd542205227970.jpg%22%2C%22nickName%22%3A%22Chen%22%2C%22openid%22%3A%22oOpUI0aVqTmBLdOwYPpxOf0h8g7Y%22%2C%22modtime%22%3A1681554150%2C%22fetchTime%22%3A1685673439994%2C%22uniqueid%22%3A%22oNQu9t_LCP_SnAKbz6qKF_EA69d4%22%7D; userid=3993580001; _lxsdk=23e68aec-dac2-4446-8b01-6170670c4895; 1=1; __lxsdk_params=bHhjdWlkOjE4ODNlZWY2MjMyYzgtMTc0MzU3NTFjZTllOGMtMC0wLTE4ODNlZWY2MjMyOTthc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wiY2F0X2lkIjoiLTk5OSIsImx4X3RhZ190bSI6MTY4NDgyNTI3NDE0MH0sImNfYTNicjJvcW8iOnsiYmlkIjoiYl9ncm91cF82dGwyejNrYl9tYyIsImJ1dHRvbl9uYW1lIjoi5pu05paw6Lqr5Lu95L*h5oGvIiwidGl0bGUiOiLlrp7lkI3orqTor4EiLCJseF90YWdfdG0iOjE2ODQ4MjUyODQ2NTd9fX0.; _lx_ver=3.8.9; app=214; homepage=1; iph=11000101394016; location=0_0; mina_name=mt-weapp; modeId=1066; openId=oJVP50HdINbEHFalMtWhcUyX1_yQ; platform=wx-miniprogram; requestId=1660903742016589849; uuid=1883eef6232c8-17435751ce9e8c-0-0-1883eef62329; wechatAppId=wxde8ac0a21135c07d; ta.uuid=1660477351613866074; _lxsdk_cuid=188415192bac8-0c9eb2bb0f6e29-f1a4b5e-505c8-188415192bac8'
data = {
'couponReferId':'5865AE2DF47846FC8C2B85078C075051',
'actualLng':'108.674404',
'actualLat' : '19.042169',
'geoType' : '2',
'gdPageId': '481021',
'pageId' : '482299',
'version' : '1',
'utmSource':'',
'utmCampaign':'',
'instanceId' :'16825614060250.5872321938318412',
'componentId' : '16825614060250.5872321938318412'
}
headers = {
'Connection':'keep-alive',
'Content-Length':'2528',
'Accept':'application/json, text/plain, */*',
'mtgsig':'{"a1":"1.0","a2":1682916907546,"a3":"uz3x8y4zzw495w70z472yyvzuuuxxv60812w4z3vz1u97958xy0135x4","a4":"0a4f3202ad50b67002324f0a70b650ad1828e5df689eb572","a5":"0qaELmW6gNAtJ7UTvaEq2G+VbqmH0MnuUxCQmC3bKfSxrDipZqHjVi4n0R3dB/Q2XJPCt7EAt82ljzJWh9TkAiGZhMh=","a6":"h1.2lYyNgvWjVsY3R5qksEQaR02Z5U4NNrVWWdWTvKuqBhs6VR3ODuxFpxWDiWLYMUvVqeNOMn5KQ5lKaULHYhNnzGq2Vjm6JBmopLylo82ckrbk26GebBgZhTTreAx0a/uSFiWE1EzQ3vL3akVMgRgkgW076CsToe4ubeBHB70XPkiHI3QDtA9/Y+BNegH+GWQTRCcLYDcyrLlqBUKw4bwIsRf7zWldZEEdeo8Cuenm+lR+uxmLFFYtjijkWVGkI+ZhfrUp0g9jXMlr01YvEehraplssI3AwMxwMO58a1sB2FBGv6p+o6mx9SSLZ9d3uc56nkozvVUEud4oRum0SVa+RPiv/CNnn83cxbcQNMVQJdzwFt9UmF9KrG/HE5pD/FSMYVGCDfsqhPwGMTFdioRPAOl2Fbg+o0ZRyh+5u25gF90SzMOONPCS2TuLYxOVn3AO","a7":"","x0":4,"d1":"fc91455ad9cef39a8e5ff71b40420d3e"}',
'User-Agent':'Mozilla/5.0 (Linux; U; Android 11; zh-cn; Redmi K30i 5G Build/RKQ1.200826.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/100.0.4896.127 Mobile Safari/537.36 XiaoMi/MiuiBrowser/17.6.40423 swan-mibrowser',
'Content-Type':'application/json',
'Origin':'https://market.waimai.meituan.com',
'Referer':'https://market.waimai.meituan.com/',
'Accept-Encoding':'gzip, deflate, br',
'Accept-Language':'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
'Cookie':cookies,
}
json_data = {
"cType":"mti",
"fpPlatform":3,
"wxOpenId":"",
"appVersion":"",
"mtFingerprint":"H5dfp_1.8.2_tttt_1DhzJ1oK7kMSdUCI29XW7kBhfXcEjCLB3ojlUq+T1iEoMFNoe9g/Almk03Ta/xvDC5OSbfq9KD+7djclMRvr+Wql5gQ1cV5rAB+/hDGTRrBQPSodfGFEMm/fN3vxmDCBQfP53wdcOwyK55xU7P5NxOkx1DF7W8vV9qlUWKDKnagi50SJYRL1YHVe0nbhn2FURcAB2AWixUWmMXMPNfpsx55pD58J3WLVQ001hHehpt1l9nqY941YbdGHzhkD5VVsTerCrVzrI7S2yfQUAWvxQ1+amIszJFg91aFK96G9aR7WojadeinSruRqXsTD4u85nCp4IpsA4UHodzZg3kvUkGKvOEqatdu8utMHxs6a93/XetCjrJ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wy7QQA8h3itxMHVde4pfnenK35XBn3dqMm+yzID+NeouxD09MA8HzjAaIVdHq8M9ebcGpa4YrlGf5T3Uw0op4RD8LBaCN1gLgMJXyb1dZ7/i7EgxUt5uAjvxYOsDxuhP3W5hZgDAemvgdeCAcPCXlnp5pLXwkxf7V2l+0VWg1Ma47B5DqXyk6WNGzuIb5CKAacdfjLwbl/MSAPR25UreM3NnCmsEfHszGLhQjKuDIpOjOghH9/lsvlqx4RA4ktM78lIUY+gGs4iQ0c0TvicjS6i74JbLtNEbcNXUhCibicSe38IaR4mi8aKcAPmxUzz0GFG0jecpyaUBT42OmOJkhuDz5mnvZCQPZFdvCy4J+ZyBwzQA+TkL1EEVOJKVLeAaFp1AQkCU1fSq8P+lo9eBQl3flpe4/Sca/jyBtkvvvaO6qCTYW7T7PsJocBq70BfGnORu4EfXYZMJ7Xzz39k5z10rbjPgbMofVJ8+ZlrMzT47gWCwGorHxsU1jrBs294VWPhvw9C5QArB2AntmXmjXd0bc3pswvgnu0MpQTpLF8hVFKUaA6xgx7G7kuPoQjKCu7D9IFYG12zpUrv2zT7WoP/lu0wxorxxG77iBqhea7KbTsKNdys0NqpEVVNACxmTAg0cK96Ma3TqsS+KQB4Jc8vFohDEXmRPgH+B9YlCEjuOGGHkrcI1UwU7CqqqejLCha6M9Lfg6YZaDG1/5PAjtgopMQ56lctVh6H1ArvMdx8c6HXqnHhxwsjhB835DpxSjuvzOaRKu2X10Gbt4/N7OERpnftMMeeULDGzg+iwoo8qCH6A/AIOGpEd3Xh0gRgMAYVosrDujGqFOqUzGiS0grXMjftOko5pGY+fydEj5hWQxdQoj7cwSDSte3bhxeYiqlpqYg1CVE7GPBnVpbN37nEaMzxLCPna4nO+JShTfOer0AXOnyDMNdNY5fPRmIubk0X/UX9WlZ6JqCAoV/V0CB/"}
msg = ''
while '成功' not in msg:
response = requests.post(url,headers = headers,params=data,json = json_data)
msg = response.text
print('msg:',msg)
if '已领取' in msg or '来晚了' in msg:
print('留点机会给年轻人吧!msg:',msg)
break
time.sleep(0.002)
else:
print('领取成功,msg为:',msg)
- 1
- 2
前往页