Danbooru

Upload software (a little bit like the firefox extension)

Posted under General

Hello,

(sorry for bad english), for my personnal use, I have set up a danbooru gallery on my personnal server, and have to upload more than 10GB of pictures, doing this through the bookmarklet is painfull because it put the url in the wrong field, and I have to cut/paste it in the good one, so I tried the firefox extension but it is not really suited to upload a lot of pictures at once.

So I made a little software (written in java for multi OS compatibility), it sure lacks of functionnalities (like related tag) but it is really usefull for me.

So here is the link to my netbeans project : http://www.kawaiyume.net/~jDanbooru/jDanbooru_v1.0.7z

You must have java >= 1.5 installed. In the 'dist' folder you will find the binary version, just execute it, and voila.

If you want to make modification to the software, it's up to you, but if you can send me your contribution, it would be great.

Please post comments, or feedback.

Thanks.

--
iXô

Updated

Shuugo said:
Seems to be not working in mac, when you press upload it's doing nothing.

Also it doesn't let you browse other hard drives than the main one

Funny, because I have developped it on a mac, but maybe there is still some bug.

For the hard drive browsing : it is the java browser, and if you have a second disc, you have to go to the top most root of the first drive (Mac hard drive, i don't remember his name), then you should see a folder named 'Volumes', and networks mounted drives, and local other drivers are here.

The probleme you might have is that the server address (for this danbooru gallery) is 'http://danbooru.donmai.us' without ending '/', I am really sorry, I don't check the server address, so it have to be the good one (something I have to do for a next release ?).

Other thing important : pictures that have been uploaded to the gallery are renamed by adding '__uploaded' to the end of the file, and files that are already on the gallery arre named by adding '__already_uploaded' to the end of the file.

Maybe this feature should be an option, but for me it is really important.

If this software is interesting many people, I will do the modifications fast.

Thanks.

An other important point to know : the checkbox 'upload' have to be checked for marking the file.

BUT : there is a little problem that I have noticed and that was not really important during development, and I haven't corrected it :

if you have 2 pictures if the list, and you want to upload only one : you select this file in the list, you choose your options (tag, rating, upload), and you have to select the second file because if not, the 'upload' check is not saved, I don't really understand why for the moment, but it will be corrected.

I am really sorry.

iXô said:

For the hard drive browsing : it is the java browser, and if you have a second disc, you have to go to the top most root of the first drive (Mac hard drive, i don't remember his name), then you should see a folder named 'Volumes', and networks mounted drives, and local other drivers are here.

I have other java apps, that option you say is not appearing, I can't go upper than my main disk.

http://img412.imageshack.us/img412/3160/picture5pj9.png

Well now items appear on the list still is not uploading anything.

http://img266.imageshack.us/img266/2351/picture6ko4.png

Problem might be here:

new String("choujin-steiner--" + jPasswordField_Password.getText() + "--").toCharArray()).toLowerCase()

My server uses a different salt, like moe.imouto uses another salt too. Maybe make salt an option?

Ahhh! yes for me I didn't know that the salt password can be changed. sorry. I will do a salt option in a few minutes.

For the drive selection :

look here : http://www.kawaiyume.net/~jDanbooru/Image_1.png

There is 2 drive in my mac computer : 'Baie 1' and 'Baie 2' the first was the hard drive shipped by apple in the computer, and the second a drive I have added.

In jDanbooru, I can't select 'Baie 2' like you in your screenshot : http://www.kawaiyume.net/~jDanbooru/Image_2.png

But, if I select 'Baie 1' (for you it might be 'Shion') : http://www.kawaiyume.net/~jDanbooru/Image_3.png there is a folder named 'Volumes' here, double clic it : http://www.kawaiyume.net/~jDanbooru/Image_4.png I can see 'Baie 2' now.

In fact every drives (an network drives too) are mounted in /Volumes, but Apple hide it in the finder, by making more user friendly.

Updated

iXô said:
Ahhh! yes for me I didn't know that the salt password can be changed. sorry. I will do a salt option in a few minutes.

Thanks Really appreciate it :)

There is 2 drive in my mac computer : 'Baie 1' and 'Baie 2' the first was the hard drive shipped by apple in the computer, and the second a drive I have added.

In jDanbooru, I can't select 'Baie 2' like you in your screenshot : http://www2.kawaiyume.net/~jDanbooru/Image_2.png

