Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Augwiki
Search
Search
Appearance
Create account
Log in
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Editing
Booru Bulk Downloader (Userscript)
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
'''Booru Bulk Downloader''' is a browser userscript written by [[August Casso]] that puts download controls directly onto booru gallery pages, so full-resolution originals can be pulled in bulk without ever opening a post page. This is the one piece of software in the archive written for a general audience rather than for August's own work: it exists because scraping a gallery one post at a time is a waste of an evening. == The Script == * '''Version:''' 1.0.1 * '''License:''' MIT * '''Size:''' ~44 KB / 1,122 lines * '''Runs on:''' Tampermonkey, Greasemonkey, Violentmonkey === Install === * '''Greasy Fork:''' [https://greasyfork.org/en/scripts/599354-booru-bulk-downloader greasyfork.org/en/scripts/599354-booru-bulk-downloader] * '''GitHub (canonical source):''' [https://github.com/Reduxed/booru-bulk-downloader github.com/Reduxed/booru-bulk-downloader] * '''OpenUserJS:''' [https://openuserjs.org/scripts/reductedharmgmail.com/Booru_Bulk_Downloader openuserjs.org/scripts/reductedharmgmail.com/Booru_Bulk_Downloader] == What It Does == A '''checkbox''' and a '''download arrow''' land on every thumbnail in a gallery. The checkbox adds an image to the batch β shift-click takes a range. The arrow grabs that one image's full-resolution original immediately. A draggable panel in the bottom-right corner holds the running count, '''Download selected''', '''Save as .zip''', Select all / Clear / Retry failed, and the filename options. '''Alt+D''' downloads the selection; '''Alt+A''' selects everything. == The Hard Part: Finding The Original == The thumbnail <code><img></code> is never the original, and every booru hides the original differently. The resolver works in three tiers, cheapest first, cached per post id: # '''DOM attribute''' β Danbooru puts <code>data-file-url</code> directly on the thumbnail. Zero extra requests. # '''Site JSON API''' β <code>?page=dapi&s=post&q=index&json=1&id=N</code> (Gelbooru family) or <code>post.json?tags=id:N</code> (Moebooru family), returning <code>file_url</code> plus tags. # '''Post page HTML''' β fetch the post page and read <code>og:image</code> and the tag links. Universal, and needs no API key. This is the tier that saves you when a site starts demanding credentials. Site support is a data array β host regex, item selector, id/link/original extractors, tag source, and API shape β so adding a booru is one object plus one <code>@match</code> line. Anything exposing a <code>data-file-url</code>-style attribute is handled by a built-in generic adapter. == Filenames Built From Tags == Template tokens: <code><nowiki>{{tags}}</nowiki></code> <code><nowiki>{{id}}</nowiki></code> <code><nowiki>{{rating}}</nowiki></code> <code><nowiki>{{site}}</nowiki></code> <code><nowiki>{{user}}</nowiki></code> <code><nowiki>{{md5}}</nowiki></code> <code><nowiki>{{ext}}</nowiki></code> β default <code><nowiki>{{tags}}</nowiki>__<nowiki>{{id}}</nowiki></code>. The extension comes from the real file URL, not the thumbnail. The sanitizer strips <code>\ / : * ? " < > |</code> and control characters, collapses whitespace, trims trailing dots, guards Windows reserved names (<code>CON</code>, <code>LPT1</code>), truncates on a tag boundary at roughly 170 characters, and suffixes <code>_2</code> on collisions inside a batch. == Download Engine == <code>GM_download</code> first, for a real download-manager entry with the exact filename requested; then <code>GM_xmlhttpRequest</code> β blob β object URL β <code><a download></code>. A bare <code><a download></code> is deliberately never used on its own, because the attribute is ignored cross-origin and would simply navigate the tab. Concurrency is a limited pool (default 3), with per-item success/error state and a retry action. == What Was Verified, And What Was Not == Markup and APIs were checked against live sites rather than assumed: * '''safebooru.org''' β <code>span.thumb > a > img.preview</code>, tags already present in <code>img[title]</code>; dapi JSON fields confirmed. * '''konachan.net''' β <code>ul#post-list-posts > li#p<id></code>, <code>post.json?tags=id:N</code> answered 200. This one exposed a real trap: the true original is <code>a.original-file-unchanged</code> β <code>/image/β¦</code>, while <code>a#highres</code> is only the converted <code>/jpeg/</code> "larger version" and <code>og:image</code> is the <code>/sample/</code>. The selector list prefers <code>/image/</code> accordingly. * '''Not verified live:''' Danbooru, Gelbooru.com and e621 β written from their published conventions, and they degrade to the HTML tier if the faster tiers miss. Building it also caught a junk <code>?</code> pseudo-tag from the tag-link scraper, an operator-precedence bug in the e621 id resolver, and a dead generic fallback. == Known Gotchas == * '''Chrome blocks the second automatic download''' unless ''Automatic downloads'' is allowed for the booru host in site settings. <code>GM_download</code> dodges most of this, not all of it. * '''Gelbooru.com and rule34.xxx now require an API key''' for the dapi. Paste your <code>api_key</code> and <code>user_id</code> into the script's options, or let it fall through to the slower, key-free HTML tier. == Publication == Published in October 2026 to three hosts, each independently verified rather than assumed: * '''Greasy Fork''' β listing live, served file matches the release apart from the two <code>@updateURL</code> / <code>@downloadURL</code> lines Greasy Fork injects. * '''GitHub''' β <code>Reduxed/booru-bulk-downloader</code>, public, the canonical source. * '''OpenUserJS''' β served source confirmed byte-identical to the release, 44,970 bytes and 1,122 lines. The OpenUserJS upload initially failed with <code>400 Selected file is not JavaScript.</code> despite the correct filename and byte count. The cause was the multipart part type: the attached File reported <code>text/plain</code> because the staged resource used the default MIME. Staging it with a JavaScript MIME made the File report <code>text/javascript</code> and the upload went straight through. The bytes were never the problem. == See Also == * [[All Billing LLC]] * [[August Casso]] [[Category:Augwiki]]
Summary:
Please note that all contributions to Augwiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Augwiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Booru Bulk Downloader (Userscript)
Add topic