summaryrefslogtreecommitdiff
path: root/main.go
blob: 1cf56ad4b29943f68351889afee798464e86ad9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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)
}