fork huanghyw/jd_seckill

Overview

Jd_Seckill

特别声明:

  • 本仓库发布的jd_seckill项目中涉及的任何脚本,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断。

  • 本项目内所有资源文件,禁止任何公众号、自媒体进行任何形式的转载、发布。

  • huanghyw 对任何脚本问题概不负责,包括但不限于由任何脚本错误导致的任何损失或损害.

  • 间接使用脚本的任何用户,包括但不限于建立VPS或在某些行为违反国家/地区法律或相关法规的情况下进行传播, huanghyw 对于由此引起的任何隐私泄漏或其他后果概不负责。

  • 请勿将jd_seckill项目的任何内容用于商业或非法目的,否则后果自负。

  • 如果任何单位或个人认为该项目的脚本可能涉嫌侵犯其权利,则应及时通知并提供身份证明,所有权证明,我们将在收到认证文件后删除相关脚本。

  • 以任何方式查看此项目的人或直接或间接使用jd_seckill项目的任何脚本的使用者都应仔细阅读此声明。huanghyw 保留随时更改或补充此免责声明的权利。一旦使用并复制了任何相关脚本或jd_seckill项目,则视为您已接受此免责声明。

  • 您必须在下载后的24小时内从计算机或手机中完全删除以上内容。

  • 本项目遵循GPL-3.0 License协议,如果本特别声明与GPL-3.0 License协议有冲突之处,以本特别声明为准。

您使用或者复制了本仓库且本人制作的任何代码或项目,则视为已接受此声明,请仔细阅读
您在本声明未发出之时点使用或者复制了本仓库且本人制作的任何代码或项目且此时还在使用,则视为已接受此声明,请仔细阅读

简介

通过我这段时间的使用(2020-12-12至2020-12-17),证实这个脚本确实能抢到茅台。我自己三个账号抢了四瓶,帮两个朋友抢了4瓶。 大家只要确认自己配置文件没有问题,Cookie没有失效,坚持下去总能成功的。

根据这段时间大家的反馈,除了茅台,其它不需要加购物车的商品也不能抢。具体原因还没有进行排查,应该是京东非茅台商品抢购流程发生了变化。
为了避免耽误大家的时间,先不要抢购非茅台商品。
等这个问题处理好了,会上线新版本。

暗中观察

根据12月14日以来抢茅台的日志分析,大胆推断再接再厉返回Json消息中resultCode与小白信用的关系。
这里主要分析出现频率最高的9001690008

样例JSON

{'errorMessage': '很遗憾没有抢到,再接再厉哦。', 'orderId': 0, 'resultCode': 90016, 'skuId': 0, 'success': False}
{'errorMessage': '很遗憾没有抢到,再接再厉哦。', 'orderId': 0, 'resultCode': 90008, 'skuId': 0, 'success': False}

数据统计

案例 小白信用 90016 90008 抢到耗时
张三 63.8 59.63% 40.37% 暂未抢到
李四 92.9 72.05% 27.94% 4天
王五 99.6 75.70% 24.29% 暂未抢到
赵六 103.4 91.02% 8.9% 2天

猜测

推测返回90008是京东的风控机制,代表这次请求直接失败,不参与抢购。
小白信用越低越容易触发京东的风控。

从数据来看小白信用与风控的关系大概每十分为一个等级,所以赵六基本上没有被拦截,李四和王五的拦截几率相近,张三的拦截几率最高。

风控放行后才会进行抢购,这时候用的应该是水库计数模型,假设无法一次性拿到所有数据的情况下来尽量的做到抢购成功用户的均匀分布,这样就和概率相关了。

综上,张三想成功有点困难,小白信用是100+的用户成功几率最大。

