Documentation
¶
Index ¶
- Constants
- func DefaultTorrentTrackerList() []string
- type BaseResponse
- type Cast
- type Client
- func (c Client) GetHomePageContent(ctx context.Context) (*HomePageContentResponse, error)
- func (c Client) GetMovieDetails(ctx context.Context, filters *MovieDetailsFilters) (*MovieDetailsResponse, error)
- func (c Client) GetMovieSuggestions(ctx context.Context, movieID int) (*MovieSuggestionsResponse, error)
- func (c Client) GetTrendingMovies(ctx context.Context) (*TrendingMoviesResponse, error)
- func (c Client) SearchMovies(ctx context.Context, filters *SearchMoviesFilters) (*SearchMoviesResponse, error)
- type Genre
- type HomePageContentData
- type HomePageContentResponse
- type Meta
- type Movie
- type MovieDetails
- type MovieDetailsData
- type MovieDetailsFilters
- type MovieDetailsResponse
- type MoviePartial
- type MovieSuggestionsData
- type MovieSuggestionsResponse
- type OrderBy
- type Quality
- type ScrapedMovie
- type ScrapedUpcomingMovie
- type SearchMoviesData
- type SearchMoviesFilters
- type SearchMoviesResponse
- type SortBy
- type StructValidationError
- type Torrent
- type TrendingMoviesData
- type TrendingMoviesResponse
Constants ¶
View Source
const ( APIBaseURL = "https://yts.mx/api/v2" SiteURL = "https://yts.mx" )
Variables ¶
This section is empty.
Functions ¶
func DefaultTorrentTrackerList ¶ added in v0.8.2
func DefaultTorrentTrackerList() []string
Types ¶
type BaseResponse ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) GetHomePageContent ¶ added in v0.8.0
func (c Client) GetHomePageContent(ctx context.Context) ( *HomePageContentResponse, error, )
func (Client) GetMovieDetails ¶
func (c Client) GetMovieDetails(ctx context.Context, filters *MovieDetailsFilters) ( *MovieDetailsResponse, error, )
func (Client) GetMovieSuggestions ¶
func (Client) GetTrendingMovies ¶ added in v0.8.0
func (c Client) GetTrendingMovies(ctx context.Context) ( *TrendingMoviesResponse, error, )
func (Client) SearchMovies ¶
func (c Client) SearchMovies(ctx context.Context, filters *SearchMoviesFilters) ( *SearchMoviesResponse, error, )
type Genre ¶ added in v0.8.2
type Genre string
const ( GenreAll Genre = "All" GenreAction Genre = "Action" GenreAdventure Genre = "Adventure" GenreAnimation Genre = "Animation" GenreBiography Genre = "Biography" GenreComedy Genre = "Comedy" GenreCrime Genre = "Crime" GenreDocumentary Genre = "Documentary" GenreDrama Genre = "Drama" GenreFamily Genre = "Family" GenreFantasy Genre = "Fantasy" GenreFilmNoir Genre = "Film-Noir" GenreGameShow Genre = "Game-Show" GenreHistory Genre = "History" GenreHorror Genre = "Horror" GenreMusic Genre = "Music" GenreMusical Genre = "Musical" GenreMystery Genre = "Mystery" GenreNews Genre = "News" GenreRealityTV Genre = "Reality-TV" GenreRomance Genre = "Romance" GenreSciFi Genre = "Sci-Fi" GenreSport Genre = "Sport" GenreTalkShow Genre = "Talk-show" GenreThriller Genre = "Thriller" GenreWar Genre = "War" GenreWestern Genre = "Western" )
func GetGenreList ¶ added in v0.7.2
func GetGenreList() []Genre
type HomePageContentData ¶ added in v0.8.0
type HomePageContentData struct {
Popular []ScrapedMovie
Latest []ScrapedMovie
Upcoming []ScrapedUpcomingMovie
}
type HomePageContentResponse ¶ added in v0.8.0
type HomePageContentResponse struct {
Data HomePageContentData `json:"data"`
}
type Movie ¶
type Movie struct {
MoviePartial
Summary string `json:"summary"`
Synopsis string `json:"synopsis"`
State string `json:"state"`
}
type MovieDetails ¶
type MovieDetails struct {
MoviePartial
LikeCount int `json:"like_count"`
DescriptionIntro string `json:"description_intro"`
MediumScreenshotImage1 string `json:"medium_screenshot_image1"`
MediumScreenshotImage2 string `json:"medium_screenshot_image2"`
MediumScreenshotImage3 string `json:"medium_screenshot_image3"`
LargeScreenshotImage1 string `json:"large_screenshot_image1"`
LargeScreenshotImage2 string `json:"large_screenshot_image2"`
LargeScreenshotImage3 string `json:"large_screenshot_image3"`
Cast []Cast `json:"cast"`
}
type MovieDetailsData ¶
type MovieDetailsData struct {
Movie MovieDetails `json:"movie"`
}
type MovieDetailsFilters ¶
type MovieDetailsFilters struct {
MovieID int `json:"movie_id" validate:"required,min=1"`
WithImages bool `json:"with_images" validate:"boolean"`
WithCast bool `json:"with_cast" validate:"boolean"`
}
func DefaultMovieDetailsFilters ¶
func DefaultMovieDetailsFilters(movieID int) *MovieDetailsFilters
type MovieDetailsResponse ¶
type MovieDetailsResponse struct {
BaseResponse
Data MovieDetailsData `json:"data"`
}
type MoviePartial ¶
type MoviePartial struct {
ID int `json:"id"`
URL string `json:"url"`
ImdbCode string `json:"imdb_code"`
Title string `json:"title"`
TitleEnglish string `json:"title_english"`
TitleLong string `json:"title_long"`
Slug string `json:"slug"`
Year int `json:"year"`
Rating float64 `json:"rating"`
Runtime int `json:"runtime"`
Genres []Genre `json:"genres"`
DescriptionFull string `json:"description_full"`
YtTrailerCode string `json:"yt_trailer_code"`
Language string `json:"language"`
MpaRating string `json:"mpa_rating"`
BackgroundImage string `json:"background_image"`
BackgroundImageOriginal string `json:"background_image_original"`
SmallCoverImage string `json:"small_cover_image"`
MediumCoverImage string `json:"medium_cover_image"`
LargeCoverImage string `json:"large_cover_image"`
Torrents []Torrent `json:"torrents"`
DateUploaded string `json:"date_uploaded"`
DateUploadedUnix int `json:"date_uploaded_unix"`
}
type MovieSuggestionsData ¶
type MovieSuggestionsResponse ¶
type MovieSuggestionsResponse struct {
BaseResponse
Data MovieSuggestionsData `json:"data"`
}
type OrderBy ¶ added in v0.8.2
type OrderBy string
func GetOrderByList ¶ added in v0.7.2
func GetOrderByList() []OrderBy
type Quality ¶ added in v0.8.2
type Quality string
func GetQualityList ¶ added in v0.8.2
func GetQualityList() []Quality
type ScrapedMovie ¶ added in v0.8.0
type ScrapedUpcomingMovie ¶ added in v0.8.0
type ScrapedUpcomingMovie struct {
ScrapedMovie
Progress int `json:"progress"`
}
type SearchMoviesData ¶
type SearchMoviesFilters ¶
type SearchMoviesFilters struct {
Limit int `json:"limit" validate:"min=1,max=50"`
Page int `json:"page" validate:"min=1"`
Quality string `json:"quality" validate:"oneof=all 480p 720p 1080p 1080p.x265 2160p 3D"`
MinimumRating int `json:"minimum_rating" validate:"min=0,max=9"`
QueryTerm string `json:"query_term"`
Genre string `` /* 251-byte string literal not displayed */
SortBy string `json:"sort_by" validate:"oneof=title year rating peers seeds download_count like_count date_added"`
OrderBy string `json:"order_by" validate:"oneof=asc desc"`
WithRTRatings bool `json:"with_rt_ratings" validate:"boolean"`
}
func DefaultSearchMoviesFilter ¶
func DefaultSearchMoviesFilter() *SearchMoviesFilters
type SearchMoviesResponse ¶
type SearchMoviesResponse struct {
BaseResponse
Data SearchMoviesData `json:"data"`
}
type SortBy ¶ added in v0.8.2
type SortBy string
func GetSortByList ¶ added in v0.7.2
func GetSortByList() []SortBy
type StructValidationError ¶ added in v0.7.0
type StructValidationError struct {
Struct string
Field string
Tag string
Value interface{}
Expected string
}
func (*StructValidationError) Error ¶ added in v0.7.0
func (e *StructValidationError) Error() string
type Torrent ¶
type Torrent struct {
URL string `json:"url"`
Hash string `json:"hash"`
Quality Quality `json:"quality"`
Type string `json:"type"`
IsRepack string `json:"is_repack"`
VideoCodec string `json:"video_codec"`
BitDepth string `json:"bit_depth"`
AudioChannels string `json:"audio_channels"`
Seeds int `json:"seeds"`
Peers int `json:"peers"`
Size string `json:"size"`
SizeBytes int `json:"size_bytes"`
DateUploaded string `json:"date_uploaded"`
DateUploadedUnix int `json:"date_uploaded_unix"`
}
type TrendingMoviesData ¶ added in v0.8.0
type TrendingMoviesData struct {
Movies []ScrapedMovie `json:"movies"`
}
type TrendingMoviesResponse ¶ added in v0.8.0
type TrendingMoviesResponse struct {
Data TrendingMoviesData `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.