Fixed #53, separate usernames with commas

This commit is contained in:
Yami Odymel 2024-03-22 09:37:51 +08:00
parent 9400591c6f
commit acb1dff0cc
No known key found for this signature in database
GPG Key ID: 68E469836934DB36
10 changed files with 34 additions and 29 deletions

View File

@ -1,20 +1,4 @@
Compile for 64-bit Windows, macOS, Linux:
```
GOOS=windows GOARCH=amd64 go build -o bin/windows/chatubrate-dvr.exe &&
GOOS=darwin GOARCH=amd64 go build -o bin/darwin/chatubrate-dvr &&
GOOS=linux GOARCH=amd64 go build -o bin/linux/chatubrate-dvr
```
Compile for arm64 Windows, macOS, Linux:
```
GOOS=windows GOARCH=arm64 go build -o bin/arm64/windows/chatubrate-dvr.exe &&
GOOS=darwin GOARCH=arm64 go build -o bin/arm64/darwin/chatubrate-dvr &&
GOOS=linux GOARCH=arm64 go build -o bin/arm64/linux/chatubrate-dvr
```
or Compile All at once:
Compile All at once:
```
GOOS=windows GOARCH=amd64 go build -o bin/windows/chatubrate-dvr.exe &&
@ -24,3 +8,19 @@ GOOS=windows GOARCH=arm64 go build -o bin/arm64/windows/chatubrate-dvr.exe &&
GOOS=darwin GOARCH=arm64 go build -o bin/arm64/darwin/chatubrate-dvr &&
GOOS=linux GOARCH=arm64 go build -o bin/arm64/linux/chatubrate-dvr
```
or Compile for 64-bit Windows, macOS, Linux:
```
GOOS=windows GOARCH=amd64 go build -o bin/windows/chatubrate-dvr.exe &&
GOOS=darwin GOARCH=amd64 go build -o bin/darwin/chatubrate-dvr &&
GOOS=linux GOARCH=amd64 go build -o bin/linux/chatubrate-dvr
```
or for arm64 Windows, macOS, Linux:
```
GOOS=windows GOARCH=arm64 go build -o bin/arm64/windows/chatubrate-dvr.exe &&
GOOS=darwin GOARCH=arm64 go build -o bin/arm64/darwin/chatubrate-dvr &&
GOOS=linux GOARCH=arm64 go build -o bin/arm64/linux/chatubrate-dvr
```

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -2,6 +2,7 @@ package handler
import (
"net/http"
"strings"
"github.com/gin-gonic/gin"
"github.com/teacat/chaturbate-dvr/chaturbate"
@ -48,17 +49,20 @@ func (h *CreateChannelHandler) Handle(c *gin.Context) {
c.AbortWithError(http.StatusBadRequest, err)
return
}
if err := h.chaturbate.CreateChannel(&chaturbate.Config{
Username: req.Username,
Framerate: req.Framerate,
Resolution: req.Resolution,
ResolutionFallback: req.ResolutionFallback,
FilenamePattern: req.FilenamePattern,
SplitDuration: req.SplitDuration,
SplitFilesize: req.SplitFilesize,
}); err != nil {
c.AbortWithError(http.StatusInternalServerError, err)
return
usernames := strings.Split(req.Username, ",")
for _, username := range usernames {
if err := h.chaturbate.CreateChannel(&chaturbate.Config{
Username: strings.TrimSpace(username),
Framerate: req.Framerate,
Resolution: req.Resolution,
ResolutionFallback: req.ResolutionFallback,
FilenamePattern: req.FilenamePattern,
SplitDuration: req.SplitDuration,
SplitFilesize: req.SplitFilesize,
}); err != nil {
c.AbortWithError(http.StatusInternalServerError, err)
return
}
}
if err := h.chaturbate.SaveChannels(); err != nil {
c.AbortWithError(http.StatusInternalServerError, err)

View File

@ -41,6 +41,7 @@
<div class="label">chaturbate.com/</div>
<input type="text" autofocus x-model="form_data.username" />
</div>
<div class="ts-text is-description has-top-spaced-small">Use commas to separate multiple channel names. For example, "channel1,channel2,channel3".</div>
</div>
</div>
<!-- / Field: Channel Username -->

View File

@ -31,7 +31,7 @@ const logo = `
func main() {
app := &cli.App{
Name: "chaturbate-dvr",
Version: "1.0.3",
Version: "1.0.4",
Usage: "Records your favorite Chaturbate stream 😎🫵",
Flags: []cli.Flag{
&cli.StringFlag{