Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement more beta api endpoints #33

Merged
merged 9 commits into from
May 29, 2022
Merged

Implement more beta api endpoints #33

merged 9 commits into from
May 29, 2022

Conversation

IchBinLeoon
Copy link
Contributor

This pull request adds more beta api endpoints to the library.

Browse

Browses the crunchyroll catalog filtered by the specified options and returns all found series and movies within the given limit.

// Filters for dubbed action and fantasy series, sorted by popularity
options := crunchyroll.BrowseOptions{
    Categories: []string{"action", "fantasy"},
    IsDubbed:   true,
    Sort:       crunchyroll.POPULARITY,
    Type:       crunchyroll.SERIES,
}

// Returns 5 entries filtered by the options
series, movies, err := crunchy.Browse(options, 5)
// Filters for slice of life series and movies from the winter 2022 simulcast, sorted alphabetically
options := crunchyroll.BrowseOptions{
    Categories: []string{"slice of life"},
    Simulcast:  "winter-2022",
    Sort:       crunchyroll.ALPHABETICAL,
}

// Returns 3 entries filtered by the options
series, movies, err := crunchy.Browse(options, 3)

Returns arrays of *crunchyroll.Series and / or *crunchroll.Movie.

Categories

Returns all available categories and possible subcategories.

// Don't include subcategories
categories, err := crunchy.Categories(false)
// Include subcategories
categories, err := crunchy.Categories(true)

Returns an array of *crunchyroll.Category.

Simulcasts

Returns all available simulcast seasons for the current locale.

simulcasts, err := crunchy.Simulcasts()

Returns an array of *crunchyroll.Simulcast.

News

Returns the top and latest news from crunchyroll for the current locale within the given limits.

// Returns 2 top and 5 latest news
top, latest, err := crunchy.News(2, 5)

Returns two arrays of *crunchyroll.News.

Recommendations

Returns series and movie recommendations from crunchyroll based on the currently logged in account within the given limit.

// Returns 10 series or movies
series, movies, err := crunchy.Recommendations(10)

Returns arrays of *crunchyroll.Series and / or *crunchroll.Movie.

UpNext

Returns the episodes that are up next based on the currently logged in account within the given limit.

// Returns 5 episodes
episodes, err := crunchy.UpNext(5)

Returns an array of *crunchyroll.Episode.

SimilarTo

Returns similar series and movies according to crunchyroll to the one specified by id within the given limit.

// Returns 5 series or movies similar to the series with id GRJ0J828Y
series, movies, err := crunchy.SimilarTo("GRJ0J828Y", 5)

Returns arrays of *crunchyroll.Series and / or *crunchroll.Movie.

WatchHistory

Returns the history of watched episodes based on the currently logged in account from the given page with the given size.

// Returns 10 episodes from the first page of the history
episodes, err := crunchy.WatchHistory(1, 10)

Returns an array of *crunchyroll.HistoryEpisode.

Account

Returns information about the currently logged in crunchyroll account.

account, err := crunchy.Account()

Returns *crunchyroll.Account.

utils.go Outdated Show resolved Hide resolved
account.go Outdated Show resolved Hide resolved
episode.go Outdated Show resolved Hide resolved
episode.go Outdated Show resolved Hide resolved
Copy link
Member

@bytedream bytedream left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bytedream bytedream changed the base branch from master to feature/common-api-endpoints May 29, 2022 13:21
@bytedream bytedream deleted the branch crunchy-labs:feature/common-api-endpoints May 29, 2022 13:22
@bytedream bytedream closed this May 29, 2022
@bytedream bytedream reopened this May 29, 2022
@bytedream
Copy link
Member

Unexpected side effects were caused lul

@bytedream bytedream merged commit 048d1ba into crunchy-labs:feature/common-api-endpoints May 29, 2022
@bytedream bytedream mentioned this pull request May 30, 2022
@bytedream bytedream mentioned this pull request Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants