func GetStreamURL(c *http.Client, auth AuthConfig, path string, locale string) (string, error) {
	req, err := http.NewRequest(http.MethodGet, "https://beta-api.crunchyroll.com"+path+"?locale="+locale+"&Key-Pair-Id="+auth.KeyPairID+"&Policy="+auth.Policy+"&Signature="+auth.Signature, nil)

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

	defer resp.Body.Close()
	var url string

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

	jsonParsed, err := gabs.ParseJSON([]byte(body))

	url, _ = jsonParsed.Path("streams.adaptive_hls." + locale + ".url").Data().(string)

	return url, nil
}
// GetStreamURL returns the stream url for the videoID and locale
GetStreamURL returns the stream url for the videoID and locale
// GetStreamURL returns the stream url for the videoID and locale
func GetStreamURL(c *http.Client, auth AuthConfig, path string, locale string) (string, error) {
	req, err := http.NewRequest(http.MethodGet, "https://beta-api.crunchyroll.com"+path+"?locale="+locale+"&Key-Pair-Id="+auth.KeyPairID+"&Policy="+auth.Policy+"&Signature="+auth.Signature, nil)
	if err != nil {
		return "", 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 "", err
	}
	defer resp.Body.Close()
	var url string
	body, _ := ioutil.ReadAll(resp.Body)
	jsonParsed, err := gabs.ParseJSON([]byte(body))
	url, _ = jsonParsed.Path("streams.adaptive_hls." + locale + ".url").Data().(string)
	return url, nil
}
func GetStreamURL ( c * http . Client , auth AuthConfig , path string , locale string ) ( string , error ) { req , err := http . NewRequest ( http . MethodGet , " " + path + " " + locale + " " + auth . KeyPairID + " " + auth . Policy + " " + auth . Signature , nil ) if err != nil { return " " , err } req . Header . Add ( " " , common . UserAgent ) req . Header . Add ( " " , " " ) resp , err := c . Do ( req ) if err != nil { return " " , err } defer resp . Body . Close ( ) var url string body , _ := ioutil . ReadAll ( resp . Body ) jsonParsed , err := gabs . ParseJSON ( [ ] byte ( body ) ) url , _ = jsonParsed . Path ( " " + locale + " " ) . Data ( ) . ( string ) return url , nil }
GetStreamURL returns the stream url for the videoID and locale
GetStreamURL returns the stream url for the videoID and locale