func GetSeasons(c *http.Client, auth AuthConfig, seriesID string) ([]Season, error) {
	type seasonsResp struct {
		common.Metadata
		Links struct {
		} `json:"__links__"`
		Actions struct {
		} `json:"__actions__"`
		Total int      `json:"total"`
		Items []Season `json:"items"`
	}
	var seasons seasonsResp

	req, err := http.NewRequest(http.MethodGet, "https://beta-api.crunchyroll.com/cms/v2"+auth.Bucket+"/seasons?series_id="+seriesID+"&locale=en-US&Signature="+auth.Signature+"&Key-Pair-Id="+auth.KeyPairID+"&Policy="+auth.Policy, nil)

	if err != nil {
		return []Season{}, err
	}

	req.Header.Add("User-Agent", common.UserAgent)
	req.Header.Add("Accept-Language", "en-US;q=1.0")

	resp, err := c.Do(req)

	if err != nil {
		return []Season{}, err
	}

	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)

	if err != nil {
		return []Season{}, err
	}

	json.Unmarshal([]byte(body), &seasons)

	return seasons.Items, nil
}
// GetSeasons gets the seasons information for the given seriesID
GetSeasons gets the seasons information for the given seriesID
// GetSeasons gets the seasons information for the given seriesID
func GetSeasons(c *http.Client, auth AuthConfig, seriesID string) ([]Season, error) {
	type seasonsResp struct {
		common.Metadata
		Links struct {
		} `json:"__links__"`
		Actions struct {
		} `json:"__actions__"`
		Total int      `json:"total"`
		Items []Season `json:"items"`
	}
	var seasons seasonsResp
	req, err := http.NewRequest(http.MethodGet, "https://beta-api.crunchyroll.com/cms/v2"+auth.Bucket+"/seasons?series_id="+seriesID+"&locale=en-US&Signature="+auth.Signature+"&Key-Pair-Id="+auth.KeyPairID+"&Policy="+auth.Policy, nil)
	if err != nil {
		return []Season{}, err
	}
	req.Header.Add("User-Agent", common.UserAgent)
	req.Header.Add("Accept-Language", "en-US;q=1.0")
	resp, err := c.Do(req)
	if err != nil {
		return []Season{}, err
	}
	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return []Season{}, err
	}
	json.Unmarshal([]byte(body), &seasons)
	return seasons.Items, nil
}
func GetSeasons ( c * http . Client , auth AuthConfig , seriesID string ) ( [ ] Season , error ) { type seasonsResp struct { common . Metadata Links struct { } `json:"__links__"` Actions struct { } `json:"__actions__"` Total int `json:"total"` Items [ ] Season `json:"items"` } var seasons seasonsResp req , err := http . NewRequest ( http . MethodGet , " " + auth . Bucket + " " + seriesID + " " + auth . Signature + " " + auth . KeyPairID + " " + auth . Policy , nil ) if err != nil { return [ ] Season { } , err } req . Header . Add ( " " , common . UserAgent ) req . Header . Add ( " " , " " ) resp , err := c . Do ( req ) if err != nil { return [ ] Season { } , err } defer resp . Body . Close ( ) body , err := ioutil . ReadAll ( resp . Body ) if err != nil { return [ ] Season { } , err } json . Unmarshal ( [ ] byte ( body ) , & seasons ) return seasons . Items , nil }
GetSeasons gets the seasons information for the given seriesID
GetSeasons gets the seasons information for the given seriesID