I like websites that feel archival.

Websites where things are tagged carefully, sourced properly, and still searchable years later.

That is one of the reasons I prefer sites like Konachan and Danbooru over most modern wallpaper platforms.

Eventually I ended up writing three small scripts to download wallpapers from them while preserving enough information to recover the original post later on. This post will showcase one of them, but it’s not why I am writing this post.


Why Filenames Matter

A filename looks small. Almost invisible. It is the sort of thing people do not think about until they are searching through a folder full of badly named files and realizing how much pain could have been avoided with five extra seconds of effort.

Most people treat filenames like disposable labels. Something temporary. Something that only has to work right now. But the truth is that a filename is often the first piece of context a file will ever have, and sometimes the only one that survives. An image might be moved, copied, compressed, or separated from whatever page it came from. The original post may vanish. The artist may change accounts or delete their work. Tags may disappear. And after a few years all you are left with is a folder full of files named things like wallpaper_final_v2.jpg.

That kind of naming tells you nothing. It does not tell you what the image is, where it came from, who made it, or why you saved it in the first place. It is a name built for the moment of download, not for the life of the file. And files tend to live much longer than the moment they were downloaded in.

I think that is why filenames far matter more than people admit. A good filename preserves a little bit of memory. It gives the file a place in a larger system instead of letting it float around as a random object. It can carry source information, an ID, a creator name, or some hint that helps you recover the original context later. Even if the rest of the internet changes, that one file still knows something about where it came from.

This matters especially with images, because images are easy to detach from their origin. Once you save them locally, they stop being tied to the page, the tags, the comments, or the artist’s profile. They become just another picture in a folder. That can be convenient, but it also means you slowly lose the reasons you cared about the image in the first place. The picture remains, but the context around it decays.

Filenames with images are not just about organization. They are about continuity. They are about keeping a thread between the present and the future. They are about respecting the fact that even something as ordinary as an image can still carry history with it, if you let it.

A file with a good name is easier to trust. It is easier to search. It is easier to revisit. And maybe that is the whole point.

Not every file needs to be permanent, but the ones we care about should at least have a name that remembers something.


Why Danbooru and Konachan Specifically?

I did not choose Danbooru and Konachan just because they have anime-style wallpapers. That is part of it, of course, but the real reason is that they are built around information rather than just appearance. A lot of image sites let you look at pictures. These sites let you actually work with them.

That difference matters more than it sounds like it should.

When a site is metadata-driven, every image carries more than just the image itself. It carries tags, source information, upload history, and usually enough structure that you can search with some actual intention instead of just hoping the right picture appears in front of you. That is the kind of design I like. It feels less like browsing a pile of content and more like navigating a catalog.

I also like that there is just so much to dig through. A bigger tag system and a larger post archive make the search process feel richer. You are not just looking for “something that looks cool.” You can look for specific poses, styles, characters, moods, backgrounds, artists, eras, and combinations of all of them. That makes the whole experience feel more precise and more rewarding. If you are looking for an older image, or something less common, that extra structure is not a bonus. It is the difference between finding what you want and never finding it again.

Better source tracking is another big reason. Sometimes I want to know where it came from, who made it, whether there are similar images, or whether I should save the source for later. Once an image is detached from its context, you lose a lot of that. Booru based sites like Danbooru and Konachan make it much easier to keep that context intact. Even if I only download the file, I still want the file to remember enough about where it came from.

There is also something about the way these sites are organized that feels more consistent. They do not try too hard to become a lifestyle platform or a consumption machine. They are there to store, tag, and let you search. That simplicity is useful. It gives you a clearer relationship with the content. You are not being pushed through endless scrolling or algorithmic suggestion loops. You are just searching through a well-organized archive.

That is probably the simplest way to put it: I use Danbooru and Konachan because they are better for finding things, remembering things, and understanding what I found. They are not places to consume images. They are places where images still have context.


Modern Wallpaper Sites: Consumption Vs Exploration

A lot of modern wallpaper sites do not really feel like archives anymore. They feel like machines built to keep you looking. This is not an accident. In fact, the entire structure of the site is designed around retention, not discovery. The goal is no longer simply to help you find a wallpaper. The goal is to keep you moving through wallpapers for as long as possible, and to do that, these sites borrow a surprising number of techniques from social media, streaming platforms, and modern recommendation engines.

