crunchyroll

package
v0.0.0-...-baf3466 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Login

func Login(c *common.HTTPClient, user, pass string) error

Login logs the user in to Crunchyroll and stores the session on the client

Types

type Episode

type Episode struct {
	ID          int
	SubtitleID  int
	Title       string
	Description string
	Number      float64
	Quality     string
	Path        string
	URL         string
	Filename    string
	StreamURL   string
}

Episode holds all episode metadata needed for downloading

func (*Episode) Download

func (e *Episode) Download(vp *common.VideoProcessor, testOnly bool) error

Download downloads entire episode to our temp directory

func (*Episode) DownloadSubtitles

func (episode *Episode) DownloadSubtitles(client *common.HTTPClient, language string, tempDir string) (string, error)

DownloadSubtitles entirely downloads subtitles to our temp directory

func (*Episode) GetEpisodeInfo

func (e *Episode) GetEpisodeInfo(client *common.HTTPClient, quality string) error

GetEpisodeInfo retrieves and populates the metadata on the Episode

func (*Episode) GetFilename

func (e *Episode) GetFilename() string

GetFilename returns the Episodes filename

type Event

type Event struct {
	Event       []ScriptEvents `xml:"events"`
	ID          int            `xml:"id,attr"`
	Start       string         `xml:"start,attr"`
	End         string         `xml:"end,attr"`
	Style       string         `xml:"style,attr"`
	Name        string         `xml:"name,attr"`
	MarginLeft  string         `xml:"margin_l,attr"`
	MarginRight string         `xml:"margin_r,attr"`
	MarginVert  string         `xml:"margin_v,attr"`
	Effect      string         `xml:"effect,attr"`
	Text        string         `xml:"text,attr"`
}

type ScriptEvents

type ScriptEvents struct {
	Events []Event `xml:"event"`
}

type ScriptStyles

type ScriptStyles struct {
	Styles []Style `xml:"style"`
}

type Season

type Season struct {
	Title    string
	Number   int
	Length   int
	Episodes []Episode
}

Season contains season metadata and child episodes

func (*Season) GetEpisodes

func (s *Season) GetEpisodes() common.Episodes

GetEpisodes copies the episodes on the Season and returns them as an common.Episodes

func (*Season) GetNumber

func (s *Season) GetNumber() int

GetNumber returns the season number that will be used for folder naming

type Show

type Show struct {
	Title   string
	AdID    string
	Path    string
	URL     string
	Seasons []Season
}

Show contins show metadata and child seasons

func (*Show) GetSeasons

func (show *Show) GetSeasons() common.Seasons

Re-stores seasons belonging to the show and returns them for iteration

func (*Show) GetTitle

func (show *Show) GetTitle() string

Gets the title of the show for referencing outside of this lib

func (*Show) Scrape

func (s *Show) Scrape(client *common.HTTPClient, showURL string) error

Scrape appends all the seasons/episodes found for the show

type Style

type Style struct {
	ID             int    `xml:"id,attr"`
	Name           string `xml:"name,attr"`
	FontName       string `xml:"font_name,attr"`
	FontSize       int    `xml:"font_size,attr"`
	PrimaryColor   string `xml:"primary_colour,attr"`
	SecondaryColor string `xml:"secondary_colour,attr"`
	OutlineColor   string `xml:"outline_colour,attr"`
	BackColor      string `xml:"back_colour,attr"`
	Bold           int    `xml:"bold,attr"`
	Italic         int    `xml:"italic,attr"`
	Underline      int    `xml:"underline,attr"`
	Strikeout      int    `xml:"strikeout,attr"`
	ScaleX         int    `xml:"scale_x,attr"`
	ScaleY         int    `xml:"scale_y,attr"`
	Spacing        int    `xml:"spacing,attr"`
	Angle          int    `xml:"angle,attr"`
	BorderStyle    int    `xml:"border_style,attr"`
	Outline        int    `xml:"outline,attr"`
	Shadow         int    `xml:"shadow,attr"`
	Alignment      int    `xml:"alignment,attr"`
	MarginLeft     string `xml:"margin_l,attr"`
	MarginRight    string `xml:"margin_r,attr"`
	MarginVert     string `xml:"margin_v,attr"`
	Encoding       int    `xml:"encoding,attr"`
}

type SubListResults

type SubListResults struct {
	Subtitles []Subtitle `xml:"subtitle"`
}

type Subtitle

type Subtitle struct {
	ID      int     `xml:"id,attr"`
	Link    string  `xml:"link,attr"`
	Title   string  `xml:"title,attr"`
	Default int     `xml:"default,attr"`
	Delay   float64 `xml:"delay,attr"`
	Iv      string  `xml:"iv"`
	Data    string  `xml:"data"`
}

type SubtitleScript

type SubtitleScript struct {
	ID        int            `xml:"id,attr"`
	Title     string         `xml:"title,attr"`
	PlayResX  int            `xml:"play_res_x,attr"`
	PlayResY  int            `xml:"play_res_y,attr"`
	LangCode  string         `xml:"lang_code,attr"`
	Lang      string         `xml:"lang_string,attr"`
	Created   string         `xml:"created,attr"`
	Progress  string         `xml:"progress_string,attr"`
	Status    string         `xml:"status_string,attr"`
	WrapStyle int            `xml:"wrap_style,attr"`
	Styles    []ScriptStyles `xml:"styles"`
	Events    []ScriptEvents `xml:"events"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL