diff options
author | Keuin <[email protected]> | 2022-09-07 02:48:46 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2022-09-07 02:48:46 +0800 |
commit | 8e15d802865ed57db0018c15ea5559c8bd44c01f (patch) | |
tree | 48f4632a1ad044bd7f7f8da3ebe2bb03ab4ca6fe /main.go | |
parent | 88234ca8fffc4e120adbe0d38071b625ad2f43c7 (diff) |
First working version. Just a POC.
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -0,0 +1,30 @@ +package main + +import ( + "bilibili-livestream-archiver/recording" + "context" + "fmt" +) + +func main() { + task := recording.TaskConfig{ + RoomId: 7777, + Transport: recording.TransportConfig{ + SocketTimeoutSeconds: 10, + RetryIntervalSeconds: 5, + MaxRetryTimes: 5, + }, + Download: recording.DownloadConfig{ + SaveDirectory: ".", + FileNameTemplate: "", + }, + } + chResult := make(chan recording.TaskResult) + go recording.RunTask( + context.Background(), + &task, + chResult, + ) + result := <-chResult + fmt.Println(result.Error) +} |