How testersunshine/12306 works
12306 购票小助手 automates ticket search and booking. The principal workflow is configured launch, login and passenger loading, repeated availability checks, order submission, queue polling, then success notification; it also supports waitlist booking and automated CAPTCHA recognition. The architecture separates orchestration, railway-interface stages, networking, and notifications. Relationships are based on the README and SOURCE INDEX references; unsampled modules are represented only where documented, and external railway-service interaction is shown as unverified.
Main entry points: select_ticket_info.py Booking coordinator · httpUtils.py HTTP client · run.py Command runner · QueryOrderWaitTime.py Order wait polling
Components 23
Booking orchestration
- Command runner
run.py - Booking coordinator
init/select_ticket_info.py
Railway workflows
- Account login
init/login.py - Cookie acquisition
config/getCookie.py - Ticket search
inter/Query.py - Passenger lookup
inter/GetPassengerDTOs.py - CAPTCHA retrieval
inter/GetRandCode.py - Waitlist eligibility
inter/ChechFace.py - Order submission
inter/SubmitOrderRequest.py - Fast submission
inter/AutoSubmitOrderRequest.py - Queue status
inter/GetQueueCount.py - Queue confirmation
inter/ConfirmSingleForQueue.py - Order wait polling
inter/QueryOrderWaitTime.py
Networking and verification
- Local recognition
verify/localVerifyCode.py - HTTP client
myUrllib/httpUtils.py - Proxy selection
agency/agency_tools.py - CDN filtering
agency/cdn_utils.py
Configuration and notifications
- Endpoint definitions
config/urlConf.py - Ticket settings
TickerConfig.py - Email notification
config/emailConf.py - ServerChan notification
config/serverchanConf.py
Other components
- Ticket seeker
- 12306 service
Connections 23
- Ticket seeker → Command runner: starts
README.md - Command runner → Booking coordinator: runs
run.py - Command runner → CDN filtering: filters CDN
run.py - Booking coordinator → Account login: logs in
init/select_ticket_info.py - Booking coordinator → Cookie acquisition: gets cookies
init/select_ticket_info.py - Booking coordinator → Passenger lookup: loads passengers
init/select_ticket_info.py - Booking coordinator → Ticket search: queries tickets
init/select_ticket_info.py - Booking coordinator → Waitlist eligibility: checks waitlist
init/select_ticket_info.py - Booking coordinator → Order submission: submits order
init/select_ticket_info.py - Ticket search → HTTP client: sends requests
inter/Query.py - CAPTCHA retrieval → Local recognition: uses recognition
inter/GetRandCode.py - CAPTCHA retrieval → HTTP client: fetches image
inter/GetRandCode.py - Order submission → Fast submission: delegates
- Fast submission → Queue status: gets queue count
inter/AutoSubmitOrderRequest.py - Queue status → Queue confirmation: confirms queue
inter/GetQueueCount.py - Queue confirmation → Order wait polling: polls order
inter/ConfirmSingleForQueue.py - Order wait polling → Email notification: sends success
inter/QueryOrderWaitTime.py - Order wait polling → ServerChan notification: sends success
inter/QueryOrderWaitTime.py - HTTP client → Proxy selection: selects proxy
myUrllib/httpUtils.py - CDN filtering → HTTP client: tests CDN
agency/cdn_utils.py - Booking coordinator → Ticket settings: reads settings
TickerConfig.py - HTTP client → Endpoint definitions: uses endpoints
inter/Query.py - HTTP client → 12306 service: requests railway APIs