The first and most obvious one is infinite scroll. This is so common now that people barely question it anymore. There is no natural stopping point, no sense of “I have looked at enough.” The page just keeps going. You are not browsing a collection so much as falling through it. That alone changes the experience. A finite page invites search. Infinite scroll invites drift. It removes friction, which sounds convenient, but friction is often what gives a user time to think about what they are actually looking for.

Then there are personalized recommendation feeds, which are even more aggressive. The site watches what you clicked on, what you looked at longer, what you downloaded, what you favorited, what colors you seem to prefer, what device you are using, and what kind of style fits your profile, it stops being a wallpaper site in the older sense. It becomes a behavioral system. It learns your tastes and starts feeding them back to you. Maybe that sounds helpful, and sometimes it is. But it also means the site is no longer helping you explore. It is helping you stay inside the shape of your existing preferences. That is a very different thing.

A related trick is the endless chain of “similar wallpapers,” “more like this,” “from the same artist,” “matching color palette,” and “complete this aesthetic pack” prompts that appear after every click. These are not neutral features. They are pathing devices. Each one gives you a reason not to stop. Each one says: you have not reached the end, there is something adjacent, something adjacent to the adjacent thing, something that completes the set. This turns browsing into a kind of soft chase. You never really arrive; you just continue.

Some sites go further and use algorithmic discovery or surprise injection. They may intentionally slip in a trending wallpaper, a niche aesthetic, a hidden gem, or something slightly outside your usual taste to keep the feed from feeling too predictable. Again, this is presented as variety, but it also works as manipulation of attention. It keeps the session alive by interrupting your expectations at just the right time. You came looking for one kind of image, and now the site is nudging you into an adjacent mood, then another, then another. It is not hard to see the engineering logic behind it: novelty keeps people moving.

One-tap instant preview fits the same pattern. It makes the act of looking weightless. There is little commitment involved in opening an image, flipping through another, then another. The smaller the effort required, the less likely you are to pause and ask whether you actually want to keep going. That is not inherently bad, but it changes the tone of the interaction. Instead of deliberate search, you get rapid consumption. Instead of choosing, you get sampling.

Daily drops and refresh cycles reinforce the same behavior over time. “Wallpaper of the day,” “daily trending packs,” seasonal themes, limited creator features, countdown refreshes — these are all retention loops. They create the sense that there is always something new just about to appear, and if you leave now, you will miss it. This is a familiar pattern across the modern internet, but it feels especially odd on wallpaper sites, because wallpaper is not supposed to be urgent. It is supposed to be something you choose, set, and live with. Turning it into a daily content stream changes the emotional relationship entirely.

Then there are the mood and identity categories. “Dark Academia,” “Lonely Rain,” “Clean Desk Energy,” “Late Night Coding,” “Sigma Aesthetic,” “Minimal Dopamine.” These names are clever because they do not describe images. They describe identities. They say: this wallpaper is not just a visual object; it is a personality you can browse into. That is powerful engineering. It gives users a way to feel seen, but it also turns taste into a menu of consumable selves. You are no longer just choosing an image. You are choosing a vibe, a mood, a version of yourself.

Micro-interactions, social validation signals, trending indicators, download counts, favorite milestones, creator followers, comments, remix counts, streaks, badges, and rankings all serve the same underlying purpose: they transform the act of browsing into a game with visible progress. A wallpaper site should not need leaderboards to function. But once they exist, users begin to respond to them. They feel the pull of what others have liked, what is popular, what is being rewarded, what is being watched. Even a simple “10K downloads” label changes the way people interpret an image. It gives the image social momentum, and social momentum is persuasive.

Auto-continue browsing is even more revealing because it preloads content you didn’t ask for. That detail is easy to miss, but it matters. The site is literally predicting your next move and preparing it before you have consciously made it. That is a very specific kind of design philosophy: the user should never hit a blank moment where nothing is ready. The feed must always be waiting, always one step ahead, always making sure the next wallpaper is there before you decide whether you wanted it or not.

