api

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDisallowedIP

func IsDisallowedIP(hostIP string) bool

func IsSeries

func IsSeries(animeURL string) (bool, int, error)

IsSeries checks if the given anime is a series or a movie/OVA.

func SafeGet

func SafeGet(url string) (*http.Response, error)

SafeGet performs a GET request with a timeout and returns the response.

func SafeTransport

func SafeTransport(timeout time.Duration) *http.Transport

SafeTransport returns a http.Transport with a custom DialContext and DialTLS functions that check if the remote IP is allowed.

func SearchAnime

func SearchAnime(animeName string) (string, error)

SearchAnime performs a search on the site for the given anime name and returns the URL of the anime page.

Types

type Anime

type Anime struct {
	Name     string
	URL      string
	Episodes []Episode
}

Anime represents an anime with its name, URL and a slice of Episode structs.

type Episode

type Episode struct {
	Number string
	Num    int
	URL    string
}

Episode represents an episode with its number, URL and a parsed number.

func GetAnimeEpisodes

func GetAnimeEpisodes(animeURL string) ([]Episode, error)

GetAnimeEpisodes returns a slice of Episode structs containing the episode number and URL.

Jump to

Keyboard shortcuts

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