主要功能

  • 登陆京东商城(www.jd.com
    • 用京东APP扫码给出的二维码
  • 预约茅台
    • 定时自动预约
  • 秒杀预约后等待抢购
    • 定时开始自动抢购

运行环境

第三方库

  • 需要使用到的库已经放在requirements.txt,使用pip安装的可以使用指令
    pip install -r requirements.txt
  • 如果国内安装第三方库比较慢,可以使用以下指令进行清华源加速 pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/

使用教程

1. 推荐Chrome浏览器

2. 网页扫码登录,或者账号密码登录

3. 填写config.ini配置信息

(1)eidfp找个普通商品随便下单,然后抓包就能看到,这两个值可以填固定的

随便找一个商品下单,然后进入结算页面,打开浏览器的调试窗口,切换到控制台Tab页,在控制台中输入变量_JdTdudfp,即可从输出的Json中获取eidfp
不会的话参考原作者的issue https://github.com/zhou-xiaojun/jd_mask/issues/22

(2)sku_id,DEFAULT_USER_AGENT

sku_id已经按照茅台的填好。 cookies_string 现在已经不需要填写了 DEFAULT_USER_AGENT 可以用默认的。谷歌浏览器也可以浏览器地址栏中输入about:version 查看USER_AGENT替换

(3)配置一下时间

现在不强制要求同步最新时间了,程序会自动同步京东时间

但要是电脑时间快慢了好几个小时,最好还是同步一下吧

以上都是必须的.

tips: 在程序开始运行后,会检测本地时间与京东服务器时间,输出的差值为本地时间-京东服务器时间,即-50为本地时间比京东服务器时间慢50ms。 本代码的执行的抢购时间以本地电脑/服务器时间为准

(4)修改抢购瓶数

代码中默认抢购瓶数为2,且无法在配置文件中修改 如果一个月内抢购过一瓶,最好修改抢购瓶数为1 具体修改为:在jd_spider_requests.py文件中搜索self.seckill_num = 2,将2改为1

4.运行main.py

根据提示选择相应功能即可。如果出现请扫码登录的提示可查看项目目录下是否存在qr_code.png文件,若存在打开图片,并使用京东手机APP扫码登录即可。

  • Linux下命令行方式显示二维码(以Ubuntu为例)
$ sudo apt-get install qrencode zbar-tools # 安装二维码解析和生成的工具,用于读取二维码并在命令行输出。
$ zbarimg qr_code.png > qrcode.txt && qrencode -r qrcode.txt -o - -t UTF8 # 解析二维码输出到命令行窗口。

5.抢购结果确认

抢购是否成功通常在程序开始的一分钟内可见分晓!
搜索日志,出现“抢购成功,订单号xxxxx",代表成功抢到了,务必半小时内支付订单!程序暂时不支持自动停止,需要手动STOP!
若两分钟还未抢购成功,基本上就是没抢到!程序暂时不支持自动停止,需要手动STOP!

打赏

不用再打赏了,抢到茅台的同学请保持这份喜悦,没抢到的继续加油 :)

感谢

非常感谢原作者 https://github.com/zhou-xiaojun/jd_mask 提供的代码
也非常感谢 https://github.com/wlwwu/jd_maotai 进行的优化
A simple proxy scraper that utilizes the requests module in python.

Proxy Scraper A simple proxy scraper that utilizes the requests module in python. Usage Depending on your python installation your commands may vary.

3 Sep 08, 2021
Binance harvester - A Python 3 script to harvest data from the Binance socket stream and calculate popular TA indicators and produce lists of top trending coins

Binance harvester - A Python 3 script to harvest data from the Binance socket stream and calculate popular TA indicators and produce lists of top trending coins

68 Oct 08, 2022
A web crawler for recording posts in "sina weibo"

Web Crawler for "sina weibo" A web crawler for recording posts in "sina weibo" Introduction This script helps collect attributes of posts in "sina wei

4 Aug 20, 2022
Simple python tool for the purpose of swapping latinic letters with cirilic ones and vice versa in txt, docx and pdf files in Serbian language

Alpha Swap English This is a simple python tool for the purpose of swapping latinic letters with cirylic ones and vice versa, in txt, docx and pdf fil

Aleksandar Damnjanovic 3 May 31, 2022
A high-level distributed crawling framework.

Cola: high-level distributed crawling framework Overview Cola is a high-level distributed crawling framework, used to crawl pages and extract structur

Xuye (Chris) Qin 1.5k Jan 04, 2023
Libextract: extract data from websites

