Skip to content

Commit

Permalink
Fix #1234
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Nov 13, 2023
1 parent 598a4a5 commit bd113de
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
24 changes: 14 additions & 10 deletions src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ var $$IMU_EXPORT$$;
cache: false,
bigimage_recursive: true,
input: false,
check_image_get: true,
find_source: true
check_image_get: false,
find_source: false
};

console.log("Loaded");
Expand Down Expand Up @@ -66138,7 +66138,7 @@ var $$IMU_EXPORT$$;
var eb_info = {
regex: /^[a-z]+:\/\/[^/]+\/+pics\/+[^/]*-([0-9]+)\.html(?:[?#].*)?$/,
qfi: "https://" + domain + "/pics/-${id}.html",
image_regex: /<a class='pswp_open' href='(https?:\/\/[^/]+\/+(?:[^"']+\/+)?content\/[^'"]+\/full\/[^'"]+)'/,
image_regex: /<img class='img-thumbnail\s+img-responsive\s+sharpen' src='(https?:\/\/[^/]+\/+content\/[^']+)'/,
video_regex: /(<video id="fluidPlayer">[\s\S]+<\/video>)/
};

Expand Down Expand Up @@ -108915,6 +108915,13 @@ var $$IMU_EXPORT$$;
return src.replace(/(\/auction\/+)(?:small|view)(\/+auctions\/+)/, "$1big$2");
}

if (domain === "media.springernature.com") {
// thanks to anonymous for reporting:
// https://media.springernature.com/w300/springer-static/image/art%3A10.1038%2Fs41565-019-0561-4/MediaObjects/41565_2019_561_Figa_HTML.jpg?as=webp
// https://media.springernature.com/full/springer-static/image/art%3A10.1038%2Fs41565-019-0561-4/MediaObjects/41565_2019_561_Figa_HTML.jpg
return src.replace(/(:\/\/[^/]+\/+)[wh][0-9]+\/+(.*?)(?:[?#].*)?$/, "$1full/$2");
}




Expand Down Expand Up @@ -112254,6 +112261,7 @@ var $$IMU_EXPORT$$;
var obj = objified[i];

var remove_obj = function() {
nir_debug("bigimage_recursive", "parse_bigimage (removing obj)");
objified.splice(i, 1);
if (is_array(newhref1)) {
newhref1.splice(i, 1);
Expand Down Expand Up @@ -112364,18 +112372,14 @@ var $$IMU_EXPORT$$;
});
};

// commenting out because apply doesn't exist
/*
// fixme: apply doesn't exist??
apply(newhref);
_apply(newhref);
// strikinglycdn needs newhref1 to be applied, because it has two rules, the cloudinary one, then the {url: src, can_head: false} one
// the second one is only set in newhref1, not newhref
apply(newhref1);
_apply(newhref1);
// _apply is also needed for bigimage'd album_links

// this also needs to be commented out, because normally "apply" not existing would throw an error, preventing this from running.
newhref = null;
currentobj = pastobjs[0];
*/
}

if (false) {
Expand Down
24 changes: 13 additions & 11 deletions userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ var $$IMU_EXPORT$$;
cache: false,
bigimage_recursive: true,
input: false,
check_image_get: true,
find_source: true
check_image_get: false,
find_source: false
};
console.log("Loaded");
}
Expand Down Expand Up @@ -59934,7 +59934,7 @@ var $$IMU_EXPORT$$;
var eb_info = {
regex: /^[a-z]+:\/\/[^/]+\/+pics\/+[^/]*-([0-9]+)\.html(?:[?#].*)?$/,
qfi: "https://" + domain + "/pics/-${id}.html",
image_regex: /<a class='pswp_open' href='(https?:\/\/[^/]+\/+(?:[^"']+\/+)?content\/[^'"]+\/full\/[^'"]+)'/,
image_regex: /<img class='img-thumbnail\s+img-responsive\s+sharpen' src='(https?:\/\/[^/]+\/+content\/[^']+)'/,
video_regex: /(<video id="fluidPlayer">[\s\S]+<\/video>)/
};
var pw_info = {
Expand Down Expand Up @@ -97695,6 +97695,12 @@ var $$IMU_EXPORT$$;
// https://st.violity.com/auction/big/auctions/13/75/23/9/137523999.jpg
return src.replace(/(\/auction\/+)(?:small|view)(\/+auctions\/+)/, "$1big$2");
}
if (domain === "media.springernature.com") {
// thanks to anonymous for reporting:
// https://media.springernature.com/w300/springer-static/image/art%3A10.1038%2Fs41565-019-0561-4/MediaObjects/41565_2019_561_Figa_HTML.jpg?as=webp
// https://media.springernature.com/full/springer-static/image/art%3A10.1038%2Fs41565-019-0561-4/MediaObjects/41565_2019_561_Figa_HTML.jpg
return src.replace(/(:\/\/[^/]+\/+)[wh][0-9]+\/+(.*?)(?:[?#].*)?$/, "$1full/$2");
}
// -- general rules --
if (src.match(/\/ImageGen\.ashx\?/)) {
// http://www.lookalikes.info/umbraco/ImageGen.ashx?image=/media/97522/nick%20hewer%20-%20mark%20brown.jpeg&width=250&constrain=true
Expand Down Expand Up @@ -100474,6 +100480,7 @@ var $$IMU_EXPORT$$;
objified[i] = deepcopy(objified[i]); // ensure no references are kept between objects
var obj = objified[i];
var remove_obj = function() {
nir_debug("bigimage_recursive", "parse_bigimage (removing obj)");
objified.splice(i, 1);
if (is_array(newhref1)) {
newhref1.splice(i, 1);
Expand Down Expand Up @@ -100567,18 +100574,13 @@ var $$IMU_EXPORT$$;
});
});
};
// commenting out because apply doesn't exist
/*
// fixme: apply doesn't exist??
apply(newhref);
_apply(newhref);
// strikinglycdn needs newhref1 to be applied, because it has two rules, the cloudinary one, then the {url: src, can_head: false} one
// the second one is only set in newhref1, not newhref
apply(newhref1);

// this also needs to be commented out, because normally "apply" not existing would throw an error, preventing this from running.
_apply(newhref1);
// _apply is also needed for bigimage'd album_links
newhref = null;
currentobj = pastobjs[0];
*/
}
if (false) {
if (!cond) {
Expand Down

0 comments on commit bd113de

Please sign in to comment.