Danbooru

Batch download a tag set

Posted under General

You also need to make the .* matching lazy if you want it to work properly with "file_url" to download the original images instead of the samples.

Also if you close the new document created, it doesn't appear to be loading forever.

Oh, also a nitpicky little detail is that the link's closing tag needs a backslash.

Other than that, good work.

This modification should work properly with "file_url" and any file type, and stops loading when complete:

javascript:

var images = document.body.innerHTML.match(/"file_url":"(.*?\.\w*)",/g);
var links = window.open("");
var links_html = "";
var n = images.length;

for(var i = 0; i < n; i++) {
var imgsrc = images.match(/http:\/\/.*\.\w*/);
links_html += "<a href=" + imgsrc + ">" + imgsrc + "</a><br />\n";
}links.document.write(links_html);
links.document.close();
// NULLTERM [\0]

Updated

Updated version that allows you to select only which images to download. http://snipt.org/HMg

Also, thanks for the feedback!

TIP: Use it as a bookmarklet so you won't have to copy/paste it everytime.

EDIT: Now uses [Post.posts.get(post_id)] function to get image URLs instead of using regular expressions.

Updated

I have a few questions:

1) Ive been trying to download from three-dee booru following the instructions Ive found on here but it doesn't work, is there any thing I can do?

2) If I select a tag like Cirno chartags:1 to download will the downloader download all cirno pics with one character tag or will it download all cirno pics, then all pics with one character tag?

If you are asking about the javascript solution on these last couple pages, search for your query cirno chartags:1 (on 3Dbooru ), it's helpful to expand the limit argument, since you'll need to run the script on each page with this method the way it's written.

Then copy-paste everything from "javascript:" on into the address bar. It should provide you with a page you can use DownThemAll on, or to save and use wget with, or however you prefer.

It downloads all the tags returned by the query, not all of each tag sequentially. I haven't used the perl script at the beginning of the thread, so I'm not sure what that does.

Scalar said:
I have a few questions:

1) Ive been trying to download from three-dee booru following the instructions Ive found on here but it doesn't work, is there any thing I can do?

2) If I select a tag like Cirno chartags:1 to download will the downloader download all cirno pics with one character tag or will it download all cirno pics, then all pics with one character tag?

1. I don't know. :(
2. It will download all cirno pics with 1 character tag. It is as if you put the query into the search bar.

3dbooru was getting throttled to 5mbit by the provider on a nearly daily basis (partly due to a txt file circulating with direct urls of every image) so nil had to go through some measures to prevent casual rippers, this script may have been one of the casualties.

Action_Kamen said:
And what if I want only the pics rated safe and questionable and not the explicit stuff, will I have to download them one at a time or is there a command I can use.

There's http://code.google.com/p/tagbooru/ , which actually gets maintained and seems to work right now. It's not capable of selecting pictures based on who added it to their favorites, but it has options for safe/explicit and it's pretty straight forward as opposed to the other Perl scripts

redtails said:
There's http://code.google.com/p/tagbooru/ , which actually gets maintained and seems to work right now. It's not capable of selecting pictures based on who added it to their favorites, but it has options for safe/explicit and it's pretty straight forward as opposed to the other Perl scripts

This is exactly what I've looking for all this time. Thank you very much!

redtails said:
There's http://code.google.com/p/tagbooru/ , which actually gets maintained and seems to work right now. It's not capable of selecting pictures based on who added it to their favorites, but it has options for safe/explicit and it's pretty straight forward as opposed to the other Perl scripts

does anyone know how to download from other booru site using tagbooru download?

Updated

A problem with tagbooru is that it actually doesn't support unicode and exact-word search. (correct me if i'm wrong)

so now i'm gonna try the method Granola mentioned a year ago. I hope it's still applicable though...

EDIT:
And yup, it still is. Thx Granola.

Updated

hitori87 said:
A problem with tagbooru is that it actually doesn't support unicode and exact-word search. (correct me if i'm wrong)

so now i'm gonna try the method Granola mentioned a year ago. I hope it's still applicable though...

EDIT:
And yup, it still is. Thx Granola.

i want to try it, but i don't understand a bit about what he/she saying

@Boush

1. Download and install Strawberry Perl.

2. Download Danbooru Downloader v1.2, unzip, make sure the zip contents are in a same folder.

3. In that folder, New -> Text Document -> type command such as example below -> Save as -> whatevername.bat (in the name field) and choose "all files" (in file type field)

perl booru.pl danbooru touhou -p="E:\Test" -u=yourusername -w=yourpassword

Such a command line will download every image with touhou tag from danbooru, file name will be their post number, into folder Test of E: drive. Of course use your own username and password. You can have multiple command lines like this in 1 .bat file.

4. After saving, click Close. The icon for .bat file you just create should be a gear in a window. Now double click that file and check if it runs well.

Updated

hitori87 said:
A problem with tagbooru is that it actually doesn't support unicode and exact-word search. (correct me if i'm wrong)

so now i'm gonna try the method Granola mentioned a year ago. I hope it's still applicable though...

EDIT:
And yup, it still is. Thx Granola.

there are two unicode tags here on danbooru which I'm familiar with, and tagbooru does support exact word searches

Fencedude said:
I was running this search:

perl booru.pl danbooru black_rock_shooter -f=${md5} -p="F:\Anime Images\B\Black Rock Shooter"

And it downloaded ~100 images, and then quit. Now it won't work at all for me.

Sorry to bump, but for about a week or two now oreno imouto doesn't seem to be downloading more than 100 images at a time. Also, the login does work for danbooru, but not for oreno.
More than 100 images download at a time for danbooru.
Perhaps there's an updated script beyond 1.2?
I've also modified list.pm to reflect the changes.

moeimouto=>sub{
use Booru::Dan;
Booru::Dan->new(
"http://oreno.imouto.org",
);
},
any ideas?

1 3 4 5 6 7 8 9