Documentation ¶
Overview ¶
Package xrel contains functions to authorize with and access the complete xREL.to API.
Here is an example on how to use the OAuth2 user authentication:
xrel.ConfigureOAuth2("OAUTH2_CLIENT_KEY", "OAUTH2_CLIENT_SECRET", "", []string{"viewnfo", "addproof"}) fmt.Println("(1) Go to: " + xrel.GetOAuth2AuthURL("")) fmt.Println("(2) Grant access, you should get back a verification code.") fmt.Print("(3) Enter that verification code here: ") verificationCode := "" fmt.Scanln(&verificationCode) err := xrel.PerformOAuth2UserAuthentication(verificationCode) ok(err)
Index ¶
- func AddComment(id string, isP2P bool, text string, videoRating, audioRating int) (types.Comment, error)
- func AddFavsListEntry(favsListID, extInfoID string) (types.FavListEntryModificationResult, error)
- func AddReleaseProofImage(ids []string, imageBase64 string) (types.AddProofResult, error)
- func AddReleaseProofImageByPath(ids []string, fp string) (types.AddProofResult, error)
- func BrowseReleaseCategory(categoryName, extInfoType string, perPage, page int) (types.Releases, error)
- func ConfigureOAuth2(clientKey, clientSecret, redirectURL string, scopes []string)
- func GetComments(id string, isP2P bool, perPage int, page int) (types.Comments, error)
- func GetExtInfo(id string) (types.ExtendedExtInfo, error)
- func GetExtInfoMedia(id string) ([]types.ExtInfoMediaItem, error)
- func GetFavsListEntries(favsListID string, getReleases bool) ([]types.ExtendedExtInfo, error)
- func GetFavsLists() ([]types.FavList, error)
- func GetLatestReleases(perPage, page int, filter, archive string) (types.Releases, error)
- func GetNFOByID(id string, isP2P bool) ([]byte, error)
- func GetOAuth2AuthURL(state string) string
- func GetP2PCategories() ([]types.P2PCategory, error)
- func GetP2PReleaseInfo(query string, isID bool) (types.P2PRelease, error)
- func GetP2PReleases(perPage, page int, categoryID, groupID, extInfoID string) (types.P2PReleases, error)
- func GetReleaseByExtInfoID(id string, perPage, page int) (types.Releases, error)
- func GetReleaseCategories() ([]types.Category, error)
- func GetReleaseFilters() ([]types.Filter, error)
- func GetReleaseInfo(query string, isID bool) (types.Release, error)
- func GetUpcomingTitles(country string) ([]types.UpcomingTitle, error)
- func GetUserInfo() (types.User, error)
- func MarkFavsListEntryAsRead(favsListID, releaseID string, isP2P bool) (types.ShortFavList, error)
- func PerformOAuth2ApplicationAuthentication() error
- func PerformOAuth2UserAuthentication(code string) error
- func RateExtInfo(id string, rating int) (types.ExtendedExtInfo, error)
- func RemoveFavsListEntry(favsListID, extInfoID string) (types.FavListEntryModificationResult, error)
- func SearchExtInfos(query, extInfoType string, limit int) (types.ExtInfoSearchResult, error)
- func SearchReleases(query string, includeScene, includeP2P bool, limit int) (types.ReleaseSearchResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddComment ¶
func AddComment(id string, isP2P bool, text string, videoRating, audioRating int) (types.Comment, error)
AddComment adds a comment to a given API release id or API P2P release id. Requires user OAuth2 authentication.
id API release id or API P2P release id. isP2P If the provided id is a P2P release id. text := "" The comment. You may use BBCode to format the text. Can be empty if both video_rating and audio_rating are set. videoRating := 0 audioRating := 0 Video and audio rating between 1 (bad) to 10 (good). 0 means no rating. You must always rate both or none. You may only vote once, and may not change your vote.
func AddFavsListEntry ¶
func AddFavsListEntry(favsListID, extInfoID string) (types.FavListEntryModificationResult, error)
AddFavsListEntry adds an ExtInfo to a favorite list. Requires user OAuth2 authentication.
favsListID The favorite list ID, as obtained through GetFavsLists(). extInfoID The Ext Info ID, as obtained through other API calls.
func AddReleaseProofImage ¶
func AddReleaseProofImage(ids []string, imageBase64 string) (types.AddProofResult, error)
AddReleaseProofImage adds the base64 of a proof picture to a given API release id. More info on proof pictures can be found here: https://www.xrel.to/wiki/6305/Proofs.html
Please read the rules before posting proofs: https://www.xrel.to/wiki/6308/Regeln-Proofs.html
func AddReleaseProofImageByPath ¶
func AddReleaseProofImageByPath(ids []string, fp string) (types.AddProofResult, error)
AddReleaseProofImageByPath adds a proof picture to a given API release id by filepath. More info on proof pictures can be found here: https://www.xrel.to/wiki/6305/Proofs.html
Please read the rules before posting proofs: https://www.xrel.to/wiki/6308/Regeln-Proofs.html
func BrowseReleaseCategory ¶
func BrowseReleaseCategory(categoryName, extInfoType string, perPage, page int) (types.Releases, error)
BrowseReleaseCategory returns scene releases from the given category.
categoryName Category name from GetReleaseCategories() extInfoType := "" Use one of: movie|tv|game|console|software|xxx - or leave empty to browse releases of all types
http://www.xrel.to/wiki/3751/api-release-browse-category.html
func ConfigureOAuth2 ¶
ConfigureOAuth2 will set needed oAuth2 variables. If you set no redirectURL xREL will display the code to the user. Get your client key & secret here: http://www.xrel.to/api-apps.html
func GetComments ¶
GetComments returns comments for a given API release id or API P2P release id. Only the id is required.
isP2P := false perPage := 25 // min. 5, max 100 page := 1
func GetExtInfo ¶
func GetExtInfo(id string) (types.ExtendedExtInfo, error)
GetExtInfo returns information about an ExtInfo.
func GetExtInfoMedia ¶
func GetExtInfoMedia(id string) ([]types.ExtInfoMediaItem, error)
GetExtInfoMedia returns media associated with an Ext Info.
func GetFavsListEntries ¶
func GetFavsListEntries(favsListID string, getReleases bool) ([]types.ExtendedExtInfo, error)
GetFavsListEntries returns entries of a favorite list. Requires user OAuth2 authentication.
favsListID The favorite list ID, as obtained through GetFavsLists(). getReleases := false If true, an inline list of unread(!) releases will be returned with each ext_info entry.
func GetFavsLists ¶
GetFavsLists returns a list of all the current user's favorite lists. Requires user OAuth2 authentication.
func GetLatestReleases ¶
GetLatestReleases returns the latest releases. Also allows to browse the archive by month.
perPage := 25 Number of releases per page. Min. 5, max. 100. page := 1 Page number (1 to N). filter := "" Filter ID (from GetReleaseFilters()) or "overview" to use the currently logged in user's overview filter. archive := "" Empty = current releases, YYYY-MM for archive.
func GetNFOByID ¶
GetNFOByID returns PNG image data of a NFO file for a given release id. Requires user or application OAuth2 authentication.
id The release id as obtained trough over methods. isP2P Is the release a P2P release?
Please cache the file on your device. You may not modify the image in any way or hide the footer.
https://www.xrel.to/wiki/6438/api-nfo-release.html https://www.xrel.to/wiki/6437/api-nfo-p2p-rls.html
func GetOAuth2AuthURL ¶
GetOAuth2AuthURL returns an URL where the user can login and get a verification code from. State can be any string. You may set this value to any value, and it will be returned after the authentication. It might also be useful to prevent CSRF attacks. Use this after ConfigureOAuth2.
func GetP2PCategories ¶
func GetP2PCategories() ([]types.P2PCategory, error)
GetP2PCategories returns a list of available P2P release categories and their IDs. You can use the category ID in GetP2PReleases().
func GetP2PReleaseInfo ¶
func GetP2PReleaseInfo(query string, isID bool) (types.P2PRelease, error)
GetP2PReleaseInfo returns information about a single release, specified by the complete dirname or an API release id.
func GetP2PReleases ¶
func GetP2PReleases(perPage, page int, categoryID, groupID, extInfoID string) (types.P2PReleases, error)
GetP2PReleases allows to browse P2P/non-scene releases.
perPage := 25 Number of releases per page. Min. 5, max. 100. page := 1 Page number (1 to N). Set only one of the following: categoryID := "" P2P category ID from GetP2PCategories() groupID := "" P2P release group ID extInfoID := "" Ext Info ID
func GetReleaseByExtInfoID ¶
GetReleaseByExtInfoID returns all releases associated with a given ExtInfo.
id ExtInfoID. perPage := 25 Number of releases per page. Min. 5, max. 100. page := 1 Page number (1 to N).
func GetReleaseCategories ¶
GetReleaseCategories returns a list of available release categories. You can use the category name in BrowseReleaseCategory().
func GetReleaseFilters ¶
GetReleaseFilters returns a list of public, predefined release filters. You can use the filter ID in GetLatestReleases().
func GetReleaseInfo ¶
GetReleaseInfo returns information about a single release, specified by the complete dirname or an API release id.
func GetUpcomingTitles ¶
func GetUpcomingTitles(country string) ([]types.UpcomingTitle, error)
GetUpcomingTitles returns a list upcoming movies and their releases. The `country` parameter can be either 'de' (default) for upcoming movies in germany or `us` for upcoming movies in the US/international.
func GetUserInfo ¶
GetUserInfo returns information about the currently active user. Requires user OAuth authentication.
func MarkFavsListEntryAsRead ¶
func MarkFavsListEntryAsRead(favsListID, releaseID string, isP2P bool) (types.ShortFavList, error)
MarkFavsListEntryAsRead marks a release on a favorite list as read. Requires user OAuth2 authentication.
favsListID The favorite list ID, as obtained through GetFavsLists(). releaseID The API release ID, as obtained through other API calls. isP2P Is the release ID a P2P release?
func PerformOAuth2ApplicationAuthentication ¶
func PerformOAuth2ApplicationAuthentication() error
PerformOAuth2UserAuthentication will perform an application authentication. Use this after ConfigureOAuth2.
func PerformOAuth2UserAuthentication ¶
PerformOAuth2UserAuthentication will perform an user authentication with the code you received from GetOAuth2URL.
func RateExtInfo ¶
func RateExtInfo(id string, rating int) (types.ExtendedExtInfo, error)
RateExtInfo rates an ExtInfo. Requires user OAuth authentication.
id Ext Info ID. rating Rating between 1 (bad) to 10 (good). You may only vote once, and may not change your vote.
func RemoveFavsListEntry ¶
func RemoveFavsListEntry(favsListID, extInfoID string) (types.FavListEntryModificationResult, error)
RemoveFavsListEntry removes an ExtInfo from a favorite list. Requires user OAuth2 authentication.
favsListID The favorite list ID, as obtained through GetFavsLists(). extInfoID The ExtInfo ID, as obtained through other API calls.
func SearchExtInfos ¶
func SearchExtInfos(query, extInfoType string, limit int) (types.ExtInfoSearchResult, error)
SearchExtInfos searches for ExtInfos. Please note that additional search rate limiting applies. See http://www.xrel.to/wiki/2727/api-rate-limiting.html
query Search keyword. extInfoType := "" One of: movie|tv|game|console|software|xxx - or leave empty to search Ext Infos of all types. limit := 25 Number of returned search results. Maximum and default 25.
func SearchReleases ¶
func SearchReleases(query string, includeScene, includeP2P bool, limit int) (types.ReleaseSearchResult, error)
SearchReleases searches for Scene and P2P releases. Please note that additional search rate limiting applies. See http://www.xrel.to/wiki/2727/api-rate-limiting.html
query Search keyword. (required) includeScene := false If true, Scene releases will be included in the search results. includeP2P := false If true, P2P releases will be included in the search results. limit := 25 Number of returned search results. Maximum and default 25.
Types ¶
This section is empty.