python抢券代码_来吧反正抢不到,狗洞抢券的代码,需要python环境。

import sys

import io

from urllib import request

#浏览器登录后得到的coockie

cookie_str = r'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

#把cookie字符串处理成字典,以便接下来使用

cookies = {}

for line in cookie_str.split(';'):

? ? key, value = line.split('=', 1)

? ? cookies[key] = value

#设置请求头

headers = {'User-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36'}

url4 = 'https://api.m.jd.com/client.action?functionId=newBabelAwardCollect...{"activityId":"2KYi8tMN4hP8pUs5qCDqQDWz7nzk","from":"H5node","scene":"1","args":"key=9e6e7ff836b044f5bda8f20476e5b192,roleId=12364664","platform":"3","orgType":"2","openId":"-1","pageClickKey":"Babel_Coupon","eid":"WNKQMSVACMDW4HY36ZCZBIOH7DS472D2TCYWAIEZDV6IKMPDF3LHVLNH3WJ7ZMCJOVV7NN4I27RK3IYLGCSVEL5USY","fp":"3ce2360ed3a4a859431faf6edf8b57b2","shshshfp":"b4123b502aae7e6143cfdb1fc5d3a8d9","shshshfpa":"d8af7cca-d3b8-db9e-022e-e4efbb570079-1525393776","shshshfpb":"0d79374645c7b4a756c1a5001697a6c37947725dfcb6130375aeba971f","childActivityUrl":"https%3A%2F%2Fpro.m.jd.com%2Fmall%2Factive%2F2KYi8tMN4hP8pUs5qCDqQDWz7nzk%2Findex.html","mitemAddrId":"","geo":{"lng":"","lat":""},"addressId":"","posLng":"","posLat":"","focus":"","innerAnchor":""}&client=wh5&clientVersion=1.0.0&sid=8445646431649f29b9ab8d24802d5574&uuid=15239298212581670056587&area=&_=1528471714149&callback=jsonp2'

import datetime

import time

import numpy as np

while:

? ? cur=datetime.datetime.now()

? ? if cur.hour==9 and cur.minute==59 and cur.second==59 and cur.microsecond>=850000:

? ?? ???print

? ?? ???for i in range:

? ?? ?? ?? ?resp = requests.get(url, headers = headers, cookies = cookies)? ?? ???

? ?? ?? ?? ?print(datetime.datetime.now(),' : ',resp.content.decode('utf-8'))

? ?? ?? ?? ?resp = requests.get(url2, headers = headers, cookies = cookies)? ?? ???

? ?? ?? ?? ?print(datetime.datetime.now(),' : ',resp.content.decode('utf-8'))

? ?? ?? ?? ?resp = requests.get(url4, headers = headers, cookies = cookies)? ?? ???

? ?? ?? ?? ?print(datetime.datetime.now(),' : ',resp.content.decode('utf-8'))

? ?? ?? ?? ?time.sleep(0.1 np.random.rand()/10)

? ?? ???break

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值