Collections and hoarding psychology also play a major role. Many users save wallpapers the same way other people save tabs, bookmarks, screenshots, or playlist tracks they never fully return to. The site supports this behavior by encouraging mood boards, saved folders, future wallpaper piles, and aesthetic collections. At some point the wallpaper stops being something you use and starts becoming something you collect. That can be fun, but it also creates a sort of digital hoarding habit. Pinterest thrives partly because of this exact pattern: the idea that you are not just browsing, you are building a self through accumulation.

AMOLED optimization, device-specific categories, trending feeds, “most downloaded this week,” “trending in X,” “editor’s picks,” creator ecosystems, infinite zoom, cinematic presentation, ambient audio, FOMO labels like “leaving soon,” and AI-generated variations all extend the same logic in different directions. The more a site can personalize, dramatize, rank, generate, and surface, the less it feels like a neutral library and the more it feels like a retention engine with wallpapers attached.

And that is what you should worry about. Not of wallpapers themselves, but of the engineering behind these sites. Because once you step back, you start noticing that the real product isn’t the wallpaper at all. The real product is attention, habit, identity, and repeat engagement. The wallpaper is just the wrapper.

That is why I prefer sites that feel more like archives than feeds. I just want to look for something, find it, save it, and leave. I do not want a site that keeps trying to convert me into a permanent viewer. I want exploration, not consumption. I want to search, not endless suggestion. I want a place where images feel like objects with context, not just content optimized for the next click.


“But Don’t These Sites Also Host NSFW Content?”

Yes, they do.

Both Danbooru and Konachan host NSFW content alongside everything else. That is true, and it would be strange to pretend otherwise. But the script itself is content-agnostic. It does not care whether a URL points to a landscape wallpaper, an anime character, or a picture of your waifu taking a bath. It simply takes a URL, extracts the post information, and names the file in a way that preserves connection to the original source.

If you pass NSFW URLs, it downloads them. If you do not, it does not.

The same applies to the tag-based scripts I wrote later on. By default they only download safe-rated posts unless you explicitly tell them otherwise. I made that choice intentionally because I wanted the default behavior to stay focused on general wallpaper collection rather than unrestricted scraping; and I don’t like NSFW wallpapers on my machine. And:

Tools and systems should not be judged only by their most controversial content.

A protocol is not defined solely by the worst thing transmitted through it. A website is not reducible to the most questionable part of its userbase. A tool is not automatically corrupted because it can be used in ways some people dislike. If that were the standard, most general-purpose technologies would immediately become impossible to discuss honestly.

What is interesting is how a system is structured, what kind of behavior it encourages, and whether it gives users meaningful control over what they are doing.

One of the reasons I prefer sites like Booru based sites is precisely because they are structured around metadata, searchability, tagging, and discoverability rather than pure engagement optimization. They are more archival than addictive. The existence of NSFW content does not erase the qualities that make those systems technically and organizationally interesting.

Modern discussions around platforms often collapse into moral simplification. People stop talking about architecture, incentives, design, or utility, and instead reduce everything to whether some controversial content exists somewhere inside the system. That approach usually produces more heat than understanding.

In case of both Konachan and Danbooru, both have SFW sites as well, them being konachan.net and Safebooru . And they are what I use to find wallpapers instead the explicit versions.

It is far more useful to ask different questions instead.

  • What does the platform optimize for?
  • Does it preserve context?
  • Does it allow precise search?
  • Can information still be recovered years later?
  • Does it encourage intentional exploration or passive consumption?

Those questions tell far more about a system than whether it contains material some people would rather avoid.

And in the case of these scripts, the answer is fairly simple: they were built because I wanted a better way to organize wallpapers while preserving enough metadata to reconnect them to their original source later on. Nothing more than that.


Why Make Your Own Script?

Part of the reason is simple: I really like collecting wallpapers.

Some of them are from 20-25 years ago. Some were uploaded yesterday. It does not really matter to me how old an image is as long as I genuinely like it. Over time I ended up with a collection large enough that organization stopped being optional. At any given moment I probably have somewhere between 2000 to 3000 wallpapers sitting on my computer; Yeah…

Once you reach that point, you start noticing that most image collections slowly decay into chaos.

