Giter Club home page Giter Club logo

mangadex's Introduction

MangaDex

GoDoc codecov

A Go client for the MangaDex API v2.

$ go get github.com/bake/mangadex/v2
func main() {
  md := mangadex.New()
  ctx := context.TODO()
  m, err := md.Manga(ctx, 23279, nil)
  if err != nil {
    log.Fatal(err)
  }
  fmt.Printf("%s by %s", m, m.Author[0])
  // Output: Wonder Cat Kyuu-chan by Nitori Sasami
}
func main() {
  md := mangadex.New()
  ctx := context.TODO()
  c, err := md.Chapter(ctx, 517244, nil)
  if err != nil {
    log.Fatal(err)
  }
  fmt.Printf("%s (Volume %s, Chapter %s)", c, c.Volume, c.Chapter)
  // Output: Cool Day (Volume 3, Chapter 253)
}

mangadex's People

Contributors

bake avatar girbons avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

girbons tracreed

mangadex's Issues

Mangadex new APIs

Hi @bake,

Mangadex changed its api recently and I was wondering if you plan to support the the new ones ๐Ÿ˜„

Add a v2

MangaDex built a new API and is deprecating v1. The client should be updated.

Endpoints:

  • /manga/{id}
  • /manga/{id}/chapters
  • /manga/{id}/covers
  • /chapter/{id}
  • /group/{id}
  • /group/{id}/chapters
  • /user/{id}
  • /user/{id}/chapters
  • /user/{id}/settings*
  • /user/{id}/followed-manga*
  • /user/{id}/followed-updates*
  • /user/{id}/manga/{mid}*
  • /user/{id}/marker*
  • /tag
  • /tag/{id}
  • /relations
  • /follows

Other things to change in v2:

  • Accept context
  • Accept query parameters
  • Add an authentication option

Some endpoints, like /manga/{id}, offer query parameters that restructure the response. include=chapters for example wraps the manga response in an object containing the Manga, PreviewChapters and Groups. I would like to ignore these parameters. However, others like page or limit are necessary. It'd probably be the best, to allow url.Values on all functions.

For v2.0.0 of this library, I'd like to have support for all public endpoints and a stable API. v.2.1.0 could add authentication.

Handle numbers represented as empty strings

MangaDex sometimes returns empty strings ("") instead of numbers. Up to Go 1.13 json.Number handled these the same way it did with "0". From 1.14 onward, unmarshalling this returns an error.

Numeric fields need to either become strings and loose their type information or a new implementation of the Unmarshaler (as suggested on the changelog).

Add v1.0.0

This repository doesn't get a lot of updates. As far as I know, it implements all known endpoints and allows for modifications (i.e. the URL in case .net is down for a while). It might be time to add a version tag.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.