But, if I select 'Baie 1' (for you it might be 'Shion') : http://www2.kawaiyume.net/~jDanbooru/Image_3.png there is a folder named 'Volumes' here, double clic it : http://www2.kawaiyume.net/~jDanbooru/Image_4.png I can see 'Baie 2' now.

Awk ok got it, is kinda different in leopard I see

Im trying to figure why

retValue = Integer.parseInt(filePost.getResponseBodyAsString().substring(filePost.getResponseBodyAsString().indexOf("/post/show/") + "/post/show/".length(), filePost.getResponseBodyAsString().indexOf("\" success=")));

threw me :

Uploading 1199959106432.jpg to http://konachan.com/post/create.xml
java.lang.StringIndexOutOfBoundsException: String index out of range: -105
at java.lang.String.substring(String.java:1938)
at jdanbooru.MainFrame$ProcessingThread.uploadNewPost(MainFrame.java:683)
at jdanbooru.MainFrame$ProcessingThread.processUploadAction(MainFrame.java:554)
at jdanbooru.MainFrame$ProcessingThread.run(MainFrame.java:527)

iXô said:
I will correct the MDGest exception problem now.

fixed lol!

System.out.println(filePost.getResponseBodyAsString());
String ficken = filePost.getResponseBodyAsString();
String[] bla = ficken.split("show/");
String blabla = bla[1].substring(0,bla[1].indexOf("\""));
System.out.print(blabla);
retValue=new Integer(blabla);

edit, works for konachan
no idea about danboo
well its useless for danbo+me anyways since i could only upload 16 posts / day

edit 2 :
My observations so far :

  • Imageicon bugs a bit (minor, when frame is too small you cant scroll, once you make frame bigger you can view full pic)
  • Imageicon slows down tagging enormously if images get bigger... (like moe.imouto style ;))
  • How can I tag more than one pic at the same time??
  • No clear list / retry once upload failed (like wrong pw) ?!

I have no idea how one could use this to tag 10gb or more...

Updated

MDGeist said:
fixed lol!
...

code modification integretad, thanks.

MDGeist said:
edit 2 :
My observations so far :

  • Imageicon bugs a bit (minor, when frame is too small you cant scroll, once you make frame bigger you can view full pic)

yeah, bug to be corrected, mouse scroll force the gui to refresh, hum, not really good.

MDGeist said:

  • Imageicon slows down tagging enormously if images get bigger... (like moe.imouto style ;))

yes, and I have a lot of big pictures too, (somes came form moe.imouto) but I don't really know how make it possible to draw fast big pictures, I will search for a swing component than can do that, for the moment it is a SwingX component that isn't finished yet.

MDGeist said:

  • How can I tag more than one pic at the same time??

;) I don't know, do you have proposition for gui enhancement ?

MDGeist said:

  • No clear list / retry once upload failed (like wrong pw) ?!

yes, but if wrong password, as it is in the config file now, we have to restart the programm.

MDGeist said:
I have no idea how one could use this to tag 10gb or more...

with a lot of patience, but it is anyway a little faster thant with the browser

;) I don't know, do you have proposition for gui enhancement ?

Well I already have a method which works quite fine if images are on a webspace.
(So importing from Danbo1/Shimmie1 on server 1 to Danbo2 on server2)

Helped Konachan that way and batch imported 30k+ pics with right tags ^^ ....

MDGeist said:
Well I already have a method which works quite fine if images are on a webspace.
(So importing from Danbo1/Shimmie1 on server 1 to Danbo2 on server2)

Helped Konachan that way and batch imported 30k+ pics with right tags ^^ ....

I think I saw what you say, with curl ?

I will search a way to mass tag in the list (maybe with multiple selection, .... yes that it !).

Shuugo said:
Working fine :)
I would love or rather have the upload checkbox enabled by default (config option) or the multi-image editing working. First should be easier though

Done for version 1.4, both features. upload checkbox enabled by default -> upload_default_value set to true

Multi-image editing work now, select the first file in the list, press and hold 'shift' keyboard key, then select the last file, (you can make 'hole' with 'ctrl' (windows and *nix) ,  for mac)), then set the options, you will notice that the preview picture display the first picture, it is nearly normal.

http://www2.kawaiyume.net/~jDanbooru/jDanbooru_v1.4.7z

1 2 3 4