49 feat add cookies (#98)
* build client side validation and submission * enabled cookies submission, bug fixes
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user