Giter Club home page Giter Club logo

rustpixiv's People

Contributors

buibuibui avatar doumanash avatar fairingrey avatar tesaguri avatar

Stargazers

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

Watchers

 avatar

rustpixiv's Issues

support the v2 API

Reference:

There are 5 new endpoints that I'm aware of:

  • https://app-api.pixiv.net/v2/illust/follow -- GET
  • https://app-api.pixiv.net/v2/illust/related -- GET
  • https://app-api.pixiv.net/v2/illust/bookmark/detail -- GET
  • https://app-api.pixiv.net/v2/illust/bookmark/add -- POST
  • https://app-api.pixiv.net/v2/user/list -- POST

Will cross-reference other libraries when I need to.

Note that AppAPI is broken on pixivpy (no-auth requests no longer work, even with auth it doesn't work), which is why I didn't implement it yet. Wanted to get something rudimentary published first (as of opening this issue I'm still leaving the version at 0.1 until I'm more confident).

Do more testing/experimentation with it, see if it's usable.

Depending on how testing it goes, may override some v1 methods? Could be another big breaking change (v1 support will probably go into its own separate module if so)

  • v2 API likely still doesn't care about the User-Agent header and all that other junk, but if it does, take note.

Redesign: Separate data structures from HTTP client

Currently, API is tied to reqwest as HTTP client so anyone who would want to use own HTTP Client would be unable to do it as Pixiv and PixivRequestBuilder are tied to it.

So what would be better if we could use
PixivRequestBuilder to create PixivRequest

And then user would need to pass PixivRequest to Pixiv for execution.

Pixiv itself would be in a separate module and optional, only if user would not disable default feature that enables reqwest

Most likely it would require to rename it.

Most likely ready to be send PixivRequest would its field to be public so that user could create request from it.
As most existing HTTP clients use http crate for basic primitives it should be easy to use it with any other clients

P.s. Well I'd like to have this separation because I prefer my own HTTP client to reqwest

Update documentation, tests, other things

Just notes to myself, but...

#1 has introduced a few potential breaking changes

  • Pixiv::new now clones a given reqwest client.
  • PixivRequestBuilder now borrows a Pixiv instead of a Client

And also a lot of QOL things. Some errors on authorization now panic instead of trying to use an unexpected result (which is good), and certain function signatures have changed to accept more generic arguments using traits (namely favorite_works_remove and others like it).

I'll be updating this as I go since I haven't looked at absolutely everything, but I should test/review it all and push a new version soon.

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.