Skip to content

wayneclub/Ticket-Bot

Repository files navigation

Ticket-Bot

zh python

NON-COMMERCIAL USE ONLY

Ticket Bot supports auto buying ticket from THSRC.

DESCRIPTION

Ticket-Bot is a command-line program which could auto buy tickets from websites. It requires Python 3.8+, and NodeJS. It should work on Linux, on Windows or on macOS. This project is only for personal research and language learning.

INSTALLATION

  • Linux, macOS:
pip install -r requriements
  • Windows: Execute install_requirements.bat

USAGE

Online (Colab environment is in the US, if you want to use it in another region please execute it locally)

  1. Save a copy in Drive
  2. Connect Colab
  3. Install the requirements (Click 1st play button)
  4. Depend on the service modify the text field.
  5. Cick the play button, and start buying tickets.

Colab

Local

  1. Depend on the service and modify Ticket-Bot/user_config.toml

    [fields]
    
    [fields.THSRC]
    id = ''             # ROC ID No. 身分證字號 (e.g. AXXXXXXXXX)
    start-station = ''  # Start-station 出發站 (e.g. Taipei)
    dest-station = ''   # Dest-station 抵達站 (e.g. Tainan)
    outbound-date = ''  # Outbound date 出發日期 (e.g. 2023-01-01)
    outbound-time = ''  # Outbound time 出發時間 (e.g. 09:00)
    inbound-time = ''   # Inbound time 抵達時間 (e.g. 12:00)
    preferred-seat = '' # Preferred seat 座位偏好 (e.g. window/aisle)
    car-type = ''       # Car Type 車廂類型 (e.g. normal/business)
    train-no = ''       # Train No. 車次 (e.g. 001)
    email = ''          # E-mail for notification
    phone = ''          # Phone number for SMS notification 手機號碼
    tgo-id = ''         # TSHRC member ID TGO會員ID (e.g. AXXXXXXXXX)
    
    [fields.THSRC.ticket]
    adult = 1    # 全票
    child = 0    # 孩童票 (6-11)
    disabled = 0 # 愛心票
    elder = 0    # 敬老票
    college = 0  # 大學生票
  2. Execute the program with command line or Ticket-Bot.bat

    python ticket_bot.py service [OPTIONS]

OPTIONS

  -h, --help                    show this help message and exit

  -l, --list                    list the tickets

  -a, --auto                    auto buy tickets (train has discount & fastest)

  -locale, --locale             interface language

  -p, --proxy                   proxy

  -d, --debug                   enable debug logging

  -v, --version                 app's version

More Examples

  • Buy ticket from THSRC
python ticket_bot.py thsrc

FAQ

  • Any issue during buying tickets, upload the screenshots and log files (Please provide service name and the command).

Appendix

About

Auto buying tickets from websites, such as THSRC.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published