local-only Node 24 node:sqlite Playwright + CDP

TTM Bot — heads off the thaiticketmajor.com ticket queue

A personal ticket-booking bot for thaiticketmajor.com that tries to put a seat in your cart before the next human caller can find the zone map. Built to out-run the queue when the site stalls under load.

Source: github.com/Olay097056/ttm-bot

Why local, not Cloudflare

thaiticketmajor.com sits behind Akamai's bot sensor wall. Cloudflare-worker IPs trip the sensor and require solving a CAPTCHA on every page, but a browser running on this machine's home IP sails through on the cached sensor state. So the bot runs here, not in the cloud — a deliberate design choice, not a limit.

What it does

The protocol (live flow on Kodaline 972/81487, verified)

zones.php  →  click <area href="#festival.php#STDA">
          →  festival.php?k=<token>
          →  set #book_cnt (jQuery val+change), click #booknow
          →  AJAX returns {result:true}
          →  enroll.php  (auto-fill attendee name + ☑ policy)
          →  click #btn_regnow
          →  paymentall.php (cart HELD)
  

Race-the-network, not tick-and-wait — the entire flow finishes in ~42 s from POST /api/poll/run to booking.status = in_cart.

Local-only by design (demo is static)

This page is the only public demo. The dashboard itself runs only on http://localhost:8787/ on the operator's machine. The repo ships run_here.bat — double-click, log in once, the dashboard auto-fills the bearer token and refreshes its own status panel every 2 s:

cd ttm-bot
run_here.bat           # deps → migrate → mint → serve → open browser

Status panel (what the operator sees)

🟢 Server   up 12h 34m   v0.3.0   poll every 5s
🟢 Chrome   ready · CDP ✓ · pid 29088
🍪 Cookie   minted 2h ago · expires in 9h 58m
📋 Events   12 armed · 0 polling · 1 in_cart · 0 failed
🔄 Last poll 3s ago · 142ms · ✓

Stack


ภาษาไทย

บอทจองตั๋ว thaiticketmajor.com แบบส่วนตัว — พยายามยัดบัตรใส่ตะกร้า ก่อนที่คนคนต่อไปจะหาแผนผังโซนเจอ

ทำไมรันบนเครื่อง ไม่ใช่ Cloudflare

thaiticketmajor.com มี Akamai bot sensor wall กั้นไว้ IP ของ Cloudflare โดน trip ให้แก้ CAPTCHA ทุกหน้า แต่ browser ที่รันจาก IP บ้านผ่านได้เพราะ sensor cache state แล้ว เลยเลือกรันบนเครื่องนี้ ไม่ใช่บน cloud — ตั้งใจไว้แบบนี้ ไม่ใช่ข้อจำกัด

มันทำอะไร

โปรโตคอลที่ใช้งานจริง

zones.php → STDA → festival.php → book_cnt + #booknow → enroll.php → paymentall.php
race-the-network, ไม่ tick-and-wait — flow ทั้งหมดเสร็จใน ~42 วินาทีจาก poll/run ถึง cart held