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
10 changed files with 34 additions and 29 deletions

View File

@@ -1,20 +1,4 @@
Compile for 64-bit Windows, macOS, Linux: Compile All at once:
```
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:
``` ```
GOOS=windows GOARCH=amd64 go build -o bin/windows/chatubrate-dvr.exe && 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=darwin GOARCH=arm64 go build -o bin/arm64/darwin/chatubrate-dvr &&
GOOS=linux GOARCH=arm64 go build -o bin/arm64/linux/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 ( import (
"net/http" "net/http"
"strings"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/teacat/chaturbate-dvr/chaturbate" "github.com/teacat/chaturbate-dvr/chaturbate"
@@ -48,17 +49,20 @@ func (h *CreateChannelHandler) Handle(c *gin.Context) {
c.AbortWithError(http.StatusBadRequest, err) c.AbortWithError(http.StatusBadRequest, err)
return return
} }
if err := h.chaturbate.CreateChannel(&chaturbate.Config{ usernames := strings.Split(req.Username, ",")
Username: req.Username, for _, username := range usernames {
Framerate: req.Framerate, if err := h.chaturbate.CreateChannel(&chaturbate.Config{
Resolution: req.Resolution, Username: strings.TrimSpace(username),
ResolutionFallback: req.ResolutionFallback, Framerate: req.Framerate,
FilenamePattern: req.FilenamePattern, Resolution: req.Resolution,
SplitDuration: req.SplitDuration, ResolutionFallback: req.ResolutionFallback,
SplitFilesize: req.SplitFilesize, FilenamePattern: req.FilenamePattern,
}); err != nil { SplitDuration: req.SplitDuration,
c.AbortWithError(http.StatusInternalServerError, err) SplitFilesize: req.SplitFilesize,
return }); err != nil {
c.AbortWithError(http.StatusInternalServerError, err)
return
}
} }
if err := h.chaturbate.SaveChannels(); err != nil { if err := h.chaturbate.SaveChannels(); err != nil {
c.AbortWithError(http.StatusInternalServerError, err) c.AbortWithError(http.StatusInternalServerError, err)

View File

@@ -41,6 +41,7 @@
<div class="label">chaturbate.com/</div> <div class="label">chaturbate.com/</div>
<input type="text" autofocus x-model="form_data.username" /> <input type="text" autofocus x-model="form_data.username" />
</div> </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>
</div> </div>
<!-- / Field: Channel Username --> <!-- / Field: Channel Username -->

View File

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