Added context to the crunchyroll struct

This commit is contained in:
bytedream 2022-03-21 16:55:27 +01:00
parent a6c14cb6c9
commit ac7904668f
3 changed files with 12 additions and 3 deletions

View file

@ -2,6 +2,7 @@ package crunchyroll
import (
"io"
"net/http"
)
type Subtitle struct {
@ -13,7 +14,12 @@ type Subtitle struct {
}
func (s Subtitle) Save(writer io.Writer) error {
resp, err := s.crunchy.Client.Get(s.URL)
req, err := http.NewRequestWithContext(s.crunchy.Context, http.MethodGet, s.URL, nil)
if err != nil {
return err
}
resp, err := s.crunchy.Client.Do(req)
if err != nil {
return err
}