summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go30
1 files changed, 30 insertions, 0 deletions
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)
+}