Commit 69034b8b authored by wanglongzhi's avatar wanglongzhi

no message

parents
Pipeline #197 failed with stages
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# pycharm
.idea/
# vs code
.vscode/
# project
*.log
.logs
logs/
.test
test/
cookies/
*.cookies
qr_code.png
# jupyter
.ipynb_checkpoints
/test/
/.user_data/
This diff is collapsed.
# 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`与小白信用的关系。
这里主要分析出现频率最高的`90016``90008`
### 样例JSON
```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](http://www.jd.com/)
- 用京东APP扫码给出的二维码
- 预约茅台
- 定时自动预约
- 秒杀预约后等待抢购
- 定时开始自动抢购
## 运行环境
- [Python 3](https://www.python.org/)
## 第三方库
- 需要使用到的库已经放在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)`eid``fp`找个普通商品随便下单,然后抓包就能看到,这两个值可以填固定的
> 现在已经支持自动获取,因为添加了一个新的三方库,需要在程序运行之前再执行一次安装第三方库的命令
> 如果想手动获取,随便找一个商品下单,然后进入结算页面,打开浏览器的调试窗口,切换到控制台Tab页,在控制台中输入变量`_JdTdudfp`,即可从输出的Json中获取`eid`和`fp`。
(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为例)*
```bash
$ sudo apt-get install qrencode zbar-tools # 安装二维码解析和生成的工具,用于读取二维码并在命令行输出。
$ zbarimg qr_code.png > qrcode.txt && qrencode -r qrcode.txt -o - -t UTF8 # 解析二维码输出到命令行窗口。
```
#### 5.抢购结果确认
抢购是否成功通常在程序开始的一分钟内可见分晓!
搜索日志,出现“抢购成功,订单号xxxxx",代表成功抢到了,务必半小时内支付订单!程序暂时不支持自动停止,需要手动STOP!
若两分钟还未抢购成功,基本上就是没抢到!程序暂时不支持自动停止,需要手动STOP!
## Docker 运行
> * 自行准备`docker`或`docker-compose`环境
> * 修改`dockerfile`目录中的配置文件`docker.env`
> * 目前支持直接使用`docker`的方式进行管理,也支持`docker-compose`的方式进行管理,根据自己的使用习惯进行选择
> * 推荐使用`docker-compose`的方式,更方便一点
> * 最新代码合并到主分之后,镜像服务器构建新的镜像会需要大概30分钟的时间,请分支合并后一小时再拉取最新镜像
### 使用Docker-Compose进行容器管理(推荐)
#### 拉取镜像
```bash
# 如果不执行此步骤则启动容器时自动进行本地构建镜像
$ sudo docker-compose -f compose/docker-compose.yml pull
```
#### 启动容器
```bash
# 如镜像不存在会自动本地构建一个镜像
$ sudo docker-compose -f compose/docker-compose.yml up
```
> 注意:
> 1. 默认运行选项为秒杀
> 1. 容器默认前端运行,如果需要停止容器连续按两次`Ctrl+C`。
> 1. 如果想后端运行,执行命令`sudo docker-compose -f compose/docker-compose.yml up -d`。
> 1. 如果存在名称为`jd-seckill`的非`docker-compose`创建的容器,需要执行`sudo docker rm -f jd-seckill`先进行删除。
#### 查看登录二维码
```bash
$ sudo docker-compose -f compose/docker-compose.yml exec jd-seckill qrcode
```
#### 停止容器
```bash
$ sudo docker-compose -f compose/docker-compose.yml down -t 0
```
#### 滚动打印运行日志
```bash
$ sudo docker-compose -f compose/docker-compose.yml logs -f
```
#### 查看容器状态
```bash
$ sudo docker-compose -f compose/docker-compose.yml ps
```
### 使用Docker直接进行容器管理
#### 创建镜像
> 一共两种方式可以创建镜像,任选其一即可
> 如果本地构建镜像失败,可以尝试拉取镜像的方式
```bash
# 第一种,直接从`DockerHub`仓库拉取镜像
$ sudo docker pull huanghyw/jd-seckill:latest
# 第二种,本地构建镜像
$ cd dockerfile
$ sudo docker build -t huanghyw/jd-seckill:latest .
```
#### 启动容器
```bash
$ cd dockerfile
$ sudo docker run -it --rm --env-file docker.env --name jd-seckill huanghyw/jd-seckill:latest
```
#### 查看登录二维码
```bash
$ sudo docker exec jd-seckill qrcode
```
#### 停止容器
```bash
$ sudo docker stop jd-seckill -t 0
```
#### 滚动打印运行日志
```bash
$ sudo docker logs jd-seckill -f
```
#### 查看容器状态
```bash
$ sudo docker ps -a
```
## 打赏
不用再打赏了,抢到茅台的同学请保持这份喜悦,没抢到的继续加油 :)
## 感谢
##### 非常感谢原作者 https://github.com/zhou-xiaojun/jd_mask 提供的代码
##### 也非常感谢 https://github.com/wlwwu/jd_maotai 进行的优化
version: "2.2"
services:
jd-seckill:
container_name: jd-seckill
image: huanghyw/jd-seckill:latest
build:
context: ../dockerfile
dockerfile: Dockerfile
env_file:
- ../dockerfile/docker.env
[config]
# eid, fp参数必须填写,具体请参考 wiki-常见问题
# 随意填写可能导致订单无法提交等问题
eid = ""
fp = ""
# cookie现在不需要填写了
# cookies_String = ""
# 商品id
# 已经是茅台的sku_id了
sku_id = 100012043978
# 设定时间 # 2021-01-01 10:00:00.100000
buy_time = 2021-01-01 10:00:00.000
# 默认UA
default_user_agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"
# 是否使用随机 useragent,默认为 false
random_useragent = false
[account]
# 支付密码
# 如果你的账户中有可用的京券(注意不是东券)或 在上次购买订单中使用了京豆,
# 那么京东可能会在下单时自动选择京券支付 或 自动勾选京豆支付。
# 此时下单会要求输入六位数字的支付密码。请在下方配置你的支付密码,如 123456 。
# 如果没有上述情况,下方请留空。
payment_pwd = ""
[messenger]
# 使用了Server酱的推送服务
# 如果想开启下单成功后消息推送,则将 enable 设置为 true,默认为 false 不开启推送
# 开启消息推送必须填入 sckey,如何获取请参考 http://sc.ftqq.com/3.version。感谢Server酱~
server_chan_enable = false
server_chan_sckey =
# 使用了smtp邮箱推送服务
# 如果想开启登录二维码邮箱推送,则将 email_enable 设置为 true,默认为 false 不开启邮箱推送
# 开启消息推送必须填入 email_user、email_pwd,email_host 若不填则会自动判断,email_pwd 如何获取请自行百度。
email_enable = false
# 邮箱域名 smtp.xx.com
email_host =
# 邮箱地址 xxxxxxxx@xx.com
email_user =
# 邮箱授权码(并不一定是邮箱密码) xxxxxxxxxxxxxxxx
email_pwd =
FROM python:3.8-slim-buster
LABEL MAINTAINER="@weidonggg"
ENV GIT_BRANCH master
ENV TIMEZONE Asia/Shanghai
COPY docker-python-entrypoint /usr/local/bin/
COPY qrcode /usr/local/bin/
add ./ /app
RUN set -ex; \
ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime \
&& echo $TIMEZONE > /etc/timezone; \
\
{ \
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free'; \
echo '# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free'; \
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free'; \
echo '# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free'; \
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free'; \
echo '# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free'; \
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free'; \
echo '# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free'; \
} > /etc/apt/sources.list; \
\
# install qrcode view tools.
apt-get update \
&& apt-get install -y --no-install-recommends \
git qrencode zbar-tools \
libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 \
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
libnss3; \
\
# clone jd seckill code.
# git clone -b $GIT_BRANCH https://github.com/huanghyw/jd_seckill.git /app; \
cd /app \
&& rm -rf .git; \
\
\
\
sed -i \
-e 's/^eid.*/eid=$JD_SECKILL_EID/g' \
-e 's/^fp.*/fp=$JD_SECKILL_FP/g' \
-e 's/^sku_id.*/sku_id=$JD_SECKILL_SKU_ID/g' \
-e 's/^buy_time.*/buy_time=$JD_SECKILL_BUY_TIME/g' \
-e 's/^default_user_agent.*/default_user_agent=$JD_SECKILL_DEFAULT_USER_AGENT/g' \
-e 's/^random_useragent.*/random_useragent=$JD_SECKILL_RANDOM_USERAGENT/g' \
-e 's/^payment_pwd.*/payment_pwd=$JD_SECKILL_PAYMENT_PWD/g' \
-e 's/^server_chan_enable.*/server_chan_enable=$JD_SECKILL_SERVER_CHAN_ENABLE/g' \
-e 's/^server_chan_sckey.*/server_chan_sckey=$JD_SECKILL_SERVER_CHAN_SCKEY/g' \
-e 's/^email_enable.*/email_enable=$JD_SECKILL_EMAIL_ENABLE/g' \
-e 's/^email_host.*/email_host=$JD_SECKILL_EMAIL_HOST/g' \
-e 's/^email_user.*/email_user=$JD_SECKILL_EMAIL_USER/g' \
-e 's/^email_pwd.*/email_pwd=$JD_SECKILL_EMAIL_PWD/g' \
-e '/#/d' \
config.ini; \
\
\
\
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/; \
\
# init Chromium Browser
python -c "import asyncio;\
from pyppeteer import launch;\
asyncio.get_event_loop()\
.run_until_complete(launch(args=[\"--no-sandbox\", \"--disable-setuid-sandbox\"]))"; \
\
chmod +x /usr/local/bin/docker-python-entrypoint; \
chmod +x /usr/local/bin/qrcode; \
\
# clean apt cache.
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
ENTRYPOINT ["docker-python-entrypoint"]
CMD ["seckill"]
#!/bin/bash
set -eo pipefail
if [ "${1:0:1}" = "-" ]; then
set -- python "$@"
fi
if [ "$1" = "reserve" ]; then
echo 1 | python main.py
fi
if [ "$1" = "seckill" ]; then
echo 2 | python main.py
fi
exec "$@"
# eid, fp参数必须填写,具体请参考 wiki-常见问题
# 随意填写可能导致订单无法提交等问题
JD_SECKILL_EID=
JD_SECKILL_FP=
# 商品id
# 已经是茅台的sku_id了
JD_SECKILL_SKU_ID=100012043978
JD_SECKILL_BUY_TIME=2021-01-01 10:00:00.000
# 默认UA
JD_SECKILL_DEFAULT_USER_AGENT=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
# 是否使用随机 useragent,默认为 false
JD_SECKILL_RANDOM_USERAGENT=false
# 支付密码
# 如果你的账户中有可用的京券(注意不是东券)或 在上次购买订单中使用了京豆,
# 那么京东可能会在下单时自动选择京券支付 或 自动勾选京豆支付。
# 此时下单会要求输入六位数字的支付密码。请在下方配置你的支付密码,如 123456 。
# 如果没有上述情况,下方请留空。
JD_SECKILL_PAYMENT_PWD=
# 使用了Server酱的推送服务
# 如果想开启下单成功后消息推送,则将 enable 设置为 true,默认为 false 不开启推送
# 开启消息推送必须填入 sckey,如何获取请参考 http://sc.ftqq.com/3.version。感谢Server酱~
JD_SECKILL_SERVER_CHAN_ENABLE=false
JD_SECKILL_SERVER_CHAN_SCKEY=
# 使用了smtp邮箱推送服务
# 如果想开启登录二维码邮箱推送,则将 email_enable 设置为 true,默认为 false 不开启邮箱推送
# 开启消息推送必须填入 email_user、email_pwd,email_host 若不填则会自动判断,email_pwd 如何获取请自行百度。
JD_SECKILL_EMAIL_ENABLE=false
# 邮箱域名 smtp.xx.com
JD_SECKILL_EMAIL_HOST=
# 邮箱地址 xxxxxxxx@xx.com
JD_SECKILL_EMAIL_USER=
# 邮箱授权码(并不一定是邮箱密码) xxxxxxxxxxxxxxxx
JD_SECKILL_EMAIL_PWD=
\ No newline at end of file
#!/bin/bash
set -eo pipefail
zbarimg qr_code.png > qrcode.txt && qrencode -r qrcode.txt -o - -t UTF8
exit $?
# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 2020/12/31 4:58 下午
@author: huangyiwei
"""
#!/usr/bin/env python
# -*- encoding=utf8 -*-
import os
import configparser
class EnvInterpolation(configparser.BasicInterpolation):
"""
尝试从系统环境变量中读取,如果读取失败,则直接使用配置值
"""
def before_get(self, parser, section, option, value, defaults):
value = super().before_get(parser, section, option, value, defaults)
# 无法获取则返回原值
return os.path.expandvars(value)
class Config(object):
def __init__(self, config_file='config.ini'):
self._path = os.path.join(os.getcwd(), config_file)
if not os.path.exists(self._path):
raise FileNotFoundError("No such file: config.ini")
self._config = configparser.ConfigParser(interpolation=EnvInterpolation())
self._config.read(self._path, encoding='utf-8-sig')
self._configRaw = configparser.RawConfigParser(interpolation=EnvInterpolation())
self._configRaw.read(self._path, encoding='utf-8-sig')
def get(self, section, name):
return self._config.get(section, name)
def getRaw(self, section, name):
return self._configRaw.get(section, name)
global_config = Config()
#!/usr/bin/env python
# -*- encoding=utf8 -*-
class SKException(Exception):
def __init__(self, message):
super().__init__(message)
import logging
import logging.handlers
'''
日志模块
'''
LOG_FILENAME = 'jd_seckill.log'
logger = logging.getLogger()
def set_logger():
logger.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(process)d-%(threadName)s - '
'%(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s')
console_handler = logging.StreamHandler()
console_handler.setFormatter(formatter)
logger.addHandler(console_handler)
file_handler = logging.handlers.RotatingFileHandler(
LOG_FILENAME, maxBytes=10485760, backupCount=5, encoding="utf-8")
file_handler.setFormatter(formatter)
logger.addHandler(file_handler)
set_logger()
\ No newline at end of file
This diff is collapsed.
#!/usr/bin/env python
# -*- encoding=utf8 -*-
import time
import requests
import json
from datetime import datetime
from .jd_logger import logger
from .config import global_config
class Timer(object):
def __init__(self, sleep_interval=0.5):
# '2018-09-28 22:45:50.000'
self.buy_time = datetime.strptime(global_config.getRaw('config', 'buy_time'), "%Y-%m-%d %H:%M:%S.%f")
self.buy_time_ms = int(time.mktime(self.buy_time.timetuple()) * 1000.0 + self.buy_time.microsecond / 1000)
self.sleep_interval = sleep_interval
self.diff_time = self.local_jd_time_diff()
def jd_time(self):
"""
从京东服务器获取时间毫秒
:return:
"""
url = 'https://a.jd.com//ajax/queryServerData.html'
ret = requests.get(url).text
js = json.loads(ret)
return int(js["serverTime"])
def local_time(self):
"""
获取本地毫秒时间
:return:
"""
return int(round(time.time() * 1000))
def local_jd_time_diff(self):
"""
计算本地与京东服务器时间差
:return:
"""
return self.local_time() - self.jd_time()
def start(self):
logger.info('正在等待到达设定时间:{},检测本地时间与京东服务器时间误差为【{}】毫秒'.format(self.buy_time, self.diff_time))
while True:
# 本地时间减去与京东的时间差,能够将时间误差提升到0.1秒附近
# 具体精度依赖获取京东服务器时间的网络时间损耗
if self.local_time() - self.diff_time >= self.buy_time_ms:
logger.info('时间到达,开始执行……')
break
else:
time.sleep(self.sleep_interval)
This diff is collapsed.
import sys
from jd_seckill.jd_spider_requests import JdSeckill
if __name__ == '__main__':
a = """
oooo oooooooooo. .oooooo..o oooo o8o oooo oooo
`888 `888' `Y8b d8P' `Y8 `888 `"' `888 `888
888 888 888 Y88bo. .ooooo. .ooooo. 888 oooo oooo 888 888
888 888 888 `"Y8888o. d88' `88b d88' `"Y8 888 .8P' `888 888 888
888 888 888 8888888 `"Y88b 888ooo888 888 888888. 888 888 888
888 888 d88' oo .d8P 888 .o 888 .o8 888 `88b. 888 888 888
.o. 88P o888bood8P' 8""88888P' `Y8bod8P' `Y8bod8P' o888o o888o o888o o888o o888o
`Y888P
功能列表:
1.预约商品
2.秒杀抢购商品
"""
print(a)
jd_seckill = JdSeckill()
choice_function = input('请选择:')
if choice_function == '1':
jd_seckill.reserve()
elif choice_function == '2':
jd_seckill.seckill_by_proc_pool()
else:
print('没有此功能')
sys.exit(1)
certifi==2020.4.5.1
chardet==3.0.4
idna==2.9
lxml==4.5.1
requests==2.23.0
urllib3==1.25.9
Pillow~=8.0.1
pyppeteer2~=0.2.2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment