Nandaka / DanbooruDownloader

*booru image downloader
http://nandaka.devnull.zone/
392 stars 38 forks source link

Requirement:

For linux/Mac, you can try to compile the source code using:

The latest source code can be pulled from https://github.com/Nandaka/DanbooruDownloader. The compiled binary can be downloaded at http://nandaka.devnull.zone/tag/danbooru-batch-download/ The previous version of compiled binary can be downloaded at https://github.com/Nandaka/DanbooruDownloader/releases

DanbooruProvider.xml

This file will be parsed when you run the applications. You can modify the xml to add new provider. The contents structure are:

Filename Format

If the given tags is not available, it will replaced with empty string.

Settings

“Blacklisted tags” => Tags to be blacklisted in the Main Tab/Batch Job. It will shown with grey background in Main Tab. It will be skipped in Batch Job. Separate each tag with new line. “Ignored Tags” => Tags to be ignored in the filename. Separate each tag with new line. “Use Regex” => Enable regular expression for filter Blacklisted/Ignored tags.

“Use Tags Auto Complete #” [200] => Enable Autocomplete in Tag searchbox in Main tab. Up to 200 tags will be retrieved. This is based on your tags.xml. “Empty Tag Repl.” [____] => For filename formatting, for example you use %artist% meta for filename format but the image doesn't have this information, then it will replaced based on this value.

file:included_tags.txt => If this file exists in the application folder, the tags defined in the file will be prioritized for filename. Separate each tags with new line. Regular expression is supported. Please note that it still depends on the filename format for ordering.

How to Use

A. Getting tags.xml:

  1. Download tags.xml from Settings tab => Click update tags.xml
  2. Select the provider from the URL combo box then press download, I recommend to use yande.re.
  3. Wait untik the download complete.

B. To search:

  1. Go to main tab, select one of the provider.
  2. Key in the search term like you do in the website on the Tag text box, the other text boxes are just a shortcut for specific search term (e.g. rating, order, etc). Check the Search Help for syntax.
  3. Make sure to tick Load Preview in the Danbooru Listing group.
  4. Click the Get button and wait until it finished download the list.
  5. Click the '<' or '>' button to move between page.

C. To download individual image

  1. Load the image list following the steps from section B.
  2. Select the images by ticking the checkbox.
  3. Click the Add button, it will show the Download List tab.
  4. Set the Save Folder by pressing the browse button.
  5. Click the Download button to start.
  6. You can also add image by right clicking and select Add Selected Rows.

D. To do Batch Download

  1. Go to Full Batch Mode.
  2. Click Add Batch Job.
  3. Key in the tag query, this follow the same rule like in the main tab.
  4. Select the provider.
  5. Press OK, the job will be added to the list.
  6. Press Start Batch job to start the download.

FAQ

Q1: I cannot download from Danbooru (403 Forbidden)! A1: Please read http://danbooru.donmai.us/forum/show/72300. You need to supply login information in the DanbooruProvider.xml and set UseAuth to true.

Q2: I cannot download/can only download 1 image from 3DBooru! A2: On Settings tab, check Pad User Agent.

Q3: I cannot use space in batch download, the program always converting it to underscores! A3: Use '+' for space.

Q4: I got 503 error from Danbooru! A4: See A1. If still have the error, see this: http://danbooru.donmai.us/forum/show/24011.

Q5: I got 'ERROR_MESSAGE_HERE'! A5: Sent me a message in the comment with the details, such as:

Q6: I got a lot of skipped files when do batch download! A6: It is caused of the target filename is already exists. Add %md5% in your filename format.

Q7: How to login to Gelbooru/Sankaku/get cookie value? A7: Follow this step:

  1. Press F12 on your Chrome browser and select Network tab.
  2. Go to the booru site and login.
  3. Click one of the entry and copy the Cookie value from the Request Header. For gelbooru, it should like this: user_id=; pass_hash= For sankaku, paste the whole cookie string. For shimmie based board, shm_user=<username; shm_session=
  4. Paste the Cookie value to the Username field.
  5. Set Login Type to Cookie. Refer to http://i.imgur.com/rCCjnPs.png
  6. Ensure the User-Agent from the browser also matching with User-Agent in the Settings tab.

Q8: Downloading tags.xml from Sankaku is too slow, what I can do? A8: Sankaku doesn't allow to download the tags json/xml directly, so the application need to parse each individual tag pages, which over 16k pages. To avoid this, the application can reparse the tags again so it can get the actual tag type from the post page itself. To enable it:

  1. Disable "Use Global Tags.xml" in the settings page.
  2. The actual tags type will be displayed after the post is added to the download list (together with image url resolution).
  3. For batch download, the tags will be reparsed just before the actual download. The disadvantage of this feature:
  4. Tags autocomplete might not working or show incorrect value, as it depends on local tags.xml.
  5. Wrong tags type will be displayed before the image url is resolved, as it depends on local tags.xml.

Q8: Sankaku only download maximum 500 images/20 pages? Why the application doesn't download all images? etc. A8: You need to supply the login information, see Q7.

Supported Board

Currently only supporting Danbooru-type, Gelbooru-type with Danbooru API, and Shimmie2 with RSS enabled. For Sankaku-related board, using HTML parser.

License Agreement

Copyright (c) 2012, Nandaka All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.