Giter Club home page Giter Club logo

python_12306's People

Contributors

jasonqiao36 avatar songroger avatar versionzhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python_12306's Issues

查询到符合条件的车次与的的配置文件不一样

这个是配置文件内容
presale_enable: True
presale_config:

预售日期, 单日期,与正常模式的配置不同,请注意

travel_date: "2019-02-03"

预售模式下查询余票时间间隔 单位秒

query_left_ticket_time: 1

预售模式下提前多久停止正常模式的查询只查询预售模式的日期的票, 单位分钟

stop_time: 2

预售模式下持续时间,过了持续时间之后,变为正常查询,按照正常查询的模式, 单位分钟

continue_time: 15

预售时间点, 可以为多个, 格式如下所示

"%H:%M" 小时:分钟

start_times:
- "20:00"
- "21:00"

basic_config:

快速下单接口, True or False, 目前12306的web端使用的是正常下单接口,快速下单是从

testerSunshine 12306的流程中拿到的,测试过程中发现有时候会出票失败, 暂时正常下单流程是稳定的

fast_submit: False

调试模式, True or False, True为调试模式,终端会输出调试信息,False为正常模式,只显示必要信息

debug: False

出发日期(list),格式ex:

# - 2019-01-26
# - 2019-01-27

travel_dates:
# 已经更新为多日期
- "2019-02-03"

ticket_type:
# 目前取值有两种
# 成人票或者学生票
# 暂时未考虑学生票和成人票混合的情况
"成人票"

是否根据时间范围 和 乘车类型 购票

否则将需要手动填写车次

manual_trainnum_enable: False

列车类型: 高铁 G 动车 D 普快K, 特快T, C城际 Z 直达 L 临客 普通纯数字车次 用S代替

manual_trainnum_enable 选项为 False时有效

train_types: [G,D,K,T]

train_types: [G]

可接受最早出发时间 格式ex:

manual_trainnum_enable 选项为 False时有效

earliest_time: "20:00"

可接受最晚抵达时间 格式ex:

manual_trainnum_enable 选项为 False时有效

latest_time: "24:00"
这个是日志内容:
[2019-01-19 20:22:32] INFO - 查找到符合配置的车次信息: G1778,G502
查找到符合配置的2个车次都是上午七点多的,而我配置文件的是要晚上八点多和九点多的。请问是什么原因呢?

有其他的项目找你合作

这边有门票类的项目想找你合作,如果有意向的话,你有时间可以看一下,当然你也可以将你的即时通讯联系方式,发到这个邮箱:[email protected],麻烦发过来的时候备注为:票务项目合作,谢谢!

接口错误

验证码校验结果: {'result_message': '验证码校验成功', 'result_code': '4'}
登录接口提交返回数据出现问题
登录失败, 重试1次
登录接口返回的数据有错误
如何解决

请教一下问题

1.需要自己注册那个ruokuai打码平台吗?

2. 填写发件人邮箱是什么?感觉可以只填写收件人邮箱,统一由一个邮箱进行发送和,不用填密码了。

出现一个小问题

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 分钟,请稍后再试。
                    重试次数已经超过设置

log日志里总是报请求异常

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'`

返回状态码问题/编码问题

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.