mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Fix typos & add more comments
This commit is contained in:
parent
2e9ce3cf52
commit
3617955bc5
16 changed files with 82 additions and 68 deletions
|
|
@ -8,6 +8,7 @@ import (
|
|||
"regexp"
|
||||
)
|
||||
|
||||
// Stream contains information about all available video stream of an episode.
|
||||
type Stream struct {
|
||||
crunchy *Crunchyroll
|
||||
|
||||
|
|
@ -22,7 +23,7 @@ type Stream struct {
|
|||
streamURL string
|
||||
}
|
||||
|
||||
// StreamsFromID returns a stream by its api id
|
||||
// StreamsFromID returns a stream by its api id.
|
||||
func StreamsFromID(crunchy *Crunchyroll, id string) ([]*Stream, error) {
|
||||
return fromVideoStreams(crunchy, fmt.Sprintf("https://beta-api.crunchyroll.com/cms/v2/%s/%s/%s/videos/%s/streams?locale=%s&Signature=%s&Policy=%s&Key-Pair-Id=%s",
|
||||
crunchy.Config.CountryCode,
|
||||
|
|
@ -35,7 +36,7 @@ func StreamsFromID(crunchy *Crunchyroll, id string) ([]*Stream, error) {
|
|||
crunchy.Config.KeyPairID))
|
||||
}
|
||||
|
||||
// Formats returns all formats which are available for the stream
|
||||
// Formats returns all formats which are available for the stream.
|
||||
func (s *Stream) Formats() ([]*Format, error) {
|
||||
if s.children != nil {
|
||||
return s.children, nil
|
||||
|
|
@ -70,7 +71,7 @@ func (s *Stream) Formats() ([]*Format, error) {
|
|||
return formats, nil
|
||||
}
|
||||
|
||||
// fromVideoStreams returns all streams which are accessible via the endpoint
|
||||
// fromVideoStreams returns all streams which are accessible via the endpoint.
|
||||
func fromVideoStreams(crunchy *Crunchyroll, endpoint string) (streams []*Stream, err error) {
|
||||
resp, err := crunchy.request(endpoint)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue