Darayavaush / decensooru

[RIP] Decensoring addon for Better Better Booru, the non-stolen version.
31 stars 2 forks source link

Some images not loading #8

Closed ghost closed 6 years ago

ghost commented 6 years ago

Some images do not load despite their link linking to an image "that danbooru returns file doesn't exist" and their previews working example https://danbooru.donmai.us/posts/1095981?tags=parent:1095965 https://danbooru.donmai.us/posts/2354617 https://danbooru.donmai.us/posts/2354511 https://danbooru.donmai.us/posts/2354173 how it looks: https://i.imgur.com/reZpg2K.png

Darayavaush commented 6 years ago

sigh

Well, I can give a short version or a long one. The short one: I added one slash in the code injection section, so go through that and it'll be fixed.

The long version: there's some fuckup that's been going on on Danbooru's side from around the start of this year, when they were migrating servers or such, namely that they fucked up their routing table or whatever. The gist is that some hidden images return a 404 when accessed on their proper URL https://danbooru.donmai.us/data/MD5.format . Up to now I thought that the admins just fucked up and didn't migrate them, but just now I dug around and figured out that for some idiotic fucking reason all files can be accessed on both https://danbooru.donmai.us/data//MD5.format and https://danbooru.donmai.us//data/MD5.format (note the extra slashes). No idea what's going on here, but whatever, fix pushed.

ghost commented 6 years ago

First of all, sorry for bothering you and thank you. and they either did this to stop stuff like your scripts (which doesn't make sense since it can be easily fixed) or they're just a punch or idiots. and older images still dont work so maybe they did something more idiotic than just slashes to that.. and i went really back to the image and found alot of them dont use "data" in the link like https://raikou2.donmai.us/2f/e2/__ibaraki_kasen_touhou_drawn_by_momoko_momopoco__2fe27564a3ed6f51b3425fde62c8ef87.png https://raikou2.donmai.us/60/05/__catchouli_and_patchouli_knowledge_touhou_drawn_by_hazuki_ruu__600540db4a055d699ea838e2164ec876.jpg they dont even use the danbooru link. some image work with the slash before the data (//data/md5.jpg) some work with the normal link (/data/md5.jpg) some work with both slashes (//data//md5.jpg) and some just dont work at all. this just turned into a mess .

Darayavaush commented 6 years ago

It's definitely either stupidity or some ultra-hack to fix an unknown problem, since it affects only a tiny subset of hidden images and fucks up all image URLs.

What do you mean by "older images don't work"? The two you posted (first, second) work just fine.

ghost commented 6 years ago

i mean older loli tagged images seem to have a higher chance of just not loading. i guess i can make a small script that adds a button and changes the URL as a temp fix

Darayavaush commented 6 years ago

Do you have an example of an image not loading?

ghost commented 6 years ago

https://danbooru.donmai.us/posts/1874961?tags=loli https://danbooru.donmai.us/posts/1876402?tags=loli

and i noticed with my friend some images loads for him but not me and some images load for me but not him for some reason, tho that may have to do with the fact that he didnt update better better booru, and how that he did they work for him. also this image https://danbooru.donmai.us/data/033d2ff02cec8e60dea65e60487367cc.jpg work on "/data/" for me and "//data//" for him.

Darayavaush commented 6 years ago

siiiigh

Added a line to Decensooru proper that checks for broken images and tries to deal with it. The whole thing is a hack, because properly someone should edit BBB instead, but I'm so not doing that.

As for the last one, it works for me both with "/data/" and with "//data//", so I have no idea what you're talking about.

ghost commented 6 years ago

i wasn't really asking fora fix for that one as i said i made a small shitty script to change the link,i was just telling you extra info incase you want it. with that being said that fixed most images and again, really sorry for giving you a headace. you dont have to but you can stop the loop after like 20 retries max

Darayavaush commented 6 years ago

Nah, you didn't give me a headache. Thanks for bringing this crap to my attention, in fact - I've never even heard about Raikou before yesterday.

ghost commented 6 years ago

btw there's also https://hijiribe.donmai.us example https://hijiribe.donmai.us/data/__admiral_and_prinz_eugen_kantai_collection_drawn_by_hangaku__6fd2e99330b348768ff1ba2a5d51e84a.gif and ofc some images only work on that cuz fucking danbooru btw the link i gave is just saying that hijiribe exists and it actually works when you change it to danbooru but other images that are the "censord" ones dont that the script aims to "uncensor" now i think about it these problems only appear in these images and any other images work normally

setTimeout(function(){
        $("#image").on("error", function(){
            var src = $("#image").attr("src");
            var HFail = false;
            if (HFail = false){
            HFail = true;
            var srcc = document.getElementById("image").src.replace('danbooru','hijiribe');
            document.getElementById("image").src = srcc;
            }
            else if (HFail = true){
            src = src.split('/');
            src = src[src.length-1];
            $("#image").attr("src", "https://raikou2.donmai.us/" + src[0] + src[1] + "/" + src[2] + src[3] + "/" + src);
            HFail = false;
            }

        });
     }, 10);

i managed to fix it by changing the function but i used normal JS since idk how to use jquery.