• MentalEdge@sopuli.xyzOPM
        link
        fedilink
        English
        arrow-up
        2
        ·
        9 months ago

        Whachu think about this @[email protected] ?

        For now it can only link anilist, and only on franchises detected from an image, but I’ve started on some code to detect mentioned series even in posts where no image is linked.

        • wjs018@ani.social
          link
          fedilink
          English
          arrow-up
          2
          ·
          edit-2
          9 months ago

          Looks promising. In my work for the next generation shinobu, I’ve been playing around with getting external links for a given show using AniList’s api. Here is an example query for an anime using the search term “Frieren”. Specifically, the externalLinks field will return all the links that appear on the AniList page. Similarly, the idMal field will let you construct the corresponding MAL url. I just haven’t really done any testing with the search filter to figure out if the search results are ordered in a predictable way or not. I literally just did this one query as a proof of concept and then moved on to other things.

          I guess problems to figure out would be how to invoke the bot and specify what the search term should be. I think some of the reddit bots enclose the search term in angled brackets (<hypothetical search term>). Then you would just need to construct a regular expression to pick that out.

          • MentalEdge@sopuli.xyzOPM
            link
            fedilink
            English
            arrow-up
            2
            ·
            edit-2
            9 months ago

            Yea I just chucked AnilistPython in there lol

            Most of what I did was pulling a good search term from saucenao/danbooru, while leaving in some basic regex to find one from a posts title or comment/body text as a fallback once I change Soutaku to be able to respond without it detecting an image.

            • wjs018@ani.social
              link
              fedilink
              English
              arrow-up
              1
              ·
              9 months ago

              I see, I was envisioning something like /u/Roboragi from reddit. Also, for the AniList api, I have simply been using requests and parsing the response as a dict. In case you are curious:

              • Example query text: link
              • Querying the api with requests: link
              • Example parsing show info from response: link
              • MentalEdge@sopuli.xyzOPM
                link
                fedilink
                English
                arrow-up
                2
                ·
                9 months ago

                Yup. Something like that is the plan.

                Also thanks, I’mma take a look at that. That python package has not been updated for a while, so using requests might be warranted.

                AniLists search seems to work pretty damn well, too, the first result is the one you want 99% of the time.