Initial commit

This commit is contained in:
ByteDream 2021-08-10 00:32:17 +02:00
commit 5f1d811c66
23 changed files with 3612 additions and 0 deletions

25
subtitle.go Normal file
View file

@ -0,0 +1,25 @@
package crunchyroll
import (
"io"
"os"
)
type Subtitle struct {
crunchy *Crunchyroll
Locale LOCALE `json:"locale"`
URL string `json:"url"`
Format string `json:"format"`
}
func (s Subtitle) Download(file *os.File) error {
resp, err := s.crunchy.Client.Get(s.URL)
if err != nil {
return err
}
defer resp.Body.Close()
_, err = io.Copy(file, resp.Body)
return err
}