func GetEpisodes(c *http.Client, auth AuthConfig, seasonID string) ([]Episode, error) {
	type episodesResp struct {
		common.Metadata
		Links struct {
		} `json:"__links__"`
		Actions struct {
		} `json:"__actions__"`
		Total int       `json:"total"`
		Items []Episode `json:"items"`
	}
	var episodes episodesResp

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

	if err != nil {
		return nil, 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 nil, err
	}

	defer resp.Body.Close()

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

	if err != nil {
		return nil, err
	}

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

	return episodes.Items, nil

}
// GetEpisodes returns a list of episodes for a given seasonID
GetEpisodes returns a list of episodes for a given seasonID
// GetEpisodes returns a list of episodes for a given seasonID
func GetEpisodes(c *http.Client, auth AuthConfig, seasonID string) ([]Episode, error) {
	type episodesResp struct {
		common.Metadata
		Links struct {
		} `json:"__links__"`
		Actions struct {
		} `json:"__actions__"`
		Total int       `json:"total"`
		Items []Episode `json:"items"`
	}
	var episodes episodesResp
	url := "https://beta-api.crunchyroll.com/cms/v2" + auth.Bucket + "/episodes?season_id=" + seasonID + "&locale=en-US&Signature=" + auth.Signature + "&Key-Pair-Id=" + auth.KeyPairID + "&Policy=" + auth.Policy
	req, err := http.NewRequest(http.MethodGet, url, nil)
	if err != nil {
		return nil, 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 nil, err
	}
	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}
	json.Unmarshal([]byte(body), &episodes)
	return episodes.Items, nil
}
func GetEpisodes ( c * http . Client , auth AuthConfig , seasonID string ) ( [ ] Episode , error ) { type episodesResp struct { common . Metadata Links struct { } `json:"__links__"` Actions struct { } `json:"__actions__"` Total int `json:"total"` Items [ ] Episode `json:"items"` } var episodes episodesResp url := " " + auth . Bucket + " " + seasonID + " " + auth . Signature + " " + auth . KeyPairID + " " + auth . Policy req , err := http . NewRequest ( http . MethodGet , url , nil ) if err != nil { return nil , err } req . Header . Add ( " " , common . UserAgent ) req . Header . Add ( " " , " " ) resp , err := c . Do ( req ) if err != nil { return nil , err } defer resp . Body . Close ( ) body , err := ioutil . ReadAll ( resp . Body ) if err != nil { return nil , err } json . Unmarshal ( [ ] byte ( body ) , & episodes ) return episodes . Items , nil }
GetEpisodes returns a list of episodes for a given seasonID
GetEpisodes returns a list of episodes for a given seasonID