funimation

package module
v0.0.0-...-74898e9 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BaseURL    = "http://www.funimation.com/"
	ShowsPath  = "feeds/ps/shows"
	VideosPath = "feeds/ps/videos"
	LoginPath  = "feeds/ps/login.json?v=2"
)

Funimation API URL endpoints

Functions

This section is empty.

Types

type Client

type Client struct {
	Client http.Client
	User   User
}

Client is a client to the Funimation API.

func NewClient

func NewClient() *Client

NewClient returns a new Client.

func (Client) Cookies

func (c Client) Cookies() []*http.Cookie

Cookies returns all cookies for the client.

func (*Client) DownloadClient

func (c *Client) DownloadClient() *funimation.Client

DownloadClient returns a client that can be used to download an episode.

func (*Client) Login

func (c *Client) Login(username, password string) (User, error)

Login logs into a users Funimation account with the specified username and password.

func (Client) MarshalJSON

func (c Client) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Client) Queue

func (c *Client) Queue(limit, offset int) (QueueResponse, error)

Queue returns all shows that have been queued up.

func (Client) SetCookies

func (c Client) SetCookies(cookies []*http.Cookie)

SetCookies sets the cookies on the client.

func (Client) UnmarshalJSON

func (c Client) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type QueueResponse

type QueueResponse struct {
	ExecutionTime string `json:"execution_time"`
	UserID        string `json:"user_id"`
	User          struct {
		Userid          string      `json:"userid"`
		Username        string      `json:"username"`
		Email           string      `json:"email"`
		Membergroupids  string      `json:"membergroupids"`
		Usergroupid     string      `json:"usergroupid"`
		IsUsernameSet   string      `json:"is_username_set"`
		AvatarURL       string      `json:"avatar_url"`
		AvatarSize      interface{} `json:"avatar_size"`
		Subscriber      bool        `json:"subscriber"`
		OnceASubscriber bool        `json:"once_a_subscriber"`
	} `json:"user"`
	Msg   string `json:"msg"`
	Queue []struct {
		QueueID                string      `json:"queue_id"`
		Order                  string      `json:"order"`
		OnlyShow               string      `json:"only_show"`
		Recaps                 string      `json:"recaps"`
		Promotionals           string      `json:"promotionals"`
		ShowURL                string      `json:"show_url"`
		Published              string      `json:"published"`
		ShowSquare             string      `json:"show_square"`
		UserRank               interface{} `json:"user_rank"`
		ShowID                 string      `json:"show_id"`
		FunimationWebsite      string      `json:"funimation_website"`
		Copyright              string      `json:"copyright"`
		Title                  string      `json:"title"`
		OriginalTitle          string      `json:"original_title"`
		VodSummary255          string      `json:"vod_summary_255"`
		VodSummary400          string      `json:"vod_summary_400"`
		FullSummary            string      `json:"full_summary"`
		ActiveDub              string      `json:"active_dub"`
		ActiveSub              string      `json:"active_sub"`
		ActiveHd               string      `json:"active_hd"`
		ActiveVideos           string      `json:"active_videos"`
		ActiveEpisodes         string      `json:"active_episodes"`
		ActiveFree             string      `json:"active_free"`
		ActiveSvod             string      `json:"active_svod"`
		ActiveSvodEpisodes     string      `json:"active_svod_episodes"`
		ActiveSvodExclusive    string      `json:"active_svod_exclusive"`
		ActiveClips            string      `json:"active_clips"`
		OriginalProductionYear string      `json:"original_production_year"`
		WeHaveEpisode          string      `json:"we_have_episode"`
		WeHaveMovie            string      `json:"we_have_movie"`
		WeHaveOva              string      `json:"we_have_ova"`
		WeHaveSpecial          string      `json:"we_have_special"`
		Simulcast              string      `json:"simulcast"`
		Pageviews              string      `json:"pageviews"`
		OriginalLanguage       string      `json:"original_language"`
		LanguageAbbreviation   string      `json:"language_abbreviation"`
		Genres                 string      `json:"genres"`
		GenresID               string      `json:"genres_id"`
		TvRatings              string      `json:"tv_ratings"`
		TvRatingsID            string      `json:"tv_ratings_id"`
		Rank                   string      `json:"rank"`
		ShowThumbnail          string      `json:"show_thumbnail"`
		FeaturedTrailerSw      string      `json:"featured_trailer_sw"`
		FeaturedTrailerID      string      `json:"featured_trailer_id"`
		FeaturedProductSw      string      `json:"featured_product_sw"`
		FeaturedProductID      string      `json:"featured_product_id"`
		ForumID                string      `json:"forum_id"`
		FeaturedTrailerURL     string      `json:"featured_trailer_url"`
		RecapsCount            int         `json:"recaps_count"`
		VideosCount            int         `json:"videos_count"`
	} `json:"queue"`
	ShowsCount  int    `json:"shows_count"`
	VideosCount int    `json:"videos_count"`
	Duration    int    `json:"duration"`
	CurrentPage int    `json:"current_page"`
	Limit       string `json:"limit"`
	NextVideo   map[string]struct {
		ShowID         string      `json:"show_id"`
		ActiveVideos   string      `json:"active_videos"`
		ShowURL        string      `json:"show_url"`
		VideoID        string      `json:"video_id"`
		Watched        string      `json:"watched"`
		Checkpoint     string      `json:"checkpoint"`
		RecapID        string      `json:"recap_id"`
		Title          string      `json:"title"`
		Thumbnail      string      `json:"thumbnail"`
		VideoType      string      `json:"video_type"`
		Number         string      `json:"number"`
		VideoSequence  string      `json:"video_sequence"`
		VideoURL       string      `json:"video_url"`
		VideoSimulcast string      `json:"video_simulcast"`
		Language       interface{} `json:"language"`
		VideoCategory  string      `json:"video_category"`
		VideoNumber    string      `json:"video_number"`
		VideoTitle     string      `json:"video_title"`
		VideoDuration  string      `json:"video_duration"`
		Exclusive      string      `json:"exclusive"`
		WidgetTitle    string      `json:"widget_title"`
	} `json:"next_video"`
	Offset int    `json:"offset"`
	Items  string `json:"items"`
}

