pi0trdotsys/intercity-sniffer

GitHub: pi0trdotsys/intercity-sniffer

一款非官方的波兰 Intercity 列车余票监控工具,通过逆向内部 API 并驱动真实浏览器绕过反爬检测,自动扫描座位余量并经 Telegram 推送通知。

Stars: 0 | Forks: 0

# Intercity Sniffer 非官方工具,用于检查 [intercity.pl](https://www.intercity.pl) 列车的余票情况,并通过 Telegram 每日发送报告。 路线和时间在代码 (`intercity_checker.py`) 中硬编码 —— 默认为 Wrocław Główny → Kielce,17:00 之后。 ## 工作原理 - `intercity_sniff.py` — [mitmproxy](https://mitmproxy.org) 的 addon,用于拦截和分析 intercity.pl 的内部 API(逆向工程)。 - `intercity_checker.py` — 核心脚本:每天提前检查 7 天内的直达车次,为每趟列车获取座位图(优先选择 2 等座,仅当 2 等座无票时才查询 1 等座),并通过 Telegram bot 发送汇总报告。 intercity.pl 的 API 由 Akamai Bot Manager 提供防护,因此请求是通过 [Playwright](https://playwright.dev) 在真实(可见的)的 Chromium 窗口内部执行的 —— headless 模式会被拦截。 ## 环境要求 ``` pip install playwright requests playwright install chromium ``` ## 使用说明 ``` TELEGRAM_BOT_TOKEN=... TELEGRAM_CHAT_ID=... python3 intercity_checker.py ``` 日常运行使用的是 macOS 的 LaunchAgent(`StartCalendarInterval`,20:00)。 ## 免责声明 本项目为非官方项目,与 PKP Intercity S.A. 无关。本项目使用了内部的、未公开的 API —— 可能随时失效且不作另行通知。仅供个人/教育用途,且仅限只读操作(不涉及预订/购买车票)。
标签:BeEF, Playwright, Python, Telegram机器人, Waymore结果处理, 信息查询, 反向工程, 字符串匹配, 数字取证, 无后门, 爬虫, 特征检测, 自动化脚本, 逆向工具