Bionus / imgbrd-grabber

Very customizable imageboard/booru downloader with powerful filenaming features.
https://www.bionus.org/imgbrd-grabber/
Apache License 2.0
2.59k stars 220 forks source link

About 'command', is it possible to ... #112

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
After what you told me in issue 111,
I wonder if those option where able to do a few thing I wished could have been 
automated :

1.
here is my filename:
%search_1%\%website%\[%artist%] %id% (%copyright% (%character%)).%ext%

I generally search image per artist names
and the, use that artist name as a folder to put the images.
I have so many downloaded images now, that I put each of those artist folder, 
in another folder With their initial letter (every artist starting with A, in 
'A' folder; artist with B, in the 'B' folder; etc)

So, is it even possible to automate that?
something like this :
%1 letter of search_1%\%search_1%\%website%\[%artist%] %id% (%copyright% 
(%character%)).%ext%

that would also be useful to shorten other name, like website names, etc.

2.
is it possible to replace a tag result, in the filename by something else. 
example :

if tag ="neon genesis evangelion"
then replace with "evangelion"

if website is "danbooru.donmai.us"
then %website% token = "danbooru"

Original issue reported on code.google.com by ser...@hotmail.com on 17 May 2012 at 8:55

GoogleCodeExporter commented 9 years ago
Haha, sorry but no, i is currently impossible. In fact, it is theorically 
possible with commands (starting a .bat which would then move the file to the 
designed folder automatically), but I think it would be really too complicated.

However, I had a idea some days ago which will be added in the next version: 
javascript filenaming (which will allow to generate the filenames with 
javascript). Thanks to it, your both requests will be doable, but it would 
still be a little bit complicated for someone who doesn't know javascript. For 
example, it is what you will have to put in the fields when JS filenaming is 
available.

1. Something like that:
return search_1.substr(0,1)+'\'+search_1+'\'+website+'\['+artist+'] '+id+' 
('+copyright+' ('+character+')).'+ext;

2. if (website == 'danbooru.donmai.us')
{ website = 'danbooru'; }
Or
website = website.split('.')[0];
Or
website = website.replace('danbooru.donmai.us', 'danbooru');
And, for the tags:
tags = tags.replace('neon_genesis_evangelion', 'evangelion');

So it is actually just programming, but I think it is still the easiest way to 
allow a great liberty in filenaming ^^'

Original comment by bio.nus@hotmail.fr on 17 May 2012 at 10:05

GoogleCodeExporter commented 9 years ago
seem cool,
and a perfect solution

I am no programmer,
but I perfectly understand the logic
I can look at html code and understand large part of it.
I also did some programing on my old C64
and also, more recently in maya.

those lines of code,
I know nothing about it,
but I perfectly grasp their logic!

That is the only thing I need to make it my own.

Thanks, 
Can't wait for that version ;)

Original comment by ser...@hotmail.com on 17 May 2012 at 10:52

GoogleCodeExporter commented 9 years ago
Aha, well if you already did C64 BASIC and understand the logic behind the 
little scrips I wrote, it shouldn't be too hard to understand JavaScript, which 
is by no means a difficult language. ^^

I'll add a wiki about it anyway when the feature comes out. :)

> Can't wait for that version ;)
Having a lot of work currently, I don't think it will be available any time 
soon. Priority to bugfixes. :X

Original comment by bio.nus@hotmail.fr on 17 May 2012 at 11:47

GoogleCodeExporter commented 9 years ago
Thinking back about it, I think this feature will be available in 3.1.5 
ultimately :)

Original comment by bio.nus@hotmail.fr on 21 May 2012 at 9:32

GoogleCodeExporter commented 9 years ago
thanks!
cant wait for that version :P

but, be prepared, I certainly will have a few question about the 
possibilities...

Original comment by ser...@hotmail.com on 22 May 2012 at 9:49

GoogleCodeExporter commented 9 years ago
Yeah, I'm sure you'll have a lot of questions and bugs to report.
I can't wait... :S

* runs *
:)

Original comment by bio.nus@hotmail.fr on 27 May 2012 at 11:16

GoogleCodeExporter commented 9 years ago
About 1.5 months later (>.>), 3.1.5 is out, which includes Javascript 
filenaming in it. To access this part, you just have to click the "..." button 
near the filename's text box. Then, just change the radio button from "classic 
filenaming" to "Javascript filenaming" (your current filename should have been 
converted to javascript automatically).

If you have any questions, you can ask me (for example if you don't know how to 
do something in Javascript) :)

Original comment by bio.nus@hotmail.fr on 8 Jul 2012 at 9:19

GoogleCodeExporter commented 9 years ago
Gee, thanks,
you were away for so long!
Exams I suppose :P

I will Check that new naming tool,
I see what I can grasp all by myself

As you know, up to now, I just want grabber to put the images in separated 
folders that is simply the first letter from the tag.

I'll ring you if ever I am unable to resolve this all by myself.
so,... see you very soon!! XD

Original comment by ser...@hotmail.com on 8 Jul 2012 at 10:56

GoogleCodeExporter commented 9 years ago
Yep, exams, and part-time job getting super-busy all of a sudden. I haven't 
even done my exams as well as I wanted (maybe it was expecting too much ^^).

By the way, here is the corrected Javascript expression I put earlier*, if you 
want the solution ^^
search_1[0] + '\\' + search_1 + '\\' + website + '\\[' + artist + '] ' + id + ' 
(' + copyright + ' (' + character + ')).' + ext

I hope it'll work :D

* "earlier" in this issue, not on a time-based scale, since it was about two 
months ago :-°

Original comment by bio.nus@hotmail.fr on 8 Jul 2012 at 11:28

GoogleCodeExporter commented 9 years ago
I just tried the java command line you gave me a long time ago...

does not seem to work ^^;

apparently, there is syntax error somewhere

return search_1.substr(0,1)+'\'+search_1+'\'+website+'\['+artist+'] '+id+' 
('+copyright+' ('+character+')).'+ext;

some + and ' must be missing, I think ,

not sure where...
whatever I tried, did not fixed it.

Original comment by ser...@hotmail.com on 9 Jul 2012 at 12:13

GoogleCodeExporter commented 9 years ago
Yes, I put the corrected version in my previous post.

There were three errors: the return was useless, the ";" was useless too, and 
the \ had to be escaped (doubled). I also simplified the substring part, but it 
wasn't necessary :)

Original comment by bio.nus@hotmail.fr on 9 Jul 2012 at 12:21