Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

本地修改 #514

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions TickerConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@
# 如果这个时候捡漏捡到的话,也是可以付款成功的,也就是说,捡漏+候补,可以最大程度提升抢票成功率

# 刷票模式:1=刷票 2=候补+刷票
TICKET_TYPE = 2
TICKET_TYPE = 1

# 出发日期(list) "2018-01-06", "2018-01-07"
STATION_DATES = [
"2019-10-25"
"2020-01-16"
]

# 填入需要购买的车次(list),"G1353"
# 修改车次填入规则,注:(以前设置的车次逻辑不变),如果车次填入为空,那么就是当日乘车所有车次都纳入筛选返回
# 不填车次是整个list为空才算,如果不是为空,依然会判断车次的,这种是错误的写法 [""], 正确的写法 []
STATION_TRAINS = []
# D2358 深圳被 - 瑞金
STATION_TRAINS = ["D2358"]

# 出发城市,比如深圳北,就填深圳就搜得到
FROM_STATION = "深圳北"

# 到达城市 比如深圳北,就填深圳就搜得到
TO_STATION = "长沙南"
TO_STATION = "瑞金"

# 座位(list) 多个座位ex:
# "商务座",
Expand All @@ -32,7 +33,7 @@
# "硬座",
# "无座",
# "动卧",
SET_TYPE = []
SET_TYPE = ["二等座"]

# 当余票小于乘车人,如果选择优先提交,则删减联系人和余票数一致在提交
# bool
Expand All @@ -41,11 +42,11 @@
# 乘车人(list) 多个乘车人ex:
# "张三",
# "李四"
TICKET_PEOPLES = []
TICKET_PEOPLES = ["温佳兴"]

# 12306登录账号
USER = ""
PWD = ""
USER = "wen939335247"
PWD = "wen2519059"

# 加入小黑屋时间默认为5分钟,此功能为了防止僵尸票导致一直下单不成功错过正常的票
TICKET_BLACK_LIST_TIME = 5
Expand Down Expand Up @@ -80,11 +81,11 @@
# host: "smtp.qq.com"
EMAIL_CONF = {
"IS_MAIL": True,
"email": "",
"notice_email_list": "",
"username": "",
"password": "",
"host": "smtp.qq.com",
"email": "[email protected]",
"notice_email_list": "[email protected]",
"username": "18840839539",
"password": "wenjiaxing",
"host": "smtp.163.com",
}

# 是否开启 server酱 微信提醒, 使用前需要前往 http://sc.ftqq.com/3.version 扫码绑定获取 SECRET 并关注获得抢票结果通知的公众号
Expand All @@ -97,11 +98,11 @@
IS_CDN = 1

# 下单接口分为两种,1 模拟网页自动捡漏下单(不稳定),2 模拟车次后面的购票按钮下单(稳如老狗)
ORDER_TYPE = 1
ORDER_TYPE = 2

# 下单模式 1 为预售,整点刷新,刷新间隔0.1-0.5S, 然后会校验时间,比如12点的预售,那脚本就会在12.00整检票,刷新订单
# 2 是捡漏,捡漏的刷新间隔时间为0.5-3秒,时间间隔长,不容易封ip
ORDER_MODEL = 2
ORDER_MODEL = 1

# 是否开启代理, 0代表关闭, 1表示开始
# 开启此功能的时候请确保代理ip是否可用,在测试放里面经过充分的测试,再开启此功能,不然可能会耽误你购票的宝贵时间
Expand All @@ -112,21 +113,22 @@
IS_PROXY = 0

# 预售放票时间, 如果是捡漏模式,可以忽略此操作
OPEN_TIME = "13:00:00"
OPEN_TIME = "09:00:00"
# 1=使用selenium获取devicesID
# 2=使用网页端/otn/HttpZF/logdevice获取devicesId,这个接口的算法目前可能有点问题,如果登录一直302的请改为配置1
# 3=自己打开浏览器在headers-Cookies中抓取RAIL_DEVICEID和RAIL_EXPIRATION,这个就不用配置selenium
COOKIE_TYPE = 1
COOKIE_TYPE = 3
# 如果COOKIE_TYPE=1,则需配置chromeDriver路径,下载地址http://chromedriver.storage.googleapis.com/index.html
# chromedriver配置版本只要和chrome的大版本匹配就行
CHROME_PATH = "/usr/src/app/chromedriver"
# CHROME_PATH = "/usr/src/app/chromedriver" rail_deviceid rail_expiration
CHROME_PATH = "C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe"

#为了docker37 准备的环境变量,windows环境可以不用管这个参数
CHROME_CHROME_PATH = "/opt/google/chrome/google-chrome";

# 如果COOKIE_TYPE=3, 则需配置RAIL_EXPIRATION、RAIL_DEVICEID的值
RAIL_EXPIRATION = ""
RAIL_DEVICEID = ""
RAIL_EXPIRATION = "1576890407314"
RAIL_DEVICEID = "XsuVHHudFQODxHj7SREdGEr2MbWeHYg5Z8wg1UN4Qjg-kmdP3owSat5FUnKTRg9Dp91KaOCGb2zE6Jz20324zMpecvwkuirwEiBp-wtoFrM68p8p56-pgU-pxIS7VYPVv0ozrhMUA2ebxHrQXpuRNCHUTme4RZti"


# 1=>为一直随机ua,2->只启动的时候随机一次ua
Expand Down
1 change: 1 addition & 0 deletions pythonTest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("Goodbye, World!")
Binary file modified tkcode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions 定时启动.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import schedule
import time
import os
print("python begin:")
def job():
print("I'm working...")
os.system("python run.py")

# schedule.every(1).minutes.do(job)
# schedule.every().hour.do(job)
schedule.every().day.at("8:50").do(job)
# schedule.every(5).to(10).days.do(job)
# schedule.every().monday.do(job)
# schedule.every().wednesday.at("13:15").do(job)

while True:
schedule.run_pending()