Folders become harder to search through. Images lose their original names. Sources disappear. You forget where something came from or why you saved it in the first place. Sometimes you find an image you still like years later but can no longer trace it back to the artist, the tags, or even the site it originally came from.

I looked at other downloaders first, but most of them did not really fit the way I wanted to organize things. Some tried to do far too much. They are giant automation tools with dozens of options, databases, GUI layers, account systems, sync logic, metadata managers, and every feature imaginable except the one thing I actually cared about. Others were too minimal in the opposite direction and simply downloaded files without preserving enough information to reconnect them to the original post later on.

I wanted something much narrower and much more predictable.

I just wanted a small tool that solved one specific problem properly: download an image from a supported URL and preserve enough information in the filename that I could recover the original post later if I needed to.

It does not need to become a media manager, an archive platform, or a wallpaper ecosystem. It takes URLs, extracts post information, and names files consistently. That is all it needs to do.

When you build something for yourself, you can shape it around your exact habits instead of adapting your habits around somebody else’s assumptions.


Why Support Both Sites?

At first glance, supporting both Konachan and Danbooru seems a little redundant.

Anything on Konachan can almost certainly also be found on Danbooru. Danbooru has a much larger archive, a richer tagging ecosystem, a bigger userbase, more metadata, and a longer history. It is older, more established, and arguably the first major Booru-style site that is still active today. If the goal were simply maximum coverage, Danbooru alone would probably be enough.

But the two sites do not actually feel the same to use.

Danbooru feels like an enormous archival system. It is dense, information-heavy, and extremely precise. The tagging system alone is powerful enough that searching sometimes feels less like browsing images and more like querying a database. That depth is one of the reasons I like it so much. It encourages exploration through metadata instead of recommendation feeds or algorithmic discovery.

Konachan, on the other hand, feels more curated.

In their own words:

Konachan concentrates on image suited for use and viewing as computer desktop background image. […] Quality is also a more significant attribute here. As desktop wallpaper, I’m pretty sure you don’t want to be staring at images that are so bad they’ll give you eye cancer.

That difference becomes noticeable very quickly once you spend enough time on both sites.

Danbooru is broader. Konachan is narrower but more selective. The overall average quality of wallpapers on Konachan tends to feel more consistent because the site is optimized specifically around wallpapers rather than acting as a giant general-purpose image archive. In practice this means you often spend less time filtering through things that technically match your tags but do not really work well as wallpapers.

So the obvious question becomes: if Konachan is more curated, why not just use Konachan exclusively?

Part of the answer is already hidden inside the question itself.

Konachan’s strength comes from its narrower focus. Danbooru’s strength comes from its scale, history, and depth. They solve slightly different problems.

Sometimes I want the enormous searchable archive with years of tagging history behind it. Sometimes I want the more focused wallpaper-oriented experience where a lot of the filtering has already been done implicitly through curation. Supporting both sites lets me keep both of those strengths instead of forcing myself to choose between them.

There is also a historical reason I find Danbooru interesting beyond just the wallpapers themselves. It represents a style of internet architecture that feels increasingly rare now: heavily metadata-driven, community-organized, searchable, and archival in nature. A lot of modern platforms prioritize engagement first and organization second. Danbooru feels like the opposite. Even after all these years, it still functions more like a structured archive than an infinite content feed.

That design philosophy is part of why I wanted to support both sites in the first place. Not because I needed another endless source of wallpapers, but because I genuinely appreciate systems that still value structure, tagging, discoverability, and long-term recoverability.


This section is already very strong conceptually because it reveals the core idea behind the whole system:

The filename is not just a name, it is a compressed reference to an entire archive entry


How Do I Store Enough Information in Just the Filename?

The answer is surprisingly simple.

248025k.jpg
7066525d.png

That is genuinely all I need.

Two pieces of information are enough to recover everything else later on:

  1. The post ID
  2. Which site the image came from

That is it. Nothing more.

  • The k stands for Konachan.
  • The d stands for Danbooru.

Once you know those two things, you can reconstruct the rest through the site’s API.

Take this image for example:

248025k.jpg

The filename already tells me:

  • It came from Konachan
  • The post ID is 248025

Which means I can do this:

curl "https://konachan.net/post.json?tags=id:248025" | jq

