versionzhang / python_12306 Goto Github PK
View Code? Open in Web Editor NEWpython 12306 抢票工具
python 12306 抢票工具
这个是配置文件内容
presale_enable: True
presale_config:
travel_date: "2019-02-03"
query_left_ticket_time: 1
stop_time: 2
continue_time: 15
start_times:
- "20:00"
- "21:00"
basic_config:
fast_submit: False
debug: False
# - 2019-01-26
# - 2019-01-27
travel_dates:
# 已经更新为多日期
- "2019-02-03"
ticket_type:
# 目前取值有两种
# 成人票或者学生票
# 暂时未考虑学生票和成人票混合的情况
"成人票"
manual_trainnum_enable: False
train_types: [G]
earliest_time: "20:00"
latest_time: "24:00"
这个是日志内容:
[2019-01-19 20:22:32] INFO - 查找到符合配置的车次信息: G1778,G502
查找到符合配置的2个车次都是上午七点多的,而我配置文件的是要晚上八点多和九点多的。请问是什么原因呢?
这边有门票类的项目想找你合作,如果有意向的话,你有时间可以看一下,当然你也可以将你的即时通讯联系方式,发到这个邮箱:[email protected],麻烦发过来的时候备注为:票务项目合作,谢谢!
验证码校验结果: {'result_message': '验证码校验成功', 'result_code': '4'}
登录接口提交返回数据出现问题
登录失败, 重试1次
登录接口返回的数据有错误
如何解决
session文件里出来应该是带着cookie的,但是在query文件里获取联系人的时候确实空的 参数没问题 所以应该是cookie的问题 如何解决呢?
难道是打开的方式不对?还有,这个会不会收集个人信息???
感谢作者,提供这么好用的软件,经过多次使用建议增加到达多个到达城市功能
获取车站信息失败,重试获取中
获取车站信息失败,重试获取中
获取车站信息失败,重试获取中
获取车站信息失败,重试获取中
获取车站信息失败,重试获取中
获取车站信息失败,重试获取中
获取车站信息失败,重试获取中
获取车站信息失败,重试获取中
获取车站信息失败,重试获取中
获取车站信息失败,重试获取中
Traceback (most recent call last):
File "/usr/local/bin/py12306", line 11, in
load_entry_point('py12306==0.9.1', 'console_scripts', 'py12306')()
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 487, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 2728, in load_entry_point
return ep.load()
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 2346, in load
return self.resolve()
File "/usr/local/lib/python3.6/dist-packages/pkg_resources/init.py", line 2352, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python3.6/dist-packages/python12306/cmd.py", line 1, in
from python12306.scheduler import Schedule
File "/usr/local/lib/python3.6/dist-packages/python12306/scheduler.py", line 8, in
from python12306.logic.query.dispatcher import DispatcherTool
File "/usr/local/lib/python3.6/dist-packages/python12306/logic/query/dispatcher.py", line 7, in
from .query import Query
File "/usr/local/lib/python3.6/dist-packages/python12306/logic/query/query.py", line 9, in
from python12306.pre_processing.cities import CityData
File "/usr/local/lib/python3.6/dist-packages/python12306/pre_processing/cities.py", line 77, in
CityData = CityTool().get_final_data()
File "/usr/local/lib/python3.6/dist-packages/python12306/pre_processing/cities.py", line 73, in get_final_data
self.to_python()
File "/usr/local/lib/python3.6/dist-packages/python12306/pre_processing/cities.py", line 45, in to_python
data = self.raw_data
File "/usr/local/lib/python3.6/dist-packages/cached_property.py", line 35, in get
value = obj.dict[self.func.name] = self.func(obj)
File "/usr/local/lib/python3.6/dist-packages/python12306/pre_processing/cities.py", line 42, in raw_data
raise ResponseError
python12306.comonexception.ResponseError
获取车站信息成功
正在为您登录
使用若快进行验证码识别
验证码校验结果: {'result_message': '验证码校验成功', 'result_code': '4'}
密码输入错误。如果输错次数超过4次,用户将被锁定。
登录失败, 重试1次
正在为您登录
使用若快进行验证码识别
验证码校验结果: {'result_message': '验证码校验成功', 'result_code': '4'}
密码输入错误。如果输错次数超过4次,用户将被锁定。
登录失败, 重试2次
正在为您登录
使用若快进行验证码识别
验证码校验结果: {'result_message': '验证码校验失败', 'result_code': '5'}
验证码识别失败
验证码校验失败
登录失败, 重试3次
正在为您登录
使用若快进行验证码识别
验证码校验结果: {'result_message': '验证码校验成功', 'result_code': '4'}
密码输入错误。如果输错次数超过4次,用户将被锁定。
登录失败, 重试4次
正在为您登录
使用若快进行验证码识别
验证码校验结果: {'result_message': '验证码校验成功', 'result_code': '4'}
密码输入错误。如果输错次数超过4次,用户将被锁定。
登录失败, 重试5次
正在为您登录
使用若快进行验证码识别
验证码校验结果: {'result_message': '验证码校验成功', 'result_code': '4'}
您的用户已经被锁定,锁定时间为20 分钟,请稍后再试。
重试次数已经超过设置
HTTPSConnectionPool(host='8.37.232.4', port=443): Max retries exceeded with url: /otn/leftTicket/queryZ?leftTicketDTO.train_date=2019-02-14&leftTicketDTO.from_station=XUN&leftTicketDTO.to_station=SHH&purpose_codes=0X00 (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x7f9706a00160>, 'Connection to 8.37.232.4 timed out. (connect timeout=10)'))
请求https://8.37.232.4/otn/leftTicket/queryZ异常
我是在digital ocean 的VPS上跑的。
Traceback (most recent call last):
File "C:\Users\1\AppData\Local\Programs\Python\Python37\Scripts\py12306-script.py", line 11, in <module>
load_entry_point('py12306==0.9.1', 'console_scripts', 'py12306')()
File "c:\users\1\appdata\local\programs\python\python37\lib\site-packages\python12306\cmd.py", line 7, in main
instance.run()
File "c:\users\1\appdata\local\programs\python\python37\lib\site-packages\python12306\scheduler.py", line 208, in run
data = DispatcherTool.run(query_params)
File "c:\users\1\appdata\local\programs\python\python37\lib\site-packages\python12306\logic\query\dispatcher.py", line 92, in run
data = q.filter()
File "c:\users\1\appdata\local\programs\python\python37\lib\site-packages\python12306\logic\query\query.py", line 53, in filter
data = self.run_query()
File "c:\users\1\appdata\local\programs\python\python37\lib\site-packages\python12306\logic\query\query.py", line 36, in run_query
return [TrainDetail(v.split('|')) for v in json_response['data']['result']] or []
KeyError: `'data'`
放在服务器上运行这个代码,看不到图片的~改成存一个本地文件,然后可以自己手动拉回来看
python_12306/python12306/scheduler.py
Line 142 in d3d876b
用这个比邮件通知配置起来简单些。
http://sc.ftqq.com/3.version
这里写的是email_conf.port
config.yaml_example里面写的是 email_port
python_12306/python12306/config.yaml_example
Line 118 in b1899c8
404错误
[2019-01-11 14:03:27] E:\logtest\python_12306-master\python12306\utils\log.py:38 WARNING - https://www.12306.cn/mormhweb/logFiles/error.html
[2019-01-11 14:03:27] E:\logtest\python_12306-master\python12306\utils\log.py:44 WARNING - 404
[2019-01-11 14:03:27] E:\logtest\python_12306-master\python12306\utils\log.py:38 WARNING - 返回状态码有问题
[2019-01-11 14:03:27] E:\logtest\python_12306-master\python12306\utils\log.py:38 INFO - 满足条件的车次暂无余票,正在重新查询
编码问题:config.py文件
path = os.path.join(os.path.dirname(file), 'config.yaml')
with open(path, 'r', encoding='utf-8') as f:
s = yaml.load(f)
return s
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.