Documentation ¶
Index ¶
- Variables
- func DecryptData(c *http.Client, data []byte, v *Download, aes128Keys *map[string][]byte)
- func DownloadSegment(c *http.Client, fn string, dlc chan *Download, recTime time.Duration)
- func DownloadStream(c *http.Client, auth AuthConfig, url string, resolution string, ep Episode, ...) error
- func GetPlaylist(c *http.Client, urlStr string, recTime time.Duration, useLocalTime bool, ...)
- func GetResolutions(c *http.Client, auth AuthConfig, url string, ep Episode) ([]string, error)
- func GetStreamURL(c *http.Client, auth AuthConfig, path string, locale string) (string, error)
- type AuthConfig
- type CMSInfo
- type Credentials
- type Download
- type Episode
- type Season
Constants ¶
This section is empty.
Variables ¶
var ( // IVPlaceholder holds place for IV IVPlaceholder = []byte{0, 0, 0, 0, 0, 0, 0, 0} )
Functions ¶
func DecryptData ¶
DecryptData decrypts the AES-128 encrypted data
func DownloadSegment ¶
DownloadSegment downloads the segment of the file
func DownloadStream ¶
func DownloadStream(c *http.Client, auth AuthConfig, url string, resolution string, ep Episode, wg *sync.WaitGroup) error
DownloadStream downloads the given stream url
func GetPlaylist ¶
func GetPlaylist(c *http.Client, urlStr string, recTime time.Duration, useLocalTime bool, dlc chan *Download, wg *sync.WaitGroup)
GetPlaylist gets the playlist data
func GetResolutions ¶
GetResolutions gets the resolutions for an episodeID
func GetStreamURL ¶
GetStreamURL returns the stream url for the videoID and locale
Types ¶
type AuthConfig ¶
type AuthConfig struct { AccessToken string Policy string Signature string KeyPairID string Bucket string }
AuthConfig stores information needed for authorized requests
type CMSInfo ¶
type CMSInfo struct { Cms struct { Bucket string `json:"bucket"` Policy string `json:"policy"` Signature string `json:"signature"` KeyPairID string `json:"key_pair_id"` Expires time.Time `json:"expires"` } `json:"cms"` ServiceAvailable bool `json:"service_available"` }
CMSInfo holds CMS info for crunchyroll streaming
type Credentials ¶
type Credentials struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` ExpiresIn int `json:"expires_in"` TokenType string `json:"token_type"` Scope string `json:"scope"` Country string `json:"country"` }
Credentials holds crunchyroll oauth credientials
type Download ¶
type Download struct { URI string SeqNo uint64 ExtXKey *m3u8.Key // contains filtered or unexported fields }
Download holds information needed for downloading
type Episode ¶
type Episode struct { Class string `json:"__class__"` Href string `json:"__href__"` ResourceKey string `json:"__resource_key__"` Links struct { EpisodeChannel struct { Href string `json:"href"` } `json:"episode/channel"` EpisodeNextEpisode struct { Href string `json:"href"` } `json:"episode/next_episode"` EpisodeSeason struct { Href string `json:"href"` } `json:"episode/season"` EpisodeSeries struct { Href string `json:"href"` } `json:"episode/series"` Streams struct { Href string `json:"href"` } `json:"streams"` } `json:"__links__"` Actions struct { } `json:"__actions__"` ID string `json:"id"` ChannelID string `json:"channel_id"` SeriesID string `json:"series_id"` SeriesTitle string `json:"series_title"` SeasonID string `json:"season_id"` SeasonTitle string `json:"season_title"` SeasonNumber int `json:"season_number"` Episode string `json:"episode"` EpisodeNumber int `json:"episode_number"` SequenceNumber int `json:"sequence_number"` ProductionEpisodeID string `json:"production_episode_id"` Title string `json:"title"` Description string `json:"description"` NextEpisodeID string `json:"next_episode_id"` NextEpisodeTitle string `json:"next_episode_title"` HdFlag bool `json:"hd_flag"` IsMature bool `json:"is_mature"` MatureBlocked bool `json:"mature_blocked"` EpisodeAirDate string `json:"episode_air_date"` IsSubbed bool `json:"is_subbed"` IsDubbed bool `json:"is_dubbed"` IsClip bool `json:"is_clip"` SeoTitle string `json:"seo_title"` SeoDescription string `json:"seo_description"` SeasonTags []string `json:"season_tags"` AvailableOffline bool `json:"available_offline"` MediaType string `json:"media_type"` Slug string `json:"slug"` Images struct { Thumbnail [][]struct { Width int `json:"width"` Height int `json:"height"` Type string `json:"type"` Source string `json:"source"` } `json:"thumbnail"` } `json:"images"` DurationMs int `json:"duration_ms"` IsPremiumOnly bool `json:"is_premium_only"` ListingID string `json:"listing_id"` SubtitleLocales []string `json:"subtitle_locales"` Playback string `json:"playback"` }
Episode contains stream information about the episode
func GetEpisode ¶
GetEpisode returns information about the episode
func GetEpisodes ¶
GetEpisodes returns a list of episodes for a given seasonID
type Season ¶
type Season struct { common.Metadata Links struct { SeasonChannel struct { Href string `json:"href"` } `json:"season/channel"` SeasonEpisodes struct { Href string `json:"href"` } `json:"season/episodes"` SeasonSeries struct { Href string `json:"href"` } `json:"season/series"` } `json:"__links__"` Actions struct { } `json:"__actions__"` ID string `json:"id"` ChannelID string `json:"channel_id"` Title string `json:"title"` SeriesID string `json:"series_id"` SeasonNumber int `json:"season_number"` IsComplete bool `json:"is_complete"` Description string `json:"description"` Keywords []interface{} `json:"keywords"` SeasonTags []string `json:"season_tags"` Images struct { } `json:"images"` IsMature bool `json:"is_mature"` MatureBlocked bool `json:"mature_blocked"` IsSubbed bool `json:"is_subbed"` IsDubbed bool `json:"is_dubbed"` IsSimulcast bool `json:"is_simulcast"` SeoTitle string `json:"seo_title"` SeoDescription string `json:"seo_description"` }
Season holds information about the series season
func GetSeasons ¶
GetSeasons gets the seasons information for the given seriesID