7 Commits
Author SHA1 Message Date
chun_qiu 4f7168a0e3 refactor: fake room routing moved to connect-time, fully decoupled from production
- server.py / main.py no longer reference fake_room at all (no import,
  no --fake-room flag, no _apply_fake_room)
- Routing decision happens at connect time in DanmakuClient.start():
  room_id == 1 dynamically imports fake_room.py and patches blivedm;
  any other room id returns immediately without touching fake_room
- Switching back from room 1 to another room unpatches to real Bilibili
- Production (packaged, no fake_room.py) is completely unaffected for
  normal room ids; room 1 without fake_room.py raises a clear error
- Rebuild portable zip (83.9 MB)
2026-08-08 17:59:38 +08:00
chun_qiu d7e940fe2e feat: auto-route room_id 1 to local fake_room.py for testing
- When room_id == 1, server/main automatically patch blivedm to connect
  to fake_room.py on 127.0.0.1:8081 (bot web UI port + 1)
- Any other room id restores real Bilibili (unpatch)
- fake_room.py (gitignored, not packaged): headless fake live room with
  bilibili-compatible init APIs (/x/web-interface/nav, /room/v1/Room/get_info,
  /xlive/web-room/v1/index/getDanmuInfo) and WS /sub protocol (AUTH/HEARTBEAT/
  SEND_MSG_REPLY), plus stdin/HTTP /emit control for danmaku/gift/blind box/
  guard/super chat/enter/follow
- Verified end-to-end: all events flow through blivedm and render rules
  (gift -> 感谢由Baka投喂的小电视, blind box, guard, super chat, custom
  danmaku template, enter room)
2026-08-08 17:25:02 +08:00
chun_qiu b7d0c26ad1 fix: danmaku template now uses event rules; rules apply instantly on save
- _on_danmaku renders via event_text(rules, 'danmaku', ...) like all other
  events; hardcoded {uname}说、 {msg} format removed
- Drop message_format param from DanmakuHandler/DanmakuClient/server/main
- api_rules_post mutates the shared rules dict in place (clear+update)
  instead of rebinding, so running handlers pick up new templates
  immediately without restarting TTS
- UI save toast: '规则已保存并即时生效'
- Verified: custom template 卧槽!、是{uname}!、他说、 {msg} works;
  save-then-next-danmaku uses new template without restart
2026-08-08 16:37:05 +08:00
chun_qiu f3a71e908e feat: user-customizable event voice rules (gift/blind box/enter/follow/like/guard/super chat)
- New event_rules.py: load/save event_rules.json, robust template renderer
  (missing vars -> empty, empty template -> muted), guard level mapping
- danmaku_handler.py: custom SEND_GIFT callback to extract blind_gift_name;
  implements all event callbacks feeding the TTS queue per user rules
- server.py: GET/POST /api/rules, load rules at startup, pass to client
- Web UI: 'Event Voice Rules' panel (per-event toggle + template + save)
- main.py CLI loads rules; build.py bundles event_rules.json
- skip_free_gift option to mute silver free gifts
- Rebuild portable zip (83.8 MB)
2026-08-08 16:17:28 +08:00
chun_qiu 0c0e63161d feat: replace wanakana with english-to-kana 49K dictionary
- Vendor english-kana-matcher.js (english-to-kana, MIT, 49216 words)
- Rewrite bridge: dictionary lookup + letter-by-letter fallback for OOV words
- Convert English punctuation (,.!?) to Japanese pauses (、。)
- Fix Chinese fullwidth comma being stripped by filter_kana
- Preserve decimal points in numbers (3.5 -> スリーファイブ)
- main.py now applies filter_kana (matches web UI behavior)
- Remove wanakana dependency; rebuild portable zip (82.5 MB)
2026-08-08 15:06:34 +08:00
chun_qiu fd5c732d8a feat: web UI + QR login + portable build
- Add web UI panel (dark theme) at / with REST API
- Add Bilibili QR code scan login with browser header emulation
- Add wanakana for English -> katakana conversion
- Add volume control (0%-200%)
- Add message format with '说、' pause marker
- PyInstaller --onedir build for portable exe
- Rate-limit danmaku logging (1/20)
- Fix aiohttp.access log spam
- Add README.md
2026-08-08 13:22:58 +08:00
chun_qiu 9b277fe2e0 feat: Bilibili Live Danmaku -> Yukkuri TTS Reader
- Python main entry with CLI (--room-id, --voice, --speed)
- blivedm integration for real-time danmaku receiving
- Chinese-to-Japanese katakana conversion (pypinyin + mapping table)
- Node.js persistent bridge for aquestalk.js TTS synthesis
- Audio playback via sounddevice
- Message queue for sequential TTS playback
2026-08-08 11:26:11 +08:00