49 feat add cookies (#98)

* build client side validation and submission

* enabled cookies submission, bug fixes
This commit is contained in:
Marco
2023-10-21 15:46:24 +02:00
committed by GitHub
parent 9361d9ce29
commit 8eb2831bc6
10 changed files with 238 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ package rest
import (
"context"
"errors"
"os"
"github.com/marcopeocchi/yt-dlp-web-ui/server/internal"
)
@@ -36,3 +37,15 @@ func (s *Service) Running(ctx context.Context) (*[]internal.ProcessResponse, err
return s.db.All(), nil
}
}
func (s *Service) SetCookies(ctx context.Context, cookies string) error {
fd, err := os.Create("cookies.txt")
if err != nil {
return err
}
defer fd.Close()
fd.WriteString(cookies)
return nil
}