From 8e15d802865ed57db0018c15ea5559c8bd44c01f Mon Sep 17 00:00:00 2001 From: Keuin Date: Wed, 7 Sep 2022 02:48:46 +0800 Subject: First working version. Just a POC. --- main.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 main.go (limited to 'main.go') diff --git a/main.go b/main.go new file mode 100644 index 0000000..1cf56ad --- /dev/null +++ b/main.go @@ -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) +} -- cgit v1.2.3