struct MangaDex::Client

Defined in:

mangadex/client.cr

Constant Summary

BOUNDARY = "__X_MDCR_BOUNDARY__"

Constructors

Instance Method Summary

Constructor Detail

def self.new(*, base_url : String = "https://mangadex.org", api_url : String = "https://api.mangadex.org/v2") #

[View source]

Instance Method Detail

def auth(username, password) #

[View source]
def auth? #

[View source]
def chapter(id : String | Int64) : Chapter #

[View source]
def get(url, *, api = true) #

[View source]
def get_headers : HTTP::Headers #

[View source]
def group(id : String | Int64) : Group #

[View source]
def manga(id : String | Int64) : Manga #

[View source]
def partial_search(query : String) : Array(PartialManga) #

Searches https://mangadex.org/quick_search/:query, and scrapes everything as a list of PartialMangas. This does not use the API, and sends only one request to MangaDex, so it is much faster than #search.


[View source]
def post(url, body) #

[View source]
def search(query : String) : Array(Manga) #

Searches https://mangadex.org/quick_search/:query, scrapes the manga ids, and uses the API to get a list of manga from the ids.


[View source]
def token : String | Nil #

[View source]
def token=(token : String | Nil) #

[View source]
def token_expires : Time #

[View source]
def token_expires=(token_expires : Time) #

[View source]
def user(id : String | Int64 = "me") : User #

[View source]
def user_id : Int64 | Nil #

[View source]
def user_id=(user_id : Int64 | Nil) #

[View source]