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

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

    Scheduled Pinned Locked Moved Suggestions & Feedback
    81 Posts 25 Posters 30.9k Views
    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.
    • BruhtekB
      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
      • BruhtekB
        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

        pcjP 1 Reply Last reply Reply Quote 0
        • pcjP
          pcj Premium Member @Bruhtek
          last edited by

          @Bruhtek said in Developer PSA: labs.j-novel.club is your new friend!:

          Still looking for a way to sort the results

          sorting is easy to do client side.

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

            @pcj Then I would have to get all the series before sorting them, it is technically viable, but a way to get them already sorted to keep requests small (using pagination) would be even better

            pcjP 1 Reply Last reply Reply Quote 0
            • pcjP
              pcj Premium Member @Bruhtek
              last edited by

              @Bruhtek True that. I didn't think about pagination, but if that's involved you definitely want a server side sort.

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

                @Bruhtek Added jnovel.bruhtek.com to the CORS exceptions, definitely nicer than proxying user data through your CORS proxy (please don't). It also includes localhost, 127.0.0.1 and dev.j-novel.club (nonexistent host you can map yourself) if you want to develop locally.

                I thought I had documented sorting before, but here's the whole proto message for series querying:

                /**
                 * Search query for series
                 */
                message SeriesQuery {
                    string query = 1; // Search query
                    Series.Type type = 2; // The type of series to include
                
                    Sorting sort = 3; // How to sort the series
                    enum Sorting {
                        NEWEST = 0; // Sort by created, descending
                        OLDEST = 1; // Sort by created, ascending
                        AZ = 2; // Sort by title, ascending
                        ZA = 3; // Sort by title, descending
                    }
                
                    bool only_follows = 4;
                    bool only_catchups = 5;
                }
                
                1 Reply Last reply Reply Quote 3
                • X
                  xellon
                  last edited by

                  Hello, I'd like https://xellon.github.io to be included in CORS list. I'm making a pre-pub reader at https://xellon.github.io/pages/j-novel for my kindle paperwhite which has a very basic browser.

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

                    Hello,
                    Just in case it is needed. I wrote a script that snags all of my purchases very quick (epub). It's just a low-quality quickie, just in case it comes in handy, I've posted it here. No guarantees and such.

                    https://github.com/redmasq/jnc_swagger/tree/main/examples

                    I'm probably going to schedule it as a weekly job myself, so as to capture any errata and such. I'll suggest not to use the -forceAll unless necessary since it does cause it to download everything again, which could be hard on J-Novel Club's servers (I'm sure my testing was annoying).

                    I was having problems with an earlier version of FBReader. I found that repackaging the epub file fixes the issue. The script does this, but it is off by default since the files downloaded works perfectly fine in Calibre and such, and in the latest FBReader (probably was a zip handling issue).

                    I done it in Powershell since I run Windows for my main desktop, but if bash (Linux), zsh (OSX), or python (whatever) is needed, it's a simple exercise to convert it. For the shell script versions, I need web request and JSON support, so I would probably use something like jq and curl, but they are installed easily through pacman, yum, apt, or brew.

                    Happy Reading.

                    1 Reply Last reply Reply Quote 1
                    • sorvaniS sorvani referenced this topic on
                    • chocolatkeyC
                      chocolatkey Staff
                      last edited by chocolatkey

                      I'll update this post with the v2 changes after the migration is fully complete. In the meantime, here's a bonus about the new image CDN:

                      https://cdn.j-novel.club/pub/img/{height}/{format}/{path...}
                      
                      height:	120,240,360,480,600,720,840,960,1080,1200
                      format:	webp,avif,jpg
                      Full example URL: https://cdn.j-novel.club/pub/img/240/webp/01J/9/V/J9BYFSR8F77KXWT87AZR7.jpg
                      

                      Many of the images behind this CDN (e.g. covers) are currently low-resolution, so the bigger heights won't result in any change. The images will eventually be replaced by high-quality equivalents.

                      T 1 Reply Last reply Reply Quote 6
                      • T
                        TAAPAye Premium Member @chocolatkey
                        last edited by

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

                        I'll update this post with the v2 cha

                        So I completely misinterpreted this statement.

                        I noticed the site changed last week when all my scripts broke. I saw in the forms there were known issue being worked on and thought the above messaged indicated that the api itself was down and that an update would be posted when it was back online. So I thought I would just be patience and wait.

                        ...Then it occurred to me to replace v1 with v2 in all the api calls.

                        1 Reply Last reply Reply Quote 2
                        • yzh4rjdzob6Y
                          yzh4rjdzob6 Member
                          last edited by

                          It amuses me that w/ the change to v2, serie is still a thing. This is a typo for series, yes? Or, perhaps, a reference to an elf mage?

                          https://labs.j-novel.club/app/v2/parts/{{part slug}}/serie
                          

                          https://labs.j-novel.club/app/v2/parts/disowned-but-not-disheartened-life-is-good-with-overpowered-magic-volume-1-part-1/serie?format=json

                          GamenG 1 Reply Last reply Reply Quote 0
                          • GamenG
                            Gamen Premium Member @yzh4rjdzob6
                            last edited by Gamen

                            @yzh4rjdzob6 Probably not a typo. Possibly a concession to some library that needed distinction between the singular and plural, maybe just because. I know I find zero plurals aggravating when I want to name both a findFirstX and findManyX method just by using -s instead of being that explicit... (anime and manga are another two annoying examples that would go the other way, tacking on a bad -s to make them plural)

                            My talking sword has a point. And is also right.

                            A 1 Reply Last reply Reply Quote 0
                            • A
                              admin Staff @Gamen
                              last edited by

                              @Gamen Indeed this was a choice I made 8 years ago when developing JNC myself. Yes, it would have been possible in the framework I was using to have Series be the model and series be an instance of that model but I felt that would make the code less readable and more prone to errrors and I'd rather have it clear "singlar" word for it that the poor English language doesn't have, so made a convention to call a single series a "serie".

                              G 1 Reply Last reply Reply Quote 6
                              • T
                                talisein Premium Member
                                last edited by talisein

                                I just realized my aoab monitor has been failing to login since Oct 10th with a 504. Has the login protobuf changed by chance? I don't think it was ever documented and I forget how I figured it out. I know its on me to fix but I thought I would ask..

                                Ah, I missed the v2 change..

                                M 1 Reply Last reply Reply Quote 0
                                • M
                                  Malloc Premium Member @talisein
                                  last edited by

                                  This post is deleted!
                                  1 Reply Last reply Reply Quote 0
                                  • M
                                    Malloc Premium Member
                                    last edited by Malloc

                                    Has https://labs.j-novel.club/embed/{part_id}/data.xhtml been disabled? I am now only getting the error "(404) Not Found" from it

                                    When I inspect the web's part reader I see they are getting the data from blob:https://labs.j-novel.club/{Some unknown token} which doesn't look like a part id at all.

                                    Also https://labs.j-novel.club/app/v1/me/library?format=json which I use to determine what volumes I own is returning "(503) Server Unavailable" and when change v1 to v2 as an earlier post indicated I get "(401) Unauthorized".

                                    GamenG 1 Reply Last reply Reply Quote 0
                                    • GamenG
                                      Gamen Premium Member @Malloc
                                      last edited by

                                      @Malloc I see https://labs.j-novel.club/embed/v2/PRT-2VPLKJA/data.xhtml for the latest tearmoon part, so everything looks fine to me. I assume the old (MongoDB?) ObjectIds, which have been termed legacyId in the data for a while now, were replaced with these new ids.

                                      My talking sword has a point. And is also right.

                                      M 1 Reply Last reply Reply Quote 1
                                      • M
                                        Malloc Premium Member @Gamen
                                        last edited by

                                        @Gamen
                                        The URL you are using to get the PartData is different from mine... however I don't get the newer ids, only the old ObjectIDs. Looks like my code is still using api.j-novel.club/api/series/findOne. I bet that is the reason why I am not getting the newer ids. I need to fix the methods I use for getting the series volumes and parts.

                                        Is there a place that lists all the new V2 versions of the api urls? The first post in this thread just lists the first migration from to labs but not the V2 version.

                                        GamenG 1 Reply Last reply Reply Quote 0
                                        • GamenG
                                          Gamen Premium Member @Malloc
                                          last edited by

                                          @Malloc I haven't looked into it that much, that just came from opening a part with the network tab open and seeing what was requested. From the little I've played with it, I think it's just v1 replaced with v2, but the endpoints take the new id instead of the old.

                                          I really, really haven't played with it much; even now that I remember why I made my own calendar, or at least found a problem with it that might have been what I was trying to fix for myself (even though it requests 200 events starting from like two days ago every time I switch focus to it, it doesn't seem to integrate them into the results so new parts don't show up if the tab is left open like i do), I haven't actually gone to the effort of fixing it to use the new APIs.

                                          My talking sword has a point. And is also right.

                                          1 Reply Last reply Reply Quote 0
                                          • Crimson WiseC
                                            Crimson Wise Premium Member
                                            last edited by

                                            Indeed. For the most part, to migrate my reader it was about replacing v1 with v2 in the URLs, and using id instead of the old legacyId. There were a few other minor differences I noted here but it mostly worked with the above.

                                            Quof got a break.
                                            WHAT'S THE STORY WITH THAT FREAKING BLACK DRAGON?!

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