J-Novel Club
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Users

    Developer PSA: labs.j-novel.club is your new friend!

    Suggestions & Feedback
    25
    81
    11412
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • chocolatkey
      chocolatkey Staff @talisein last edited by

      @talisein that's because the ebooks are generated on the fly as they're downloaded. Some sort of etag-equivalent unrelated to the content of the final ebook you download maybe be a possibility in the future, but it will probably never be a checksum of the content itself

      1 Reply Last reply Reply Quote 0
      • chocolatkey
        chocolatkey Staff @yanrishatum last edited by chocolatkey

        @yanrishatum

        Have to also note about /parts/$id/toc not making sense, as it clearly should be /series/$id/toc / /series/$id/parts

        I know, it's weird. It's a quirk of dealing with the current database and how everything is connected, and it's just easier/more efficient for now to say "I am currently reading this part and I want the TOC for its series" for the mobile app, for which this API was originally designed for. We'll have a better TOC API in the future, probably /v2

        Regarding your suggestion for accepted content-type, I'll look into it, first I have to make sure it doesn't break any of the clients

        1 Reply Last reply Reply Quote 0
        • chocolatkey
          chocolatkey Staff last edited by

          Added the following to the list:

          PUT https://labs.j-novel.club/app/v1/me
          GET/POST https://labs.j-novel.club/app/v1/me/subscription
          POST https://labs.j-novel.club/app/v1/me/subscription/sync
          POST/DELETE https://labs.j-novel.club/app/v1/me/subscription/cancel
          POST https://labs.j-novel.club/app/v1/me/subscription/estimate
          GET/DELETE/PUT https://labs.j-novel.club/app/v1/me/method
          GET https://labs.j-novel.club/app/v1/me/method/setup
          

          Subscription management through the old API is no longer supported, and may be removed at any time.

          P.S. I'm getting tired of updating/maintaining this list, it will soon be time for proper API docs, currently researching the most appropriate/best docs generator.

          1 Reply Last reply Reply Quote 1
          • Ran
            Ran @chocolatkey last edited by

            Thanks for making all this available, even unofficially -- if you add proper API docs that'll be more than some major companies provide for official partners. :)

            Speaking of APIs ...
            @chocolatkey said in Developer PSA: labs.j-novel.club is your new friend!:

            POST https://labs.j-novel.club/app/v1/me/coins/purchase

            Knowing the kind of parameters each takes would be really helpful -- it's a lot harder to work backwards with protobufs!

            chocolatkey 1 Reply Last reply Reply Quote 0
            • chocolatkey
              chocolatkey Staff @Ran last edited by chocolatkey

              @Ran Yeah protobufs docs is also part of what I want to expose... For now have this, you POST it a PurchaseRequest

              message StripePaymentIntent {
                  string payment_method = 1;
                  string payment_intent = 2;
              }
              
              message PurchaseRequest {
                  enum Processor {
                      DEBUG = 0; // Only works when debug mode is enabled on the server
                      STRIPE = 1; // Stripe
                      // Insert app payment processors here!
                  }
                  Processor processor = 1; // The payment processor to use
                  uint32 amount = 2; // The amount of coins to purchase
                  oneof intent { // The payment intent from the processor
                      StripePaymentIntent stripe_payment_intent = 3;
                  }
              }
              

              If I remember correctly the enum values need to use the names in JSON, so "processor":"STRIPE"

              Ran 1 Reply Last reply Reply Quote 1
              • Ran
                Ran @chocolatkey last edited by

                @chocolatkey Awesome, thanks! That's exactly what I needed. You were totally right about the enum name -- and I would never have figured out how to pass along the payment intent without seeing the protos laid out like that.

                1 Reply Last reply Reply Quote 0
                • chocolatkey
                  chocolatkey Staff last edited by chocolatkey

                  Added a new GET https://labs.j-novel.club/app/v1/series/{ID or slug}/aggregate , to get all data regarding a series (series, volumes, parts). Should be identical to making the individual requests

                  1 Reply Last reply Reply Quote 3
                  • chocolatkey
                    chocolatkey Staff last edited by

                    Added "status" to series, which can be (in JSON format) one of "DEFAULT", "COMPLETE", "HIATUS"

                    1 Reply Last reply Reply Quote 2
                    • Bruhtek
                      Bruhtek Member last edited by

                      Is it possible to get some pointers on the /parts/$slug/data endpoint? Light novel data is simple enough with /embed/$slug/data.xhtml, but doesn't work for manga. I am trying to get manga parts, but have no idea where to even start decoding the response.

                      chocolatkey 1 Reply Last reply Reply Quote 1
                      • chocolatkey
                        chocolatkey Staff @Bruhtek last edited by

                        @Bartek The manga parts currently have DRM due to the stipulations of the original publisher(s). There is, therefore, no documentation on how to decode and display manga data

                        Bruhtek 1 Reply Last reply Reply Quote 1
                        • Bruhtek
                          Bruhtek Member @chocolatkey last edited by

                          @chocolatkey Ah, too bad!

                          1 Reply Last reply Reply Quote 1
                          • T
                            TailsxKyuubi Premium Member last edited by

                            My question is regarding the covers. is there any reason, that the field originalUrl is always empty? i would need the cover in a higher resolution.

                            chocolatkey 1 Reply Last reply Reply Quote 0
                            • chocolatkey
                              chocolatkey Staff @TailsxKyuubi last edited by

                              @TailsxKyuubi Because we don't actually have any original uploaded right now, it's planned for the future although I think that structure may change before then

                              T 1 Reply Last reply Reply Quote 0
                              • T
                                TailsxKyuubi Premium Member @chocolatkey last edited by

                                @chocolatkey i dont understand the problem. they are already in some way uploaded. the ebooks itself already have the cover wouldnt it be possible to upload this in a automated process?

                                1 Reply Last reply Reply Quote 0
                                • Bruhtek
                                  Bruhtek Member last edited by

                                  Does the /auth/otp4app/check not accept format=json query? It works with /auth/otp4app/generate/, but for some reason not with the check one. From a decoder, all I can guess is that it returns some kind of token starting with otp_, and 3 numbers? Could we get some more info on how to login using the OTP code?

                                  T 1 Reply Last reply Reply Quote 0
                                  • T
                                    thelta Member @Bruhtek last edited by thelta

                                    @Bartek
                                    Yeah, I also couldn't manage to work with json. However, with protoc --decode_raw you can easily parse it. The protobuf format is probably something like this.

                                    message Ttl
                                    {
                                      int64 ttl_seconds = 1;
                                    }
                                    message AuthSession 
                                    {
                                      string token = 1;
                                      Ttl ttl_seconds = 2;
                                      google.protobuf.Timestamp timestamp = 3;
                                    }
                                    

                                    Token size is 56 characters.

                                    chocolatkey 1 Reply Last reply Reply Quote 0
                                    • chocolatkey
                                      chocolatkey Staff @thelta last edited by

                                      @thelta @Bartek this is fixed, please try again

                                      1 Reply Last reply Reply Quote 2
                                      • redmasq
                                        redmasq Premium Member last edited by redmasq

                                        For the heck of it, I decided to start going through the topic here and document the interface.

                                        https://github.com/redmasq/jnc_swagger/blob/main/j-novel-club.swagger.yml
                                        ...the website https://editor.swagger.io/ can be used to view it. I have setup a viewer on https://redmasq.github.io/jnc_swagger/

                                        @chocolatkey if this effort is inappropriate for sharing, let me know and I'll private the repo and just keep it for my own purposes; however, in the meantime, I'm making my work available for others as I go along.

                                        Just to note... It is a work-in-progress. So far, I've only done the initial login, but I will be expanding the document as I have time. As a programmer who likes to read isekai, I am hopelessly lazy and prefer studying and reading light novels over actually documenting... the effort is useful to me and I do like to spread the benefit; however, I'm not promising any timelines, update schedule, or anything of the like. I am willing to accept pull requests.

                                        1 Reply Last reply Reply Quote 2
                                        • Bruhtek
                                          Bruhtek Member last edited by Bruhtek

                                          @chocolatkey Can I ask You to add https://jnovel.bruhtek.com and (if possible *.jnovel.bruhtek.com) to CORS? I am working on a E-Ink optimized reader, and currently using my own cors proxy, but would prefer to be able to get rid of it as soon as possible (at least for the deployed version).
                                          Thanks

                                          1 Reply Last reply Reply Quote 1
                                          • Bruhtek
                                            Bruhtek Member last edited by Bruhtek

                                            Also, are there any query parameters for /app/v1/series, except for the format and limit?. I am thinking about a way to only get follows / only catchups (since they're in the app), and if available, maybe also a way to sort the series A-Z, Z-A, release date/update date?

                                            Edit:
                                            Figured out follows and catchups, for anyone else you have to make a POST request, with body of

                                            {
                                            	"only_follows": true/false,
                                            	"only_catchups": true/false
                                            }
                                            

                                            Still looking for a way to sort the results

                                            pcj 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 3 / 5
                                            • First post
                                              Last post