(jq just makes the JSON readable.)

Which gets me this beauty:

[
  {
    "id": 248025,
    "tags": "book brown_hair drink headdress kogecha_(coge_ch) long_hair original paper smoking water",
    "created_at": 1502548025,
    "creator_id": 156425,
    "author": "RyuZU",
    "change": 1384168,
    "source": "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=64337772",
    "score": 126,
    "md5": "76e92a618fed3be2bf939d4b845487dd",
    "file_size": 713469,
    "file_url": "https://konachan.net/image/76e92a618fed3be2bf939d4b845487dd/Konachan.com%20-%20248025%20book%20brown_hair%20drink%20headdress%20kogecha_%28coge_ch%29%20long_hair%20original%20paper%20smoking%20water.jpg",
    "is_shown_in_index": true,
    "preview_url": "https://konachan.net/data/preview/76/e9/76e92a618fed3be2bf939d4b845487dd.jpg",
    "preview_width": 150,
    "preview_height": 92,
    "actual_preview_width": 300,
    "actual_preview_height": 184,
    "sample_url": "https://konachan.net/sample/76e92a618fed3be2bf939d4b845487dd/Konachan.com%20-%20248025%20sample.jpg",
    "sample_width": 1500,
    "sample_height": 918,
    "sample_file_size": 1011690,
    "jpeg_url": "https://konachan.net/image/76e92a618fed3be2bf939d4b845487dd/Konachan.com%20-%20248025%20book%20brown_hair%20drink%20headdress%20kogecha_%28coge_ch%29%20long_hair%20original%20paper%20smoking%20water.jpg",
    "jpeg_width": 2048,
    "jpeg_height": 1253,
    "jpeg_file_size": 0,
    "rating": "s",
    "has_children": false,
    "parent_id": null,
    "status": "active",
    "width": 2048,
    "height": 1253,
    "is_held": false,
    "frames_pending_string": "",
    "frames_pending": [],
    "frames_string": "",
    "frames": []
  }
]

And suddenly the file is no longer just a random image sitting in a folder. Now I have:

  • Tags
  • Artist/source information
  • Rating
  • Upload date
  • Dimensions
  • Hashes
  • Original URLs
  • Preview/sample variants
  • And much more

All reconstructed from a tiny filename.

The same idea works for Danbooru:

curl "https://danbooru.donmai.us/posts/7066525.json" | jq

Which gives us even more metadata:

