Giter VIP home page Giter VIP logo

12306's Introduction

###ps:又要过年了 我看最近12306登陆方式改成短信验证了,加上又要过年了,最近会抽空更新一版。【2021.12.20】

写在前面:

​ 视频教程:https://www.bilibili.com/video/BV1mK4y1V7cd

​ 项目原地址:https://github.com/testerSunshine/12306

​ 因作为没有维护,本人进行二次开发,现在可以用【2020-12-24】。有问题可以关注公众号:罐子里的茶,会有群二维码回复,有问题必定解答!最后祝大家都抢到过年的票。

qrcode_for_gh_0626c7a906e9_258

公众号二维码:https://gitee.com/gzldc/images/raw/master/2020-12-04/qrcode_for_gh_0626c7a906e9_258.jpg

启动命令: 1.安装依赖包: pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple 2.加入cdn: python3 run.py c 3.启动脚本: python3 run.py r

IP 代理池

推荐一个ip代理池的项目:https://github.com/Python3WebSpider/ProxyPool 简单使用方法:docker-compose up

本地云打码平台搭建(基于docker)

在安装好docker环境下,运行如下命令:

docker run -d -p 8080:80 --name 12306 yinaoxiong/12306_code_server

(可选)配置 sre24 免费推送消息到 微信/短信/邮箱 提醒

推送 token 值通过微信免费扫码登录 https://sre24.com 「设置」页面获取,修改根目录配置文件 TickerConfig.py

SRE24_TOKEN = "xxx"

保存后重启生效。

备注:sre24 推送支持免费一对多推送消息到 微信/短信/邮箱 提醒,可以设置一个 SRE24_TOKEN 代替分别设置 EMAIL_CONF 和 SERVER_CHAN_CONF 。

12306's People

Contributors

buzhdiao avatar gzldc 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

12306's Issues

多个乘车人无法提交

你好, 单个乘车人可以提交成功,多个乘车人(2个)接口提示302,无法提交订单;
TICKET_PEOPLES = [
"user1",
"user2"
]

TICKET_PEOPLES = ["user1", "user2"]

2022-01-09 at 21 03

select_ticket_info.select().main(),求助

报错信息,求助
Traceback (most recent call last):
File "run.py", line 22, in
select_ticket_info.select().main()
File "C:\Users\Administrator\Downloads\Compressed\12306-master\init\select_ticket_info.py", line 115, in main
l.reqLiftTicketInit()
File "C:\Users\Administrator\Downloads\Compressed\12306-master\inter\LiftTicketInit.py", line 18, in reqLiftTicketInit
matchObj = re.search('var CLeftTicketUrl = '(.*)'', result, re.M|re.I);
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\re.py", line 183, in search
return _compile(pattern, flags).search(string)
TypeError: expected string or bytes-like object

连续查询几个小时后报错

连续查询几个小时后报错,疑似和tk过期有关

empty range for randrange()

目前我观察到tk过期非常频繁,平均只能查询几十分钟左右,希望能改进登录方式

tk失效了也会一直查询车次信息,给人一种正常运行的错觉

我的操作流程:

  1. 用刚抓取的tk运行程序,运行一段时间
  2. 用网页登陆12306(此时程序配置的tk应当失效了)
  3. 查看程序运行状态,一直在正常输出查询结果,无法感知tk失效了
  4. 此时结束程序,重新运行run r,才会报错tk失效

tk已经失效,但是程序一直在正常输出,无法感知tk已经失效,如果刷到有票是无法下单的。
可以加入定时校验tk有效性功能,tk失效及时报错。

邮箱配置失效

运行 :>python run.py t
显示:邮件配置有误'ascii' codec can't encode characters in position 1-3: ordinal not in range(128)
已下发 Server酱 微信通知, 请查收

邮箱 pop3/SMTP 和TMTP/SMTP 都试过了 要报错
方糖可以接收

控制台 返回参数为空, 接口状态码: 302

问题 控制台302,但是浏览器直接访问地址可以拿到数据

image

/otn/leftTicket/queryT?leftTicketDTO.train_date=2020-02-07&leftTicketDTO.from_station=SZQ&leftTicketDTO.to_station=NCG&purpose_codes=ADULT返回参数为空, 接口状态码: 302
image

tk失效解决方案

能不能升级一下功能,自动抓取tk。使用密码用户名登录模式。这样就不影响,刷票了。tk失效了,票一下就没有了

登录不了

可以查询到票,但是登录失败,所以也提交不了

/otn/login/checkUser返回参数为空, 接口状态码: 302

深圳-武汉 车次坐席查询为空,查询url: https://kyfw.12306.cn/otn/leftTicket/queryO?leftTicketDTO.train_date=2021-02-08&leftTicketDTO.from_station=SZQ&leftTicketDTO.to_station=WHN&purpose_codes=ADULT, 可以手动查询是否有票
正在第41次查询 停留时间:0.19 乘车日期: 2021-02-08 车次:所有车次 下单无票 无候补机会 耗时:216.4 120.226.55.151
url: /otn/login/checkUser返回参数为空, 接口状态码: 302

这个报错是怎么回事?感谢解答

TK失效

预售踩点时间:14:29:59


cookie获取中
tk失效 请更新

TK的有效期是多久啊?我预售的抢票老是失败

cdn 重复加载

image
每次重启 加入cdn 需要花很长时间,请问能否只加载一次cdn

依赖装失败了

Using cached https://mirrors.aliyun.com/pypi/packages/46/1c/395a83ee7b2d2ad7a05b453872053d41449564477c81dc356f720b16eac4/sklearn-0.0.post12.tar.gz (2.6 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [15 lines of output]
The 'sklearn' PyPI package is deprecated, use 'scikit-learn'
rather than 'sklearn' for pip commands.

  Here is how to fix this error in the main use cases:
  - use 'pip install scikit-learn' rather than 'pip install sklearn'
  - replace 'sklearn' by 'scikit-learn' in your pip requirements files
    (requirements.txt, setup.py, setup.cfg, Pipfile, etc ...)
  - if the 'sklearn' package is used by one of your dependencies,
    it would be great if you take some time to track which package uses
    'sklearn' instead of 'scikit-learn' and report it to their issue tracker
  - as a last resort, set the environment variable
    SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True to avoid this error

  More information is available at
  https://github.com/scikit-learn/sklearn-pypi-package
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

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.