Libextract is a statistics-enabled data extraction library that works on HTML and XML documents and written in Python

499 Dec 09, 2022
Works very well and you can ask for the type of image you want the scrapper to collect.

Works very well and you can ask for the type of image you want the scrapper to collect. Also follows a specific urls path depending on keyword selection.

Memo Sim 1 Feb 17, 2022
A Telegram crawler to search groups and channels automatically and collect any type of data from them.

Introduction This is a crawler I wrote in Python using the APIs of Telethon months ago. This tool was not intended to be publicly available for a numb

39 Dec 28, 2022
Web-scraping - A bot using Python with BeautifulSoup that scraps IRS website by form number and returns the results as json

Web-scraping - A bot using Python with BeautifulSoup that scraps IRS website (prior form publication) by form number and returns the results as json. It provides the option to download pdfs over a ra

1 Jan 04, 2022
News, full-text, and article metadata extraction in Python 3. Advanced docs:

Newspaper3k: Article scraping & curation Inspired by requests for its simplicity and powered by lxml for its speed: "Newspaper is an amazing python li

Lucas Ou-Yang 12.3k Jan 07, 2023
Html Content / Article Extractor, web scrapping lib in Python

Python-Goose - Article Extractor Intro Goose was originally an article extractor written in Java that has most recently (Aug2011) been converted to a

Xavier Grangier 3.8k Jan 02, 2023
爬虫案例合集。包括但不限于《淘宝、京东、天猫、豆瓣、抖音、快手、微博、微信、阿里、头条、pdd、优酷、爱奇艺、携程、12306、58、搜狐、百度指数、维普万方、Zlibraty、Oalib、小说、招标网、采购网、小红书》

lxSpider 爬虫案例合集。包括但不限于《淘宝、京东、天猫、豆瓣、抖音、快手、微博、微信、阿里、头条、pdd、优酷、爱奇艺、携程、12306、58、搜狐、百度指数、维普万方、Zlibraty、Oalib、小说网站、招标采购网》 简介: 时光荏苒,记不清写了多少案例了。

lx 793 Jan 05, 2023
A Pixiv web crawler module

Pixiv-spider A Pixiv spider module WARNING It's an unfinished work, browsing the code carefully before using it. Features 0004 - Readme.md updated, co

Uzuki 1 Nov 14, 2021
A social networking service scraper in Python

snscrape snscrape is a scraper for social networking services (SNS). It scrapes things like user profiles, hashtags, or searches and returns the disco

2.4k Jan 01, 2023
A simple python script to fetch the latest covid info

covid-tracker-script A simple python script to fetch the latest covid info How it works First, get the current date in MM-DD-YYYY format. Check if the

Dot 0 Dec 15, 2021
Luis M. Capdevielle 1 Jan 14, 2022
Web scrapping tool written in python3, using regex, to get CVEs, Source and URLs.

searchcve Web scrapping tool written in python3, using regex, to get CVEs, Source and URLs. Generates a CSV file in the current directory. Uses the NI

32 Oct 10, 2022
Simple tool to scrape and download cross country ski timings and results from live.skidor.com

LiveSkidorDownload Simple tool to scrape and download cross country ski timings

0 Jan 07, 2022
一些爬虫相关的签名、验证码破解

cracking4crawling 一些爬虫相关的签名、验证码破解,目前已有脚本: 小红书App接口签名(shield)(2020.12.02) 小红书滑块(数美)验证破解(2020.12.02) 海南航空App接口签名(hnairSign)(2020.12.05) 说明: 脚本按目标网站、App命

XNFA 90 Feb 09, 2021
河南工业大学 完美校园 自动校外打卡

HAUT-checkin 河南工业大学自动校外打卡 由于github actions存在明显延迟,建议直接使用腾讯云函数 特点 多人打卡 使用简单,仅需账号密码以及用于微信推送的uid 自动获取上一次打卡信息用于打卡 向所有成员微信单独推送打卡状态 完美校园服务器繁忙时造成打卡失败会自动重新打卡

36 Oct 27, 2022