{
  "id": 7066525,
  "created_at": "2024-01-07T01:18:20.113-05:00",
  "uploader_id": 251464,
  "score": 10,
  "source": "https://chamuwang.lofter.com/post/1d284525_2bad0643f",
  "md5": "24fbe049609da2a2e4f9327b163cfc20",
  "last_comment_bumped_at": null,
  "rating": "g",
  "image_width": 3508,
  "image_height": 2177,
  "tag_string": "2boys absurdres adam_(lord_of_the_mysteries) armor arrow_(projectile) bird black_armor blood blood_splatter chamuwang chinese_commentary circle_of_inevitability closed_eyes cloud commentary_request dove fire flower highres holding holding_sword holding_weapon long_hair lord_of_the_mysteries medici_(lord_of_the_mysteries) multiple_boys on_one_knee outdoors pillar plant red_hair red_sky robe ruins shadow sky sword vines weapon",
  "fav_count": 10,
  "file_ext": "png",
  "last_noted_at": null,
  "parent_id": null,
  "has_children": false,
  "approver_id": null,
  "tag_count_general": 30,
  "tag_count_artist": 1,
  "tag_count_character": 2,
  "tag_count_copyright": 2,
  "file_size": 10991234,
  "up_score": 10,
  "down_score": 0,
  "is_pending": false,
  "is_flagged": false,
  "is_deleted": false,
  "tag_count": 39,
  "updated_at": "2024-01-16T08:18:50.451-05:00",
  "is_banned": false,
  "pixiv_id": null,
  "last_commented_at": null,
  "has_active_children": false,
  "bit_flags": 0,
  "tag_count_meta": 4,
  "has_large": true,
  "has_visible_children": false,
  "media_asset": {
    "id": 18243982,
    "created_at": "2024-01-06T08:29:57.264-05:00",
    "updated_at": "2024-01-06T08:30:03.486-05:00",
    "md5": "24fbe049609da2a2e4f9327b163cfc20",
    "file_ext": "png",
    "file_size": 10991234,
    "image_width": 3508,
    "image_height": 2177,
    "duration": null,
    "status": "active",
    "file_key": "7c5hryIEv",
    "is_public": true,
    "pixel_hash": "e7ac20afa77d4dd9c01618d4fca69c47",
    "variants": [
      {
        "type": "180x180",
        "url": "https://cdn.donmai.us/180x180/24/fb/24fbe049609da2a2e4f9327b163cfc20.jpg",
        "width": 180,
        "height": 112,
        "file_ext": "jpg"
      },
      {
        "type": "360x360",
        "url": "https://cdn.donmai.us/360x360/24/fb/24fbe049609da2a2e4f9327b163cfc20.jpg",
        "width": 360,
        "height": 223,
        "file_ext": "jpg"
      },
      {
        "type": "720x720",
        "url": "https://cdn.donmai.us/720x720/24/fb/24fbe049609da2a2e4f9327b163cfc20.webp",
        "width": 720,
        "height": 447,
        "file_ext": "webp"
      },
      {
        "type": "sample",
        "url": "https://cdn.donmai.us/sample/24/fb/sample-24fbe049609da2a2e4f9327b163cfc20.jpg",
        "width": 850,
        "height": 527,
        "file_ext": "jpg"
      },
      {
        "type": "original",
        "url": "https://cdn.donmai.us/original/24/fb/24fbe049609da2a2e4f9327b163cfc20.png",
        "width": 3508,
        "height": 2177,
        "file_ext": "png"
      }
    ]
  },
  "tag_string_general": "2boys armor arrow_(projectile) bird black_armor blood blood_splatter closed_eyes cloud dove fire flower holding holding_sword holding_weapon long_hair multiple_boys on_one_knee outdoors pillar plant red_hair red_sky robe ruins shadow sky sword vines weapon",
  "tag_string_character": "adam_(lord_of_the_mysteries) medici_(lord_of_the_mysteries)",
  "tag_string_copyright": "circle_of_inevitability lord_of_the_mysteries",
  "tag_string_artist": "chamuwang",
  "tag_string_meta": "absurdres chinese_commentary commentary_request highres",
  "file_url": "https://cdn.donmai.us/original/24/fb/24fbe049609da2a2e4f9327b163cfc20.png",
  "large_file_url": "https://cdn.donmai.us/sample/24/fb/sample-24fbe049609da2a2e4f9327b163cfc20.jpg",
  "preview_file_url": "https://cdn.donmai.us/180x180/24/fb/24fbe049609da2a2e4f9327b163cfc20.jpg"
}

Again, the filename alone is enough to reconnect the image back to its original metadata.

The image itself may get moved across folders, copied to different drives, uploaded somewhere else, converted to a different format, or detached from the original site entirely, but the filename still preserves enough information to reconnect it back to its source later on.

In other words, the metadata is not truly lost. It is compressed into something much smaller.

These websites expose enough structure that simple tools like this become possible. The sites are not just giant image dumps. They are searchable systems with stable identifiers, APIs, tags, and recoverable relationships between files and information.

I could also have saved images using huge filenames full of tags and artist names, but those become messy very quickly, and I tell this by experience. They are harder to script around, harder to rename consistently, and often break once tags change over time.

  • An ID is stable.
  • A source identifier is stable.

And together they are more than enough.

This entire script is built around the idea that a file should still remember where it came from years later, even if everything around it changes.


One of the Ways I Actually Used This

Once every image could be traced back to its original metadata, the wallpapers stop being just files sitting in a folder. They effectively became a searchable local archive.

So inside my wallpapers directory I kept a small .json file that mapped tags to posts I had downloaded.

Something roughly like this:


{
  "cat": [
    "248025k.jpg",
    "7066525d.png"
  ]
}

Of course the real file was much, much larger than that, but the idea stayed simple:

Use the tags from the APIs to build a lightweight local index of my wallpapers.

That made searching far easier than manually scrolling through folders.

But the fun part came later.

