aa548db9802150fba583bb79242f0f2061396a56
Live Recorder
Live Recorder is a multi-platform live recording system built with:
- Backend:
.NET 8 Web API + EF Core + SQLite - Frontend:
Vue 3 + TypeScript + Element Plus
The current production-ready adapter is DouyinLivePlatformAdapter. The architecture keeps platform-specific logic isolated so Bilibili, Huya, Douyu, and Kuaishou can be added without changing application services.
Architecture
.
├─ src
│ ├─ LiveRecorder.Domain
│ │ ├─ Entities
│ │ └─ Enums
│ ├─ LiveRecorder.Application
│ │ ├─ Abstractions
│ │ ├─ Common
│ │ ├─ Models
│ │ └─ Services
│ ├─ LiveRecorder.Infrastructure
│ │ ├─ Persistence
│ │ ├─ Platforms
│ │ │ ├─ Douyin
│ │ │ ├─ Bilibili
│ │ │ └─ Huya
│ │ └─ Services
│ └─ LiveRecorder.WebApi
│ ├─ Controllers
│ └─ Middleware
└─ frontend
└─ src
├─ api
├─ components
├─ router
├─ stores
└─ views
Core design
Domain
LiveRoom: platform, room id, source URL, title, anchor, cover, availability statusRecordTask: recording state, quality, output format, ffmpeg process id, output pathRecordResult: final file or segment directory, file size, duration, final statusSystemLogEntry: persistent system logAppSetting: runtime settings storeUserAccount,UserSession: lightweight token-based sign-in
Application
ILivePlatformAdapterParseRoomAsyncGetLiveStatusAsyncGetStreamUrlAsync
ILivePlatformAdapterFactoryLiveRoomServiceRecordServiceSystemSettingsServiceSystemLogServiceAuthService
Infrastructure
DouyinHttpClient- wraps User-Agent, Referer, Cookie, and
ttwidhandling
- wraps User-Agent, Referer, Cookie, and
DouyinLivePlatformAdapter- share-link resolution, room id extraction, status check, stream selection
FfmpegService- single file mode, segmented mode, reconnect arguments, recording templates
LiveRoomPollingBackgroundService- background polling scheduler for live detection and auto-start recording
LiveRecorderDbContext
Web API
AuthControllerLiveRoomsControllerRecordTasksControllerLogsControllerSettingsControllerApiTokenAuthenticationMiddlewareExceptionHandlingMiddleware
Implemented features
Douyin adapter
- resolve share links and redirects
- extract real
roomId - call
https://live.douyin.com/webcast/room/web/enter/ - preload
ttwidwhen needed - parse both:
live_core_sdk_data.pull_data.stream_dataflv_pull_url / hls_pull_url_map
- select the highest quality by default or respect configured quality
Background polling scheduler
- configurable polling interval
- configurable enable/disable switch
- configurable auto-start switch
- updates room status in background
- auto-creates a recording task when a room is live and no task is running
- also works as a recovery layer when ffmpeg exits unexpectedly while the room is still live
Recording enhancements
- save format setting:
MP4orTS - save mode setting:
SingleFileSegmented
- recording template setting:
StreamCopyBalancedMp4ArchiveTs
- reconnect tuning:
- enable/disable reconnect
- max reconnect delay
- read/write timeout
Frontend
- login page
- live room management
- recording task list
- recording task detail
- log viewer
- system settings
- route lazy loading
- vendor chunk splitting in Vite
Settings exposed in UI
- ffmpeg path
- output root
- default quality
- live save format
- save mode
- recording template
- segment duration
- reconnect switch and reconnect delay
- read/write timeout
- background polling switch
- auto-start-on-live switch
- polling interval
- Douyin User-Agent / Referer / Cookie
Run
Backend
dotnet restore LiveRecorder.sln
dotnet build LiveRecorder.sln --no-restore -m:1
dotnet run --project src/LiveRecorder.WebApi/LiveRecorder.WebApi.csproj --urls http://localhost:5000
Default account:
- username:
admin - password:
Admin@123
Swagger:
Frontend
cd frontend
npm install
npm run dev
Frontend dev server:
Verified locally
dotnet build LiveRecorder.sln --no-restore -m:1npm run build
Next steps
- Implement full adapters for Bilibili, Huya, Douyu, and Kuaishou.
- Add per-room recording preferences instead of relying only on global defaults.
- Add full-text log search and time-range filters.
- Replace lightweight token sessions with JWT or external SSO if needed.
Languages
C#
56.5%
Vue
15.6%
Dart
11.2%
HTML
6.8%
TypeScript
3.1%
Other
6.7%