shish / shimmie2

An easy-to-install community image gallery (aka booru)
http://code.shishnet.org/shimmie2/
GNU General Public License v2.0
397 stars 111 forks source link

auto-tagging system based on MD5 hashes on other booru-like sites? #842

Open mmd123 opened 3 years ago

mmd123 commented 3 years ago

so, I find myself wanting a feature, and had asked around on reddit under r/selfhosted, and somebody suggested making a feature request given they also use shimmie2 and would also like to see this as a feature possibly added.

so, other sites out there that a lot of us likely use to browse certain materials exist (gelbooru, e621, chan.sankakucomplex, danbooru, just to name a few) all have publicly available galleries, and it was mentioned that if the site has an API that could be called, that you could use, as per the suggestion of another user, a python script for gallery-dl to have tags from matched images automatically populated into shimmie2, however, I am a horrible programmer, and I could not for the life of me implement this myself, so here we are, now asking about this being a feature request.

ideally, you would be able to specify information on what other sites to try and pull information from, in a configuration page for this particular feature, extension, or otherwise. but yea. what are the odds something like this could be added, either as an official feature, or an extension that can be installed/added only by those that want to add this functionality?

MetallicAchu commented 3 years ago

Hey there :) I was actually the one that suggested to post a request here.

As a note: this can be done either at upload, as another task like generating thumbnails, or as a prompt action, which is triggered manually.

I think the latter is better because this potentially could take a lot of time to process.

Are the current API extensions allow search by MD5? Another note: someone from Reddit suggested gallery-dl as tag based search.

mmd123 commented 3 years ago

Hey there :) I was actually the one that suggested to post a request here.

As a note: this can be done either at upload, as another task like generating thumbnails, or as a prompt action, which is triggered manually.

I think the latter is better because this potentially could take a lot of time to process.

Are the current API extensions allow search by MD5? Another note: someone from Reddit suggested gallery-dl as tag based search.

Thank you again for suggesting to ask this here, I had honestly not even considered to do so until you suggested to.

shish commented 3 years ago

Assuming those other sites have suitable APIs, it's definitely possible; I'm melting from my day-job at the moment but happy to advise and accept pull-requests ^^;;

Other thoughts -

mmd123 commented 2 years ago

Assuming those other sites have suitable APIs, it's definitely possible; I'm melting from my day-job at the moment but happy to advise and accept pull-requests ^^;;

Other thoughts -

  • it should be relatively easy to support both "at upload" and "manual click" approaches
  • if other sites use other hashes (eg sha1) we can hash the files on disk as-needed, it's not that expensive (unless it's being done in bulk)

given I have no idea how to do this, do you have any suggestions on how to try and implement this if I were to try and take a stab at making this myself?? I so far have not found any friends of mine that I can contact for help, on javascript or Php, so any insight or suggestions on what to try and do to implement this would be highly appreciated, especially so if you are able to suggest anything for reading on how to try and make an extension for this feature, ideally I'd like to set this up as an installable extension for shimmie, but so far, my attempts at googling anything for material to look into has been utterly fruitless. I'm likely going to have to teach myself both PHP and some javascript to get this done, but since so far, over months of asking, nobody else I know is able or willing to help, so may as well do it myself.

dali99 commented 2 years ago

If I were to do something like this I'd probably try to use hydrus (hydrus-network) (with the PTR) and some booru software that uses its client api. Of which there are at least a couple

mmd123 commented 2 years ago

If I were to do something like this I'd probably try to use hydrus (hydrus-network) (with the PTR) and some booru software that uses its client api. Of which there are at least a couple

honestly, I was going to try and write some kind of javascript library was my thinking, just was not sure of a couple things, one and most notably being how to hook it into shimmie in such a way that it could be called from the admin backend, like, when your looking at shimmie's interface, on the backend of my specific installation it has the following toolbars at the top: board config, system info, source changes, tag changes, board admin, extension manager, user list, chron upload, and tips editor, given the extensions I have installed and configured... my original thought process was to hook into that somehow, and then have a specific page for the tag searching by image, somehow, but I cant pre-plan to save my life, however given this runs on normal web server software, my thought was thus to use javascript and php, or maybe just regular HTML, so that its cross webserver compatible...

I have used hydrus in the past, and decided I did not like it for my own usage, thus why I ended up opting to use shimmie, I had demo'd basically every single damn thing that existed to be totally honest, gelbooru source, danbooru (opted not to try it given it had to run by way of ruby on rails, and to date I have never messed with ruby apps, gems or otherwise, so if I broke something, I'd be left unable to figure out how to fix it myself), and even other options, nothing even came close to what I wanted, which shimmi has come the closest to so far.