I used pywal to generate colorschemes automatically from wallpapers.

Because the wallpapers still preserved their metadata, I could search through them semantically instead of visually.

I was no longer required to think:

“I remember there was a blue wallpaper somewhere…”

Instead, I could search things like:

cat
christmas hand_in_pocket
rain night city

And immediately get matching wallpapers based on tags.

If I wanted to get Christmas-themed wallpapers where characters had their hands in their pockets for some oddly specific reason, I could actually search for that combination directly. And because the metadata came from Danbooru/Konachan’s tagging systems, and the searches stayed surprisingly precise even with very large collections.

I used rofi for previews, so everything felt instant. No giant gallery applications, no indexing databases running in the background, no Electron apps eating memory just to display images. Just a few small tools connected together properly.

Once the information exists, small tools suddenly become extremely powerful. You do not need machine learning, cloud syncing, recommendation engines, or giant media managers to organize things intelligently. A stable ID and a good tagging system already solve the hard part.

And honestly, this is only one small use case.

You could build far more elaborate systems on top of this idea than I ever did. Automatic wallpaper rotations based on mood tags, local recommendation systems, similarity grouping, statistics, archival tools, artist tracking, duplicate detection, offline browsing systems — the possibilities expand very quickly once the metadata becomes recoverable and searchable locally.


The Script

You can download the entire script here: get.sh


How It Works?

The text diagram given below shows the basic workflow of the script:

URLs in
  ↓
For each URL
  ↓
Detect site
  ├─ Konachan → extract post ID → rename to IDk.ext → download
  ├─ Danbooru  → extract MD5 → API lookup ID → rename to IDd.ext → download
  └─ Other     → download normally
  ↓
Done

The script starts by making sure the user actually passed URLs:

if [ "$#" -eq 0 ]; then
    echo "Usage: get <url1> [url2 ...]"
    exit 1
fi

After that, it checks each URL and handles it based on which site it came from.

For Konachan, it extracts the post ID from the image URL:

get_konachan_post_id() {
    local url="$1"
    if [[ "$url" =~ %20-%20([0-9]+)%20 ]]; then
        printf '%s\n' "${BASH_REMATCH[1]}"
        return 0
    fi
    return 1
}

For Danbooru, it uses the image’s MD5 hash to look up the post ID through the API:

get_danbooru_post_id() {
    local md5="$1"
    local id
    id="$(wget -qO- "https://danbooru.donmai.us/posts.json?tags=md5:${md5}&limit=1" \
        | jq -r '.[0].id // empty')" || return 1

    [ -n "$id" ] && printf '%s\n' "$id"
}

That is the key part of the whole script: the filename is not just a name, it is a compact pointer back to the original post.


Why It Uses a Temporary File?

When the script downloads a file, it first writes to a temporary location and only moves it into place after the download succeeds:

download_to_file() {
    local url="$1"
    local outfile="$2"
    local tmpfile

    tmpfile="$(mktemp)" || return 1
    if wget -q -O "$tmpfile" "$url"; then
        mv -f "$tmpfile" "$outfile"
    else
        rm -f "$tmpfile"
        return 1
    fi
}

That avoids leaving half-downloaded files behind if something fails.


How the Filename Is Chosen

For Konachan:

final_file="${post_id}k.${ext}"

For Danbooru:

final_file="${post_id}d.${ext}"

The suffix (k or d) tells which site the file came from, while the number in front tells me which post it was.


What Makes the Script Fast?

It also runs multiple downloads in parallel, but keeps the number of active jobs under control:

max_jobs=$(( $# < 5 ? $# : 5 ))

So even if I pass a lot of URLs, it will not launch everything at once.


Fallback Behavior

If a URL is not from Konachan or Danbooru, the script still downloads it normally:

else
    printf "Downloading: %s ... " "$url"
    if wget -q "$url"; then
        echo "[OK]"
    else
        echo "[FAILED]"
    fi
fi

So the script is still usable outside those two sites.


I do not think every file needs to remember everything, but the ones I care about should remember enough. This script is my way of making sure wallpapers stay connected to their source, their tags, and their history instead of becoming anonymous files in a folder. It is a small tool, but it reflects a larger preference of mine: keeping context alive for as long as possible.