QueueResponse is all the shows queued.

type Show

type Show struct {
	AssetID                    string      `json:"asset_id"`
	PubDate                    string      `json:"pubDate"`
	SeriesName                 string      `json:"series_name"`
	Link                       string      `json:"link"`
	SeriesDescription          string      `json:"series_description"`
	SeasonCount                string      `json:"season_count"`
	EpisodeCount               int         `json:"episode_count"`
	Genres                     string      `json:"genres"`
	Simulcast                  string      `json:"simulcast"`
	Popularity                 string      `json:"popularity"`
	OfficialMarketingWebsite   string      `json:"official_marketing_website"`
	LatestVideoFree            interface{} `json:"latest_video_free"`
	LatestVideoFreeReleaseDate interface{} `json:"latest_video_free_release_date"`
	LatestVideoSubscription    struct {
		VideoID     string `json:"video_id"`
		ReleaseDate string `json:"release_date"`
		Title       string `json:"title"`
	} `json:"latest_video_subscription"`
	LatestVideoSubscriptionReleaseDate string `json:"latest_video_subscription_release_date"`
	ShowRating                         string `json:"show_rating"`
	ActiveHD1080                       string `json:"active_hd_1080"`
	HasClosedCaptions                  string `json:"has_closed_captions"`
	ThumbnailSmall                     string `json:"thumbnail_small"`
	ThumbnailMedium                    string `json:"thumbnail_medium"`
	ThumbnailLarge                     string `json:"thumbnail_large"`
	PosterArt                          string `json:"poster_art"`
	PosterArtLarge                     string `json:"poster_art_large"`
	ContactLink                        string `json:"contactLink"`
	DisplayOrder                       int    `json:"display_order"`
	ElementPosition                    int    `json:"element_position"`
	RatingSystem                       string `json:"rating_system"`
	Quality                            string `json:"quality"`
	Languages                          string `json:"languages,omitempty"`
}

Show represents a single Funimation show.

func GetShow

func GetShow(id string) (Show, error)

GetShow returns a single show.

func Shows

func Shows(limit, offset int) ([]Show, error)

Shows returns all the shows on Funimation.

type User

type User struct {
	UserID           string `json:"user_id"`
	UserType         string `json:"user_type"`
	UT               string `json:"ut"`
	UserRole         string `json:"user_role"`
	SubscriberStatus string `json:"subscriber_status"`
	UserBirthday     string `json:"user_birthday"`
	UserAge          int    `json:"user_age"`
	Country          string `json:"country"`

	// Response fields.
	Success bool   `json:"success"`
	Message string `json:"message"`
}

User is the user info of the currently logged in user.

type Video

type Video struct {
	AssetID               string   `json:"asset_id"`
	FunimationID          string   `json:"funimation_id"`
	PubDate               string   `json:"pubDate"`
	Rating                string   `json:"rating"`
	Quality               string   `json:"quality"`
	Language              string   `json:"language"`
	Duration              int      `json:"duration"`
	Simulcast             string   `json:"simulcast"`
	ClosedCaptioning      string   `json:"closed_captioning"`
	URL                   string   `json:"url"`
	Promo                 string   `json:"promo"`
	ShowName              string   `json:"show_name"`
	Popularity            string   `json:"popularity"`
	Title                 string   `json:"title"`
	Description           string   `json:"description"`
	Sequence              string   `json:"sequence"`
	Number                int      `json:"number"`
	VideoType             string   `json:"video_type"`
	ShowID                string   `json:"show_id"`
	Thumbnail             string   `json:"thumbnail"`
	SeasonID              string   `json:"season_id"`
	SeasonNumber          string   `json:"season_number"`
	Genre                 string   `json:"genre"`
	ReleaseDate           string   `json:"releaseDate"`
	ThumbnailURL          string   `json:"thumbnail_url"`
	ThumbnailSmall        string   `json:"thumbnail_small"`
	ThumbnailMedium       string   `json:"thumbnail_medium"`
	ThumbnailLarge        string   `json:"thumbnail_large"`
	VideoURL              string   `json:"video_url"`
	ClosedCaptionLocation string   `json:"closed_caption_location"`
	Aips                  []string `json:"aips"`
	DubSub                string   `json:"dub_sub"`
	Featured              string   `json:"featured"`
	Highdef               string   `json:"highdef"`
	HasSubtitles          string   `json:"has_subtitles"`
	ElementPosition       int      `json:"element_position"`
	TvOrMove              string   `json:"tv_or_move"`
	RatingSystem          string   `json:"rating_system"`
	DisplayOrder          int      `json:"display_order"`
	ExtendedTitle         string   `json:"extended_title"`
}

Video represents a single Funimation video.

func Videos

func Videos(limit, offset int) ([]Video, error)

Videos return all the videos on Funimation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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