Created
January 21, 2020 23:06
-
-
Save qsniyg/9065cb574178953b9a1007004021ff9d to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @license http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0 | |
// ^ for LibreJS (this has to be the first comment in the file) | |
// ==UserScript== | |
// @name Image Max URL | |
// @namespace http://tampermonkey.net/ | |
// @version 0.12.6 | |
// @description Finds larger or original versions of images for 6100+ websites | |
// @description:ko 6100개 이상의 사이트에 대해 더 크거나 원본 이미지 찾는 스크립트 | |
// @description:fr Trouve des images plus grandes ou originales pour plus de 6100 sites | |
// @description:es Encuentra imágenes más grandes y originales para más de 6100 sitios | |
// @description:zh 为6100多个网站查找更大或原始图像 | |
// @description:zh-CN 为6100多个网站查找更大或原始图像 | |
// @description:zh-TW 為6100多個網站查找更大或原始圖像 | |
// @description:zh-HK 為6100多個網站查找更大或原始圖像 | |
// @author qsniyg | |
// @homepageURL https://qsniyg.github.io/maxurl/options.html | |
// @supportURL https://github.com/qsniyg/maxurl/issues | |
// @icon https://raw.githubusercontent.com/qsniyg/maxurl/b5c5488ec05e6e2398d4e0d6e32f1bbad115f6d2/resources/logo_256.png | |
// @include * | |
// @grant GM.xmlHttpRequest | |
// @grant GM_xmlhttpRequest | |
// @grant GM.setValue | |
// @grant GM_setValue | |
// @grant GM.getValue | |
// @grant GM_getValue | |
// @grant GM_registerMenuCommand | |
// @grant GM_unregisterMenuCommand | |
// @grant GM_addValueChangeListener | |
// @grant GM_openInTab | |
// @grant GM.openInTab | |
// @connect * | |
// @run-at document-start | |
// @license Apache-2.0 | |
// ==/UserScript== | |
// If you see "A userscript wants to access a cross-origin resource.", it's used for: | |
// * Detecting whether or not the destination URL exists before redirecting | |
// * API calls for various websites to find the larger image (e.g. for Flickr) | |
// * You can control this with the "Rules using API calls" setting | |
// * Downloading the image for the popup | |
// * Querying a third-party library | |
// * You can control this with the "Rules using 3rd-party libraries" setting | |
// Search for do_request if you want to see what the code does exactly. | |
var $$IMU_EXPORT$$; | |
// Disable linting because otherwise editing is incredibly slow | |
// jshint ignore: start | |
(function() { | |
// Don't 'use strict', as it prevents nested functions | |
//'use strict'; | |
var _nir_debug_ = true; | |
if (_nir_debug_) { | |
_nir_debug_ = { | |
no_request: false, | |
no_recurse: false, | |
no_redirect: true | |
}; | |
} | |
var nullfunc = function(){}; | |
var is_extension = false; | |
var is_webextension = false; | |
var extension_send_message = null; | |
var extension_options_page = null; | |
var is_extension_options_page = false; | |
var is_options_page = false; | |
var is_maxurl_website = false; | |
var options_page = "https://qsniyg.github.io/maxurl/options.html"; | |
var imagetab_ok_override = false; | |
try { | |
if (window.location.href.match(/^https?:\/\/qsniyg\.github\.io\/+maxurl\/+options\.html/) || | |
window.location.href.match(/^file:\/\/.*\/maxurl\/site\/options\.html/)) { | |
is_options_page = true; | |
} | |
if (window.location.href.match(/^https?:\/\/qsniyg\.github\.io\/+maxurl\/+/) || | |
window.location.href.match(/^file:\/\/.*\/maxurl\/site\/(?:index|about|options)\.html/)) { | |
is_maxurl_website = true; | |
} | |
} catch(e) { | |
} | |
try { | |
var extension_manifest = chrome.runtime.getManifest(); | |
is_extension = extension_manifest.name === "Image Max URL"; | |
extension_options_page = chrome.runtime.getURL("extension/options.html"); | |
is_extension_options_page = window.location.href.replace(/[?#].*$/, "") === extension_options_page; | |
is_options_page = is_options_page || is_extension_options_page; | |
//options_page = extension_options_page; // can't load from website | |
if (is_extension) { | |
extension_send_message = function(message, respond) { | |
message = deepcopy(message, {json:true}); | |
return chrome.runtime.sendMessage(null, message, null, respond); | |
}; | |
} | |
} catch (e) { | |
} | |
var is_node = false; | |
if ((typeof module !== 'undefined' && module.exports) && | |
typeof window === 'undefined' && typeof document === 'undefined') { | |
is_node = true; | |
} | |
var is_scripttag = false; | |
if (typeof imu_variable !== 'undefined' && (typeof(GM_xmlhttpRequest) === 'undefined' && | |
typeof(GM) === 'undefined')) | |
is_scripttag = true; | |
var is_userscript = false; | |
if (!is_node && !is_scripttag && !is_extension) | |
is_userscript = true; | |
var is_interactive = is_extension || is_userscript; | |
var userscript_manager = "unknown"; | |
var userscript_manager_version = ""; | |
if (is_userscript) { | |
var gm_info = undefined; | |
if (typeof GM_info === "function") { | |
gm_info = GM_info(); | |
} else if (typeof GM_info === "object") { | |
gm_info = GM_info; | |
} | |
if (typeof gm_info === "object") { | |
if (gm_info.scriptHandler) { | |
userscript_manager = gm_info.scriptHandler; | |
} | |
if (gm_info.version) { | |
userscript_manager_version = gm_info.version; | |
} | |
} else if (typeof GM_fetch === 'function' && gm_info === null) { | |
// Unfortunately FireMonkey currently doesn't implement GM_info's scriptHandler: | |
// https://github.com/erosman/support/issues/98#issuecomment-534671229 | |
// We currently have to rely on this hack | |
userscript_manager = "FireMonkey"; | |
gm_info = {scriptHandler: userscript_manager}; | |
} | |
if (_nir_debug_ && false) { | |
console.log("GM_info", gm_info); | |
} | |
} | |
var do_request_browser = function (request) { | |
if (_nir_debug_) { | |
console_log("do_request_browser", request); | |
} | |
var method = request.method || "GET"; | |
var xhr = new XMLHttpRequest(); | |
xhr.open(method, request.url, true); | |
if (request.responseType) | |
xhr.responseType = request.responseType; | |
var do_final = function(override, cb) { | |
if (_nir_debug_) { | |
console_log("do_request_browser's do_final", xhr, cb); | |
} | |
var resp = { | |
readyState: xhr.readyState, | |
finalUrl: xhr.responseURL, | |
responseHeaders: xhr.getAllResponseHeaders(), | |
responseType: xhr.responseType, | |
status: xhr.status, // file:// returns 0, tracking protection also returns 0 | |
statusText: xhr.statusText | |
}; | |
resp.response = xhr.response; | |
try { | |
resp.responseText = xhr.responseText; | |
} catch (e) {} | |
cb(resp); | |
}; | |
var add_handler = function(event, empty) { | |
xhr[event] = function() { | |
if (empty) { | |
return request[event](null); | |
} | |
do_final({}, function(resp) { | |
request[event](resp); | |
}); | |
}; | |
}; | |
add_handler("onload"); | |
add_handler("onerror"); | |
add_handler("onprogress"); | |
add_handler("onabort", true); | |
xhr.send(request.data); | |
return { | |
abort: function() { | |
xhr.abort(); | |
} | |
}; | |
}; | |
if (typeof XMLHttpRequest !== "function") { | |
do_request_browser = null; | |
} | |
var extension_requests = {}; | |
var do_request_raw = null; | |
if (is_extension) { | |
do_request_raw = function(data) { | |
var reqid; | |
extension_send_message({ | |
type: "request", | |
data: data | |
}, function (response) { | |
if (response.type !== "id") { | |
console_error("Internal error: Wrong response", response); | |
return; | |
} | |
reqid = response.data; | |
extension_requests[reqid] = { | |
id: reqid, | |
data: data | |
}; | |
}); | |
return { | |
abort: function() { | |
if (reqid === undefined) { | |
console_error("abort() was called before the request was initialized"); | |
return; | |
} | |
extension_send_message({ | |
type: "abort_request", | |
data: reqid | |
}); | |
} | |
}; | |
}; | |
} else if (typeof(GM_xmlhttpRequest) !== "undefined") { | |
do_request_raw = GM_xmlhttpRequest; | |
} else if (typeof(GM) !== "undefined" && typeof(GM.xmlHttpRequest) !== "undefined") { | |
do_request_raw = GM.xmlHttpRequest; | |
} | |
var register_menucommand = nullfunc; | |
var unregister_menucommand = nullfunc; | |
var num_menucommands = 0; | |
if (is_userscript) { | |
if (typeof(GM_registerMenuCommand) !== "undefined") { | |
register_menucommand = function(name, func) { | |
num_menucommands++; | |
var caption = "[" + num_menucommands + "] " + name; | |
var id = GM_registerMenuCommand(caption, func); | |
if (id === undefined || id === null) | |
id = caption; | |
return id; | |
}; | |
} | |
if (typeof(GM_unregisterMenuCommand) !== "undefined") { | |
unregister_menucommand = function(id) { | |
num_menucommands--; | |
return GM_unregisterMenuCommand(id); | |
}; | |
} | |
} | |
var open_in_tab = nullfunc; | |
if (is_userscript) { | |
if (typeof(GM_openInTab) !== "undefined") { | |
open_in_tab = GM_openInTab; | |
} else if (typeof(GM) !== "undefined" && typeof(GM.openInTab) !== "undefined") { | |
open_in_tab = GM.openInTab; | |
} | |
if (open_in_tab !== nullfunc) { | |
register_menucommand("Options", function() { | |
open_in_tab(options_page); | |
}); | |
} | |
} | |
var check_tracking_blocked = function(result) { | |
if (result.status === 0) | |
return true; | |
return false; | |
}; | |
var do_request = null; | |
if (do_request_raw) { | |
do_request = function(data) { | |
if (_nir_debug_) { | |
console_log("do_request", deepcopy(data)); | |
} | |
if (!data.onerror) | |
data.onerror = data.onload; | |
// For cross-origin cookies | |
if (!("withCredentials" in data)) { | |
data.withCredentials = true; | |
} | |
if (data.trackingprotection_failsafe && settings.allow_browser_request && do_request_browser) { | |
var real_onload = data.onload; | |
var real_onerror = data.onerror; | |
var finalcb = function(resp, iserror) { | |
if (check_tracking_blocked(resp)) { | |
data.onload = real_onload; | |
data.onerror = real_onerror; | |
return do_request_browser(data); | |
} else { | |
if (iserror) { | |
real_onerror(resp); | |
} else { | |
real_onload(resp); | |
} | |
} | |
}; | |
data.onload = function(resp) { | |
finalcb(resp, false); | |
}; | |
data.onerror = function(resp) { | |
finalcb(resp, true); | |
}; | |
} | |
return do_request_raw(data); | |
}; | |
} | |
var get_cookies = null; | |
if (is_extension) { | |
get_cookies = function(url, cb) { | |
if (settings.browser_cookies === false) { | |
return cb(null); | |
} | |
extension_send_message({ | |
type: "getcookies", | |
data: {url: url} | |
}, function(message) { | |
cb(message.data); | |
}); | |
}; | |
} | |
var cookies_to_httpheader = function(cookies) { | |
// deduplication apparently isn't necessary (browser duplicates them too) | |
var strs = []; | |
for (var i = 0; i < cookies.length; i++) { | |
var str = cookies[i].name + "=" + cookies[i].value; | |
strs.push(str); | |
} | |
return strs.join("; "); | |
}; | |
var bigimage_filter = function() { | |
return true; | |
}; | |
if (is_interactive) { | |
bigimage_filter = function(url) { | |
for (var i = 0; i < blacklist_regexes.length; i++) { | |
if (url.match(blacklist_regexes[i])) | |
return false; | |
} | |
return true; | |
} | |
} | |
var default_options = { | |
fill_object: true, | |
null_if_no_change: false, | |
catch_errors: true, | |
use_cache: true, | |
use_api_cache: true, | |
urlcache_time: 60*60, | |
iterations: 200, | |
exclude_problems: [ | |
"watermark", | |
"smaller", | |
"possibly_different", | |
"possibly_broken" | |
], | |
exclude_videos: false, | |
include_pastobjs: true, | |
force_page: false, | |
allow_thirdparty: false, | |
allow_thirdparty_libs: true, | |
filter: bigimage_filter, | |
rule_specific: { | |
imgur_source: true, | |
imgur_nsfw_headers: null, | |
instagram_use_app_api: true, | |
instagram_gallery_postlink: false, | |
tumblr_api_key: null | |
}, | |
do_request: do_request, | |
get_cookies: get_cookies, | |
host_url: null, | |
document: null, | |
window: null, | |
element: null, | |
cb: null | |
}; | |
var default_object = { | |
url: null, | |
always_ok: false, | |
likely_broken: false, | |
can_head: true, | |
head_ok_errors: [], | |
head_wrong_contenttype: false, | |
head_wrong_contentlength: false, | |
waiting: false, | |
redirects: false, | |
forces_download: false, | |
is_private: false, | |
is_original: false, | |
norecurse: false, | |
forcerecurse: false, | |
bad: false, | |
bad_if: [], | |
fake: false, | |
video: false, | |
headers: {}, | |
referer_ok: { | |
same_domain: false, | |
same_domain_nosub: false | |
}, | |
extra: { | |
page: null, | |
caption: null | |
}, | |
filename: "", | |
problems: { | |
watermark: false, | |
smaller: false, | |
possibly_different: false, | |
possibly_broken: false | |
} | |
}; | |
//var options_page = "https://qsniyg.github.io/maxurl/options.html"; | |
// restore console.log for websites that remove it (twitter) | |
// https://gist.github.com/Ivanca/4586071 | |
//var console_log = function(){ return window.console.__proto__.log.apply(console, arguments) } ; | |
//var console_error = function(){ return window.console.__proto__.error.apply(console, arguments) } ; | |
// since the userscript is run first, this generally shouldn't be a problem | |
var console_log = console.log; | |
var console_error = console.error; | |
var console_warn = console.warn; | |
var console_trace = console.trace; | |
var JSON_stringify = JSON.stringify; | |
var JSON_parse = JSON.parse; | |
function is_element(x) { | |
if ((typeof Element !== "undefined" && x instanceof Element) || | |
(x && typeof x === "object" && (("namespaceURI" in x) && ("ariaSort" in x)))) { | |
return true; | |
} else { | |
return false; | |
} | |
} | |
function is_iterable_object(x) { | |
return typeof x === "object" && x !== null && !(x instanceof Array) && !is_element(x); | |
} | |
function deepcopy(x, options) { | |
if (!options) | |
options = {}; | |
if (!options.history) | |
options.history = []; | |
if (typeof x === "object") { | |
if (options.history.indexOf(x) >= 0) | |
return; | |
else | |
options.history.push(x); | |
} | |
var result; | |
if (typeof x === "string" || x === null) { | |
return x; | |
} else if ((typeof Element !== "undefined" && x instanceof Element) || | |
(x && typeof x === "object" && (("namespaceURI" in x) && ("ariaSort" in x)))) { | |
if (options.json) { | |
return undefined; | |
} else { | |
return x; | |
} | |
} else if (typeof x === "function") { | |
if (options.json) { | |
return undefined; | |
} else { | |
return x; | |
} | |
} else if (x instanceof Array) { | |
result = []; | |
for (var i = 0; i < x.length; i++) { | |
var item = x[i]; | |
result.push(deepcopy(item, options)); | |
} | |
return result; | |
} else if (typeof x === "object") { | |
result = {}; | |
for (var key in x) { | |
try { | |
result[key] = deepcopy(x[key], options); | |
} catch (e) { | |
result[key] = x[key]; | |
} | |
} | |
return result; | |
} else { | |
return x; | |
} | |
} | |
function overlay_object(base, obj) { | |
if (typeof base === "function" || base instanceof Array) | |
return obj; // FIXME? | |
if (typeof base === "object") { | |
if (typeof obj !== "object") | |
return obj; | |
for (var key in obj) { | |
if (key in base) { | |
base[key] = overlay_object(base[key], obj[key]); | |
} else { | |
base[key] = obj[key]; | |
} | |
} | |
return base; | |
} | |
return obj; | |
} | |
var parse_boolean = function(bool) { | |
if (bool === "true" || bool === true || bool === 1) | |
return true; | |
if (bool === "false" || bool === false || bool === 0) | |
return false; | |
return; | |
}; | |
// https://stackoverflow.com/a/25603630 | |
function get_language() { | |
if (typeof navigator === "undefined") | |
return "en"; | |
if (navigator.languages) | |
return navigator.languages[0]; | |
return navigator.language || navigator.userLanguage; | |
} | |
var supported_languages = ["en", "ko", "fr"]; | |
var browser_language = "en"; | |
try { | |
browser_language = get_language().replace(/-.*/, "").toLowerCase(); | |
if (supported_languages.indexOf(browser_language) < 0) | |
browser_language = "en"; | |
} catch (e) { | |
console_error(e); | |
} | |
var strings = { | |
"options_header": { | |
"en": "Options", | |
"ko": "설정" | |
}, | |
"yes": { | |
"en": "Yes", | |
"ko": "예", | |
"fr": "Oui" | |
}, | |
"no": { | |
"en": "No", | |
"ko": "아니오", | |
"fr": "Non" | |
}, | |
"category_redirection": { | |
"en": "Redirection", | |
"ko": "리디렉션" | |
}, | |
"Enable redirection": { | |
"ko": "리디렉션 사용", | |
"fr": "Activer la redirection" | |
}, | |
"Add to history": { | |
"ko": "브라우저 기록에 추가", | |
"fr": "Ajouter à l'historique" | |
}, | |
"Use GET if HEAD is unsupported": { | |
"ko": "HEAD 지원되지 않으면 GET 사용", | |
"fr": "Utiliser GET si HEAD n'est pas supporté" | |
}, | |
"Try finding original page/caption": { | |
"fr": "Essayer de trouver la page d'origine/sous-titre" | |
}, | |
"Enable mouseover popup": { | |
"en": "Enable image popup", | |
"ko": "이미지 팝업 사용", | |
"fr": "Activer le popup" | |
}, | |
"Mouseover popup action": { | |
"en": "Popup action", | |
"ko": "이미지 팝업 작업" | |
}, | |
"category_popup": { | |
"en": "Popup", | |
"ko": "팝업" | |
}, | |
"subcategory_ui": { | |
"en": "UI" | |
}, | |
"subcategory_trigger": { | |
"en": "Trigger", | |
"ko": "트리거", | |
"fr": "Déclencheur" | |
}, | |
"subcategory_open_behavior": { | |
"en": "Open Behavior" | |
}, | |
"subcategory_close_behavior": { | |
"en": "Close Behavior" | |
}, | |
"subcategory_behavior": { | |
"en": "Popup Behavior" | |
}, | |
"subcategory_video": { | |
"en": "Video", | |
"ko": "영상" | |
}, | |
"subcategory_gallery": { | |
"en": "Gallery" | |
}, | |
"subcategory_popup_other": { | |
"en": "Other", | |
"fr": "Autre" | |
}, | |
"New tab": { | |
"ko": "새 탭", | |
"fr": "Nouvel onglet" | |
}, | |
"Mouseover popup trigger": { | |
// FIXME is 트리거 correct? | |
"en": "Popup trigger", | |
"ko": "팝업 트리거", | |
"fr": "Déclencheur du popup" | |
}, | |
"Mouseover": { | |
// FIXME | |
"ko": "마우스" | |
}, | |
"Key trigger": { | |
"ko": "키 바인딩" | |
}, | |
"Popup trigger key": { | |
"ko": "팝업 키 바인딩" | |
}, | |
"Popup trigger delay": { | |
// FIXME? | |
"ko": "팝업 작업 지연 시간" | |
}, | |
"seconds": { | |
"ko": "초" | |
}, | |
"Popup UI": { | |
"ko": "팝업 UI" | |
}, | |
"Opacity": { | |
"ko": "불투명", | |
"fr": "Opacité" | |
}, | |
"Gallery counter": { | |
"ko": "갤러리 이미지 수", | |
"fr": "Nombre d'images dans la galerie" | |
}, | |
"Gallery counter max": { | |
"ko": "갤러리 이미지 수의 최대값", | |
"fr": "Nombre max d'images a compter pour la galerie" | |
}, | |
"images": { | |
"ko": "이미지" | |
}, | |
"Options Button": { | |
"ko": "설정 링크" | |
}, | |
"Rotation Buttons": {}, | |
"Video": { | |
"ko": "영상" | |
}, | |
"Media": { | |
"ko": "미디어" | |
}, | |
"Both images and video": { | |
"ko": "사진+영상" | |
}, | |
"Keep popup open until": { | |
"ko": "팝업 닫으려면" | |
}, | |
"Any trigger is released": { | |
"ko": "아무 키 놓습니다" | |
}, | |
"All triggers are released": { | |
"ko": "키 다 놓습니다" | |
}, | |
"ESC/Close is pressed": { | |
"ko": "ESC/닫기 누릅니다" | |
}, | |
"Popup default zoom": { | |
"ko": "확대/축소 기본값" | |
}, | |
"Fit to screen": { | |
"ko": "화면 크기에 맞춤", | |
"fr": "Adapter a l'ecran" | |
}, | |
"Full size": { | |
"ko": "전체 크기", | |
"fr": "Taille réelle" | |
//"fr": "Pleine grandeur" // should it be this instead? | |
}, | |
"Popup panning method": { | |
"ko": "이미지 이동하려면" | |
}, | |
"Movement": { | |
"ko": "마우스 움직입니다" | |
}, | |
"Drag": { | |
"ko": "끕니다" | |
}, | |
"Popup scroll action": { | |
"ko": "마우스 휠 작업" | |
}, | |
"Zoom": { | |
"ko": "줌" | |
}, | |
"Pan": { | |
"ko": "이동" | |
}, | |
"None": { | |
"ko": "없다" | |
}, | |
"Zoom behavior": { | |
// FIXME? | |
"ko": "줌 동작" | |
}, | |
"Fit/Full": { | |
"ko": "화면맞춤/전체" | |
}, | |
"Incremental": { | |
"ko": "증분", | |
"fr": "Incrémentale" | |
}, | |
"Popup position": { | |
"ko": "팝업 위치" | |
}, | |
"Mouse cursor": { | |
"ko": "마우스 커서" | |
}, | |
"Page middle": { | |
"ko": "페이지 중간" | |
}, | |
"Clicking image downloads": { | |
"ko": "이미지 클릭하면 다운로드", | |
"fr": "Cliquer l'image le télécharge" | |
}, | |
"Popup for plain hyperlinks": { | |
"ko": "일반적인 링크에도 팝업" | |
}, | |
"Popup CSS style": { | |
"ko": "팝업 CSS" | |
}, | |
"category_rules": { | |
"en": "Rules", | |
"ko": "규칙", | |
"fr": "Règles" | |
}, | |
"Larger watermarked images": { | |
"ko": "더 크지만 워터마크 있는 이미지" | |
}, | |
"Smaller non-watermarked images": { | |
"ko": "더 작지만 워터마크 없는 이미지" | |
}, | |
"Possibly different images": { | |
"ko": "다를 수 있는 이미지", | |
"fr": "Images possiblement différentes" | |
}, | |
"Possibly broken images": { | |
"ko": "손상될 수 있는 이미지", | |
"fr": "Images possiblement brisée" | |
}, | |
"Rules using 3rd-party websites": { | |
"ko": "3파티 사이트를 사용하는 규칙", | |
"fr": "Règles utilisant des sites 3rd-party" | |
}, | |
"Newsen": { | |
"ko": "뉴스엔" | |
}, | |
"subcategory_rule_specific": { | |
"en": "Rule-specific" | |
}, | |
"category_website": { | |
"en": "Website", | |
"ko": "웹사이트", | |
"fr": "Site" | |
}, | |
"Use userscript": { | |
"ko": "유저스크립트 사용하기", | |
"fr": "Utiliser ce userscript" | |
}, | |
"Website image preview": { | |
"ko": "링크 붙인 후 이미지 미리보기" | |
}, | |
"saved_refresh_target": { | |
"en": "Saved! Refresh the target page for changes to take effect", | |
"ko": "저장됩니다. 번경사항 적용하려면 대상 웹페이지 다시 로드하십시오", | |
"fr": "Enregistré! Actualiser la page que vous visitez pour que les changements prennent effet" // FIXME: this is a terrible translation | |
}, | |
"saved_no_refresh": { | |
"en": "Saved!", | |
"ko": "저장됩니다", | |
"fr": "Enregistré!" | |
}, | |
"save": { | |
"en": "Save", | |
"ko": "저장", | |
"fr": "Enregistrer" | |
}, | |
"record": { | |
"en": "Record" | |
// "Enregistrer" also means "Record" | |
}, | |
"cancel": { | |
"en": "Cancel", | |
"ko": "취소", | |
"fr": "Annuler" | |
}, | |
"Mouseover popup (%%1) is needed to display the original version": { | |
"ko": "원본 이미지 보려면 팝업 (%%1) 필요합니다", | |
"fr": "Popup (%%1) est nécessaire pour trouver la version originale" | |
}, | |
"custom headers": { | |
"ko": "특정 헤더", | |
"fr": "en-têtes spéciales" | |
}, | |
"forces download": {}, // TODO | |
"Close": { | |
"ko": "닫기", | |
"fr": "Fermer" | |
}, | |
"Previous": { | |
"ko": "이전", | |
"fr": "Image précédente" | |
}, | |
"Next": { | |
"ko": "다음", | |
"fr": "Image suivante" | |
}, | |
"Left Arrow": { | |
"ko": "왼쪽 화살표", | |
"fr": "Flèche gauche" | |
}, | |
"Right Arrow": { | |
"ko": "오른쪽 화살표", | |
"fr": "Flèche droite" | |
}, | |
"Blacklist": { | |
"ko": "블랙리스트" | |
}, | |
"Blacklist engine": { | |
"ko": "블랙리스트 엔진" | |
}, | |
"Simple (glob)": { | |
"ko": "단순 (glob)" | |
}, | |
"Regex": { | |
"ko": "정규식" | |
}, | |
"category_extension": { | |
"en": "Extension" | |
}, | |
"rotate_left_btn": { | |
"en": "Rotate Left" | |
}, | |
"rotate_right_btn": { | |
"en": "Rotate Right" | |
}, | |
"category_extra": { | |
"en": "Buttons" | |
}, | |
"subcategory_replaceimages": { | |
"en": "Replace Images" | |
}, | |
"subcategory_highlightimages": { | |
"en": "Highlight Images" | |
}, | |
"category_general": { | |
"en": "General", | |
"ko": "일반" | |
}, | |
"Language": { | |
"ko": "언어" | |
} | |
}; | |
function _(str) { | |
if (typeof str !== "string") { | |
return str; | |
} | |
var language = settings.language; | |
if (str in strings) { | |
if (language in strings[str]) { | |
str = strings[str][language]; | |
} else if ("en" in strings[str]) { | |
str = strings[str]["en"]; | |
} | |
} | |
var parts = []; | |
var currentpart = ""; | |
for (var i = 0; i < str.length; i++) { | |
if (str[i] == '%') { | |
if ((i + 2) < str.length) { | |
if (str[i + 1] == '%') { | |
var num = parseInt(str[i + 2]); | |
if (!isNaN(num)) { | |
parts.push(currentpart); | |
currentpart = ""; | |
parts.push(arguments[num]); | |
i += 2; | |
continue; | |
} | |
} | |
} | |
} | |
currentpart += str[i]; | |
} | |
parts.push(currentpart); | |
return parts.join(""); | |
} | |
var settings = { | |
// thanks to decembre on github for the idea: https://github.com/qsniyg/maxurl/issues/14#issuecomment-530760246 | |
imu_enabled: true, | |
language: browser_language, | |
// thanks to forefix on firefox for the idea: https://github.com/qsniyg/maxurl/issues/189 | |
dark_mode: false, | |
advanced_options: false, | |
allow_browser_request: true, | |
redirect: true, | |
redirect_history: true, | |
canhead_get: true, | |
redirect_force_page: false, | |
redirect_disable_for_responseheader: false, | |
mouseover: true, | |
// thanks to blue-lightning on github for the idea: https://github.com/qsniyg/maxurl/issues/16 | |
mouseover_open_behavior: "popup", | |
//mouseover_trigger: ["ctrl", "shift"], | |
mouseover_trigger_behavior: "keyboard", | |
// thanks to 894-572 on github for the idea: https://github.com/qsniyg/maxurl/issues/30 | |
mouseover_trigger_key: ["shift", "alt", "i"], | |
mouseover_trigger_delay: 1, | |
mouseover_trigger_mouseover: false, | |
mouseover_trigger_prevent_key: ["shift"], | |
// also thanks to blue-lightning: https://github.com/qsniyg/maxurl/issues/16 | |
mouseover_close_behavior: "esc", | |
// thanks to acid-crash on github for the idea: https://github.com/qsniyg/maxurl/issues/14#issuecomment-436594057 | |
mouseover_close_need_mouseout: true, | |
mouseover_jitter_threshold: 30, | |
mouseover_cancel_popup_when_elout: true, | |
mouseover_cancel_popup_with_esc: true, | |
// thanks to decembre on github for the idea: https://github.com/qsniyg/maxurl/issues/14#issuecomment-530760246 | |
mouseover_use_hold_key: true, | |
mouseover_hold_key: ["i"], | |
// thanks to decembre on github for the idea: https://github.com/qsniyg/maxurl/issues/14#issuecomment-531549043 | |
//mouseover_close_on_leave_el: true, | |
mouseover_close_el_policy: "both", | |
// thanks to decembre on github for the idea: https://github.com/qsniyg/maxurl/issues/126 | |
mouseover_allow_partial: is_extension ? "media" : "video", | |
//mouseover_use_fully_loaded_image: is_extension ? false : true, | |
//mouseover_use_fully_loaded_video: false, | |
mouseover_minimum_size: 20, | |
mouseover_exclude_backgroundimages: false, | |
// thanks to decembre on github for the idea: https://github.com/qsniyg/maxurl/issues/14#issuecomment-530760246 | |
mouseover_exclude_page_bg: true, | |
// thanks to Jin on discord for the idea | |
mouseover_only_links: false, | |
mouseover_exclude_sameimage: false, | |
mouseover_exclude_imagetab: true, | |
mouseover_video_controls: false, | |
mouseover_video_loop: true, | |
mouseover_video_muted: false, | |
mouseover_video_volume: 100, | |
mouseover_ui: true, | |
mouseover_ui_opacity: 80, | |
mouseover_ui_imagesize: true, | |
mouseover_ui_zoomlevel: true, | |
mouseover_ui_gallerycounter: true, | |
mouseover_ui_gallerymax: 50, | |
mouseover_ui_closebtn: true, | |
mouseover_ui_optionsbtn: is_userscript ? true : false, | |
mouseover_ui_rotationbtns: false, | |
mouseover_ui_caption: true, | |
mouseover_ui_wrap_caption: true, | |
mouseover_zoom_behavior: "fit", | |
// thanks to decembre on github for the idea: https://github.com/qsniyg/maxurl/issues/14#issuecomment-531080061 | |
mouseover_zoom_custom_percent: 100, | |
mouseover_pan_behavior: "drag", | |
mouseover_drag_min: 5, | |
mouseover_scroll_behavior: "zoom", | |
scroll_zoom_behavior: "fitfull", | |
mouseover_move_with_cursor: false, | |
zoom_out_to_close: false, | |
// thanks to 07416 on github for the idea: https://github.com/qsniyg/maxurl/issues/20#issuecomment-439599984 | |
mouseover_position: "cursor", | |
// thanks to decembre on github for the idea: https://github.com/qsniyg/maxurl/issues/14#issuecomment-531549043 | |
mouseover_prevent_cursor_overlap: true, | |
mouseover_download: false, | |
// also thanks to 07416: https://github.com/qsniyg/maxurl/issues/25 | |
mouseover_links: false, | |
mouseover_gallery_cycle: false, | |
mouseover_gallery_prev_key: ["left"], | |
mouseover_gallery_next_key: ["right"], | |
// thanks to acid-crash on github for the idea: https://github.com/qsniyg/maxurl/issues/20 | |
mouseover_styles: "", | |
// thanks to decembre on github for the idea: https://github.com/qsniyg/maxurl/issues/14#issuecomment-541065461 | |
mouseover_wait_use_el: false, | |
mouseover_download_key: ["s"], | |
mouseover_rotate_left_key: ["e"], | |
mouseover_rotate_right_key: ["r"], | |
mouseover_flip_horizontal_key: ["h"], | |
mouseover_flip_vertical_key: ["v"], | |
mouseover_apply_blacklist: false, | |
website_inject_imu: true, | |
website_image: true, | |
extension_contextmenu: true, | |
allow_video: true, | |
allow_watermark: false, | |
allow_smaller: false, | |
allow_possibly_different: false, | |
allow_possibly_broken: false, | |
allow_thirdparty: false, | |
allow_apicalls: true, | |
allow_thirdparty_libs: is_userscript ? false : true, | |
//browser_cookies: true, | |
imgur_source: true, | |
instagram_use_app_api: true, | |
instagram_gallery_postlink: false, | |
tumblr_api_key: "", | |
// thanks to LukasThyWalls on github for the idea: https://github.com/qsniyg/maxurl/issues/75 | |
bigimage_blacklist: "", | |
bigimage_blacklist_engine: "glob", | |
replaceimgs_auto: false, | |
replaceimgs_replaceimgs: true, | |
replaceimgs_addlinks: false, | |
replaceimgs_replacelinks: false, | |
replaceimgs_usedata: true, | |
replaceimgs_wait_fullyloaded: true, | |
replaceimgs_totallimit: 8, | |
replaceimgs_domainlimit: 2, | |
highlightimgs_enable: false, | |
highlightimgs_auto: "never", | |
highlightimgs_onlysupported: true, | |
highlightimgs_css: "outline: 4px solid yellow" | |
}; | |
var orig_settings = deepcopy(settings); | |
var settings_meta = { | |
imu_enabled: { | |
name: "Enable extension", | |
description: "Globally enables or disables the extension", | |
category: "general", | |
// Userscript users can easily disable it from the userscript menu, | |
// and enabling it again isn't as trivial as it is for the extension | |
extension_only: true, | |
imu_enabled_exempt: true | |
}, | |
language: { | |
name: "Language", | |
description: "Language for this extension", | |
category: "general", | |
options: { | |
_type: "combo", | |
en: { | |
name: "English" | |
}, | |
ko: { | |
name: "한국어" | |
}, | |
fr: { | |
name: "Français" | |
} | |
}, | |
onedit: function() { | |
run_soon(do_options); | |
}, | |
imu_enabled_exempt: true | |
}, | |
dark_mode: { | |
name: "Dark mode", | |
description: "Changes the colors to have light text on a dark background", | |
category: "general", | |
onedit: update_dark_mode, | |
onupdate: update_dark_mode, | |
imu_enabled_exempt: true | |
}, | |
advanced_options: { | |
name: "Show advanced settings", | |
description: "If disabled, settings that might be harder to understand will be hidden", | |
category: "general", | |
onedit: function() { | |
run_soon(do_options); | |
}, | |
imu_enabled_exempt: true | |
}, | |
allow_browser_request: { | |
name: "Allow using browser XHR", | |
description: "This allows XHR requests to be run in the browser's context if they fail in the extension (e.g. when Tracking Protection is set to High)", | |
category: "general", | |
imu_enabled_exempt: true, | |
advanced: true | |
}, | |
redirect: { | |
name: "Enable redirection", | |
description: "Redirect images opened in their own tab", | |
category: "redirection" | |
}, | |
redirect_history: { | |
name: "Add to history", | |
description: "Redirection will add a new entry to the browser's history", | |
requires: { | |
redirect: true | |
}, | |
category: "redirection" | |
}, | |
canhead_get: { | |
name: "Use GET if HEAD is unsupported", | |
description: "Use a GET request to check an image's availability, if the server does not support HEAD requests", | |
requires: { | |
redirect: true | |
}, | |
category: "redirection", | |
advanced: true | |
}, | |
redirect_force_page: { | |
name: "Try finding original page/caption", | |
description: "Enables methods that use API calls for finding the original page or caption", | |
example_websites: [ | |
"Flickr", | |
"SmugMug", | |
"..." | |
], | |
category: "rules" | |
}, | |
redirect_disable_for_responseheader: { | |
name: "Disable when response headers need modifying", | |
description: "This option works around Chrome's migration to manifest v3, redirecting some images to being force-downloaded", | |
extension_only: true, | |
hidden: true, // Doesn't seem to be needed? | |
category: "redirection", | |
advanced: true | |
}, | |
mouseover: { | |
name: "Enable mouseover popup", | |
description: "Show a popup with the larger image when you mouseover an image with the trigger key held", | |
category: "popup" | |
}, | |
mouseover_open_behavior: { | |
name: "Mouseover popup action", | |
description: "Determines how the mouseover popup will open", | |
extension_only: true, | |
options: { | |
_type: "or", | |
popup: { | |
name: "Popup" | |
}, | |
newtab: { | |
name: "New tab" | |
} | |
}, | |
requires: { | |
mouseover: true | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_trigger: { | |
name: "Popup trigger", | |
description: "Trigger key that, when held, will show the popup", | |
options: { | |
_type: "and", | |
_group1: { | |
_type: "and", | |
ctrl: { | |
name: "Ctrl" | |
}, | |
shift: { | |
name: "Shift" | |
}, | |
alt: { | |
name: "Alt" | |
} | |
}, | |
_group2: { | |
_type: "or", | |
delay_1: { | |
name: "Delay 1s" | |
}, | |
delay_3: { | |
name: "Delay 3s" | |
} | |
} | |
}, | |
requires: { | |
mouseover: true | |
}, | |
category: "popup", | |
subcategory: "trigger" | |
}, | |
mouseover_trigger_behavior: { | |
name: "Mouseover popup trigger", | |
description: "How the popup will get triggered", | |
options: { | |
mouse: { | |
name: "Mouseover", | |
description: "Triggers when your mouse is over the image" | |
}, | |
keyboard: { | |
name: "Key trigger", | |
description: "Triggers when you press a key sequence when your mouse is over an image" | |
}, | |
none: { | |
name: "None", | |
description: "Disables the popup from being triggered (useful if you only want to use the context menu item)", | |
extension_only: true | |
} | |
}, | |
requires: { | |
mouseover: true | |
}, | |
category: "popup", | |
subcategory: "trigger" | |
}, | |
mouseover_trigger_key: { | |
name: "Popup trigger key", | |
description: "Key sequence to trigger the popup", | |
type: "keysequence", | |
requires: { | |
mouseover: true, | |
mouseover_trigger_behavior: "keyboard" | |
}, | |
category: "popup", | |
subcategory: "trigger" | |
}, | |
mouseover_trigger_delay: { | |
name: "Popup trigger delay", | |
description: "Delay (in seconds) before the popup shows", | |
requires: { | |
mouseover: true, | |
mouseover_trigger_behavior: "mouse" | |
}, | |
type: "number", | |
number_min: 0, | |
number_unit: "seconds", | |
category: "popup", | |
subcategory: "trigger" | |
}, | |
mouseover_trigger_mouseover: { | |
name: "Use mouseover event", | |
description: "Uses the mouseover event instead of mousemove to figure out where to trigger the popup. This more closely matches the way other image popup addons work, at the cost of configurability", | |
requires: { | |
mouseover_trigger_behavior: "mouse" | |
}, | |
advanced: true, | |
category: "popup", | |
subcategory: "trigger" | |
}, | |
mouseover_trigger_prevent_key: { | |
name: "Popup prevention key", | |
description: "Holding down this key will prevent the popup from being opened", | |
requires: { | |
mouseover: true, | |
mouseover_trigger_behavior: "mouse" | |
}, | |
type: "keysequence", | |
category: "popup", | |
subcategory: "trigger" | |
}, | |
mouseover_allow_partial: { | |
name: "Allow showing partially loaded", | |
description: "This will allow the popup to open for partially loaded media", | |
description_userscript: "This will allow the popup to open for partially loaded media, but this might break some images", | |
requires: { | |
mouseover: true, | |
mouseover_open_behavior: "popup" | |
}, | |
options: { | |
_type: "or", | |
video: { | |
name: "Video" | |
}, | |
media: { | |
name: "Media", | |
description: "Both images and video" | |
}, | |
none: { | |
name: "None" | |
} | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_use_fully_loaded_image: { | |
name: "Wait until image is fully loaded", | |
description: "Wait until the image has fully loaded before displaying it", | |
requires: { | |
mouseover: true, | |
mouseover_open_behavior: "popup" | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_use_fully_loaded_video: { | |
name: "Wait until video is fully loaded", | |
description: "Wait until the video has fully loaded before displaying it (this may significantly increase memory usage with larger videos)", | |
requires: { | |
mouseover: true, | |
mouseover_open_behavior: "popup" | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_exclude_page_bg: { | |
name: "Exclude page background", | |
description: "Excludes the page background for the popup", | |
requires: { | |
mouseover: true, | |
mouseover_exclude_backgroundimages: false | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_minimum_size: { | |
name: "Minimum image size", | |
description: "Smallest size acceptable for the popup to open (this option is ignored for background images)", | |
requires: { | |
mouseover: true | |
}, | |
type: "number", | |
number_min: 0, | |
number_unit: "pixels", | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_exclude_backgroundimages: { | |
name: "Exclude `background-image`s", | |
description: "Excludes 'background-image's for the popup. Might prevent the popup from working on many images", | |
requires: { | |
mouseover: true | |
}, | |
disabled_if: { | |
mouseover_trigger_mouseover: true | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_exclude_imagetab: { | |
name: "Exclude image tabs", | |
description: "Excludes images that are opened in their own tabs", | |
requires: { | |
mouseover: true, | |
mouseover_trigger_behavior: "mouse" | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_exclude_sameimage: { | |
name: "Exclude if image URL is unchanged", | |
description: "Don't pop up if the new image is the same as the thumbnail image", | |
requires: { | |
mouseover: true | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_only_links: { | |
name: "Only popup for linked images", | |
description: "Don't pop up if the image isn't linked", | |
requires: { | |
mouseover: true | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_video_controls: { | |
name: "Show video controls", | |
description: "Shows native video controls. Note that this prevents dragging under Firefox", | |
requires: { | |
mouseover_open_behavior: "popup", | |
allow_video: true | |
}, | |
category: "popup", | |
subcategory: "video" | |
}, | |
mouseover_video_loop: { | |
name: "Loop video", | |
description: "Allows the video to automatically restart to the beginning after finishing playing", | |
requires: { | |
mouseover_open_behavior: "popup", | |
allow_video: true | |
}, | |
category: "popup", | |
subcategory: "video" | |
}, | |
mouseover_video_muted: { | |
name: "Mute video", | |
description: "Mutes the video by default", | |
requires: { | |
mouseover_open_behavior: "popup", | |
allow_video: true | |
}, | |
category: "popup", | |
subcategory: "video" | |
}, | |
mouseover_video_volume: { | |
name: "Default volume", | |
description: "Default volume for the video", | |
requires: { | |
mouseover_video_muted: false | |
}, | |
type: "number", | |
number_min: 0, | |
number_max: 100, | |
number_int: true, | |
number_unit: "%", | |
category: "popup", | |
subcategory: "video" | |
}, | |
mouseover_ui: { | |
name: "Popup UI", | |
description: "Enables a UI on top of the popup", | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
category: "popup", | |
subcategory: "ui" | |
}, | |
mouseover_ui_opacity: { | |
name: "Opacity", | |
description: "Opacity of the UI on top of the popup", | |
requires: { | |
mouseover_ui: true | |
}, | |
type: "number", | |
number_unit: "%", | |
number_max: 100, | |
number_min: 0, | |
number_int: true, | |
category: "popup", | |
subcategory: "ui" | |
}, | |
mouseover_ui_imagesize: { | |
name: "Image size", | |
description: "Displays the image size on top of the UI", | |
requires: { | |
mouseover_ui: true | |
}, | |
category: "popup", | |
subcategory: "ui" | |
}, | |
mouseover_ui_zoomlevel: { | |
name: "Zoom percent", | |
description: "Displays the current zoom level on top of the UI", | |
requires: { | |
mouseover_ui: true | |
}, | |
category: "popup", | |
subcategory: "ui" | |
}, | |
mouseover_ui_gallerycounter: { | |
name: "Gallery counter", | |
description: "Enables a gallery counter on top of the UI", | |
requires: { | |
mouseover_ui: true | |
}, | |
category: "popup", | |
subcategory: "ui" | |
}, | |
mouseover_ui_gallerymax: { | |
name: "Gallery counter max", | |
description: "Maximum amount of images to check in the counter (this can be slightly CPU-intensive)", | |
requires: { | |
mouseover_ui_gallerycounter: true | |
}, | |
type: "number", | |
number_min: 0, | |
number_unit: "images", | |
category: "popup", | |
subcategory: "ui" | |
}, | |
mouseover_ui_closebtn: { | |
name: "Close Button", | |
description: "Enables a button to close the popup", | |
requires: { | |
mouseover_ui: true | |
}, | |
category: "popup", | |
subcategory: "ui" | |
}, | |
mouseover_ui_optionsbtn: { | |
name: "Options Button", | |
description: "Enables a button to go to this page", | |
requires: { | |
mouseover_ui: true | |
}, | |
// While it works for the extension, it's more or less useless | |
userscript_only: true, | |
category: "popup", | |
subcategory: "ui" | |
}, | |
mouseover_ui_rotationbtns: { | |
name: "Rotation Buttons", | |
description: "Enables buttons on the UI to rotate the image by 90 degrees", | |
requires: { | |
mouseover_ui: true | |
}, | |
category: "popup", | |
subcategory: "ui" | |
}, | |
mouseover_ui_caption: { | |
name: "Caption", | |
description: "Shows the image's caption (if available) at the top", | |
requires: { | |
mouseover_ui: true | |
}, | |
category: "popup", | |
subcategory: "ui" | |
}, | |
mouseover_ui_wrap_caption: { | |
name: "Wrap caption text", | |
description: "Wraps the caption if it's too long", | |
requires: { | |
mouseover_ui_caption: true | |
}, | |
category: "popup", | |
subcategory: "ui" | |
}, | |
mouseover_close_behavior: { | |
name: "Keep popup open until", | |
description: "Closes the popup when the selected condition is met", | |
options: { | |
_type: "or", | |
_group1: { | |
any: { | |
name: "Any trigger is released" | |
} | |
}, | |
_group2: { | |
all: { | |
name: "All triggers are released" | |
} | |
}, | |
_group3: { | |
esc: { | |
name: "ESC/Close is pressed" | |
} | |
} | |
}, | |
requires: { | |
mouseover_open_behavior: "popup", | |
mouseover_trigger_behavior: "keyboard" | |
}, | |
category: "popup", | |
subcategory: "close_behavior" | |
}, | |
mouseover_close_need_mouseout: { | |
name: "Don't close until mouse leaves", | |
description: "If true, this keeps the popup open even if all triggers are released if the mouse is still over the image", | |
requires: [ | |
{mouseover_close_behavior: "any"}, | |
{mouseover_close_behavior: "all"} | |
], | |
category: "popup", | |
subcategory: "close_behavior" | |
}, | |
mouseover_jitter_threshold: { | |
name: "Threshold to leave image", | |
description: "How many pixels outside of the image before the cursor is considered to have left the image", | |
requires: [ | |
{mouseover_close_need_mouseout: true}, | |
{mouseover_trigger_behavior: "mouse"} | |
], | |
type: "number", | |
number_unit: "pixels", | |
category: "popup", | |
subcategory: "close_behavior" | |
}, | |
mouseover_cancel_popup_when_elout: { | |
name: "Leaving thumbnail cancels loading", | |
description: "Cancels the current popup loading when the cursor has left the thumbnail image", | |
requires: { | |
mouseover: true, | |
mouseover_trigger_behavior: "mouse" | |
}, | |
category: "popup", | |
subcategory: "close_behavior" | |
}, | |
mouseover_cancel_popup_with_esc: { | |
name: "ESC cancels loading", | |
description: "Cancels the current popup loading if ESC is pressed", | |
requires: { | |
mouseover: true | |
}, | |
category: "popup", | |
subcategory: "close_behavior" | |
}, | |
mouseover_use_hold_key: { | |
name: "Use hold key", | |
description: "Enables the use of a hold key that, when pressed, will keep the popup open", | |
requires: { | |
mouseover_trigger_behavior: "mouse" | |
}, | |
category: "popup", | |
subcategory: "close_behavior" | |
}, | |
mouseover_hold_key: { | |
name: "Hold key", | |
description: "Hold key that, when pressed, will keep the popup open", | |
requires: { | |
mouseover_use_hold_key: true | |
}, | |
type: "keysequence", | |
category: "popup", | |
subcategory: "close_behavior" | |
}, | |
mouseover_close_on_leave_el: { | |
name: "Close when leaving thumbnail", | |
description: "Closes the popup when the mouse leaves the thumbnail element (won't close if the mouse instead moves to the popup)", | |
requires: { | |
mouseover_trigger_behavior: "mouse", | |
mouseover_position: "beside_cursor" | |
}, | |
category: "popup", | |
subcategory: "close_behavior" | |
}, | |
mouseover_close_el_policy: { | |
name: "Close when leaving", | |
description: "Closes the popup when the mouse leaves the thumbnail element, the popup, or either", | |
requires: { | |
mouseover_trigger_behavior: "mouse" | |
}, | |
options: { | |
_type: "or", | |
thumbnail: { | |
name: "Thumbnail" | |
}, | |
popup: { | |
name: "Popup" | |
}, | |
both: { | |
name: "Both" | |
} | |
}, | |
category: "popup", | |
subcategory: "close_behavior" | |
}, | |
mouseover_wait_use_el: { | |
name: "Use invisible element when waiting", | |
description: "Creates an invisible element under the cursor when waiting for the popup instead of a style element (legacy)", | |
requires: { | |
mouseover: true | |
}, | |
category: "popup", | |
subcategory: "popup_other", | |
advanced: true | |
}, | |
mouseover_zoom_behavior: { | |
name: "Popup default zoom", | |
description: "How the popup should be initially sized", | |
options: { | |
_type: "or", | |
_group1: { | |
fit: { | |
name: "Fit to screen" | |
} | |
}, | |
_group2: { | |
full: { | |
name: "Full size" | |
} | |
}, | |
_group3: { | |
custom: { | |
name: "Custom size" | |
} | |
} | |
}, | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_zoom_custom_percent: { | |
name: "Custom zoom percent", | |
description: "Custom percent to initially size the popup", | |
type: "number", | |
number_min: 0, | |
number_unit: "%", | |
requires: { | |
mouseover_zoom_behavior: "custom" | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_pan_behavior: { | |
name: "Popup panning method", | |
description: "How the popup should be panned when larger than the screen", | |
options: { | |
_type: "or", | |
movement: { | |
name: "Movement", | |
description: "The popup pans as you move your mouse" | |
}, | |
drag: { | |
name: "Drag", | |
description: "Clicking and dragging pans the popup" | |
} | |
}, | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
category: "popup", | |
subcategory: "behavior" | |
}, | |
mouseover_drag_min: { | |
name: "Minimum drag amount", | |
description: "How many pixels the mouse should move to start a drag", | |
type: "number", | |
number_min: 0, | |
number_int: true, | |
number_unit: "pixels", | |
requires: { | |
mouseover_pan_behavior: "drag" | |
}, | |
category: "popup", | |
subcategory: "behavior" | |
}, | |
mouseover_scroll_behavior: { | |
name: "Popup scroll action", | |
description: "How the popup reacts to a scroll/mouse wheel event", | |
options: { | |
_type: "or", | |
_group1: { | |
zoom: { | |
name: "Zoom" | |
}, | |
pan: { | |
name: "Pan" | |
}, | |
gallery: { | |
name: "Gallery" | |
} | |
}, | |
_group2: { | |
nothing: { | |
name: "None" | |
} | |
} | |
}, | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
category: "popup", | |
subcategory: "behavior" | |
}, | |
scroll_zoom_behavior: { | |
name: "Zoom behavior", | |
description: "How zooming should work", | |
options: { | |
_type: "or", | |
fitfull: { | |
name: "Fit/Full", | |
description: "Toggles between the full size, and fit-to-screen" | |
}, | |
incremental: { | |
name: "Incremental" | |
} | |
}, | |
requires: { | |
mouseover_scroll_behavior: "zoom" | |
}, | |
category: "popup", | |
subcategory: "behavior" | |
}, | |
mouseover_move_with_cursor: { | |
name: "Move with cursor", | |
description: "Moves the popup as the cursor moves", | |
requires: { | |
mouseover_open_behavior: "popup", | |
mouseover_trigger_behavior: "mouse" | |
}, | |
category: "popup", | |
subcategory: "behavior" | |
}, | |
zoom_out_to_close: { | |
name: "Zoom out fully to close", | |
description: "Closes the popup if you zoom out past the minimum zoom", | |
requires: { | |
mouseover_scroll_behavior: "zoom" | |
}, | |
category: "popup", | |
subcategory: "close_behavior" | |
}, | |
mouseover_position: { | |
name: "Popup position", | |
description: "Where the popup will appear", | |
options: { | |
_type: "or", | |
_group1: { | |
cursor: { | |
name: "Cursor middle", | |
description: "Underneath the mouse cursor" | |
} | |
}, | |
_group2: { | |
beside_cursor: { | |
name: "Beside cursor" | |
} | |
}, | |
_group3: { | |
center: { | |
name: "Page middle" | |
} | |
} | |
}, | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_prevent_cursor_overlap: { | |
name: "Prevent cursor overlap", | |
description: "Prevents the image from overlapping with the cursor", | |
requires: { | |
mouseover_position: "beside_cursor" | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_download: { | |
name: "Clicking image downloads", | |
description: "Instead of opening the link in a new tab, it will download the image instead", | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
category: "popup", | |
subcategory: "behavior" | |
}, | |
mouseover_download_key: { | |
name: "Download key", | |
description: "Downloads the image in the popup when this key is pressed", | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
type: "keysequence", | |
category: "popup", | |
subcategory: "behavior" | |
}, | |
mouseover_rotate_left_key: { | |
name: "Rotate left key", | |
description: "Rotates the popup 90 degrees to the left", | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
type: "keysequence", | |
category: "popup", | |
subcategory: "behavior" | |
}, | |
mouseover_rotate_right_key: { | |
name: "Rotate right key", | |
description: "Rotates the popup 90 degrees to the right", | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
type: "keysequence", | |
category: "popup", | |
subcategory: "behavior" | |
}, | |
mouseover_flip_horizontal_key: { | |
name: "Horizontal flip key", | |
description: "Flips the image horizontally", | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
type: "keysequence", | |
category: "popup", | |
subcategory: "behavior" | |
}, | |
mouseover_flip_vertical_key: { | |
name: "Vertical flip key", | |
description: "Flips the image vertically", | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
type: "keysequence", | |
category: "popup", | |
subcategory: "behavior" | |
}, | |
mouseover_links: { | |
name: "Popup for plain hyperlinks", | |
description: "Whether or not the popup should also open for plain hyperlinks", | |
requires: { | |
mouseover: true | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
mouseover_gallery_cycle: { | |
name: "Cycle gallery", | |
description: "Going to the previous image for the first image will lead to the last image and vice-versa", | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
category: "popup", | |
subcategory: "gallery" | |
}, | |
mouseover_gallery_prev_key: { | |
name: "Previous gallery item", | |
description: "Key to trigger the previous gallery item", | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
type: "keysequence", | |
category: "popup", | |
subcategory: "gallery" | |
}, | |
mouseover_gallery_next_key: { | |
name: "Next gallery item", | |
description: "Key to trigger the next gallery item", | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
type: "keysequence", | |
category: "popup", | |
subcategory: "gallery" | |
}, | |
mouseover_styles: { | |
name: "Popup CSS style", | |
description: "CSS style rules for the mouseover popup", | |
type: "textarea", | |
requires: { | |
mouseover_open_behavior: "popup" | |
}, | |
category: "popup", | |
subcategory: "popup_other" | |
}, | |
mouseover_apply_blacklist: { | |
name: "Don't popup blacklisted images", | |
description: "This option prevents a popup from appearing altogether for blacklisted images", | |
requires: { | |
mouseover: true | |
}, | |
category: "popup", | |
subcategory: "open_behavior" | |
}, | |
website_inject_imu: { | |
name: "Use userscript", | |
description: "Replaces the website's IMU instance with the userscript", | |
userscript_only: true, | |
category: "website" | |
}, | |
website_image: { | |
name: "Website image preview", | |
description: "Enables a preview of the image on the Image Max URL website", | |
userscript_only: true, | |
requires: { | |
website_inject_imu: true | |
}, | |
category: "website" | |
}, | |
extension_contextmenu: { | |
name: "IMU entry in context menu", | |
description: "Enables a custom entry for this extension in the right click/context menu", | |
extension_only: true, | |
category: "extension", | |
imu_enabled_exempt: true | |
}, | |
allow_video: { | |
name: "Videos", | |
description: "Allows videos to be returned", | |
category: "rules", | |
onupdate: update_rule_setting | |
}, | |
allow_watermark: { | |
name: "Larger watermarked images", | |
description: "Enables rules that return larger images that include watermarks", | |
category: "rules", | |
example_websites: [ | |
"Stock photo websites" | |
], | |
onupdate: update_rule_setting | |
}, | |
allow_smaller: { | |
name: "Smaller non-watermarked images", | |
description: "Enables rules that return smaller images without watermarks", | |
category: "rules", | |
onupdate: update_rule_setting | |
}, | |
allow_possibly_different: { | |
name: "Possibly different images", | |
description: "Enables rules that return images that possibly differ", | |
category: "rules", | |
example_websites: [ | |
"YouTube video thumbnails" | |
], | |
onupdate: update_rule_setting | |
}, | |
allow_possibly_broken: { | |
name: "Possibly broken images", | |
description: "Enables rules that return images that are possibly broken", | |
category: "rules", | |
example_websites: [ | |
"Tumblr GIFs" | |
], | |
onupdate: update_rule_setting | |
}, | |
allow_thirdparty: { | |
name: "Rules using 3rd-party websites", | |
description: "Enables rules that use 3rd-party websites", | |
category: "rules", | |
example_websites: [ | |
"Newsen" | |
], | |
onupdate: update_rule_setting | |
}, | |
allow_apicalls: { | |
name: "Rules using API calls", | |
description: "Enables rules that use API calls. Strongly recommended to keep this enabled", | |
category: "rules", | |
example_websites: [ | |
"Instagram", | |
"Flickr", | |
"..." | |
], | |
onupdate: update_rule_setting | |
}, | |
allow_thirdparty_libs: { | |
name: "Rules using 3rd-party libraries", | |
description: "Enables rules that use 3rd-party libraries", | |
description_userscript: "Enables rules that use 3rd-party libraries. There is a possible (but unlikely) security risk for the userscript version", | |
category: "rules", | |
example_websites: [ | |
"Sites using testcookie (slowAES)" | |
], | |
onupdate: function() { | |
update_rule_setting(); | |
real_api_cache.clear(); | |
} | |
}, | |
browser_cookies: { | |
name: "Use browser cookies", | |
description: "Uses the browser's cookies for API calls in order to access otherwise private data", | |
category: "rules", | |
example_websites: [ | |
"Private Flickr images" | |
], | |
// Until GM_Cookie is implemented | |
extension_only: true, | |
onupdate: update_rule_setting | |
}, | |
imgur_source: { | |
name: "Source image for Imgur", | |
description: "If a source image is found for Imgur, try using it instead", | |
category: "rule_specific", | |
onupdate: update_rule_setting | |
}, | |
instagram_use_app_api: { | |
name: "Use native API for Instagram", | |
description: "Uses Instagram's native API if possible, requires you to be logged into Instagram", | |
category: "rule_specific", | |
onupdate: update_rule_setting | |
}, | |
instagram_gallery_postlink: { | |
name: "Use albums for Instagram post thumbnails", | |
description: "Queries Instagram for albums when using the popup on a post thumbnail", | |
category: "rule_specific" | |
}, | |
tumblr_api_key: { | |
name: "Tumblr API key", | |
description: "API key for finding larger images on Tumblr", | |
category: "rule_specific", | |
type: "lineedit", | |
onupdate: update_rule_setting | |
}, | |
bigimage_blacklist: { | |
name: "Blacklist", | |
description: "A list of URLs that are blacklisted from being processed", | |
category: "rules", | |
type: "textarea", | |
onupdate: function() { | |
update_rule_setting(); | |
create_blacklist_regexes(); | |
}, | |
onedit: function() { | |
var errors = create_blacklist_regexes(); | |
var errordiv; | |
try { | |
errordiv = document.querySelector("#option_bigimage_blacklist .error"); | |
errordiv.innerText = ""; | |
} catch (e) { | |
} | |
if (errors) { | |
for (var i = 0; i < errors.length; i++) { | |
if (errordiv) | |
errordiv.innerText += errors[i].message + "\n"; | |
console.error(errors[i]); | |
} | |
} | |
}, | |
documentation: { | |
title: "Documentation", | |
value: [ | |
"The examples below are written for the simple (glob) engine, not the regex engine. The glob engine is generally based on the UNIX glob syntax.<br />", | |
"<ul><br />", | |
"<li><code>google.com</code> will block https://google.com/, https://www.google.com/, https://abcdef.google.com/, https://def.abc.google.com/, etc.</li>", | |
"<li><code>abc.google.com</code> will block https://abc.google.com/, https://def.abc.google.com/, etc.</li>", | |
"<li><code>*.google.com</code> will block https://www.google.com/, https://def.abc.google.com/, etc. but not https://google.com/</li>", | |
"<li><code>google.*/</code> will block https://google.com/, https://www.google.co.uk, etc.</li>", | |
"<li><code>http://google.com</code> will block http://google.com/, but not https://google.com/, http://www.google.com/, etc.</li>", | |
"<li><code>google.com/test</code> will block https://google.com/test, https://www.google.com/test/abcdef, but not https://google.com/, etc.</li>", | |
"<li><code>google.com/*/test</code> will block https://google.com/abc/test, but not https://google.com/test or https://google.com/abc/def/test</li>", | |
"<li><code>google.com/**/test</code> will block https://google.com/abc/test, https://google.com/abc/def/test, https://google.com/abc/def/ghi/test, etc. but not https://google.com/test</li>", | |
"<li><code>g??gle.com</code> will block https://google.com/, https://gaagle.com/, https://goagle.com/, etc.</li>", | |
"<li><code>google.{com,co.uk}</code> will block https://google.com/ and https://google.co.uk/</li>", | |
"<li><code>g[oau]ogle.com</code> will block https://google.com/, https://gaogle.com/, and http://www.guogle.com/</li>", | |
"<li><code>g[0-9]ogle.com</code> will block https://g0ogle.com/, https://g1ogle.com/, etc. (up to https://g9ogle.com/)</li>", | |
"</ul>" | |
].join("\n") | |
} | |
}, | |
bigimage_blacklist_engine: { | |
name: "Blacklist engine", | |
description: "How the blacklist should be processed", | |
category: "rules", | |
options: { | |
glob: { | |
name: "Simple (glob)" | |
}, | |
regex: { | |
name: "Regex" | |
} | |
} | |
}, | |
replaceimgs_auto: { | |
name: "Automatically replace images", | |
description: "Automatically replace images to larger versions on pages you view", | |
warning: { | |
"true": "This could lead to rate limiting or IP bans" | |
}, | |
// Auto-updating is disabled due to the warning above | |
needrefresh: true, | |
category: "extra", | |
subcategory: "replaceimages" | |
}, | |
replaceimgs_usedata: { | |
name: "Use data URLs", | |
description: "Uses data:// URLs instead of image links", | |
category: "extra", | |
subcategory: "replaceimages", | |
imu_enabled_exempt: true | |
}, | |
replaceimgs_wait_fullyloaded: { | |
name: "Wait until image is fully loaded", | |
description: "Waits until the image being replaced is fully loaded before moving on to the next image", | |
category: "extra", | |
subcategory: "replaceimages", | |
requires: { | |
replaceimgs_usedata: false | |
}, | |
imu_enabled_exempt: true | |
}, | |
replaceimgs_totallimit: { | |
name: "Max images to process at once", | |
description: "The maximum amount of images to process at once", | |
type: "number", | |
number_min: 1, | |
number_int: true, | |
number_unit: "images", | |
category: "extra", | |
subcategory: "replaceimages", | |
imu_enabled_exempt: true | |
}, | |
replaceimgs_domainlimit: { | |
name: "Max images per domain at once", | |
description: "The maximum amount of images per domain to process at once", | |
type: "number", | |
number_min: 1, | |
number_int: true, | |
number_unit: "images", | |
category: "extra", | |
subcategory: "replaceimages", | |
imu_enabled_exempt: true | |
}, | |
replaceimgs_replaceimgs: { | |
name: "Replace images", | |
description: "Replaces images to their larger versions when the button is pressed", | |
category: "extra", | |
subcategory: "replaceimages", | |
imu_enabled_exempt: true | |
}, | |
replaceimgs_addlinks: { | |
name: "Add links", | |
description: "Adds links around images if a link doesn't already exist", | |
category: "extra", | |
subcategory: "replaceimages", | |
imu_enabled_exempt: true | |
}, | |
replaceimgs_replacelinks: { | |
name: "Replace links", | |
description: "Replaces links if they already exist", | |
category: "extra", | |
subcategory: "replaceimages", | |
requires: { | |
replaceimgs_addlinks: true | |
}, | |
imu_enabled_exempt: true | |
}, | |
highlightimgs_enable: { | |
name: "Enable button", | |
description: "Enables the 'Highlight Images' button", | |
category: "extra", | |
subcategory: "highlightimages", | |
imu_enabled_exempt: true | |
}, | |
highlightimgs_auto: { | |
name: "Automatically highlight images", | |
description: "Automatically highlights images as you view pages", | |
options: { | |
_type: "or", | |
always: { | |
name: "Always" | |
}, | |
hover: { | |
name: "Hover", | |
description: "When hovering over an image" | |
}, | |
never: { | |
name: "Never" | |
} | |
}, | |
category: "extra", | |
subcategory: "highlightimages" | |
}, | |
highlightimgs_onlysupported: { | |
name: "Only explicitly supported images", | |
description: "Only highlights images that can be made larger or the original version can be found", | |
requires: [ | |
{highlightimgs_enable: true}, | |
{highlightimgs_auto: "always"}, | |
{highlightimgs_auto: "hover"} | |
], | |
category: "extra", | |
subcategory: "highlightimages" | |
}, | |
highlightimgs_css: { | |
name: "Highlight CSS", | |
description: "CSS style to apply for highlight", | |
type: "textarea", | |
requires: [ | |
{highlightimgs_enable: true}, | |
{highlightimgs_auto: "always"}, | |
{highlightimgs_auto: "hover"} | |
], | |
category: "extra", | |
subcategory: "highlightimages", | |
imu_enabled_exempt: true | |
} | |
}; | |
var option_to_problems = { | |
allow_watermark: "watermark", | |
allow_smaller: "smaller", | |
allow_possibly_different: "possibly_different", | |
allow_possibly_broken: "possibly_broken" | |
}; | |
var categories = { | |
"general": "category_general", | |
"redirection": "category_redirection", | |
"popup": "category_popup", | |
"rules": "category_rules", | |
"website": "category_website", | |
"extension": "category_extension", | |
"extra": "category_extra" | |
}; | |
var subcategories = { | |
"popup": { | |
"trigger": "subcategory_trigger", | |
"open_behavior": "subcategory_open_behavior", | |
"close_behavior": "subcategory_close_behavior", | |
"behavior": "subcategory_behavior", | |
"gallery": "subcategory_gallery", | |
"video": "subcategory_video", | |
"ui": "subcategory_ui", | |
"popup_other": "subcategory_popup_other" | |
}, | |
"rules": { | |
"rule_specific": "subcategory_rule_specific" | |
}, | |
"extra": { | |
"replaceimages": "subcategory_replaceimages", | |
"highlightimages": "subcategory_highlightimages" | |
} | |
}; | |
for (var option in option_to_problems) { | |
var problem = option_to_problems[option]; | |
settings[option] = default_options.exclude_problems.indexOf(problem) < 0; | |
} | |
var settings_history = {}; | |
function Cache() { | |
this.data = {}; | |
this.times = {}; | |
this.fetches = {}; | |
this.set = function(key, value, time) { | |
if (_nir_debug_) | |
console_log("Cache.set key=" + key + ", time=" + time + ", value:", deepcopy(value)); | |
this.remove(key); | |
this.data[key] = value; | |
if (typeof time === "number" && time > 0) { | |
var cache = this; | |
var timer = setTimeout(function() { | |
cache.remove(key); | |
}, time * 1000); | |
// Ensures the process can exit in node.js | |
if (is_node && "unref" in timer) { | |
timer.unref(); | |
} | |
this.times[key] = { | |
timer: timer, | |
time: time | |
}; | |
} | |
}; | |
this.has = function(key) { | |
if (_nir_debug_) | |
console_log("Cache.has key=" + key, key in this.data); | |
return (key in this.data); | |
}; | |
this.get = function(key) { | |
// TODO: maybe renew timeout per-get? | |
if (_nir_debug_) | |
console_log("Cache.get key=" + key, deepcopy(this.data[key])); | |
return this.data[key]; | |
}; | |
this.fetch = function(key, done, fetcher) { | |
if (_nir_debug_) | |
console_log("Cache.fetch key=" + key + ", exists=" + (key in this.data)); | |
if (!(key in this.data)) { | |
if (key in this.fetches) { | |
this.fetches[key].push(done); | |
} else { | |
this.fetches[key] = []; | |
fetcher(function(data, time) { | |
if (time !== false) | |
this.set(key, data, time); | |
done(data); | |
for (var i = 0; i < this.fetches[key].length; i++) { | |
this.fetches[key][i](data); | |
} | |
delete this.fetches[key]; | |
}.bind(this)); | |
} | |
} else { | |
done(this.data[key]); | |
} | |
}; | |
this.remove = function(key) { | |
if (_nir_debug_) | |
console_log("Cache.remove key=" + key); | |
if (key in this.times) { | |
clearTimeout(this.times[key].timer); | |
} | |
delete this.times[key]; | |
delete this.data[key]; | |
}; | |
this.clear = function() { | |
if (_nir_debug_) | |
console_log("Cache.clear"); | |
for (var key in this.times) { | |
clearTimeout(this.times[key].timer); | |
} | |
this.times = {}; | |
this.data = {}; | |
}; | |
}; | |
var url_cache = new Cache(); | |
var real_api_cache = new Cache(); | |
var lib_cache = new Cache(); | |
var cookie_cache = new Cache(); | |
var urlparse = function(x) { | |
return new URL(x); | |
}; | |
if (is_node && typeof URL === 'undefined') { | |
var url = require("url"); | |
urlparse = function(x) { | |
var parsed = url.parse(x); | |
parsed.searchParams = new Map(); | |
if (parsed.query) { | |
parsed.query.split("&").forEach(function (query) { | |
var splitted = query.split("="); | |
parsed.searchParams.set(splitted[0], splitted[1]); | |
}); | |
} | |
return parsed; | |
}; | |
} | |
var base64_decode = nullfunc; | |
if (is_node && typeof atob === 'undefined') { | |
base64_decode = function(a) { | |
return Buffer.from(a, 'base64').toString('binary'); | |
}; | |
} else if (typeof atob !== 'undefined') { | |
base64_decode = atob; | |
} | |
// https://stackoverflow.com/a/17323608 | |
function mod(n, m) { | |
return ((n % m) + m) % m; | |
} | |
function urlsplit(a) { | |
var protocol_split = a.split("://"); | |
var protocol = protocol_split[0]; | |
var splitted = protocol_split[1].split("/"); | |
var domain = splitted[0]; | |
var start = protocol + "://" + domain; | |
return { | |
protocol: protocol, | |
domain: domain, | |
url: a | |
}; | |
} | |
function urlnorm(a) { | |
var protocol_split = a.split("://"); | |
var splitted = protocol_split[1].split("/"); | |
var newsplitted = []; | |
for (var i = 0; i < splitted.length; i++) { | |
if (splitted[i] === "..") | |
newsplitted.pop(); | |
else | |
newsplitted.push(splitted[i]); | |
} | |
return protocol_split[0] + "://" + newsplitted.join("/"); | |
} | |
function urljoin(a, b, browser) { | |
if (b.length === 0) | |
return a; | |
if (b.match(/^[-a-z]*:\/\//) || b.match(/^(?:data|x-raw-image|blob):/)) | |
return b; | |
var protocol_split = a.split("://"); | |
var protocol = protocol_split[0]; | |
var splitted = protocol_split[1].split("/"); | |
var domain = splitted[0]; | |
var start = protocol + "://" + domain; | |
if (!browser) { | |
// simple path join | |
// urljoin("http://site.com/index.html", "file.png") = "http://site.com/index.html/file.png" | |
return a + "/" + b.replace(/^\/*/, ""); | |
} else { | |
if (b.length >= 2 && b.slice(0, 2) === "//") | |
return protocol + ":" + b; | |
if (b.length >= 1 && b.slice(0, 1) === "/") | |
return start + b; | |
// to emulate the browser's behavior instead | |
// urljoin("http://site.com/index.html", "file.png") = "http://site.com/file.png" | |
if (!a.match(/\/$/)) | |
a = a.replace(/^([^?]*)\/.*?$/, "$1/"); | |
return urlnorm(a + b.replace(/^\/*/, "")); | |
//return a.replace(/\/[^/]*$/, "/") + b.replace(/^\/*/, ""); | |
//return urlnorm(a.replace(/^([^?]*)\/.*?$/, "$1/") + b.replace(/^\/*/, "")); | |
} | |
} | |
var fullurl = function(url, x) { | |
if (x === undefined || x === null) | |
return x; | |
var a = document.createElement(a); | |
a.href = x; | |
return a.href; | |
}; | |
var fillobj_urls = function(urls, obj) { | |
var newobj = []; | |
for (var i = 0; i < urls.length; i++) { | |
var currentobj = deepcopy(obj); | |
currentobj.url = urls[i]; | |
newobj.push(currentobj); | |
} | |
return newobj; | |
}; | |
var add_full_extensions = function(obj, extensions) { | |
if (!extensions) | |
extensions = [ | |
"jpg", "jpeg", "png", "gif", "webp", | |
"JPG", "JPEG", "PNG", "GIF" | |
]; | |
if (!(obj instanceof Array)) { | |
obj = [obj]; | |
} | |
var result = []; | |
for (var i = 0; i < obj.length; i++) { | |
var currentobj = obj[i]; | |
var url = currentobj; | |
if (typeof currentobj !== "string") { | |
url = currentobj.url; | |
} | |
var regex = /(.*)\.([^/.]*)([?#].*)?$/; | |
if (!url.match(regex)) { | |
result.push(currentobj); | |
continue; | |
} | |
var ext = url.replace(regex, "$2"); | |
var basename = url.replace(regex, "$1"); | |
var query = url.replace(regex, "$3"); | |
//var result = [url]; | |
result.push(currentobj); | |
for (var i = 0; i < extensions.length; i++) { | |
if (ext === extensions[i]) | |
continue; | |
var currenturl = basename + "." + extensions[i] + query; | |
if (typeof currentobj === "string") { | |
result.push(currenturl); | |
} else { | |
var newobj = deepcopy(currentobj); | |
newobj.url = currenturl; | |
result.push(newobj); | |
} | |
} | |
} | |
return result; | |
}; | |
var add_extensions = function(url) { | |
return add_full_extensions(url, ["jpg", "png"]); | |
}; | |
var add_extensions_jpeg = function(url) { | |
return add_full_extensions(url, ["jpeg", "png"]); | |
}; | |
var add_extensions_with_jpeg = function(url) { | |
return add_full_extensions(url, ["jpg", "jpeg", "png"]); | |
}; | |
var add_extensions_gif = function(url) { | |
return add_full_extensions(url, ["jpg", "png", "gif"]); | |
}; | |
var add_extensions_upper = function(url) { | |
return add_full_extensions(url, ["jpg", "png", "JPG", "PNG"]); | |
}; | |
var add_extensions_upper_jpeg = function(url) { | |
return add_full_extensions(url, ["jpg", "jpeg", "png", "JPG", "JPEG", "PNG"]); | |
}; | |
var add_http = function(url) { | |
if (!url.match(/^[a-z]+:\/\//)) | |
return "http://" + url; | |
return url; | |
}; | |
var decodeuri_ifneeded = function(url) { | |
if (url.match(/^https?:\/\//)) | |
return url; | |
if (url.match(/^https?%3[aA]/)) | |
return decodeURIComponent(url); | |
if (url.match(/^https?%253[aA]/)) | |
return decodeURIComponent(decodeURIComponent(url)); | |
return url; | |
}; | |
// https://stackoverflow.com/a/10073788 | |
var zpadnum = function(n, width, z) { | |
z = z || '0'; | |
n = n + ''; | |
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; | |
} | |
// https://www.w3resource.com/javascript-exercises/javascript-string-exercise-28.php | |
function hex_to_ascii(str1) { | |
var hex = str1.toString(); | |
var str = ''; | |
for (var n = 0; n < hex.length; n += 2) { | |
str += String.fromCharCode(parseInt(hex.substr(n, 2), 16)); | |
} | |
return str; | |
} | |
function hex_to_numberarray(str) { | |
var result = []; | |
for (var i = 0; i < str.length; i += 2) { | |
result.push(parseInt(str.substr(i, 2), 16)); | |
} | |
return result; | |
} | |
function numberarray_to_hex(arr) { | |
var str = ""; | |
for (var i = 0; i < arr.length; i++) { | |
if (arr[i] < 16) | |
str += "0"; | |
str += arr[i].toString(16); | |
} | |
return str; | |
} | |
function reverse_str(str) { | |
return str.split("").reverse().join(""); | |
} | |
function decode_entities(str) { | |
return str | |
.replace(/ /g, " ") | |
.replace(/&#([0-9]+);/g, function (full, num) { return String.fromCharCode(num); }) | |
.replace(/&/g, "&"); | |
} | |
function remove_queries(url, queries) { | |
if (!(queries instanceof Array)) { | |
queries = [queries]; | |
} | |
var beforequery = url.replace(/^([^#]*?)\?(.*)$/, "$1"); | |
var afterquery = url.replace(/^([^#]*?)\?(.*)$/, "$2"); | |
// TODO: handle things like: ?a=b&c=b#&d=e | |
// no query string | |
if (beforequery === url) | |
return url; | |
var splitted = afterquery.split("&"); | |
var newsplitted = []; | |
for (var i = 0; i < splitted.length; i++) { | |
var property = splitted[i].replace(/^(.*?)=.*/, "$1"); | |
if (queries.indexOf(property) < 0) { | |
newsplitted.push(splitted[i]); | |
} | |
} | |
if (newsplitted.length === 0) { | |
afterquery = ""; | |
} else { | |
afterquery = "?" + newsplitted.join("&"); | |
} | |
return beforequery + afterquery; | |
} | |
function fuzzify_text(str) { | |
return str | |
.replace(/(?:[-=_!?$#"'’‘”“]|\[|])/g, " ") | |
.replace(/\s+/g, " ") | |
.replace(/^\s+|\s+$/g, ""); | |
} | |
function version_compare(a, b) { | |
var version_regex = /^[0-9]+(\.[0-9]+){1,}$/; | |
if (!version_regex.test(a) || | |
!version_regex.test(b)) | |
return null; | |
var a_split = a.split("."); | |
var b_split = b.split("."); | |
if (a_split.length !== b_split.length) | |
return null; | |
for (var i = 0; i < a_split.length; i++) { | |
var an = parseInt(a_split[i]); | |
var bn = parseInt(b_split[i]); | |
if (an < bn) | |
return 1; | |
if (an > bn) | |
return -1; | |
} | |
return 0; | |
} | |
function _fuzzy_compare_rollover(a, b, lim) { | |
if (a === b) | |
return true; | |
if (a - 1 === b || a + 1 === b) | |
return true; | |
for (var i = 0; i < lim.length; i++) { | |
if (a === lim[i]) { | |
if (b === 1) | |
return true; | |
} else if (b === lim[i]) { | |
if (a === 1) | |
return true; | |
} | |
} | |
return false; | |
} | |
function _is_larger_rollover(a, b, end) { | |
if (a === 1 && end.indexOf(b) >= 0) | |
return true; | |
if (b === 1 && end.indexOf(a) >= 0) | |
return true; | |
return false; | |
} | |
function fuzzy_date_compare(a, b) { | |
if (a === b) | |
return true; | |
if (a.length !== 8 || b.length !== 8) | |
return false; | |
var a_d = parseInt(a.substr(6, 2)); | |
var b_d = parseInt(b.substr(6, 2)); | |
if (!_fuzzy_compare_rollover(a_d, b_d, [28, 29, 30, 31])) | |
return false; | |
var a_m = parseInt(a.substr(4, 2)); | |
var b_m = parseInt(b.substr(4, 2)); | |
var d_rollover = _is_larger_rollover(a_d, b_d, [28, 29, 30, 31]); | |
if (a_m !== b_m) { | |
if (!d_rollover) | |
return false; | |
if (!_fuzzy_compare_rollover(a_m, b_m, [12])) | |
return false; | |
} | |
var a_y = parseInt(a.substr(0, 4)); | |
var b_y = parseInt(b.substr(0, 4)); | |
if (a_y !== b_y) { | |
if (!d_rollover || !_is_larger_rollover(a_m, b_m, [12])) | |
return false; | |
if (!_fuzzy_compare_rollover(a_y, b_y, [])) | |
return false; | |
} | |
return true; | |
} | |
function run_soon(func) { | |
setTimeout(func, 1); | |
} | |
// bug in chrome, see | |
// https://github.com/qsniyg/maxurl/issues/7 | |
// https://our.umbraco.org/forum/using-umbraco-and-getting-started/91715-js-error-when-aligning-content-left-center-right-justify-in-richtext-editor | |
if (is_node || true) { | |
fullurl = function(url, x) { | |
return urljoin(url, x); | |
}; | |
} | |
var blacklist_regexes = []; | |
function update_rule_setting() { | |
url_cache.clear(); | |
} | |
function create_blacklist_regexes() { | |
blacklist_regexes = []; | |
var blacklist = settings.bigimage_blacklist || ""; | |
if (typeof blacklist !== "string") | |
return; | |
blacklist = blacklist.split("\n"); | |
for (var i = 0; i < blacklist.length; i++) { | |
var current = blacklist[i].replace(/^\s+|\s+$/, ""); | |
//console_log(current); | |
if (current.length === 0) | |
continue; | |
if (settings.bigimage_blacklist_engine === "regex") { | |
try { | |
blacklist_regexes.push(new RegExp(current)); | |
} catch (e) { | |
return [e]; | |
} | |
} else if (settings.bigimage_blacklist_engine === "glob") { | |
var newcurrent = ""; | |
var sbracket = -1; | |
var cbracket = -1; | |
for (var j = 0; j < current.length; j++) { | |
if (sbracket >= 0) { | |
if (current[j] === "]") { | |
newcurrent += current.substr(sbracket, j - sbracket + 1); | |
sbracket = -1; | |
} | |
continue; | |
} | |
if (cbracket >= 0) { | |
if (current[j] === "}") { | |
var options = current.substr(cbracket + 1, j - cbracket - 1).split(","); | |
var newoptions = []; | |
for (var k = 0; k < options.length; k++) { | |
newoptions.push(options[k].replace(/(.)/g, "[$1]")); | |
} | |
if (newoptions.length > 0 && (newoptions.length > 1 || newoptions[0].length > 0)) | |
newcurrent += "(?:" + newoptions.join("|") + ")"; | |
cbracket = -1; | |
} | |
continue; | |
} | |
if (current[j] !== "*") { | |
if (current[j] === "{") { | |
cbracket = j; | |
} else if (current[j] === "[") { | |
sbracket = j; | |
} else if (current[j] === "?") { | |
newcurrent += "[^/]"; | |
} else if (current[j] === ".") { | |
newcurrent += "\\."; | |
} else { | |
newcurrent += current[j]; | |
} | |
continue; | |
} | |
var doublestar = false; | |
if ((j + 1) < current.length) { | |
if (current[j+1] === "*") { | |
doublestar = true; | |
j++; | |
} | |
} | |
if (doublestar) | |
newcurrent += ".+"; | |
else | |
newcurrent += "[^/]+"; | |
} | |
current = newcurrent; | |
if (current[0] !== "*") { | |
newcurrent = current.replace(/^[a-z]*:\/\//, "[a-z]+://"); | |
if (newcurrent !== current) { | |
current = newcurrent; | |
} else { | |
current = "[a-z]+://[^/]*" + current; | |
} | |
} | |
current = "^" + current; | |
try { | |
blacklist_regexes.push(new RegExp(current)); | |
} catch (e) { | |
return [e]; | |
} | |
} | |
} | |
//console_log(blacklist_regexes); | |
} | |
var parse_headers = function(headerstr) { | |
var headers = []; | |
var splitted = headerstr.split("\r\n"); | |
for (var i = 0; i < splitted.length; i++) { | |
var header_name = splitted[i].replace(/^\s*([^:]*?)\s*:[\s\S]*/, "$1").toLowerCase(); | |
var header_value = splitted[i].replace(/^[^:]*?:\s*([\s\S]*?)\s*$/, "$1"); | |
if (header_name === splitted[i] || header_value === splitted[i]) | |
continue; | |
var value_split = header_value.split("\n"); | |
for (var j = 0; j < value_split.length; j++) { | |
headers.push({name: header_name, value: value_split[j]}); | |
} | |
} | |
if (_nir_debug_) | |
console_log("parse_headers", headerstr, deepcopy(headers)); | |
return headers; | |
}; | |
var headers_list_to_dict = function(headers) { | |
var dict = {}; | |
for (var i = 0; i < headers.length; i++) { | |
dict[headers[i].name.toLowerCase()] = headers[i].value; | |
} | |
return dict; | |
}; | |
var parse_cookieheader = function(cookieheader) { | |
var cookies = {}; | |
do { | |
var match = cookieheader.match(/^\s*([^=]*?)\s*=\s*([^;]*?)\s*(?:;\s*(.*))?$/); | |
if (!match) | |
break; | |
cookies[match[1]] = match[2]; | |
cookieheader = match[3]; | |
} while (cookieheader); | |
if (_nir_debug_) | |
console_log("parse_cookieheader", cookieheader, deepcopy(cookies)); | |
return cookies; | |
}; | |
var create_cookieheader_from_headers = function(headers, cookieheader) { | |
headers = parse_headers(headers); | |
var cookies = {}; | |
for (var i = 0; i < headers.length; i++) { | |
if (headers[i].name !== "set-cookie") | |
continue; | |
var cookie_match = headers[i].value.match(/^\s*([^=]*?)\s*=\s*([^;]*?)\s*;.*/); | |
if (!cookie_match) { | |
console_error("Unable to match cookie: ", headers[i]); | |
continue; | |
} | |
cookies[cookie_match[1]] = cookie_match[2]; | |
} | |
if (_nir_debug_) | |
console_log("create_cookieheader_from_headers", headers, cookieheader, deepcopy(cookies)); | |
if (cookieheader) { | |
var parsed = parse_cookieheader(cookieheader); | |
for (var key in parsed) { | |
if (!(key in cookies)) { | |
cookies[key] = parsed[key]; | |
} | |
} | |
} | |
var cookies_array = []; | |
for (var key in cookies) { | |
cookies_array.push(key + "=" + cookies[key]); | |
} | |
return cookies_array.join("; "); | |
}; | |
// https://stackoverflow.com/a/18639999 | |
var makeCRCTable = function() { | |
var c; | |
var crcTable = []; | |
for (var n =0; n < 256; n++) { | |
c = n; | |
for (var k =0; k < 8; k++) { | |
c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1)); | |
} | |
crcTable[n] = c; | |
} | |
return crcTable; | |
}; | |
var cached_crc_table = null; | |
var crc32 = function(str) { | |
var crcTable = cached_crc_table || (cached_crc_table = makeCRCTable()); | |
var crc = 0 ^ (-1); | |
for (var i = 0; i < str.length; i++) { | |
crc = (crc >>> 8) ^ crcTable[(crc ^ str.charCodeAt(i)) & 0xFF]; | |
} | |
return (crc ^ (-1)) >>> 0; | |
}; | |
var lib_urls = { | |
"testcookie_slowaes": { | |
url: "https://raw.githubusercontent.com/qsniyg/maxurl/5af5c0e8bd18fb0ae716aac04ac42992d2ddc2e5/lib/testcookie_slowaes.js", | |
size: 31248, | |
crc32: 2955697328, | |
crc32_size: 4174899014 | |
} | |
}; | |
var get_library = function(name, options, cb) { | |
if (!options.allow_thirdparty_libs) | |
return cb(null); | |
if (is_scripttag) { | |
return cb(null); | |
} else if (is_node) { | |
try { | |
var lib = require("./lib/" + name + ".js"); | |
return cb(lib); | |
} catch (e) { | |
console.error(e); | |
return cb(null); | |
} | |
} | |
var do_request = options.do_request; | |
if (is_extension || is_userscript) { | |
// Unfortunately in these cases it's less clean | |
// Without building separate version of this for each use case, we have to fall back on "eval"ing (through `new Function`) | |
lib_cache.fetch(name, cb, function (done) { | |
if (is_extension) { | |
// Thankfully in this case can query directly from the extension, removing possibility for XSS | |
extension_send_message({ | |
type: "get_lib", | |
data: { | |
name: name | |
} | |
}, function (response) { | |
if (!response || !response.data || !response.data.text) | |
return done(null, 0); // 0 instead of false because it will never be available | |
done(new Function(response.data.text + ";return lib_export;")(), 0); | |
}); | |
} else { | |
if (!(name in lib_urls)) { | |
return done(null, 0); | |
} | |
var lib_url = lib_urls[name]; | |
// For the userscript, we have no other choice than to query and run arbitrary JS. | |
// The commit is specified in lib_urls in order to prevent possible incompatibilities. | |
// Unfortunately this still cannot prevent a very dedicated hostile takeover. | |
// This is why we use the dual CRC32 check. Not bulletproof, but much better than nothing. | |
// On my system it takes 6ms to do both CRC32 checks, so performance isn't an issue. | |
do_request({ | |
method: "GET", | |
url: lib_url.url, | |
headers: { | |
Referer: "" | |
}, | |
onload: function(result) { | |
if (result.readyState !== 4) | |
return; | |
if (result.status !== 200) | |
return done(null, false); | |
if (result.responseText.length !== lib_url.size) { | |
console_error("Wrong response length for " + name + ": " + result.responseText.length + " (expected " + lib_url.size + ")"); | |
return done(null, false); | |
} | |
var crc = crc32(result.responseText); | |
if (crc !== lib_url.crc32) { | |
console_error("Wrong crc32 for " + name + ": " + crc + " (expected " + lib_url.crc32 + ")"); | |
return done(null, false); | |
} | |
crc = crc32(result.reponseText + (lib_url.size + "")); | |
if (crc !== lib_url.crc32_size) { | |
console_error("Wrong crc32 #2 for " + name + ": " + crc + " (expected " + lib_url.crc32_size + ")"); | |
return done(null, false); | |
} | |
done(new Function(result.responseText + ";return lib_export;")(), 0); | |
} | |
}); | |
} | |
}); | |
} else { | |
return cb(null); | |
} | |
}; | |
var common_functions = {}; | |
common_functions.fetch_imgur_webpage = function(do_request, api_cache, headers, url, cb) { | |
var cache_key = "imgur_webpage:" + url.replace(/^https?:\/\/(?:www\.)?imgur/, "imgur").replace(/[?#].*/, ""); | |
var apply_headers = false; | |
var real_fetch = function(done) { | |
var request_headers; | |
if (apply_headers) | |
request_headers = headers; | |
do_request({ | |
url: url.replace(/^http:/, "https:"), | |
method: "GET", | |
headers: request_headers, | |
onload: function(resp) { | |
if (resp.readyState !== 4) | |
return; | |
if (resp.status !== 200) { | |
console_error("Bad status for Imgur: " + resp.status); | |
return done(null, false); | |
} | |
var ogvideo, ogimage; | |
var ogmatch = resp.responseText.match(/<meta\s+property=["']og:video["']\s+content=["'](.*?)["']/); | |
if (ogmatch) { | |
ogvideo = decode_entities(ogmatch[1]).replace(/\?.*/, ""); | |
} | |
ogmatch = resp.responseText.match(/<meta\s+property=["']og:image["']\s+content=["'](.*?)["']/); | |
if (ogmatch) { | |
ogimage = decode_entities(ogmatch[1]).replace(/\?.*/, ""); | |
} | |
var retobj = { | |
ogvideo: ogvideo, | |
ogimage: ogimage | |
}; | |
var imageinfo; | |
var match = resp.responseText.match(/\.\s*mergeConfig\s*\(\s*["']gallery["']\s*,\s*{[\s\S]+?image\s*:\s*({.*?})\s*,\s*\n/); | |
if (!match) { | |
var nsfwmatch = resp.responseText.match(/<a.*?btn-wall--yes.*?\.signin\(/); | |
var msg = "Unable to find match for Imgur page"; | |
if (nsfwmatch) { | |
msg += " (it's probably NSFW and you aren't logged in)"; | |
} | |
console_warn(msg); | |
if (headers && !apply_headers) { | |
console_log("Retrying with custom headers"); | |
apply_headers = true; | |
return real_fetch(done); | |
} | |
// Only cache it for 15 seconds (helpful if the user logs in) | |
done(retobj, 15); | |
} else { | |
imageinfo = match[1]; | |
try { | |
imageinfo = JSON_parse(imageinfo); | |
retobj.imageinfo = imageinfo; | |
if (imageinfo.source && imageinfo.hash && !imageinfo.is_album) { | |
api_cache.set("imgur_imageinfo:" + imageinfo.hash, imageinfo, 6*60*60); | |
} | |
} catch (e) { | |
console_error(e); | |
console_log(match); | |
imageinfo = undefined; | |
} | |
done(retobj, 6*60*60); | |
}; | |
} | |
}); | |
}; | |
api_cache.fetch(cache_key, cb, real_fetch); | |
}; | |
common_functions.deviantart_page_from_id = function(do_request, api_cache, id, cb) { | |
var cache_key = "deviantart_page_from_id:" + id; | |
api_cache.fetch(cache_key, cb, function (done) { | |
do_request({ | |
method: "GET", | |
url: "http://fav.me/" + id, | |
onload: function (result) { | |
if (result.status !== 200) { | |
console_log(cache_key, result); | |
return done(null, false); | |
} | |
done(result, 60 * 60); | |
} | |
}); | |
}); | |
}; | |
common_functions.wix_image_info = function(url) { | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/06653b48-43c3-403f-9d72-c1c5519db560/ddl6lkp-cde05779-5a0a-47d8-8d43-f31a063fd30e.jpg/v1/fill/w_623,h_350,q_100/into_the_light_by_pajunen_ddl6lkp-350t.jpg | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/faa48d2d-12c2-43d1-bf23-b5e99857825b/ddo0eau-c742e0f9-07f9-4a22-8d47-933e9fd3fb2b.png/v1/crop/w_244,h_350,x_0,y_0,scl_0.066812705366922,q_70,strp/railway_road_to_the_stars_by_ellysiumn_ddo0eau-350t.jpg | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/e04c7e93-4504-4dbe-91f9-fd353fc145f2/dcx503r-30c02b72-c26d-4732-9c9f-14fcbc633aaa.jpg | |
var match = url.match(/^[a-z]+:\/\/[^/]+\/+(?:intermediary\/+)?f\/+[-0-9a-f]{20,}\/+[^/]+(?:[?#].*)?$/); | |
if (match) { | |
return { | |
original: true | |
}; | |
} | |
var match = url.match(/^[a-z]+:\/\/[^/]+\/+(?:intermediary\/+)?f\/+[-0-9a-f]{20,}\/+[^/]+\/+v1\/+(?:fit|fill|crop)\/+([^/]+)\/+[^/]+(?:[?#].*)?$/); | |
if (!match) { | |
return null; | |
} | |
var infostr = match[1]; | |
var splitted = infostr.split(","); | |
var obj = {}; | |
for (var i = 0; i < splitted.length; i++) { | |
if (splitted[i].match(/^[a-z]+$/)) { | |
obj[splitted[i]] = true; | |
continue; | |
} | |
var name = splitted[i].replace(/_.*$/, ""); | |
var value = splitted[i].replace(/^.*?_/, ""); | |
if (value.match(/^[-0-9.]+$/)) | |
value = parseFloat(value); | |
obj[name] = value; | |
} | |
if (obj.w && obj.h) { | |
obj.pixels = obj.w * obj.h; | |
} | |
return obj; | |
}; | |
common_functions.wix_compare = function(url1, url2) { | |
if (_nir_debug_) | |
console_log("wix_compare", url1, url2); | |
if (!url2) | |
return url1; | |
var info1 = common_functions.wix_image_info(url1); | |
var info2 = common_functions.wix_image_info(url2); | |
if (!info1 || !info2) | |
return null; | |
if (info1.original) | |
return url1; | |
if (info2.original) | |
return url2; | |
if (info1.pixels && info2.pixels) { | |
if (info1.pixels > info2.pixels) | |
return url1; | |
else if (info2.pixels > info1.pixels) | |
return url2; | |
else if (info1.q && info2.q) { | |
if (info1.q > info2.q) { | |
return url1; | |
} else if (info2.q > info1.q) { | |
return url2; | |
} | |
} | |
} | |
return null; | |
}; | |
common_functions.deviantart_fullimage = function(options, api_cache, src, id, cb) { | |
common_functions.deviantart_page_from_id(options.do_request, api_cache, id, function(result) { | |
if (!result) { | |
return cb(null); | |
} | |
var obj = { | |
url: null, | |
waiting: false, | |
extra: { | |
page: result.finalUrl | |
} | |
}; | |
if (!src.match(/:\/\/[^/]*\/fake_image\//)) | |
obj.url = src; | |
var deviationid = result.finalUrl.replace(/.*-([0-9]+)(?:[?#].*)?$/, "$1"); | |
if (deviationid === result.finalUrl) | |
deviationid = null; | |
// Support the redesign | |
var initialstate = result.responseText.match(/window\.__INITIAL_STATE__\s*=\s*JSON\.parse\((".*")\);\s*(?:window\.|<\/script)/); | |
if (initialstate && deviationid) { | |
initialstate = JSON_parse(JSON_parse(initialstate[1])); | |
//console_log(initialstate); | |
try { | |
var deviation = initialstate["@@entities"].deviation[deviationid]; | |
//console_log(deviation); | |
var maxurl = obj.url; | |
var files = deviation.files; | |
if (files instanceof Array) { | |
for (var i = files.length - 1; i >= 0; i--) { | |
var current = files[i]; | |
var newurl = common_functions.wix_compare(current.src, maxurl); | |
if (newurl === current.src) | |
maxurl = newurl; | |
} | |
} else if ("media" in deviation && deviation.media.types instanceof Array) { | |
var types = deviation.media.types; | |
for (var i = types.length - 1; i >= 0; i--) { | |
// Occasionally this exists for some images, where it instead has: | |
// s: "https://st.deviantart.net/misc/noentrythumb-200.png" (for t: "social_preview") | |
if (!types[i].c) | |
continue; | |
var link = deviation.media.baseUri + "/" + types[i].c.replace("<prettyName>", deviation.media.prettyName) + "?token=" + deviation.media.token[0]; | |
var newurl = common_functions.wix_compare(link, maxurl); | |
if (newurl === link) | |
maxurl = newurl; | |
} | |
} | |
obj.url = maxurl; | |
if (common_functions.wix_image_info(obj.url).original) { | |
obj.is_original = true; | |
return cb(obj); | |
} | |
} catch (e) { | |
console_error(e); | |
} | |
} | |
try { | |
var hrefre = /href=["'](https?:\/\/www\.deviantart\.com\/+download\/+[0-9]+\/+[^/>'"]*?)["']/; | |
var match = result.responseText.match(hrefre); | |
if (!match) { | |
console_error("No public download for " + src); | |
// This will occasionally scale down the image | |
// Broken for the site redesign | |
if (false) { | |
try { | |
var hrefre = /<img[^>]*?src=["'](https?:\/\/(?:images-wixmp)[^>'"]*?)["'][^>]*class=["']dev-content-/g; | |
var match = result.responseText.match(hrefre); | |
if (match) { | |
var maxres = 0; | |
var maxurl = null; | |
for (var i = 0; i < match.length; i++) { | |
var whmatch = match[i].match(/width=["']?([0-9]+)/); | |
var oururl = match[i].match(/\ssrc=['"](http[^'"]*)/); | |
if (!oururl) | |
continue; | |
oururl = oururl[1]; | |
var base = 0; | |
if (!whmatch) | |
continue; | |
base = parseInt(whmatch[1]); | |
whmatch = match[i].match(/height=["']?([0-9]+)/); | |
if (!whmatch) | |
continue; | |
base *= parseInt(whmatch[1]); | |
if (base > maxres) { | |
maxres = maxres; | |
maxurl = oururl; | |
} | |
} | |
if (maxurl && | |
maxurl.replace(/\?.*/) !== src.replace(/\?.*/)) { | |
var compare = common_functions.wix_compare(maxurl, src); | |
if (compare === maxurl) { | |
obj.url = maxurl; | |
obj.likely_broken = false; | |
return cb(obj); | |
} | |
} | |
} else { | |
console_error("No image found (this is likely a bug)"); | |
} | |
return cb(obj) | |
} catch (e) { | |
console_error(e); | |
return cb(obj); | |
} | |
} else { | |
return cb(obj); | |
} | |
return; | |
} | |
var href = match[1].replace("&", "&"); | |
options.do_request({ | |
method: "HEAD", | |
url: href, | |
onload: function (result) { | |
if (result.status !== 200 && result.status !== 405) { | |
console_log("Error fetching DeviantArt download link:"); | |
console_log(result); | |
return cb(obj); | |
} | |
var finalurl = result.finalUrl; | |
if (finalurl.match(/^[a-z]+:\/\/(?:www\.)?deviantart\.com\/+users\/+outgoing\?/)) { | |
finalurl = finalurl.replace(/^[a-z]+:\/\/(?:www\.)?deviantart\.com\/+users\/+outgoing\?/, ""); | |
} | |
obj.url = finalurl; | |
obj.likely_broken = false; | |
return cb(obj); | |
} | |
}); | |
} catch (e) { | |
console_error(e); | |
return cb(obj); | |
} | |
}); | |
} | |
common_functions.get_testcookie_cookie = function(options, api_cache, site, cb) { | |
var cache_key = "testcookie_cookie:" + site; | |
var do_request = options.do_request; | |
api_cache.fetch(cache_key, cb, function (done) { | |
get_library("testcookie_slowaes", options, function (lib) { | |
if (!lib) { | |
console_error(cache_key, "Unable to fetch patched slowAES library"); | |
return done(null, false); | |
} | |
do_request({ | |
method: "GET", | |
url: site, | |
headers: { | |
Referer: "", | |
Cookie: "" | |
}, | |
onload: function (result) { | |
if (result.readyState !== 4) | |
return; | |
if (result.status !== 200) { | |
console_log(cache_key, result); | |
return done(null, false); | |
} | |
var matches = result.responseText.match(/[a-z]=\s*toNumbers\(["'][0-9a-f]+["']/g); | |
if (matches.length === 0) { | |
console_log(cache_key, "Unable to find toNumbers match", result); | |
return done(null, false); | |
} | |
var vartable = {}; | |
for (var i = 0; i < matches.length; i++) { | |
var match = matches[i].match(/([a-z])=toNumbers\(["']([0-9a-f]+)["']/); | |
vartable[match[1]] = hex_to_numberarray(match[2]); | |
} | |
var slowaesmatch = result.responseText.match(/slowAES\.decrypt\s*\(\s*(.)\s*,\s*(.)\s*,\s*(.)\s*,\s*(.)\s*\)/); | |
if (!slowaesmatch) { | |
console_log(cache_key, "Unable to find slowAES match", result); | |
return done(null, false); | |
} | |
var cookiename = result.responseText.match(/document\.cookie\s*=\s*["']([^='"]*?)=/); | |
if (!cookiename) { | |
console_log(cache_key, "Unable to find cookie name match", result); | |
return done(null, false); | |
} else { | |
cookiename = cookiename[1]; | |
} | |
var getarg = function(x) { | |
if (/[a-z]/.test(x)) | |
return vartable[x]; | |
return parseInt(x); | |
}; | |
var cookievalue = numberarray_to_hex(lib.decrypt( | |
getarg(slowaesmatch[1]), getarg(slowaesmatch[2]), | |
getarg(slowaesmatch[3]), getarg(slowaesmatch[4]))); | |
done(cookiename + "=" + cookievalue, 6*60*60); | |
} | |
}); | |
}); | |
}); | |
}; | |
common_functions.instagram_username_from_sharedData = function(json) { | |
if (json.username) | |
return json.username; | |
else { | |
var entrydata = json.entry_data; | |
if (entrydata.ProfilePage) | |
return entrydata.ProfilePage[0].graphql.user.username; | |
else | |
return entrydata.PostPage[0].graphql.shortcode_media.owner.username; | |
} | |
}; | |
common_functions.instagram_get_imageid = function(image_url) { | |
if (!image_url) | |
return image_url; | |
return image_url.replace(/.*\/([^/.]*)\.[^/.]*(?:[?#].*)?$/, "$1"); | |
}; | |
common_functions.instagram_parse_el_info = function(api_cache, do_request, use_app_api, info, cb) { | |
var query_ig = function(url, cb) { | |
// Normalize the URL to reduce duplicate cache checks | |
url = url | |
.replace(/[?#].*/, "") | |
.replace(/([^/])$/, "$1/") | |
.replace(/^http:/, "https:") | |
.replace(/(:\/\/)(instagram\.com\/)/, "$1www.$2") | |
.replace(/(:\/\/.*?)\/\/+/g, "$1/"); | |
var cache_key = "instagram_sharedData_query:" + url; | |
api_cache.fetch(cache_key, cb, function (done) { | |
do_request({ | |
method: "GET", | |
url: url, | |
onload: function (result) { | |
if (result.readyState !== 4) | |
return; | |
try { | |
var text = result.responseText; | |
var regex1 = /window\._sharedData = *(.*?);?<\/script>/; | |
var regex2 = /window\._sharedData *= *(.*?}) *;[\s]*window\.__initialDataLoaded/; | |
var match = text.match(regex1); | |
if (!match) { | |
match = text.match(regex2); | |
} | |
var parsed = JSON_parse(match[1]); | |
var regex3 = /window\.__additionalDataLoaded\(["'].*?["']\s*,\s*({.*?})\);?\s*<\/script>/; | |
match = text.match(regex3); | |
if (match) { | |
var parsed1 = JSON_parse(match[1]); | |
for (var key in parsed.entry_data) { | |
if (parsed.entry_data[key] instanceof Array) { | |
parsed.entry_data[key][0] = overlay_object(parsed.entry_data[key][0], parsed1); | |
} | |
} | |
} | |
// TODO: maybe check if parsed is correct before setting to cache? | |
done(parsed, 60 * 60); | |
} catch (e) { | |
console_log("instagram_sharedData", result); | |
console_error("instagram_sharedData", e); | |
done(null, false); | |
} | |
} | |
}); | |
}); | |
}; | |
var uid_from_sharedData = function(json) { | |
if (json.id) | |
return json.id; | |
else { | |
var entrydata = json.entry_data; | |
if (entrydata.ProfilePage) | |
return entrydata.ProfilePage[0].graphql.user.id; | |
else | |
return entrydata.PostPage[0].graphql.shortcode_media.owner.id; | |
} | |
}; | |
var username_to_uid = function(username, cb) { | |
if (username.match(/^http/)) { | |
username = username.replace(/^[a-z]+:\/\/[^/]*\/+(?:stories\/+)?([^/]*)(?:\/.*)?(?:[?#].*)?$/, "$1"); | |
} | |
var cache_key = "instagram_username_uid:" + username; | |
api_cache.fetch(cache_key, cb, function (done) { | |
query_ig("https://www.instagram.com/" + username + "/", function (json) { | |
try { | |
done(uid_from_sharedData(json), 5*60); | |
} catch (e) { | |
console_error(cache_key, e); | |
done(null, false); | |
} | |
}); | |
}); | |
}; | |
var uid_to_profile = function(uid, cb) { | |
var cache_key = "instagram_uid_to_profile:" + uid; | |
api_cache.fetch(cache_key, cb, function (done) { | |
var url = "https://i.instagram.com/api/v1/users/" + uid + "/info/"; | |
app_api_call(url, function (result) { | |
if (result.readyState !== 4) | |
return; | |
try { | |
var parsed = JSON_parse(result.responseText).user; | |
// 5 minutes since they can change their profile pic often | |
done(parsed, 5 * 60); | |
} catch (e) { | |
console_log("instagram_uid_to_profile", result); | |
console_error("instagram_uid_to_profile", e); | |
done(null, false); | |
} | |
}); | |
}); | |
}; | |
var get_instagram_cookies = function(cb) { | |
// For now, we'll disable this as it doesn't appear to be needed | |
if (true) { | |
cb(null); | |
} else { | |
var cookie_cache_key = "instagram"; | |
if (cookie_cache.has(cookie_cache_key)) { | |
return cb(cookie_cache.get(cookie_cache_key)); | |
} | |
if (options.get_cookies) { | |
options.get_cookies("https://www.instagram.com/", function(cookies) { | |
cookie_cache.set(cookie_cache_key, cookies); | |
cb(cookies); | |
}); | |
} else { | |
cb(null); | |
} | |
} | |
}; | |
var app_api_call = function (url, cb) { | |
var headers = { | |
//"User-Agent": "Instagram 10.26.0 (iPhone7,2; iOS 10_1_1; en_US; en-US; scale=2.00; gamut=normal; 750x1334) AppleWebKit/420+", | |
"User-Agent": "Instagram 10.26.0 Android (23/6.0.1; 640dpi; 1440x2560; samsung; SM-G930F; herolte; samsungexynos8890; en_US)", | |
"X-IG-Capabilities": "36oD", | |
"Accept": "*/*", | |
"Accept-Language": "en-US,en;q=0.8" | |
}; | |
get_instagram_cookies(function(cookies) { | |
if (cookies) { | |
headers.Cookie = cookies_to_httpheader(cookies); | |
} | |
if (!use_app_api) | |
headers.Cookie = ""; | |
do_request({ | |
method: "GET", | |
url: url, | |
headers: headers, | |
onload: cb | |
}); | |
}); | |
}; | |
var mediainfo_api = function(id, cb) { | |
if (!use_app_api) | |
return cb(null); | |
var cache_key = "instagram_mediainfo:" + id; | |
api_cache.fetch(cache_key, cb, function (done) { | |
var url = "https://i.instagram.com/api/v1/media/" + id + "/info/"; | |
app_api_call(url, function (result) { | |
if (result.readyState !== 4) | |
return; | |
if (result.status === 200) { | |
try { | |
var parsed = JSON_parse(result.responseText); | |
return done(parsed, 60 * 60); | |
} catch (e) { | |
console_log("instagram_mediainfo", result); | |
console_error("instagram_mediainfo", e); | |
} | |
} | |
done(null, false); | |
}); | |
}); | |
}; | |
var get_all_stories_api = function(uid, cb) { | |
if (!use_app_api) | |
return cb(null); | |
var story_cache_key = "instagram_story_uid:" + uid; | |
api_cache.fetch(story_cache_key, cb, function (done) { | |
var url = "https://i.instagram.com/api/v1/feed/user/" + uid + "/reel_media/"; | |
app_api_call(url, function(result) { | |
if (result.readyState !== 4) | |
return; | |
if (result.status !== 200) { | |
console_log(story_cache_key, result); | |
return done(null, false); | |
} | |
try { | |
var parsed = JSON_parse(result.responseText); | |
return done(parsed, 10*60); | |
} catch(e) { | |
console_log(story_cache_key, result); | |
console_error(story_cache_key, e); | |
} | |
return done(null, false); | |
}); | |
}); | |
}; | |
var story_api = function(picid, uid, cb) { | |
var get_stories = function(cb) { | |
get_all_stories_api(uid, function(result) { | |
if (!result) { | |
return cb(null); | |
} | |
try { | |
var items = result.items; | |
var all_images = []; | |
var our_item = null; | |
for (var i = 0; i < items.length; i++) { | |
var item = items[i]; | |
var images = get_maxsize_app(item); | |
if (images.length < 1) { | |
console_warn("No images found for", item); | |
continue; | |
} | |
var image = images[0]; | |
all_images.push(image); | |
var item_picid = common_functions.instagram_get_imageid(image.src); | |
api_cache.set("instagram_story_pic:" + item_picid, image, 6*60*60); | |
if (image.video) { | |
var item_vidid = common_functions.instagram_get_imageid(image.video); | |
api_cache.set("instagram_story_pic:" + item_vidid, image, 6*60*60); | |
} | |
if (picid && (item_picid === picid || item_vidid === picid)) { | |
our_item = image; | |
} | |
} | |
if (picid) { | |
if (our_item !== null) | |
return cb(our_item); | |
} else { | |
return cb(all_images); | |
} | |
return cb(null); | |
} catch (e) { | |
console_log(cache_key, result); | |
console_error(cache_key, e); | |
return cb(null); | |
} | |
}); | |
}; | |
if (picid) { | |
var cache_key = "instagram_story_pic:" + picid; | |
api_cache.fetch(cache_key, cb, function (done) { | |
get_stories(function(result) { | |
if (result) { | |
return done(result, 6*60*60); | |
} else { | |
return done(result, false); | |
} | |
}); | |
}); | |
} else { | |
get_stories(cb); | |
} | |
}; | |
var profile_to_url = function(profile) { | |
try { | |
return profile.hd_profile_pic_url_info.url; | |
} catch (e) { | |
console_error(e); | |
return null; | |
} | |
}; | |
var request_profile = function(username, cb) { | |
username_to_uid(username, function(uid) { | |
if (!uid) { | |
return cb(null); | |
} | |
uid_to_profile(uid, function(profile) { | |
if (!profile) { | |
return cb(null); | |
} | |
return cb(profile_to_url(profile)); | |
}); | |
}); | |
return { | |
waiting: true | |
}; | |
}; | |
var parse_caption = function(caption) { | |
if (typeof caption === "string") | |
return caption; | |
if (caption.text) | |
return caption.text; | |
if (caption.edges) | |
return caption.edges[0].node.text; | |
return null; | |
}; | |
var get_caption = function(item) { | |
if (item.caption) | |
return parse_caption(item.caption); | |
if (item.title) | |
return parse_caption(item.title); | |
if (item.edge_media_to_caption) | |
return parse_caption(item.edge_media_to_caption); | |
return undefined; | |
}; | |
var image_in_objarr = function(image, objarr) { | |
var imageid = common_functions.instagram_get_imageid(image); | |
for (var i = 0; i < objarr.length; i++) { | |
if (objarr[i].src.indexOf(imageid) > 0) | |
return objarr[i]; | |
} | |
return null; | |
}; | |
var get_maxsize_app = function(item) { | |
var images = []; | |
var parse_image = function (img) { | |
var candidates = img.image_versions2.candidates; | |
var maxsize = 0; | |
var maxobj = null; | |
for (var i = 0; i < candidates.length; i++) { | |
var size = candidates[i].width * candidates[i].height; | |
if (size > maxsize) { | |
maxsize = size; | |
maxobj = candidates[i]; | |
} | |
} | |
var image = null; | |
if (maxobj !== null) { | |
image = { | |
src: maxobj.url, | |
caption: get_caption(item), | |
width: maxobj.width, | |
height: maxobj.height | |
}; | |
} | |
if (image && img.video_versions) { | |
maxsize = 0; | |
maxobj = null; | |
var videos = img.video_versions; | |
for (var i = 0; i < videos.length; i++) { | |
var size = videos[i].width * videos[i].height; | |
if (size > maxsize) { | |
maxsize = size; | |
maxobj = videos[i]; | |
} | |
} | |
if (maxobj !== null) { | |
image.video = maxobj.url; | |
} | |
} | |
if (image !== null) { | |
images.push(image); | |
} | |
}; | |
if ("carousel_media" in item) { | |
for (var i = 0; i < item.carousel_media.length; i++) { | |
parse_image(item.carousel_media[i]); | |
} | |
} else { | |
parse_image(item); | |
} | |
return images; | |
}; | |
var get_maxsize_graphql = function(media) { | |
var images = []; | |
var parse_image = function(node) { | |
var image = node.display_src; | |
if (!image) | |
image = node.display_url; | |
var width = 0, height = 0; | |
if (node.dimensions) { | |
width = node.dimensions.width; | |
height = node.dimensions.height; | |
} | |
if (!image) | |
return; | |
var found_image = image_in_objarr(image, images); | |
if (found_image) { | |
var found_size = found_image.width * found_image.height; | |
var our_size = width * height; | |
if (our_size <= found_size) | |
return; | |
} | |
images.push({ | |
src: image, | |
video: node.video_url, | |
caption: get_caption(media), | |
width: width, | |
height: height | |
}); | |
}; | |
if (media.edge_sidecar_to_children) { | |
var edges = media.edge_sidecar_to_children.edges; | |
for (var i = 0; i < edges.length; i++) { | |
var edge = edges[i]; | |
if (edge.node) | |
edge = edge.node; | |
parse_image(edge); | |
} | |
} | |
parse_image(media); | |
return images; | |
}; | |
var image_to_obj = function(image) { | |
var extra = null; | |
if (image.caption) | |
extra = {caption: image.caption}; | |
if (image.video) { | |
return [ | |
{url: image.video, video: true, extra: extra}, | |
{url: image.src, extra: extra} | |
]; | |
} else { | |
return { | |
url: image.src, | |
extra: extra | |
}; | |
} | |
}; | |
var request_post_inner = function(post_url, image_url, cb) { | |
query_ig(post_url, function(json) { | |
if (!json) { | |
return cb(null); | |
} | |
try { | |
var media = json.entry_data.PostPage[0].graphql.shortcode_media; | |
mediainfo_api(media.id + "_" + media.owner.id, function(app_response) { | |
var images = []; | |
if (app_response !== null) { | |
images = get_maxsize_app(app_response.items[0]); | |
} else if (use_app_api) { | |
console_log("Unable to use API to find Instagram image, you may need to login to Instagram"); | |
} | |
var images_graphql = get_maxsize_graphql(media); | |
if (images && images.length === images_graphql.length) { | |
for (var i = 0; i < images.length; i++) { | |
var app_size = images[i].width * images[i].height; | |
var graphql_size = images_graphql[i].width * images_graphql[i].height; | |
if (graphql_size > app_size) { | |
//console_log("Using graphql image", images[i], images_graphql[i]); | |
images[i] = images_graphql[i]; | |
} | |
} | |
} else { | |
images = images_graphql; | |
} | |
if (image_url) { | |
var image = image_in_objarr(image_url, images); | |
if (image) | |
return cb(image_to_obj(image)); | |
} else { | |
return cb(images); | |
} | |
cb(null); | |
}); | |
} catch (e) { | |
console_error(e); | |
cb(null); | |
} | |
}); | |
return { | |
waiting: true | |
}; | |
}; | |
var request_post = function(post_url, image_url, cb) { | |
return request_post_inner(post_url, image_url, cb); | |
}; | |
var request_stories = function(url, image_url, cb, all) { | |
var username = url.replace(/.*\/stories\/+([^/]*).*$/, "$1"); | |
if (username === url) | |
return null; | |
username_to_uid(username, function(uid) { | |
if (!uid) { | |
return cb(null); | |
} | |
var image_id = common_functions.instagram_get_imageid(image_url); | |
story_api(image_id, uid, function(result) { | |
if (!result) { | |
return cb(null); | |
} | |
var images = result; | |
if (!(images instanceof Array)) | |
images = [images]; | |
if (image_id) { | |
var image = image_in_objarr(image_url, images); | |
if (!image) | |
return cb(null); | |
return cb(image_to_obj(image)); | |
} else { | |
return cb(images); | |
} | |
}); | |
}); | |
return { | |
waiting: true | |
}; | |
}; | |
var parse_single_el_info = function(info, cb) { | |
var retval; | |
if (info.type === "post") { | |
if (info.all) | |
info.image = null; | |
retval = request_post(info.url, info.image, cb); | |
if (retval) | |
return retval; | |
} else if (info.type === "profile") { | |
retval = request_profile(info.url, cb); | |
if (retval) | |
return retval; | |
} else if (info.type === "story") { | |
if (info.all) | |
info.image = null; | |
retval = request_stories(info.url, info.image, cb); | |
if (retval) | |
return retval; | |
} | |
return retval; | |
}; | |
var parse_el_info = function(info, cb) { | |
var retval; | |
for (var i = 0; i < info.length; i++) { | |
retval = parse_single_el_info(info[i], cb); | |
if (retval) | |
return retval; | |
} | |
return retval; | |
}; | |
return parse_el_info(info, cb); | |
}; | |
common_functions.instagram_find_el_info = function(document, element, host_url) { | |
var possible_infos = []; | |
// check for links first | |
var current = element; | |
while ((current = current.parentElement)) { | |
if (current.tagName !== "A") | |
continue; | |
if (current.href.match(/:\/\/[^/]+\/+(?:[^/]+\/+)?p\//)) { | |
// link to post | |
possible_infos.push({ | |
type: "post", | |
subtype: "link", | |
url: current.href, | |
image: element.src, | |
element: current | |
}); | |
} else if (current.href.match(/:\/\/[^/]+\/+[^/]+(?:\/+(?:[?#].*)?)?$/)) { | |
// link to profile (e.g. for someone who comments on a post) | |
possible_infos.push({ | |
type: "profile", | |
subtype: "link", | |
url: current.href, | |
element: current | |
}); | |
} | |
} | |
current = element; | |
while ((current = current.parentElement)) { | |
// profile image | |
// a better way would be to check the username from the h2 > a (title, href, innerText) | |
if (current.tagName === "HEADER") { | |
var sharedData = null; | |
// Still keep this code because this way we can know it exists? | |
// We can't use this directly because the user might have switched the profile they're currently viewing | |
if (true) { | |
var scripts = document.getElementsByTagName("script"); | |
for (var i = 0; i < scripts.length; i++) { | |
if (scripts[i].innerText.match(/^ *window\._sharedData/)) { | |
sharedData = scripts[i].innerText.replace(/^ *window\._sharedData *= *({.*}) *;.*?/, "$1"); | |
} | |
} | |
if (!sharedData) { | |
console_error("Shared data not found"); | |
continue; | |
} else { | |
sharedData = JSON_parse(sharedData); | |
} | |
} | |
var url = host_url; | |
if (url.match(/:\/\/[^/]+\/+p\//)) { | |
// There are 2 h1's, the first should be the username (the second is the person's "name") | |
var username = current.querySelector("h1").innerText; | |
url = "https://www.instagram.com/" + username;//common_functions.instagram_username_from_sharedData(sharedData); | |
} | |
possible_infos.push({ | |
type: "profile", | |
subtype: "page", | |
url: url, | |
element: current | |
}); | |
} | |
// popup | |
if ((current.tagName === "DIV" && current.getAttribute("role") === "dialog") || | |
// post page | |
(current.tagName === "BODY" && host_url.match(/:\/\/[^/]*\/+(?:[^/]+\/+)?p\//))) { | |
possible_infos.push({ | |
type: "post", | |
subtype: current.tagName === "BODY" ? "page" : "popup", | |
url: host_url, | |
image: element.src, | |
element: current | |
}); | |
} | |
// stories | |
if (current.tagName === "BODY" && host_url.match(/:\/\/[^/]*\/+stories\/+([^/]*)\/*(?:[?#].*)?$/)) { | |
possible_infos.push({ | |
type: "story", | |
url: host_url, | |
image: element.src, | |
element: current | |
}); | |
} | |
} | |
return possible_infos; | |
}; | |
var get_domain_nosub = function(domain) { | |
var domain_nosub = domain.replace(/^.*\.([^.]*\.[^.]*)$/, "$1"); | |
if (domain_nosub.match(/^co\.[a-z]{2}$/) || | |
domain_nosub.match(/^ne\.jp$/) || // stream.ne.jp | |
domain_nosub.match(/^or\.jp$/) || | |
domain_nosub.match(/^com\.[a-z]{2}$/) || | |
domain_nosub.match(/^org\.[a-z]{2}$/) || | |
domain_nosub.match(/^net\.[a-z]{2}$/)) { | |
domain_nosub = domain.replace(/^.*\.([^.]*\.[^.]*\.[^.]*)$/, "$1"); | |
} | |
return domain_nosub; | |
}; | |
function bigimage(src, options) { | |
if (!src) | |
return src; | |
if (!src.match(/^(?:https?|x-raw-image):\/\//) && !src.match(/^data:/)) | |
return src; | |
var origsrc = src; | |
var url = urlparse(src); | |
var protocol; | |
var domain; | |
var port; | |
if (!src.match(/^(?:data|x-raw-image):/)) { | |
// to prevent infinite loops | |
if (src.length >= 65535) | |
return src; | |
var protocol_split = src.split("://"); | |
protocol = protocol_split[0]; | |
var splitted = protocol_split[1].split("/"); | |
domain = splitted[0]; | |
port = domain.replace(/.*:([0-9]+)$/, "$1"); | |
if (port === domain) | |
port = ""; | |
domain = domain.replace(/(.*):[0-9]+$/, "$1"); | |
} else { | |
//protocol = src.replace(/^([-a-z]+):.*/, "$1"); | |
protocol = "data"; | |
domain = ""; | |
src = ""; // FIXME: this isn't great | |
} | |
var domain_nowww = domain.replace(/^www\./, ""); | |
var domain_nosub = get_domain_nosub(domain); | |
var amazon_container = null; | |
if (domain.indexOf(".amazonaws.com") >= 0) { | |
// https://timely-api-public.s3.us-west-2.amazonaws.com/116743_phpg7Ixww_small.JPG | |
// https://pixls-discuss.s3.dualstack.us-east-1.amazonaws.com/optimized/3X/0/5/0530ef1424b7bace746cd10d2bc26b5cd58d5e27_2_690x388.png | |
// http://stezor-img-res.s3-website.eu-central-1.amazonaws.com/600x0/0eefab17-aa8b-4f8e-9017-7b9442d1ee9e | |
if (domain.match(/^s3(?:-website)?(?:\.dualstack)?(?:[-.][-a-z0-9]+)?\.amazonaws\.com/)) | |
amazon_container = src.replace(/^[a-z]*:\/\/[^/]*\/([^/]*)\/.*/, "$1"); | |
else if (domain.match(/[^/]*\.s3(?:-website)?(?:\.dualstack)?(?:[-.][-a-z0-9]+)?\.amazonaws\.com/)) | |
amazon_container = src.replace(/^[a-z]*:\/\/([^/]*)\.s3(?:-website)?(?:\.dualstack)?(?:[-.][-a-z0-9]+)?\.amazonaws\.com\/.*/, "$1"); | |
} | |
var googleapis_container = null; | |
if (domain.indexOf(".googleapis.com") >= 0) { | |
googleapis_container = src.replace(/^[a-z]*:\/\/[^/]*\/([^/]*)\/.*/, "$1"); | |
} | |
var googlestorage_container = null; | |
if (domain_nosub === "googleapis.com" && | |
(domain === "storage.googleapis.com" || | |
domain.match(/\.storage\.googleapis\.com$/) || | |
domain === "commondatastorage.googleapis.com" || | |
domain.match(/\.commondatastorage\.googleapis\.com$/))) { | |
if (domain.match(/\.[a-z]+\.googleapis\.com$/)) { | |
googlestorage_container = src.replace(/^[a-z]*:\/\/([^/]*)\.[a-z]+\.googleapis\.com\/.*/, "$1"); | |
} else { | |
googlestorage_container = src.replace(/^[a-z]*:\/\/[^/]*\/([^/]*)\/.*/, "$1"); | |
} | |
} | |
var host_domain = ""; | |
var host_domain_nowww = ""; | |
var host_domain_nosub = ""; | |
if (options.host_url) { | |
host_domain = options.host_url.replace(/^[a-z]+:\/\/([^/]*)(?:\/.*)?$/,"$1"); | |
host_domain_nowww = host_domain.replace(/^www\./, ""); | |
host_domain_nosub = host_domain.replace(/^.*\.([^.]*\.[^.]*)$/, "$1"); | |
if (host_domain_nosub.match(/^co\.[a-z]{2}$/)) { | |
host_domain_nosub = host_domain.replace(/^.*\.([^.]*\.[^.]*\.[^.]*)$/, "$1"); | |
} | |
} | |
if (options.document) | |
document = options.document; | |
if (options.window) | |
window = options.window; | |
var problem_excluded = function(problem) { | |
if (!options.exclude_problems) | |
return false; | |
if (typeof options.exclude_problems === "string" && options.exclude_problems === problem) | |
return true; | |
if (!(options.exclude_problems instanceof Array)) | |
return false; | |
return options.exclude_problems.indexOf(problem) >= 0; | |
}; | |
var api_cache = real_api_cache; | |
if (options.use_api_cache === false) { | |
api_cache = new Cache(); | |
} | |
var newsrc, i, id, size, origsize, regex, match; | |
// instart logic morpheus | |
// test urls: | |
// char - 5 | |
// https://c-6rtwjumjzx7877x24nrlncx2ewfspjwx2ehtr.g00.ranker.com/g00/3_c-6bbb.wfspjw.htr_/c-6RTWJUMJZX77x24myyux78x3ax2fx2fnrlnc.wfspjw.htrx2fzx78jw_stij_nrlx2f94x2f415044x2ftwnlnsfqx2fjzs-on-bts-wjhtwinsl-fwynx78yx78-fsi-lwtzux78-umtyt-z6x3fbx3d105x26vx3d05x26krx3doulx26knyx3dhwtux26hwtux3dkfhjx78x26n65h.rfwp.nrflj.yduj_$/$/$/$/$/$ | |
// https://imgix.ranker.com/user_node_img/49/960599/original/eun-ji-won-recording-artists-and-groups-photo-u1?w=650&q=50&fm=jpg&fit=crop&crop=faces | |
// https://c-6rtwjumjzx7877x24nrlncx2ewfspjwx2ehtr.g00.ranker.com/g00/3_c-6bbb.wfspjw.htr_/c-6RTWJUMJZX77x24myyux78x3ax2fx2fnrlnc.wfspjw.htrx2fzx78jw_stij_nrlx2f03x2f6698837x2ftwnlnsfqx2fmjj-hmzq-umtyt-z4x3fbx3d105x26vx3d05x26krx3doulx26knyx3dhwtux26hwtux3dkfhjx78x26n65h.rfwp.nrflj.yduj_$/$/$/$/$/$ | |
// https://imgix.ranker.com/user_node_img/58/1143382/original/hee-chul-photo-u9?w=650&q=50&fm=jpg&fit=crop&crop=faces | |
// https://c-6rtwjumjzx7877x24nrlncx2ewfspjwx2ehtr.g00.ranker.com/g00/3_c-6bbb.wfspjw.htr_/c-6RTWJUMJZX77x24myyux78x3ax2fx2fnrlnc.wfspjw.htrx2fzx78jw_stij_nrlx2f16x2f6757374x2ftwnlnsfqx2fmdzs-dtzsl-z7x3fbx3d105x26vx3d05x26krx3doulx26knyx3dhwtux26hwtux3dkfhjx78x26n65h.rfwp.nrflj.yduj_$/$/$/$/$/$ | |
// https://imgix.ranker.com/user_node_img/61/1202829/original/hyun-young-u2?w=650&q=50&fm=jpg&fit=crop&crop=faces | |
// https://c-7npsfqifvt0x24jnh-t-nto-dpnx2eblbnbjafex2eofu.g01.msn.com/g00/3_c-7x78x78x78.nto.dpn_/c-7NPSFQIFVT0x24iuuqtx3ax2fx2fjnh-t-nto-dpn.blbnbjafe.ofux2fufoboux2fbnqx2ffoujuzjex2fBBFFIbi.jnhx3fix3d2191x26x78x3d2031x26nx3d7x26rx3d71x26px3dgx26mx3dgx26yx3d665x26zx3d341x26j21d.nbslx3djnbhf_$/$/$/$/$ | |
// https://img-s-msn-com.akamaized.net/tenant/amp/entityid/AAEEHah.img | |
// | |
// http://c-6rtwjumjzx7877x24bbbx2esfstanx78twx2ent.g00.tomshardware.com/g00/3_c-6bbb.ytrx78mfwibfwj.htr_/c-6RTWJUMJZX77x24myyux78x3ax2fx2fbbb.sfstanx78tw.ntx2fx40u6x2fHfhmjfgqjHXXx3fywfhpx26n65h.rfwp.qnsp.yduj_$/$/$ | |
// https://www.nanovisor.io/@p1/CacheableCSS?track | |
// | |
// char - 8 | |
// https://c-5uwzmx78pmca09x24quoqfx2ezivsmzx2ekwu.g00.ranker.com/g00/3_c-5eee.zivsmz.kwu_/c-5UWZMXPMCA09x24pbbx78ax3ax2fx2fquoqf.zivsmz.kwux2fcamz_vwlm_quox2f25x2f716313x2fwzqoqvitx2fmuui-eibawv-x78mwx78tm-qv-bd-x78pwbw-c01x3fex3d903x26px3d903x26nqbx3dkzwx78x26kzwx78x3dnikmax26yx3d48x26nux3drx78ox26q98k.uizs.quiom.bgx78m_$/$/$/$/$/$ | |
// https://imgix.ranker.com/user_node_img/47/938535/original/emma-watson-people-in-tv-photo-u23?w=125&h=125&fit=crop&crop=faces&q=60&fm=jpg | |
// | |
// http://c-6rtwjumjzx7877x24zlh-56x2ehfkjrtrx78yfynhx2ehtr.g00.cafemom.com/g00/3_c-6ymjx78ynw.hfkjrtr.htr_/c-6RTWJUMJZX77x24myyux78x3ax2fx2fzlh-56.hfkjrtrx78yfynh.htrx2fljsx2fhwtux2f705x2f695x2f25x2f7563x2f57x2f56x2f65x2f82x2fibx2futpmy32vnt27.uslx3fn65h.rfwpx3dnrflj_$/$/$/$/$/$/$/$/$/$/$/$/$ | |
// https://ugc-01.cafemomstatic.com/gen/crop/250/140/70/2018/02/01/10/37/dw/pokht87qio72.png | |
if (src.indexOf("/g00/") >= 0 && /\.g0[0-9]\./.test(domain)) { | |
var str = ""; | |
//var i; | |
// decode x[0-9][0-9] to \x[0-9][0-9] | |
for (i = 0; i < src.length; i++) { | |
if (src[i] == 'x') { | |
var char = parseInt(src[i + 1] + src[i + 2], 16); | |
str += String.fromCharCode(char); | |
i += 2; | |
} else { | |
str += src[i]; | |
} | |
} | |
str = str.split("/").slice(5).join("/").split("$").slice(1).join("$"); | |
if (str && str.indexOf("://") < 10 && str[1] == str[2]) { | |
var diff = mod(str.charCodeAt(0) - 'h'.charCodeAt(0), 26); | |
// char - diff | |
var str1 = ""; | |
for (i = 0; i < str.length; i++) { | |
var code = str.charCodeAt(i); | |
if (code > 47 && code < 58) { | |
/* number */ | |
code = (mod((code - 48 - diff), 10) + 48); | |
} else if (code > 64 && code < 91) { | |
/* uppercase */ | |
code = (mod((code - 65 - diff),26) + 65); | |
} else if (code > 96 && code < 123) { | |
/* lowercase */ | |
code = (mod((code - 97 - diff),26) + 97); | |
} | |
str1 += String.fromCharCode(code); | |
} | |
var urlparts = str1; | |
if (urlparts && urlparts.indexOf("http") === 0) { | |
var $s = urlparts.replace(/.*?([$/]*)$/, "$1"); | |
if ($s !== urlparts && $s) { | |
var count = $s.split("$").length - 1; | |
if (count > 0) { | |
// + 2 for http:// | |
var newurl = urlparts.split("/").slice(0, count + 2).join("/"); | |
// https://ugc-01.cafemomstatic.com/gen/crop/250/140/70/2018/02/01/10/37/dw/pokht87qio72.png?i10c.mark=image_$ | |
//newurl = newurl.split("&").slice(0,-1).join("&"); // remove &i10c.mark.link.type_... | |
newurl = newurl.replace(/[?&]i10c\.mark[^/]*$/, ""); | |
if (newurl) | |
return newurl; | |
} | |
} | |
} else { | |
console_log(urlparts); | |
} | |
} | |
} | |
// -- start bigimage -- | |
/*if (false && domain.indexOf("img.tenasia.hankyung.com") >= 0) { | |
// http://img.hankyung.com/photo/201612/AA.12967766.4.jpg -- larger than .1. | |
// http://img.hankyung.com/photo/201612/AA.12967766.1.jpg | |
return src.replace(/-[0-9]+x[0-9]+\.([^/.]*)$/, ".$1"); | |
}*/ | |
if (domain === "img.hankyung.com" || | |
// http://img.hankyung.com/photo/201612/AA.12967766.4.jpg -- larger than .1. | |
// http://img.hankyung.com/photo/201612/AA.12967766.1.jpg | |
domain === "img.tenasia.hankyung.com") { | |
// http://img.hankyung.com/photo/201808/ZK.17491055.3.jpg | |
// http://img.hankyung.com/photo/201808/ZK.17491055.1.jpg -- watermark | |
// http://img.hankyung.com/photo/201902/01.19032633.3.jpg | |
// http://img.hankyung.com/photo/201902/01.19032633.1.jpg -- no watermark | |
// http://img.hankyung.com/photo/201802/ZA.16036542.1.jpg -- 3696x2778 (4 is not available) | |
// https://img.hankyung.com/photo/201906/01.19968607.1-1200x.jpg -- 1200x795, upscaled | |
// https://img.hankyung.com/photo/201906/01.19968607.1.jpg | |
// https://img.hankyung.com/photo/201506/ZA.10064438.1.jpg -- 4078x2155 | |
// http://ac.hankyung.com/data/file/53fa81e2501efc21f89ed7a440d2d22c.JPG -- 4032x3024 | |
// | |
// thanks to Bobfrnw on greasyfork for reporting this: | |
// http://img.hankyung.com/photo/201903/03.19066867.4.jpg -- no watermark, larger (1800x1200) | |
// http://img.hankyung.com/photo/201903/03.19066867.1.jpg -- watermark, smaller (620x420) | |
newsrc = src.replace(/(\/photo\/+[0-9]{6}\/+[0-9A-Z]{2}\.[0-9]+\.[0-9]+)-[0-9]*x[0-9]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2"); | |
if (newsrc !== src) | |
return newsrc; | |
if (src.match(/\.[0-9](\.[^/.]*)(?:[?#].*)?$/)) { | |
newsrc = src.replace(/[?#].*$/, ""); | |
if (newsrc !== src) | |
return newsrc; | |
return [ | |
src.replace(/\.[0-9](\.[^/.]*)$/, ".4$1"), | |
src.replace(/\.[0-9](\.[^/.]*)$/, ".1$1") | |
]; | |
} | |
} | |
if (domain_nosub === "naver.net" || | |
domain_nosub === "pstatic.net") { | |
if (domain.indexOf("gfmarket.") >= 0) { | |
return src; | |
} | |
// http://tv03.search.naver.net/thm?size=120x150&quality=9&q=http://sstatic.naver.net/people/portrait/201401/20140127145415321.jpg | |
// http://sstatic.naver.net/people/portrait/201401/20140127145415321.jpg | |
// https://tv.pstatic.net/thm?size=120x150&quality=9&q=http://sstatic.naver.net/people/portrait/201604/20160426164831645.jpg | |
// http://sstatic.naver.net/people/portrait/201604/20160426164831645.jpg | |
if (domain.match(/tv[0-9]*\.search\.naver\.net/) || | |
domain.match(/tv[0-9]*\.pstatic\.net/)) { | |
return src.replace(/.*\/thm\?.*?q=/, ""); | |
} | |
if (src.match(/[?&]src=/)) { | |
return decodeURIComponent(src.replace(/.*src=*([^&]*).*/, "$1")).replace(/^"*/, '').replace(/"$/, ''); | |
} | |
// for some reason it doesn't work with (some?) cafe files? | |
// test: | |
// https://cafeptthumb-phinf.pstatic.net/20150611_228/pht0829_1434017180824U5auR_JPEG/U01.jpg?type=w1 | |
// proper: | |
// https://cafeptthumb-phinf.pstatic.net/20150611_228/pht0829_1434017180824U5auR_JPEG/U01.jpg | |
// however in cases such as | |
// https://postfiles.pstatic.net/MjAxNzA2MjVfMjcg/MDAxNDk4MzY2NTU1NDA1._jJeyTBgxoS4OUVFnfUpCTwFlWgsQANPgd5g4Wr__2kg._o3wfc4uAzyG_buHGKqENCl6g1pDt6-thoX-akGet9Qg.JPEG.amyo916/%EB%B0%A4%EB%B9%84%EB%85%B8_%EC%9D%80%EC%86%943.jpg?type=w1 | |
// doing | |
// https://postfiles.pstatic.net/MjAxNzA2MjVfMjcg/MDAxNDk4MzY2NTU1NDA1._jJeyTBgxoS4OUVFnfUpCTwFlWgsQANPgd5g4Wr__2kg._o3wfc4uAzyG_buHGKqENCl6g1pDt6-thoX-akGet9Qg.JPEG.amyo916/%EB%B0%A4%EB%B9%84%EB%85%B8_%EC%9D%80%EC%86%943.jpg | |
// returns a smaller file | |
// https://blogfiles.pstatic.net/MjAxNzA2MjVfMjcg/MDAxNDk4MzY2NTU1NDA1._jJeyTBgxoS4OUVFnfUpCTwFlWgsQANPgd5g4Wr__2kg._o3wfc4uAzyG_buHGKqENCl6g1pDt6-thoX-akGet9Qg.JPEG.amyo916/%EB%B0%A4%EB%B9%84%EB%85%B8_%EC%9D%80%EC%86%943.jpg is the same size as ?type=w1 | |
// | |
// https://postfiles.pstatic.net/MjAxNzA5MjFfMTg1/MDAxNTA1OTk3ODQzNjU3.oR8-_8p2zkJuFfz41D_ABFDKc82luEh45nxxiH1riAUg.NqrW3NUoqqR_a3Pqbg0jAttIrNst4k5BdFG2M7WNfQsg.JPEG.bho1000/IMG_4092_resize.JPG?type=w966 (900x600) | |
// https://postfiles.pstatic.net/MjAxNzA5MjFfMTg1/MDAxNTA1OTk3ODQzNjU3.oR8-_8p2zkJuFfz41D_ABFDKc82luEh45nxxiH1riAUg.NqrW3NUoqqR_a3Pqbg0jAttIrNst4k5BdFG2M7WNfQsg.JPEG.bho1000/IMG_4092_resize.JPG = smallest | |
// https://postfiles.pstatic.net/MjAxNzA5MjFfMTg1/MDAxNTA1OTk3ODQzNjU3.oR8-_8p2zkJuFfz41D_ABFDKc82luEh45nxxiH1riAUg.NqrW3NUoqqR_a3Pqbg0jAttIrNst4k5BdFG2M7WNfQsg.JPEG.bho1000/IMG_4092_resize.JPG?type=w1 = largest (eq to w966) | |
// https://postfiles.pstatic.net/MjAxNzA5MjFfMTg1/MDAxNTA1OTk3ODQzNjU3.oR8-_8p2zkJuFfz41D_ABFDKc82luEh45nxxiH1riAUg.NqrW3NUoqqR_a3Pqbg0jAttIrNst4k5BdFG2M7WNfQsg.JPEG.bho1000/IMG_4092_resize.JPG?type=w2 = smaller | |
// https://postfiles.pstatic.net/MjAxNzA5MjFfMTg1/MDAxNTA1OTk3ODQzNjU3.oR8-_8p2zkJuFfz41D_ABFDKc82luEh45nxxiH1riAUg.NqrW3NUoqqR_a3Pqbg0jAttIrNst4k5BdFG2M7WNfQsg.JPEG.bho1000/IMG_4092_resize.JPG?type=w3 = smallest (but larger than without) | |
// https://blogfiles.pstatic.net/MjAxNzA5MjFfMTg1/MDAxNTA1OTk3ODQzNjU3.oR8-_8p2zkJuFfz41D_ABFDKc82luEh45nxxiH1riAUg.NqrW3NUoqqR_a3Pqbg0jAttIrNst4k5BdFG2M7WNfQsg.JPEG.bho1000/IMG_4092_resize.JPG = largest (eq to w966) | |
// there is also ?type=w2 to consider, but with no change i've seen so far | |
// ?type=w1 doesn't work: | |
// | |
// https://img-pholar.pstatic.net/20161120_290/1479626135018LJPrw_JPEG/p?type=ffn720_720 | |
// https://img-pholar.pstatic.net/20161120_290/1479626135018LJPrw_JPEG/p?type=w1 is broken | |
// https://img-pholar.pstatic.net/20161120_290/1479626135018LJPrw_JPEG/p is ok | |
// http://dic.phinf.naver.net/20170424_170/1493009773923GjUgo_JPEG/196_cobis_20070206153112.jpg?type=nf118_80_q80 | |
// ?type=w1 works: | |
// | |
// https://postfiles.pstatic.net/MjAxNzEyMjNfMTc5/MDAxNTEzOTk4OTA3MzQ0.3GiIBnqVyIshzpThGEE92-RMzAWDRShnmSwfZyviyVQg.OiRXD8qLAXSNXgDUF1yPsXnx8SPxj3RWhYr-eUoCWhUg.JPEG.com862/IMG_1826.jpg?type=w773 | |
// https://postfiles.pstatic.net/MjAxNzEyMjNfMTc5/MDAxNTEzOTk4OTA3MzQ0.3GiIBnqVyIshzpThGEE92-RMzAWDRShnmSwfZyviyVQg.OiRXD8qLAXSNXgDUF1yPsXnx8SPxj3RWhYr-eUoCWhUg.JPEG.com862/IMG_1826.jpg?type=w1 | |
// http://sstatic.naver.net/people/194/201710101543498651.jpg | |
// http://sstatic.naver.net/people/194/201710101543498651.jpg?type=w1 | |
// http://sstatic.naver.net/people/portraitGroup/201709/20170929171408460-4330243.jpg | |
// http://sstatic.naver.net/people/portraitGroup/201709/20170929171408460-4330243.jpg?type=w1 | |
// ?type=w1 makes a smaller file: | |
// http://blogfiles.naver.net/MjAxNzEyMTNfNzAg/MDAxNTEzMTcxOTYwMTYy.LUNqGf98PVcskK0cLDV3Gil8H861pt8Y-Mv1PP0BnLcg.gC3LNf7q0rJZJ044ZjdDbUQTGqXIYzL-bRiKyxYocDcg.PNG.vvyeo/1_%BD%BA%C0%A7%C4%A1_.png | |
// http://blogfiles.pstatic.net/MjAxNzEyMTNfNzAg/MDAxNTEzMTcxOTYwMTYy.LUNqGf98PVcskK0cLDV3Gil8H861pt8Y-Mv1PP0BnLcg.gC3LNf7q0rJZJ044ZjdDbUQTGqXIYzL-bRiKyxYocDcg.PNG.vvyeo/1_%BD%BA%C0%A7%C4%A1_.png?type=w1 | |
// http://blogfiles.pstatic.net/MjAxNzEyMTNfNzAg/MDAxNTEzMTcxOTYwMTYy.LUNqGf98PVcskK0cLDV3Gil8H861pt8Y-Mv1PP0BnLcg.gC3LNf7q0rJZJ044ZjdDbUQTGqXIYzL-bRiKyxYocDcg.PNG.vvyeo/1_%BD%BA%C0%A7%C4%A1_.png?type=w2 (even smaller) | |
// http://blogfiles.pstatic.net/MjAxNzEyMTNfNzAg/MDAxNTEzMTcxOTYwMTYy.LUNqGf98PVcskK0cLDV3Gil8H861pt8Y-Mv1PP0BnLcg.gC3LNf7q0rJZJ044ZjdDbUQTGqXIYzL-bRiKyxYocDcg.PNG.vvyeo/1_%BD%BA%C0%A7%C4%A1_.png?type=w3 (smallest) | |
// with that being said, type=w3 does look the least stretched. however, with other images, it just resizes, no un-stretching | |
if (domain.search(/^[-a-z0-9]*cafe[-a-z0-9]*\./) < 0 && | |
domain.search(/^img-pholar[-a-z0-9]*\./) < 0 && | |
domain.search(/^shopping-phinf[-a-z0-9]*\./) < 0 && | |
domain.search(/^dic.phinf.naver.net/) < 0 && | |
domain.search(/^musicmeta.phinf.naver.net/) < 0 && false) | |
src = src.replace(/\?type=[^/]*$/, "?type=w1"); | |
else | |
src = src.replace(/\?type=[^/]*$/, ""); | |
src = src.replace(/#[^/]*$/, ""); | |
if (domain.search(/^[-a-z0-9]*blog[-a-z0-9]*\./) < 0 && | |
domain.search(/^[-a-z0-9]*cafe[-a-z0-9]*\./) < 0 && | |
domain.search(/^[-a-z0-9]*news[-a-z0-9]*\./) < 0 && | |
domain.search(/^[-a-z0-9]*post[-a-z0-9]*\./) < 0 && | |
domain.search(/^[-a-z0-9]*v.phinf[-a-z0-9]*\./) < 0 && | |
domain.search(/^[-a-z0-9]*shopping.phinf[-a-z0-9]*\./) < 0 && | |
domain.search(/^[-a-z0-9]*musicmeta.phinf[-a-z0-9]*\./) < 0) { | |
return src; | |
} | |
// http://post.phinf.naver.net/20160324_74/1458783545129zPGJg_JPEG/%B0%AD%B3%B2TV_%B0%C9%B1%D7%B7%EC_%BD%BA%C0%A7%C4%A1%BA%A3%B8%AE_%B0%A1%BB%F3%C7%F6%BD%C7_360VR_%BC%EE%C4%C9%C0%CC%BD%BA_%B9%C2%C1%F7%BA%F1%B5%F0%BF%C0_%BB%E7%C1%F82.jpg/IT8SeAh7YSaM55bq7KMOEE5ImDlU.jpg | |
// http://post-phinf.pstatic.net/20160324_74/1458783545129zPGJg_JPEG/%B0%AD%B3%B2TV_%B0%C9%B1%D7%B7%EC_%BD%BA%C0%A7%C4%A1%BA%A3%B8%AE_%B0%A1%BB%F3%C7%F6%BD%C7_360VR_%BC%EE%C4%C9%C0%CC%BD%BA_%B9%C2%C1%F7%BA%F1%B5%F0%BF%C0_%BB%E7%C1%F82.jpg/IT8SeAh7YSaM55bq7KMOEE5ImDlU.jpg | |
// works: | |
// https://s.pstatic.net/shopping.phinf/20180115_4/ce3dfbda-c44b-43aa-83d0-2ffb8fa3dd47.jpg | |
// https://shopping-phinf.pstatic.net/20180115_4/ce3dfbda-c44b-43aa-83d0-2ffb8fa3dd47.jpg | |
// http://imgnews.pstatic.net/image/origin/433/2017/07/31/33727.jpg | |
// http://s.pstatic.net/imgnews/image/origin/433/2017/07/31/33727.jpg | |
// http://imgnews.pstatic.net/image/origin/416/2018/04/04/223346.jpg | |
// doesn't work: | |
// http://dic.phinf.naver.net/20170424_126/14930112296681HPid_JPEG/14051_getty_20080128162512.jpg | |
// http://s.pstatic.net/dic.phinf/20170424_126/14930112296681HPid_JPEG/14051_getty_20080128162512.jpg | |
// | |
// can't remove ? | |
// http://dbscthumb.phinf.naver.net/4209_000_1/20160408160657214_SYEAAJM97.jpg/5%EA%B0%90%EA%B5%AC.jpg?type=r160 | |
// http://dbscthumb-phinf.pstatic.net/4209_000_1/20160408160657214_SYEAAJM97.jpg/5%EA%B0%90%EA%B5%AC.jpg?type=r160 | |
newsrc = src | |
.replace(/postfiles[^/.]*\./, "blogfiles.") | |
.replace(/m?blogthumb[^./]*/, "blogfiles") | |
.replace(/blogfiles[^/.]*\./, "blogfiles.") | |
.replace(/postfiles[^/.]*\./, "blogfiles.") | |
.replace(/cafeptthumb[^./]*/, "cafefiles") | |
// https://cafeskthumb-phinf.pstatic.net/MjAxNzAyMjhfMjIw/MDAxNDg4Mjg1NzU1ODY0.FAX24pXzUaNN-_C5yRRGcJJsswcKtGmsdOi2hTQQfJog.muWF7CuoY7-HKdrPQRYDyp8OlZGyITwmkcGQgzkxzFcg.PNG.yj991224/main-cover1.png?type=w740 | |
.replace(/cafeskthumb[^./]*/, "cafefiles") | |
.replace(/m?cafethumb[^./]*/, "cafefiles") | |
.replace(/cafefiles[^/.]*\./, "cafefiles.") | |
.replace(/mimgnews[^./]*/, "imgnews") | |
.replace(/post\.phinf\./, "post-phinf.") | |
// http://v.phinf.naver.net/20180117_164/1516193382182Jx9lx_JPEG/df9c0c3b-fb84-11e7-9554-000000008ca5_07.jpg | |
.replace(/v\.phinf\./, "v-phinf.") | |
// http://musicmeta.phinf.naver.net/album/002/152/2152949.jpg | |
.replace(/musicmeta\.phinf\./, "musicmeta-phinf.") | |
.replace(/shopping\.phinf\./, "shopping-phinf.") | |
// http://blogpfthumb.phinf.naver.net/20131119_160/thenote_13847965353237CovB_JPEG/controlrooma.jpg | |
// http://blogpfthumb-phinf.pstatic.net/20131119_160/thenote_13847965353237CovB_JPEG/controlrooma.jpg | |
.replace(/blogpfthumb\.phinf\./, "blogpfthumb-phinf.") | |
//.replace(/\.phinf\./, ".") | |
//.replace(".naver.net/", ".pstatic.net/") | |
// http://mblogthumb4.phinf.naver.net/20140302_211/ttlyoung333_1393761808293P7TKj_JPEG/17.jpg?type=w2 -- normal | |
// http://blogfiles.pstatic.net/20140302_211/ttlyoung333_1393761808293P7TKj_JPEG/17.jpg -- cropped and upscaled (same as type=w1 and type=w2) | |
// http://blogfiles.naver.net/20140302_211/ttlyoung333_1393761808293P7TKj_JPEG/17.jpg -- works | |
// https for naver.net doesn't work (invalid certificate) | |
.replace(/(:\/\/blogfiles\.)pstatic\.net\/+/, "$1naver.net/") | |
.replace(/^https?(:\/\/[^/.]*(?:phinf|files)\.naver\.net\/)/, "http$1"); | |
if (newsrc !== src) | |
return newsrc; | |
return { | |
url: src, | |
headers: { | |
Referer: "" | |
}, | |
referer_ok: { | |
same_domain_nosub: true | |
} | |
}; | |
} | |
if ((domain_nosub === "daumcdn.net" || | |
domain_nosub === "kakaocdn.net") && | |
src.indexOf("/thumb/") >= 0) { | |
// https://search1.kakaocdn.net/thumb/C72x90h.q85/?fname=http%3A%2F%2Fcfile66.uf.daum.net%2Fimage%2F26191E4558DC88D52BF198 | |
// http://cfile66.uf.daum.net/image/26191E4558DC88D52BF198 | |
return decodeURIComponent(src.replace(/.*fname=([^&]*).*/, "$1")); | |
} | |
/*if (false && (src.indexOf("daumcdn.net/argon/") >= 0 || | |
src.indexOf(".kakaocdn.net/argon/") >= 0)) { | |
// wip | |
// https://search3.kakaocdn.net/argon/600x0_65_wr/CdIaPo4lsew | |
// https://search3.kakaocdn.net/argon/0x200_85_hr/CdIaPo4lsew | |
}*/ | |
if ((domain_nosub === "tistory.com" || | |
domain_nosub === "daum.net") && | |
(domain.match(/\.uf\.[a-z]+\.[a-z]+$/) || | |
domain.match(/^cfs[0-9]*\./))) { | |
// http://cfile21.uf.tistory.com/image/994900485A9A66EF2564F4 -- 1000x1500 | |
// http://cfile21.uf.tistory.com/original/994900485A9A66EF2564F4 -- 1333x2000 | |
// http://cfile37.uf.daum.net/C160x160/23138C47524BB2D42DD743 | |
// http://cfile37.uf.daum.net/original/23138C47524BB2D42DD743 | |
// http://cfs9.tistory.com/image/30/tistory/2008/06/12/11/13/4850862dc2093 | |
// http://cfs9.tistory.com/original/30/tistory/2008/06/12/11/13/4850862dc2093 | |
// http://cfs11.blog.daum.net/image/10/blog/2008/05/25/00/14/483830c0500a4 | |
// http://cfs11.blog.daum.net/original/10/blog/2008/05/25/00/14/483830c0500a4 | |
// http://cfile23.uf.tistory.com/media/1947E0374F15B01F148CE6 | |
// http://cfile23.uf.tistory.com/original/1947E0374F15B01F148CE6 | |
// unhandled: | |
// https://tistory4.daumcdn.net/tistory/458362/attach/3a4fa78bca8649b6a44bf4627075837e | |
// http://t1.daumcdn.net/tvpot/thumb/s07a6T8ejtee6OXNNXjQtVE/thumb.png?ts=1523956270 | |
// | |
// https://t1.daumcdn.net/cfile/tistory/996D34465B12921B1A | |
// http://cfile2.uf.tistory.com/original/996D34465B12921B1AE97C | |
// 996D34465B12921B1A | |
// 996D34465B12921B1AE97C | |
// https://t1.daumcdn.net/cfile/tistory/996A16355B12784D0B | |
// http://cfile5.uf.tistory.com/original/996A16355B12784D0B9CF8 | |
// 996A16355B12784D0B | |
// 996A16355B12784D0B9CF8 | |
// credit to severus on greasyfork: | |
// https://t1.daumcdn.net/cfile/tistory/9921ED405B0FCEDB17 -- 1600x2036 | |
// http://cfile25.uf.tistory.com/original/9921ED405B0FCEDB17DF05 -- 2200x2800 | |
// 9921ED405B0FCEDB17 | |
// 9921ED405B0FCEDB17DF05 | |
return src | |
.replace("/attach/", "/original/") | |
.replace("/media/" , "/original/") | |
.replace("/image/", "/original/") | |
.replace(/\/[RTC][0-9]*x[0-9]*\//, "/original/"); | |
} | |
if (domain_nosub === "daumcdn.net" && | |
domain.match(/^t[0-9]*\.daumcdn\.net/)) { | |
// credit to 灰原米兰 on greasyfork for finding this pattern: | |
// https://t1.daumcdn.net/cfile/tistory/99DECC4B5B1150482D | |
// https://t1.daumcdn.net/cfile/tistory/99DECC4B5B1150482D?original | |
// credit again to severus for the link: | |
// https://t1.daumcdn.net/cfile/tistory/9921ED405B0FCEDB17 -- 1600x2036 | |
// https://t1.daumcdn.net/cfile/tistory/9921ED405B0FCEDB17?original -- 2200x2800 | |
// | |
// https://t1.daumcdn.net/cfile/211DD54C5627181233 | |
// https://t1.daumcdn.net/cfile/211DD54C5627181233?original -- no difference | |
return src.replace(/(\/cfile\/(?:tistory\/)?[0-9A-F]+)(?:\\?.*)$/, "$1?original"); | |
} | |
if (domain_nosub === "daumcdn.net" && | |
domain.match(/^i[0-9]*\.media\./)) { | |
// http://i1.media.daumcdn.net/uf/image/U01/agora/5134354D420CC80021 | |
// http://i1.media.daumcdn.net/uf/original/U01/agora/5134354D420CC80021 | |
return src.replace(/\/uf\/image\//, "/uf/original/"); | |
} | |
if (domain_nosub === "daumcdn.net" && | |
domain.match(/^[mi][0-9]*\.daumcdn\.net/)) { | |
// http://i1.daumcdn.net/cfile37/C160x160/23138C47524BB2D42DD743 | |
// http://cfile37.uf.daum.net/C160x160/23138C47524BB2D42DD743 | |
// http://m1.daumcdn.net/cfile81/C41x41/150A68444FFA321A18F2DB | |
// http://cfile81.uf.daum.net/C41x41/150A68444FFA321A18F2DB | |
// unhandled: | |
// http://i2.daumcdn.net/thumb/S160x160/18287A354FA757530767B0 (https://warmpm.tistory.com/798) | |
return src.replace(/:\/\/[^/]*\/(cfile[0-9]+)\//, "://$1.uf.daum.net/"); | |
} | |
if (domain_nosub === "daumcdn.net" && /^i[0-9]*\.tvpot\./.test(domain)) { | |
// http://i1.tvpot.daumcdn.net/svc/image/U03/tvpot_thumb/7sbtgVQMZk8$/thumb.jpg.mini | |
// http://i1.tvpot.daumcdn.net/svc/image/U03/tvpot_thumb/7sbtgVQMZk8$/thumb.jpg | |
return src.replace(/(\/thumb\.[a-z0-9]+)\.mini(?:[?#].*)?$/, "$1"); | |
} | |
if (domain === "image.news1.kr") { | |
// http://image.news1.kr/system/thumbnails/photos/2018/2/19/2973418/thumb_336x230.jpg | |
// http://image.news1.kr/system/photos/2018/2/19/2973418/original.jpg | |
// http://image.news1.kr/system/photos/2014/8/22/985836/main_thumb.jpg | |
// http://image.news1.kr/system/photos/2014/8/22/985836/original.jpg | |
// http://image.news1.kr/system/photos/2018/6/15/3162887/high.jpg -- 1400x1867 | |
// http://image.news1.kr/system/photos/2018/6/15/3162887/original.jpg -- 1500x2000 | |
newsrc = src | |
.replace(/\/thumbnails\/(.*)\/thumb_[0-9]+x(?:[0-9]+)?(\.[^/.]*)$/, "/$1/original$2") | |
.replace(/main_thumb\.jpg/, "original.jpg") | |
.replace(/article.jpg/, "original.jpg") | |
.replace(/no_water.jpg/, "original.jpg") | |
.replace(/photo_sub_thumb.jpg/, "original.jpg") | |
.replace(/section_top\.jpg/, "original.jpg") | |
.replace(/high\.jpg/, "original.jpg"); | |
var filename = src.replace(/.*\/photos\/+[0-9]{4}\/+(?:[0-9]{1,2}\/+){2}([0-9]+)\/+.*$/, "$1"); | |
if (filename !== src) { | |
return { | |
url: newsrc, | |
filename: filename, | |
extra: { | |
page: "http://news1.kr/photos/view/?" + filename | |
} | |
}; | |
} | |
return newsrc; | |
} | |
if (domain.indexOf(".joins.com") >= 0) { | |
// need test case | |
newsrc = src.replace(/\.tn_[0-9]*\..*/, ""); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "ir.joins.com" || | |
// https://loki.zhibotie.net/?u=https%3A%2F%2Fimg3.doubanio.com%2Fview%2Fgroup_topic%2Flarge%2Fpublic%2Fp66834704.jpg | |
// https://img3.doubanio.com/pview/group_topic/large/public/p66834704.jpg | |
domain === "loki.zhibotie.net") { | |
// http://ir.joins.com/?u=http%3A%2F%2Fpds.joins.com%2F%2Fnews%2Fcomponent%2Fhtmlphoto_mmdata%2F201802%2F02%2Ff1272e1a-836b-4e54-be62-1ab42de3b53b.jpg | |
// http://pds.joins.com//news/component/htmlphoto_mmdata/201802/02/f1272e1a-836b-4e54-be62-1ab42de3b53b.jpg | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/.*?[?&]u=([^&]*).*$/, "$1"); | |
if (newsrc !== src) | |
return decodeuri_ifneeded(newsrc); | |
} | |
if (domain_nosub === "koreadaily.com" && | |
domain.match(/^thumb[0-9]*\./)) { | |
// http://thumb5.koreadaily.com/tn.dll?w=450&h=253&url=http://pds.joins.com/news/component/htmlphoto_mmdata/201808/21/687941c0%2Dc590%2D4222%2D9263%2D669a56ff3bbc.jpg | |
// http://pds.joins.com/news/component/htmlphoto_mmdata/201808/21/687941c0-c590-4222-9263-669a56ff3bbc.jpg | |
// http://thumb5.koreadaily.com/cache/pds_joins_com/news/component/htmlphoto_mmdata/201808/21/F450x253_687941c0-c590-4222-9263-669a56ff3bbc_jpg.jpg | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/tn\.dll.*?[?&]url=([^&]*).*?$/, "$1"); | |
if (newsrc !== src) | |
return decodeURIComponent(newsrc); | |
} | |
if (domain === "uhd.img.topstarnews.net") { | |
// http://www.topstarnews.net/news/articleView.html?idxno=59506 | |
// http://uhd.img.topstarnews.net/wys2/file_attach/2014/05/20/1400555456-84-org.jpg -- dead | |
// http://www.topstarnews.net/news/photo/first/201405/img_59506_1_org.jpg | |
return src | |
.replace("/file_attach_thumb/", "/file_attach/") | |
.replace(/_[^/]*[0-9]*x[0-9]*_[^/]*(\.[^/]*)$/, "-org$1") | |
.replace(/(-[0-9]*)(\.[^/]*)$/, "$1-org$2"); | |
} | |
if (domain_nowww === "topstarnews.net" || | |
domain === "cdn.topstarnews.net" || | |
// http://cds.topstarnews.net/news/thumbnail/201911/698561_409137_392_v150.jpg | |
// http://cds.topstarnews.net/news/photo/201911/698561_409137_392_org.jpg | |
domain === "cds.topstarnews.net") { | |
// http://www.topstarnews.net/news/thumbnail/201802/365216_8748_4653_v150.jpg | |
// http://www.topstarnews.net/news/photo/201802/365216_8748_4653_org.jpg | |
// http://www.topstarnews.net/news/photo/201802/364365_7857_4310.jpg | |
// http://www.topstarnews.net/news/photo/201802/364365_7857_4310_org.jpg | |
// http://www.topstarnews.net/news/thumbnail/first/201710/img_319718_1_v150.jpg | |
// http://www.topstarnews.net/news/photo/first/201710/img_319718_1_org.jpg | |
// http://cdn.topstarnews.net/news/photo/first/201710/img_319718_1_org.jpg | |
// credit to Gyuri on discord | |
// http://cdn.topstarnews.net/news/photo/first/201406/img_63025_1.jpg/ndsoft/optimize | |
// http://www.topstarnews.net/news/photo/first/201406/img_63025_1_org.jpg | |
newsrc = src.replace(/:\/\/[^/]*\/(.*\/photo\/.*_[0-9]+)(\.[^/.]*)\/.*$/, "://www.topstarnews.net/$1_org$2"); | |
if (newsrc !== src) | |
return newsrc; | |
return src | |
.replace(/_v[0-9]+(\.[^/.]*)$/, "_org$1") | |
.replace(/(_[0-9]+)(\.[^/.]*)$/, "$1_org$2") | |
.replace("/thumbnail/", "/photo/"); | |
} | |
if (domain === "thumb.mt.co.kr" || | |
domain === "thumb.mtstarnews.com") { | |
// http://thumb.mt.co.kr/06/2017/12/2017122222438260548_1.jpg | |
// http://image.mt.co.kr/2017/12/2017122222438260548_1.jpg | |
// http://thumb.mtstarnews.com/06/2018/04/2018040415075698337_1.jpg | |
// http://thumb.mtstarnews.com/07/2018/04/2018040415075698337_1.jpg -- much smaller | |
// http://image.mtstarnews.com/2018/04/2018040415075698337_1.jpg | |
// http://thumb.mtstarnews.com/star_chi/02/2019/04/2019040415557949978_1.jpg | |
// http://image.mtstarnews.com/star_chi/2019/04/2019040415557949978_1.jpg | |
// https://thumb.mt.co.kr/11/2019/08/2019082308100726893_1.jpg/dims/resize/100x/optimize/ | |
// http://image.mt.co.kr/2019/08/2019082308100726893_1.jpg | |
newsrc = src.replace(/\/+dims\/.*/, ""); | |
if (newsrc !== src) | |
return newsrc; | |
// 06 and 21 seem to be identical | |
// after that, in order of size: 05, 07, 17, 11, 16, 10, 20, 04, 15, 03, 14, 19 | |
//src = src.replace(/(thumb\.[^/]*)\/[0-9]+(\/[0-9]*\/[0-9]*\/[^/]*).*/, "$1/06$2"); | |
newsrc = src.replace(/^[a-z]+:\/\/thumb\.([^/]*)\/+([^/]*\/+)?[0-9]{2}\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{8,}_[0-9]+\.)/, "http://image.$1/$2$3"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "menu.mt.co.kr" || | |
// https://img.koreatimes.co.kr/upload/thumbnailV2/590K2019061200203.jpg/dims/resize/720/optimize | |
// https://img.koreatimes.co.kr/upload/thumbnailV2/590K2019061200203.jpg | |
domain === "img.koreatimes.co.kr" || | |
// http://1290000230.desst.vcase2.myskcdn.com/1100000038/dev/1290000230/2018/03/20/1890835738_1_1.jpg?key=6a156742b5f85fb887bd7b79a94eea2471884c8c.3669019742&cid=1890835745&pid=1993936257&oid=1890835738/dims/resize/95x54 | |
// http://1290000230.desst.vcase2.myskcdn.com/1100000038/dev/1290000230/2018/03/20/1890835738_1_1.jpg?key=6a156742b5f85fb887bd7b79a94eea2471884c8c.3669019742&cid=1890835745&pid=1993936257&oid=1890835738 | |
domain_nosub === "myskcdn.com") { | |
// http://moneys.mt.co.kr/photoDb/mwPhotoDbList.php?no=2017013115555978429&page=1&idx=3 | |
// http://menu.mt.co.kr/moneyweek/photoDb/2017/01/31/20170131155559784294333.jpg/dims/optimize | |
// http://menu.mt.co.kr/moneyweek/thumb/2017/01/31/06/2017013115108024857_1.jpg -- smaller | |
// http://menu.mt.co.kr/moneyweek/thumb/2017/01/31/00/2017013115108024857_1.jpg -- not found | |
// http://menu.mt.co.kr/moneyweek/thumb/2018/03/05/19/2018030511008030850_1.jpg | |
// http://menu.mt.co.kr/moneyweek/thumb/2018/03/05/06/2018030511008030850_1.jpg | |
// http://menu.mt.co.kr/moneyweek/thumb/2018/03/05/00/2018030511008030850_1.jpg -- larger | |
// http://menu.mt.co.kr/moneyweek/thumb/2017/11/16/00/2017111614558031796_1.jpg/dims/optimize/ | |
// http://menu.mt.co.kr/moneyweek/thumb/2017/11/16/00/2017111614558031796_1.jpg | |
// http://menu.mt.co.kr/moneyweek/thumb/2017/11/16/06/2017111614558031796_1.jpg -- smaller | |
// http://menu.mt.co.kr/moneyweek/thumb/2018/01/14/00/2018011416088035798_2.jpg/dims/optimize/ | |
// http://menu.mt.co.kr/moneyweek/thumb/2018/03/09/06/2018030917238012410_1.jpg (found on sidebar) | |
// http://menu.mt.co.kr/moneyweek/thumb/2018/03/09/00/2018030917238012410_1.jpg | |
// http://menu.mt.co.kr/moneyweek/thumb/2017/06/24/06/2017062410078087905_1.jpg - larger than 00, but looks scaled | |
// https://menu.mt.co.kr/theleader/thumb/2019/12/06/2019120212067878586_1.jpg | |
// https://menu.mt.co.kr/theleader/thumb/2019/12/00/2019120212067878586_1.jpg | |
// http://menu.mt.co.kr/moneyweek/thumb/2017/05/26/00/2017052617068063683_1.jpg -- works | |
// http://menu.mt.co.kr/moneyweek/thumb/2017/05/23/00/2017052310108026652_1.jpg -- doesn't | |
// http://menu.mt.co.kr/theleader/photo_img/00/2018/02/01/2018020114447262989_0.jpg | |
// http://menu.mt.co.kr/moneys/images/bg_png30.png | |
// http://menu.mt.co.kr/moneys/images/bg_num1.png | |
if (/\/images\/+bg_[a-z]+[0-9]+\.png(?:[?#].*)?$/.test(src)) | |
return { | |
url: src, | |
bad: "mask" | |
}; | |
var obj = src.match(/\/thumb\/+(?:[0-9]+\/+){2,3}([0-9]+)\/[0-9]{10,}_/); | |
if (obj && obj[1] !== "00") { | |
var obj1_str = src.replace(/.*\/thumb\/+([0-9]+\/+[0-9]+\/+[0-9]+\/).*/, "$1").replace(/\//g, ""); | |
var obj1 = parseInt(obj1_str); | |
//console_log(obj1_str); | |
var num = "00"; | |
if (obj1 < 20170526) | |
num = "06"; | |
src = src.replace(/(\/thumb\/+(?:[0-9]+\/+){2,3})[0-9]+(\/+[0-9]{10,}_)/, "$1" + num + "$2"); | |
} | |
return src | |
.replace(/\/dims\/.*/, ""); | |
} | |
if (domain === "img.enews24.cjenm.skcdn.com") { | |
// http://img.enews24.cjenm.skcdn.com/News/NewsThumbnail/20180821/4_81524182.jpg | |
// http://img.enews24.cjenm.skcdn.com/News/NewsThumbnail/20180821/81524182.jpg -- 555x757 | |
// http://img.enews24.cjenm.skcdn.com/News/Contents/20180821/81524182.jpg -- same size | |
// http://img.enews24.cjenm.skcdn.com/News/NewsThumbnail/20180305/96260245.jpg -- 2208x2457 | |
// http://img.enews24.cjenm.skcdn.com/News/Contents/20180305/96260245.jpg -- 2208x2457 | |
// http://img.enews24.cjenm.skcdn.com/Photo/Contents/20180821/3_55037036.jpg -- 115x65 | |
// http://img.enews24.cjenm.skcdn.com/Photo/Contents/20180821/55037036.jpg -- 450x602 | |
return src | |
.replace(/\/News\/NewsThumbnail(\/[0-9]+\/)(?:[0-9]+_)?([0-9]+\.[^/.]*)$/, "/News/Contents$1$2") | |
.replace(/(\/Photo\/Contents\/[0-9]+\/)[0-9]+_([0-9]+\.[^/.]*)$/, "$1$2"); | |
} | |
if (domain_nosub === "stardailynews.co.kr" || | |
// http://www.stardailynews.co.kr/news/thumbnail/201808/212431_241837_1916_v150.jpg | |
// http://www.stardailynews.co.kr/news/photo/201808/212431_241837_1916.jpg | |
// http://www.liveen.co.kr/news/thumbnail/201809/230495_282622_126_v150.jpg | |
// http://www.liveen.co.kr/news/photo/201809/230495_282622_126.jpg | |
domain_nosub === "liveen.co.kr" || | |
// http://ilyoseoul.co.kr/news/thumbnail/201808/251059_177609_143_v150.jpg | |
// http://ilyoseoul.co.kr/news/photo/201808/251059_177609_143.jpg | |
domain_nosub === "ilyoseoul.co.kr" || | |
// http://www.sportsq.co.kr/news/thumbnail/201808/300799_291630_537_v150.jpg | |
// http://www.sportsq.co.kr/news/photo/201808/300799_291630_537.jpg | |
domain_nosub === "sportsq.co.kr" || | |
// http://www.zenithnews.com/news/thumbnail/201808/119840_109469_1835_v150.jpg | |
// http://www.zenithnews.com/news/photo/201808/119840_109469_1835.jpg | |
domain_nosub === "zenithnews.com" || | |
// http://www.munhwanews.com/news/thumbnail/201809/149954_197569_4039_v150.jpg | |
// http://www.munhwanews.com/news/photo/201809/149954_197569_4039.jpg | |
// doesn't work for all: | |
// http://www.munhwanews.com/news/thumbnail/201801/106108_163361_2456_v150.jpg | |
// http://www.munhwanews.com/news/photo/201801/106108_163361_2456.jpg | |
// http://www.munhwanews.com/news/photo/201801/106108_163361_2456.png -- works | |
domain_nowww === "munhwanews.com" || | |
// http://www.mhns.co.kr/news/thumbnail/201801/106108_163361_2456_v150.jpg | |
// http://www.mhns.co.kr/news/photo/201801/106108_163361_2456.png | |
domain_nowww === "mhns.co.kr" || | |
// http://www.ccdailynews.com/news/thumbnail/201801/953374_384565_4611_v150.jpg | |
domain_nowww === "ccdailynews.com" || | |
// http://ph.kyeonggi.com/news/thumbnail/201802/1440153_1332290_5913_150.jpg | |
// http://ph.kyeonggi.com/news/photo/201802/1440153_1332290_5913.jpg | |
// http://ph.kyeonggi.com/edit/news/view_img/PHOTO_1440148_1332273_5348_47.jpg | |
// http://ph.kyeonggi.com/news/photo/201802/1440148_1332273_5348.jpg | |
domain === "ph.kyeonggi.com" || | |
// http://www.jemin.com/news/thumbnail/201802/495551_158263_5710_v150.jpg | |
domain_nowww === "jemin.com" || | |
// http://www.domin.co.kr/news/thumbnail/201802/1183690_311011_329_v150.jpg | |
// http://www.domin.co.kr/news/photo/201802/1183690_311011_329.jpg (very hq) | |
// http://www.domin.co.kr/news/view_img/MAIN_2_2639_2152.jpg | |
// http://www.domin.co.kr/news/photo/201802/1183700_311009_2038.jpg | |
domain_nowww === "domin.co.kr" || | |
// http://cdn.jejudomin.co.kr/news/thumbnail/201802/96102_90506_3656_v150.jpg | |
// http://www.jejudomin.co.kr/photobox/photo/2018020261404454865.jpg | |
// http://cdn.jejudomin.co.kr/news/photo/201802/96119_90524_4043.jpg | |
domain === "cdn.jejudomin.co.kr" || | |
// http://ph.incheonilbo.com/news/thumbnail/201712/792780_315340_1230_150.jpg | |
domain === "ph.incheonilbo.com" || | |
// http://www.hidomin.com/news/thumbnail/201802/349870_151635_5018_v150.jpg | |
domain_nowww === "hidomin.com" || | |
// http://www.newsfreezone.co.kr/news/thumbnail/201802/38623_37635_844_v150.jpg | |
domain_nowww === "newsfreezone.co.kr" || | |
// http://cdn.newsfreezone.co.kr/news/thumbnail/201802/41850_39614_2056_v150.jpg | |
domain === "cdn.newsfreezone.co.kr" || | |
// http://www.newsinside.kr/news/thumbnail/201606/412819_220009_299_v150.jpg | |
domain_nowww === "newsinside.kr" || | |
// http://cdn.newsinside.kr/news/thumbnail/201807/500595_348177_554_v150.jpg | |
domain === "cdn.newsinside.kr" || | |
// http://www.greenpostkorea.co.kr/news/thumbnail/201802/85004_79031_3615_v150.jpg | |
domain_nowww === "greenpostkorea.co.kr" || | |
// http://www.egn.kr/news/thumbnail/201802/90010_149058_921_v150.jpg | |
// | |
// http://www.egn.kr/news/photo/201710/87447_142141_178.jpg | |
// http://www.egn.kr/news/photo/201710/87447_142142_179.jpg | |
// http://www.egn.kr/news/photo/201710/87447_142143_1710.jpg | |
domain_nowww === "egn.kr" || | |
// http://www.whitepaper.co.kr/news/thumbnail/201802/95633_76403_5942_v150.jpg | |
domain_nowww === "whitepaper.co.kr" || | |
// http://www.outdoornews.co.kr/news/thumbnail/201802/30078_79659_4819_v150.jpg | |
domain_nowww === "outdoornews.co.kr" || | |
// http://www.shinailbo.co.kr/news/thumbnail/201803/1049737_358211_645_v150.jpg | |
// http://www.shinailbo.co.kr/news/articleView.html?idxno=319278 | |
// http://www.shinailbo.co.kr/news/photo/201304/319278_175094_5325.jpg - 3500x1807 | |
domain_nowww === "shinailbo.co.kr" || | |
// http://www.ngtv.tv/news/thumbnail/201803/44169_57237_2756_v150.jpg | |
// http://www.ngtv.tv/news/articleView.html?idxno=24743 | |
// http://www.ngtv.tv/news/thumbnail/201503/24743_28146_3449_v150.jpg | |
// http://www.ngtv.tv/news/photo/201503/24743_28146_3449.jpg - 2364x1971 | |
domain_nowww === "ngtv.tv" || | |
// http://www.rnx.kr/news/thumbnail/201803/62152_50525_470_150.jpg | |
// http://m.rnx.kr/news/articleView.html?idxno=1390 | |
domain_nowww === "rnx.kr" || | |
// http://www.intronews.net/news/thumbnail/201803/85854_115174_717_v150.jpg | |
// http://www.intronews.net/news/articleView.html?idxno=85633 | |
// http://www.intronews.net/news/thumbnail/201802/85633_114974_1625_v150.jpg | |
domain_nowww === "intronews.net" || | |
// http://www.hg-times.com/news/thumbnail/201803/178090_128993_4414_v150.jpg | |
// http://www.hg-times.com/news/photo/201803/178090_128993_4414.jpg | |
domain_nowww === "hg-times.com" || | |
// http://www.iemn.kr/news/thumbnail/201606/2457_2879_40_v150.jpg | |
domain_nowww === "iemn.kr" || | |
// http://www.newscj.com/news/thumbnail/201803/newscj_%EC%B2%9C%EC%A7%80%EC%9D%BC%EB%B3%B4_505243_487804_229_v150.jpg | |
// http://www.newscj.com/news/photo/201803/newscj_%EC%B2%9C%EC%A7%80%EC%9D%BC%EB%B3%B4_505243_487804_229.jpg | |
// http://www.newscj.com/news/thumbnail/201809/newscj_천지일보_552148_548008_98_v150.jpg | |
// http://www.newscj.com/news/photo/201809/newscj_%EC%B2%9C%EC%A7%80%EC%9D%BC%EB%B3%B4_552148_548008_98.jpg | |
// http://cds.newscj.com/news/thumbnail/201809/newscj_천지일보_552148_548008_98_v150.jpg | |
// http://cds.newscj.com/news/photo/201809/newscj_%EC%B2%9C%EC%A7%80%EC%9D%BC%EB%B3%B4_552148_548008_98.jpg | |
// http://www.newscj.com/news/thumbnail/201908/newscj_%EC%B2%9C%EC%A7%80%EC%9D%BC%EB%B3%B4_661837_676135_413_orgBig_v150.jpg | |
// http://www.newscj.com/news/photo/201908/newscj_%EC%B2%9C%EC%A7%80%EC%9D%BC%EB%B3%B4_661837_676135_413.jpg | |
domain_nosub === "newscj.com" || | |
// http://www.ggilbo.com/news/thumbnail/201802/444114_351433_497_v150.jpg | |
domain_nowww === "ggilbo.com" || | |
// http://www.bstoday.kr/news/thumbnail/201804/200376_125982_145_v150.jpg | |
// | |
// http://www.bstoday.kr/news/articleView.html?idxno=5090 | |
// http://www.bstoday.kr/photobox/photo/2018032371050517410.jpg | |
// http://www.bstoday.kr/news/photo/201508/5090_4090_1029.jpg | |
domain_nowww === "bstoday.kr" || | |
// http://interfootball.heraldcorp.com/news/thumbnail/201803/194965_212367_3835_150.jpg | |
domain === "interfootball.heraldcorp.com" || | |
// http://www.ilyosisa.co.kr/news/thumbnail/201805/145247_81281_562_v150.jpg | |
domain_nowww === "ilyosisa.co.kr" || | |
// http://www.ynnews.kr/news/thumbnail/201805/130007_85746_295_150.jpg | |
domain_nowww === "ynnews.kr" || | |
// http://www.starilbo.com/news/thumbnail/201802/43552_58572_5916_v150.jpg | |
domain_nowww === "starilbo.com" || | |
// http://www.autoherald.co.kr/news/thumbnail/201805/31572_48631_5317_v150.jpg | |
domain_nowww === "autoherald.co.kr" || | |
// http://www.00news.co.kr/news/thumbnail/201805/53198_101527_5227_v150.jpg | |
domain_nowww === "00news.co.kr" || | |
// http://www.kstarfashion.com/news/thumbnail/201805/131724_67495_4142_v150.jpg | |
domain_nowww === "kstarfashion.com" || | |
// http://www.inewspeople.co.kr/news/thumbnail/201611/12355_20610_5726_v150.jpg | |
domain_nowww === "inewspeople.co.kr" || | |
// http://www.staraz.co.kr/news/thumbnail/201703/32882_7294_2352_v150.jpg | |
// no longer works | |
//domain_nowww === "staraz.co.kr" || | |
// http://www.wonnews.co.kr/news/thumbnail/201805/201275_36498_2029_v150.jpg | |
domain_nowww === "wonnews.co.kr" || | |
// http://www.gukjenews.com/news/thumbnail/201806/938035_714703_1521_v150.jpg | |
// http://cdn.gukjenews.com/news/thumbnail/201806/938035_714703_1521_v150.jpg | |
domain_nosub === "gukjenews.com" || | |
// http://www.lunarglobalstar.com/news/thumbnail/201806/19254_15963_1148_v150.jpg | |
domain_nowww === "lunarglobalstar.com" || | |
// http://www.sundayjournal.kr/news/thumbnail/201806/15914_26675_3235_v150.jpg | |
domain_nowww === "sundayjournal.kr" || | |
// http://www.stnsports.co.kr/news/thumbnail/201806/78500_39611_034_v150.jpg | |
domain_nowww === "stnsports.co.kr" || | |
// http://www.thekpm.com/news/thumbnail/201806/21213_21127_1440_v150.jpg | |
domain_nowww === "thekpm.com" || | |
// http://chunchu.yonsei.ac.kr/news/thumbnail/201806/24380_12155_3112_v150.jpg | |
domain === "chunchu.yonsei.ac.kr" || | |
// http://www.e2news.com/news/thumbnail/201807/200453_60290_1157_v150.jpg | |
domain_nowww === "e2news.com" || | |
// http://www.newswiz.kr/news/thumbnail/201803/2250_2132_412_150.jpg | |
// doesn't work anymore | |
//domain_nowww === "newswiz.kr" || | |
// http://ph.spotvnews.co.kr/news/thumbnail/201809/234592_287106_0230_150.jpg | |
// http://ph.spotvnews.co.kr/news/photo/201809/234592_287106_0230.jpg | |
domain === "ph.spotvnews.co.kr" || | |
// http://www.sisunnews.co.kr/news/thumbnail/201603/34339_48461_5310_v150.jpg | |
domain_nowww === "sisunnews.co.kr" || | |
// http://www.kpinews.co.kr/news/thumbnail/201810/83057_52603_315_150.jpg | |
domain_nowww === "kpinews.co.kr" || | |
// http://www.4th.kr/news/thumbnail/201611/28739_3653_4123_150.jpg | |
// http://www.4th.kr/news/photo/201611/28739_3653_4123.png | |
domain_nowww === "4th.kr" || | |
// http://cds.topdaily.kr/news/thumbnail/201812/56185_20164_437_v150.jpg | |
// http://cds.topdaily.kr/news/photo/201812/56185_20164_437.jpeg | |
domain === "cds.topdaily.kr" || | |
// http://www.kntimes.co.kr/news/thumbnail/201807/26257_33405_1126_v150.jpg | |
domain_nowww === "kntimes.co.kr" || | |
// http://www.senmedia.kr/news/thumbnail/201709/2842_2729_2543_v150.jpg | |
domain_nowww === "senmedia.kr" || | |
// http://www.siminilbo.co.kr/news/thumbnail/201904/617941_158117_436_v150.jpg | |
domain_nowww === "siminilbo.co.kr" || | |
// http://www.sisafocus.co.kr/news/thumbnail/201904/207963_245791_2137_v150.jpg | |
domain_nowww === "sisafocus.co.kr" || | |
// http://www.futurekorea.co.kr/news/thumbnail/201904/116934_117354_5130_v150.jpg | |
domain_nowww === "futurekorea.co.kr" || | |
// http://www.dailygrid.net/news/thumbnail/201904/216463_115815_96_v150.jpg | |
domain_nowww === "dailygrid.net" || | |
// http://www.datanet.co.kr/news/thumbnail/201904/133154_58977_577_v150.jpg | |
domain_nowww === "datanet.co.kr" || | |
// http://www.slist.kr/news/thumbnail/201902/67706_145468_352_v150.jpg | |
domain_nowww === "slist.kr" || | |
// http://www.secondmirror.co.kr/news/thumbnail/201902/975_949_3434_v150.jpg | |
domain_nowww === "secondmirror.co.kr" || | |
// http://www.ntoday.co.kr/news/thumbnail/201604/42811_17317_2848_v150.jpg | |
domain_nowww === "ntoday.co.kr" || | |
// http://www.seoulilbo.com/news/thumbnail/201603/130273_55917_389_v150.jpg | |
domain_nowww === "seoulilbo.com" || | |
// http://www.lecturernews.com/news/thumbnail/201905/19595_47130_5520_150.jpg | |
domain_nowww === "lecturernews.com" || | |
// http://www.youthdaily.co.kr/news/thumbnail/201904/11136_11059_4958_v150.jpg | |
domain_nowww === "youthdaily.co.kr" || | |
// http://www.mdaily.net/news/thumbnail/201904/21619_26375_1729_v150.jpg | |
domain_nowww === "mdaily.net" || | |
// http://www.cctoday.co.kr/news/thumbnail/201906/2006428_504058_3632_v150.jpg | |
domain_nowww === "cctoday.co.kr" || | |
// http://www.gnmaeil.com/news/thumbnail/201903/409191_447180_487_v150.jpg | |
domain_nowww === "gnmaeil.com" || | |
// http://en.mhnew.com/news/thumbnail/201903/3370_5124_295_v150.jpg | |
domain_nosub === "mhnew.com" || | |
// http://www.mediadale.com/news/thumbnail/201903/14728_18216_3020_v150.jpg | |
domain_nowww === "mediadale.com" || | |
// http://viewers.heraldcorp.com/news/thumbnail/201903/31241_27009_3343_v150.jpg | |
domain === "viewers.heraldcorp.com" || | |
// http://www.biztribune.co.kr/news/thumbnail/201903/204838_55259_3431_v150.jpg | |
domain_nowww === "biztribune.co.kr" || | |
// http://www.obsnews.co.kr/news/thumbnail/201903/1147272_352387_1820_v150.jpg | |
domain_nowww === "obsnews.co.kr" || | |
// http://www.kyeonggi.com/news/thumbnail/201903/2067792_861603_5016_v150.jpg | |
domain_nowww === "kyeonggi.com" || | |
// http://www.iloveorganic.co.kr/news/thumbnail/201903/221692_24198_530_150.jpg | |
domain_nowww === "iloveorganic.co.kr" || | |
// http://www.newslock.co.kr/news/thumbnail/201903/3564998_high_v150.jpg | |
// http://www.newslock.co.kr/news/photo/201903/3564998_high.jpg | |
// http://www.newslock.co.kr/news/thumbnail/201906/19336_14698_1623_v150.jpg | |
// http://www.newslock.co.kr/news/photo/201906/19336_14698_1623.jpg | |
// http://www.newslock.co.kr/news/photo/201906/19336_high.jpg -- doesn't work | |
domain_nowww === "newslock.co.kr" || | |
// http://www.news33.net/news/thumbnail/201809/31583_15312_1018_v150.jpg | |
domain_nowww === "news33.net" || | |
// http://www.mainnews.kr/news/thumbnail/201812/66967_53693_258_150.jpg | |
domain_nowww === "mainnews.kr" || | |
// http://www.ilemonde.com/news/thumbnail/201901/10159_20297_4932_v150.jpg | |
domain_nowww === "ilemonde.com" || | |
// http://www.canews.kr/news/thumbnail/201901/1598_2307_444_v150.jpg | |
domain_nowww === "canews.kr" || | |
// http://www.newsflix.co.kr/news/thumbnail/201901/348_168_4151_v150.jpg | |
domain_nowww === "newsflix.co.kr" || | |
// http://www.gokorea.kr/news/thumbnail/201901/66876_104058_015_v150.jpg | |
domain_nowww === "gokorea.kr" || | |
// http://www.womaneconomy.kr/news/thumbnail/201701/43819_73700_258_v150.jpg | |
domain_nowww === "womaneconomy.kr" || | |
// http://www.apsk.co.kr/news/thumbnail/201907/4133_10362_2721_v150.jpg | |
domain_nowww === "apsk.co.kr" || | |
// http://www.sporbiz.co.kr/news/thumbnail/201907/356684_265899_649_v150.jpg | |
domain_nowww === "sporbiz.co.kr" || | |
// http://www.lovesbeauty.co.kr/news/thumbnail/201403/6451_10368_1200_v150.jpg | |
domain_nowww === "lovesbeauty.co.kr" || | |
// http://www.ikoreadaily.co.kr/news/thumbnail/201506/200257_95468_3552_v150.jpg | |
domain_nowww === "ikoreadaily.co.kr" || | |
// http://www.interview365.com/news/thumbnail/201908/88350_115004_3128_v150.jpg | |
domain_nowww === "interview365.com" || | |
// http://www.newsa.co.kr/news/thumbnail/201908/229705_168792_3246_v150.jpg | |
domain_nowww === "newsa.co.kr" || | |
// http://www.newstown.co.kr/news/thumbnail/201801/311251_198441_4816_v150.jpg | |
domain_nowww === "newstown.co.kr" || | |
// http://www.kgdm.co.kr/news/thumbnail/201908/652501_225858_1621_v150.jpg | |
src.match(/^[a-z]+:\/\/[^/]+\/+news\/+thumbnail\/+[0-9]{6}\/+[0-9]+_[0-9]+_[0-9]+_v?150\.[^/.]*(?:[?#].*)?$/)) { | |
newsrc = src.replace(/\/thumbnail\/+([0-9]{6}\/+(?:[^/.]*_)?[0-9]+_[0-9]+_[0-9]+)(?:_orgBig)?_v?150(\.[^/.]*)(?:[?#].*)?$/, "/photo/$1$2"); | |
if (newsrc !== src) | |
return add_extensions_upper_jpeg(newsrc); | |
//return add_extensions_upper_jpeg(src | |
// .replace("/thumbnail/", "/photo/") | |
// //.replace(/_v[0-9]*\.([^/]*)$/, ".$1") | |
// .replace(/(\/[0-9]+_[0-9]+_[0-9]+)_(?:orgBig_)?v?150(\.[^/.]*)$/, "$1$2")); | |
} | |
if (domain === "shop.newsen.com") { | |
// http://shop.newsen.com/data/thumb/200_142_201808171221570910_1.jpg | |
// http://photo.newsen.com/news_photo/2018/08/17/201808171221570910_1.jpg | |
return src.replace(/:\/\/[^/]*\/+data\/+thumb\/+[0-9]+_[0-9]+_([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([^/]*)$/, "://photo.newsen.com/news_photo/$1/$2/$3/$1$2$3$4"); | |
} | |
if (domain === "cdn.newsen.com" || | |
domain === "photo.newsen.com") { | |
// http://photo.newsen.com/news_photo/2011/04/28/201104281531181001_1.jpg -- 2880x4320 | |
// http://cdn.newsen.com/newsen/news_photo/2011/04/28/201104281531181001_1.jpg -- same | |
// http://www.newsen.com/news_view.php?uid=201903062017275510 | |
// http://cdn.newsen.com/newsen/news_photo/2019/03/06/201903062017275510_1.jpg -- 540x842 | |
// https://entertain.v.daum.net/v/20190306201751601 | |
// https://t1.daumcdn.net/news/201903/06/newsen/20190306201751195iqvu.jpg -- 641x1000 | |
// other: | |
// http://photo.newsen.com/photo/2006/05/15/200605151650091006_1.jpg | |
newsrc = src.replace(/_ts\.[^/._]*$/, ".jpg").replace("/mphoto/", "/news_photo/"); | |
if (newsrc !== src) | |
return newsrc; | |
if (src.indexOf("/main_photo/") >= 0) { | |
// http://cdn.newsen.com/newsen/main_photo/index_a2_201801030825321910_1.jpg | |
// http://cdn.newsen.com/newsen/news_photo/2018/01/03/201801030825321910_1.jpg | |
// http://cdn.newsen.com/newsen/main_photo/mobile/favphoto_201807131531391510_1.jpg | |
// http://cdn.newsen.com/newsen/news_photo/2018/07/13/201807131531391510_1.jpg | |
// http://photo.newsen.com/news_photo/2018/07/13/201807131531391510_1.jpg | |
newsrc = src.replace(/\/main_photo\/+(?:mobile\/+)?[^/]*_([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([^/]*)$/, "/news_photo/$1/$2/$3/$1$2$3$4"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
// http://cdn.newsen.com/newsen/resize/235x-/2019/05/18/201905182149162610_1.jpg | |
// http://cdn.newsen.com/newsen/news_photo/2019/05/18/201905182149162610_1.jpg | |
newsrc = src.replace(/\/resize\/+[-0-9]+x[-0-9]+\/+/, "/news_photo/"); | |
if (newsrc !== src) | |
return newsrc; | |
var extra = {}; | |
match = src.match(/cdn\.newsen\.com\/+newsen\/+news_photo\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}([0-9]{10,})_[0-9]+\.[^/.]*(?:[?#].*)?$/); | |
var pageid = null; | |
if (match || | |
(match = src.match(/photo\.newsen\.com\/+news_photo\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}([0-9]{10,})_[0-9]+\.[^/.]*(?:[?#].*)?$/))) { | |
pageid = match[1]; | |
extra.page = "http://www.newsen.com/news_view.php?uid=" + match[1]; | |
} | |
var obj = { | |
url: src, | |
headers: { | |
Referer: "http://www.newsen.com/" | |
}, | |
referer_ok: { | |
same_domain_nosub: true | |
}, | |
extra: extra | |
}; | |
// http://www.newsen.com/news_view.php?uid=201909050803320410 -- multiple images in one page | |
// http://cdn.newsen.com/newsen/news_photo/2019/09/05/201909050803320410_1.jpg | |
if (extra.page && options && options.cb && options.allow_thirdparty && options.do_request) { | |
var get_imageid = function(url) { | |
if (!url) | |
return url; | |
var match = url.match(/\/[0-9]{4}\/+(?:[0-9]{2}\/+){2}([0-9]{10,}_[0-9]+)\.[^/.]*(?:[?#].*)?$/); | |
if (!match) | |
return null; | |
if (_nir_debug_) | |
console_log("Image ID for " + url + ":", match[1]); | |
return match[1]; | |
}; | |
var get_newsen_pageinfo = function(page, pageid, cb) { | |
api_cache.fetch("newsen_pageinfo:" + pageid, cb, function(done) { | |
options.do_request({ | |
method: "GET", | |
url: extra.page, | |
overrideMimeType: "text/html; charset=euc-kr", | |
onload: function(result) { | |
if (result.readyState !== 4) | |
return; | |
if (result.status !== 200) { | |
return done(null, false); | |
} | |
var match = result.responseText.match(/<meta\s+property=["']og:title["']\s+content=["']([^'"]+)["']/); | |
if (!match) { | |
return done(null, false); | |
} | |
var title = match[1]; | |
console_log("Title: ", title); | |
match = result.responseText.match(/<img\s+id=["']artImg["']\s+src=["'](?:https?:)\/\/[a-z]+\.newsen\.com\/.*?["']/g); | |
if (!match) { | |
return done(null, false); | |
} | |
return done({ | |
page: result.finalUrl, | |
title: title, | |
images: match | |
}, 6*60*60); | |
} | |
}); | |
}); | |
}; | |
var get_imagenum_from_newsen_pageinfo = function(image, pageinfo) { | |
var imageid = get_imageid(image); | |
if (!imageid) | |
return null; | |
var imagenum; | |
for (imagenum = 0; imagenum < pageinfo.images.length; imagenum++) { | |
var i_imageid = get_imageid(pageinfo.images[imagenum]); | |
if (!i_imageid) | |
continue; | |
if (i_imageid === imageid) | |
break; | |
} | |
if (imagenum === pageinfo.images.length) { | |
return null; | |
} | |
return imagenum; | |
}; | |
var get_daum_search_results = function(title, cb) { | |
api_cache.fetch("newsen_daum_search:" + title, cb, function(done) { | |
var searchurl = "https://m.search.daum.net/search?w=news&q=" + encodeURIComponent(title) + "&enc=utf8"; | |
options.do_request({ | |
method: "GET", | |
url: searchurl, | |
onload: function (result) { | |
if (result.readyState !== 4) { | |
return; | |
} | |
if (result.status !== 200) { | |
return done(null, false); | |
} | |
// TODO: check date too | |
var entry_regex = /<a\s+class=["']info_item["']\s+href=["']((?:https?:)\/\/v\.media\.daum\.net\/+.*?)["'][^>]*?>\s*(?:<div\s+class=["']compo-.*?["']\s*>\s*)?<span\s+class=["']wrap_(?:tit|head)["']\s*>(?:\s*<strong\s+class=["']tit-g["']\s*>\s*)?([\s\S]*?)(?:\s*<\/strong>\s*)?<\/span>/g; | |
var nonglobal_regex = new RegExp(entry_regex, ""); | |
var entries_match = result.responseText.match(entry_regex); | |
if (!entries_match) { | |
console_error("No search entries found", searchurl); | |
console_log(result); | |
return done(null, false); | |
} | |
var search_entries = []; | |
for (var entry_i = 0; entry_i < entries_match.length; entry_i++) { | |
var match = entries_match[entry_i].match(nonglobal_regex); | |
if (!match) { | |
console_error("Unable to match non-global regex (this shouldn't happen)"); | |
continue; | |
} | |
search_entries.push({ | |
title: decode_entities(match[2].replace(/<([a-z]+)(?:\s+.*?)?>(.*?)<\/\1>/g, "$2")), | |
// getting rid of ?f=o, which'll redirect to newsen instead | |
url: urljoin(result.finalUrl, match[1].replace(/[?#].*/, ""), true) | |
}); | |
} | |
if (search_entries.length === 0) { | |
console_error("Zero search entries found", searchurl); | |
} | |
done(search_entries, 2*60*60); | |
} | |
}); | |
}); | |
}; | |
var get_daum_url_from_results = function(real_title, real_pageid, results) { | |
if (!results) | |
return null; | |
// Daum seems to cut off the text at 38 characters in, let's use 35 to be safe | |
var real_fuzzy = fuzzify_text(real_title).substr(0, 35); | |
for (var i = 0; i < results.length; i++) { | |
if (real_fuzzy !== fuzzify_text(results[i].title).substr(0, 35)) { | |
continue; | |
} | |
var pageid = results[i].url.replace(/.*\/v\/([0-9]+)$/, "$1"); | |
if (pageid === results[i].url) { | |
console_error("Unhandled URL: " + results[i].url); | |
continue; | |
} | |
if (!fuzzy_date_compare(pageid.substr(0, 8), real_pageid.substr(0, 8))) { | |
if (_nir_debug_) { | |
console_log("Skipping:", pageid, real_pageid); | |
} | |
continue; | |
} | |
return results[i].url; | |
} | |
console_error("Unable to find result from search", real_title, results); | |
return null; | |
}; | |
var get_daum_pageinfo = function(daumurl, cb) { | |
api_cache.fetch("newsen_daum_pageinfo:" + daumurl, cb, function(done) { | |
options.do_request({ | |
method: "GET", | |
url: daumurl, | |
onload: function (result) { | |
if (result.readyState !== 4) | |
return; | |
if (result.status !== 200) { | |
return done(null, false); | |
} | |
var image_regex = /<img[^>]+dmcf-mtype=["']image["'][^>]+src=["']((?:https?:)\/\/[^/]+\.daumcdn\.net\/.*?)["']/g; | |
var nonglobal_regex = new RegExp(image_regex, ""); | |
var obj = { | |
url: result.finalUrl, | |
images: [] | |
}; | |
var images_match = result.responseText.match(image_regex); | |
if (!images_match) { | |
return done(obj, 60*60); | |
} | |
for (var i = 0; i < images_match.length; i++) { | |
var image_match = images_match[i].match(nonglobal_regex); | |
if (!image_match) | |
continue; | |
obj.images.push(urljoin(result.finalUrl, image_match[1], true)); | |
} | |
done(obj, 6*60*60); | |
} | |
}); | |
}); | |
}; | |
get_newsen_pageinfo(extra.page, pageid, function(pageinfo) { | |
if (!pageinfo) { | |
return options.cb(obj); | |
} | |
var title = pageinfo.title; | |
var total_images = pageinfo.images.length; | |
var imagenum = get_imagenum_from_newsen_pageinfo(src, pageinfo); | |
if (imagenum === null) { | |
return options.cb(obj); | |
} | |
get_daum_search_results(title, function(results) { | |
var daumurl = get_daum_url_from_results(title, pageid, results); | |
if (!daumurl) | |
return options.cb(obj); | |
console_log("Daum article URL:", daumurl); | |
get_daum_pageinfo(daumurl, function(daum_pageinfo) { | |
if (!daum_pageinfo) | |
return options.cb(obj); | |
if (daum_pageinfo.images.length !== total_images) { | |
console_error("Image number mismatch"); | |
return options.cb(obj); | |
} | |
obj.url = daum_pageinfo.images[imagenum]; | |
obj.extra.page = daum_pageinfo.url; | |
delete obj.headers.Referer; | |
return options.cb(obj); | |
}); | |
}); | |
}); | |
return { | |
waiting: true | |
}; | |
} | |
return obj; | |
} | |
if (domain === "sccdn.chosun.com") { | |
// http://sccdn.chosun.com/news/photobook/201504/13267_scr_201504140000000022741_t.jpg | |
// http://sccdn.chosun.com/news/photobook/201504/13267_201504140000000022741.jpg | |
// http://sccdn.chosun.com/news/photobook/201504/13267_2015041400000000000122741_t.jpg | |
// http://sccdn.chosun.com/news/photobook/201504/13267_2015041400000000000122741.jpg | |
// http://sccdn.chosun.com/news/photobook/201203/4488_scr_%EB%8D%9C%EB%8D%9C_t.jpg | |
// large: | |
// http://sccdn.chosun.com/news/photobook/201710/23202_2017101301010007001.jpeg | |
// http://sccdn.chosun.com/news/photobook/201412/11896_20141201010101000972.jpeg | |
// http://sccdn.chosun.com/news/photobook/201607/18084_207777778888816070401010002381.jpeg | |
// http://sccdn.chosun.com/news/photobook/201412/11896_2014120101000156100006731.jpg - small | |
// http://sccdn.chosun.com/news/photobook/201412/11896_2014120101000155800006701.jpg - ^ | |
// other: | |
// http://sccdn.chosun.com/news/photobook/201908/29780_2019062501001807700123651.jpg | |
// http://sccdn.chosun.com/news/html/2019/06/25/2019062501001807700123651.jpg | |
// http://sports.chosun.com/news/news.htm?id=201906250100180770012365&ServiceDate=20190625 -- ServiceDate is needed | |
return src.replace(/\/([0-9]*_)(?:scr_)?([^._/]*)(?:_t)?(\.[^/.]*)$/, "/$1$2$3"); | |
} | |
if (domain_nosub === "chosun.com" || | |
// http://the-star.co.kr/site/data/thumb_dir/2015/11/13/2015111301003_0_thumb.jpg | |
// http://the-star.co.kr/site/data/img_dir/2015/11/13/2015111301003_0.jpg | |
domain_nowww === "the-star.co.kr" || | |
// http://digitalchosun.dizzo.com/site/data/html_dir/2019/10/02/2019100280037.html | |
// http://digitalchosun.dizzo.com/site/data/thumb_dir/2019/10/02/2019100280036_0_thumb.jpg | |
// http://digitalchosun.dizzo.com/site/data/img_dir/2019/10/02/2019100280036_0.jpg | |
domain === "digitalchosun.dizzo.com" || | |
domain_nosub === "chosunonline.com") { | |
// works: | |
// http://woman.chosun.com/up_fd/wc_news/2018-01/simg_thumb/1802_292s.jpg | |
// http://woman.chosun.com/up_fd/wc_news/2018-01/simg_org/1802_292s.jpg | |
// http://woman.chosun.com/up_fd/wc_news/2018-01/bimg_org/1802_292.jpg | |
// http://woman.chosun.com/up_fd/wc_news/2018-01/simg_org/1802_294s.jpg | |
// http://woman.chosun.com/up_fd/wc_news/2018-01/bimg_org/1802_294.jpg | |
// http://woman.chosun.com/up_fd/wc_news/2018-02/simg_org/1802_88s.jpg | |
// http://woman.chosun.com/up_fd/wc_news/2018-02/bimg_org/1802_88.jpg | |
// http://woman.chosun.com/up_fd/wc_news/2018-02/simg_org/1802_340s.jpg | |
// http://woman.chosun.com/up_fd/wc_news/2018-02/bimg_org/1802_340.jpg | |
// http://woman.chosun.com/up_fd/wc_news/2018-01/simg_org/1802_294s.jpg | |
// http://woman.chosun.com/up_fd/wc_news/2018-01/bimg_org/1802_294.jpg | |
// http://woman.chosun.com/up_fd/wc_news/2018-02/simg_org/1802_322s.jpg | |
// http://woman.chosun.com/up_fd/wc_news/2018-02/bimg_org/1802_322.jpg | |
// http://ekr.chosunonline.com/site/data/thumb_dir/2018/02/23/2018022301051_1_thumb.jpg | |
// http://ekr.chosunonline.com/site/data/img_dir/2018/02/23/2018022301051_1.jpg | |
// http://ekr.chosunonline.com/site/data/thumb_dir/2018/02/21/2018022101757_3_thumb.jpg | |
// http://ekr.chosunonline.com/site/data/img_dir/2018/02/21/2018022101757_3.jpg | |
// | |
// doesn't work: | |
// http://woman.chosun.com/up_fd/wc_news/2018-01/simg_org/1801_164s.jpg | |
// http://ekr.chosunonline.com/site/data/img_dir/2015/07/16/2015071601601_thumb.jpg | |
// http://ekr.chosunonline.com/site/data/img_dir/2017/10/24/2017102400705_thumb.jpg | |
// http://ekr.chosunonline.com/site/data/img_dir/2017/10/24/2017102400675_0.jpg | |
newsrc = src | |
//.replace(/\/simg_(?:thumb|org)\/([^/]*)s(\.[^/.]*)$/, "/bimg_org/$1$2") | |
.replace("/simg_thumb/", "/simg_org/") | |
.replace(/\/thumb_dir\/(.*)_thumb(\.[^/.]*)$/, "/img_dir/$1$2") | |
// http://image.chosun.com/sitedata/thumbnail/201803/08/2018030801755_0_thumb.jpg | |
// http://image.chosun.com/sitedata/image/201803/08/2018030801755_0.jpg | |
.replace(/\/thumbnail\/(.*?)(?:_thumb)?(\.[^/.]*)$/, "/image/$1$2"); | |
if (newsrc !== src) | |
return add_full_extensions(newsrc); | |
id = src.match(/\/site\/+data\/+img_dir\/+([0-9]{4}\/+(?:[0-9]{2}\/+){2})([0-9]{10,})_[0-9]+\./); | |
if (false && id) { | |
var id_plus_one = parseInt(id[2]) + 1; // doesn't always work | |
return { | |
url: src, | |
extra: { | |
page: src.replace(/\/site\/+data\/+img_dir\/+.*/, "/site/data/html_dir/" + id[1] + (id_plus_one) + ".html") | |
} | |
}; | |
} | |
} | |
// replaced in large rule above | |
/*if (false && domain.indexOf("ph.spotvnews.co.kr") >= 0) { | |
return src.replace("/thumbnail/", "/photo/").replace(/([0-9]+_[0-9]+_[0-9]+)_[0-9]+\.([^/]*)$/, "$1.$2"); | |
}*/ | |
if (domain === "photo.hankooki.com") { | |
// http://photo.hankooki.com/newsphoto/v001/thumbs/2017/06/23/tsjmao20170623113309_O_00_C_1.jpg | |
// http://photo.hankooki.com/newsphoto/v001/2017/06/23/sjmao20170623113309_O_00_C_1.jpg | |
// http://photo.hankooki.com/arch/thumbs/P/2017/10/25/t20171025182853_P_00_C_1_846.jpg | |
// http://photo.hankooki.com/arch/photo/P/2017/10/25/20171025182853_P_00_C_1_846.jpg | |
// http://photo.hankooki.com/arch/original/P/2017/10/25/20171025182853_P_00_C_1_846.jpg | |
// http://photo.hankooki.com/newsphoto/yonhap/thumbs/2016/05/17/t_20160517121834.jpg | |
// http://photo.hankooki.com/newsphoto/yonhap/2016/05/17/20160517121834.jpg | |
// http://photo.hankooki.com/newsphoto/v001/thumbs/2018/01/28/20180128000108_1_holic.jpg -- doesn't work | |
// http://photo.hankooki.com/newsphoto/v001/2018/01/27/jay1220180127233802_P_02_C_1.jpg (unrelated url?) | |
// http://photo.hankooki.com/newsphoto/v001/thumbs/2014/11/11/tegeriace20141111172610_X_01_C_1.jpg -- doesn't work, tries to go to: | |
// http://photo.hankooki.com/newsphoto/v001/2014/11/11/egeriace20141111172610_X_01_C_1.jpg | |
// real: | |
// http://photo.hankooki.com/newsphoto/v001/2014/11/11/wegeriace20141111172610_X_01_C_1.jpg | |
newsrc = src.replace("/arch/photo/", "/arch/original/") | |
.replace("/arch/thumbs/", "/arch/original/") | |
.replace(/(\/newsphoto\/[^/]*\/)thumbs\//, "$1"); | |
//.replace(/(.*\/)t([0-9]*[^/]*)$/, "$1$2"); | |
if (newsrc !== src) { | |
return newsrc.replace(/(.*\/)t_?([^/]*)$/, "$1$2"); | |
} else { | |
return src; | |
} | |
} | |
if (domain === "thumb.hankooki.com") { | |
// http://thumb.hankooki.com/gisaphoto/inews/2014/09/11/282x170xIR@0911087100636.jpg | |
// http://photo.hankooki.com/gisaphoto/inews/2014/09/11/0911087100636.jpg | |
return src.replace(/:\/\/[^/]*\/+(.*\/+)[0-9]+x[0-9]+x[^/]*@([^/]*)(?:[?#].*)?$/, | |
"://photo.hankooki.com/$1$2"); | |
} | |
if (domain_nosub === "ettoday.net") { | |
// https://cdn2.ettoday.net/images/1760/d1760595.jpg | |
// https://cdn2.ettoday.net/images/1760/1760595.jpg | |
// https://static.ettoday.net/images/3341/c3341311.jpg -- 400x267 | |
// https://static.ettoday.net/images/3341/3341311.jpg -- 5499x3666 | |
// http://cdn2.ettoday.net/images/3228/c3228532.jpg | |
// http://cdn2.ettoday.net/images/3228/3228532.jpg -- works, but is not interpreted as an image | |
// http://static.ettoday.net/images/3228/3228532.jpg | |
// https://cdn2.ettoday.net/images/4135/d4135251.jpg | |
// https://static.ettoday.net/images/4135/4135251.jpg | |
return { | |
url: src | |
.replace(/\/[a-z]+([0-9]*\.[^/]*)(?:[?#].*)?$/, "/$1") | |
.replace(/:\/\/cdn[0-9]*\./, "://static."), | |
head_wrong_contenttype: true | |
}; | |
} | |
if (domain === "img.mbn.co.kr") { | |
// http://img.mbn.co.kr/filewww/news/other/2012/04/30/340200121110.jpg - 5705x2917 | |
return src.replace(/_s[0-9]+x[0-9]+(\.[^/]*)$/, "$1"); | |
} | |
if (domain === "imgmmw.mbn.co.kr") { | |
// http://imgmmw.mbn.co.kr/storage/news/2018/12/11/0BBA1180-1749-4768-8F8A-91A334414CB9_576.jpg | |
// http://imgmmw.mbn.co.kr/storage/news/2018/12/11/0BBA1180-1749-4768-8F8A-91A334414CB9.jpg | |
return src.replace(/(\/storage\/+news\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[-0-9A-F]{30,})_[0-9]+(\.[^/.]*)*(?:[?#].*)?$/, | |
"$1$2"); | |
} | |
if (domain === "image-gd.inews24.com") { | |
// http://image-gd.inews24.com/image.php?u=/image_joy/201804/1522932288117_1_214943.jpg | |
// http://image-gd.inews24.com/image2.php?u=/image_joy/201804/1522932288117_1_214943.jpg | |
// http://image3.inews24.com/image_joy/201804/1522932288117_1_214943.jpg | |
return src.replace(/:\/\/[^/]*\/image[0-9]*\.php\?u=([^&]*).*/, "://image3.inews24.com$1"); | |
} | |
if ((domain_nosub === "inews24.com" && /^img\.(?:lb|xml|[0-9]+)\./.test(domain)) || | |
(domain_nosub === "inews24.com" && /^image[0-9]*\./.test(domain)) || | |
// http://inews24.ext3.cache.iwinv.net/image_joy/thumbnail/201804/152292797427_1_203359.jpg | |
// http://inews24.ext3.cache.iwinv.net/image_joy/201804/152292797427_1_203359.jpg | |
// http://inews24.cache.iwinv.net/image_joy/thumbnail/201604/1461628592495_1_173610.jpg | |
// http://inews24.cache.iwinv.net/image_joy/201604/1461628592495_1_173610.jpg | |
(domain_nosub === "iwinv.net" && /^inews24\.(?:ext[0-9]+\.)?cache\./.test(domain))) { | |
// http://img.lb.inews24.com/face/100dpi/180x220/image_joy/201911/1575008174298_1_152007.jpg | |
// http://img.lb.inews24.com/image_joy/201911/1575008174298_1_152007.jpg | |
// http://img.lb.inews24.com/100dpi/x280/image_joy/201911/1575009715956_1_161653.jpg | |
// http://img.lb.inews24.com/image_joy/201911/1575009715956_1_161653.jpg | |
// http://img.5.inews24.com/300x/image_joy/201911/1573547923849_1_175144.jpg | |
// http://img.5.inews24.com/image_joy/201911/1573547923849_1_175144.jpg | |
// http://img.xml.inews24.com/x289/image_joy/201904/155576283786_1_212113.jpg | |
// http://image.inews24.com/image_joy/201904/155576283786_1_212113.jpg | |
// http://img.xml.inews24.com/image_joy/201904/155576283786_1_212113.jpg | |
// http://img.xml.inews24.com/200x200/image_joy/thumbnail/201904/1554893184953_2_203020.jpg | |
// http://image.inews24.com/image_joy/201904/1554893184953_2_203020.jpg | |
// http://img.xml.inews24.com/image_joy/thumbnail/201904/1554893184953_2_203020.jpg | |
// http://img.xml.inews24.com/image_joy/201904/1554893184953_2_203020.jpg | |
// http://img.2.inews24.com/200x/300x/400x/image_joy/201911/1573192207502_1_221148.jpg | |
// http://img.2.inews24.com/image_joy/201911/1573192207502_1_221148.jpg | |
return src | |
.replace(/(:\/\/[^/]+\/)(?:face\/+)?(?:[0-9]+dpi\/+){0,}(?:[0-9]*x[0-9]*\/+){0,}image_joy\//, "$1image_joy/") | |
.replace(/\/image_joy\/+thumbnail\//, "/image_joy/"); | |
//return src.replace(/:\/\/[^/]*\/(?:[0-9]+)?x[0-9]+\/+/, "://image.inews24.com/"); | |
} | |
if (domain_nosub === "wowkorea.jp" && | |
(src.indexOf(".wowkorea.jp/img") >= 0 || | |
src.indexOf(".wowkorea.jp/upload") >= 0)) { | |
// works: | |
// http://kt.wowkorea.jp/img/album/10/54888/94580_l.jpg | |
// http://kt.wowkorea.jp/img/album/10/54888/94580.jpg | |
// http://image.wowkorea.jp/upload/news/214660/20180612_cosm_n.jpg | |
// http://image.wowkorea.jp/upload/news/214660/20180612_cosm.jpg | |
// http://kt.wowkorea.jp/img/album/8/43853/78804_ss.jpg | |
// http://kt.wowkorea.jp/img/album/8/43853/78804.jpg | |
// | |
// http://www.wowkorea.jp/upload/news/153102/450_teyon1003.jpg | |
// http://www.wowkorea.jp/upload/news/153102/teyon1003.jpg -- not sure how to make a rule for this | |
// | |
// doesn't work: | |
// http://kt.wowkorea.jp/img/news/3/19899/53692_s.jpg | |
// http://kt.wowkorea.jp/img/news/3/19899/53692_l.jpg - works | |
// http://kt.wowkorea.jp/img/news/3/19899/53692.jpg - 404 | |
// http://kt.wowkorea.jp/img/news/3/19961/53856_160.jpg | |
// thanks to Gyuri on discord | |
// http://www.wowkorea.jp/upload/photoSpecial/731/re_1-1.jpg -- 80x60 | |
// http://www.wowkorea.jp/upload/photoSpecial/731/1-1.jpg -- 600x450 | |
newsrc = src.replace(/(\/upload\/+photoSpecial\/+[0-9]+\/+)re_([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2"); | |
if (newsrc !== src) | |
return newsrc; | |
if (src.indexOf("/img/album/") < 0 && | |
!src.match(/\/upload\/news\/+[0-9]+\//)) { | |
return src.replace(/([^/]*_)[a-z0-9]*(\.[^/.]*)$/, "$1l$2"); | |
} | |
newsrc = src.replace(/_(?:[a-z0-9]|ss)(\.[^/.]*)$/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nosub === "saostar.vn" && | |
domain.match(/img[0-9]*\.saostar\.vn/)) { | |
// https://img.saostar.vn/fb660png_1/2017/11/04/1750083/img_0127.jpg/fbsscover.png | |
// https://img.saostar.vn/2017/11/04/1750083/img_0127.jpg | |
newsrc = src | |
.replace(/saostar.vn\/fb[0-9]+[^/]*(\/.*\.[^/.]*)\/[^/]*$/, "saostar.vn$1") | |
.replace(/saostar.vn\/[a-z][0-9]+\//, "saostar.vn/") | |
.replace(/saostar.vn\/[0-9]+x[0-9]+\//, "saostar.vn/"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
// keep this? | |
if (domain_nosub.match(/^google\./) && | |
src.match(/\/www\.google\.(?:[a-z]+\.)?[a-z]*\/url\?/)) { | |
newsrc = src.replace(/.*url=([^&]*).*/, "$1"); | |
if (newsrc !== src && /^https?/.test(newsrc)) | |
return decodeURIComponent(newsrc); | |
} | |
if ((domain_nowww === "lipstickalley.com" || | |
// https://stephenking.com/xf/proxy.php?image=http%3A%2F%2Fimages.askmen.com%2Fphotos%2Fdimension-films-presents-the-world-premiere-of-1408%2F20574.jpg&hash=f8f6f7179d75c0fd0a960ac5e65612a2 | |
// http://images.askmen.com/photos/dimension-films-presents-the-world-premiere-of-1408/20574.jpg | |
domain_nowww === "stephenking.com" || | |
// https://www.ambercutie.com/forums/proxy.php?image=http%3A%2F%2F24.media.tumblr.com%2Fc4395a17e157f2a9d9dd7fb9c56495b6%2Ftumblr_mhkekoQgAh1qcr6iqo1_1280.jpg&hash=f7e1ba2a0eb3236d02ea79aa629dfc1a | |
// http://66.media.tumblr.com/c4395a17e157f2a9d9dd7fb9c56495b6/tumblr_mhkekoQgAh1qcr6iqo1_1280.jpg | |
domain_nowww === "ambercutie.com" || | |
domain.indexOf("forum.purseblog.com") >= 0) && | |
src.indexOf("/proxy.php?") >= 0) { | |
// https://www.lipstickalley.com/proxy.php?image=http%3A%2F%2Fwww.trendalert.nl%2Fpostsize%2Fw700-h759%2F201508%2F1441031539_MTV_VMA_Rita%2520Ora.jpg&hash=c9113b1d6e27f0f572b1423ba92979d0 | |
// http://www.trendalert.nl/postsize/w700-h759/201508/1441031539_MTV_VMA_Rita%20Ora.jpg | |
newsrc = src.replace(/.*image=([^&]*).*/, "$1"); | |
if (newsrc !== src) | |
return decodeuri_ifneeded(newsrc); | |
} | |
if (domain === "images.askmen.com") { | |
// http://images.askmen.com/photos/dimension-films-presents-the-world-premiere-of-1408/20574.jpg | |
return { | |
url: src, | |
head_wrong_contentlength: true | |
}; | |
} | |
if ((domain_nosub === "127.net" && domain.indexOf("nosdn.127.net") >= 0) || | |
// https://pic-bucket.ws.126.net/photo/0003/2018-12-03/E23MBHK63LF60003NOS.jpg?imageView&thumbnail=690x465&quality=85&type=webp&interlace=1 | |
// https://pic-bucket.ws.126.net/photo/0003/2018-12-03/E23MBHK63LF60003NOS.jpg | |
domain === "pic-bucket.ws.126.net") { //lofter | |
// http://imglf1.nosdn.127.net/img/cVVvSm1kaHhURWlQcVkyQVBzZ2lMRExONjBVS1N1UnZUV3dvQ3BtaFVuYjFuUk9EUG5OcnFnPT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg%7Cwatermark&type=2&text=wqkg5p6B5ZywIC8ga3lva3VjaGkubG9mdGVyLmNvbQ==&font=bXN5aA==&gravity=southwest&dissolve=30&fontsize=680&dx=32&dy=36&stripmeta=0 | |
// http://imglf1.nosdn.127.net/img/cVVvSm1kaHhURWlQcVkyQVBzZ2lMRExONjBVS1N1UnZUV3dvQ3BtaFVuYjFuUk9EUG5OcnFnPT0.jpg | |
// http://imglf0.nosdn.127.net/img/cytFZVcyeDNVU2pvR0l0QkdXM0FBUmJuU1paTnVDQnM1UmJ4T3BhNE94WW1BZlVOQ1dLSld3PT0.png?imageView&thumbnail=500x0&quality=96&stripmeta=0&type=jpg | |
// http://pic-bucket.nosdn.127.net/photo/0001/2018-01-24/D8SM4CRK00AP0001NOS.jpg?imageView&thumbnail=100y75 | |
// http://pic-bucket.nosdn.127.net/photo/0001/2018-01-24/D8SM4CRK00AP0001NOS.jpg | |
// http://dingyue.nosdn.127.net/lJszRnDoqxNbRLPfYG2DackcH7WAEdAe=8SdmaEDOhxMz1542447679423compressflag.jpg?imageView&thumbnail=250x0&quality=85&type=jpg&interlace=1 | |
// http://dingyue.nosdn.127.net/lJszRnDoqxNbRLPfYG2DackcH7WAEdAe=8SdmaEDOhxMz1542447679423compressflag.jpg | |
return { | |
url: src.replace(/\?.*$/, ""), | |
headers: { | |
"Referer": "https://lofter.com" | |
} | |
}; | |
} | |
if (domain === "board.makeshop.co.kr") { | |
// http://board.makeshop.co.kr/board/premium204/mastideco_image2/mini::20130513094047.jpg | |
// http://board.makeshop.co.kr/board/premium204/mastideco_image2/20130513094047.jpg | |
return src.replace(/\/[a-z]*::/, "/"); | |
} | |
if (domain_nosub === "naver.jp" && | |
domain.match(/^rr\.img[0-9]*\.naver\./)) { | |
// https://rr.img1.naver.jp/mig?src=http%3A%2F%2Fimgcc.naver.jp%2Fkaze%2Fmission%2FUSER%2F20161018%2F76%2F7776016%2F17%2F600x450x28290423f03522c4ff136cd5.jpg&twidth=414&theight=0&qlt=80&res_format=jpg&op=r | |
// http://imgcc.naver.jp/kaze/mission/USER/20161018/76/7776016/17/600x450x28290423f03522c4ff136cd5.jpg | |
//return decodeURIComponent(src.replace(/.*src=([^&]*).*/, "$1")); | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/mig.*?[?&]src=([^&]*).*?$/, "$1"); | |
if (newsrc !== src) | |
return decodeURIComponent(newsrc); | |
} | |
if (domain === "imgcc.naver.jp") { | |
// http://imgcc.naver.jp/kaze/mission_anm/USER/20141027/15/1773065/0/thumb/450x253x18f52e3379003e23293ac0c3_300_600.gif | |
// http://imgcc.naver.jp/kaze/mission_anm/USER/20141027/15/1773065/0/450x253x18f52e3379003e23293ac0c3.gif | |
// http://imgcc.naver.jp/kaze/mission_anm/USER/20141027/15/1773065/0/450x253x18f52e3379003e23293ac0c3.gif/300/600 | |
// http://imgcc.naver.jp/kaze/mission_anm/USER/20141027/15/1773065/0/450x253x18f52e3379003e23293ac0c3.gif | |
//return src.replace(/\/[0-9]+\/[0-9]+\/*$/, ""); | |
return src | |
.replace(/\/thumb(\/[0-9]+x[0-9]+x[0-9a-f]+)_[0-9]+_[0-9]+(\.[^/.]*)$/, "$1$2") | |
.replace(/\/[0-9]+\/[0-9]+\/*(?:[?&].*)?$/, ""); | |
} | |
if (domain === "dimg.donga.com") { | |
// http://dimg.donga.com/c/138/175/90/1/wps/NEWS/IMAGE/2018/04/04/89455472.2.jpg | |
// http://dimg.donga.com/wps/NEWS/IMAGE/2018/04/04/89455472.2.jpg | |
// http://dimg.donga.com/a/280/60/90/2/wps/NEWS/FEED/Top_Main_Top_2013/89467049.1.thumb.jpg | |
// http://dimg.donga.com/wps/NEWS/FEED/Top_Main_Top_2013/89467049.1.thumb.jpg | |
// 3, 4, 5, and 6 seem to be the same | |
// other: | |
// http://dimg.donga.com/egc/PHOTO/udata/photonews/image/201506/04/201506040012/A84P4320.jpg | |
// http://dimg.donga.com/egc/PHOTO/udata/photonews/image/201406/05/201406050013/P90151637.jpg -- 6378x4252 | |
// http://www.donga.com/BIZN/realestate/List/3/all/20141024/67412273/1 | |
// https://dimg.donga.com/egc/PHOTO/udata/photonews/image/201408/19/201408190052/spl823546_002.jpg | |
// http://www.donga.com/news/List/PoliticsN/article/all/20140826/66006935/1 | |
// http://dimg.donga.com/egc/PHOTO/udata/photonews/image/201408/25/201408250020/1.jpg -- 2560x1707 | |
// https://dimg.donga.com/wps/STUDIO/IMAGE/2014/08/25/1363601.1.jpg | |
// https://dimg.donga.com/wps/NEWS/IMAGE/2014/08/26/66006897.2.jpg | |
// https://dimg.donga.com/wps/STUDIO/IMAGE/2014/08/25/1363600.1.jpg | |
// http://dimg.donga.com/egc/PHOTO/udata/photonews/image/201408/25/201408250020/2.jpg | |
// https://dimg.donga.com/wps/NEWS/IMAGE/2013/11/18/58982640.3.jpg -- 4505x8026 | |
// http://www.donga.com/news/article/all/20131118/58982687/1 | |
// http://dimg.donga.com/ugc/CDB/CHINA/Article/59/3c/c5/f0/593cc5f00d78d2738243.jpg -- 3372x2283 | |
// http://china.donga.com/List/3/all/43/949830/1 | |
// http://china.donga.com/Profile?cid=728339 | |
return src | |
.replace(/\/[ca]\/(?:[0-9]+\/){4}/, "/") | |
.replace(/\/i\/[0-9]+\/[0-9]+\/[0-9]+\//, "/"); | |
} | |
if (domain === "imgpark.donga.com" && src.indexOf("/fileUpload/") >= 0) { | |
// http://imgpark.donga.com/mbs/fileUpload/201507/02/55948bb91e89b4e44119.jpg | |
return { | |
url: src, | |
headers: { | |
Referer: "http://mlbpark.donga.com/" | |
} | |
}; | |
} | |
if ((domain_nosub === "marishe.com" && | |
domain.match(/s[0-9]\.marishe\.com/)) || | |
// https://www.klik.gr/uploads_image/2017/06/19/p1bivfplat1vjv1ls95fr57b10rlt_900.jpg | |
// https://www.klik.gr/uploads_image/2017/06/19/p1bivfplat1vjv1ls95fr57b10rlt.jpg | |
(domain_nowww === "klik.gr" && src.indexOf("/uploads_image/") >= 0) || | |
// https://ug-ts.ru/psyzoo/content/pics/e7e/e7ed71ca9bdb10f35cabb3ac43c2104a_400.jpg | |
// https://ug-ts.ru/psyzoo/content/pics/e7e/e7ed71ca9bdb10f35cabb3ac43c2104a.jpg | |
(domain_nowww === "ug-ts.ru" && /\/content\/+pics\//.test(src)) || | |
// http://eroticasearch.net/content/pics/ce9/ce9462d41e02e0c73662f316b1ebaf8f_400.jpg | |
// http://eroticasearch.net/content/pics/ce9/ce9462d41e02e0c73662f316b1ebaf8f.jpg | |
(domain_nowww === "eroticasearch.net" && src.indexOf("/content/pics/") >= 0) || | |
// http://resource.breakingnews.mn/image/2015/09/30/0p23eruc8h4gu2mi/articleemmawatson167901856201509301039_400.jpg | |
// http://resource.breakingnews.mn/image/2015/09/30/0p23eruc8h4gu2mi/articleemmawatson167901856201509301039.jpg | |
domain === "resource.breakingnews.mn") { | |
newsrc = src.replace(/(\/[^/]*)_[0-9]+(\.[^/.]*)$/, "$1$2"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nowww === "klik.gr") { | |
return { | |
url: src, | |
can_head: false | |
}; | |
} | |
// img77 | |
/*if (false && domain.match(/img[0-9]*\.dreamwiz\.com/)) { | |
// most tested don't work (anymore?) | |
// http://img77.dreamwiz.com/MV/2006/y/yfGjHAz_l.jpg -- 3000x1994 | |
// http://img77.dreamwiz.com/YTN_IMAGE/20180316/201803161101514477_d.jpg -- 2500x1667 | |
return src.replace(/(\/[^/]*)_[a-z]\.([^/.]*)$/, "$1_o.$2"); | |
}*/ | |
if (domain === "cdn.hk01.com") { | |
// https://cdn.hk01.com/di/media/images/1016988/org/95b53d52af36ddfa9103948bdfc9ccdd.jpg/ZfwdPWx-CWi144GhhxOAdNml9EacWur1YaGOe2Ghjns?v=w1920 -- stretched | |
// https://cdn.hk01.com/di/media/images/1016988/org/95b53d52af36ddfa9103948bdfc9ccdd.jpg/ZfwdPWx-CWi144GhhxOAdNml9EacWur1YaGOe2Ghjns | |
// https://cdn.hk01.com/di/media/images/1552737/org/b7034991651c8724ee7f02176fcd853b.JPG/h4N9QxvaH15uPPX8Agz_dSIL0ikqT1nBef3OuXn9zrk?v=w1920r16_9 | |
// https://cdn.hk01.com/di/media/images/1552737/org/b7034991651c8724ee7f02176fcd853b.JPG/h4N9QxvaH15uPPX8Agz_dSIL0ikqT1nBef3OuXn9zrk | |
// https://cdn.hk01.com/media/images/1432611/xlarge/4b37b8fbd88672371e5f090abc2acf59.jpg | |
// https://cdn.hk01.com/media/images/1432611/org/4b37b8fbd88672371e5f090abc2acf59.jpg | |
// https://cdn.hk01.com/media/images/1357333/xlarge/43372fd2c8e52bec13601ad123401616.jpg -- stretched | |
// https://cdn.hk01.com/media/images/1357333/org/43372fd2c8e52bec13601ad123401616.jpg | |
return src | |
.replace(/(\/media\/images\/[^/]*\/)[^/]*\//, "$1org/") | |
.replace(/\?.*/, ""); | |
} | |
if (domain_nosub === "sinaimg.cn") { | |
// works: | |
// http://ss12.sinaimg.cn/orignal/66a6ce75g8b46ba3a373b&690 | |
// http://ss12.sinaimg.cn/orignal/6bc10695g923b8902976b&690 | |
// http://ss7.sinaimg.cn/orignal/67a7cd73g8b48c289ae26&690 | |
// http://ss6.sinaimg.cn/orignal/6b3178f4g92678953d725&690 | |
// thanks to fireattack on github for these examples: https://github.com/qsniyg/maxurl/issues/147#issue-503777148 | |
// https://wx4.sinaimg.cn/mw690/9a646dd9ly1g7qil8atsgj22ao328qv6.jpg | |
// https://wx4.sinaimg.cn/large/9a646dd9ly1g7qil8atsgj22ao328qv6.jpg | |
// doesn't: | |
// http://ww4.sinaimg.cn/large/ad769c8bgy1fnaovhjp4rj21m62iob2d.jpg | |
// http://ww4.sinaimg.cn/woriginal/ad769c8bgy1fnaovhjp4rj21m62iob2d.jpg - works | |
// http://wx3.sinaimg.cn/large/71080fe4gy1fehxmeusddj21kw2ddb2a.jpg | |
// https://wxt.sinaimg.cn/large/006Qyga5ly1fnsl8inznlj31ww2pgqv8.jpg | |
// | |
// http://k.sinaimg.cn/n/ent/transform/w150h100/20180227/Mf6R-fyrwsqi6927544.jpg/w150h100f1t0l0syf.png | |
// http://n.sinaimg.cn/sinacn/w603h580/20180227/b993-fyrwsqi5950343.jpg | |
// http://n.sinaimg.cn/ent/transform/w500h750/20180206/FzeL-fyrhcqz0888399.jpg | |
// http://k.sinaimg.cn/ent/transform/w500h750/20180206/FzeL-fyrhcqz0888399.jpg - doesn't work (bad request) | |
// http://n.sinaimg.cn/sinacn/w500h750/20180206/FzeL-fyrhcqz0888399.jpg - doesn't work | |
// | |
// http://n.sinaimg.cn/translate/w750h484/20180206/c8U1-fyrhcqy9899138.jpg | |
// http://n.sinaimg.cn/transform/w750h484/20180206/c8U1-fyrhcqy9899138.jpg - doesn't work | |
// | |
// http://n.sinaimg.cn/translate/20170819/QwU0-fykcpru8486163.jpg | |
// | |
// http://n.sinaimg.cn/ent/4_ori/upload/a57892fc/w2048h3072/20180217/zPxq-fyrpeif2120125.jpg | |
// | |
// https://tc.sinaimg.cn/maxwidth.800/tc.service.weibo.com/img_mp_itc_cn/8236ed1acca6f9b1f2d57a59cb5088cf.jpg | |
// https://tc.sinaimg.cn/original/tc.service.weibo.com/img_mp_itc_cn/8236ed1acca6f9b1f2d57a59cb5088cf.jpg -- 403 if head | |
if (src.match(/:\/\/[^/]*\/+max(?:width|height)\.[0-9]+\//)) { | |
return { | |
url: src.replace(/(:\/\/[^/]*\/+)[^/]*\//, "$1original/"), | |
can_head: false | |
}; | |
} | |
if (domain.match(/^ss/)) { | |
src = src.replace(/\.sinaimg\.cn\/+[^/]*\/+([^/]*)\/*$/, ".sinaimg.cn/orignal/$1"); | |
} else { | |
src = src.replace(/\.sinaimg\.cn\/+[^/]*\/+([^/]*)\/*$/, ".sinaimg.cn/large/$1"); | |
} | |
if (domain.match(/^n\./)) { | |
// http://n.sinaimg.cn/ent/4_img/upload/75913a59/20170522/iHLB-fyfkzhs8250377.jpg | |
// http://n.sinaimg.cn/ent/4_ori/upload/75913a59/20170522/iHLB-fyfkzhs8250377.jpg | |
newsrc = src.replace(/(\/ent\/+[0-9]+_)img(\/+upload\/)/, "$1ori$2"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
// http://www.sinaimg.cn/dy/slidenews/4_t500/2014_15/704_1283534_165508.jpg | |
// http://www.sinaimg.cn/dy/slidenews/4_img/2014_15/704_1283534_165508.jpg | |
newsrc = src.replace(/\/slidenews\/+([^/_]*)_[^/_]*\//, "/slidenews/$1_img/"); // there's also _ori, but it seems to be smaller? | |
if (newsrc !== src) | |
return newsrc; | |
return { | |
url: src, | |
headers: { | |
Referer: "https://weibo.com/" | |
}, | |
referer_ok: { | |
same_domain: true | |
} | |
} | |
} | |
if (domain_nosub === "sina.com.cn" && domain.match(/^static[0-9]\.photo\.sina\.com\.cn/)) { | |
// http://static7.photo.sina.com.cn/medium/49d0afb2g87b3e7e7a066&690 | |
// http://ss7.sinaimg.cn/medium/49d0afb2g87b3e7e7a066&690 | |
// http://ss7.sinaimg.cn/orignal/49d0afb2g87b3e7e7a066&690 | |
return src.replace(/:\/\/static([0-9]*)\.photo\.sina\.com\.cn\//, "://ss$1.sinaimg.cn/"); | |
} | |
if (domain === "thumbnail.egloos.net" || | |
// http://thumb.egloos.net/460x0/http://pds25.egloos.com/pds/201208/22/41/f0095041_503490baddcc4.jpg | |
// http://pds25.egloos.com/pds/201208/22/41/f0095041_503490baddcc4.jpg | |
domain === "thumb.egloos.net") { | |
// http://thumbnail.egloos.net/600x0/http://pds27.egloos.com/pds/201802/20/90/e0060990_5a8bc59b9b6c5.jpg | |
// http://pds27.egloos.com/pds/201802/20/90/e0060990_5a8bc59b9b6c5.jpg | |
return src.replace(/^[a-z]+:\/\/thumb(?:nail)?\.egloos\.net\/[^/]*\/*/, ""); | |
} | |
if (domain === "k.kakaocdn.net") { | |
// https://k.kakaocdn.net/dn/YRLG1/btqfOF1cFrB/OgpuqdEHB0GR3FmuwUHMtK/img_l.jpg -- 800x1200 | |
// https://k.kakaocdn.net/dn/YRLG1/btqfOF1cFrB/OgpuqdEHB0GR3FmuwUHMtK/img.jpg -- 3000x4500 | |
return src.replace(/\/img_[a-z]*\.([^./]*)$/, "/img.$1"); | |
} | |
if (domain === "images.sportskhan.net" || | |
// http://img.khan.co.kr/news/2018/08/13/l_2018081401000000000117731.jpg | |
// http://img.khan.co.kr/news/2018/08/13/2018081401000000000117731.jpg | |
domain === "img.khan.co.kr") { | |
return src | |
// http://images.sportskhan.net/article/r/155x155/2016/04/25/l_2016042502001091100264931.jpg | |
// http://images.sportskhan.net/article/2016/04/25/l_2016042502001091100264931.jpg | |
.replace(/\/r\/[0-9]+x[0-9]+\//, "/") | |
// http://images.sportskhan.net/article/2016/04/25/l_2016042502001091100264931.jpg | |
// http://images.sportskhan.net/article/2016/04/25/2016042502001091100264931.jpg | |
.replace(/\/[a-z]*_([0-9]+\.[a-z0-9A-Z]*)$/, "/$1") | |
// http://images.sportskhan.net/spkn/ranking/c/94x94/3100/310005/20180904135417_31000501.jpeg | |
// http://images.sportskhan.net/spkn/ranking/3100/310005/20180904135417_31000501.jpeg | |
.replace(/\/c\/[0-9]*x[0-9]*\//, "/") | |
// http://img.khan.co.kr/news/2011/01/25/20110125.01200199991308.03S.jpg | |
// http://img.khan.co.kr/news/2011/01/25/20110125.01200199991308.03L.jpg -- L, M, S (tested all uppercase, lowercase) | |
.replace(/(\/news\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/[0-9]{8}\.[0-9]+\.[0-9]+)[A-Z](\.[^/.]*)$/, "$1L$2") | |
// http://images.sportskhan.net/photodb/c/85x85/16/2017/10/25/GettyImages-865606556_594_screen.jpg | |
// http://images.sportskhan.net/PhotoDB/16/2017/10/25/GettyImages-865606556_594_screen.jpg | |
.replace(/\/photodb\//, "/PhotoDB/"); | |
} | |
if (domain_nosub === "sbs.co.kr" && | |
domain.match(/^img[0-9]*\.sbs\.co\.kr/)) { | |
// http://img.sbs.co.kr/sbscnbc/upload/2017/11/06/10000590366_700.jpg | |
// http://img.sbs.co.kr/sbscnbc/upload/2017/11/06/10000590366.jpg | |
// https://img.sbs.co.kr/newsnet/etv/upload/2019/04/21/30000626551_16v9.jpg | |
// https://img.sbs.co.kr/newsnet/etv/upload/2019/04/21/30000626551.jpg | |
newsrc = src.replace(/(\/[0-9]+)_[0-9v]+\.([a-z0-9A-Z]*)$/, "$1.$2"); | |
if (newsrc !== src) | |
return newsrc; | |
// http://img2.sbs.co.kr/img/sbs_cms/SR/2017/06/26/SR88942637_w640_h360.jpg | |
// http://img2.sbs.co.kr/img/sbs_cms/SR/2017/06/26/SR88942637_ori.jpg | |
return src.replace(/(\/[^_]*)_[^/.]*(\.[^/.]*)$/, "$1_ori$2"); | |
} | |
if (domain === "image.board.sbs.co.kr") { | |
// http://image.board.sbs.co.kr/2018/02/02/h191517549706907-600.jpg | |
// http://image.board.sbs.co.kr/2018/02/02/h191517549706907.jpg | |
return src.replace(/-[0-9]+(\.[^/.]*)$/, "$1"); | |
} | |
if (domain_nosub === "edaily.co.kr" && | |
domain.indexOf("image.edaily.co.kr") >= 0 || | |
domain.indexOf("img.edaily.co.kr") >= 0) { | |
// http://spnimage.edaily.co.kr/images/Photo/files/NP/S/2018/02/PS18021400011h.jpg | |
// http://image.edaily.co.kr/images/Photo/files/NP/S/2018/02/PS18021100248t.jpg | |
// (none, g), b, t, h, s, m | |
// http://img.edaily.co.kr/images/photo/files/NP/S/2018/04/b_5ACD63A4B813DB7E7DBDBA63.jpg | |
// http://img.edaily.co.kr/images/photo/files/NP/S/2018/04/5ACD63A4B813DB7E7DBDBA63.jpg | |
// others: | |
// http://www.edaily.co.kr/news/news_detail.asp?newsId=01203766619110520&mediaCodeNo=257 | |
// http://image.edaily.co.kr/images/photo/files/NP/S/2018/02/PS18021400103.jpg (original?) | |
// http://image.edaily.co.kr/images/photo/files/HN/H/2018/02/HNE01203766619110520_LV1.jpg - zoomed in | |
// http://image.edaily.co.kr/images/photo/files/HN/H/2018/02/HNE01203766619110520.jpg - not zoomed in, but cropped | |
// http://image.edaily.co.kr/images/photo/files/NP/S/2016/04/PS16040100068.jpg - 3278x4918 | |
// http://edaily.co.kr/news/news_detail.asp?newsId=02059846615960080&mediaCodeNo=257 | |
// http://image.edaily.co.kr/images/photo/files/NP/S/2017/06/PS17060900211.jpg | |
// | |
// http://beautyin.edaily.co.kr/read/news.asp?newsid=329216886615960080 | |
// http://superdeskapi.edaily.co.kr/api/upload/5939e0ffb813db52b1fb81aa/raw?_schema=http | |
return src | |
.replace(/\/[a-z]_([A-Z0-9]+)\.([a-z0-9A-Z]*)$/, "/$1.$2") | |
.replace(/(\/[A-Z0-9]+)[a-z]\.([a-z0-9A-Z]*)$/, "$1.$2"); | |
} | |
// cloudinary | |
// /master/master/ is another possible alternative | |
if (domain === "media.glamour.com" || | |
// https://media.glamour.com/photos/58c420d33b757b7cc97d0a5f/master/w_644,c_limit/emma-watson.jpg | |
// https://assets.teenvogue.com/photos/56c648746d38be8a461b4c31/master/pass/GettyImages-104044913_master.jpg | |
domain === "assets.teenvogue.com" || | |
// https://assets.vogue.com/photos/55c651b108298d8be2265985/16:9/pass/00010fullscreen.jpg | |
domain === "assets.vogue.com" || | |
// http://media.vanityfair.com/photos/58a77812c41f737fae527fab/16:9/w_1200,h_630,c_limit/t-march-issue-ed-letter-trump.jpg | |
domain === "media.vanityfair.com" || | |
// http://media.gq.com/photos/58eb8e4c8e4ae708183f9291/3:2/w_300/Stephen-Curry-0517-GQ-FECU02-01.jpg | |
domain === "media.gq.com" || | |
// https://media.wmagazine.com/photos/5b2fa4640008757085e61704/1:1/w_767/GettyImages-982174754.jpg | |
domain === "media.wmagazine.com" || | |
// https://media.self.com/photos/5b5a606cf658c67200f6a772/4:3/w_570/SELF%2520film-139.jpg | |
domain === "media.self.com" || | |
// https://media.pitchfork.com/photos/5931ce6dd13a3d6b24765f82/2:1/w_790/fd0304ef.jpeg | |
domain === "media.pitchfork.com" || | |
// https://media.wired.com/photos/5b8837d22997aa2df18d9970/16:9/w_2400,c_limit/roomba.jpg | |
domain === "media.wired.com" || | |
// https://media.golfdigest.com/photos/5a7498e5b9a33161e3689aa9/master/w_780,c_limit/180202-sb-party.jpg | |
domain === "media.golfdigest.com" || | |
// https://media.architecturaldigest.com/photos/56380571a6f997a353b888a2/master/w_640,c_limit/worlds-best-stained-glass-windows-13-10.jpg | |
domain === "media.architecturaldigest.com" || | |
// https://media.cntraveler.com/photos/59bb6a56e35d8f08044a32cf/16:9/pass/Rakotzbrucke-GettyImages-538162756.jpg | |
// http://media.cntraveler.com/photos/59305e5611e6e853c33e7587/master/w_1440,c_limit/car-free-halibut-cove-alaska-GettyImages-496660709.jpg | |
domain === "media.cntraveler.com" || | |
// https://media.allure.com/photos/5771af392554df47220a75cb/3:4/w_767/beauty-trends-blogs-daily-beauty-reporter-2016-05-19-selena-gomez-hair.jpg | |
domain === "media.allure.com" || | |
src.match(/:\/\/[^/]*\/photos\/[0-9a-f]{24}\/[^/]*\/[^/]*\/[^/]*$/)) { | |
newsrc = src.replace(/\/[^/]*\/[^/]*\/([^/]*)$/, "/original/original/$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nosub === "cloudinary.com" || | |
// http://images.playmates.com/playboy-digital/image/fetch/q_80/http://images.contentful.com/l7es9q9kzr9z/KVC2bUAzyUkW6KaMgGkeA/2f45f07b331a60fc360ff8d641a29d7a/778_KimberlyMcArthur_15.jpg | |
// http://images.contentful.com/l7es9q9kzr9z/KVC2bUAzyUkW6KaMgGkeA/2f45f07b331a60fc360ff8d641a29d7a/778_KimberlyMcArthur_15.jpg | |
domain === "images.playmates.com" || | |
// https://images.playboy.com/playboy-digital/image/fetch/s--s1yV9nz0--/c_fit,h_1024,q_80,w_1024/http://images-origin.playboy.com/ogz4nxetbde6/3CJdCBvUEU2qaE6E00CYQU/a8277fb2808ea265a219036c150c4ffe/24_Dodger.jpg | |
// https://images.playboy.com/playboy-digital/image/fetch/s--82ZXSENj--/c_fit,h_1024,q_80,w_1024%2Fhttp%3A%2F%2Fimages-origin.playboy.com%2Fogz4nxetbde6%2F5hBHszaLoWia0AGcMQQOKs%2F84892f7ff68f2755536203b369398814%2F04_Dodger.jpg | |
// http://images-origin.playboy.com/ogz4nxetbde6/5hBHszaLoWia0AGcMQQOKs/84892f7ff68f2755536203b369398814/04_Dodger.jpg | |
domain === "images.playboy.com" || | |
// https://transcode3.app.engoo.com/image/fetch/f_auto,c_lfill,w_300,dpr_1/https://assets.app.engoo.com/images/5jlP76Tw4fNwJDhoBVqrqT.jpeg | |
// https://assets.app.engoo.com/images/5jlP76Tw4fNwJDhoBVqrqT.jpeg | |
(domain_nosub === "engoo.com" && domain.match(/^transcode[0-9]*\.app\./)) || | |
// http://images.thehollywoodgossip.com/iu/s--09NH5dFF--/t_xlarge_l/f_auto,fl_lossy,q_75/v1375379663/rihanna-natural-hair.jpg | |
// http://images.thehollywoodgossip.com/iu/s--09NH5dFF--/v1375379663/rihanna-natural-hair.jpg | |
// http://images.thehollywoodgossip.com/iu/v1375379663/rihanna-natural-hair.jpg -- also works | |
domain === "images.thehollywoodgossip.com" || | |
// https://cdn.apartmenttherapy.info/image/fetch/f_auto,q_auto:eco/https%3A%2F%2Fstorage.googleapis.com%2Fgen-atmedia%2F3%2F2018%2F03%2F43997be9fb4a1acca400bfea464fe31701f17157.jpeg | |
// https://storage.googleapis.com/gen-atmedia/3/2018/03/43997be9fb4a1acca400bfea464fe31701f17157.jpeg | |
domain === "cdn.apartmenttherapy.info" || | |
// https://image.thestartmagazine.com/fetch/d_magazineDefault.jpg,c_fill,g_face:auto,fl_lossy,q_70,w_480/http%3A%2F%2Fimages.summitmedia-digital.com%2Fpreview%2Fimages%2F2019%2F10%2F07%2Fmimiyuh-nm.jpg | |
// http://images.summitmedia-digital.com/preview/images/2019/10/07/mimiyuh-nm.jpg | |
domain === "image.thestartmagazine.com" || | |
// https://cdn.substack.com/image/fetch/c_limit,q_auto:good,f_auto/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0d3b9fbf-c06e-4b6e-ac84-13c53da04462_952x400.png | |
// https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/0d3b9fbf-c06e-4b6e-ac84-13c53da04462_952x400.png | |
domain === "cdn.substack.com" || | |
domain === "images.taboola.com") { | |
// https://res.cloudinary.com/emazecom/image/fetch/c_limit,a_ignore,w_320,h_200/https%3A%2F%2Fimg-aws.ehowcdn.com%2F877x500p%2Fs3.amazonaws.com%2Fcme_public_images%2Fwww_ehow_com%2Fi.ehow.com%2Fimages%2Fa04%2Fbd%2Fic%2Fchemical-energy-work-3.1-800x800.jpg | |
// https://images.taboola.com/taboola/image/fetch/f_jpg%2Cq_auto%2Cc_fill%2Cg_faces:auto%2Ce_sharpen/https%3A%2F%2Fwww.gannett-cdn.com%2F-mm-%2F2e56892f6a349ad47192b530425d443fb365e5e9%2Fr%3Dx1803%26c%3D3200x1800%2Fhttps%2Fmedia.gannett-cdn.com%2F37861007001%2F37861007001_5735420050001_5735409691001-vs.jpg%3FpubId%3D37861007001 | |
// https://res.cloudinary.com/emazecom/image/fetch/c_limit,a_ignore,w_320,h_200/http%3A%2F%2Fcdn.expansion.mx%2Fdims4%2Fdefault%2F5227468%2F2147483647%2Fthumbnail%2F850x478%255E%2Fquality%2F75%2F%3Furl%3Dhttps%253A%252F%252Fcdn.expansion.mx%252Fmedia%252F2010%252F06%252F08%252Fobreros-chinos-trabajadores-china.jpg | |
if (src.search(/:\/\/[^/]*\/(?:[^/]*\/+)?(?:image\/+)?fetch\//) >= 0) { | |
newsrc = src.replace(/.*?:\/\/[^/]*\/(?:[^/]*\/)?(?:image\/+)?fetch\/(?:.*?(?:\/|%2F))?([^/%]*(?::|%3A).*)/, "$1"); | |
if (newsrc.match(/^[^/:]*%3A/)) | |
newsrc = decodeURIComponent(newsrc); | |
return newsrc; | |
} | |
// https://the-hollywood-gossip-res.cloudinary.com/iu/s--xSziJrCi--/t_v_xlarge_l/cs_srgb,f_auto,fl_strip_profile.lossy,q_auto:420/v1409168696/video/victoria-justice-twerks-dances-like-nicki-minaj.png | |
// https://the-hollywood-gossip-res.cloudinary.com/iu/v1409168696/video/victoria-justice-twerks-dances-like-nicki-minaj.png | |
newsrc = src.replace(/(\/iu\/[^/]*)\/.*?(\/v[0-9]*\/)/, "$1$2"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nosub === "jpimedia.uk" && domain.match(/^images(?:-[a-z])?\./)) { | |
// https://images-a.jpimedia.uk/imagefetch/w_700,f_auto,ar_3:2,q_auto:low,c_fill/if_h_lte_200,c_mfit,h_201/https://www.lep.co.uk/webimage/1.9676998.1553766389!/image/image.jpg | |
// https://www.lep.co.uk/webimage/1.9676998.1553766389!/image/image.jpg | |
return src.replace(/^[a-z]+:\/\/[^/]*\/+imagefetch\/+.*?\/(https?:\/\/)/, "$1"); | |
} | |
// https://res.cloudinary.com/beamly/image/upload/s--Ayyiome3--/c_fill,g_face,q_70,w_479/f_jpg/v1/news/sites/6/2014/11/Nick-Hewer-The-Apprentice.jpg | |
// https://res.cloudinary.com/beamly/image/upload/v1/news/sites/6/2014/11/Nick-Hewer-The-Apprentice.jpg | |
// https://res.cloudinary.com/beamly/image/upload/news/sites/6/2014/11/Nick-Hewer-The-Apprentice.jpg | |
// https://res.cloudinary.com/beamly/image/upload/s--pMOefc2U--/c_fill,g_face,q_70,w_1160/f_jpg/v1/news/sites/6/2014/05/LuisaSwimsuit621.jpg | |
// https://res.cloudinary.com/beamly/image/upload/v1/news/sites/6/2014/05/LuisaSwimsuit621.jpg | |
// https://res.cloudinary.com/beamly/image/upload/s--1uSHUtr1--/c_fill,g_face,q_70,w_1160/f_jpg/v1/news/sites/6/2013/12/o-katie-hopkins-570.jpg | |
// https://res.cloudinary.com/beamly/image/upload/v1/news/sites/6/2013/12/o-katie-hopkins-570.jpg | |
// http://thefader-res.cloudinary.com/private_images/w_1440,c_limit,f_auto,q_auto:best/Badgyal5RGB_wbgyon/bad-gyal-nicest-cocky-interview-dancehall-catalan.jpg | |
// http://thefader-res.cloudinary.com/private_images/c_limit/Badgyal5RGB_wbgyon/bad-gyal-nicest-cocky-interview-dancehall-catalan.jpg | |
// https://res.cloudinary.com/dk-find-out/image/upload/q_80,w_1920,f_auto/MA_00079563_yvu84f.jpg | |
// https://res.cloudinary.com/jerrick/image/upload/p7jbqvi0aoxm4mdn3x6x | |
// https://talenthouse-res.cloudinary.com/image/upload/c_limit,f_auto,fl_progressive,h_2048,w_2048/v1457507984/user-555017/submissions/a1kqddzzmsoyjxh2mkks.jpg | |
// https://talenthouse-res.cloudinary.com/image/upload/c_limit,f_auto,fl_progressive,h_2048,w_2048/user-555017/submissions/a1kqddzzmsoyjxh2mkks.jpg | |
// https://talenthouse-res.cloudinary.com/image/upload/v1457507984/user-555017/submissions/a1kqddzzmsoyjxh2mkks.jpg | |
// https://talenthouse-res.cloudinary.com/image/upload/user-555017/submissions/a1kqddzzmsoyjxh2mkks.jpg | |
// https://nordot-res.cloudinary.com/t_size_l/ch/images/359126053920392289/origin_1.jpg | |
// https://nordot-res.cloudinary.com/ch/images/359126053920392289/origin_1.jpg | |
// https://the-hollywood-gossip-res.cloudinary.com/iu/s--xSziJrCi--/t_v_xlarge_l/cs_srgb,f_auto,fl_strip_profile.lossy,q_auto:420/v1409168696/video/victoria-justice-twerks-dances-like-nicki-minaj.png | |
// http://res-4.cloudinary.com/uan/image/private/c_fill,d_event_default.jpg,g_north,h_640,q_80,w_1280/jzigjdloajy6wzbzqjk1.jpg | |
// http://res-4.cloudinary.com/uan/image/private/c_limit/jzigjdloajy6wzbzqjk1.jpg | |
// https://res.cloudinary.com/teepublic/image/private/s--AcQdRwqc--/t_Resized%20Artwork/c_fit,g_north_west,h_1054,w_1054/co_ffffff,e_outline:53/co_ffffff,e_outline:inner_fill:53/co_bbbbbb,e_outline:3:1000/c_mpad,g_center,h_1260,w_1260/b_rgb:eeeeee/c_limit,f_jpg,h_630,q_90,w_630/v1518936493/production/designs/2373946_0.jpg | |
if ((domain_nosub === "cloudinary.com" && | |
(domain.indexOf("res.cloudinary.com") >= 0 || | |
domain.match(/res-[0-9]*\.cloudinary\.com/))) || | |
// https://i.kinja-img.com/gawker-media/image/upload/s--aj1fB409--/c_fill,f_auto,fl_progressive,g_center,h_675,q_80,w_1200/181f6al0l60gjjpg.jpg -- stretched, cropped | |
// https://i.kinja-img.com/gawker-media/image/upload/181f6al0l60gjjpg.jpg | |
domain === "i.kinja-img.com") { | |
newsrc = src | |
// depends on repetition | |
.replace(/\/image\/upload\/s\-\-[^/]*\-\-\//, "/image/upload/") | |
.replace(/\/iu\/s\-\-[^/]*\-\-\//, "/iu/") | |
.replace(/\/image\/upload\/[^/]*_[^/]*\//, "/image/upload/") | |
.replace(/\/image\/upload\/v[0-9]+\//, "/image/upload/") | |
//.replace(/(\/image\/upload\/)(?:(?:.*?\/?(v1\/))|(?:[^/]*\/))/, "$1$2") | |
.replace(/(\/private_images\/)[^/]*\//, "$1c_limit/") | |
.replace(/(\/image\/private\/)[^s][^-][^/]*\//, "$1c_limit/") | |
.replace(/(:\/\/[^/]*\/)[^/]*\/(ch\/images\/[0-9]+\/[^/]*$)/, "$1$2"); | |
if (newsrc !== src) { | |
return newsrc; | |
} | |
//return src.replace(/\/image\/+upload\/+[a-z]l?[_-][^/]*\//, "/image/upload/"); | |
} | |
if (domain === "fiverr-res.cloudinary.com" || | |
// https://assets.lybrate.com/q_auto,f_auto,h_80,w_120,c_fill,g_auto/imgs/tic/improving-hair-health/male/Improving-Hair-Health-male-02.jpg | |
// https://assets.lybrate.com/imgs/tic/improving-hair-health/male/Improving-Hair-Health-male-02.jpg | |
domain === "assets.lybrate.com") { | |
// https://fiverr-res.cloudinary.com/w_iw_div_3.0,q_auto,f_auto/general_assets/homepage/assets/f6/desktop_subcategory_logo.jpg | |
// https://fiverr-res.cloudinary.com/general_assets/homepage/assets/f6/desktop_subcategory_logo.jpg | |
// https://fiverr-res.cloudinary.com/images/t_main1,q_auto,f_auto/gigs/106410116/original/de3608cf995c4b2de061c6147d7f5899b5dacc12/get-you-authoritative-media-citation-on-nbc-cbs-abc-and-fox.jpg | |
// https://fiverr-res.cloudinary.com/images/gigs/106410116/original/de3608cf995c4b2de061c6147d7f5899b5dacc12/get-you-authoritative-media-citation-on-nbc-cbs-abc-and-fox.jpg | |
return src.replace(/(:\/\/[^/]*\/+(?:images\/+)?)[a-z]_[^/]*\//, "$1"); | |
} | |
if (domain === "images.complex.com") { | |
// https://images.complex.com/complex/images/c_crop,h_2437,w_3289,x_0,y_1067/c_limit,w_680/fl_lossy,pg_1,q_auto/gc123hobhudxx063ak8v/converse-yung-lean-one-star | |
// https://images.complex.com/complex/images/gc123hobhudxx063ak8v/converse-yung-lean-one-star | |
// https://images.complex.com/complex/image/upload/c_limit,w_680/fl_lossy,pg_1,q_auto/qh1ve8ncxzxlfiy9aauw.jpg | |
// https://images.complex.com/complex/image/upload/qh1ve8ncxzxlfiy9aauw.jpg | |
// https://images.complex.com/complex/images/c_scale,w_1100/fl_lossy,pg_1,q_auto/blwjl76jv2vcqdgd3sqy/bella-thorne | |
// https://images.complex.com/complex/images/blwjl76jv2vcqdgd3sqy/bella-thorne | |
// http://images.complex.com/complex/image/upload/t_article_image/ckxhi0lpw2jsvm3rx3f4.jpg | |
// http://images.complex.com/complex/image/upload/ckxhi0lpw2jsvm3rx3f4.jpg | |
// https://images.complex.com/complex/images/c_scale,w_1100/fl_lossy,pg_1,q_auto/brfqstj5jihhzr9eu1bw/bella-thorne | |
// https://images.complex.com/complex/images/brfqstj5jihhzr9eu1bw/bella-thorne | |
return src.replace(/\/(images|image\/upload)\/[^/]*_[^/]*\//, "/$1/"); | |
} | |
// https://images.spot.im/image/upload/q_70,fl_lossy,dpr_1.0,h_300,w_320,c_fill,g_face/v200/production/watfc8itl4hcgavprfku | |
// https://images.spot.im/image/upload/production/watfc8itl4hcgavprfku | |
if (domain === "images.spot.im" || | |
// https://fashionista.com/.image/ar_16:9%2Cc_fill%2Ccs_srgb%2Cg_faces:center%2Cq_80%2Cw_620/MTQyNjI1MjYyNTc4NzA1NzM0/emma-watson-promojpg.jpg | |
// https://fashionista.com/.image/t_share/MTQ2Njg0NzA2NzUzMDk1NTQ3/gettyimages-672499332.jpg | |
domain_nowww === "fashionista.com" || | |
// http://images.pigeonsandplanes.com/images/c_crop,h_2268,w_3024,x_0,y_330/c_limit,f_auto,fl_lossy,q_auto,w_1030/obk4degjo35h2jzuwyd7/opal-press-2017 | |
domain === "images.pigeonsandplanes.com" || | |
// https://images.sftcdn.net/images/t_optimized,f_auto/p/2fbcf826-96d0-11e6-ac58-00163ec9f5fa/62785002/gang-beasts-screenshot.jpg | |
domain === "images.sftcdn.net" || | |
// http://cdn.primedia.co.za/primedia-broadcasting/image/upload/c_fill,h_289,q_70,w_463/o0nu1bpsbgpfgvwa7vmj | |
domain === "cdn.primedia.co.za" || | |
// https://www.maxim.com/.image/c_limit%2Ccs_srgb%2Cq_80%2Cw_960/MTUzMzQ0MzA2MTQzNTAzNzUz/harley-davidson-livewire3.webp | |
// https://www.maxim.com/.image/MTUzMzQ0MzA2MTQzNTAzNzUz/harley-davidson-livewire3.webp | |
domain_nowww === "maxim.com" || | |
// https://img.thedailybeast.com/image/upload/c_crop,d_placeholder_euli9k,h_1439,w_2560,x_0,y_0/dpr_2.0/c_limit,w_740/fl_lossy,q_auto/v1492195023/articles/2014/10/19/the-world-s-most-beautiful-boat-yours-for-half-a-billion-dollars/141018-teeman-star-yacht-tease_tlw0nl | |
domain === "img.thedailybeast.com" || | |
// https://alibaba.kumpar.com/kumpar/image/upload/h_153,w_273,c_fill,ar_16:9,g_face,f_jpg,q_auto,fl_progressive,fl_lossy/hzwutxv6kqhrj3grgbtf.jpg | |
domain === "alibaba.kumpar.com" || | |
// https://5b0988e595225.cdn.sohucs.com/q_70,c_zoom,w_640/images/20180121/1fad12f07c90464295f05598305a08ad.jpeg | |
domain === "5b0988e595225.cdn.sohucs.com" || | |
// nano defender blocks this? | |
// https://images-cdn.moviepilot.com/images/c_fill,h_1800,w_2897/t_mp_quality/vg7z3yhfbklgnnlki3cs/angelina-jolie-s-next-project-is-close-to-her-heart-and-her-son-maddox-will-be-involved-530390.jpg | |
domain === "images-cdn.moviepilot.com" || | |
// http://img.playbuzz.com/image/upload/f_auto,fl_lossy,q_auto/cdn/a205ab41-8564-4ed6-8bc2-42d742b284f0/de57f9d2-be24-43e8-910a-c972d8cf6cb8.jpg | |
domain === "img.playbuzz.com" || | |
// https://images.discerningassets.com/image/upload/c_scale,h_44,w_90/v1424385252/ahmf3bignioajopkklpo.jpg | |
domain === "images.discerningassets.com" || | |
// https://images.radio-canada.ca/q_auto,w_310/v1/ici-info/16x9/fusee-space-tsss.jpg | |
domain === "images.radio-canada.ca" || | |
// https://img.wcdn.co.il/f_auto,w_100/2/0/4/7/2047784-46.jpg | |
// https://img.wcdn.co.il/2/0/4/7/2047784-46.jpg | |
domain === "img.wcdn.co.il" || | |
// https://images.haarets.co.il/image/upload/w_2178,h_1267,x_22,y_99,c_crop,g_north_west/w_468,h_272,q_auto,c_fill,f_auto/fl_any_format.preserve_transparency.progressive:none/v1531586984/1.6270687.637195137.jpg | |
// https://images.haarets.co.il/image/upload/fl_any_format.preserve_transparency.progressive:none/1.6270687.637195137.jpg | |
// https://images.haarets.co.il/image/upload/1.6270687.637195137.jpg | |
domain === "images.haarets.co.il" || | |
// https://images.cdn.yle.fi/image/upload/fl_keep_iptc,f_auto,fl_progressive/q_88/w_1600,h_900,c_fill,g_faces/w_500/v1531638823/13-1-50005334-1531638819357.jpg | |
// https://images.cdn.yle.fi/image/upload/fl_keep_iptc,f_auto,fl_progressive/13-1-50005334-1531638819357.jpg | |
// https://images.cdn.yle.fi/image/upload/13-1-50005334-1531638819357.jpg | |
domain === "images.cdn.yle.fi" || | |
// https://sol.no/s/img/t_sol-forty-v2,w_490/solmediaCloudify/giwkcu7lqlluohdmbfcn.jpg | |
// https://sol.no/s/img/solmediaCloudify/giwkcu7lqlluohdmbfcn.jpg | |
(domain_nowww === "sol.no" && src.indexOf("/img/") >= 0)|| | |
// https://prof.prepics-cdn.com/image/upload/c_fit,w_480/v1514146939/prcm_news-gazo-129019-3.jpg | |
// https://prof.prepics-cdn.com/image/upload/prcm_news-gazo-129019-3.jpg | |
(domain === "prof.prepics-cdn.com" && src.indexOf("/image/upload/") >= 0) || | |
// https://images.ezvid.com/image/upload/fl_immutable_cache/c_limit,f_auto,h_400,w_400,q_auto:eco/rhnqlnvwkb39gukug44z | |
// https://images.ezvid.com/image/upload/fl_immutable_cache/rhnqlnvwkb39gukug44z | |
domain === "images.ezvid.com" || | |
// https://img.peerspace.com/image/upload/c_crop,g_custom/g_auto,c_fill,q_auto:eco,f_auto,fl_progressive:steep,w_169,h_100/stoszz7hp3jjbwyrhyeb | |
// https://img.peerspace.com/image/upload/stoszz7hp3jjbwyrhyeb | |
domain === "img.peerspace.com" || | |
// https://dhgywazgeek0d.cloudfront.net/watcha/image/upload/c_fill,h_400,q_80,w_280/v1520472661/t1f98e-142589.jpg | |
// https://dhgywazgeek0d.cloudfront.net/watcha/image/upload/t1f98e-142589.jpg | |
domain === "dhgywazgeek0d.cloudfront.net" || | |
// https://assets.nuuvem.com/image/upload/t_screenshot_full/v1/products/557dbb7f69702d0a9c7c9c00/screenshots/opczeymdmcouc9npu8wn.jpg | |
// https://assets.nuuvem.com/image/upload/products/557dbb7f69702d0a9c7c9c00/screenshots/opczeymdmcouc9npu8wn.jpg | |
domain === "assets.nuuvem.com" || | |
// https://images.lanouvellerepublique.fr/image/upload/t_1020w/5b703714badf36d7618b458a.jpg | |
// https://images.lanouvellerepublique.fr/image/upload/5b703714badf36d7618b458a.jpg | |
domain === "images.lanouvellerepublique.fr" || | |
// https://images.fastcompany.net/image/upload/w_1280,f_auto,q_auto,fl_lossy/wp-cms/uploads/2018/04/3-braille-neue-combines-letters-you-can-touch-with-letters-you-can-see-1.jpg | |
// https://images.fastcompany.net/image/upload/wp-cms/uploads/2018/04/3-braille-neue-combines-letters-you-can-touch-with-letters-you-can-see-1.jpg | |
domain === "images.fastcompany.net" || | |
// http://dwgyu36up6iuz.cloudfront.net/heru80fdn/image/upload/c_scale,h_315,w_560/g_south_east,l_newsletter_play_button_overlay,w_100,x_11,y_11/g_north_west,l_circle_brand_overlay_vanityfair,w_80,x_11,y_11/c_fill,d_placeholder_thescene.jpg,fl_progressive,g_center,q_80/v1426695217/vanityfair_vf-confidential-psych-of-a-psychopath-legend-with-a-bullet.jpg | |
// http://dwgyu36up6iuz.cloudfront.net/heru80fdn/image/upload/v1426695217/vanityfair_vf-confidential-psych-of-a-psychopath-legend-with-a-bullet.jpg | |
domain === "dwgyu36up6iuz.cloudfront.net" || | |
// https://images2.minutemediacdn.com/image/upload/c_fill,w_684,h_387,f_auto,q_auto,g_auto/shape/cover/entertainment/5956983e27a119a9dd00001a.jpeg | |
// https://images2.minutemediacdn.com/image/upload/shape/cover/entertainment/5956983e27a119a9dd00001a.jpeg | |
(domain_nosub === "minutemediacdn.com" && domain.match(/^images[0-9]*\./)) || | |
// https://planet-sports-res.cloudinary.com/images/q_80,f_auto,dpr_2.0,d_planetsports:products:nopic.jpg/planetsports/products/46867500_00/rip-curl-fiesta-bandeau-bikini-set-women-black.jpg | |
// https://planet-sports-res.cloudinary.com/images/planetsports/products/46867500_00/rip-curl-fiesta-bandeau-bikini-set-women-black.jpg | |
(domain_nosub === "cloudinary.com" && domain.indexOf("res.cloudinary.com") >= 0 && src.indexOf("/images/") >= 0) || | |
// https://media.stubhubstatic.com/stubhub-product/t_face-faces-noface/a_0,q_auto:good,f_auto,c_fill,w_900,h_300/st/PYEAAOSw-9xZ26cw/s-l600.jpg | |
// https://media.stubhubstatic.com/stubhub-product/st/PYEAAOSw-9xZ26cw/s-l600.jpg | |
domain === "media.stubhubstatic.com" || | |
// https://img.promipool.de/www-promipool-de/image/upload/w_580,f_jpg,q_auto:eco/Megan_Fox_fku2vopjkf | |
// https://img.promipool.de/www-promipool-de/image/upload/Megan_Fox_fku2vopjkf | |
domain === "img.promipool.de" || | |
// https://blue.kumparan.com/kumpar/image/upload/fl_progressive,fl_lossy,c_fill,q_auto:best,w_640/v1501935658/emma_zpvivy.jpg | |
// https://blue.kumparan.com/kumpar/image/upload/emma_zpvivy.jpg | |
domain === "blue.kumparan.com" || | |
// http://file2.answcdn.com/answ-cld/image/upload/w_760,c_fill,g_faces:center,q_60/v1401441847/iqjpcuhvwtw1ocnpeibc.jpg | |
// http://file2.answcdn.com/answ-cld/image/upload/iqjpcuhvwtw1ocnpeibc.jpg | |
(domain_nosub === "answcdn.com" && domain.match(/^file[0-9]*\./)) || | |
// https://res.fashionsnap.com/image/upload/f_auto,q_auto/media2/2017/09/helpern-18ss_001.jpg?1563879770653 | |
domain === "res.fashionsnap.com" || | |
// thanks to susanqt on github: https://github.com/qsniyg/maxurl/issues/100 | |
// http://user-images.strikinglycdn.com/res/hrscywv4p/image/upload/c_limit,fl_lossy,h_9000,w_1200,f_auto,q_auto/1515559/534889_633117.jpg | |
// http://user-images.strikinglycdn.com/res/hrscywv4p/image/upload/1515559/534889_633117.jpg | |
domain === "user-images.strikinglycdn.com" || | |
// https://novel-img.prepics-cdn.com/image/upload/c_fill,w_156,h_222/p/c75f2ea15a148139b76ebdee2064737f8a4523c1/cover/ne7yeah9k1dsmwxmyuvn.jpg | |
// https://novel-img.prepics-cdn.com/image/upload/p/c75f2ea15a148139b76ebdee2064737f8a4523c1/cover/ne7yeah9k1dsmwxmyuvn.jpg | |
domain === "novel-img.prepics-cdn.com" || | |
// https://cdn.apartmenttherapy.info/image/upload/f_jpg,q_auto:eco,c_fill,g_auto,w_1500,ar_16:9/k/Photo/Recipes/2019-07-recipe-farmers-market-breakfast-bread/vegetable_quick_bread_4.12 | |
// https://cdn.apartmenttherapy.info/image/upload/k/Photo/Recipes/2019-07-recipe-farmers-market-breakfast-bread/vegetable_quick_bread_4.12 | |
domain === "cdn.apartmenttherapy.info" || | |
// https://cdn.domestika.org/c_fill,dpr_auto,h_157,t_base_params.format_jpg,w_280/v1529661169/course-covers/000/000/262/262-original.jpg?1529661169 | |
// https://cdn.domestika.org/course-covers/000/000/262/262-original.jpg?1529661169 | |
domain === "cdn.domestika.org" || | |
// https://assets.charmboard.com/images/w_375,ar_0.75,c_fill,c_pad,q_auto:eco,e_sharpen/im/lk/810912/pallavi-patil-wearing-kurta.jpg | |
// https://assets.charmboard.com/images/im/lk/810912/pallavi-patil-wearing-kurta.jpg | |
(domain === "assets.charmboard.com" && src.indexOf("/images/") >= 0) || | |
// https://image.spreadshirtmedia.com/content/q_auto/h_150,f_auto,b_rgb:f2f2f2/v27/cms/ml/tiles/models/t_shirts_men_us | |
// https://image.spreadshirtmedia.com/content/cms/ml/tiles/models/t_shirts_men_us | |
// https://image.spreadshirtmedia.com/content/w_650/cms/cyo/seo/cheaptshirts/6_us_desktop.png | |
// https://image.spreadshirtmedia.com/content/cms/cyo/seo/cheaptshirts/6_us_desktop.png | |
domain === "image.spreadshirtmedia.com" || | |
// https://images.moviepilot.com/images/c_limit,q_auto:good,w_600/uom2udz4ogmkncouu83q/beauty-and-the-beast-credit-disney.jpg | |
// https://images.moviepilot.com/image/upload/c_fill,h_64,q_auto,w_64/lpgwdrrgc3m8duvg7zt2.jpg | |
domain === "images.moviepilot.com") { | |
return src | |
.replace(/%2C/g, ",") | |
.replace(/\/[a-z]+_[^/_,]+(?:,[^/]*)?\//, "/") | |
.replace(/\/fl_any_format\.[^/]*\//, "/") | |
.replace(/\/fl_keep_iptc[^/]*\//, "/") | |
.replace("/t_mp_quality/", "/") | |
.replace(/\/image\/+upload\/+t_[^/]*\//, "/image/upload/") | |
.replace(/\/v[0-9]+\//, "/"); | |
} | |
if (domain === "image.kkday.com") { | |
// https://image.kkday.com/image/get/w_1900%2Cc_fit/s1.kkday.com/product_17911/20170926035641_Kii80/jpg | |
// https://image.kkday.com/image/get/s1.kkday.com/product_17911/20170926035641_Kii80/jpg | |
return src.replace(/\/image\/+get\/+[^/]*(?:%2C|,)[^/]*\//, "/image/get/"); | |
} | |
if (domain === "cdn.skim.gs") { | |
// http://cdn.skim.gs/image/upload/c_fill,dpr_1.0,f_auto,fl_lossy,q_auto,w_940/v1456338060/msi/fc8_k4lgbp.jpg -- 940x1413 (stretched) | |
// http://cdn.skim.gs/image/upload/v1456338060/msi/fc8_k4lgbp.jpg -- 600x902 | |
return src | |
.replace(/\/image\/upload\/[^/]*_[^/]*\//, "/image/upload/") | |
.replace(/\/images\/[^/]*_[^/]*\//, "/images/"); | |
} | |
if (((domain_nosub === "biography.com" || | |
domain_nowww === "guitarworld.com" || | |
domain_nowww === "guitaraficionado.com" || | |
domain_nowww === "psneurope.com") && | |
src.indexOf("/.image/") >= 0) || | |
src.match(/:\/\/[^/]*\/\.image\/[^/]*_[^/]*\/[A-Za-z-0-9]{24}\/[^/]*$/)) { | |
// https://www.biography.com/.image/c_limit%2Ccs_srgb%2Cq_80%2Cw_960/MTI2NDQwNDA2NTg5MTUwNDgy/ariana-grande-shutterstock_213445195-600x487jpg.webp | |
// https://www.biography.com/.image/MTI2NDQwNDA2NTg5MTUwNDgy/ariana-grande-shutterstock_213445195-600x487jpg.webp | |
// https://www.guitarworld.com/.image/t_share/MTUxNDQ0NTk1MTMyMDgxNDA3/keithrichardsgettyimages-71684054.jpg | |
// https://www.guitarworld.com/.image//MTUxNDQ0NTk1MTMyMDgxNDA3/keithrichardsgettyimages-71684054.jpg | |
// https://www.guitarworld.com/.image/ar_8:10%2Cc_fill%2Ccs_srgb%2Cg_faces:center%2Cq_80%2Cw_620/MTUwNjEyNDY4MDM2MzQ3MjU2/keith_richards_2jpg.jpg | |
// https://www.guitarworld.com/.image//MTUwNjEyNDY4MDM2MzQ3MjU2/keith_richards_2jpg.jpg | |
// https://www.psneurope.com/.image/c_limit%2Ccs_srgb%2Cq_80%2Cw_482/MTUwNjU0MjczNjQ2NjM0NjU3/vintage-studios-web.webp | |
// https://www.psneurope.com/.image/MTUwNjU0MjczNjQ2NjM0NjU3/vintage-studios-web.webp | |
newsrc = src.replace(/(\/.image)\/[^/]*(\/[^/]*\/[^/]*)$/, "$1$2"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "resources.mynewsdesk.com") { | |
// https://resources.mynewsdesk.com/image/upload/t_next_gen_span3_fit_and_crop/b3d5cr3yxtxylt7sp9wu.jpg | |
// https://resources.mynewsdesk.com/image/upload/b3d5cr3yxtxylt7sp9wu.jpg | |
return src.replace(/(\/image\/+upload\/+)t_[^/]+\/+/, "$1"); | |
} | |
if (domain_nosub === "popsugar-assets.com" || | |
domain_nosub === "onsugar.com") { | |
// https://media1.popsugar-assets.com/files/thumbor/Aq5Tn8-7kqPSJs4U0_QaYoM6x8Q/fit-in/1024x1024/filters:format_auto-!!-:strip_icc-!!-/2015/03/30/647/n/1922564/ccc1eafd_edit_img_cover_file_864129_1397566805/i/Emma-Watson-Best-Red-Carpet-Looks.png | |
// https://media1.popsugar-assets.com/files/2015/03/30/647/n/1922564/ccc1eafd_edit_img_cover_file_864129_1397566805/i/Emma-Watson-Best-Red-Carpet-Looks.png | |
// https://media1.popsugar-assets.com/files/thumbor/1ktKvFdaPtIVjrL085ZgDu-0IUM/160x160/filters:format_auto-!!-:strip_icc-!!-:sharpen-!1,0,true!-/2014/04/09/959/n/1922564/d006b9f456c00f56_478466321_10/i/Emma-Watson-Wes-Gordon-2014-Noah-Germany-Premiere.jpg | |
// https://media1.popsugar-assets.com/files/2014/04/09/959/n/1922564/d006b9f456c00f56_478466321_10/i/Emma-Watson-Wes-Gordon-2014-Noah-Germany-Premiere.jpg | |
// http://media1.popsugar-assets.com/files/thumbor/hEi29uVq6ywnKLkB2konCS2CMJI=/fit-in/2048xorig/2016/05/22/156/n/1922398/c7b25a8fd8aaab98_GettyImages-533596620/i/Mila-Kunis-Ashton-Kutcher-Billboard-Music-Awards-2016.jpg | |
// http://media1.popsugar-assets.com/files/2016/05/22/156/n/1922398/c7b25a8fd8aaab98_GettyImages-533596620/i/Mila-Kunis-Ashton-Kutcher-Billboard-Music-Awards-2016.jpg | |
// https://media1.popsugar-assets.com/files/thumbor/t85Z6EqhDjIu8EaEzfzk5hOJ1Ck/0x360:2400x2394/fit-in/728xorig/filters:format_auto-!!-:strip_icc-!!-:watermark-!popsugar-watermark.png,-5,-5,0!-/2020/01/16/687/n/1922564/4606d55d5e20819816a430.09594567_/i/selena-gomez-style-for-new-album-release-2020.jpg | |
// https://media1.popsugar-assets.com/files/2020/01/16/687/n/1922564/4606d55d5e20819816a430.09594567_/i/selena-gomez-style-for-new-album-release-2020.jpg | |
newsrc = src.replace(/\/thumbor\/[^/]+\/(?:[0-9]+x[0-9]+:[0-9]+x[0-9]+\/)?(?:fit-in\/)?[^/]+\/(?:filters:[^/]+\/)?/, "/"); | |
if (newsrc !== src) | |
return newsrc; | |
// http://media1.popsugar-assets.com/files/2013/02/08/2/192/1922398/13bc50e021acd58e_wenn10840119.xxxlarge/i/Spring-Breakers-Berlin-Red-Carpet-Premiere-Pictures.jpg | |
// http://media1.popsugar-assets.com/files/2013/02/08/2/192/1922398/13bc50e021acd58e_wenn10840119/i/Spring-Breakers-Berlin-Red-Carpet-Premiere-Pictures.jpg | |
// https://media1.popsugar-assets.com/files/2015/09/02/221/n/37139775/d391fe8f30364ef0_15._2007_GettyImages-81449203/i/Selena-Gomez.jpg | |
// http://media4.onsugar.com/files/2013/12/16/757/n/1922398/1f2e71247e26b096_Twoimageskinnyheadshot_R.jpg.xlarge/i/Gisele-Bundchen-Wearing-Bikini-Miami.jpg | |
// http://media4.onsugar.com/files/2013/12/16/757/n/1922398/1f2e71247e26b096_Twoimageskinnyheadshot_R/i/Gisele-Bundchen-Wearing-Bikini-Miami.jpg | |
// http://media1.popsugar-assets.com/files/2014/04/09/009/n/1922441/9933a3baeee323df_141827630.xxxlarge_2x/i/Dog-Thinks-Parade-All-Him.jpg | |
// http://media1.popsugar-assets.com/files/2014/04/09/009/n/1922441/9933a3baeee323df_141827630/i/Dog-Thinks-Parade-All-Him.jpg | |
// http://media1.popsugar-assets.com/files/2011/01/02/4/192/1922564/bacd60f46322150a_105266939.xxxlarge/i/Scarlett-Johansson-2004.jpg | |
// http://media1.popsugar-assets.com/files/2011/01/02/4/192/1922564/bacd60f46322150a_105266939/i/Scarlett-Johansson-2004.jpg | |
// https://media1.popsugar-assets.com/files/2013/01/03/4/192/1922398/079410d93cbf965d_89387PCN_Banks44._original_wm/i/Elizabeth-Banks-Filming-Walk-Shame-Yellow-Dress.jpg | |
// https://media1.popsugar-assets.com/files/2013/01/03/4/192/1922398/079410d93cbf965d_89387PCN_Banks44/i/Elizabeth-Banks-Filming-Walk-Shame-Yellow-Dress.jpg | |
// http://media2.popsugar-assets.com/files/2013/01/03/4/192/1922398/079410d93cbf965d_89387PCN_Banks44.xxxlarge_wm/i/Elizabeth-Banks-Filming-Walk-Shame-Yellow-Dress.jpg | |
// http://media2.popsugar-assets.com/files/2013/01/03/4/192/1922398/079410d93cbf965d_89387PCN_Banks44/i/Elizabeth-Banks-Filming-Walk-Shame-Yellow-Dress.jpg | |
// http://media1.onsugar.com/files/2013/01/03/4/192/1922398/8aedd815f4d135be_89387PCN_Banks38.preview_wm/i/Elizabeth-Banks-Filming-Walk-Shame-Yellow-Dress.jpg | |
// http://media1.onsugar.com/files/2013/01/03/4/192/1922398/8aedd815f4d135be_89387PCN_Banks38/i/Elizabeth-Banks-Filming-Walk-Shame-Yellow-Dress.jpg | |
// http://media3.onsugar.com/files/2014/03/25/832/n/1922398/586721e67a483aca_thumb_temp_image344319351395692338.jpg.preview_tall/i/Madeline-Brewer-Life-After-Orange-New-Black.jpg | |
// http://media3.onsugar.com/files/2014/03/25/832/n/1922398/586721e67a483aca_thumb_temp_image344319351395692338/i/Madeline-Brewer-Life-After-Orange-New-Black.jpg | |
// doesn't work: | |
// http://media3.popsugar-assets.com/files/2013/09/16/795/n/1922564/b962955383f6b80f_1592163256t6a65.xxxlarge_2x/i/Emma-Watson-all-legs-sexy-Peter-Pilotto-cutout-minidress.jpg | |
// http://media3.popsugar-assets.com/files/2013/09/16/795/n/1922564/b962955383f6b80f_1592163256t6a65/i/Emma-Watson-all-legs-sexy-Peter-Pilotto-cutout-minidress.jpg -- doesn't work (403) | |
// http://media4.popsugar-assets.com/files/2015/12/14/081/n/1922398/74d22b8d4b738d72_GettyImages-491215020E3065m.xxxlarge.jpg | |
// http://media4.popsugar-assets.com/files/2015/12/14/081/n/1922398/74d22b8d4b738d72_GettyImages-491215020E3065m.jpg -- doesn't work | |
// http://media4.popsugar-assets.com/files/2015/12/14/081/n/1922398/74d22b8d4b738d72_GettyImages-491215020E3065m.xxxlarge/i/a.jpg -- works | |
// http://media4.popsugar-assets.com/files/2015/12/14/081/n/1922398/74d22b8d4b738d72_GettyImages-491215020E3065m/i/a.jpg -- doesn't work | |
// http://media4.popsugar-assets.com/files/2015/12/14/081/n/1922398/74d22b8d4b738d72_GettyImages-491215020E3065/i/a.jpg -- doesn't work | |
// http://media1.popsugar-assets.com/files/2015/01/03/181/n/1922398/5bccdcce4f5c73c6_460999856_10ioj9fk.150square/i/Felicity-Jones.jpg -- works | |
// http://media1.popsugar-assets.com/files/2015/01/03/181/n/1922398/5bccdcce4f5c73c6_460999856_10ioj9fk/i/Felicity-Jones.jpg -- doesn't work | |
newsrc = src.replace(/\.(?:preview_)?(?:[a-z]*|_original)(?:_(?:[0-9x]+|wm))?(\/i\/[^/]*)$/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
// https://media1.popsugar-assets.com/files/2010/08/34/3/301/3019466/36cde93e8d75bf68_HeidiMont_Denis_60124316_Max.preview.jpeg | |
// https://media1.popsugar-assets.com/files/2010/08/34/3/301/3019466/36cde93e8d75bf68_HeidiMont_Denis_60124316_Max.jpeg | |
// http://media4.onsugar.com/files/2013/07/19/761/n/1922564/d5d89db25acd7746_173781022.xxxlarge.jpg | |
// http://media4.onsugar.com/files/2013/07/19/761/n/1922564/d5d89db25acd7746_173781022.jpg | |
// http://media3.onsugar.com/files/2012/06/24/4/192/1922153/8e8d2f2e956a6470_Giada.xxxlarge_1.jpg | |
// http://media3.onsugar.com/files/2012/06/24/4/192/1922153/8e8d2f2e956a6470_Giada.jpg | |
// doesn't work: | |
// http://media3.onsugar.com/files/2014/07/25/003/n/1922441/07ae12e6fcb9b25c_Screen_Shot_2014-07-25_at_4.00.20_PM.xxxlarge.jpg | |
// http://media3.onsugar.com/files/2014/07/25/003/n/1922441/07ae12e6fcb9b25c_Screen_Shot_2014-07-25_at_4.00.20_PM.jpg -- doesn't work | |
return src.replace(/\.(?:preview|x*large)(?:_(?:[0-9x]+|wm))?(\.[^/.]*)$/, "$1"); | |
} | |
if (domain_nosub === "ceros.com" && domain.match(/^media[-.]/)) { | |
// https://media-s3-us-east-1.ceros.com/popsugar/images/2018/08/17/73bd83a889f54cc67731a00623f5a1ca/ps18-cotton-np2-forceros.jpg?imageOpt=1&fit=bounds&width=1962 | |
// https://media-s3-us-east-1.ceros.com/popsugar/images/2018/08/17/73bd83a889f54cc67731a00623f5a1ca/ps18-cotton-np2-forceros.jpg | |
newsrc = src.replace(/\?.*/, ""); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "elleuk.cdnds.net") { | |
// http://elleuk.cdnds.net/15/37/980x1306/980x1306--29f8-11e6-9cdd-21395b3400d9-assets-elleuk-com-gallery-16644-1365760633-emma-watson-january-2013-jpg.jpg | |
// http://assets.elleuk.com/gallery/16644/1365760633-emma-watson-january-2013.jpg | |
// | |
// http://elleuk.cdnds.net/15/37/768x1024/768x1024-d38b1ahttp-s3-eu-west-1-amazonaws-com-ee-elleuk-2-emma-watson-december-2014-cover-star-composite-jpg.jpg | |
// http://s3-eu-west-1.amazonaws.com/ee-elleuk/Hailey-Baldwin-Topshop-unique-RS15-0515-Imaxtree.jpg | |
// problem: capitalized | |
newsrc = src.replace(/:\/\/.*\/[^/]*assets-elleuk-com-gallery-([0-9]*)-([^/]*)-([^-/.]*)\.[^-/.]*$/, "://assets.elleuk.com/gallery/$1/$2.$3"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nosub === "cdnds.net" && | |
//!src.match(/\/gallery_[^/]*$/) && | |
!src.match(/\/[0-9]*x[0-9]*-[^/]*$/)) { | |
//domain.indexOf("esquireuk.cdnds.net") < 0 && | |
//domain.indexOf("digitalspyuk.cdnds.net") < 0 | |
// doesn't work: | |
// http://digitalspyuk.cdnds.net/14/42/768x512/gallery_7065877-low_res-.jpg | |
// http://digitalspyuk.cdnds.net/14/42/1600x1067/gallery_7065877-low_res-.jpg | |
// http://digitalspyuk.cdnds.net/14/42/7065877-low_res-.jpg -- works | |
// http://digitalspyuk.cdnds.net/11/51/768x512/gallery_tv_countdown_nick_hewer_2.jpg | |
// http://digitalspyuk.cdnds.net/11/51/gallery_tv_countdown_nick_hewer_2.jpg | |
// http://digitalspyuk.cdnds.net/11/51/tv_countdown_nick_hewer_2.jpg -- works | |
// http://digitalspyuk.cdnds.net/13/40/980x1470/gallery_emma-watson.jpg | |
// http://digitalspyuk.cdnds.net/13/40/emma-watson.jpg -- works | |
// | |
// works: | |
// http://digitalspyuk.cdnds.net/16/47/980x490/landscape-1479890677-gettyimages-108378197.jpg | |
// http://digitalspyuk.cdnds.net/16/47/landscape-1479890677-gettyimages-108378197.jpg | |
// http://digitalspyuk.cdnds.net/16/47/1479890677-gettyimages-108378197.jpg | |
// http://elleuk.cdnds.net/17/06/1600x900/hd-aspect-1486581368-emma-web.jpg | |
// http://elleuk.cdnds.net/17/06/hd-aspect-1486581368-emma-web.jpg | |
// http://elleuk.cdnds.net/17/06/1486581368-emma-web.jpg | |
// http://cosmouk.cdnds.net/14/51/980x490/nrm_1418985628-nick-hewer-quits-apprentice.jpg?resize=768:* | |
// http://cosmouk.cdnds.net/14/51/nrm_1418985628-nick-hewer-quits-apprentice.jpg?resize=768:* | |
// http://elleuk.cdnds.net/17/25/480x719/gallery-1498212018-emmawatsonlouisvuitton.jpg | |
// http://elleuk.cdnds.net/17/25/gallery-1498212018-emmawatsonlouisvuitton.jpg | |
// http://elleuk.cdnds.net/17/25/1498212018-emmawatsonlouisvuitton.jpg | |
// http://digitalspyuk.cdnds.net/18/05/landscape-1517275491-cameron1.jpg | |
// http://digitalspyuk.cdnds.net/18/05/1517275491-cameron1.jpg | |
// http://i1.cdnds.net/13/34/M/lily-collins_2.jpg | |
// http://i1.cdnds.net/13/34/L/lily-collins_2.jpg | |
// http://i1.cdnds.net/13/34/lily-collins_2.jpg | |
newsrc = src | |
.replace(/\/[0-9]+x[0-9]+\/gallery_/, "/") | |
.replace(/\/[0-9]+x[0-9]+\/([^/]*)$/, "/$1") | |
.replace(/\/[ML]\/([^/]*)$/, "/$1") | |
.replace(/\/(?:landscape|hd-aspect|gallery)-([^/]*)$/, "/$1") | |
.replace(/(\/[^/]*)\?[^/]*$/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "redonline.cdnds.net") { | |
// http://redonline.cdnds.net/main/gallery/21794/grammy-awards-2016-taylor-swift__portrait.jpg | |
// http://redonline.cdnds.net/main/gallery/21794/grammy-awards-2016-taylor-swift.jpg | |
return src.replace(/__[a-z]+(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "img.usmagazine.com") { | |
// http://img.usmagazine.com/660-width/matthew-clines-624d28c3-5401-4041-9b40-1f25c25bf397.jpg | |
// http://img.usmagazine.com/matthew-clines-624d28c3-5401-4041-9b40-1f25c25bf397.jpg | |
return src.replace(/(.*?[^:])\/[0-9]*-[^/]*\//, "$1/"); | |
} | |
if (domain_nosub === "gannett-cdn.com" && | |
src.indexOf("/-mm-/") >= 0) { | |
// https://www.gannett-cdn.com/-mm-/2e56892f6a349ad47192b530425d443fb365e5e9/r=x1803&c=3200x1800/https/media.gannett-cdn.com/35547429001/35547429001_5727574988001_5727573873001-vs.jpg?pubId=35547429001 | |
// https://media.gannett-cdn.com/35547429001/35547429001_5727574988001_5727573873001-vs.jpg | |
// https://www.gannett-cdn.com/-mm-/2eab0172f87f63087b9b90322b67744820df1d8d/c=0-230-4565-2809&r=x1683&c=3200x1680/local/-/media/2018/02/27/USATODAY/USATODAY/636553489293713705-AFP-AFP-10H1QY-97704432.JPG | |
// https://www.gannett-cdn.com/media/2018/02/27/USATODAY/USATODAY/636553489293713705-AFP-AFP-10H1QY-97704432.JPG | |
newsrc = src.replace(/.*?\/-mm-\/[0-9a-f]*\/[^/]*\/(http[^/]*)\/(.*)$/, "$1://$2"); | |
if (newsrc !== src) | |
return newsrc; | |
return src.replace(/\/-mm-\/.*?\/-\//, "/"); | |
} | |
if (domain_nosub === "aolcdn.com") { | |
var regex1 = /.*image_uri=([^&]*).*/; | |
if (src.match(regex1)) { | |
// https://o.aolcdn.com/images/dims?thumbnail=640%2C420&quality=75&format=jpg&image_uri=https%3A%2F%2Faol-releases-assets-production.s3.amazonaws.com%2Fgenerator%2F07A13DEB.jpg&client=cbc79c14efcebee57402&signature=09ed437d01bfde0d182a609c759f58006578aa3a | |
// https://aol-releases-assets-production.s3.amazonaws.com/generator/07A13DEB.jpg | |
// https://o.aolcdn.com/images/dims?resize=1200%2C630&crop=1200%2C630%2C0%2C0&quality=80&image_uri=https%3A%2F%2Fimg.vidible.tv%2Fprod%2F2018-07%2F03%2F5b3bcb63158f855373e8f026%2F5b3bcc4d802b9473f9df3077_o_U_v1.jpg&client=cbc79c14efcebee57402&signature=358c49852d6c8cdd678cc7dea0ad0995c5f7d224 | |
// https://img.vidible.tv/prod/2018-07/03/5b3bcb63158f855373e8f026/5b3bcc4d802b9473f9df3077_o_U_v1.jpg | |
newsrc = decodeURIComponent(src.replace(/.*image_uri=([^&]*).*/, "$1")); | |
} else if (src.match(/.*o\.aolcdn\.com\/images\//)) { | |
// https://o.aolcdn.com/images/dims3/GLOB/legacy_thumbnail/1028x675/format/jpg/quality/85/http%3A%2F%2Fo.aolcdn.com%2Fhss%2Fstorage%2Fmidas%2F652aa88cb26c6aafe4dca4eef405c15%2F205409332%2FScreen%2BShot%2B2017-06-23%2Bat%2B2.36.37%2BPM.png | |
// http://o.aolcdn.com/hss/storage/midas/652aa88cb26c6aafe4dca4eef405c15/205409332/Screen+Shot+2017-06-23+at+2.36.37+PM.png | |
newsrc = decodeURIComponent(src).replace(/.*o\.aolcdn\.com\/images\/[^:]*\/([^:/]*:.*)/, "$1"); | |
} else if (src.match(/^[a-z]+:\/\/[^/]*\/hss\/storage\/midas\//)) { | |
// https://s.aolcdn.com/hss/storage/midas/668dd572f108685386710ff09bb15f2a/205350917/1280_selena_gomez_the_weeknd_carbone_backgrid_BGUS_879674_007.jpg | |
// https://s.aolcdn.com/hss/storage/midas/668dd572f108685386710ff09bb15f2a/205350917/selena_gomez_the_weeknd_carbone_backgrid_BGUS_879674_007.jpg | |
return src.replace(/\/[0-9]+_([^/]*)$/, "/$1"); | |
} | |
if (newsrc && newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "imagesvc.timeincapp.com") { | |
// http://imagesvc.timeincapp.com/v3/foundry/image/?q=70&w=1440&url=https%3A%2F%2Ftimedotcom.files.wordpress.com%2F2017%2F11%2Fcolumbia-1.jpg%3Fquality%3D85 | |
// https://timedotcom.files.wordpress.com/2017/11/columbia-1.jpg | |
// https://imagesvc.timeincapp.com/v3/fan/image?url=https://winteriscoming.net/files/2019/05/Official-806-Daenerys-Helen-Sloan-HBO.jpg&c=sc&w=736&h=485 | |
// https://winteriscoming.net/files/2019/05/Official-806-Daenerys-Helen-Sloan-HBO.jpg | |
// https://imagesvc.timeincapp.com/v3/mm/image?url=https%3A%2F%2Fcdn-s3.si.com%2Fs3fs-public%2F2013%2F05%2F13_kate-upton-body-paint_02.jpg&w=900&q=85 | |
// https://cdn-s3.si.com/s3fs-public/2013/05/13_kate-upton-body-paint_02.jpg | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/v3\/+[a-z]+\/+image\/?.*?[?&]url=(http[^&]*).*/, "$1"); | |
if (newsrc !== src) | |
return decodeuri_ifneeded(newsrc); | |
} | |
/*if (false && domain.indexOf(".photoshelter.com") >= 0) { | |
return src.replace(/\/s\/[0-9]*\/[0-9]*\//, "/"); | |
}*/ | |
if (domain_nosub === "photoshelter.com") { | |
// http://c.photoshelter.com/img-get/I00002_.IhMQAZEg/t/200/I00002_.IhMQAZEg.jpg | |
// https://ssl.c.photoshelter.com/img-get/I00002_.IhMQAZEg/s/700/SHM-Spider-Man-Homecoming-Prem-28062017-001.jpg | |
// https://ssl.c.photoshelter.com/img-get2/I00002_.IhMQAZEg/fit=4000x4000/SHM-Spider-Man-Homecoming-Prem-28062017-001.jpg | |
// https://ssl.c.photoshelter.com/img-get2/I00002_.IhMQAZEg/fit=99999999999/SHM-Spider-Man-Homecoming-Prem-28062017-001.jpg | |
// https://ssl.c.photoshelter.com/img-get2/I00007dPXW9BAIiU/sec=wd0sd0oe0lwe0ms1000ed20170311lyHGYvV7mWMka15/fit=2040x2040/Rutgers-womens-rowing-team-works-out-on-the-Raritan-River.jpg -- 2040x1357 | |
// https://ssl.c.photoshelter.com/img-get2/I00007dPXW9BAIiU/fit=4000x4000/Rutgers-womens-rowing-team-works-out-on-the-Raritan-River.jpg | |
// https://culver.photoshelter.com/asset-get/A0000N3HQ83lQtzA/20160913_325_RS-0.jpg -- 5000x3333 | |
// https://ssl.c.photoshelter.com/img-get/I0000sljp0JcarNs/pak05lhecop-57.jpg -- 500x332 | |
// https://ssl.c.photoshelter.com/img-get/I0000x_JQ_qY2rhs/s/750/750/1678-James-Brown-11-and-Tomi-Rae-Hynie-Brown-and-Martha-Stewart.jpg | |
// https://ssl.c.photoshelter.com/img-get2/I0000x_JQ_qY2rhs/fit=99999999999/1678-James-Brown-11-and-Tomi-Rae-Hynie-Brown-and-Martha-Stewart.jpg | |
// https://ssl.c.photoshelter.com/img-get2/I0000Ie55NrhpWqc/sec=wdfsdfoeflwefms1440ed20190122M0EoIIVFG8_ziPw/fit=350x2040 | |
// https://ssl.c.photoshelter.com/img-get2/I0000Ie55NrhpWqc/fit=99999999999/fit=350x2040 | |
// https://ssl.c.photoshelter.com/img-get2/I0000Ie55NrhpWqc/fit=99999999999 | |
return src | |
.replace(/\/img-get2\/([^/]*)\/(?:[a-z]+=[^/]*\/)*([^/]*)$/, "/img-get2/$1/fit=99999999999/$2") | |
.replace(/\/img-get\/([^/]*)(?:\/[ts]\/[0-9]+\/(?:[0-9]+\/)?)?([^/]*)$/, "/img-get2/$1/fit=99999999999/$2") | |
.replace(/\/+fit=[0-9x]+\/+fit=[0-9x]+/, "/fit=99999999999"); | |
} | |
if (domain_nowww === "celebzz.com" && | |
src.indexOf("/wp-content/uploads/") >= 0) { | |
// http://www.celebzz.com/wp-content/uploads/2018/03/jenna-ortega-at-ready-player-one-premiere-at-dolby-theatre-in-hollywood-21_thumbnail.jpg | |
// http://www.celebzz.com/wp-content/uploads/2018/03/jenna-ortega-at-ready-player-one-premiere-at-dolby-theatre-in-hollywood-21.jpg | |
newsrc = src.replace(/_thumbnail(\.[^/.]*)$/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nosub === "images-amazon.com" || | |
// http://ec2.images-amazon.com/images/I/81IotHEYjBL._AA1417_.jpg | |
// http://ec2.images-amazon.com/images/I/81IotHEYjBL.jpg | |
// https://images-na.ssl-images-amazon.com/images/I/B1GLFkULdTS._CR0,0,3840,2880_._SL1000_.png | |
// https://images-na.ssl-images-amazon.com/images/I/B1GLFkULdTS.png | |
// https://images-na.ssl-images-amazon.com/images/I/81yxJ9lr5vL.AC_SL1500_.jpg -- no ._ | |
// https://images-na.ssl-images-amazon.com/images/I/81yxJ9lr5vL.jpg | |
// https://images-eu.ssl-images-amazon.com/images/I/41TMMGD0XZL._SL500_AC_SS350_.jpg | |
// https://images-eu.ssl-images-amazon.com/images/I/41TMMGD0XZL.jpg | |
// https://images-na.ssl-images-amazon.com/images/S/abs-image-upload-na/3/AmazonStores/ATVPDKIKX0DER/bd40c858f5fe4f2734eea3b15695e490.w10200.h25650._SL5000_AC_.png | |
// https://images-na.ssl-images-amazon.com/images/S/abs-image-upload-na/3/AmazonStores/ATVPDKIKX0DER/bd40c858f5fe4f2734eea3b15695e490.w10200.h25650.png | |
// https://images-na.ssl-images-amazon.com/images/S/abs-image-upload-na/3/AmazonStores/ATVPDKIKX0DER/bd40c858f5fe4f2734eea3b15695e490.png -- doesn't work (403) | |
// https://images-na.ssl-images-amazon.com/images/S/abs-image-upload-na/9/AmazonStores/ATVPDKIKX0DER/02918ee40d2ef3b6901d11895620f31b.w7402.h4915._SL5000_AC_.png -- 5000x3320 | |
// https://images-na.ssl-images-amazon.com/images/S/abs-image-upload-na/9/AmazonStores/ATVPDKIKX0DER/02918ee40d2ef3b6901d11895620f31b.w7402.h4915.png | |
// https://images-na.ssl-images-amazon.com/images/G/01/aplusautomation/vendorimages/73da407a-f7e0-4d9a-8943-178d8838be48.jpg._CB329731638_.jpg -- 3744x5616 | |
// https://images-na.ssl-images-amazon.com/images/G/01/aplusautomation/vendorimages/73da407a-f7e0-4d9a-8943-178d8838be48.jpg.jpg -- same size | |
// https://images-na.ssl-images-amazon.com/images/G/01/aplusautomation/vendorimages/73da407a-f7e0-4d9a-8943-178d8838be48.jpg -- works too | |
domain_nosub === "ssl-images-amazon.com" || | |
// https://m.media-amazon.com/images/I/61rtKO6VrUL._SL500_.jpg | |
// https://m.media-amazon.com/images/I/61rtKO6VrUL.jpg | |
// https://m.media-amazon.com/images/M/MV5BNTJjZDE0YzQtNjQ1Mi00M2EwLTkxYTEtZDBiY2Q5NzY4NmQ5XkEyXkFqcGdeQXVyMDM2NDM2MQ@@._CR294,163,2581,2581_UX614_UY614.jpg | |
// https://m.media-amazon.com/images/M/MV5BNTJjZDE0YzQtNjQ1Mi00M2EwLTkxYTEtZDBiY2Q5NzY4NmQ5XkEyXkFqcGdeQXVyMDM2NDM2MQ@@.jpg | |
domain_nosub === "media-amazon.com" || | |
// https://ia.media-imdb.com/images/M/MV5BNjA1NDYwMDQ3MF5BMl5BanBnXkFtZTcwOTYyNDQ0MQ@@._V1_UY268_CR1,0,182,268_AL_.jpg | |
// https://ia.media-imdb.com/images/M/MV5BNjA1NDYwMDQ3MF5BMl5BanBnXkFtZTcwOTYyNDQ0MQ@@.jpg | |
// https://ia.media-imdb.com/images/M/MV5BMTU2NDI2YjktYjYxMy00OGIwLWEzMjktNzEzNzA4YzVmZGRjXkEyXkFqcGdeQXVyNDU4MDk4OA@@._V1_UY317_CR51,0,214,317_AL_.jpg | |
// https://ia.media-imdb.com/images/M/MV5BMTU2NDI2YjktYjYxMy00OGIwLWEzMjktNzEzNzA4YzVmZGRjXkEyXkFqcGdeQXVyNDU4MDk4OA@@.jpg | |
domain_nosub === "media-imdb.com" || | |
// http://in.in3w.info/i/MV5BMjM3MTczNzY1MF5BMl5BanBnXkFtZTgwNjgwODgzNDE@._V1_.jpg | |
// http://in.in3w.info/i/MV5BMjM3MTczNzY1MF5BMl5BanBnXkFtZTgwNjgwODgzNDE@.jpg | |
// moving to ia.media-imdb.com doesn't work | |
domain === "in.in3w.info" || | |
// https://i.gr-assets.com/images/S/compressed.photo.goodreads.com/users/1497668011i/22813064._UX100_CR0,0,100,100_.jpg | |
// https://i.gr-assets.com/images/S/compressed.photo.goodreads.com/users/1497668011i/22813064.jpg | |
domain === "i.gr-assets.com") { | |
// apparently some images can be replaced to 160px? ._SCRM_. apparently fixes this? | |
// ref: https://wiki.musicbrainz.org/User:Nikki/CAA | |
return { | |
//url: src.replace(/\._[^/]*\.([^./]*)$/, "._.$1"), | |
url: src | |
.replace(/(\.[^/.]*)(?:\.[^/.]*_){1,}\1(?:[?#].*)?$/, "$1") // is this needed? | |
.replace(/\.(?:[^/.]*_|_[^/.]+)\.([^./]*)$/, ".$1"), // for now this seems to work for all images | |
//always_ok: true, | |
is_original: true, | |
can_head: false | |
}; | |
} | |
if (domain_nosub === "otapol.jp") { | |
// http://otapol.jp/img/amazon/size130/41CUQ4yXvwL.jpg | |
// https://images-na.ssl-images-amazon.com/images/I/41CUQ4yXvwL.jpg | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/img\/amazon\/size[0-9]+\/([^/]*)$/, | |
"https://images-na.ssl-images-amazon.com/images/I/$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nowww === "movpins.com") { | |
// http://www.movpins.com/big/MV5BMjgxMzU1NDcxNV5BMl5BanBnXkFtZTgwODMzMjEyNTE@.__UY268_CR1,0,182,268_AL/stefanie-scott-at-event-of-insidious:-chapter-3-(2015)-large-picture.jpg | |
// https://ia.media-imdb.com/images/M/MV5BMjgxMzU1NDcxNV5BMl5BanBnXkFtZTgwODMzMjEyNTE@.jpg | |
return src.replace(/^[a-z]+:\/\/[^/]*\/[a-z]+\/+(.)([a-zA-Z0-9]+(?:@+)?)(?:\.[^/]*)?\/[^/]*(\.[^/.]*)$/, | |
"https://ia.media-imdb.com/images/$1/$1$2$3"); | |
} | |
/*if (false && domain.indexOf("cdn-img.instyle.com") >= 0) { | |
return src.replace(/(\/files\/styles\/)[^/]*(\/public)/, "$1original$2"); | |
} | |
if (false && domain.indexOf("static.independent.co.uk") >= 0) { | |
return src.replace(/(\/styles\/)story_[^/]*(\/public)/, "$1story_large$2"); | |
}*/ | |
// drupal | |
// https://italyxp.com/sites/default/files/mediaitalyxp/vesuvius.jpg?width=820&height=620&iframe=true | |
// https://www.windowscentral.com/sites/wpcentral.com/files/styles/xlarge_wm_brw/public/field/image/2018/03/surviving-mars-hero.jpg?itok=4_uW-AOb | |
// https://www.windowscentral.com/sites/wpcentral.com/files/field/image/2018/03/surviving-mars-hero.jpg -- different image | |
if (domain === "cdn-img.instyle.com" || | |
// https://cdn-img.instyle.com/sites/default/files/styles/684xflex/public/images/2016/07/071616-blake-lively-lead.jpg?itok=MFWx_-rR | |
// https://cdn-img.instyle.com/sites/default/files/images/2016/07/071616-blake-lively-lead.jpg | |
// https://static.independent.co.uk/s3fs-public/styles/story_large/public/thumbnails/image/2016/02/20/20/21-LGBT-MPs-TeriPeng.jpg | |
// https://static.independent.co.uk/s3fs-public/thumbnails/image/2016/02/20/20/21-LGBT-MPs-TeriPeng.jpg | |
domain === "static.independent.co.uk" || | |
// https://static.standard.co.uk/s3fs-public/thumbnails/image/2017/04/21/09/graham-norton-harry-styles-2.jpg?w968 | |
// https://static.standard.co.uk/s3fs-public/thumbnails/image/2017/04/21/09/graham-norton-harry-styles-2.jpg -- 1500x1000 | |
// https://static.standard.co.uk/s3fs-public/styles/story_large/public/thumbnails/image/2018/06/22/14/summerdresses.jpg | |
// https://static.standard.co.uk/s3fs-public/thumbnails/image/2018/06/22/14/summerdresses.jpg | |
domain === "static.standard.co.uk" || | |
/*domain.indexOf("www.billboard.com") >= 0 || | |
domain.indexOf("www.harpersbazaararabia.com") >= 0 || | |
domain.indexOf("www.etonline.com") >= 0 ||*/ | |
domain === "o.oystermag.com" || | |
/*domain.indexOf("www.metro.us") >= 0 || | |
domain.indexOf("www.mtv.co.uk") >= 0 || | |
domain.indexOf("www.grammy.com") >= 0 ||*/ | |
// https://cdn1.thr.com/sites/default/files/imagecache/scale_crop_768_433/2017/08/shot_02_-_warren_solo_00220-h_2017_thr.jpg | |
// https://cdn1.thr.com/sites/default/files/2017/08/shot_02_-_warren_solo_00220-h_2017_thr.jpg | |
(domain_nosub === "thr.com" && domain.match(/cdn[0-9]*\.thr\.com/)) || | |
// http://cdnau.ibtimes.com/sites/au.ibtimes.com/files/styles/v2_article_large/public/2016/02/23/kendall-jenner.jpg | |
// http://cdnau.ibtimes.com/sites/au.ibtimes.com/files/2016/02/23/kendall-jenner.jpg | |
domain.match(/s[0-9]*\.ibtimes\.com/) || | |
// https://www.standard.co.uk/s3fs-public/styles/hero_tablet/public/thumbnails/image/2014/11/18/15/nickhewer4.jpg | |
// https://www.standard.co.uk/s3fs-public/thumbnails/image/2014/11/18/15/nickhewer4.jpg | |
// | |
// https://www.standard.co.uk/s3fs-public/image/2014/11/18/15/nickhewer4.jpg | |
// is redirected to: | |
// http://www.standard.co.uk/s3/files/image/2014/11/18/15/nickhewer4.jpg | |
// which is not found | |
// but replacing /s3fs-public/ to /s3/files/ doesn't work | |
//domain_nowww === "standard.co.uk" || | |
// https://media.pri.org/s3fs-public/styles/story_main/public/story/images/coco-movie.jpg?itok=Uo82G_FI | |
// https://media.pri.org/s3fs-public/story/images/coco-movie.jpg | |
src.match(/\/s3fs-public\/styles\/[^/]*\/public\//) || | |
domain === "media.pri.org" || | |
// https://www.wwe.com/f/styles/gallery_img_l/public/all/2018/06/101_Tokyo_06282018hm_2329--f4c8f1052cba83a4a8b3f05905330617.jpg | |
domain_nowww === "wwe.com" || | |
// https://akm-img-a-in.tosshub.com/indiatoday/styles/video_landing_page_170_x_127/public/images/photogallery/201807/ambani_party.jpeg?XzEToHYNGMQ8GE4HVzpMci7KFJEe2wYe | |
domain === "akm-img-a-in.tosshub.com" || | |
// https://cdn.9razia.de/f/styles/facebook/public/media/gallery/2016-05-26/rihanna_red.jpg | |
// https://cdn.9razia.de/f/media/gallery/2016-05-26/rihanna_red.jpg | |
domain === "cdn.9razia.de" || | |
// https://www.bravo.de/assets/styles/teaserimage_200x200/public/field/image/on_gettyimages-521255466.jpg?itok=NwumyGri | |
// https://www.bravo.de/assets/field/image/on_gettyimages-521255466.jpg | |
domain_nowww === "bravo.de" || | |
// https://static.reservationvacances.com/reservationvacances/public/styles/mg_thumb_1/public/2018-02/poster-tour-eiffel-jour-nuit.jpg?itok=sVDUxLws | |
// https://static.reservationvacances.com/reservationvacances/public/2018-02/poster-tour-eiffel-jour-nuit.jpg | |
domain === "static.reservationvacances.com" || | |
// https://cdn.okmag.de/f/styles/facebook/public/media/gallery/2015/08/06/isabel-lucas.jpg | |
// https://cdn.okmag.de/f/media/gallery/2015/08/06/isabel-lucas.jpg | |
domain === "cdn.okmag.de" || | |
// http://www.soganhaber.com/dosyalar/styles/kr_150x150/public/Kisi/K/nm1083271/nm1083271_0.jpg?itok=uYzb0OTH | |
// http://www.soganhaber.com/dosyalar/Kisi/K/nm1083271/nm1083271_0.jpg | |
domain_nowww === "soganhaber.com" || | |
// https://favera.ru/img/styles/pin_tmb_2/public/2016/09/11/1368071_1473572524.jpg | |
// https://favera.ru/img/2016/09/11/1368071_1473572524.jpg | |
domain_nowww === "favera.ru" || | |
// https://cdn.businessinsider.es/sites/navi.axelspringer.es/public/styles/480/public/media/image/2019/03/Kim%20Jong-Un%2C%20li%CC%81der%20de%20Corea%20del%20Norte.jpg?itok=_Cf23v2r | |
// https://cdn.businessinsider.es/sites/navi.axelspringer.es/public/media/image/2019/03/Kim%20Jong-Un%2C%20li%CC%81der%20de%20Corea%20del%20Norte.jpg | |
domain === "cdn.businessinsider.es" || | |
// https://ru-24.ru/_files/styles/origina/public/news/image/pic_5093dfd3fb1ea735b63380a78a3389be.jpg?itok=p5WOiINr | |
// https://ru-24.ru/_files/news/image/pic_5093dfd3fb1ea735b63380a78a3389be.jpg | |
(domain_nowww === "ru-24.ru" && src.indexOf("/_files/") >= 0) || | |
// https://www.selenagomez.com/sites/g/files/aaj1261/f/styles/suzuki_opengraph/public/news/201710/IMG_2992.jpg.jpeg?itok=R0NVE31p | |
// https://www.selenagomez.com/sites/g/files/aaj1261/f/news/201710/IMG_2992.jpg.jpeg | |
(domain_nowww === "selenagomez.com" && src.indexOf("/sites/") >= 0) || | |
// http://cdn.whodoyouthinkyouaremagazine.com/sites/default/files/imagecache/623px_wide/episode/hewer500.jpg | |
// http://cdn.whodoyouthinkyouaremagazine.com/sites/default/files/episode/hewer500.jpg | |
// https://www.telugucinema.com/sites/default/files2/styles/media_gallery_thumbnail/public/amy-jackson-instagram1.jpg?itok=nwFhV2Iy | |
// https://www.telugucinema.com/sites/default/files2/amy-jackson-instagram1.jpg | |
src.match(/\/sites\/[^/]*\/files2?\/styles\/[^/]*/) || | |
src.match(/\/sites\/[^/]*\/files2?\/[^/]*\/styles\/[^/]*/) || | |
// https://cdn2.benzinga.com/files/imagecache/1024x768xUP/images/story/2012/rihanna.jpg | |
// http://mobile.dlisted.com/files/imagecache/photo-preview-mobile/files/hotslutweeknorwoodyoung.jpg | |
// http://i.dlisted.com/files/hotslutweeknorwoodyoung.jpg | |
// http://scd.en.rfi.fr/sites/english.filesrfi/imagecache/aef_ct_wire_image_620/images/afp/7270320fc21023b847f3f7755db401cc5de551bc.jpg | |
// http://scd.en.rfi.fr/sites/english.filesrfi/images/afp/7270320fc21023b847f3f7755db401cc5de551bc.jpg | |
// https://cdn.hobbyconsolas.com/sites/navi.axelspringer.es/public/styles/480/public/media/image/2016/06/601572-analisis-mirrors-edge-catalyst-ps4-xbox-one-pc.jpg?itok=6-RQwgNm | |
src.match(/(?:(?:\/sites\/+[^/]*)?\/files\/+|\/sites\/+[^/]*\/+)imagecache\/+[^/]*|\/sites\/+[^/]*\/+public\/+styles\/+/) || | |
// http://shakespearestaging.berkeley.edu/system/files/styles/large/private/images/titus-andronicus-the-old-globe-2006-2109.jpg?itok=zmPfmjYs | |
src.search(/\/files\/styles\/[^/]*\/(?:public|private)\//) >= 0 || | |
// https://www.straight.com/files/v3/styles/gs_large/public/2013/09/MUS_Nostalghia_2386.jpg | |
// https://www.straight.com/files/v3/2013/09/MUS_Nostalghia_2386.jpg | |
src.search(/\/files\/[^/]*\/styles\/[^/]*\/(?:public|private)\//) >= 0) { | |
newsrc = src | |
.replace(/\/styles\/+.*?\/+(?:public|private)\//, "/") | |
.replace(/\/imagecache\/+[^/]*\/+(?:files\/)?/, "/") | |
.replace(/\?.*$/, ""); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "cdn-img.instyle.com") { | |
// https://cdn-img.instyle.com/sites/default/files/styles/594xflex/public/images/2015/04/042015-dakota-fanning-lead_0_0.jpg | |
// https://cdn-img.instyle.com/sites/default/files/images/2015/04/042015-dakota-fanning-lead.jpg | |
// https://cdn-img.instyle.com/sites/default/files/images/2015/05/050915-lotd-dakota-fanning_0.jpg | |
newsrc = src.replace(/(\/images\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]+-[^/]+)_0(\.[^/.]+)(?:[?#].*)?$/, "$1$2"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nowww === "etonline.com") { | |
// https://www.etonline.com/sites/default/files/styles/max_970x546/public/images/2014-11/640_mike_myers_458987658.jpg?itok=Z5VnvwQ1 | |
return { | |
url: src, | |
head_wrong_contentlength: true | |
}; | |
} | |
if (domain === "cdn.okmag.de" || | |
// https://cdn.9razia.de/s/fotostrecke__slider/public/media/gallery/2016-05-26/rihanna_red.jpg | |
// https://cdn.9razia.de/media/gallery/2016-05-26/rihanna_red.jpg | |
domain === "cdn.9razia.de") { | |
// https://cdn.okmag.de/s/article_main/public/media/gallery/2015/08/19/emily-ratajkowski-promotour_good_morning_america.jpg | |
// https://cdn.okmag.de/media/gallery/2015/08/19/emily-ratajkowski-promotour_good_morning_america.jpg | |
return src.replace(/(:\/\/[^/]*\/)s\/[^/]*\/public\/(media\/)/, "$1$2"); | |
} | |
if (domain === "img.elcomercio.pe" || | |
// https://img.peru21.pe/files/article_main/uploads/2017/12/02/5a23434bd163c.jpeg | |
// https://img.peru21.pe/uploads/2017/12/02/5a23434bd163c.jpeg | |
domain === "img.peru21.pe" || | |
// https://www.elpais.com.co/files/article_graphic_small_inset/uploads/2018/08/06/5b686285870b6.jpeg | |
// https://www.elpais.com.co/uploads/2018/08/06/5b686285870b6.jpeg | |
domain_nowww === "elpais.com.co") { | |
// https://img.elcomercio.pe/files/article_main/uploads/2018/07/13/5b48b97d53da2.jpeg | |
// https://img.elcomercio.pe/uploads/2018/07/13/5b48b97d53da2.jpeg | |
return src.replace(/\/files\/[^/]*\/uploads\//, "/uploads/"); | |
} | |
if (domain === "media.voltron.voanews.com") { | |
// https://media.voltron.voanews.com/Drupal/01live-166/styles/sourced/s3/2019-04/E5076B31-4E4E-4435-AD6A-3784CE9C188D.jpg?itok=jV9YimuM | |
// https://media.voltron.voanews.com/Drupal/01live-166/2019-04/E5076B31-4E4E-4435-AD6A-3784CE9C188D.jpg?itok=jV9YimuM | |
return src.replace(/\/styles\/+[^/]*\/+s3\/+/, "/"); | |
} | |
if (domain_nowww === "trbimg.com") { | |
return src.replace(/\/[0-9]*\/[0-9]*x[0-9]*\/*$/, "/").replace(/\/[0-9]*\/*$/, "/"); | |
} | |
if ((domain_nosub === "blogspot.com" && domain.indexOf(".bp.blogspot.com") >= 0) || | |
// https://4.bp.blogspot.com/-1ndmEdQX3AM/Tv04FWJ3kTI/AAAAAAAAAzg/P-WNaJRST6Q/s400/Bookworm%2B3.jpg?ssl=1 | |
// https://4.bp.blogspot.com/-1ndmEdQX3AM/Tv04FWJ3kTI/AAAAAAAAAzg/P-WNaJRST6Q/s0/Bookworm%2B3.jpg=s0?imgmax=0 | |
((domain_nosub === "googleusercontent.com" || | |
// http://lh4.google.com.tw/thorking01/R7p9oIzdBMI/AAAAAAAACDA/wCm5zzbzkVE/s400/Hitomi101.jpg | |
domain_nosub.match(/^google\./)) && | |
// https://lh3.googleusercontent.com/qAhRBhfciCcosUoYHPJr5WtNYSJ81vpSqcQwbQitZtsR3mB2aCUj7J5LvhJOCfWn-CWqiLB18SyTr1VJvm_HI7B72opIAMZiZvg=w9999-h9999 | |
// https://lh3.googleusercontent.com/qAhRBhfciCcosUoYHPJr5WtNYSJ81vpSqcQwbQitZtsR3mB2aCUj7J5LvhJOCfWn-CWqiLB18SyTr1VJvm_HI7B72opIAMZiZvg=s0?imgmax=0 | |
// https://lh3.googleusercontent.com/j7RWveJMFLh5TNHWRRvQnTpwFF3Xzz-mZd8ff-2PmKGIycRxZkUaOmf14g7wIj7D5x2ci1d6DbstteRtb9GN5OXF6ozB32KIY0HUtXFKnN48A1DaxnV-7Nk3YoGbI5ITVJiHA6HyN1cGo_djsw | |
// https://lh3.googleusercontent.com/j7RWveJMFLh5TNHWRRvQnTpwFF3Xzz-mZd8ff-2PmKGIycRxZkUaOmf14g7wIj7D5x2ci1d6DbstteRtb9GN5OXF6ozB32KIY0HUtXFKnN48A1DaxnV-7Nk3YoGbI5ITVJiHA6HyN1cGo_djsw=s0?imgmax=0 | |
// https://lh3.googleusercontent.com/C6yBYozE1sXc9o_jsrh29_AYQ6ffCKO-fpooQ5nwuu7FSgQvdGtfSbcJVBUGSDi1VXE9TqYT2g=s0?imgmax=s0 -- "imgmax=s0" | |
(domain.match(/^lh[0-9]\./) || | |
// https://gp3.googleusercontent.com/a/AGF-l79M_XGVECzZZjz0fjvLRQ2F12vPycaGh4QLpKNN=s32-p-no | |
// https://gp3.googleusercontent.com/a/AGF-l79M_XGVECzZZjz0fjvLRQ2F12vPycaGh4QLpKNN=s0?imgmax=0 | |
domain.match(/^gp[0-9]\./) || | |
// https://ci3.googleusercontent.com/proxy/5wDs0lW9VwiJ9VuY3yV6TxZcSB2RQa7HcEWfwi_2elR976_QTHuRO464NJr1plEnsJc25ug3XZs1Xuw7TcVfvp6o-djvrmsHNobTAE13jxqHLm_IcCSl5KV924zY=w530-h300-p | |
// https://ci3.googleusercontent.com/proxy/5wDs0lW9VwiJ9VuY3yV6TxZcSB2RQa7HcEWfwi_2elR976_QTHuRO464NJr1plEnsJc25ug3XZs1Xuw7TcVfvp6o-djvrmsHNobTAE13jxqHLm_IcCSl5KV924zY=s0?imgmax=0 | |
domain.match(/^ci[0-9]\./))) || | |
// https://d2yal1mtmg1ts6.cloudfront.net/iFkddP_wLWySXrHXQ9oDom9utMCj3_9wsPjLcT3mipityCgMxnuspjAL5mejAeAQFA=h350-r | |
// https://d2yal1mtmg1ts6.cloudfront.net/iFkddP_wLWySXrHXQ9oDom9utMCj3_9wsPjLcT3mipityCgMxnuspjAL5mejAeAQFA=s0?imgmax=0 | |
domain === "d2yal1mtmg1ts6.cloudfront.net" || | |
// http://bp0.blogger.com/_sBBi-c1S7gU/SD5OZiDWDnI/AAAAAAAAFNc/3-cwL7frca0/s400/Copy+of+milla-jovovich-2.jpg | |
// https://1.bp.blogspot.com/_sBBi-c1S7gU/SD5OZiDWDnI/AAAAAAAAFNc/3-cwL7frca0/s0/Copy+of+milla-jovovich-2.jpg=s0?imgmax=0 | |
(domain_nosub === "blogger.com" && domain.match(/^bp[0-9]*\.blogger\.com/)) || | |
// http://lh4.ggpht.com/__zoKJ77EvEc/TO-9wdVTcwI/AAAAAAAAJEA/SbyR-4a03S0/dekotora%20%289%29%5B2%5D.jpg?imgmax=800 -- larger than s0? | |
// http://lh4.ggpht.com/__zoKJ77EvEc/TO-9wdVTcwI/AAAAAAAAJEA/SbyR-4a03S0/dekotora%20%289%29%5B2%5D.jpg=s0?imgmax=0 -- same size | |
domain_nosub === "ggpht.com") { | |
return src | |
.replace(/#.*$/, "") | |
.replace(/\?.*$/, "") | |
.replace(/\/[swh][0-9]*(-[^/]*]*)?\/([^/]*)$/, "/s0/$2") | |
.replace(/(=[^/]*)?$/, "=s0?imgmax=0"); | |
} | |
if (domain_nowww === "star-tool.ru") { | |
// https://star-tool.ru/-IqS0oUzPD8E/V3aAbr--0FI/AAAAAAAAD44/p1gVF4jSTSs5vu_w30KE6C-9SpkNiyWmQCLcB/s200/036-9oBtltvbsT8.jpg | |
// https://lh3.googleusercontent.com/-IqS0oUzPD8E/V3aAbr--0FI/AAAAAAAAD44/p1gVF4jSTSs5vu_w30KE6C-9SpkNiyWmQCLcB/s0/036-9oBtltvbsT8.jpg=s0?imgmax=0 | |
// this rule could probably be improved | |
return src.replace(/^[a-z]+:\/\/[^/]+\/+([^/]+\/+[^/]+\/+[^/]+\/+[^/]+\/+[swh][0-9]*(?:-[^/]*]*)?\/+)/, "https://lh3.googleusercontent.com/$1"); | |
} | |
if (domain_nosub === "googleusercontent.com" && | |
domain.indexOf("opensocial.googleusercontent.com") >= 0) { | |
// https://images-blogger-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2F1.bp.blogspot.com%2F-jdpU1PhmEgg%2FU2lBLnp50QI%2FAAAAAAAAChs%2FUu01Lvq-2xc%2Fs1600%2Frihanna%2Bmccartney.jpg&container=blogger&gadget=a&rewriteMime=image%2F* | |
// http://1.bp.blogspot.com/-jdpU1PhmEgg/U2lBLnp50QI/AAAAAAAAChs/Uu01Lvq-2xc/s1600/rihanna+mccartney.jpg | |
// http://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?container=focus&gadget=a&no_expand=1&resize_w=0&rewriteMime=image/*&url=http%3A%2F%2Fs5.mgimgcdn.com%2Fmangakakalot%2Fb1%2Fblack_rock_shooter_innocent_soul%2Fchapter_1%2F49.jpg | |
// http://s5.mgimgcdn.com/mangakakalot/b1/black_rock_shooter_innocent_soul/chapter_1/49.jpg | |
return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/gadgets\/proxy.*?[?&]url=([^&]*).*?$/, "$1")); | |
} | |
// replaced by thumbor rule | |
/*if (false && domain === "images.thestar.com") { | |
// https://images.thestar.com/-ZOPF3_-dhsPDK5diZsl7k2AWyE=/1086x724/smart/filters:cb(1533380883140)/https://www.thestar.com/content/dam/thestar/opinion/contributors/2018/08/02/mall-is-wrong-about-use-of-captured-images/rpjeatoncameras04.jpg | |
// https://www.thestar.com/content/dam/thestar/opinion/contributors/2018/08/02/mall-is-wrong-about-use-of-captured-images/rpjeatoncameras04.jpg | |
newsrc = src.replace(/(\/[^/.]*\.[^/.]*)\.[^/]*$/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
}*/ | |
if (domain === "cdn.narcity.com" || | |
// https://www.narcity.com/u/2018/01/11/e4b085930cc3bcc2a07ebab04580eadd81a0c6e0.jpg_1200x630.jpg | |
// https://www.narcity.com/u/2018/01/11/e4b085930cc3bcc2a07ebab04580eadd81a0c6e0.jpg | |
domain_nowww === "narcity.com") { | |
// https://cdn.narcity.com/uploads/288430_2f9bf6228fb968d30f49e19268da5c3719d76d74.jpg_facebook.jpg -- stretched? | |
// https://cdn.narcity.com/uploads/288430_2f9bf6228fb968d30f49e19268da5c3719d76d74.jpg | |
// https://cdn.narcity.com/u/2018/01/24/a84af3e5ab19eb3af3688b2e4ec6f768801df3fc.jpg_1200x630.jpg | |
// https://cdn.narcity.com/u/2018/01/24/a84af3e5ab19eb3af3688b2e4ec6f768801df3fc.jpg | |
// nano defender blocks js, need website to test | |
return src.replace(/(\/[^/.]*\.[^/._]+)_(?:facebook|[0-9]+x[0-9]+)\.[^/.]*(?:[?#].*)?$/, "$1"); | |
} | |
if (domain === "images.vanityfair.it" || | |
// https://images.glamour.it/gallery/64001/Mid/c8962608-9e0f-432c-8a31-17f24b645e7f.jpg | |
// https://images.glamour.it/gallery/64001/Original/c8962608-9e0f-432c-8a31-17f24b645e7f.jpg | |
domain === "images.glamour.it") { | |
// https://images.vanityfair.it/gallery/92363/Mid/190f628a-c665-4b01-a73d-5a230ad8b3b6.jpg | |
// https://images.vanityfair.it/gallery/92363/Original/190f628a-c665-4b01-a73d-5a230ad8b3b6.jpg | |
return src.replace(/(\/gallery\/[0-9]*\/)[^/]*\//, "$1Original/"); | |
} | |
if (domain_nosub === "r29static.com" || | |
// https://static2.refinery29.com/bin/entry/253/x,80/1173580/1janmain.jpg | |
// https://static2.refinery29.com/bin/entry/253/x,100/1173580/1janmain.jpg | |
(domain_nosub === "refinery29.com" && domain.match(/^static[0-9]*\./))) { | |
// http://s1.r29static.com//bin/entry/812/0,12,460,552/0x864,80/1207816/image.jpg -- stretched | |
// https://s1.r29static.com//bin/entry/812/x,100/1207816/image.jpg | |
// https://s1.r29static.com//bin/public/e32/0,0,2000,2400/720x864,80/1573061/image.jpg | |
// https://s1.r29static.com//bin/entry/e32/x,100/1573061/image.jpg | |
// https://s1.r29static.com//bin/public/e32/x,100/1573061/image.jpg | |
// https://s1.r29static.com//bin/entry/a34/340x408,80/1970977/image.jpg | |
// https://s1.r29static.com//bin/entry/a34/x,100/1970977/image.jpg | |
// https://s2.r29static.com//bin/author/f58/75x75,85/1320357/image.webp | |
// https://s2.r29static.com//bin/author/f58/x,100/1320357/image.webp | |
// 0x0,100 and x,100 both work | |
// other: https://www.refinery29.com/images/8499155.jpg?format=webp&width=720&height=864&quality=85 | |
return src.replace(/(\/bin\/(?:entry|public|author)\/[^/]*)\/(?:[0-9]+,[0-9]+,[0-9]+,[0-9]+\/)?[^/]*(?:,[^/]*)?\/([^,]*)$/, "$1/x,100/$2"); | |
} | |
if (domain === "img.huffingtonpost.com") { | |
// http://img.huffingtonpost.com/asset/5936853f2200003d00c6c785.png | |
// http://img.huffingtonpost.com/asset/5a6b56b02d00004900942e4e.jpeg | |
return src | |
// http://img.huffingtonpost.com//asset/scaleFit_630_noupscale/55a658581200002b001348b0.jpeg | |
// http://img.huffingtonpost.com//asset/55a658581200002b001348b0.jpeg | |
.replace(/\/asset\/[^/]*\/([^/.]*\.[^/.]*)$/, "/asset/$1") | |
// https://img.huffingtonpost.com/asset/5b670cbb2000009f00378f9a.jpeg?cache=aklfxnevww&ops=1910_1000 | |
// https://img.huffingtonpost.com/asset/5b670cbb2000009f00378f9a.jpeg | |
.replace(/\?[^/]*$/, ""); | |
} | |
if (domain === "images.huffingtonpost.com" || | |
// http://www.kisax.com/images/Samantha-Mumba/Samantha-Mumba-3-thumb.JPG | |
// http://www.kisax.com/images/Samantha-Mumba/Samantha-Mumba-3.JPG | |
(domain_nowww === "kisax.com" && src.indexOf("/images/") >= 0) || | |
// https://i2.nicepik.com/files/576/225/299/alberta-aspen-autumn-canada-thumb.jpg | |
// https://i2.nicepik.com/files/576/225/299/alberta-aspen-autumn-canada.jpg | |
(domain_nosub === "nicepik.com" && domain.match(/^i[0-9]*\./) && src.indexOf("/files/") >= 0) || | |
// https://babylonbee.com/img/articles/article-4919-1-thumb.jpg | |
// https://babylonbee.com/img/articles/article-4919-1.jpg | |
(domain_nowww === "babylonbee.com" && /\/img\/+articles\//.test(src)) || | |
// http://www.womansdiary.gr/articles/1686/774bb14b-4d63-4969-adc4-06322e6b852f-thumb.jpg | |
// http://www.womansdiary.gr/articles/1686/774bb14b-4d63-4969-adc4-06322e6b852f.jpg | |
(domain_nowww === "womansdiary.gr" && src.match(/\/articles\/[0-9]+\/[-0-9a-f]+-thumb/))) { | |
// https://images.huffingtonpost.com/2015-12-15-1450212883-2879887-356670f8740946d741c648b23_villarufologardensravellocampaniaitalycrgetty-thumb.jpg | |
// https://images.huffingtonpost.com/2015-12-15-1450212883-2879887-356670f8740946d741c648b23_villarufologardensravellocampaniaitalycrgetty.jpg | |
return src.replace(/-thumb(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "i.huffpost.com" || | |
domain === "s-i.huffpost.com") { | |
// https://i.huffpost.com/gen/1557988/thumbs/o-EMMA-570.jpg | |
// https://i.huffpost.com/gen/1557988/images/o-EMMA-570.jpg | |
// https://i.huffpost.com/gen/3142438/images/o-LORD-SUGAR-570.jpg | |
// https://i.huffpost.com/gen/4681756/thumbs/o-601718112-900.jpg | |
// https://i.huffpost.com/gen/4681864/thumbs/o-601718288-900.jpg?2 | |
// https://s-i.huffpost.com/gen/4681864/original.jpg | |
// https://i.huffpost.com/gen/3217980/images/n-JAZMIN-GRACE-GRIMALDI-628x314.jpg | |
// https://i.huffpost.com/gen/816377/original.jpg | |
// http://i.huffpost.com/gadgets/slideshows/331487/slide_331487_3313386_free.jpg | |
// http://i.huffpost.com/gadgets/slideshows/331487/slide_331487_3313616_free.jpg | |
// http://i.huffpost.com/gadgets/slideshows/366854/slide_366854_4186736_compressed.jpg | |
// http://i.huffpost.com/gadgets/slideshows/278815/slide_278815_2063217_original.jpg | |
return src | |
.replace(/(\/gadgets\/slideshows\/[0-9]*\/slide_[^/]*_)[a-z]*(\.[^/.]*)$/, "$1original$2") | |
.replace(/(\/gen\/[0-9]*\/).*(\.[^/.?]*)(?:\?[^/]*)?$/, "$1original$2"); | |
} | |
if ((domain_nosub === "washingtonpost.com" || | |
// https://www.statesman.com/rf/image_md/Pub/p9/AJC/Blog/Diehards/2018/04/05/Images/240866_GettyImages-872925824_sndecp.jpg | |
domain_nowww === "statesman.com" || | |
// https://www.myajc.com/rf/image_lowres/Pub/p6/CmgSharedContent/2015/05/18/Images/photos.medleyphoto.7287170.jpg | |
domain_nowww === "myajc.com" || | |
// https://www.ajc.com/rf/image_lowres/Pub/p6/CmgSharedContent/2015/05/18/Images/photos.medleyphoto.7287170.jpg | |
domain_nowww === "ajc.com" || | |
// http://www.lastampa.it/rf/image_lowres/Pub/p4/2018/03/09/Tecnologia/Foto/RitagliWeb/Mario%20Day1-15627-U11012767847446UFI-U11012767847446WcE-1400x788%40LaStampa.it.jpg | |
domain_nowww === "lastampa.it" || | |
// https://www.whio.com/rf/image_md/Pub/p7/CmgSharedContent/2016/08/01/Images/photos.medleyphoto.10777077.jpg | |
domain_nowww === "whio.com" || | |
// https://www.daytondailynews.com/rf/image_lowres/Pub/p7/CmgSharedContent/2016/08/01/Images/photos.medleyphoto.10777077.jpg | |
domain_nowww === "daytondailynews.com" || | |
// https://www.livemint.com/rf/Image-621x414/LiveMint/Period1/2012/09/28/Photos/currency--621x414.jpg | |
// https://www.livemint.com/rw/LiveMint/Period1/2012/09/28/Photos/currency--621x414.jpg | |
domain_nowww === "livemint.com" || | |
// https://c.o0bg.com/rf/image_371w/Boston/2011-2020/2018/01/03/BostonGlobe.com/Arts/Images/AFP_V03Q8.jpg | |
domain === "c.o0bg.com" || | |
// https://www.bostonglobe.com/rf/image_r/Boston/2011-2020/2018/01/29/BostonGlobe.com/Metro/Images/Polkgetty.r.jpg | |
// https://www.bostonglobe.com/rw/Boston/2011-2020/2018/01/29/BostonGlobe.com/Metro/Images/Polkgetty.jpg | |
// https://www3.bostonglobe.com/rf/image_r/Boston/2011-2020/2018/01/29/BostonGlobe.com/Metro/Images/Polkgetty.r.jpg?arc404=true | |
// https://www3.bostonglobe.com/rw/Boston/2011-2020/2018/01/29/BostonGlobe.com/Metro/Images/Polkgetty.jpg | |
domain_nosub === "bostonglobe.com" || | |
// https://www.960theref.com/rf/image_lowres/Pub/p6/CmgSharedContent/2015/05/18/Images/photos.medleyphoto.7287170.jpg | |
//domain_nowww === "960theref.com" || | |
// https://www.wgauradio.com/rf/image_lowres/Pub/p6/CmgSharedContent/2015/05/18/Images/photos.medleyphoto.7287170.jpg | |
//domain_nowww === "wgauradio.com" || | |
// https://www.journal-news.com/rf/image_medium/Pub/p10/JournalNews/2019/06/17/Images/newsEngin.24329221_Hamilton-Pothole-1.jpg | |
//domain_nowww === "journal-news.com" || | |
// https://www.wsbradio.com/rf/image_lowres/Pub/p9/CmgSharedContent/2018/08/14/Images/GettyImages-946417236.jpg | |
//domain_nowww === "wsbradio.com" || | |
// https://www.springfieldnewssun.com/rf/image_lowres/Pub/p10/DaytonDailyNews/2019/04/29/Images/newsEngin.24132011_IMG_1550.jpg | |
//domain_nowww === "springfieldnewssun.com" || | |
// https://www.dayton.com/rf/image_lowres/Pub/p10/DaytonDailyNews/2019/02/05/Images/newsEngin.23769425_Busy-Shopping-001--3-.jpg | |
//domain_nowww === "dayton.com" || | |
// https://www.krmg.com/rf/image_lowres/Wires/w2/AP_Top_News/2019/06/15/Images/1919968b8f534f8895c03c5625535ed9.jpg | |
//domain_nowww === "krmg.com" || | |
// https://www.news965.com/rf/image_lowres/Pub/p10/News965/2019/04/20/Images/lakeola.JPG | |
//domain_nowww === "news965.com" || | |
// https://www.magic1053.com/rf/image_lowres/Pub/p10/Magic1053/2019/06/12/Images/Office-Crash-2019-0612.jpg | |
//domain_nowww === "magic1053.com" || | |
// https://www.kissrocks.com/rf/image_lowres/Pub/p10/KissRocks/2019/02/21/Images/Alexa-Slider.jpg | |
//domain_nowww === "kissrocks.com" || | |
// https://www.kiss104fm.com/rf/image_lowres/Pub/p10/Kiss104FM/2019/04/02/Videos/4625859.vpx | |
//domain_nowww === "kiss104fm.com" || | |
// https://www.hot105fm.com/rf/image_lowres/Pub/p10/CmgSharedContent/2019/06/01/Images/juju%20smith%20schuster%20ketchup.jpg | |
//domain_nowww === "hot105fm.com" || | |
// https://www.k99online.com/rf/image_lowres/Pub/p10/K99Online/2019/06/10/Images/cj.jpg | |
//domain_nowww === "k99online.com" || | |
// https://www.news965.com/rf/image_lowres/Pub/p10/CmgSharedContent/2019/06/17/Images/gloria%20vanderbilt.jpg | |
//domain_nowww === "news965.com" || | |
// https://www.hits973.com/rf/image_lowres/Pub/Web/Hits973/Special%20Contents/FlatPages/Images/AppPage-830x467_HITS_2019-01.jpg | |
//domain_nowww === "hits973.com" || | |
// https://www.969theeagle.com/rf/image_lowres/Pub/p10/WAPE/2019/04/02/Images/IMG_7908.jpg | |
//domain_nowww === "969theeagle.com" || | |
// https://www.971theriver.com/rf/image_lowres/Pub/Web/971TheRiver/Special%20Contents/Links/Images/theeaglesthridshow.jpg | |
//domain_nowww === "971theriver.com" || | |
// https://www.thenew93q.com/rf/image_lowres/Pub/p10/TheNew93Q/2019/03/20/Images/MVIMG_20190304_160203.jpg | |
//domain_nowww === "thenew93q.com" || | |
// https://www.power953.com/rf/image_lowres/Pub/p10/Power953/2019/06/10/Images/CB_Slider1.jpg | |
//domain_nowww === "power953.com" || | |
// https://www.y100fm.com/rf/image_lowres/Pub/p10/Y100FM/2019/06/11/Images/Big-Reveal-2019-2.jpg | |
//domain_nowww === "y100fm.com" || | |
// https://www.easy93.com/rf/image_lowres/Pub/p10/Easy93/2019/06/12/Images/Free%20Lunch%20Friday_REV.jpg | |
//domain_nowww === "easy93.com" || | |
// https://www.1073theeagle.com/rf/image_lowres/Pub/Web/1073TheEagle/Special%20Contents/Links/Images/WXGL-Weather-RR-COLLEGE%20OF%20ROCK%20KNOWLEDGE.png | |
//domain_nowww === "1073theeagle.com" || | |
// https://www.hindustantimes.com/rf/image_size_640x362/HT/p2/2016/06/07/Pictures/_5e4299f2-2c82-11e6-85eb-521f5a9851b5.png | |
// https://www.hindustantimes.com/rw/HT/p2/2016/06/07/Pictures/_5e4299f2-2c82-11e6-85eb-521f5a9851b5.png | |
// https://m.hindustantimes.com/rf/image_size_640x362/HT/p2/2016/06/07/Pictures/_5e4299f2-2c82-11e6-85eb-521f5a9851b5.png | |
// https://www.hindustantimes.com/rw/HT/p2/2016/06/07/Pictures/_5e4299f2-2c82-11e6-85eb-521f5a9851b5.png | |
domain_nosub === "hindustantimes.com") && | |
src.indexOf("/rf/") >= 0 || | |
src.match(/^[a-z]+:\/\/[^/]*\/rf\/+image_[^/]*\/+(?:[0-9]{4}-[0-9]{4}\/+)?(?:Pub|Wires|HT)\/+(?:[wp][0-9]+|Online|Web)\/+/)) { | |
// test: https://img.washingtonpost.com/rf/image_1483w/2010-2019/Wires/Online/2017-11-21/AP/Images/Music_Taylor_Swift_36357.jpg | |
// error: Query String : src=http://www.washingtonpost.com/rw/2010-2019/Wires/Online/2017-11-21/AP/Images/Music_Taylor_Swift_36357.jpg&w=1483 | |
// real: https://img.washingtonpost.com/rf/image_1484w/2010-2019/Wires/Online/2017-11-21/AP/Images/Music_Taylor_Swift_36357.jpg-ced9a.jpg?uuid=TiTSis5fEeeoe0fxS3MWKg | |
// https://www.washingtonpost.com/rf/image_480x320/2010-2019/WashingtonPost/2018/01/26/Foreign/Images/AFP_XY105.jpg?t=20170517a | |
// https://www.washingtonpost.com/rw/2010-2019/WashingtonPost/2018/01/26/Foreign/Images/AFP_XY105.jpg | |
// https://www.hindustantimes.com/rf/image_size_960x540/HT/p2/2018/01/08/Pictures/susan-sarandon-watson-clemente-marai-larasi-emma_f6e96a02-f475-11e7-95e6-04e0a17510b6.jpg - stretched | |
// https://www.hindustantimes.com/rf/image/HT/p2/2018/01/08/Pictures/susan-sarandon-watson-clemente-marai-larasi-emma_f6e96a02-f475-11e7-95e6-04e0a17510b6.jpg | |
// https://www.hindustantimes.com/rf/image_size_90x90/HT/p2/2018/01/27/Pictures/parliament-session_d792b3aa-037c-11e8-8651-33050e64100a.jpg | |
// https://www.hindustantimes.com/rf/image/HT/p2/2018/01/27/Pictures/parliament-session_d792b3aa-037c-11e8-8651-33050e64100a.jpg | |
// https://www.hindustantimes.com/rf/image_size_960x540/HT/p2/2018/01/27/Pictures/parliament-session_d146b4e2-037c-11e8-8651-33050e64100a.jpg | |
// https://www.hindustantimes.com/rf/image/HT/p2/2018/01/27/Pictures/parliament-session_d146b4e2-037c-11e8-8651-33050e64100a.jpg | |
// https://www.hindustantimes.com/rf/image_size_960x540/HT/p2/2018/01/08/Pictures/emma-watson_af695f5c-f475-11e7-95e6-04e0a17510b6.jpg | |
// https://www.hindustantimes.com/rf/image/HT/p2/2018/01/08/Pictures/emma-watson_af695f5c-f475-11e7-95e6-04e0a17510b6.jpg | |
// https://www.hindustantimes.com/rw/HT/p2/2018/01/08/Pictures/emma-watson_af695f5c-f475-11e7-95e6-04e0a17510b6.jpg | |
// return src.replace(/\/image_size_[0-9]+x[0-9]+\//, "/image/"); | |
newsrc = src | |
.replace(/(.*?:\/\/[^/]*\/)rf\/[^/]*\/(.*)$/, "$1rw/$2") | |
.replace(/[?&].*$/, "") | |
.replace(/\.r(\.[^/.]*)$/, "$1"); | |
if (newsrc !== src) { | |
return newsrc; | |
} | |
// replaced by a generic one | |
//return src.replace(/.*\/wp-apps\/imrs\.php\?[^/]*src=/, ""); | |
} | |
// why was this separate? | |
/*if (false && domain_nowww === "livemint.com") { | |
// https://www.livemint.com/rf/Image-621x414/LiveMint/Period1/2012/09/28/Photos/currency--621x414.jpg | |
// https://www.livemint.com/rw/LiveMint/Period1/2012/09/28/Photos/currency--621x414.jpg | |
return src.replace(/\/rf\/[^/]*\/(.*)$/, "/rw/$1"); | |
}*/ | |
if (domain_nosub === "foxnews.com" && | |
domain.match(/^a[0-9]*\.foxnews\.com/)) { | |
// http://a57.foxnews.com/images.foxnews.com/content/fox-news/world/2017/11/15/firefighters-in-thailands-capital-on-front-line-citys-fight-against-snakes/_jcr_content/par/featured_image/media-0.img.jpg/931/524/1510749948281.jpg?ve=1&tl=1 | |
// down for now? | |
//console_log(src.replace(/.*\/a[0-9]*\.foxnews\.com\/(.*).*/, "$1")); | |
if (src.replace(/.*\/a[0-9]*\.foxnews\.com\/([^/]*).*/, "$1") !== "images.foxnews.com") { | |
return src.replace(/.*\/a[0-9]*\.foxnews\.com\/(.*)\/[0-9]+\/[0-9]+\/([^/]*)$/, "http://$1/$2"); | |
} | |
return src.replace(/(\/a[0-9]*\.foxnews\.com\/.*)\/[0-9]+\/[0-9]+\/([^/?]*)(?:\?.*)?$/, "$1/0/0/$2"); | |
} | |
if (domain === "cdn.cliqueinc.com" || | |
// http://cliqueimg.com/cache/posts/185680/threes-a-trend-super-sequins-bring-a-sexy-edge-to-the-oscars-1677261-1456708645.640x0c.jpg | |
// http://cliqueimg.com/cache/posts/185680/threes-a-trend-super-sequins-bring-a-sexy-edge-to-the-oscars-1677261-1456708645.jpg | |
// http://cliqueimg.com/posts/185680/threes-a-trend-super-sequins-bring-a-sexy-edge-to-the-oscars-1677261-1456708645.jpg | |
// http://cliqueimg.com/cache/posts/img/uploads/current/images/0/70/213/main.original.600x0c.jpg | |
// http://cliqueimg.com/cache/posts/img/uploads/current/images/0/70/213/main.original.jpg | |
// http://cliqueimg.com/posts/img/uploads/current/images/0/174/782/promo.original.600x0.jpg | |
// http://cliqueimg.com/posts/img/uploads/current/images/0/174/782/promo.original.jpg | |
domain_nosub === "cliqueimg.com") { | |
// https://cdn.cliqueinc.com/posts/img/uploads/current/images/0/39/490/main.original.640x0c.jpg | |
// https://cdn.cliqueinc.com/posts/img/uploads/current/images/0/39/490/main.original.jpg | |
return src | |
.replace(/(\/[^/]*)\.[0-9]*x[0-9]*[^/.]*\.([^./]*)$/, "$1.$2") | |
.replace(/\/cache\/posts\//, "/posts/"); | |
//return src.replace(/(\/[a-z]+)\.[a-z]+(?:\.[^/.]*)(\.[^/.]*)$/, "$1.original$2"); | |
} | |
if (domain_nosub === "hubstatic.com") { | |
return src.replace(/_[^_/.]*\.([^/.]*)$/, ".$1"); | |
} | |
if ((domain === "pbs.twimg.com" && | |
src.indexOf("pbs.twimg.com/media/") >= 0) || | |
(domain === "ton.twitter.com" && | |
src.indexOf("/ton/data/dm/") >= 0)) { | |
// use ?name=orig instead of :orig, see: | |
// https://github.com/qsniyg/maxurl/issues/2 | |
// https://pbs.twimg.com/media/DWREhilXkAAcafr?format=jpg&name=small -- 403 | |
// https://pbs.twimg.com/media/DWREhilXkAAcafr.jpg:orig | |
// https://pbs.twimg.com/media/DWREhilXkAAcafr?format=jpg&name=orig | |
// https://pbs.twimg.com/media/DWREhilXkAAcafr.jpg?name=orig | |
// https://pbs.twimg.com/media/DWO61F5X4AISSsF?format=jpg | |
// https://pbs.twimg.com/media/DWO61F5X4AISSsF.jpg:orig | |
// https://pbs.twimg.com/media/DWO61F5X4AISSsF?format=jpg&name=orig | |
// https://pbs.twimg.com/media/Dbxmq4BV4AA2ozg.jpg:orig | |
// https://pbs.twimg.com/media/Dbxmq4BV4AA2ozg.jpg?name=orig | |
// https://pbs.twimg.com/media/DdxPc2eU0AAED8b.jpg:thumb | |
// https://pbs.twimg.com/media/DdxPc2eU0AAED8b.jpg?name=orig | |
// https://pbs.twimg.com/media/DhI2IjaU8AAzEFA.jpg?format=jpg&name=orig | |
// https://pbs.twimg.com/media/DhI2IjaU8AAzEFA.jpg?name=orig | |
// https://pbs.twimg.com/media/DhbrylaVAAYlrss?format=png | |
// https://pbs.twimg.com/media/DhbrylaVAAYlrss.jpg?name=orig | |
// https://pbs.twimg.com/media/DhbrylaVAAYlrss:orig?format=jpg | |
// https://pbs.twimg.com/media/DhqeJS2UcAAo7fr.png | |
// https://pbs.twimg.com/media/DhqeJS2UcAAo7fr.jpg | |
// https://pbs.twimg.com/media/DhqeJS2UcAAo7fr.jpg?name=orig -- doesn't work | |
// https://pbs.twimg.com/media/DhqeJS2UcAAo7fr.png?name=orig -- works | |
// 4096x4096 is also a valid "name" | |
// medium == null? | |
// replace :orig to name=orig | |
newsrc = src | |
.replace(/:([^/?]+)(.*)?$/, "$2?name=$1") | |
.replace(/(\?.*)\?name=/, "$1&name="); | |
if (newsrc !== src) | |
return newsrc; | |
// replace format=jpg to .jpg | |
newsrc = src | |
.replace(/(\/[^/.?]+)\?(.*?&)?format=([^&]*)(.*?$)?/, "$1.$3?$2$4") | |
.replace(/\?&/, "?") | |
.replace(/[?&]+$/, ""); | |
if (newsrc !== src) | |
return newsrc; | |
// try various names (thanks to rEnr3n for reporting): https://github.com/qsniyg/maxurl/issues/165 | |
// https://pbs.twimg.com/media/Bu4G7k3CcAA6Nx7.jpg | |
// https://pbs.twimg.com/media/Bu4G7k3CcAA6Nx7.jpg?name=medium -- same size, anything higher doesn't work | |
var names = ["orig", "4096x4096", "large", "medium"]; | |
var obj = []; | |
var name = src.match(/[?&]name=([^&]+)/); | |
if (name) | |
name = name[1]; | |
else | |
name = null; | |
// don't downscale | |
var end = names.indexOf(name); | |
if (end < 0) | |
end = names.length; | |
for (var i = 0; i < end; i++) { | |
newsrc = src.replace(/(\?.*)?$/, "?name=" + names[i]); | |
// don't do this, this doesn't work for .jpg?format=jpg&name=... | |
if (false) { | |
newsrc = src.replace(/([?&]name=)[^&]+(&.*)?$/, "$1" + names[i] + "$2"); | |
if (newsrc === src) | |
newsrc = src | |
.replace(/(\?.*)?$/, "$1?name=" + names[i]) | |
.replace(/(\?.*)\?name=/, "$1&name="); | |
} | |
if (newsrc.match(/\.png(\?.*)?$/)) { | |
obj.push(newsrc); | |
obj.push(newsrc.replace(/\.png(\?.*)?$/, ".jpg$1")); | |
} else { | |
// Prefer png over jpg (compression) | |
obj.push(newsrc.replace(/\.jpg(\?.*)?$/, ".png$1")); | |
obj.push(newsrc); | |
} | |
} | |
obj.push(src); | |
return obj; | |
} | |
if (domain === "pbs.twimg.com" && | |
src.indexOf("pbs.twimg.com/profile_images/") >= 0) { | |
// https://pbs.twimg.com/profile_images/539057632435122178/1_MUcoAZ_bigger.jpeg | |
// https://pbs.twimg.com/profile_images/642139282325417984/uXOHdmTV_mini.png | |
// https://pbs.twimg.com/profile_images/1079712585186852864/l9IiWuzk_reasonably_small.jpg | |
// https://pbs.twimg.com/profile_images/1079712585186852864/l9IiWuzk.jpg | |
//return src.replace(/_[a-zA-Z0-9]+\.([^/_]*)$/, "\.$1"); | |
return src | |
.replace(/[?#].*$/, "") | |
.replace(/_bigger\.([^/_]*)$/, "\.$1") | |
.replace(/_normal\.([^/_]*)$/, "\.$1") | |
.replace(/_mini\.([^/_]*)$/, "\.$1") | |
.replace(/_reasonably_small\.([^/_]*)$/, "\.$1") | |
.replace(/_[0-9]+x[0-9]+\.([^/_]*)$/, "\.$1"); | |
} | |
if (domain === "pbs.twimg.com" && | |
// https://pbs.twimg.com/card_img/958636711470223361/S0DycGGB?format=jpg&name=600x314 | |
// https://pbs.twimg.com/card_img/958636711470223361/S0DycGGB?format=jpg&name=orig | |
src.indexOf("pbs.twimg.com/card_img/") >= 0 || | |
// https://pbs.twimg.com/ext_tw_video_thumb/1078225907569967105/pu/img/-Dw-qFfQvMTHz6YA?format=jpg&name=120x120 | |
// https://pbs.twimg.com/ext_tw_video_thumb/1078225907569967105/pu/img/-Dw-qFfQvMTHz6YA?format=jpg&name=orig | |
src.indexOf("/ext_tw_video_thumb/") >= 0) { | |
return src.replace(/(\?[^/]*&?name=)[^&/]*([^/]*)$/, "$1orig$2"); | |
} | |
if (domain === "pbs.twimg.com" && | |
src.indexOf("pbs.twimg.com/profile_banners/") >= 0) { | |
// https://pbs.twimg.com/profile_banners/811769379020947458/1503413326/1500x500 -- stretched | |
// https://pbs.twimg.com/profile_banners/811769379020947458/1503413326 | |
// thanks to Gyuri on discord: | |
// https://pbs.twimg.com/profile_banners/4746636714/1520928319/1500x500 -- possibly not stretched? | |
// https://pbs.twimg.com/profile_banners/4746636714/1520928319 | |
return src.replace(/\/[0-9]+x[0-9]+$/, ""); | |
} | |
if (domain === "ytimg.googleusercontent.com" || | |
// https://i.ytimg.com/vi/WLUWOwO2U8c/hqdefault.jpg?sqp=-oaymwEZCPYBEIoBSFXyq4qpAwsIARUAAIhCGAFwAQ==&rs=AOn4CLApoW235ABiHOfyJan0ArZIRsbUOA | |
(domain_nosub === "ytimg.com" && domain.match(/^i[0-9]*\./)) || | |
domain === "img.youtube.com") { | |
// thanks to speedymaan on github: https://github.com/qsniyg/maxurl/issues/29 | |
// https://i.ytimg.com/vi/sxItyrp55g8/0.jpg | |
// https://i.ytimg.com/vi/sxItyrp55g8/maxresdefault.jpg | |
// https://i1.ytimg.com/vi/KSUGZNEP-T4/1.jpg | |
// https://i1.ytimg.com/vi/KSUGZNEP-T4/mq1.jpg | |
// https://i1.ytimg.com/vi/KSUGZNEP-T4/maxres1.jpg | |
// https://i.ytimg.com/vi_webp/c8e9Nc36lRg/mqdefault.webp | |
// https://i.ytimg.com/vi_webp/c8e9Nc36lRg/sddefault.webp | |
// doesn't work for some urls: | |
// https://i.ytimg.com/vi/o-gVbQHG0Ck/hqdefault.jpg | |
// https://i.ytimg.com/vi/o-gVbQHG0Ck/sddefault.jpg -- different image | |
// https://i.ytimg.com/vi/bXMUBdqyVAE/hq720.jpg | |
// https://i.ytimg.com/vi/bXMUBdqyVAE/maxresdefault.jpg | |
obj = { | |
problems: { | |
possibly_different: true | |
} | |
}; | |
match = src.match(/\/vi(?:_webp)?\/+([^/]+)\/+[^/]+\.[^/.]+(?:[?#].*)?$/); | |
if (match) { | |
obj.extra = {page: "https://www.youtube.com/watch?v=" + match[1]}; | |
} | |
// Transforms private signed URLs into public ones. Only works for public videos. | |
// Signed URLs can't be changed, so this step is needed. | |
newsrc = src.replace(/^([a-z]+:\/\/)i[0-9]+(\.ytimg\.com\/vi(?:_webp)?\/+[^/]+\/+[a-z]+\.)/, "$1i$2"); | |
if (newsrc !== src) { | |
obj.url = newsrc; | |
// FIXME: is it possibly_different? | |
return obj; | |
} | |
regex = /^(.+\/+vi(?:_webp)?\/+[^/]*\/+)[a-z]*(default|[0-9]+)(\.[^/.?#]*)(?:[?#].*)?$/; | |
if (regex.test(src)) { | |
var sizes = [ | |
"maxres", | |
//"hq720", // don't use because it'll break mq1 etc. | |
"sd", | |
"hq", | |
"mq" | |
]; | |
var urls = [] | |
for (var i = 0; i < sizes.length; i++) { | |
var match = src.match(regex); | |
var number = match[2]; | |
if (number.length > 1 || number === "0") { | |
number = "default"; | |
} | |
newsrc = match[1] + sizes[i] + number + match[3]; | |
urls.push(newsrc); | |
} | |
if (urls.length > 0) | |
return fillobj_urls(urls, obj); | |
} | |
} | |
if (domain === "images.attvideo.com") { | |
// https://images.attvideo.com/image/BQ0mxQXmLsk/camila-cabello-havana-official-music-video-ft-young-thug.jpg | |
// https://i.ytimg.com/vi/BQ0mxQXmLsk/maxresdefault.jpg | |
match = src.match(/^[a-z]+:\/\/[^/]*\/+image\/+([^/]+)\/+[^/]*(?:[?#].*)?$/); | |
if (match) { | |
return "https://i.ytimg.com/vi/" + match[1] + "/mqdefault.jpg"; | |
} | |
} | |
if (domain_nowww === "phim24h.vn") { | |
// https://phim24h.vn/5yphoto/thumb-172/BQ0mxQXmLsk/camila-cabello-havana-official-music-video-ft-young-thug.jpg | |
// https://phim24h.vn/5yphoto/BQ0mxQXmLsk/camila-cabello-havana-official-music-video-ft-young-thug.jpg | |
// https://i.ytimg.com/vi/BQ0mxQXmLsk/maxresdefault.jpg | |
newsrc = src.replace(/\/5yphoto\/+thumb-[0-9]+\/+/, "/5yphoto/"); | |
if (newsrc !== src) | |
return newsrc; | |
match = src.match(/^[a-z]+:\/\/[^/]*\/+5yphoto\/+([^/]+)\/+[^/]+\.[^/.]+(?:[?#].*)?$/); | |
if (match) { | |
return "https://i.ytimg.com/vi/" + match[1] + "/mqdefault.jpg"; | |
} | |
} | |
if (domain === "zeroinger.herokuapp.com" || | |
// https://you2php.me/thumbnail.php?type=mqdefault&vid=Utx1UMAM4zU | |
// https://i.ytimg.com/vi/Utx1UMAM4zU/maxresdefault.jpg | |
domain_nowww === "you2php.me") { | |
// https://zeroinger.herokuapp.com/thumbnail.php?type=mqdefault&vid=BQ0mxQXmLsk | |
// https://zeroinger.herokuapp.com/thumbnail.php?vid=BQ0mxQXmLsk | |
// https://i.ytimg.com/vi/BQ0mxQXmLsk/maxresdefault.jpg | |
if (/^[a-z]+:\/\/[^/]*\/+thumbnail\.php\?/.test(src)) { | |
var vid = url.searchParams.get("vid"); | |
var type = url.searchParams.get("type"); | |
if (!type) | |
type = "mqdefault"; | |
return "https://i.ytimg.com/vi/" + vid + "/" + type + ".jpg"; | |
} | |
} | |
if (domain_nowww === "wapinda.in") { | |
// http://www.wapinda.in/vimg.php?v=KAzH-fPJDLQ | |
// https://i.ytimg.com/vi/KAzH-fPJDLQ/hqdefault.jpg | |
return src.replace(/.*\/vimg\.php\?(?:.*?&)?v=([^&]*).*?$/, "https://i.ytimg.com/vi/$1/mqdefault.jpg"); | |
} | |
if (domain === "image.bugsm.co.kr") { | |
// blank image: (?version= doesn't impact) | |
// https://image.bugsm.co.kr/artist/images/200/200498/20049877.jpg?version=20180108002103 | |
// https://image.bugsm.co.kr/artist/images/0/200498/20049877.jpg | |
// https://image.bugsm.co.kr/artist/images/original/200498/20049877.jpg -- same | |
// | |
// non-blank image: | |
// https://image.bugsm.co.kr/album/images/170/201403/20140343.jpg | |
// https://image.bugsm.co.kr/album/images/0/201403/20140343.jpg | |
// | |
// http://image.bugsm.co.kr/artist/images/original/801326/80132659.jpg | |
return src.replace(/\/images\/[0-9]*\//, "/images/original/").replace(/\?.*$/, ""); | |
} | |
if (domain_nosub === "wp.com" && | |
domain.match(/i[0-9]\.wp\.com/)) { | |
// https://i1.wp.com/img-aws.ehowcdn.com/default/cme/cme_public_images/www_ehow_com/photos.demandstudios.com/getty/article/240/3/178773543_XS.jpg?resize=400%2C267 | |
// http://photos.demandstudios.com/getty/article/240/3/178773543.jpg | |
// http://i0.wp.com/mmsns.qpic.cn/mmsns/7KE858KbWtJWJFCnub4OrBAHial0SicILILia7G2I1h6VwXG5cWSWpnPQ/0 -- redirect error, but works | |
// https://i1.wp.com/images-na.ssl-images-amazon.com/images/G/01/aplusautomation/vendorimages/73da407a-f7e0-4d9a-8943-178d8838be48.jpg._CB329731638_.jpg?ssl=1 | |
newsrc = remove_queries(src, ["w", "h", "resize", "zoom", "quality", "strip"]); | |
if (newsrc !== src) | |
return newsrc; | |
newsrc = src.replace(/^[a-z]+:\/\/i[0-9]*\.wp\.com\/(.*?)(?:\?.*)?$/, "$1"); | |
if (newsrc !== src) { | |
if (src.match(/[?&]ssl=1(?:&.*)?$/)) | |
return "https://" + newsrc; | |
else | |
return "http://" + newsrc; | |
} | |
} | |
/*if (false && domain === "imagesmtv-a.akamaihd.net") { | |
// http://imagesmtv-a.akamaihd.net/uri/mgid:file:http:shared:mtv.com/news/wp-content/uploads/2016/09/Guess-whooooooo-1473944872.jpg | |
// http://mtv.com/news/wp-content/uploads/2016/09/Guess-whooooooo-1473944872.jpg -- doesn't exist | |
// http://imagesmtv-a.akamaihd.net/news/wp-content/uploads/2016/09/Guess-whooooooo-1473944872.jpg -- works | |
return src.replace(/.*\/uri\/([a-z:]*:)?/, "http://"); | |
}*/ | |
if (domain === "img.voi.pmdstatic.net" || | |
// https is not supported | |
// http://img.voi.pmdstatic.net/fit/http.3A.2F.2Fprd2-bone-image.2Es3-website-eu-west-1.2Eamazonaws.2Ecom.2Fvoi.2F2018.2F09.2F05.2Ff6deca2b-fea8-4f1b-8045-fa30eb8515df.2Ejpeg/565x317/quality/80/pamela-anderson-decouvrez-qui-sera-son-partenaire-dans-danse-avec-les-stars-9.jpg | |
// http://prd2-bone-image.s3-website-eu-west-1.amazonaws.com/voi/2018/09/05/f6deca2b-fea8-4f1b-8045-fa30eb8515df.jpeg | |
// https://voi.img.pmdstatic.net/fit/http.3A.2F.2Fprd2-bone-image.2Es3-website-eu-west-1.2Eamazonaws.2Ecom.2Fvoi.2F2018.2F09.2F05.2Ff6deca2b-fea8-4f1b-8045-fa30eb8515df.2Ejpeg/565x317/quality/80/pamela-anderson-decouvrez-qui-sera-son-partenaire-dans-danse-avec-les-stars-9.jpg | |
// http://prd2-bone-image.s3-website-eu-west-1.amazonaws.com/voi/2018/09/05/f6deca2b-fea8-4f1b-8045-fa30eb8515df.jpeg | |
domain === "voi.img.pmdstatic.net") { | |
var base = src.replace(/.*\/fit\/([^/]*)\/.*/, "$1"); | |
base = base.replace(/\./g, "%"); | |
base = decodeURIComponent(base); | |
return base; | |
} | |
if (domain === "dynaimage.cdn.cnn.com") { | |
// https://dynaimage.cdn.cnn.com/cnn/q_auto,w_672,c_fill/http%3A%2F%2Fcdn.cnn.com%2Fcnnnext%2Fdam%2Fassets%2F170428012205-28-met-gala-kurkova.jpg | |
// http://cdn.cnn.com/cnnnext/dam/assets/170428012205-28-met-gala-kurkova.jpg | |
return decodeURIComponent(src.replace(/.*\/cnn\/[^/]*\//, "")); | |
} | |
// http://wcmimages.ottawasun.com/images?url=http://storage.ottawasun.com/v1/dynamic_resize/sws_path/suns-prod-images/1297804218043_ORIGINAL.jpg%3Fsize=520x&w=840&h=630 | |
// http://storage.ottawasun.com/v1/dynamic_resize/sws_path/suns-prod-images/1297804218043_ORIGINAL.jpg?size=520x -- broken, but 520x520 works | |
if (domain === "wcmimages.ottawasun.com" || | |
// http://wcmimages.torontosun.com/images?url=http://postmediatorontosun.files.wordpress.com/2017/12/ts20171211vh16159.jpg&w=840&h=630 | |
// https://postmediatorontosun.files.wordpress.com/2017/12/ts20171211vh16159.jpg | |
domain === "wcmimages.torontosun.com" || | |
// http://wcmimages.winnipegsun.com/images?url=http://storage.winnipegsun.com/v1/dynamic_resize/sws_path/suns-prod-images/1297974096773_ORIGINAL.jpg%3Fsize=520x&w=840&h=630 | |
// http://storage.winnipegsun.com/v1/suns-prod-images/1297974096773_ORIGINAL.jpg | |
domain === "wcmimages.winnipegsun.com" || | |
// http://wcmimages.edmontonjournal.com/images?url=https://postmediaedmontonjournal2.files.wordpress.com/2017/10/1014-you-black-hole8057-jpg.jpg&w=107&h=80 | |
// https://postmediaedmontonjournal2.files.wordpress.com/2017/10/1014-you-black-hole8057-jpg.jpg | |
domain === "wcmimages.edmontonjournal.com" || | |
src.match(/^[a-z]+:\/\/wcmimages\.[^/]*\/images\?url=http/)) { | |
//return decodeURIComponent(src.replace(/.*\/images\?[^/]*url=/, "")); | |
//return src.replace(/.*\/images\?url=([^&]*).*/, "$1"); | |
newsrc = decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/images.*?[?&]url=([^&]*).*/, "$1")); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
// moved to thumbor section | |
if (false && domain === "i.amz.mshcdn.com") { | |
// https://i.amz.mshcdn.com/S4Fr7rEpLL-QZnU3bsNT5ORJzYQ=/364x130/https%3A%2F%2Fblueprint-api-production.s3.amazonaws.com%2Fuploads%2Fstory%2Fthumbnail%2F73835%2Fd72a8d3f-baf0-4132-b6f9-358d27d1c0c9.JPG | |
// https://blueprint-api-production.s3.amazonaws.com/uploads/story/thumbnail/73835/d72a8d3f-baf0-4132-b6f9-358d27d1c0c9.JPG | |
// https://i.amz.mshcdn.com/vWTWthC534bzcGDk15NwrBy-dd4=/fit-in/1200x9600/https%3A%2F%2Fblueprint-api-production.s3.amazonaws.com%2Fuploads%2Fcard%2Fimage%2F54484%2FGettyImages-520238014.jpg | |
// doesn't work: | |
// https://i.amz.mshcdn.com/gXMzg2Z3xmXPa7EhIYOuwMmUu6M=/950x534/filters:quality(90)/2014%2F11%2F02%2F05%2Frihanna.40a2d.jpg | |
//return decodeURIComponent(src.replace(/.*i\.amz\.mshcdn\.com\/[^/]*\/[^/]*\/[^/]*\/([^/]*).*/, "$1")); | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/[^/]*=\/[0-9]+x[0-9]+\/(?:filters:[^/]*\/)?(https?(?:%3A|:\/\/))/, "$1"); | |
if (newsrc !== src) | |
return decodeURIComponent(newsrc); | |
} | |
if ((domain_nosub === "yimg.com" && domain.match(/^(?:[sl]|ct)[0-9]*\.yimg\.com/)) || | |
// https://movies.yahoo.com.tw/y/r/w520/bt/api/res/1.2/7CVvg8ycHHyQQhIFbt0eFw--~A/YXBwaWQ9dHdhYnVuZXdzO2ZpPWZpbGw7dz0xMzY1O2g9MjA0ODs-/http://media.zenfs.com/en/homerun/feed_manager_auto_publish_494/a292a5af4b414a75fc4aa1d0762bc2f2 | |
// http://media.zenfs.com/en/homerun/feed_manager_auto_publish_494/a292a5af4b414a75fc4aa1d0762bc2f2 | |
// https://movies.yahoo.com.tw/x/r/w340/i/o/production/movie-photos/December2018/J2l1xQpwWxuv2BGAQk3D-5568x3712.jpg | |
// https://movies.yahoo.com.tw/i/o/production/movie-photos/December2018/J2l1xQpwWxuv2BGAQk3D-5568x3712.jpg | |
// https://movies.yahoo.com.tw/x/r/h340/i/o/production/movie-photos/September2018/b3VeqXiLz0dWg7fRKSWf-533x800.jpg | |
// https://movies.yahoo.com.tw/i/o/production/movie-photos/September2018/b3VeqXiLz0dWg7fRKSWf-533x800.jpg | |
domain_nosub === "yahoo.com.tw") { | |
// http://l.yimg.com/bt/api/res/1.2/YIgTLkK5SkGYHzqDt4_e8Q--/YXBwaWQ9eW5ld3M7cT04NQ--/http:/mit.zenfs.com/316/2011/11/T-ZUCKERBERG_AP.jpg | |
// http://mit.zenfs.com/316/2011/11/T-ZUCKERBERG_AP.jpg | |
// https://s.yimg.com/uu/api/res/1.2/dO0cMruL5vXOYMSnK577KQ--~B/aD03OTg7dz0xMzMwO3NtPTE7YXBwaWQ9eXRhY2h5b24-/https://s.yimg.com/cd/resizer/2.0/FIT_TO_WIDTH-w1330/a8b0bce04276cee4a1a80ea615a18c6e087e3b28.jpg | |
// https://s.yimg.com/cd/resizer/2.0/FIT_TO_WIDTH-w1330/a8b0bce04276cee4a1a80ea615a18c6e087e3b28.jpg | |
// https://s.yimg.com/ny/api/res/1.2/guu198chJ6n8wlBLHhuLtg--/YXBwaWQ9aGlnaGxhbmRlcjtzbT0xO3c9NDUwO2g9MzAwO2lsPXBsYW5l/http://media.zenfs.com/en_us/News/Reuters/2017-03-17T012117Z_1_LYNXMPED2G03G_RTROPTP_2_PEOPLE-EMMAWATSON.JPG.cf.jpg | |
// http://media.zenfs.com/en_us/News/Reuters/2017-03-17T012117Z_1_LYNXMPED2G03G_RTROPTP_2_PEOPLE-EMMAWATSON.JPG | |
// https://s.yimg.com/uu/api/res/1.2/1aGXhnnFE3EBXf7EvkNT6w--~B/Zmk9c3RyaW07aD0xNjA7cHlvZmY9MDtxPTgwO3c9MzQwO3NtPTE7YXBwaWQ9eXRhY2h5b24-/https://media.zenfs.com/creatr-images/GLB/2018-06-15/acf56170-70a4-11e8-ad9e-1f5591b0f4d1_trump-kim-new.jpg.cf.webp | |
// https://media.zenfs.com/creatr-images/GLB/2018-06-15/acf56170-70a4-11e8-ad9e-1f5591b0f4d1_trump-kim-new.jpg | |
// http://l2.yimg.com/bt/api/res/1.2/K9XINOdK8vorcF7Ed__x2g--/YXBwaWQ9eW5ld3M7cT04NTt3PTMxMA--/http://media.zenfs.com/en-US/blogs/partner/emma_watson_bling_ring.jpg | |
// http://media.zenfs.com/en-US/blogs/partner/emma_watson_bling_ring.jpg | |
// https://s.yimg.com/ny/api/res/1.2/i7vByicVXw.SMw0TEmwy5Q--~A/YXBwaWQ9aGlnaGxhbmRlcjtzbT0xO3c9ODAw/http://media.zenfs.com/en/homerun/feed_manager_auto_publish_494/e1f72d9e2dc10d66297f7241501c98bd | |
// https://media.zenfs.com/en/homerun/feed_manager_auto_publish_494/e1f72d9e2dc10d66297f7241501c98bd | |
// https://ct.yimg.com/xd/api/res/1.2/sZNPkU7aHGDv1ysfUUaZHA--/YXBwaWQ9eXR3YXVjdGlvbnNlcnZpY2U7aD04MDA7cT04NTtyb3RhdGU9YXV0bzt3PTgwMA--/https://s.yimg.com/ob/image/4deef77a-5e3b-438b-8024-627e0eed0e72.jpg | |
// https://s.yimg.com/ob/image/4deef77a-5e3b-438b-8024-627e0eed0e72.jpg | |
return src | |
.replace(/.*\/[^/]*\/api\/res\/[^/]*\/[^/]*\/[^/]*\/(.*?)(?:\.cf\.(?:jpg|webp))?$/, "$1") | |
.replace(/^([a-z]*:\/)([^/])/, "$1/$2") | |
.replace(/(:\/\/[^/]*\/)x\/+r\/+[wh][0-9]+\/+i\/+/, "$1i/"); | |
} | |
if (false && domain === "media.zenfs.com") { | |
// wip | |
// http://media.zenfs.com/en-US/homerun/w_988/a6ca1ccb43ed5e7ef568057bf72638a2 -- 2137x3000 | |
} | |
if (domain === "image.iol.co.za") { | |
// https://image.iol.co.za/image/1/process/620x349?source=https://inm-baobab-prod-eu-west-1.s3.amazonaws.com/public/inm/media/2017/12/28/iol/665/18156546_10155339323235555_1085978007028663507_o.jpg | |
// https://inm-baobab-prod-eu-west-1.s3.amazonaws.com/public/inm/media/2017/12/28/iol/665/18156546_10155339323235555_1085978007028663507_o.jpg | |
return decodeURIComponent(src.replace(/.*\/process\/.*\?.*source=([^&]*).*/, "$1")); | |
} | |
// moved to thumbor section | |
/*if (false && domain.indexOf("imageresizer.static9.net.au") >= 0) { | |
//return decodeURIComponent(src.replace(/.*imageresizer\.static9\.net\.au\/[^=/]*=\/[0-9]+x[0-9]+\//, "")); | |
return decodeURIComponent(src.replace(/.*imageresizer\.static9\.net\.au\/.*?\/([^/.?&]*%3A%2F%2F)/, "$1")); | |
}*/ | |
if (domain_nosub === "squarespace.com" && | |
domain.match(/^static[0-9]*\.squarespace\.com/)) { | |
// https://static1.squarespace.com/static/56e08f834c2f850f604de326/5aa3c6d141920255c00dfa67/5aa3c705652dea7e55277e8f/1520682759079/POR_Stylist_Letitia+Wright_1.jpg?format=500w | |
// https://static1.squarespace.com/static/56e08f834c2f850f604de326/5aa3c6d141920255c00dfa67/5aa3c705652dea7e55277e8f/1520682759079/POR_Stylist_Letitia+Wright_1.jpg?format=original | |
newsrc = src.replace(/(?:\?.*)?$/, "?format=original"); | |
if (newsrc !== src) | |
return { | |
url: newsrc, | |
head_wrong_contentlength: true | |
}; | |
} | |
if (domain === "images.squarespace-cdn.com") { | |
// thanks to Lerortle on greasyfork | |
// original & 2500w don't work | |
// https://static1.squarespace.com/static/5af7497355b02c256beb398f/5ca91c12b208fc8763436403/5ca9236bf4e1fc950f180091/1554588542724/JM2_0214.jpg -- adding ?format=original removes format | |
// https://images.squarespace-cdn.com/content/5af7497355b02c256beb398f/1554588539422-SOGLCVARD0WFVBETEVV2/JM2_0214.jpg?format=500w&content-type=image%2Fjpeg | |
// https://images.squarespace-cdn.com/content/5af7497355b02c256beb398f/1554588539422-SOGLCVARD0WFVBETEVV2/JM2_0214.jpg?content-type=image%2Fjpeg | |
// | |
// no format doesn't work | |
// https://static1.squarespace.com/static/5af7497355b02c256beb398f/5ca91c12b208fc8763436403/5ca92359e4966bd72ecaf3c5/1554588550591/CF039538+v2+CU+copy.jpg -- adding ?format=original results in 2500w | |
// https://images.squarespace-cdn.com/content/5af7497355b02c256beb398f/1554588547904-N1RMALTJ0CDMXDDMEZL6/CF039538+v2+CU+copy.jpg?format=1000w&content-type=image%2Fjpeg | |
// https://images.squarespace-cdn.com/content/5af7497355b02c256beb398f/1554588547904-N1RMALTJ0CDMXDDMEZL6/CF039538+v2+CU+copy.jpg?format=2500w&content-type=image%2Fjpeg | |
// | |
// https://images.squarespace-cdn.com/content/5ad803f6f8370ac56e54a302/1554142468529-R05GL9RO9KSTOOTTT21Y/500w?content-type=image%2Fjpeg | |
// https://images.squarespace-cdn.com/content/5ad803f6f8370ac56e54a302/1554142468529-R05GL9RO9KSTOOTTT21Y?content-type=image%2Fjpeg | |
var contenttype = url.searchParams.get("content-type"); | |
var append = ""; | |
if (contenttype) { | |
append = "content-type=" + encodeURIComponent(decodeURIComponent(contenttype)); | |
} else { | |
append = ""; | |
} | |
var aappend = append ? "&" + append : ""; | |
var qappend = append ? "?" + append : ""; | |
newsrc = src | |
.replace(/\?.*/, "") | |
.replace(/\/+[0-9]+w$/, ""); | |
return [ | |
newsrc + "?format=original" + aappend, | |
newsrc + "?format=2500w" + aappend, | |
newsrc + qappend | |
]; | |
} | |
// /wp/uploads: | |
// http://ksassets.timeincuk.net/wp/uploads/sites/46/2017/02/oscars.jpg | |
if ((domain_nosub === "wordpress.com" && domain.indexOf(".files.wordpress.com") >= 0) || | |
//domain.indexOf("typeset-beta.imgix.net") >= 0 || | |
// what about pngs? shouldn't this be replaced to ?fm=png? | |
// https://nylon-img.imgix.net/featured_images/attachments/000/008/458/original/Emma_Watson_Gravity_Premieres_NYC_Part_4_uWbHv1Bg6Owx.jpg?auto=format&ch=Width%2CDPR&q=75&w=640&ixlib=js-1.1.1&s=1587e8684f7fef1feac6d703480a760b | |
((domain_nosub === "imgix.net" || | |
// https://imgix.bustle.com/uploads/getty/2018/3/14/a38ca3e6-056e-4aef-9c2b-1b00a134d7be-getty-917851058.jpg?w=970&h=582&fit=crop&crop=faces&auto=format&q=70 | |
domain === "imgix.bustle.com" || | |
// https://imgix.ovp.tv2.dk/s/73/45137373-da3fa00af722541b2a7b64cdb7847f0c.jpeg?auto=format%2Ccompress&fit=min&crop=top&w=200 | |
domain === "imgix.ovp.tv2.dk" || | |
// https://imgix.elitedaily.com/elite-daily/2015/12/06102252/elitedaily-fox-xfiles.jpg?w=945&h=574&auto=format&q=70&fit=crop&crop=faces | |
domain === "imgix.elitedaily.com" || | |
// https://imgix.thezoereport.com/zoe-report/2017/11/margot-robbie-style-versace-gold-gown-web.jpg?w=640&fit=max&auto=format&q=70 | |
domain === "imgix.thezoereport.com" || | |
// https://cdn-imgix-open.headout.com/blog/Paris+Guide/ND-exterior.JPG?auto=compress&fm=pjpg&fit=min&crop=faces&w=600&h=600&q=20 | |
domain === "cdn-imgix-open.headout.com" || | |
// https://images.assettype.com/mediaone%2F2018-06%2F2da714b8-3908-47f6-86fa-8a88ea1ef9d8%2Femma_stone.jpg?w=480&auto=format%2Ccompress&fit=max | |
domain === "images.assettype.com" || | |
// https://images.seoghoer.dk/s3fs-public/storage_1/media/kylie_jenner_1.jpg?ixlib=imgixjs-3.4.0&w=200 | |
domain === "images.seoghoer.dk" || | |
// https://imgix.romper.com/2016/8/22/584902004.jpg?w=640&fit=max&auto=format&q=70 | |
domain === "imgix.romper.com") && | |
!src.match(/[?&]s=[^/]*$/)) || | |
// http://hmg-prod.s3.amazonaws.com/images/bgus-1060427-037-1-1510856807.jpg | |
// http://s3.amazonaws.com/hmg-prod/images/bgus-1060427-037-1-1510856807.jpg | |
amazon_container === "hmg-prod" || | |
// https://blogs-images.forbes.com/niallmccarthy/files/2017/11/20171114_Cigarettes.jpg?width=960 | |
domain === "blogs-images.forbes.com" || | |
// https://images-production.global.ssl.fastly.net/uploads/images/file/47918/jonah-hill-2015-vs-2017.jpg?auto=compress&fit=crop&h=727&q=55&w=750 | |
domain === "images-production.global.ssl.fastly.net" || | |
// https://images-production.freetls.fastly.net/uploads/photos/file/116888/selena-gomez-no-bra-2015.jpg?auto=compress&crop=top&fit=max&q=55&w=750 | |
domain === "images-production.freetls.fastly.net" || | |
//domain.indexOf("typeset-beta.imgix.net") >= 0 || | |
//domain.indexOf("cosmouk.cdnds.net") >= 0 || | |
// http://esquireuk.cdnds.net/15/37/2048x2730/2048x2730-felicity-jones-oscars-43-jpg-fe5ebdf1.jpg?resize=768:* | |
domain_nosub === "cdnds.net" || | |
/*domain.indexOf("hbz.h-cdn.co") >= 0 || | |
domain.indexOf("cos.h-cdn.co") >= 0 ||*/ | |
domain_nosub === "h-cdn.co" || | |
// http://cdn.newsapi.com.au/image/v1/00f120191891d8b371ae91eba6290c76?width=316 | |
domain === "cdn.newsapi.com.au" || | |
// https://images.indianexpress.com/2018/09/feat1.jpg?w=450 | |
domain === "images.indianexpress.com" || | |
// can't find a test case | |
domain === "images.contentful.com" || | |
// http://imagesmtv-a.akamaihd.net/uri/mgid:file:http:shared:mtv.com/news/wp-content/uploads/2016/03/Spy-Kids-1459273031.jpg?quality=.8&height=400&wid | |
domain === "imagesmtv-a.akamaihd.net" || | |
// https://d.ibtimes.co.uk/en/full/435849/anjem-choudary-shariah-project-protest-brick-lane-pic-ibtimes-co-uk.jpg?w=720&e=f9b092054c209d993bb1be7d435f293a | |
domain === "d.ibtimes.co.uk" || | |
// http://akns-images.eonline.com/eol_images/Entire_Site/2014519/rs_300x300-140619060824-600.Harry-Potter-Cast-JR-61914.jpg | |
// http://akns-images.eonline.com/eol_images/Entire_Site/2014519/rs_1024x759-140619060822-1024.Harry-Potter-Cast-JR-61914.jpg | |
domain === "akns-images.eonline.com" || | |
/*domain.indexOf("www.telegraph.co.uk") >= 0 || | |
// http://subscriber.telegraph.co.uk/content/dam/news/2018/01/08/GettyImages-862428716_trans_NvBQzQNjv4BqZgEkZX3M936N5BQK4Va8RWtT0gK_6EfZT336f62EI5U.jpg?imwidth=480 | |
domain === "subscriber.telegraph.co.uk" || | |
// https://secure.aws.telegraph.co.uk/content/dam/wellbeing/2016/12/28/graham5_trans_NvBQzQNjv4BqNyaloxhBNUSEitvcqmzeaNrVK9LoR4c_wZH1EhIay9c.jpg?imwidth=480 | |
domain.indexOf("aws.telegraph.co.uk") >= 0 ||*/ | |
(domain_nosub === "telegraph.co.uk" && src.indexOf("/content/dam/") >= 0) || | |
// https://img.buzzfeed.com/thumbnailer-prod-us-east-1/video-api/assets/175593.jpg?output-format=auto&output-quality=auto&resize=625:* | |
domain === "img.buzzfeed.com" || | |
// doesn't work with google's referrer | |
// http://p3.music.126.net/MsiMKqHKy4xHxpLHngSuYQ==/19145795975058896.jpg?param=200y200 | |
(domain_nosub === "126.net" && domain.match(/^p[0-9]*\.music\.126\.net/)) || | |
// https://stat.profile.ameba.jp/profile_images/20180312/04/0d/ir/j/o03980600p_1520796916426_wiwja.jpg?cat=248 | |
domain === "stat.profile.ameba.jp" || | |
// https://stat.blogskin.ameba.jp/blogskin_images/20181221/11/87/6A/p/o11200520cherrsee1545359990390.png?caw=1120 | |
domain === "stat.blogskin.ameba.jp" || | |
// https://stat.ameba.jp/user_images/20180222/17/kirarinfairy/75/1c/j/o0414060014136605494.jpg?caw=200 | |
domain === "stat.ameba.jp" || | |
// http://image.uczzd.cn/5758462716763402626.jpg?id=0&width=480 | |
domain === "image.uczzd.cn" || | |
// http://img.danawa.com/prod_img/500000/803/712/img/1712803_1.jpg?shrink=500:500&_v=20150119135203 | |
domain === "img.danawa.com" || | |
// https://img-www.tf-cdn.com/movie/2/dont-worry-he-wont-get-far-on-foot-2018.jpeg?_v=20180709235653&w=1024&h=512&dpr=1&auto=compress&fm=pjpg&fit=crop&crop=faces%2Ctop | |
domain === "img-www.tf-cdn.com"|| | |
// https://6.viki.io/image/85db05c96d2c4a4ba4d6d2fa9798281c.jpeg?x=b&a=0x0&s=460x268&e=t&f=t&cb=1 | |
domain_nosub === "viki.io" || | |
// https://avatars2.githubusercontent.com/u/1?s=400&v=4 | |
(domain_nosub === "githubusercontent.com" && domain.match(/^avatars[0-9]*\./)) || | |
// https://bloximages.newyork1.vip.townnews.com/heraldmailmedia.com/content/tncms/assets/v3/editorial/1/9a/19a45cfe-354a-11e3-939d-001a4bcf6878/5800f2836b369.image.jpg?resize=1200%2C675 | |
(domain_nosub === "townnews.com" && domain.match(/bloximages\..*vip\.townnews\.com/)) || | |
//domain === "bloximages.newyork1.vip.townnews.com" || | |
domain === "asset.wsj.net" || | |
// https://images.wsj.net/im-20887?width=1260&aspect_ratio=1.5 | |
domain === "images.wsj.net" || | |
domain === "steamuserimages-a.akamaihd.net" || | |
// haven't tested, but it's imgix | |
//domain === "image.assets.pressassociation.io" || | |
// https://content.assets.pressassociation.io/2018/02/06210749/1324f25e-1b19-4315-9420-e8e027475cf2.jpg?rect=0,183,2355,1325&ext=.jpg | |
//domain === "content.assets.pressassociation.io" || | |
(domain_nosub === "pressassociation.io" && domain.match(/\.assets\.pressassociation\.io$/)) || | |
// http://media.immediate.co.uk/volatile/sites/3/2012/05/13874.jpg?quality=90&lb=620,413&background=white | |
domain === "media.immediate.co.uk" || | |
// https://images.immediate.co.uk/volatile/sites/3/2018/03/Emma-Watson-Oscars-tattoo-25baac2.jpg?quality=10&lb=620,413&background=white | |
domain === "images.immediate.co.uk" || | |
// https://media.gettyimages.com/photos/nick-hewer-arriving-for-the-2012-arqiva-british-academy-television-picture-id848052898?k=6&m=848052898&s=612x612&w=0&h=4QnBTCuNyp6nYhAumGR6k9gqH3iYagsnqkDo0ouGnts= | |
// adds watermark, sometimes smaller | |
//domain === "media.gettyimages.com" || | |
// https://media.npr.org/assets/artslife/arts/2010/10/keith-richards/keith-richards_wide-68d0d5994c72c50de849d27e7c75519f2c832fc8.jpg?s=1400 | |
domain === "media.npr.org" || | |
// http://assets.teamrock.com/image/1cfd675c-33c9-4081-a27f-3f41abc88b69?w=800 | |
domain === "assets.teamrock.com" || | |
// https://media2.woopic.com/api/v1/images/156%2FS6N4g%2Fles-revoltes-rencontre-avec-simon-leclere-et-solene-rigot%7Cx240-WfM.jpg?format=300x175&facedetect=1&quality=85 | |
(domain_nosub === "woopic.com" && domain.match(/^media[0-9]\.woopic\.com/)) || | |
// http://md1.libe.com/photo/357188-de-gauche-a-droite-louise-grinberg-yara-pilartz-roxane-duran-solene-rigot-et-juliette-darche.jpg?modified_at=1322675617&width=975 -- redirects to the pattern below | |
(domain_nosub === "libe.com" && domain.match(/^md[0-9]\.libe\.com/)) || | |
// http://medias.liberation.fr/photo/357188-de-gauche-a-droite-louise-grinberg-yara-pilartz-roxane-duran-solene-rigot-et-juliette-darche.jpg?modified_at=1322675617&width=975 | |
domain === "medias.liberation.fr" || | |
// https://regmedia.co.uk/2016/08/03/newsboy.jpg?x=442&y=293&crop=1 | |
domain === "regmedia.co.uk" || | |
// https://imageservice.nordjyske.dk/images/nordjyske.story/2012_05_12/961b43d2-64b8-47df-8c37-1c0e73565fb0.jpg?w=624&mode=crop&scale=both | |
domain === "imageservice.nordjyske.dk" || | |
// https://cms.algoafm.co.za/img/or_2018111575720.jpeg?mode=crop&w=320&h=240&anchor=topcenter&scale=both | |
(domain === "cms.algoafm.co.za" && src.indexOf("/img/") >= 0) || | |
// http://www.gosoutheast.com/images/2015/9/29/Tony_Anderson-150917-JR.jpg?width=300 | |
(domain_nowww === "gosoutheast.com" && src.indexOf("/images/") >= 0) || | |
// http://itpro.nikkeibp.co.jp/atcl/column/17/010900605/011000014/ph01.jpg?__scale=w:450,h:501&_sh=0e0c309803 | |
//(domain === "itpro.nikkeibp.co.jp" && src.toLowerCase().match(/\.(?:jpg|png)$/)) || | |
// http://trendy.nikkeibp.co.jp/atcl/column/17/011800066/020900003/01.jpg?__scale=w:400,h:267&_sh=08d0b10ff0 | |
// http://wol.nikkeibp.co.jp/atcl/column/15/011500044/021300142/icon_m.jpg?__scale=w:214,h:147&_sh=0820dc0240 | |
(domain_nosub === "nikkeibp.co.jp" && src.toLowerCase().match(/\.(?:jpg|png)/)) || | |
// http://s-a4.best.gg/rosters/players/default2.png?image=c_fill,g_south,h_90,w_90 | |
(domain_nosub === "best.gg" && domain.match(/s-a[0-9]*\.best\.gg/)) || | |
// https://i5.walmartimages.com/asr/5375d30c-11a2-4725-a32d-cb59da53b5a5_1.20c1f4d2ccae8f4840ae88be99babb3e.jpeg?odnHeight=450&odnWidth=450&odnBg=FFFFFF | |
(domain_nosub === "walmartimages.com" && domain.match(/i[0-9]*\.walmartimages\.com/)) || | |
// https://nails.newsela.com/s3/newsela-media/article_media/2017/10/elem-hogwarts-express-rescue-fa623e3b.jpg?crop=0,139,1366,907&height=497&width=885 | |
domain === "nails.newsela.com" || | |
// http://ojsfile.ohmynews.com/CT_T_IMG/2018/0201/IE002279450_APP.jpg?2034 | |
domain === "ojsfile.ohmynews.com" || | |
// https://lumiere-a.akamaihd.net/v1/images/image_4cca1969.jpeg?region=0,0,512,288 | |
domain === "lumiere-a.akamaihd.net" || | |
// http://img.lum.dolimg.com/v1/images/homepage_sabrinacarpenter_hero_ec42cce5.jpeg?region=704,0,519,480 | |
domain === "img.lum.dolimg.com" || | |
// http://www.xxlmag.com/files/2018/02/Iggy-Azalea-interview.jpeg?w=980&q=75 | |
// http://xxlmag.com/files/2018/02/Iggy-Azalea-interview.jpeg?w=980&q=75 | |
domain_nowww === "xxlmag.com" || | |
// https://static01.nyt.com/images/2018/02/03/arts/03playlist/merlin_123145877_5ed2acde-72d5-4afb-a19a-93dbc29b5d2f-superJumbo.jpg?quality=100&auto=webp | |
(domain_nosub === "nyt.com" && domain.match(/^static[0-9]*\.nyt\.com/)) || | |
// https://image.insider.com/5d1b732b21a8617668149572?width=1100&format=jpeg&auto=webp | |
domain === "image.insider.com" || | |
// https://image.businessinsider.com/5bc0aeeddde8677f346b9a82?width=1100&format=jpeg&auto=webp | |
domain === "image.businessinsider.com" || | |
// https://video-images.vice.com/articles/592ed99499168942accbdf39/lede/1496243427040-BadGyal_JavierRuiz_2.jpeg?crop=1xw:0.4212xh;0xw,0.3534xh&resize=1200:* | |
// https://i-d-images.vice.com/images/2016/07/29/club-marab-cierra-su-temporada-con-bad-gyal-la-princesa-del-trap-cataln-body-image-1469779091.jpg?crop=1xw:0.5625xh;center,center&resize=0:* | |
// https://images.vice.com/noisey/content-images/article/die-antwoord-gucci-coochie/Screen-Shot-2016-05-18-at-16-32-36.jpg?crop=1xw%3A0.8371478873239436xh%3Bcenter%2Ccenter&resize=650%3A*&output-quality=55 | |
(domain_nosub === "vice.com" && domain.match(/images\.vice\.com$/)) || | |
// https://i.imgur.com/ajsLfCa_d.jpg?maxwidth=520&shape=thumb&fidelity=high | |
(domain === "i.imgur.com" && !src.match(/\?[0-9]+$/)) || | |
// https://media.discordapp.net/attachments/170399623859404800/411963827412795394/CdynalsW4AQYsgy.png?width=223&height=300 | |
domain === "media.discordapp.net" || | |
// https://images.discordapp.net/.eJwFwcsRgyAQANBeKIDltwIWkB48IjKgo4FhN6dMes97X_GZt1hFYx60Ahwn5T4PSdxnqkXW3utd0jhJ5v5AYk65PeXNBAaVDSF6ZVR0WitvwGrEBbVzyvsQ7eIMvPYWM27yGlX8_v3wIf4.2PoWG1MegEuQyuPigedqzEcwm7Y?width=462&height=600 | |
domain === "images.discordapp.net" || | |
// https://images.theconversation.com/files/159874/original/image-20170308-14932-n1fsc6.jpg?ixlib=rb-1.1.0&q=45&auto=format&w=1000&fit=clip | |
domain === "images.theconversation.com" || | |
// https://www.rspb.org.uk/globalassets/images/birds-and-wildlife/non-bird-species-illustrations/grey-squirrel_1200x675.jpg?preset=landscape_mobile | |
(domain_nowww === "rspb.org.uk" && src.indexOf("/globalassets/") >= 0) || | |
// http://media.beliefnet.com/~/media/photos/inspiration/galleries/20-most-beautiful-places-in-the-world/tunnel_of_love_ukraine.jpg?as=1&w=400 | |
(domain === "media.beliefnet.com" && (/\/media\//i).test(src)) || | |
// https://www.ramblers.org.uk/~/media/Images/Walk%20magazine/Features/Winter%202013%20and%20past/12.jpg?h=394&la=en&w=200 | |
(domain_nowww === "ramblers.org.uk" && (/\/media\//i).test(src)) || | |
// https://warnerbrosuk.azureedge.net/~/media/images/warner-bro/movies/aquaman/37.jpg?w=400 | |
// https://warnerbrosuk.azureedge.net/~/Media/Images/warner-bro/movies/aquaman/37.jpg?w=400 | |
(domain === "warnerbrosuk.azureedge.net" && (/\/media\//i).test(src)) | | |
// https://www.warnerbros.co.uk/~/media/images/warner%20bro/movies/aquaman/37.ashx?mw=1200 | |
(domain_nowww === "warnerbros.co.uk" && (/\/media\//i).test(src)) | | |
// http://img.cdn2.vietnamnet.vn/Images/english/2017/11/10/09/20171110093351-sez.jpg?w=80&h=45 | |
// http://imgs.vietnamnet.vn/Images/2015/11/17/10/20151117104955-av-240x160.jpg?w=10 | |
(domain_nosub === "vietnamnet.vn" && /^(?:[^/]*\.)?img(?:\.cdn[0-9]*|s)\./.test(domain)) || | |
// http://img.cdn2.vietnamnet.vn/Images/english/2018/05/23/09/20180523095208-3.jpg?w=80&h=45 | |
//domain.match(/img\.cdn[0-9]*\.vietnamnet\.vn/) || | |
// https://i.gadgets360cdn.com/large/tara_main_1511903994721.jpg?output-quality=70&output-format=webp | |
domain === "i.gadgets360cdn.com" || | |
// https://i.ndtvimg.com/video/images/vod/medium/2018-02/big_478201_1517848813.jpg?downsize=298:224&output-quality=70&output-format=webp | |
domain === "i.ndtvimg.com" || | |
// https://d3lp4xedbqa8a5.cloudfront.net/s3/digital-cougar-assets/Now/2018/02/16/44694/Healthy-pizza.jpg?width=132&height=107&mode=crop&scale=both&anchor=middlecenter&quality=85 | |
domain === "d3lp4xedbqa8a5.cloudfront.net" || | |
// https://brnow.org/getattachment/cc67f65b-b0b7-4365-abd5-258e4e1c1680?maxsidesize=50 | |
(domain_nowww === "brnow.org" && src.indexOf("/getattachment/") >= 0) || | |
// https://p3.ssl.cdn.btime.com/t01b3d8cb1040fbe0ba.jpg?size=730x1110 | |
(domain_nosub === "btime.com" && domain.match(/p[0-9]*\.(?:ssl\.)?cdn\.btime\.com/)) || | |
// http://images.twistmagazine.com/uploads/images/file/21604/sabrina-carpenter-selfie.jpg?fit=crop&h=666&w=500 | |
domain === "images.twistmagazine.com" || | |
// https://sites.google.com/site/faustrolemodel/_/rsrc/1427391714266/sabrina-carpenter/452204682.jpg?height=400&width=331 | |
domain === "sites.google.com" || | |
// https://images.pexels.com/photos/68147/waterfall-thac-dray-nur-buon-me-thuot-daklak-68147.jpeg?h=350&auto=compress&cs=tinysrgb | |
domain === "images.pexels.com" || | |
// https://images.unsplash.com/photo-1503320748329-9455bea97a68?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=324bf91b29fb196d6aefb2f4806d04c0&auto=format&fit=crop&w=1000&q=60 | |
domain === "images.unsplash.com" || | |
// tshop will automatically be replaced to shop | |
// https://tshop.r10s.jp/book/cabinet/3966/4907953093966.jpg?fitin=200:300&composite-to=*,*|200:300 | |
// https://shop.r10s.jp/book/cabinet/3966/4907953093966.jpg | |
//domain === "tshop.r10s.jp" || | |
// https://tshop.r10s.com/4bf21390-ec8c-11e4-9162-005056b75bda/upload/np/A685-M1.jpg?_ex=330x330 | |
domain_nosub === "r10s.com" || | |
// https://rakuma.r10s.jp/d/strg/ctrl/25/af89f9418a6f8fc899e2e0a280d79acd0c274d16.79.1.25.2.jpg?fit=inside%7C300%3A300 | |
//domain === "rakuma.r10s.jp" || | |
// https://r.r10s.jp/ran/img/1001/0004/943/674/259/502/10010004943674259502_1.jpg?fitin=100:100 | |
domain_nosub === "r10s.jp" || | |
// http://static.netlife.vn//2017/11/07/14/43/sao-han-trong-1-tuan-tara-den-viet-nam-2-lan_1.jpg?maxwidth=480 | |
domain === "static.netlife.vn" || | |
// http://rs.phunuonline.com.vn/staticFile/Subject/2018/02/14/7391244/unnamed_182138203.png?w=51&h=32 | |
domain === "rs.phunuonline.com.vn" || | |
// https://images.nbcolympics.com/www.nbcolympics.com/field_image/22February2018/shuster_smile.jpg?impolicy=960x540_rectangle | |
domain === "images.nbcolympics.com" || | |
// https://dist.joshinweb.jp/cdshop/img/jacket/P5_G/5863/P5_G5863047W.JPG?impolicy=tp100 | |
(domain === "dist.joshinweb.jp" && src.indexOf("/img/") >= 0) || | |
// https://compote.slate.com/images/4e1e4179-fb17-436b-a890-1a4fdb417d45.jpeg?width=1180&offset=0x0&rect=1560x1040&height=842 | |
domain === "compote.slate.com" || | |
// https://media.gannett-cdn.com/29906170001/29906170001_5720100432001_5720093419001-vs.jpg?pubId=29906170001&quality=10 | |
//domain === "media.gannett-cdn.com" || | |
// https://www.gannett-cdn.com/media/2016/04/15/USATODAY/USATODAY/635963424849581175-GTY-463036250-70683098.JPG?width=299&height=168&fit=bounds | |
domain_nosub === "gannett-cdn.com" || | |
// http://www.rdfm-radio.fr/medias/images/media.nrj.fr-2f436x327-2f2017-2f11-2fbiographie-de-mc-fioti-484.jpg?fx=c_180_180 -- dead? | |
(domain_nowww === "rdfm-radio.fr" && src.indexOf("/medias/") >= 0) || | |
// http://salleobscure.e-monsite.com/medias/images/affiche-premier-contact-arrival-2016-5.jpg?fx=r_1170_600 | |
(domain === "salleobscure.e-monsite.com" && src.indexOf("/medias/") >= 0) || | |
// http://image-api.nrj.fr/02_5a02579e3cb49.png?w=730&h=410 | |
domain === "image-api.nrj.fr" || | |
// http://api.hdwallpapers5k.com/resource/fileuploads/photos/albums/1400/5382c527-5081-4bf4-8b2b-25ea11356bf4.jpeg?quality=100&w=2560&h=2560&mode=crop | |
domain === "api.hdwallpapers5k.com" || | |
// http://images.en.koreaportal.com/data/images/full/14639/rita-ora.jpg?w=600 | |
(domain_nosub === "koreaportal.com" && domain.match(/images\.[^.]*\.koreaportal\.com/)) || | |
// http://www.officialcharts.com/media/653733/taylor-swift-press-image-1100.jpg?width=796&mode=stretch | |
(domain_nowww === "officialcharts.com" && src.indexOf("/media/") >= 0) || | |
// https://citywonders.com/media/11395/mt-vesuvius-crater.jpg?anchor=center&mode=crop&quality=65&width=1200&height=900 | |
(domain_nowww === "citywonders.com" && src.indexOf("/media/") >= 0) || | |
// https://fee.org/media/22152/karliekloss_mini.jpg?anchor=center&mode=crop&width=1920&rnd=131388985770000000 | |
(domain_nowww === "fee.org" && src.indexOf("/media/") >= 0) || | |
// http://pix10.agoda.net/hotelImages/519/519394/519394_14031416100018704350.jpg?s=1024x768 | |
(domain_nosub === "agoda.net" && domain.match(/pix[0-9]*\.agoda\.net/)) || | |
// https://images.pottermore.com/bxd3o8b291gf/1FC5pSmkSg44SMew0osm4Y/afb1fbf505eaf4c6a398b80ca075e014/DracoMalfoy_WB_F6_DracoMalfoyOnBathroomFloorHarryStanding_Still_080615_Land.jpg?w=1330&q=85 | |
domain === "images.pottermore.com" || | |
// https://www.google.com/s2/u/0/photos/public/AIbEiAIAAABECKjC6cfB5MXfkQEiC3ZjYXJkX3Bob3RvKig5NThhYjU1NjkzZGJkOTBmY2ZhZDAyYjE4NThjZjlmMzZmY2ZiZGY3MAHuuVSn2yIIP3390PZse6G3donZOg?sz=50 | |
(domain_nowww === "google.com" && src.match(/\/photos\/public\/[^/]*$/)) || | |
// https://images.streamable.com/east/image/pqxns_first.jpg?height=100 | |
domain === "images.streamable.com" || | |
// https://cdn.amebaowndme.com/madrid-prd/madrid-web/images/sites/121508/7b13cca970a6eae1f46625638213900b_3a2cc2bd26844834e05b77f95b7500b7.jpg?width=724 | |
domain === "cdn.amebaowndme.com" || | |
// http://www.kaixian.tv/gd/d/file/201803/13/6b65c9bc4e0128a92a0e9fc0aa2d2d2d.jpg?imageView&thumbnail=100y75 | |
(domain_nowww === "kaixian.tv" && src.indexOf("/file/") >= 0) || | |
// http://pic-bucket.nosdn.127.net/photo/0001/2018-01-24/D8SM4CRK00AP0001NOS.jpg?imageView&thumbnail=100y75 | |
// forbidden with referrer | |
// http://imglf6.nosdn.127.net/img/NStLVUtLYlBtSm9PTWJqMmpEVXF5N2pSL1U1a2I5SjhTdG50QzNMRHljblFlV1VQeUtGVUJ3PT0.jpg?imageView&thumbnail=1680x0&quality=96&stripmeta=0&type=jpg | |
//(domain.indexOf("nosdn.127.net") >= 0 && src.indexOf("/photo/") >= 0) || | |
// https://sumo.cdn.tv2.no/imageapi/v2/img/58aff90284ae6c3cc0945755-1519386606657?width=1920&height=1080&location=list | |
(domain === "sumo.cdn.tv2.no" && src.indexOf("/imageapi/") >= 0) || | |
// http://www.bzqzsj.com/uploads/allimg/181203/1553324424-1.jpg?imageView&thumbnail=100y75 | |
(domain_nowww === "bzqzsj.com" && src.indexOf("/uploads/") >= 0) || | |
// https://media.missguided.com/s/missguided/L4227488_set/1/brown-square-back-thong-swimsuit.jpg?$category-page__grid--1x$ | |
domain === "media.missguided.com" || | |
// https://photo.venus.com/im/V1092-COB_V2362-COB.0288.s.jpg?preset=product | |
domain === "photo.venus.com" || | |
// https://cdn-images.prettylittlething.com/c/4/f/f/c4ffac27c350089f9cb5214a68bad59c7a943bb5_CLW1289_1.JPG?imwidth=60 | |
domain === "cdn-images.prettylittlething.com" || | |
// http://www.oxfordmail.co.uk/resources/images/4817793.jpg?display=1&htype=0&type=responsive-gallery | |
(domain_nowww === "oxfordmail.co.uk" && src.indexOf("/resources/") >= 0) || | |
// http://popcrush.com/files/2014/07/EmmaWatson1.jpg?w=980&q=75 | |
(domain_nowww === "popcrush.com" && src.indexOf("/files/") >= 0) || | |
// http://screencrush.com/files/2013/03/50_shades_of_grey_emma_watson.jpg?w=980&q=75 | |
(domain_nowww === "screencrush.com" && src.indexOf("/files/") >= 0) || | |
// http://assets.cougar.nineentertainment.com.au/assets/Dolly/2014/03/20/52622/3.jpg?mode=max&quality=80&width=1024 | |
(domain_nosub === "nineentertainment.com.au" && domain.match(/assets\.[^.]*\.nineentertainment\.com\.au/)) || | |
// https://www.thenational.ae/image/policy:1.479136:1499670177/image/jpeg.jpg?f=16x9&w=1024&$p$f$w=2589da4 | |
(domain_nowww === "thenational.ae" && src.indexOf("/image/") >= 0) || | |
// https://s3.kh1.co/80e0569ad275cc700a5b9bee37447bd432a63ced.jpg?m=thumb&w=400&h=560 | |
(domain_nosub === "kh1.co" && domain.match(/s[0-9]*\.kh1\.co/)) || | |
// https://uploads.disquscdn.com/images/9b96ed95917fe3b747f0b441246985a838e3e0b370607817a540b4a40119b9a6.gif?w=800&h=253 | |
domain === "uploads.disquscdn.com" || | |
// https://www.voidu.com/content/products/gallery/99832a851b23b8a91f296adac...-20180216101631.jpg?width=1140&height=450&mode=crop&scale=both | |
// https://voidu.com/content/products/gallery/99832a851b23b8a91f296adac...-20180216101631.jpg?width=1140&height=450&mode=crop&scale=both | |
(domain_nowww === "voidu.com" && src.indexOf("/gallery/") >= 0) || | |
// https://store.playstation.com/store/api/chihiro/00_09_000/container/US/en/99/UP4139-CUSA10160_00-SURVIVINGMARSFCE//image?_version=00_09_000&platform=chihiro&w=720&h=720&bg_color=000000&opacity=100 | |
(domain === "store.playstation.com" && src.indexOf("/image?") >= 0) || | |
// https://images.interactives.dk/cdn-connect/98f5b7864bfb4efba3e65b9d0c983122.jpg?auto=compress&ch=Width%2CDPR&ixjsv=2.2.4&w=750 | |
domain === "images.interactives.dk" || | |
// https://toyo-arhxo0vh6d1oh9i0c.stackpathdns.com/media/1200/xl-hero-tire-pr-ra1.jpg?quality=10 | |
// https://toyo-arhxo0vh6d1oh9i0c.stackpathdns.com/media/1908/xl-pxr8r-hero-740x740.jpg?anchor=center&mode=crop&quality=90&width=470&rnd=131206940370000000 | |
domain === "toyo-arhxo0vh6d1oh9i0c.stackpathdns.com" || | |
// http://www.zmonline.com/media/17805975/pussycat.jpg?mode=crop&width=620&height=349&quality=60&scale=both | |
(domain_nowww === "zmonline.com" && src.indexOf("/media/") >= 0) || | |
// https://img-s-msn-com.akamaized.net/tenant/amp/entityid/AAtV5nt.img?h=328&w=270&m=6&q=60&o=f&l=f&x=277&y=235 | |
domain === "img-s-msn-com.akamaized.net" || | |
// http://www.heraldscotland.com/resources/images/5792318.jpg?display=1&htype=0&type=responsive-gallery | |
// http://heraldscotland.com/resources/images/5792318.jpg?display=1&htype=0&type=responsive-gallery | |
(domain_nowww === "heraldscotland.com" && src.indexOf("/resources/images/") >= 0) || | |
// https://www.theboltonnews.co.uk/resources/images/6984626/?type=responsive-gallery-fullscreen | |
(domain_nowww === "theboltonnews.co.uk" && src.indexOf("/resources/images/") >= 0) || | |
// https://cdn.instructables.com/ORIG/FLU/3BAI/JF8IWE1M/FLU3BAIJF8IWE1M.jpg?width=400&crop=3:2 | |
domain === "cdn.instructables.com" || | |
// http://images.performgroup.com/di/library/sporting_news/a5/be/edmonton-oilers-getty-images-041102017-ftrjpg_jt08mu2eqgwn1xr30wgvpqdzv.jpg?t=1619857107&w=960&quality=70 | |
domain === "images.performgroup.com" || | |
// http://media.playmobil.com/i/playmobil/9022_product_detail?locale=en-US,en,*&$pdp_product_main_xl$ | |
domain === "media.playmobil.com" || | |
// https://img.crocdn.co.uk/images/products2/pl/00/00/00/38/pl0000003849.jpg?width=940&height=940 | |
domain === "img.crocdn.co.uk" || | |
// http://www.calgaryherald.com/life/cms/binary/6748001.jpg?size=sw620x65 | |
(domain_nowww === "calgaryherald.com" && src.indexOf("/cms/") >= 0) || | |
// http://www.montrealgazette.com/cms/binary/8317804.jpg?size=640x420 | |
(domain_nowww === "montrealgazette.com" && src.indexOf("/cms/") >= 0) || | |
// https://m2.ikea.com/images/pokoj-dziecka-z-niebieskimi-scianami-i-monochromatyczna-posc-919afda5ac9e85ba681cd2e3e698e893.jpg?f=l | |
(domain_nosub === "ikea.com" && src.indexOf("/images/") >= 0) || | |
// https://colorwallpaper.net/img/2018/01/pashion-with-a-fashion.jpg?w=544&h=967&fit=stretch | |
(domain_nowww === "colorwallpaper.net" && src.indexOf("/img/") >= 0) || | |
// https://img.cache.vevo.com/thumb/cms/6adeb8f9fb65d67e94044181f4e102c6/281x159.jpg?resize=fit&remove_borders=true | |
domain === "img.cache.vevo.com" || | |
// https://drop.ndtv.com/albums/uploadedpics/small/vivo_v9_youth_small_636598304295938786.jpg?downsize=120:90&output-quality=70&output-format=webp | |
(domain === "drop.ndtv.com" && src.indexOf("/albums/") >= 0) || | |
// http://kr.images.christianitydaily.com/data/images/full/107742/97.jpg?w=304&h=152&l=50&t=40 | |
(domain_nosub === "christiandaily.com" && domain.indexOf("images.christianitydaily.com") >= 0) || | |
// http://cdn.christianitydaily.com/data/images/full/3559/vanessa-hudgens.jpg?w=600 | |
domain === "cdn.christianitydaily.com" || | |
// http://images.christiandaily.co.kr/data/images/full/50674/image.jpg?w=600 | |
(domain_nosub === "christiandaily.co.kr" && domain.indexOf("images.christiandaily.co.kr") >= 0) || | |
// http://images.christiantoday.co.kr/data/images/full/292467/image.png?w=600 | |
domain === "images.christiantoday.co.kr" || | |
// https://blogimg.goo.ne.jp/cnv/v1/user_image/5d/9d/e2b49057338c93324e0f70dd6fc4be03.jpg?dw=110,dh=110,cw=110,ch=110,q=90,da=s,ds=s | |
domain === "blogimg.goo.ne.jp" || | |
// https://cdn.clien.net/web/api/file/F01/6848785/5a32dafe05c22a.jpg?w=780&h=30000 | |
domain === "cdn.clien.net" || | |
// https://s1.imgs.cc/img/aaaaaRmUn.jpg?_w=500 | |
(domain_nosub === "imgs.cc" && domain.match(/s[0-9]*\.imgs\.cc/)) || | |
// https://ssl-stat.amebame.com/pub/content/8265872137/user/article/unknown/unknown/376668982082606877/6af49eccc7dd77e2b3bde8002f6be55c/uploaded.png?width=546 | |
// https://stat.amebame.com/pub/content/8265872137/user/article/unknown/unknown/376668982082606877/6af49eccc7dd77e2b3bde8002f6be55c/uploaded.png?width=546 | |
(domain_nosub === "amebame.com" && domain.indexOf("stat.amebame.com") >= 0) || | |
// https://i.iheart.com/v3/re/new_assets/5a91863a79b810a683361620?ops=fit(770%2C385) | |
domain === "i.iheart.com" || | |
// https://cdn-hit.scadigital.io/media/10650/justin-bieber-selena-gomez.jpg?preset=MainImage | |
domain === "cdn-hit.scadigital.io" || | |
// https://cdn56.picsart.com/169599975000202.jpeg?r1024x1024 | |
(domain_nosub === "picsart.com" && domain.match(/cdn[0-9]*\.picsart\.com/)) || | |
// https://cdn.ndtv.com/tech/gadgets/Electronic_Arts_Dragon_Age_Inquisition_Cover.jpg?output-quality=10 | |
domain === "cdn.ndtv.com" || | |
// https://assets-a1.kompasiana.com/images/avatar/13267750-10207923832071268-7573729854263131153-n-57aeadc0d89373090f9eb6eb.jpg?t=t&v=70&x=70 | |
(domain_nosub === "kompasiana.com" && domain.match(/assets(?:-[a-z][0-9])?\.kompasiana\.com/)) || | |
// https://images.popbuzz.com/images/2126?crop=1_1&width=200&signature=CbNpTNT994BxnDA7v5idqFKtsOs= | |
domain === "images.popbuzz.com" || | |
// https://i1.adis.ws/i/Marc_Jacobs/friends_dovecameron_beautyconfestival_spring17?w=800&qlt=70&img404=NOIMAGEMEDIUM | |
(domain_nosub === "adis.ws" && domain.match(/i[0-9]*\.adis\.ws/)) || | |
// http://images2.9c9media.com/image_asset/2017_6_18_79194164-a321-4264-a5e3-f641dad7e65b_png_1920x1080.jpg?size=400 | |
(domain_nosub === "9c9media.com" && domain.match(/^images[0-9]*\.9c9media\.com/)) || | |
// http://img1-azcdn.newser.com/image/1180030-0-20180515094436.jpeg?width=76&height=76&crop=yes | |
(domain_nosub === "newser.com" && domain.match(/img[0-9]*(?:-[a-z]+)?\.newser\.com/)) || | |
// http://images.m-magazine.com/uploads/posts/image/62933/dove-cameron-descendants-doll.jpg?crop=top&fit=clip&h=500&w=698 | |
domain === "images.m-magazine.com" || | |
// https://www.zoom.co.uk/assets/images/0/0/2/4/4/mm00244615.jpg?width=208 | |
(domain_nowww === "zoom.co.uk" && src.match(/\/assets\/+images\/+/)) || | |
// https://ctd-thechristianpost.netdna-ssl.com/en/full/21939/a-thief-in-the-night.jpg?w=400&h=608 | |
domain === "ctd-thechristianpost.netdna-ssl.com" || | |
// https://img.vidible.tv/prod/2017-06/19/59481cb6f3bdc95f62ebf5bf/59481cb56709846d28c25ea1_o_F_v0.jpg?w=1440&h=900 -- upscaled | |
domain === "img.vidible.tv" || | |
// http://images.es.j-14.com/uploads/posts/image/67560/dove-cameron-new-music.jpg?crop=top&fit=clip&h=900&w=2000 -- upscaled | |
(domain_nosub === "j-14.com" && domain.match(/images\.(?:[a-z]+\.)?j-14\.com/)) || | |
// https://cdn.abcotvs.com/dip/images/3174795_030418aposcarsredcarpetronan.jpg?w=120&r=16:9 | |
domain === "cdn.abcotvs.com" || | |
// http://www.tasteofcountry.com/files/2018/04/ACM-RC-Pictures.jpg?w=980&q=75 | |
(domain_nowww === "tasteofcountry.com" && src.indexOf("/files/") >= 0) || | |
// https://images.thewest.com.au/publication/B88845233Z/1527064708921_GEP1KTC2C.2-2.jpg?imwidth=640&impolicy=.auto | |
domain === "images.thewest.com.au" || | |
// https://cdn1.ntv.com.tr/gorsel/sanat/izlemeniz-gereken-100-anime/izlemeniz-gereken-100-anime,cZEsQuQhvUqIlKd_mSoGvw.jpg?w=960&mode=max&v=20100504143043000 | |
(domain_nosub === "ntv.com.tr" && domain.match(/cdn[0-9]*\.ntv\.com\.tr/)) || | |
// https://img6.hotnessrater.com/3892309/cailin-russo.jpg?w=200&h=300 | |
(domain_nosub === "hotnessrater.com" && domain.match(/img[0-9]*\.hotnessrater\.com/)) || | |
// http://www.starcrush.com/files/2012/11/AnnaSophia-Robb.jpg?w=980&q=75 | |
domain_nowww === "starcrush.com" || | |
// https://www.chrichri.dk/media/11430/11.jpeg?width=634&height=1004 | |
// https://www.chrichri.dk/media/30431/_k8t8450_kopi.jpg?width=264&height=176 | |
(domain_nowww === "chrichri.dk" && src.indexOf("/media/") >= 0) || | |
// https://www.rightstufanime.com/images/productImages/816546020668_anime-anohana-the-flower-we-saw-that-day-tv-series-box-set-blu-ray-primary.jpg?resizeid=4&resizeh=100&resizew=60 | |
(domain_nowww === "rightstufanime.com" && src.indexOf("/images/") >= 0) || | |
// https://assets.bigcartel.com/product_images/203868677/ANOHANA+SITE.jpg?auto=format&fit=max&w=1500 | |
domain === "assets.bigcartel.com" || | |
// http://www.thenorthernecho.co.uk/resources/images/7672541.jpg?display=1&htype=0&type=responsive-gallery | |
(domain_nowww === "thenorthernecho.co.uk" && src.indexOf("/resources/images/") >= 0) || | |
// http://binaryapi.ap.org/2df5c8e3642d4183a08cf802c2dd50b1/preview/AP13344549840.jpg?wm=api&ver=0 | |
domain === "binaryapi.ap.org" || | |
// https://images.8tracks.com/cover/i/000/618/338/hive_mind_cover-4092.jpg?rect=0,0,500,500&q=98&fm=jpg&fit=max&w=320&h=320 | |
domain === "images.8tracks.com" || | |
// http://cdn2.spoilercat.com/ac/a/christopher-nolan-53c9cd8d5bbe5d40048c7003.jpeg?s=640x0 -- upscaled | |
(domain_nosub === "spoilercat.com" && domain.match(/cdn[0-9]*\.spoilercat\.com/)) || | |
// https://www.mumbailive.com/images/news/Christopher_1514973032318.jpg?w=205 | |
(domain_nowww === "mumbailive.com" && src.indexOf("/images/") >= 0) || | |
// https://static.juksy.com/files/articles/68423/59704be703149.png?m=widen&i=600&q=75 | |
domain === "static.juksy.com" || | |
// http://img.reblog.hu/blogs/28942/christophere8d6.jpg?w=640 | |
domain === "img.reblog.hu" || | |
// http://www.thefw.com/files/2012/11/tumblr_ls6ujhB6wV1qfq9oxo1_5001.jpg?w=980&q=75 -- stretched | |
(domain_nowww === "thefw.com" && src.indexOf("/files/") >= 0) || | |
// https://img.csfd.cz/files/images/creator/photos/160/654/160654750_730831.jpg?w100h132crop | |
domain === "img.csfd.cz" || | |
// http://img.timesnownews.com/2_1518716279__rend_1_1.jpg?d=300x225 | |
// https://imgk.timesnownews.com/00000656_p_edited_1568362924__rend_4_3.jpg?tr=w-600 | |
(domain_nosub === "timesnownews.com" && /^img/.test(domain)) || | |
// https://img.siksinhot.com/place/1487044026161009.jpg?w=508&h=412&c=Y | |
domain === "img.siksinhot.com" || | |
// https://mp-seoul-image-production-s3.mangoplate.com/keyword_search/meta/pictures/19bmu--ycm0atk5q.png?fit=around|600:400&crop=600:400;*,*&output-format=jpg&output-quality=80 | |
domain === "mp-seoul-image-production-s3.mangoplate.com" || | |
// http://api.theweek.com/sites/default/files/sbr070118dAPR.jpg?resize=807x807 | |
domain === "api.theweek.com" || | |
// https://i.smalljoys.me/2018/02/kpop-girls-generation-popularity_2017112803570_0.jpg?w=300&ssl=1&strip=all | |
domain === "i.smalljoys.me" || | |
// https://t1.huanqiu.cn/98c0e4cbd2b91f316105adef408fb21b.jpg?w=150 | |
(domain_nosub === "huanqiu.cn" && domain.match(/t[0-9]*\.huanqiu.cn/)) || | |
// https://hypebeast.com/image/2018/07/kaws-companion-sculpture-gwanggyo-ipark-0.jpg?q=90 | |
(domain_nowww === "hypebeast.com" && src.indexOf("/image/") >= 0) || | |
// https://dramaguru.net/images/actors/amar_khan_645.jpeg?w=315&h=350&fit=crop-top | |
(domain_nowww === "dramaguru.net" && src.indexOf("/images/") >= 0) || | |
// http://sos.vfan.vlive.tv/b/2jfi2j/8_187Ud018svc1i6cch4stmk9h_flwfzl.jpeg?type=e640 | |
domain === "sos.vfan.vlive.tv" || | |
// https://img.journalmedia.ie/article/3622641?width=1366&version=3622995 | |
(domain_nosub === "journalmedia.ie" && domain.match(/^img[0-9]*\./)) || | |
// http://img2.thejournal.ie/inline/3749439/original?width=200&version=3749439 | |
(domain_nosub === "thejournal.ie" && domain.match(/^img[0-9]*\./)) || | |
// http://external.polskieradio.pl/files/75762f5c-6ae2-40f2-b06d-bbc45beaa6d5.file?format=136x81 | |
(domain === "external.polskieradio.pl" && src.indexOf("/files/") >= 0) || | |
// https://thumb.netz.id/image/2018/06/29/4a093f0c3ce6da7948cb456893cbb926.jpg?w=600 | |
domain === "thumb.netz.id" || | |
// https://us-east-1.tchyn.io/snopes-production/uploads/2018/04/kkk_feature.jpg?resize=865,452 | |
(domain_nosub === "tchyn.io" && src.indexOf("/snopes-production/uploads/") >= 0) || | |
// http://img.diply.com/article-images/a/884c637e-7288-480a-a2df-543ff15ae971.jpg?impolicy=mobile | |
domain === "img.diply.com" || | |
// https://img-mdpr.freetls.fastly.net/article/Wf7O/nm/Wf7Oi0E0-_n8CRBG4lyiHeFarklxrewLePLfp6cFSf0.jpg?width=250&enable=upscale&crop=250:250,offset-y0&auto=webp&quality=50 | |
domain === "img-mdpr.freetls.fastly.net" || | |
// https://cdn-assets.ziniopro.com/var/site_877/storage/images/media2/cover187/440239-1-eng-US/cover2.jpg?w=200 | |
domain === "cdn-assets.ziniopro.com" || | |
// https://netherlands-grlk5lagedl.stackpathdns.com/production/netherlands/images/1526305860593210-Julianne-Moore-in-Givenchy-.jpg?w=802&h=720&fit=clip&fm=pjpg&auto=compress | |
domain === "netherlands-grlk5lagedl.stackpathdns.com" || | |
// https://russia-grlk5lagedl.stackpathdns.com/production/russia/images/1526119976681968-c0da67fdb8b-1524024352.jpg?w=450&h=800&fit=clip&crop=faces&fm=pjpg&auto=compress | |
(domain_nosub === "stackpathdns.com" && domain.indexOf("-grlk5lagedl.stackpathdns.com") >= 0) || | |
// https://www.beautycrew.com.au/media/12866/jessica-alba-portrait.jpg?width=200 | |
(domain_nowww === "beautycrew.com.au" && src.indexOf("/media/") >= 0) || | |
// http://vh1.mtvnimages.com/uri/mgid:file:http:shared:vh1.com/news/uploads/sites/2/2018/03/GettyImages-873076880-1522090083.jpg?quality=0.85&format=jpg&width=480 | |
domain_nosub === "mtvnimages.com" || | |
// https://dsx.weather.com/util/image/w/greenaldnberg.jpg?v=at&w=320&h=180&api=7db9fe61-7414-47b5-9871-e17d87b8b6a0 | |
(domain === "dsx.weather.com" && src.indexOf("/util/image/") >= 0) || | |
// https://img.r7.com/images/iceberg-gigante-14072018102456056?dimensions=600x315 | |
domain === "img.r7.com" || | |
// https://cdn-images.rtp.pt/icm/images/e1/e12cf8ca828c5079d156e5e1f4903c1a?1200&rect=0,17,700,384&q=100&w=620&q=75 | |
domain === "cdn-images.rtp.pt" || | |
// https://media.ouest-france.fr/v1/pictures/f34478ee116ed1a208792e10a772aa78-banquise-glacier-iceberg-tout-fond-sur-terre.jpg?width=940&height=531&fill=0&focuspoint=49%2C25&cropresize=1 | |
domain === "media.ouest-france.fr" || | |
// https://www.rbsdirect.com.br/imagesrc/24569629.jpg?w=1024&h=512&a=c | |
(domain_nowww === "rbsdirect.com.br" && src.indexOf("/imagesrc/") >= 0) || | |
// https://www.newfoundlandlabrador.com/-/media/marquees/things-to-do/iceberg-viewing/our-icebergs/iceberg-viewing-our-icebergs-marquee.jpg?mh=477&mw=1272&hash=013C8094C8B7F70F880BE7567A37631629C58B07 | |
(domain_nowww === "newfoundlandlabrador.com" && src.indexOf("/-/media/") >= 0) || | |
// https://images.businessoffashion.com/site/uploads/2016/02/shutterstock_85109977.jpg?auto=format%2Ccompress&crop=top&fit=crop&h=573&w=1024 | |
domain === "images.businessoffashion.com" || | |
// http://n10.cmsfile.pg0.cn/group2/M00/2C/C8/Cgqg2lh3CNGAK9KoAANuU1gzN84392.jpg?enable=&w=550&h=731&cut= | |
(domain_nosub === "pg0.cn" && domain.match(/cmsfile\.pg0\.cn/)) || | |
// http://api.ning.com/files/JtotRF7dxCUb6oEDdSaFzZJXhL0GGMo-wPYbqAOga3rqEmhaecqI*AxzoQNAArT08Pqt4g9PX*0aFA8I2bPe1b8RtTBY8KD8/011212natalieportmanoscars350.jpg?width=30 | |
domain === "api.ning.com" || | |
// http://storage0.dms.mpinteractiv.ro/media/2/1401/16207/16175015/4/b30cdcf1c208a63611f6d15a9b76276e.jpg?width=400 | |
(domain_nosub === "mpinteractiv.ro" && domain.match(/^storage[0-9]*\./) && src.indexOf("/media/") >= 0) || | |
// https://a0.muscache.com/im/pictures/14866a48-c889-4cad-91fa-ae3216e2841e.jpg?aki_policy=x_medium | |
(domain_nosub === "muscache.com" && src.match(/\/im\/pictures\/[-0-9a-f]+\./)) || | |
// https://wedd.today/wallpaper/99c10ed13a6aa8620bd5955f14c08bdd/tgc-easy-on-the-eye-thread-no-nsfw-image-pics-only-no-chat-no-paige-spiranac-wallpaper-hd?w=116&h=88 | |
(domain_nowww === "wedd.today" && src.indexOf("/wallpaper/") >= 0) || | |
// https://www.looklive.at/media/72109/riri.jpg?anchor=center&mode=crop&width=1024&rnd=131565967210000000 | |
(domain_nowww === "looklive.at" && src.match(/\/media\/[0-9]+\//)) || | |
// https://t.tudocdn.net/150447?w=100&h=1080&fit=clip | |
domain === "t.tudocdn.net" || | |
// http://me.phununet.com/topic/resources/img/upload/htsmjle/08032016034306749.jpg?w=400&mode=crop&anchor=topcenter&scale=both | |
(domain === "me.phununet.com" && src.indexOf("/resources/img/") >= 0) || | |
// http://cdn.diario26.com.ar/media/image/2018/05/25/389592.jpg?s=2 | |
(domain === "cdn.diario26.com.ar" && src.indexOf("/media/image/") >= 0) || | |
// http://discovermagazine.com/~/media/Images/Promo%20Images/2018/june/CentaurusA.jpg?mw=200 | |
(domain_nowww === "discovermagazine.com" && src.indexOf("/media/Images/") >= 0) || | |
// https://steamusercontent-a.akamaihd.net/ugc/952958110703301417/7410320729F64979B9BFFED4C742F9BC1535FB64/?interpolation=lanczos-none&output-format=jpeg&output-quality=95&fit=inside%7C506%3A284&composite-to=*,*%7C506%3A284&background-color=black | |
domain === "steamusercontent-a.akamaihd.net" || | |
// https://www.qfeast.com/imret/qq/iI4Fe2.jpg?w=300&h=300&sc=1 | |
(domain_nowww === "qfeast.com" && src.indexOf("/imret/") >= 0) || | |
// http://statis.gamen.vn/images/upload/2016/09/14/57_l5u2MnoUOr_animemomokofanartrinkyajapan6.jpg?w=200 | |
(domain === "statis.gamen.vn" && src.indexOf("/images/upload/") >= 0) || | |
// https://img.anikore.jp/images/board/4/2/2/55422/55422.jpg?width=560&height=560&type=resize | |
domain === "img.anikore.jp" || | |
// https://cdn1.newsplex.pt/media/2018/3/5/628723.jpg?type=xl | |
(domain_nosub === "newsplex.pt" && domain.match(/^cdn[0-9]*\./)) || | |
// http://static.origos.hu/s/img/i/1712/2017121499.jpg?w=644&h=866 | |
(domain === "static.origos.hu" && src.indexOf("/img/") >= 0) || | |
// https://cdn.nwmgroups.hu/s/img/i/1909//20190913comedy-wildlife-photography-awards-20192.jpg?w=600&h=447 | |
(domain === "cdn.nwmgroups.hu" && src.indexOf("/img/") >= 0) || | |
// http://robertocavada.com/Images/6c732c90-1dee-4d93-968f-47c3bd9d8d9d.jpg?width=385&format=png | |
(domain_nowww === "robertocavada.com" && src.indexOf("/Images/") >= 0) || | |
// https://images.mncdn.pl/com_calendar/kurt_nilsen.png?resizeimage=w:230,q:97?resizeimage=w:130,q:97 | |
domain === "images.mncdn.pl" || | |
// https://imgsearches.com/i/arod-meme-jenniferlopez-losangeles-tights-jennifer-lopez-in-tights-los-D3bdaa424e3c7179ddfcdda66a5c38e5e.jpg?w=238 | |
(domain_nowww === "imgsearches.com" && src.indexOf("/i/") >= 0) || | |
// http://www.thetimesnews.com/storyimage/NC/20180904/NEWS/180909253/AR/AR-180909253.jpg?Q=75&maxH=775&maxW=775 | |
// http://www.thetimesnews.com/galleryimage/NC/20180905/NEWS/905009997/PH/1/1/PH-905009997.jpg?Q=75&maxH=775&maxW=775 | |
(domain_nowww === "thetimesnews.com" && ( | |
src.indexOf("/storyimage/") >= 0 || | |
src.indexOf("/galleryimage/") >= 0)) || | |
// https://static.fthis.gr/userfiles/articles/legacy/badb6201-6565-4904-bcdd-3494b9ddea15.jpg?h=573&scale=both&bgcolor=151515&mode=pad | |
domain === "static.fthis.gr" || | |
// https://img.pixelz.com/blog/how-to-shoot-a-lookbook/photo-bohemian-model-rocks-and-sand.jpg?w=1000 | |
(domain === "img.pixelz.com" && src.indexOf("/blog/") >= 0) || | |
// https://ca.hellomagazine.com/imagenes/healthandbeauty/201210249802/get-the-bond-girl-body/0-49-79/naomie-harris-1--a.jpg?interpolation=lanczos-normal&downsize=200px:*&output-format=progressive-jpeg | |
// https://ca.hellomagazine.com/images/stories/0/2016/09/02/000/383/648/gallery_3_5.jpg?interpolation=lanczos-normal&downsize=0.75xw:* | |
(domain_nosub === "hellomagazine.com" && (src.indexOf("/imagenes/") >= 0 || src.indexOf("/images/") >= 0)) || | |
// https://i0.1616.ro/media/521/2861/35030/17944527/1/jennifer-lawrence.jpg?width=160 | |
(domain_nosub === "1616.ro" && domain.match(/^i[0-9]*\./)) || | |
// http://images.lifeandstylemag.com/uploads/posts/image/35601/paula-patton-spirit-awards.jpg?crop=top&fit=clip&h=500&w=698 | |
domain === "images.lifeandstylemag.com" || | |
// https://img.freepik.com/free-vector/wrinkled-paper-texture_1100-12.jpg?size=158c&ext=jpg | |
domain === "img.freepik.com" || | |
// https://img1.fonwall.ru/o/zl/redhead-freckles-sensual-gaze.jpg?route=low&h=200 | |
(domain_nosub === "fonwall.ru" && domain.match(/^img[0-9]*\./)) || | |
// https://www.wonderwall.com/photos/2018/09/14/1036597-copper-fit-and-kate-upton-launch-event-in-nyc.jpg?x=500&y=1025&icq=74&sig=43aca4eba07017dd9e832c2a0b806368 | |
(domain_nowww === "wonderwall.com" && src.indexOf("/photos/") >= 0) || | |
// https://www.thestar.com.my/~/media/online/2013/08/29/11/46/doc6bgz1axwovp1c21a5duc.ashx/?w=620&h=413&crop=1&hash=F8EDD8B2D1EF3FA235A86220BB7EB24045FE73B5 | |
(domain_nowww === "thestar.com.my" && src.indexOf("/~/media/online/") >= 0) || | |
// http://www.vancouversun.com/entertainment/movie-guide/cms/binary/8231595.jpg?size=140x95 | |
(domain_nowww === "vancouversun.com" && src.indexOf("/cms/") >= 0) || | |
// https://imageproxy.viewbook.com/a22ab14f4e2f7c3ddbe8fc6b48cde6d6_hd.jpg?fit=max&dpr=1&w=200 | |
domain === "imageproxy.viewbook.com" || | |
// https://image.lag.vn/upload/news/17/11/20/13-1511026059714_QVIK.jpg?w=200 | |
(domain === "image.lag.vn" && src.indexOf("/upload/") >= 0) || | |
// https://www.booktrust.org.uk/globalassets/images/news-and-blogs/blogs-2017/03.-march/dr-seuss/dr-seuss-16x9.jpg?w=200&h=675&quality=70&anchor=middlecenter | |
(domain_nowww === "booktrust.org.uk" && src.indexOf("/globalassets/images/") >= 0) || | |
// https://ind5.ccio.co/lF/9B/u6/7b47872636fed37e01f8124ee07e6e66.jpg?iw=300 | |
(domain_nosub === "ccio.co" && domain.match(/^ind[0-9]*\./)) || | |
// https://i3.cpcache.com/product/1940586465/Elegant_Floral_Abstract_Decorative_Shower_Curtain_300x300.jpg?height=300&width=300&qv=90&side=front&Filters=[{%22name%22:%22background%22,%22value%22:%22ddddde%22,%22sequence%22:2}] | |
(domain_nosub === "cpcache.com" && domain.match(/^i[0-9]*\./)) || | |
// https://i.rocdn.com/v2/2515808?w=480&h=480 | |
domain === "i.rocdn.com" || | |
// https://resource.globenewswire.com/Resource/Download/63bc1237-3bf3-4ac4-99b0-6c07b738e939?size=2 | |
(domain === "resource.globenewswire.com" && src.indexOf("/Resource/Download/") >= 0) || | |
// http://townsquare.media/site/252/files/2018/10/blackpink.jpg?w=980&q=75 | |
(domain_nowww === "townsquare.media" && src.match(/\/+site\/+[0-9]+\/+files\/+/)) || | |
// https://images.reference.com/reference-production-images/question/782bd2daeda6430a1f9227e816a5339a/aq/things-consider-before-buying-scottish-fold-kitten_ae37beb63bfc893a_EKBERfd0RHqThVWjPBS5eA.jpg?width=760&height=411&fit=crop | |
domain === "images.reference.com" || | |
// https://assets.pcmag.com/media/images/394301-devil-may-cry-4-special-edition-for-pc.jpg?width=740&height=416 | |
domain === "assets.pcmag.com" || | |
// https://images.jg-cdn.com/image/b6461302-bd22-42f1-984d-ffb8de0d8093.jpg?template=fundraisingpagegalleryxl | |
domain === "images.jg-cdn.com" || | |
// https://mjzj-static.sh1a.qingstor.com/images/articles/2018/06/04/VQLtshi8bp3vV0zcbkYCGzo5jJ9djp20gtrXGhxe.jpeg?image&action=resize:w_400,m_1 | |
(domain_nosub === "qingstor.com" && src.indexOf("/images/articles/") >= 0) || | |
// https://img.ibxk.com.br/2014/05/23/23164043333557.jpg?w=1040 | |
domain === "img.ibxk.com.br" || | |
// https://image.biccamera.com/img/00000003627646_A01.jpg?sr.dw=320&sr.dh=320&sr.jqh=60&sr.mat=1 | |
(domain === "image.biccamera.com" && src.indexOf("/img/") >= 0) || | |
// https://sp-m.mu-mo.net/image/jacket/84/1_11765843.jpg?sr.dw=172&sr.dh=172&sr.mat=1 | |
(domain_nosub === "mu-mo.net" && src.indexOf("/image/") >= 0) || | |
// https://www.g-mark.org/media/award/2010/10E16015/10E16015_01_880x660.jpg?w=680&h=460&m=0 | |
(domain_nowww === "g-mark.org" && src.indexOf("/media/") >= 0) || | |
// https://kubrick.htvapps.com/htv-prod-media.s3.amazonaws.com/images/sf19-thomasrhett-blog-lg-1547637894.jpg?crop=1.00xw:0.858xh;0,0&resize=900:* | |
((domain === "kubrick.htvapps.com" || amazon_container === "htv-prod-media") && src.indexOf("/images/") >= 0) || | |
// https://images.france.fr/zeaejvyq9bhj/5QsvRnijLyI2SacuII8mcO/94de7994698fa0baf56366b62fa4b7ff/183-18_cmjn_ouverture.jpg?w=1000&h=200&q=70&fl=progressive&fit=fill | |
domain === "images.france.fr" || | |
// https://az877327.vo.msecnd.net/~/media/images/references/2018/notre%20dame%20projection%20mapping/notredamemapping%202%20jpg.jpg?v=1&mw=1800&mh=1200 | |
(domain === "az877327.vo.msecnd.net" && src.indexOf("/media/images/") >= 0) || | |
// https://en.hoteljardinlebrea.com/usermedia/photo-636263964711140067-1.JPG?dummy=0&h=800 | |
(domain_nosub === "hoteljardinlebrea.com" && src.indexOf("/usermedia/") >= 0) || | |
// https://cdn2.veltra.com/ptr/20170913144602_1511696320_10189_0.jpg?imwidth=480&impolicy=custom | |
(domain_nosub === "veltra.com" && domain.match(/^cdn[0-9]*\./)) || | |
// https://img.letgo.com/images/20/63/07/50/206307501f2c7130c7fe212906ca0558.jpeg?impolicy=img_100 | |
// https://img.letgo.com/images/20/63/07/50/206307501f2c7130c7fe212906ca0558.jpeg -- upscaled? | |
(domain === "img.letgo.com" && src.indexOf("/images/") >= 0) || | |
// https://images.musement.com/cover/0001/58/thumb_57463_cover_header.jpeg?&q=60&fit=crop&lossless=true&auto=format&w=412&h=200 | |
(domain === "images.musement.com" && src.indexOf("/cover/") >= 0) || | |
// https://i.playground.ru/i/blog/344061/icon.jpg?600xauto | |
domain === "i.playground.ru" || | |
// https://www.treeoftheyear.org/getmedia/ecd7b001-6c64-4279-9eee-32c76dedc3dc/117221b;.aspx?width=600 | |
(domain_nowww === "treeoftheyear.org" && src.indexOf("/getmedia/") >= 0) || | |
// https://cdn.indicium.nu/source/grazia/2018/06/selena.jpg?w=410&h=290&fit=crop | |
(domain === "cdn.indicium.nu" && src.indexOf("/source/grazia/") >= 0) || | |
// https://news-img.51y5.net/91849b1acbfae70c2995b276557582c5_3?w=640&h=400 | |
domain === "news-img.51y5.net" || | |
// https://st.automobilemag.com/uploads/sites/11/2019/04/wm-2019-techno-classica-43.jpg?interpolation=lanczos-none&fit=around%7C660%3A440&fit=around%7C680%3A453 | |
(domain === "st.automobilemag.com" && src.indexOf("/uploads/sites/") >= 0) || | |
// thanks to PwnicornDev on github: https://github.com/qsniyg/maxurl/issues/46 | |
// https://styles.redditmedia.com/t5_3pguo/styles/profileIcon_hdpofk4olag01.jpg?width=256&height=256&crop=256:256,smart&s=3df0ac6cd6b812fc38a249f3579e261d442424b3 | |
// https://styles.redditmedia.com/t5_3pguo/styles/profileIcon_hdpofk4olag01.jpg | |
(domain === "styles.redditmedia.com" && src.indexOf("/styles/") >= 0) || | |
// https://img.webmd.com/dtmcms/live/webmd/consumer_assets/site_images/article_thumbnails/other/zoe_saldana_2017_other/375x321_zoe_saldana_2017_other.jpg?resize=*:85px | |
domain === "img.webmd.com" || | |
// https://embedwistia-a.akamaihd.net/deliveries/156d4cda7d1fd80c4d334b35f3f033b9.jpg?image_crop_resized=1280x720 | |
domain === "embedwistia-a.akamaihd.net" || | |
// http://ame-prod-redonline-assets.s3.amazonaws.com/main/thumbs/25292/january_jones_3_redonline.jpg?resize=480:* | |
amazon_container === "ame-prod-redonline-assets" || | |
// https://www.noted.co.nz/media/19199/ls2818_50_gi_464223141.jpg?width=800 | |
(domain_nowww === "noted.co.nz" && src.indexOf("/media/") >= 0) || | |
// https://image.cnbcfm.com/api/v1/image/101914724-105911909.jpg?v=1532564436&w=630&h=420 | |
domain === "image.cnbcfm.com" || | |
// https://images.newrepublic.com/cbb807bdf41088690fba891f74be19765fec4144.jpeg?w=1200&q=65&dpi=2.625&fm=pjpg&h=496 | |
domain === "images.newrepublic.com" || | |
// https://www.madametussauds.com/media/1897935/_dsc6467-ariana-grande-mta-2017.jpg?center=0.380281690140845,0.495&mode=crop&width=584&height=643 | |
(domain_nowww === "madametussauds.com" && src.indexOf("/media/") >= 0) || | |
// https://www.tirolerin.at/media/63724/rihanna-wearing-the-rihanna-chopard-joaillerie-collection.jpg?center=0.30769230769230771,0.36073825503355705&mode=crop&width=800&height=400&rnd=131438597590000000 | |
(domain_nowww === "tirolerin.at" && src.indexOf("/media/") >= 0) || | |
// https://media.deseretdigital.com/file/7b4eed7931?resize=width_1200&type=jpg&c=21&a=e0717f4c | |
(domain === "media.deseretdigital.com" && src.indexOf("/file/") >= 0) || | |
// https://assets.audiomack.com/djsev/c829ceb284e2d4b043145aec664a93dc.jpeg?width=165&height=165&max=true | |
domain === "assets.audiomack.com" || | |
// https://pic.rutube.ru/video/ba/58/ba58dead2098b9c37486ad4d86e7453f.jpg?size=z | |
domain === "pic.rutube.ru" || | |
// http://cdn.marketplaceimages.windowsphone.com/v8/images/c8268cdc-ac27-4a03-bd9b-f2c3645e5387?imageType=ws_icon_large | |
(domain === "cdn.marketplaceimages.windowsphone.com" && src.indexOf("/images/") >= 0) || | |
// https://dsocdn.akamaized.net/Assets/Images_Upload/2009/10/06/meganfoxtransformers.jpg?maxheight=550&maxwidth=550&scale=both | |
((domain === "dsocdn.akamaized.net" || | |
// https://nbocdn.akamaized.net/Assets/Images_Upload/2011/06/20/megan_fox_transformers_movie_image.jpg?maxheight=460&maxwidth=638&scale=both | |
domain === "nbocdn.akamaized.net" || | |
// https://avecdn.akamaized.net/Assets/Images_Upload/Actu24/2019/01/17/5db5bcce-1a52-11e9-8d8b-af38f65ef78d_web_.jpg?maxheight=1000&maxwidth=1000&scale=both | |
domain === "avecdn.akamaized.net" || | |
// https://limnlcdn.akamaized.net/Assets/Images_Upload/2018/10/19/Rihanna.jpg?maxheight=460&maxwidth=629 | |
domain === "limnlcdn.akamaized.net") && /\/Assets\/+Images_Upload\//i.test(src)) || | |
// https://img.s-msn.com/tenant/amp/entityid/AA1G0zk.img?h=416&w=624&m=6&q=60&u=t&o=f&l=f&x=292&y=145 | |
(domain === "img.s-msn.com" && src.indexOf("/entityid/") >= 0) || | |
// https://netstorage-nur.akamaized.net/images/pogudx820tio3bdte.jpg?imwidth=900 | |
(domain === "netstorage-nur.akamaized.net" && src.indexOf("/images/") >= 0) || | |
// https://images.moviebuff.com/35923d1e-e6bc-4abb-96b6-da98a0569475?w=100 | |
domain === "images.moviebuff.com" || | |
// https://static-ugc-media.hk01.com/5cbdd7eb51801661e96f9578.jpeg?v=200h | |
domain === "static-ugc-media.hk01.com" || | |
// https://warwick.film/image/wi/3481.jpeg?maxwidth=300&maxheight=300 | |
(domain_nowww === "warwick.film" && src.indexOf("/image/") >= 0) || | |
// https://quizizz.com/media/resource/gs/quizizz-media/quizzes/7ba7f6b8-81fe-427a-b455-eb5fabc60880?w=90&h=90 | |
(domain_nowww === "quizizz.com" && src.match(/\/media\/+resource\/+/)) || | |
// http://eroce.com/img/post-images/2017-03-17/35234/009.jpg?p=small | |
(domain_nowww === "eroce.com" && src.indexOf("/img/") >= 0) || | |
// https://img-cdn.hipertextual.com/files/2019/05/hipertextual-juego-tronos-episodio-final-es-mas-visto-historia-hbo-2019773047.jpg?strip=all&lossy=1&quality=70&resize=740%2C490&ssl=1 | |
(domain === "img-cdn.hipertextual.com" && src.indexOf("/files/") >= 0) || | |
// https://img.ponparemall.net/imgmgr/61/00101261/img0132/00001411407.jpg?ver=1&size=pict200_200 | |
(domain === "img.ponparemall.net" && src.indexOf("/imgmgr/") >= 0) || | |
// https://smart.usen.com/data/jacket/SME/0001/4706/jacket_SRCL09319B01A_600over.jpg?size=600 | |
(domain === "smart.usen.com" && src.indexOf("/data/") >= 0) || | |
// https://img.digitaldjpool.com/6/4/0/b/a/0/640ba029-71be-4bfd-a5dc-9b1fa7e1bbc7.jpg?mode=max&width=320&height=320& | |
domain === "img.digitaldjpool.com" || | |
// https://d25-a.sdn.szn.cz/d_25/c_img_F_GO/OAeDZF.jpeg?fl=res,350,350,1 | |
(domain_nosub === "szn.cz" && domain.match(/\.sdn\./) && src.indexOf("_img_") >= 0) || | |
// https://banana1015.com/files/2013/04/Daryl-Salad-ft.jpg?w=600&h=0&zc=1&s=0&a=t&q=89 | |
(domain_nowww === "banana1015.com" && src.indexOf("/files/") >= 0) || | |
// https://mix106radio.com/files/2017/05/RS8710_177369626.jpg?w=630&h=420&zc=1&s=0&a=t&q=89 | |
(domain_nowww === "mix106radio.com" && src.indexOf("/files/") >= 0) || | |
// https://static-cdn.sr.se/sida/images/3138/3464680_2048_1152.jpg?preset=768x432 | |
(domain === "static-cdn.sr.se" && src.indexOf("/images/") >= 0) || | |
// https://cdn.kaumo.jp/element/25beb439-c680-42cb-b4da-01082ffd495e.jpg?w=200&h=200&t=resize&q=90 | |
(domain === "cdn.kaumo.jp" && src.indexOf("/element/") >= 0) || | |
// https://d12swbtw719y4s.cloudfront.net/images/HAH4ZNFC/j8zc9QNLZWdMLRkJoJ10/13876272_154185325010658_4931241332073474710_n.jpeg?w=300 | |
(domain === "d12swbtw719y4s.cloudfront.net" && src.indexOf("/images/") >= 0) || | |
// https://www.saplinghr.com/hs-fs/hubfs/Imported_Blog_Media/Adobe-1024x425.png?width=1024&name=Adobe-1024x425.png | |
(domain_nowww === "saplinghr.com" && src.indexOf("/hubfs/") >= 0) || | |
// https://telefe-static2.akamaized.net/media/172711/keanu.png?v=20190610125202000&format=main&width=640&height=360&mode=crop | |
(domain === "telefe-static2.akamaized.net" && src.indexOf("/media/") >= 0) || | |
// https://10daily.com.au/ip/s3/2019/06/10/2463e4bc5827eeb7aec3ffee82d4126a-280668.jpg?image-profile=card_max&io=landscape | |
domain_nowww === "10daily.com.au" || | |
// https://spark.adobe.com/page/eq97XntUeP3NA/images/314ec4b7-f138-46b4-8246-7e5ab62e33ee.jpg?asset_id=9ec649f8-f5d8-4178-a637-f1e6c9f95a20&img_etag=7743c1a8f9943940e303fcdc239a3291&size=2560 | |
(domain === "spark.adobe.com" && src.indexOf("/page/") >= 0) || | |
// https://s.w-x.co/util/image/w/ap_19171124776280.jpg?v=at&w=485&h=273 | |
(domain === "s.w-x.co" && src.indexOf("/image/") >= 0) || | |
// https://img.monocle.com/radio/episodes/untitled-1-55df1345e1fea.jpg?w=408&g=center&q=50 | |
domain === "img.monocle.com" || | |
// https://bildix.mmcloud.se/bildix/api/images/2ec6e4f9-0a6f-449b-9429-2e63ba616165.jpg?fit=crop&w=300 | |
(domain === "bildix.mmcloud.se" && /\/bildix\/+api\/+images\/+/.test(src)) || | |
// https://media.cinedb.com.tr/Upload/News/c9f58bdc-6f94-41d9-8e3e-90d5961cddfd.jpeg?h=320&crop=true | |
(domain === "media.cinedb.com.tr" && /\/Upload\//i.test(src)) || | |
// https://www.newidea.com.au/media/41689/gettyimages-859537364.jpg?width=720¢er=0.0,0.0 | |
(domain_nowww === "newidea.com.au" && src.indexOf("/media/") >= 0) || | |
// https://www.essexstudent.com/asset/Event/6006/aquaman-original.jpg?thumbnail_width=595&thumbnail_height=883&resize_type=CropToFit | |
(domain_nowww === "essexstudent.com" && /\/asset\//i.test(src)) || | |
// https://d.newsweek.com/en/full/1505905/belle-delphine.png?w=1600&h=1600&l=50&t=40&q=88&f=14e520e290afd404d58c1386f9e4bd20 | |
(domain === "d.newsweek.com" && src.indexOf("/full/") >= 0) || | |
// https://images.techtimes.com/data/images/full/249878/mirrors-edge-catalyst.jpg?w=600&h=300 | |
(domain === "images.techtimes.com" && /\/data\/+images\/+/.test(src)) || | |
// https://oyster.ignimgs.com/mediawiki/apis.ign.com/mirrors-edge-2/7/7f/ME_Imprisoned2.jpg?width=640 | |
domain === "oyster.ignimgs.com" || | |
// https://www.marieclaire.com.au/media/29220/gettyimages-873295564.jpg?width=640 | |
(domain_nowww === "marieclaire.com.au" && src.indexOf("/media/") >= 0) || | |
// https://www.theargus.co.uk/resources/images/10117461.jpg?htype=0&type=mc2 | |
(domain_nowww === "theargus.co.uk" && /\/resources\/+images\/+/.test(src)) || | |
// https://www.stylist.co.uk/images/app/uploads/2015/09/24222225/kendall-jenner-8.jpg?w=200&h=1&fit=max&auto=format%2Ccompress | |
(domain_nowww === "stylist.co.uk" && /\/images\/+app\/+uploads\/+/.test(src)) || | |
// https://www.britishfashioncouncil.co.uk/uploads/collections/3162/70/original/282717.jpg?w=600&h=894&mode=crop | |
(domain_nowww === "britishfashioncouncil.co.uk" && src.indexOf("/uploads/") >= 0) || | |
// https://static.fptplay.net/static/img/share/video/09_05_2016/9794a73f2472ed913bf6f44718a1acaf1355153297_full09-05-2016_10g02-52.jpg?w=300&h=430&mode=scale | |
(domain === "static.fptplay.net" && src.indexOf("/img/") >= 0) || | |
// https://images-mega.mdstrm.com/2019/06/30/91551_1_5d19275c96931.jpg?d=300x200 | |
domain === "images-mega.mdstrm.com" || | |
// https://www.girlfriend.com.au//media/13027/1000-selena-gomez-justin-bieber-hailey-baldwin.png?width=200&format=jpg | |
(domain_nowww === "girlfriend.com.au" && src.indexOf("/media/") >= 0) || | |
// http://imgs.ngaotruyen.com//LibIma/TruyenChu/anh-yeu-em-co-be-ngoc-a.jpg?width=160&quality=95&v=41 | |
domain === "imgs.ngaotruyen.com" || | |
// https://d1ywb8dvwodsnl.cloudfront.net/files.fuzoku.jp/img/shop/eroma/diary/57347859/thumbnail_57347859_1563667048_0.jpeg?width=160&height=240&type=resize&quality=80 | |
(domain === "d1ywb8dvwodsnl.cloudfront.net" && /\/files\.fuzoku\.jp\/+img\//.test(src)) || | |
// https://www.menshealth.com.au/media/10567/rihanna.jpg?width=606&mode=crop¢er=0.0,0.0 | |
(domain_nowww === "menshealth.com.au" && src.indexOf("/media/") >= 0) || | |
// https://2sao.vietnamnetjsc.vn/images/2019/05/28/11/04/hara-ava2.jpg?width=150 | |
(domain === "2sao.vietnamnetjsc.vn" && src.indexOf("/images/") >= 0) || | |
// http://images.jkn.co.kr/data/images/full/939969/image.jpg?w=64&h=64&l=50&t=40 | |
(domain === "images.jkn.co.kr" && src.indexOf("/images/") >= 0) || | |
// https://www.instylemag.com.au/media/19665/anne-hathaway.jpg?width=640 | |
(domain_nowww === "instylemag.com.au" && src.indexOf("/media/") >= 0) || | |
// https://i.eurosport.com/2018/06/17/2356762-49034010-2560-1440.jpg?w=750 | |
domain === "i.eurosport.com" || | |
// https://blog.wirelessanalytics.com/hs-fs/hubfs/bigstock-Burj-Al-Arab-Jumeirah-In-Dubai-129187832.jpg?width=524&name=bigstock-Burj-Al-Arab-Jumeirah-In-Dubai-129187832.jpg | |
(domain === "blog.wirelessanalytics.com" && src.indexOf("/hubfs/") >= 0) || | |
// https://b.zmtcdn.com/data/user_profile_pictures/b8b/0bbe96945a87de2eb8c9d9d82e1ecb8b.jpg?fit=around%7C400%3A400&crop=400%3A400%3B%2A%2C%2A | |
(domain_nosub === "zmtcdn.com" && src.indexOf("/data/") >= 0) || | |
// https://images.mubi.com/images/film/179265/image-w1280.jpg?size=740x | |
(domain === "images.mubi.com" && src.indexOf("/images/") >= 0) || | |
// https://i.obozrevatel.com/gallery/2011/4/1/840669.jpg?size=400x400 | |
domain === "i.obozrevatel.com" || | |
// https://1624909224.rsc.cdn77.org/data/images/full/20509/singer-taylor-swift-c-and-selena-gomez-r-attend-the-58th-grammy-awards-at-staples-center-on-february-15-2016-in-los-angeles-california.jpg?w=600&h=300 | |
domain === "1624909224.rsc.cdn77.org" || | |
// https://assetscdn1.paytm.com/images/catalog/product/K/KI/KIDPRIYA-COLLECPRIY20786186F9A127/1564605875711_0..jpg?imwidth=320&impolicy=hq | |
(domain_nosub === "paytm.com" && /^assetscdn[0-9]*\./.test(domain)) || | |
// https://images.perthnow.com.au/publication/B881248267Z/1562057175392_GKT29TC6J.2-2.jpg?imwidth=668&impolicy=pn_v3 | |
domain === "images.perthnow.com.au" || | |
// https://netstorage-yen.akamaized.net/images/3o3bpd2bs54589rka.jpg?imwidth=900 | |
(domain === "netstorage-yen.akamaized.net" && src.indexOf("/images/") >= 0) || | |
// https://cdn1.eldia.com/092017/1506251744295.jpg?&cw=320 | |
(domain_nosub === "eldia.com" && /^cdn[0-9]*\./.test(domain)) || | |
// https://esquire.com.gr/Content/ImagesDatabase/dd/dd305859aa7b4181b03ee3f615490545.jpg?v=1&maxwidth=760& | |
(domain_nowww === "esquire.com.gr" && /\/Content\/+ImagesDatabase\//i.test(src)) || | |
// https://akmedia.hollywoodlife.com/2012/04/041012_1d_teaser_spl380257_017120410085753.jpg?w=150&h=115&crop=1 | |
domain === "akmedia.hollywoodlife.com" || | |
// https://www.refinery29.com/images/8499155.jpg?format=webp&width=720&height=864&quality=85 | |
(domain_nowww === "refinery29.com" && src.indexOf("/images/") >= 0) || | |
// https://images.radio.com/aiu-media/BebeRexha.jpg?width=300&crop=16:9,offset-y0 | |
(domain === "images.radio.com" && src.indexOf("/aiu-media/") >= 0) || | |
// http://www.casseycds.net/uploads/sanpham/g1hv6_09.jpg?w=160&h=140&mode=pad | |
(domain_nowww === "casseycds.net" && src.indexOf("/uploads/") >= 0) || | |
// http://www.youmekorea.com/event_4.brd/_12.12.cea0c14/T-ara%20Day%20By%20Day.jpg?cid=smime_6_50434350&thumb=300x226 | |
(domain_nowww === "youmekorea.com" && /[?&]thumb=/.test(src)) || | |
// https://cdfront.tower.jp/~/media/Images/Mag/Mikiki/mikiki_icon_70.jpg?h=70&thn=1&w=70 | |
// https://tower.jp/~/media/Images/Mag/Mikiki/mikiki_icon_70.jpg?h=70&thn=1&w=70 | |
(domain_nosub === "tower.jp" && /\/~\/+media\//.test(src)) || | |
// https://images.boosty.to/user/23212/avatar?change_time=1566827978&croped=1&mh=560&mw=450 | |
domain === "images.boosty.to" || | |
// https://media.nbcnewyork.com/2019/09/bestdressed-uma.jpg?fit=700%2C1000 | |
domain === "media.nbcnewyork.com" || | |
// http://us.jimmychoo.com/dw/image/v2/AAWE_PRD/on/demandware.static/-/Sites-jch-master-product-catalog/default/dw70b1ebd2/images/rollover/LIZ100MPY_120004_MODEL.jpg?sw=245&sh=245&sm=fit | |
// https://www.aritzia.com/on/demandware.static/-/Library-Sites-Aritzia_Shared/default/dw3a7fef87/seasonal/ss18/ss18-springsummercampaign/ss18-springsummercampaign-homepage/hptiles/tile-wilfred-lrg.jpg | |
src.match(/\/demandware\.static\//) || | |
// https://cdn1.kongcdn.com/assets/avatars/defaults/robotboy.png?i10c=img.resize(width:40) | |
src.match(/\?i10c=[^/]*$/) || | |
// http://hypebeast.com/wp-content/blogs.dir/4/files/2018/01/louis-vuitton-2018-fall-winter-50.jpg?q=75&w=400 | |
// doesn't work: | |
// https://d2u7zfhzkfu65k.cloudfront.net/resize/wp-content/uploads/2018/5/8/15/f21a56c81474b277e24bca7575e94dc7.jpg?w=70&q=85 | |
/^[a-z]+:\/\/[^?]*\/wp(?:-content\/+(?:uploads|blogs.dir)|\/+uploads)\//.test(src) | |
/*src.indexOf("/wp-content/blogs.dir/") >= 0 || | |
src.indexOf("/wp-content/uploads/") >= 0 || | |
src.indexOf("/wp/uploads/") >= 0*/) { | |
//src = src.replace(/\?[^/]*$/, ""); | |
src = src.replace(/\?.*$/, ""); | |
} | |
// https://cdn.odigo.net/60168923a5f06af67f74250c44de7861.png?imageView2/2/w/800/interlace/1%7Cimageslim | |
if (domain === "cdn.odigo.net" || | |
// http://wangsuimg.fanshuapp.com/14892066562143large17ef000388f3e91c711a?imageView2/2/w/375/q/80 | |
domain === "wangsuimg.fanshuapp.com" || | |
// https://img.aiji66.com/83/9d/f1/f4/64/afe732c7-9501-11e7-9040-11832666daf4.jpg?ufopmogr3/auto-orient/thumbnail/300x/crop/x792/interlace/1/quality/100/&e=1519833600&token=Uon2lwH6FDLYBhVyGu5jN25PwVCQuNAIf-_PaQ8E:2Du8aIDyVBLvGBAdS0vvI1eX53c= | |
domain === "img.aiji66.com" || | |
// http://imgs.aixifan.com/content/2018_05_01/1525165813.jpg?imageView2/1/w/432/h/240 | |
domain === "imgs.aixifan.com" || | |
// http://imgcdn.thecover.cn/cf48adfc-f370-4ee9-922e-dd17fe90691e@1532497060708?imageView2/1/w/315/h/157 | |
domain === "imgcdn.thecover.cn" || | |
// http://img.shelive.net/201704/1c700003b38741b2ef81.jpg?imageView2/2/w/640/h/427 | |
domain === "img.shelive.net" || | |
// http://img.qdaily.com/article/article_show/201801221803061ecNiBfxSIF2pzrU.jpg?imageMogr2/auto-orient/thumbnail/!245x185r/gravity/Center/crop/245x185/quality/85/format/webp/ignore-error/1 | |
domain === "img.qdaily.com" || | |
// https://qimage.owhat.cn/prod/shop/cover/1557915266300.jpg?imageMogr2/auto-orient/thumbnail/!750x480r/gravity/Center/quality/80/crop/750x480 | |
domain === "qimage.owhat.cn" || | |
// https://cdn.ruguoapp.com/7b7fbe6f0a56510160ffe58bbdb9f76a?imageMogr2/auto-orient/thumbnail/1000x2000%3E/quality/70/interlace/1 | |
domain === "cdn.ruguoapp.com" || | |
// http://user-assets.sxlcdn.com/images/87741/FnNRSp9wPHG_XCQBPjpiPs6vGwlq.jpg?imageMogr2/strip/auto-orient/thumbnail/1920x9000%3E/quality/90!/interlace/1/format/jpg | |
(domain === "user-assets.sxlcdn.com" && src.indexOf("/images/") >= 0) || | |
// https://img.ksl.com/slc/2657/265775/26577563.jpg?filter=ksl/img143 | |
domain === "img.ksl.com" || | |
// https://img3.tapimg.com/avatars/1e81533319ff240f73fa29a04ae8b769.jpg?imageMogr2/auto-orient/strip/thumbnail/!300x300r/gravity/Center/crop/300x300/format/jpg/interlace/1/quality/80 | |
(domain_nosub === "tapimg.com" && domain.match(/^img[0-9]*\./)) || | |
// http://7xka0y.com1.z0.glb.clouddn.com/%E3%80%90%E6%8E%A8%E8%8D%90%E3%80%91%E8%80%81%E5%A4%96%E5%B8%B8%E6%8C%82%E5%9C%A8%E5%98%B4%E8%BE%B9%E7%9A%84%E7%9F%AD%E5%8F%A5%E8%A1%A8%E8%BE%BE%EF%BC%882%EF%BC%89.jpg?imageView2/1/w/375/h/250/q/100 | |
domain === "7xka0y.com1.z0.glb.clouddn.com" || | |
// https://p4-q.mafengwo.net/s10/M00/73/67/wKgBZ1l9RWWAEl9xAAFOhGs4tI892.jpeg?imageMogr2%2Fthumbnail%2F%21440x260r%2Fgravity%2FCenter%2Fcrop%2F%21440x260%2Fquality%2F100 | |
// http://b1-q.mafengwo.net/s10/M00/5E/92/wKgBZ1mXs1SAOJDoAAe3hRNOEs475.jpeg?imageView2%2F2%2Fw%2F700%2Fq%2F90%7Cwatermark%2F1%2Fimage%2FaHR0cDovL24xLXEubWFmZW5nd28ubmV0L3MxMS9NMDAvOTEvNzAvd0tnQkVGcF9faTZBUHYtZEFBQUwxMzg3aE0wNjk5LnBuZw%3D%3D%2Fgravity%2FSouthEast%2Fdx%2F10%2Fdy%2F11 | |
(domain_nosub === "mafengwo.net" && domain.match(/^[a-z][0-9]*(?:-[a-z])?\./)) || | |
//(domain_nosub === "mafengwo.net" && domain.match(/^p[0-9]*(?:-[a-z]+)\./)) || | |
// http://mplive-1253454074.image.myqcloud.com/mplive_dev/imgZmFkNWY0Y2ItNDFkOS00ZTNlLWE3ZmEtZmE4YTA2MGI1NjM0.jpg?imageView2/1/w/400/h/225 | |
(domain_nosub === "myqcloud.com" && domain.match(/image\.myqcloud\.com/)) || | |
// https://ci.xiaohongshu.com/751cccf1-a34a-57fd-ac5e-438265582359?imageMogr2/thumbnail/640x640/format/jpg/quality/92/auto-orient/strip | |
domain === "ci.xiaohongshu.com" || | |
// http://pic.qianye88.com/0c4b3bc07a69b2ed260d3b17e15ff4f2.jpeg?imageMogr2/thumbnail/x300/quality/90! | |
domain === "pic.qianye88.com" || | |
// http://imgboys1.yohobuy.com/spidercms/2018/01/27/01/0127fc0ca0f50496e5235ebc742ff0e056.jpeg?imageView2/2/w/240/q/75|imageslim | |
(domain_nosub === "yohobuy.com" && domain.match(/^img[a-z]*[0-9]*\.yohobuy\.com$/)) || | |
// http://i-4-yxdown.715083.com/2018/3/30/a9be3ebb-50a7-4993-9cfb-c1a3ddc3ff61.png?imageView2/2/q/65/w/600 | |
(domain_nosub === "715083.com" && domain.match(/^i-[0-9]*-yxdown\./)) || | |
// http://i-4.yxdown.com/2018/3/30/KDYwMHgp/a9be3ebb-50a7-4993-9cfb-c1a3ddc3ff61.png?imageView2/2/q/65/w/600 | |
(domain_nosub === "yxdown.com" && domain.match(/^i-[0-9]*\./)) || | |
// https://jkcdn.pajk.com.cn/image/T1iZhnBvd_1R4bAZ6K.jpg?img=/tf,d_jpg,q_70/rs,w_500 | |
(domain === "jkcdn.pajk.com.cn" && src.indexOf("/image/") >= 0) || | |
// https://www.hola.com/imagenes/moda/tendencias/2016071486971/summer-denim-looks/0-377-84/jessica_alba_1-a.jpg?interpolation=lanczos-normal&downsize=200px:*&output-format=progressive-jpeg | |
// https://us.hola.com/en/imagenes/fashion/2017111710813/latin-grammy-awards-2017-red-carpet-fashion/0-16-344/latin-grammys-t.jpg?interpolation=lanczos-normal&downsize=780px:*&output-format=progressive-jpeg | |
// https://us.hola.com/en/imagenes/celebrities/2018012911210/grammy-awards-2018-camila-cabello-mom-nick-jonas/0-19-519/camila-cabello-grammy-awards-t.jpg?composite=0.9%7C1/8xw%3A%2A%3Bright%5B0.02xw%5D%2Cbottom%5B0.02xw%5D%7CRJmqrP23Dz8EaRRxMm5bs07f5pu42i2f | |
(domain_nosub === "hola.com" && src.indexOf("/imagenes/") >= 0) || | |
// http://static.leiphone.com/uploads/new/article/600_600/201409/54087bb6e4a2c.jpg?imageMogr2/thumbnail/1920x%3E/format/jpg/quality/90 | |
(domain === "static.leiphone.com" && src.indexOf("/uploads/") >= 0) || | |
// https://static-movie.a.88cdn.com/3e253bd7c046ee9ab3611b6fa6df6380584de3a2?imageView2/2/q/85/interlace/1/format/gif | |
domain === "static-movie.a.88cdn.com" || | |
// http://image.qianye88.com/pic/4a05c5838eb8bbb41a3a1af82815c4f7?imageMogr2/thumbnail/!400x260r/gravity/North/crop/400x260/quality/90! | |
(domain === "image.qianye88.com" && src.indexOf("/pic/") >= 0) || | |
// http://pc.wangpan.xycdn.n0808.com/57984519e2491eb5cf3a536c3e2a434016908e1a?imageView2/2/w/460/q/90/interlace/1/format/gif | |
domain === "pc.wangpan.xycdn.n0808.com" || | |
// http://resource.meihua.info/fa6c53e3-2dfb-441d-a323-158146e5a9aa.jpg?imageView2/0/format/jpg | |
domain === "resource.meihua.info" || | |
// https://i.ezbuy.sg/Fgf2dNzJvLXyyw04b-yGRWTRUbmx?imageView2/2/w/264/q/90/format/webp | |
domain === "i.ezbuy.sg" || | |
// http://upload-images.jianshu.io/upload_images/1685198-ebfc2a22664f623c?imageMogr2/auto-orient/strip%7CimageView2/2/w/300 | |
domain === "upload-images.jianshu.io") { | |
src = src.replace(/\?.*$/, ""); | |
} | |
if (domain === "mtv.mtvnimages.com" || | |
// https://item4.tradesy.com/images/miu-miu-cut-off-cat-eye-marble-havana-retro-funky-sunnies-sunglasses-1063438-5-0.jpg?width=720&height=960 -- stretched, 406 for head | |
(domain_nosub === "tradesy.com" && domain.match(/^item[0-9]*\.tradesy/) && src.indexOf("/images/") >= 0)) { | |
// http://mtv.mtvnimages.com/uri/mgid:file:gsp:scenic:/international/mtvema/2017/images/nominees/Taylor_Swift_1940x720.jpg?quality=0.85&width=1024&height=450&crop=true -- 400 | |
// https://mtv.mtvnimages.com/uri/mgid:file:http:shared:mtv.com/news/wp-content/uploads/2017/03/GettyImages-661260604-1490974103.jpg?quality=.8&height=1221.3740458015266&width=800 -- 400 | |
return { | |
url: src.replace(/\?.*$/, ""), | |
can_head: false | |
}; | |
} | |
if (domain === "store-images.microsoft.com" || | |
// http://store-images.s-microsoft.com/image/apps.29315.9007199266376618.a07f1cfa-b27d-402c-98e5-a3bae29e8cf3.9fd604bc-2a5c-4e17-be7d-37af2d7afe02?w=180&h=180&q=60 | |
domain === "store-images.s-microsoft.com") { | |
// https://store-images.microsoft.com/image/apps.48655.9007199266600012.ac6a9859-80c3-4fc8-8ac1-45b10b74e7ab.e9bce38b-5ca6-4355-8e25-a2d486d2d568?w=712&h=400&mode=letterbox&background=black | |
return { | |
url: src.replace(/\?.*$/, ""), | |
head_wrong_contenttype: true | |
}; | |
} | |
if (domain_nowww === "dailyherald.com") { | |
// http://www.dailyherald.com/storyimage/DA/20140418/news/140418160/AR/0/AR-140418160.jpg&updated=201404182313&MaxW=800&maxH=800&noborder | |
newsrc = src.replace(/[?&].*$/, ""); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
// check to make sure this doesn't break anything | |
// test: https://s3.amazonaws.com/oscars-img-abc/wp-content/uploads/2017/02/26164054/950c51cde0a1cab411efdbf8f1abc117a6aad749397172c9b95dd3c47bfb6f6f-370x492.jpg | |
// http://3.imimg.com/data3/BH/EP/MY-26242/silk-printed-ties-500x500.jpg | |
if (domain_nosub === "imimg.com" || | |
//domain.indexOf(".files.wordpress.com") >= 0 || // doesn't work | |
// https://blogs-images.forbes.com/jasonevangelho/files/2018/06/playstation-logo-1200x675.jpg | |
domain === "blogs-images.forbes.com" || | |
// http://static.thesuperficial.com/uploads/2016/07/lindsay-lohan-egor-tarabasov-butterfly-ball-0701-01-420x560.jpg -- dead | |
domain === "static.thesuperficial.com" || | |
// doesn't work: | |
// http://static.celebuzz.com/uploads/2011/06/10/Emma-Roberts-Outside-Today-Show-in-NYC-e1435832610488-385x560.jpg | |
// http://static.celebuzz.com/uploads/2011/06/10/Emma-Roberts-Outside-Today-Show-in-NYC.jpg | |
// http://static.celebuzz.com/uploads/2011/06/10/Emma-Roberts-Outside-Today-Show-in-NYC-e1435832660684-310x560.jpg | |
// http://static.celebuzz.com/uploads/2011/06/10/Emma-Roberts-Outside-Today-Show-in-NYC.JPG | |
// works: | |
// http://static.celebuzz.com/uploads/2018/02/kim-kardashian-celeb-snaps-020218-1517608914-414x268.jpg | |
domain === "static.celebuzz.com" || | |
// http://img.vogue.co.kr/vogue/2018/07/style_5b43023b0c1b0-783x930.jpg | |
domain === "img.vogue.co.kr" || | |
// https://static.spin.com/files/2016/11/needledropjeremy-1480526302-1648x800.png | |
domain === "static.spin.com" || | |
// https://zrockr.com/user-files/uploads/2018/04/John5.4.7.2018-3867-1024x683.jpg | |
domain_nowww === "zrockr.com" || | |
// http://electricegg.co.uk/media/uploads/2017/08/nick-hewer-by-electric-egg-375x320.jpg | |
domain_nowww === "electricegg.co.uk" || | |
// https://iphone7wallpapers.co/media/uploads/2017/08/Josie-Lane-Model-Girl-Cute-300x533.jpg | |
(domain_nowww === "iphone7wallpapers.co" && /\/media\/+uploads\//.test(src)) || | |
// https://androidhdwallpapers.com/media/uploads/2017/08/Josie-Lane-Model-Girl-Cute-640x960.jpg | |
(domain_nowww === "androidhdwallpapers.com" && /\/media\/+uploads\//.test(src)) || | |
// http://www.media2.hw-static.com/media/2018/01/wenn_kerrywashington_012618-442x216.jpg | |
(domain_nosub === "hw-static.com" && domain.match(/www\.media[0-9]*\.hw-static\.com/)) || | |
// http://i2.cdn.turner.com/money/dam/assets/160511121527-emma-watson-780x439.jpg | |
(domain_nosub === "turner.com" && domain.indexOf(".cdn.turner.com") >= 0) || | |
// http://k99.com/files/2013/01/JohnnyCarson_Facebook-630x477.jpg | |
domain_nowww === "k99.com" || | |
// http://97rockonline.com/files/2012/07/Flag-Bikini-Venus-214x300.jpg | |
domain_nowww === "97rockonline.com" || | |
// http://wfgr.com/files/2011/03/old-rich-woman-200x300.jpg | |
domain_nowww === "wfgr.com" || | |
// http://wblk.com/files/2013/04/sirius-alien-630x355.jpg | |
domain_nowww === "wblk.com" || | |
// http://fun107.com/files/2015/01/charlie-hunnam-and-chris-hemsworth-630x346.jpg | |
domain_nowww === "fun107.com" || | |
// http://965kvki.com/files/2013/12/christmasgenius-630x472.jpg | |
domain_nowww === "965viki.com" || | |
// http://1079ishot.com/files/2013/06/90713084-630x434.jpg | |
domain_nowww === "1079ishot.com" || | |
// https://edge.alluremedia.com.au/m/l/2017/05/Surface-Laptop-410x231.png | |
domain === "edge.alluremedia.com.au" || | |
// https://s3-us-west-1.amazonaws.com/blogs-prod-media/us/uploads/2016/06/02110848/Coco-Austin-breastfeeding-650x630.jpg | |
(amazon_container === "blogs-prod-media" && src.indexOf("/uploads/") >= 0) || | |
// https://d36tnp772eyphs.cloudfront.net/blogs/1/2014/08/8754021448_bf2a5c94a3_k-940x403.jpg | |
domain === "d36tnp772eyphs.cloudfront.net" || | |
// http://img.allurekorea.com/allure/2016/10/style_581190dac6d83-835x1024.jpg | |
domain === "img.allurekorea.com" || | |
// https://www.psu.com/app/uploads/2017/12/gang_beasts_review_01-1024x576.jpg | |
// https://psu.com/app/uploads/2017/12/gang_beasts_review_01-1024x576.jpg | |
domain_nowww === "psu.com" || | |
// http://media.popculture.com/2018/01/demi-lovato-fabletics-fitness-leggings-20022601-160x90.jpeg | |
domain === "media.popculture.com" || | |
// http://www.rap-up.com/app/uploads/2018/02/rihanna-gpe-340x330.jpg | |
// http://rap-up.com/app/uploads/2018/02/rihanna-gpe-340x330.jpg | |
domain_nowww === "rap-up.com" || | |
// https://www.funweek.it/app/uploads/2018/01/kay-panabaker-38703-200x300.jpeg | |
(domain_nowww === "funweek.it" && src.indexOf("/uploads/") >= 0) || | |
// http://img.snacker.hankyung.com/hk-content/2017/08/terracotta-army-1865006__340-400x300.jpg | |
(domain_nosub === "hankyung.com" && domain.match(/img\..*?\.hankyung\.com$/)) || | |
// https://www.traveltipy.com/content/uploads/2015/10/Gorlitz-Germany-1024x692.jpg | |
domain_nowww === "traveltipy.com" || | |
// http://coveteur.com/content/uploads/2017/03/Emma-Roberts-Hair-3-940x940.jpg | |
domain_nowww === "coveteur.com" || | |
// http://food-ehow-com.blog.ehow.com/files/2014/12/edits-2282-1024x682.jpg | |
(domain_nosub === "ehow.com" && domain.indexOf(".blog.ehow.com") >= 0) || | |
// https://cdn2.theheartysoul.com/uploads/2016/06/image1-798x418.jpg | |
(domain_nosub === "theheartysoul.com" && domain.match(/cdn[0-9]*\.theheartysoul\.com/)) || | |
// http://www.bandt.com.au/information/uploads/2017/08/Screen-Shot-2017-08-01-at-10.58.17-am-420x280.png | |
// http://bandt.com.au/information/uploads/2017/08/Screen-Shot-2017-08-01-at-10.58.17-am-420x280.png | |
domain_nowww === "bandt.com.au" || | |
// https://www.theepochtimes.com/assets/uploads/2017/08/28/Agriculture-dependent-to-the-river-5-700x420.jpg | |
(domain_nosub === "theepochtimes.com" && src.match(/\/assets\/+uploads\/+/)) || | |
// https://m.theepochtimes.com/assets/uploads/2016/06/15/Argan_Tree_near_Tafraoute-550x330.jpg | |
//domain === "m.theepochtimes.com" || | |
// https://images.gamme.com.tw/news2/2018/82/30/pJySpaabj56WsKQ-300x250.jpg | |
// https://images2.gamme.com.tw/news2/2016/48/54/q5iYop_Xk6CXqqQ-270x180.jpg | |
(domain_nosub === "gamme.com.tw" && /^images[0-9]*\./.test(domain)) || | |
// http://images.gamme.com.cn/news2/2017/97/14/pZeao56Yj6aZqA-380x300.jpg | |
domain === "images.gamme.com.cn" || | |
// http://cdn.hoahoctro.vn/uploads/2018/02/5a87a07c09b7e-pagehihi-600x450.jpg | |
domain === "cdn.hoahoctro.vn" || | |
// https://vnn-imgs-f.vgcloud.vn/2018/02/22/09/fan-xon-xao-mat-son-tung-beo-u-sau-tet-nguyen-dan-140x78.jpg | |
domain === "vnn-imgs-f.vgcloud.vn" || | |
// https://static.vibe.com/files/archives/galleries/2005/01/23/ciara2-160x160.jpg | |
domain === "static.vibe.com" || | |
// https://rightsinfo.org/app/uploads/2018/02/nathan-dumlao-378988-unsplash-1024x671.jpg | |
(domain_nowww === "rightsinfo.org" && src.indexOf("/uploads/") >= 0) || | |
// http://spotted.tv/app/uploads/20131210-2339481-750x355.jpg | |
(domain_nowww === "spotted.tv" && src.indexOf("/uploads/") >= 0) || | |
// http://img.marieclairekorea.com/2018/03/mck_5a9de416ee7a4-570x381.jpg | |
domain === "img.marieclairekorea.com" || | |
// http://tokyopopline.com/images/2013/01/130106kara6-515x341.jpg | |
(domain_nowww === "tokyopopline.com" && src.indexOf("/images/") >= 0) || | |
// http://px1img.getnews.jp/img/archives/2017/10/ba35fadf68725a24224b306250f20c2f-1024x761.jpg | |
domain === "px1img.getnews.jp" || | |
// https://media.thetab.com/blogs.dir/279/files/2017/03/emma-1177x557.jpg | |
domain === "media.thetab.com" || | |
// https://assets.rockpapershotgun.com/images//2018/02/survivingmars2-620x315.jpg | |
domain === "assets.rockpapershotgun.com" || | |
// http://f.imgs.vietnamnet.vn/2017/11/05/09/t-ara-roi-nuoc-mat-vi-fan-viet-4-100x30.jpg | |
// http://imgs.vietnamnet.vn/Images/2015/11/17/10/20151117104955-av-240x160.jpg | |
(domain_nosub === "vietnamnet.vn" && /^(?:[^/]*\.)?img(?:\.cdn[0-9]*|s)\./.test(domain)) || | |
//(domain_nosub === "vietnamnet.vn" && domain.indexOf(".imgs.vietnamnet.vn") >= 0) || | |
// https://sloanreview.mit.edu/content/uploads/2018/04/GEN-Ross-Digital-Transformation-Speed-Long-Term-1200-300x300.jpg | |
domain === "sloanreview.mit.edu" || | |
// http://business.inquirer.net/files/2017/09/pet6-1024x682.jpg | |
// https://preen.inquirer.net/files/2017/08/IMG_1911-300x200.jpg | |
(domain_nosub === "inquirer.net" && src.indexOf("/files/") >= 0) || | |
// http://static.thefrisky.com/uploads/2013/07/10/Victoria-Justice-Lucy-Hale-And-Nina-Dobrev-600x450.jpg | |
// http://static.thefrisky.com/uploads/2013/07/10/Victoria-Justice-Lucy-Hale-And-Nina-Dobrev.jpg | |
domain === "static.thefrisky.com" || | |
// http://hobby.dengeki.com/ss/hobby/uploads/2017/12/P1014922-440x586.jpg | |
domain === "hobby.dengeki.com" || | |
// https://cdn-blog.adafruit.com/uploads/2017/06/megumin-cosplay-360x480.jpg | |
domain === "cdn-blog.adafruit.com" || | |
// http://img.uuhy.com/uploads/2010/10/sexy-cosplay-46-550x825.jpg | |
// http://simg.uuhy.com/2017/06/businesscards7-220x150.jpg | |
(domain_nosub === "uuhy.com" && domain.match(/s?img\.uuhy\.com/)) || | |
// http://img.butongshe.com/2017/12/DSXVVOWVAAEVjVa-520x245.jpg | |
domain === "img.butongshe.com" || | |
// https://myreco.asia/img/uploads/article/SE9OJk4VWYhKq8JN1t7THTyVFzvdbA2qOy3XgEVS-2000x1000.jpeg | |
(domain_nowww === "myreco.asia" && src.indexOf("/uploads/") >= 0) || | |
// https://d3p157427w54jq.cloudfront.net/uploads/2018/01/selena-site-637x397.jpg | |
(domain === "d3p157427w54jq.cloudfront.net" && src.indexOf("/uploads/") >= 0) || | |
// http://cdn.harpersbazaar.com.sg/2017/10/DSC_2716-1200x799.jpg | |
domain === "cdn.harpersbazaar.com.sg" || | |
// https://media.harpersbazaar.com.sg/2018/03/Emma-Watson-700x933.jpg | |
domain === "media.harpersbazaar.com.sg" || | |
// http://nsfw.myconfinedspace.com/files/2017/06/gomez__7__1-1000x1500.jpg | |
domain_nosub === "myconfinedspace.com" || | |
// https://s3.amazonaws.com/hiphopdx-production/2017/08/Rihanna-826x620.jpg | |
amazon_container === "hiphopdx-production" || | |
// https://assets.wonderlandmagazine.com/uploads/2014/11/Taylor-Swift-Wonderland-1-Crop-345x483.jpg | |
domain === "assets.wonderlandmagazine.com" || | |
// https://am24.akamaized.net/tms/cnt/uploads/2017/04/taylor-swift-650x372.jpg | |
// https://am21.akamaized.net/tms/cnt/uploads/2019/01/CardiB-1200x831.jpg | |
(domain_nosub === "akamaized.net" && domain.match(/^am[0-9]*\./) && /\/tms\/+cnt\/+uploads\//.test(src)) || | |
// http://snappa.static.pressassociation.io/assets/2016/04/08154418/1460126656-210b91ce6f5398e743add7f71b3e9b72-600x986.jpg | |
(domain_nosub === "pressassociation.io" && domain.indexOf("static.pressassociation.io") >= 0) || | |
// https://assets.vg247.com/current/2014/09/sep_23_-_keyart_inquisitormf_v3-156x108.jpg | |
domain === "assets.vg247.com" || | |
// https://www.theblemish.com/images/2015/02/taylor-swift-stops-by-kelsey-edwards-studio-17-640x881.jpg | |
(domain_nowww === "theblemish.com" && src.indexOf("/images/") >= 0) || | |
// https://www.dailyxtra.com/content/uploads/2017/06/billc36-479x270.jpg | |
(domain_nowww === "dailyxtra.com" && /\/content\/+uploads\//.test(src)) || | |
// https://media.metrolatam.com/2018/05/12/neymarseponecamistapsg2018-09b3bddb47d54ac1e4d12b24697bc2e8-300x200.jpg | |
domain === "media.metrolatam.com" || | |
// http://media.comicbook.com/2018/01/dove-cameron-ruby-agents-of-shield-1079103-1280x0.jpeg | |
domain === "media.comicbook.com" || | |
// https://www.grazia.it/content/uploads/2018/01/Dove-Cameron-800x599.jpg | |
domain_nowww === "grazia.it" || | |
// https://img.kpopmap.com/2018/05/loco-445x262.jpg | |
domain === "img.kpopmap.com" || | |
// https://s.nbst.gr/files/1/2018/03/AP_18064008875527-353x221.jpg | |
domain === "s.nbst.gr" || | |
// https://assets.metrolatam.com/gt/2015/01/14/488408753-200x300.jpg | |
domain === "assets.metrolatam.com" || | |
// https://women.mthai.com/app/uploads/2014/01/rihanna2-100x140.jpg | |
domain_nosub === "mthai.com" || | |
// https://cdn.webnoviny.sk/sites/13/2013/02/cerveny-koberec-55-hudobnych-cien-grammy1-640x897.jpeg | |
domain === "cdn.webnoviny.sk" || | |
// https://bloggar.expressen.se/emmasmode/files/2013/02/2013-GRAMMY-AWARDS-ARRIVALS.JPEG-0AB3E3-835x1022.jpg | |
domain === "bloggar.expressen.se" || | |
// http://img2.saostar.vn/2016/02/16/279989/taylor-swift-grammys-red-carpet-2016-646x1024.jpg | |
(domain_nosub === "saostar.vn" && domain.match(/img[0-9]*\.saostar\.vn/)) || | |
// https://s3.gossipcop.com/up/2018/06/Selena-Gomez-Jennifer-Aniston-Justin-Theroux-533x395.jpg | |
(domain_nosub === "gossipcop.com" && domain.match(/s[0-9]*\.gossipcop\.com/)) || | |
// https://petapixel.com/assets/uploads/2017/01/RT40170-800x534.jpg | |
(domain_nowww === "petapixel.com" && src.indexOf("/uploads/") >= 0) || | |
// https://d3i6fh83elv35t.cloudfront.net/newshour/app/uploads/2017/03/cat-tongue_AdobeStock_70141743-1024x719.jpeg | |
domain === "d3i6fh83elv35t.cloudfront.net" || | |
// https://d17fnq9dkz9hgj.cloudfront.net/uploads/2018/03/Russian-Blue_01-390x203.jpg | |
domain === "d17fnq9dkz9hgj.cloudfront.net" || | |
// https://images.everyeye.it/img-notizie/yakuza-6-emergono-40-minuti-gameplay-v6-272793-350x16.jpg | |
domain === "images.everyeye.it" || | |
// https://koreaboo-cdn.storage.googleapis.com/2016/12/15123352_1467738783241379_1368418332014232741_o-650x867.jpg | |
googlestorage_container === "koreaboo-cdn" || | |
// https://www.behindzscene.net/file/2018/01/%D8%A7%D8%B3%D8%B7%D9%88%D8%B1%D8%A9-440x264.jpg | |
(domain_nowww === "behindzscene.net" && src.indexOf("/file/") >= 0) || | |
// https://www.hipertextual.com/files/2014/12/christopher-nolan-670x410.jpg | |
(domain_nowww === "hipertextual.com" && src.indexOf("/files/") >= 0) || | |
// https://geeksofdoom.com/GoD/img/2015/11/the-bastard-executioner-110-03-530x353.jpg | |
(domain_nowww === "geeksofdoom.com" && src.indexOf("/img/") >= 0) || | |
// http://newsimages.fashionmodeldirectory.com/content/2018/06/july-cover2-392x400.jpg | |
domain === "newsimages.fashionmodeldirectory.com" || | |
// https://akm-img-a-in.tosshub.com/indiatoday/images/story/201804/fLIPKART_FB-88x50.jpeg?7aUorT.AyYkITen3_QwmsIcFMHwg032p | |
domain === "akm-img-a-in.tosshub.com" || | |
// http://img.blogtamsu.vn/2015/12/tae-yeon-hanh-trinh-vit-hoa-thien-nga-blogtamsu291-600x900.jpg | |
domain === "img.blogtamsu.vn" || | |
// https://cdn03.starsdaily.net/starsdaily/uploads/2016/11/%E1%9F%A5%E1%9F%A5-683x1024.jpg | |
(domain_nosub === "starsdaily.net" && domain.match(/cdn[0-9]+\.starsdaily\.net/)) || | |
// https://nextnature.net/app/uploads/2017/02/71HTjrSeI5L-1280x450.jpg | |
// https://nextnature.net/app/uploads/2017/02/71HTjrSeI5L.jpg | |
(domain_nowww === "nextnature.net" && src.indexOf("/uploads/") >= 0) || | |
// https://www.vooks.net/img/2018/06/mosiac-1000x562.jpg | |
(domain_nowww === "vooks.net" && src.indexOf("/img/") >= 0) || | |
// https://i.ido.bi/assets/podcast/2017/12/jenna-ortega-friends-434x650.jpg | |
domain === "i.ido.bi" || | |
// https://cdn.techgyd.com/150-best-Anime-Wallpaper-In-HD-For-Your-Device-65-640x1024.jpg | |
domain === "cdn.techgyd.com" || | |
// https://4girls.co.il/uploads/mediaBank/2017/02/22-gallery_photos-1f4c8c1e-120x80.jpg | |
(domain_nowww === "4girls.co.il" && src.indexOf("/uploads/") >= 0) || | |
// http://gceleb.com/photo/2016/06/Mathematician-Rachel-Riley-768x1152.jpg | |
(domain_nowww === "gceleb.com" && src.indexOf("/photo/") >= 0) || | |
// https://www.seriouseats.com/recipes/images/2015/02/20150216-grilled-tofu-banh-mi-recipe-vegan-12-1500x1125.jpg | |
(domain_nowww === "seriouseats.com" && src.indexOf("/images/") >= 0) || | |
// http://i.epochtimes.com/assets/uploads/2016/11/yangmi-600x400.jpg | |
domain === "i.epochtimes.com" || | |
// https://cdn.thammysen.vn//2017/04/tam-trang-toan-than-bang-sua-chua-va-mat-ong3-300x200.jpg | |
domain === "cdn.thammysen.vn" || | |
// http://d1lofqbqbj927c.cloudfront.net/xtremaGT/2017/12/06190753/camila-500x263.jpg | |
domain === "d1lofqbqbj927c.cloudfront.net" || | |
// http://www.180grados.com.mx/img/2017/05/rs-camila-cabello-ad1dc260-a687-4b5a-8fe3-9fad3800ab7b-560x294.jpg | |
(domain_nowww === "180grados.com.mx" && src.indexOf("/img/") >= 0) || | |
// http://photo.tin8.co/upload/2018/07/06/14663363979018311466336543sumarionormal14838670891530849084-308x201.jpg | |
domain === "photo.tin8.co" || | |
// https://cdn3.whatculture.com/images/2015/04/avengers-end-scene-600x400.jpg | |
(domain_nosub === "whatculture.com" && domain.match(/^cdn[0-9]*\.whatculture\.com/) && src.indexOf("/images/") >= 0) || | |
// http://www.electronicbeats.net/app/uploads/2013/11/baxxter-oehlen-electronic-beats-luci-lux-1240x710.jpg | |
(domain_nowww === "electronicbeats.net" && src.indexOf("/uploads/") >= 0) || | |
// https://media.iconsingapore.com/2018/05/Julianne-Moore-in-Givenchy-750x1125.jpg | |
domain === "media.iconsingapore.com" || | |
// http://p.cosmopolitan.bg/g/e/gettyimages-699742676-74636-636x0.jpg?1504777991774 | |
domain === "p.cosmopolitan.bg" || | |
// https://cache.pakistantoday.com.pk/447464_24204507-230x130.jpg | |
domain === "cache.pakistantoday.com.pk" || | |
// https://media.breitbart.com/media/2017/06/EmiliaClarkeSexismGameOfThrones-640x480.jpg | |
domain === "media.breitbart.com" || | |
// https://s.rozali.com/p/j/e/jesika-alba-34-320293-500x0.jpg | |
domain === "s.rozali.com" || | |
// https://s.sdgcdn.com/7/2018/06/d15ed3e907d41b4e1236d5bd0d14836f768ce800_90f83913e7f20144896634648ea442679d3ed64e_2016_06_29_07_24_12_2412_05e4_optimized-429x600.jpg | |
domain === "s.sdgcdn.com" || | |
// http://ticket.heraldtribune.com/files/2013/08/Victoria-Justice-200x300.jpg | |
(domain === "ticket.heraldtribune.com" && src.indexOf("/files/") >= 0) || | |
// https://blog.hola.com/estilistademodacristinareyes/files/2014/09/elle-08-birthdays-beyonce-xln-xln-200x300.jpg | |
domain === "blog.hola.com" || | |
// http://www.therussiantimes.com/upkeep/uploads/2018/07/00103c8b-800-650x366.jpg | |
(domain_nowww === "therussiantimes.com" && src.indexOf("/uploads/") >= 0) || | |
// http://static.idolator.com/uploads/2010/09/selenagomez-vmas1-500x747.jpg | |
domain === "static.idolator.com" || | |
// http://images.saloona.co.il/commelle/files/2016/03/i3kxpbzo4wr9enzrr18-199x300.jpg | |
domain === "images.saloona.co.il" || | |
// http://bellezaenvena.com/my_uploads/2017/08/miss-dior-eau-de-parfum-450x600.jpg | |
(domain_nowww === "bellezaenvena.com" && src.indexOf("/my_uploads/") >= 0) || | |
// http://c1.thejournal.ie/media/2014/06/samantha-mumba-752x501.jpg | |
(domain_nosub === "thejournal.ie" && src.indexOf("/media/") >= 0) || | |
// http://tvperson.ru/2016/01/jeanne-tripplehorn-006-682x1024.jpg | |
domain_nowww === "tvperson.ru" || | |
// http://iwantpix.com/stuff/female-celebrities/female-celebrities-33-810x1024.jpg | |
domain_nowww === "iwantpix.com" || | |
// http://nudemodelpics.com/girls/2016/12/nelly-show-me-yummy/nelly-amour-angels-nudemodel.pics-01-180x240.jpg | |
domain_nowww === "nudemodelpics.com" || | |
// https://images.chr.bg/uploads/2017/07/Zendaya-Feet-2287006-1108x831.jpg | |
(domain === "images.chr.bg" && src.indexOf("/uploads/") >= 0) || | |
// http://woman.ua/file/images/2014/08/2014081353eb770bdc340-370x515.jpg | |
(domain_nowww === "woman.ua" && src.indexOf("/file/images/") >= 0) || | |
// https://gdsit.cdn-immedia.net/2015/11/Rihanna-4-423x505.jpg | |
domain === "gdsit.cdn-immedia.net" || | |
// http://cseditors.com/g/pho/photoshoot-for-the-new-york-times-style-magazine-october-2015-615x734.jpg | |
domain_nowww === "cseditors.com" || | |
// https://imcdn.org/uploads/2016/02/emma-watson-300x178.gif | |
(domain_nowww === "imcdn.org" && src.indexOf("/uploads/") >= 0) || | |
// http://t.a4vn.com/2009/12/emma-127x92.jpg | |
domain === "t.a4vn.com" || | |
// http://dodskypict.com/D/Emma-Watson-Wallpaper-On-Wallpaper-Hd-8-480x320.jpg | |
domain_nowww === "dodskypict.com" || | |
// https://files.dals.media/mediafiles/wpf/2016/12/15534872_1362015517143304_547806809268682752_n-1024x1024.jpg | |
domain === "files.dals.media" || | |
// https://cdn.crhoy.net/imagenes/2018/08/asia-argento%C2%BA-300x169.jpg | |
domain === "cdn.crhoy.net" || | |
// http://longwallpapers.com/Desktop-Wallpaper/cute-bunny-images-For-Desktop-Wallpaper-230x140.jpg | |
domain_nowww === "longwallpapers.com" || | |
// https://files.greatermedia.com/uploads/sites/53/2018/06/GettyImages-845019148-1-1400x1727.jpg | |
domain === "files.greatermedia.com" || | |
// https://tsundora.com/image/2016/05/re_zero_kara_hajimeru_isekai_seikatsu_181-1024x576.jpg | |
(domain_nowww === "tsundora.com" && src.indexOf("/image/") >= 0) || | |
// https://clips-media-assets2.twitch.tv/vod-290596181-offset-0-preview-260x147.jpg | |
(domain_nosub === "twitch.tv" && domain.match(/^clips-media-assets[0-9]*\./) && src.match(/-preview-[0-9]+x[0-9]+\.[^/.]*$/)) || | |
// https://file.immo.vlan.be/ImageHandler/Image/Wordpress/effeil2-1024x576.jpg | |
(domain === "file.immo.vlan.be" && src.indexOf("/Image/Wordpress/") >= 0) || | |
// https://media.trud.bg/2016/10/26-6-360x540.jpg | |
domain === "media.trud.bg" || | |
// https://rotativo.com.mx/assets//2018/03/rihanna-se-lanza-contra-a-snapchat-696x573.jpg | |
(domain_nowww === "rotativo.com.mx" && src.indexOf("/assets/") >= 0) || | |
// https://www.chfi.com/wp-content/blogs.dir/2/files/Rihanna_Diamonds_World_Tour_2013_Cropped-637x838.png | |
(domain_nowww === "chfi.com" && src.indexOf("/wp-content/") >= 0) || | |
// https://storage.googleapis.com/sin-cdn/2017/12/rihanna-367x215.jpg | |
// https://sin-cdn.storage.googleapis.com/2017/12/rihanna-367x215.jpg | |
googlestorage_container === "sin-cdn" || | |
// https://cdn.appleigeek.com/2018/03/rihanna-644x350.jpg | |
domain === "cdn.appleigeek.com" || | |
// https://media.cnnchile.com/sites/2/2018/06/imagen_principal-9349-740x430.jpg | |
domain === "media.cnnchile.com" || | |
// http://festivalteen.com.br/qsafrcbfds/uploads/2018/08/WhatsApp-Image-2018-08-06-at-14.40.46-252x300.jpeg | |
(domain_nowww === "festivalteen.com.br" && src.indexOf("/uploads/") >= 0) || | |
// https://rhodiesworld.s3.amazonaws.com/uploads/2018/08/bey5-400x483.jpg | |
(amazon_container === "rhodiesworld" && src.indexOf("/uploads/") >= 0) || | |
// https://ntdtv.kr/assets/uploads/2017/11/1-1-10-795x436.jpg | |
(domain_nowww === "ntdtv.kr" && src.indexOf("/assets/") >= 0) || | |
// http://xdn.tf.rs/2015/05/18/Dzenifer-Lopez-1-670x984.jpg | |
domain === "xdn.tf.rs" || | |
// https://static.acg12.com/uploads/2015/07/7cedbaa31f53feaa86fed37fd9fe9da6-320x200.jpg | |
domain === "static.acg12.com" || | |
// https://img.zone5.ru/50/1/0/zone5.ru-hermione-corfield-176882-145x200.jpg | |
domain === "img.zone5.ru" || | |
// https://i2.bssl.es/lacosarosa/2017/12/emiliaclarke-880x495.jpg | |
(domain_nosub === "bssl.es" && domain.match(/^i[0-9]*\./)) || | |
// http://images.virgula.com.br/2017/06/Sofia-Solares-1-387x479.jpg | |
domain === "images.virgula.com.br" || | |
// http://rotana.net/assets/uploads/2017/08/2936489101502703278-406x228.jpg | |
(domain_nowww === "rotana.net" && src.indexOf("/assets/uploads/") >= 0) || | |
// https://elle.unitedinfluencers.org/content/uploads/sites/19/2013/04/c11-621x1024.jpg | |
(domain === "elle.unitedinfluencers.org" && src.indexOf("/content/uploads/") >= 0) || | |
// http://www.notredamedeparis.fr/content/uploads/sites/3/2017/01/Tallon_Paris_ND_January_2013_CF020507-1024x1021.jpg | |
(domain_nowww === "notredamedeparis.fr" && src.indexOf("/content/uploads/") >= 0) || | |
// https://zenska.hudo.com/files/2016/08/c24e131d48b6c478405ad53365ae90fa-409x660.jpg | |
(domain === "zenska.hudo.com" && src.indexOf("/files/") >= 0) || | |
// https://s3.ap-south-1.amazonaws.com/seenitblog/uploads/2016/02/Margot-634x1024.jpg | |
(amazon_container === "seenitblog" && src.indexOf("/uploads/") >= 0) || | |
// https://marieclaire.hu/uploads/2016/10/A-vilag-legkulonlegesebb-gyemantmarkaja-Magyarorszagon-1-680x1024.jpg | |
(domain_nowww === "marieclaire.hu" && src.indexOf("/uploads/") >= 0) || | |
// http://infinitymemories.com/amour/files/2018/05/Margot-Robbie-assiste-%C3%A0-la-90e-Annual-Academy-Awards-au-Hollywood-Highland-Center-683x1024.jpg | |
(domain_nowww === "infinitymemories.com" && src.indexOf("/files/") >= 0) || | |
// https://www.tuxboard.com/photos/2013/12/best-photo-nature-2013-14-640x405.jpg | |
(domain_nowww === "tuxboard.com" && src.indexOf("/photos/") >= 0) || | |
// http://arcdn02.mundotkm.com/2014/08/S11-286x400.jpg | |
(domain_nosub === "mundotkm.com" && domain.match(/^arcdn[0-9]*\./)) || | |
// http://cdn2.game4v.com/2015/09/cosplay-game-322-560x373.jpg | |
(domain_nosub === "game4v.com" && domain.match(/^cdn[0-9]*\./)) || | |
// https://cosplaytime.pl/uploads/2018/06/5297219860-400x600.jpg | |
(domain_nosub === "cosplaytime.pl" && src.indexOf("/uploads/") >= 0) || | |
// http://img.wkorea.com/w/2018/04/style_5ad5567c70116-924x1200.jpg | |
domain === "img.wkorea.com" || | |
// https://i.mdel.net/newfaces/i/2013/09/dd_ak_25-783x1024.jpg | |
(domain === "i.mdel.net" && src.indexOf("/newfaces/i/") >= 0) || | |
// https://media.celebmasta.com/2016/03/real-lindsay-lohan-nude-pics-and-video-scene-41-370x297.jpg | |
domain === "media.celebmasta.com" || | |
// https://media.korea25.com/news/2018/10/0003458151_3267522_I-280x280.jpg | |
// I and U, can't find any difference | |
domain === "media.korea25.com" || | |
// http://sexyfandom.com/images/2018/02/A2-Cosplay-by-Miyuko-1-650x922.jpg | |
(domain_nowww === "sexyfandom.com" && src.indexOf("/images/") >= 0) || | |
// https://i.dmarge.com/2016/06/twothousand-610x424.jpg | |
domain === "i.dmarge.com" || | |
// http://assets.boundingintocomics.com/content/uploads/2018/05/Korg-Thor-Ragnarok-750x400.jpg | |
domain === "assets.boundingintocomics.com" || | |
// https://media.profootballfocus.com/2018/10/DENZEL-1024x581.jpg | |
domain === "media.profootballfocus.com" || | |
// http://www.redu.pl/img/2012/08/539863_391053194270196_1915005508_n-600x425.jpg | |
(domain_nowww === "redu.pl" && src.indexOf("/img/") >= 0) || | |
// https://multifiles.pressherald.com/uploads/sites/4/2018/10/1590594_931934-20180930_112727-1024-1024x556.jpg | |
(domain === "multifiles.pressherald.com" && src.indexOf("/uploads/") >= 0) || | |
// http://img.time2draw.com/2015/02/Learn-to-Draw-Anime-Natsu-Fairy-Tail-Drawing-final-step-215x382.png | |
domain === "img.time2draw.com" || | |
//http://ffw.uol.com.br/app/uploads/desfiles/2013/02/desfile-dvf-ny-inv2014-331-150x224.jpg | |
(domain === "ffw.uol.com.br" && src.indexOf("/app/uploads/") >= 0) || | |
// http://images.harianjogja.com/2014/09/Taeyeon-SNSD-Soompi.com_-370x219.jpg | |
domain === "images.harianjogja.com" || | |
// http://images.hamodia.com/hamod-uploads/2017/09/08134636/2017-09-08T172110Z_338724345_RC1482A3A370_RTRMADP_3_STORM-IRMA-1024x854.jpg | |
domain === "images.hamodia.com" || | |
// https://www.bz-berlin.de/data/uploads/multimedia/archive/00071/Megan_Fox2_71614a-450x432.jpg | |
(domain_nowww === "bz-berlin.de" && src.indexOf("/data/uploads/multimedia/") >= 0) || | |
// https://luxury-inside.vn/data/uploads/2019/05/Alan-Turing-3-1440x809.jpg | |
(domain_nowww === "luxury-inside.vn" && src.match(/\/data\/+uploads\//)) || | |
// http://worldcupgirls.net/girls-pics/hottest-girls-fans-world-cup-2014_41-korean-530x353.jpg | |
domain_nowww === "worldcupgirls.net" || | |
// https://cdn1-www.playstationlifestyle.net/assets/uploads/2018/07/gta6hack-555x423.jpg | |
(domain_nosub === "playstationlifestyle.net" && domain.match(/^cdn[0-9]*-www\./) && src.indexOf("/assets/uploads/") >= 0) || | |
// https://assets.cdn.moviepilot.de/files/0cb261dba5f21fe5e69afaaa61896d3d81ec1f9b24b173f3f504d0bf068c/IronThroneReal-610x885.jpg | |
domain === "assets.cdn.moviepilot.de" || | |
// http://image2.aving.net/2018/12/26/201812261637237790-120x80.jpg | |
(domain_nosub === "aving.net" && domain.match(/^image[0-9]*\./)) || | |
// https://ss-images.catscdn.vn/2016/07/01/591387/Sao-n%E1%BB%AF-%E1%BB%9F-Hollywood-3-290x393.jpg | |
domain === "ss-images.catscdn.vn" || | |
// https://blogs.gnome.org/chergert/files/2019/01/new-workspace-768x432.png | |
(domain === "blogs.gnome.org" && src.indexOf("/files/") >= 0) || | |
// https://cdn01.zoomit.ir/2018/12/93350cef-0eed-44a5-8bef-b3b08947b98f-400x267.jpg | |
(domain_nosub === "zoomit.ir" && domain.match(/^cdn[0-9]*\./)) || | |
// https://img.myfirstshow.com/uploads/2018/06/Super-hot-Amy-jackson-at-the-2018-Life-Ball-4-362x450.jpg | |
domain === "img.myfirstshow.com" || | |
// https://cdn3-www.musicfeeds.com.au/assets/uploads/justin-bieber-2016-press-pic-supplied-671x377.jpg | |
(domain_nosub === "musicfeeds.com.au" && domain.match(/^cdn[0-9]*/) && src.indexOf("/assets/uploads/")) || | |
// https://d13vpcwfpcq1p8.cloudfront.net/contents/official/sites/887/2019/02/x20190219000550684_20190219-000548-image-300x300.jpg | |
(domain === "d13vpcwfpcq1p8.cloudfront.net" && src.indexOf("/contents/") >= 0) || | |
// https://media3.paperblog.fr/i/582/5820009/critique-colombiana-L-WlVd2S-175x130.jpeg | |
(domain_nosub === "paperblog.fr" && domain.match(/^media[0-9]*\./)) || | |
// https://m52.paperblog.com/i/77/774024/barbara-palvin-for-zoltan-tombor-in-marie-cla-L-ztr8o_-175x130.jpeg | |
(domain_nosub === "paperblog.com" && domain.match(/^m[0-9]*\./)) || | |
// http://bikini.sbgefree.org/files/2018/11/sexy-bikini-models-image328-150x150.jpg | |
(domain === "bikini.sbgefree.org" && src.indexOf("/files/") >= 0) || | |
// http://redbust.com/stuff/kloe-kane-in-jeans-mini-skirt/kloe-redhead-jeans-miniskirt-pussy-twistys-02-800x534.jpg | |
(domain_nowww === "redbust.com" && src.indexOf("/stuff/") >= 0) || | |
// https://img.providr.com/AS13-297x300.png | |
domain === "img.providr.com" || | |
// https://static.hiphopdx.com/2018/09/180924-cardi-b-getty-800x600.jpg | |
domain === "static.hiphopdx.com" || | |
// https://queerty-prodweb.s3.amazonaws.com/2019/02/ariana-grande-break-up-girlfriend-670x456.jpg | |
amazon_container === "queerty-prodweb" || | |
// https://static.timesofisrael.com/njjewishnews/uploads/2018/09/JohnnyCash-640x400.jpg | |
domain === "static.timesofisrael.com" || | |
// https://hairstylesweekly.com/images/2013/01/Cute-Korean-Mushroom-Haircut-with-Bangs-150x150.jpg | |
(domain_nowww === "hairstylesweekly.com" && src.indexOf("/images/") >= 0) || | |
// https://www.famousbirthsdeaths.com/fbd-uploads/2015/10/is-felicity-jones-dead-or-alive-150x150.jpg | |
(domain_nowww === "famousbirthsdeaths.com" && src.indexOf("/fbd-uploads/") >= 0) || | |
// https://img.leaksx.com/2017/12/Melanie-Inglesias-Leaked-Pictures-21-150x150.jpg | |
domain === "img.leaksx.com" || | |
// https://www.top10films.co.uk/img/felicity-jones-bifa-2018-150x150.jpg | |
(domain_nowww === "top10films.co.uk" && src.indexOf("/img/") >= 0) || | |
// https://www.hotel-aramis.com/inc/uploads/sites/8/2016/03/cathedrale_notre-dame_de_paris-461x400.jpg | |
domain_nowww === "hotel-aramis.com" || | |
// https://dvfmubv4tjrqd.cloudfront.net/uploads/2018/04/25122626/NDDP_Coliseum_2000x1000px_v24-800x400.jpg | |
(domain === "dvfmubv4tjrqd.cloudfront.net" && src.indexOf("/uploads/") >= 0) || | |
// https://s3-ap-southeast-2.amazonaws.com/assets.whatson.cityofsydney.nsw.gov.au/2016/07/SabrinaCarpenter-sideview-493x480.jpg | |
amazon_container === "assets.whatson.cityofsydney.nsw.gov.au" || | |
// http://static.hasselblad.com/2017/04/HH_7-792x1000.jpg | |
domain === "static.hasselblad.com" || | |
// https://saywho.fr/app/uploads/2018/06/NinaRicci00880-768x1151.jpg | |
(domain_nowww === "saywho.fr" && src.indexOf("/app/uploads/") >= 0) || | |
// https://talentandpartner.com/data/uploads/2016/12/1216-MX-FT_CoverStoryBarbaraPalvin-2-497x600.jpg | |
(domain_nowww === "talentandpartner.com" && src.indexOf("/data/uploads/") >= 0) || | |
// http://files.vividscreen.info/soft/b19df99ca381f5439ee6ae9e9c69663c/Cute-Anime-Girl-With-Snowman-128x128.jpg | |
domain === "files.vividscreen.info" || | |
// https://s3.amazonaws.com/lilianpacce/media/2013/10/291013-little-black-jacket-29-400x600.jpg | |
(amazon_container === "lilianpacce" && src.indexOf("/media/") >= 0) || | |
// http://chl-network.s3.amazonaws.com/uploads/chl/2019/04/15130734/ByramFinalRankingsEN-1024x600.jpg | |
(amazon_container === "chl-network" && src.indexOf("/uploads/") >= 0) || | |
// https://www.starkbros.com/images/dynamic/4877-200x200.jpg | |
(domain_nowww === "starkbros.com" && src.indexOf("/images/dynamic/") >= 0) || | |
// https://m.actve.net/evropa2/image/2017/02/2-7-140x208.jpg | |
// https://m.actve.net/koule2017/70067/motiv-640x427.jpg | |
domain === "m.actve.net" || | |
// http://d279m997dpfwgl.cloudfront.net/wp/2013/10/IMG_9694-1000x666.jpg | |
(domain === "d279m997dpfwgl.cloudfront.net" && src.indexOf("/wp/") >= 0) || | |
// https://telegraf.com.ua/files/2016/04/EJE_wM3kipw-188x118.jpg | |
// https://telegraf.com.ua/files/2016/04/EJE_wM3kipw.jpg | |
(domain_nowww === "telegraf.com.ua" && src.indexOf("/files/") >= 0) || | |
// http://media.womanista.com/2017/02/selena-gomez-bikini-body-56680-57265-1280x0.png | |
domain === "media.womanista.com" || | |
// https://jenny.gr/storage/photos/master/201607/13414121_1137258113004232_916616221_n-577x720.jpg | |
(domain_nowww === "jenny.gr" && src.indexOf("/storage/photos/") >= 0) || | |
// https://static.infomusic.ro/media/2017/09/selena-gomez-800x533.jpg | |
(domain === "static.infomusic.ro" && src.indexOf("/media/") >= 0) || | |
// https://www.csiete.net/contenido/imagenes/2018/07/Selena-Gomez-2016-237x143.jpg | |
(domain_nowww === "csiete.net" && src.indexOf("/contenido/imagenes/") >= 0) || | |
// https://wallpaper4rest.com/water/wallpaper/amazing-photography-arts-style-yellow-leaf-rain_1-1-237x134.jpg | |
(domain_nowww === "wallpaper4rest.com" && src.indexOf("/wallpaper/") >= 0) || | |
// https://ichip.ru/blobimgs/uploads/2018/10/IMG_7900-696x464.jpg | |
(domain_nowww === "ichip.ru" && src.indexOf("/blobimgs/uploads/") >= 0) || | |
// http://pophaircuts.com/images/2013/11/Selena-Gomez-Hairstyles-Blond-Highlights-138x180.jpg | |
(domain_nowww === "pophaircuts.com" && src.indexOf("/images/") >= 0) || | |
// http://she12.com/uploads/2012/07/Emma-Stone-Cover-Shoots-For-VOGUE-Mag-9-150x150.jpg | |
(domain_nowww === "she12.com" && src.indexOf("/uploads/") >= 0) || | |
// http://cdn.stylefrizz.com/img/Emma-Stone-2012-SAG-Awards-black-dress-150x150.jpg | |
(domain === "cdn.stylefrizz.com" && src.indexOf("/img/") >= 0) || | |
// http://cdn5.windows7themes.net/wp-content/files/rachel-mcadams-1-150x150.jpg | |
(domain_nosub === "windows7themes.net" && src.indexOf("/wp-content/files/") >= 0) || | |
// http://quotes.whyfame.com/files/2010/01/zoe_saldana-150x150.jpg | |
(domain === "quotes.whyfame.com" && src.indexOf("/files/") >= 0) || | |
// https://hacks.mozilla.org/files/2019/05/Worker-Threads-Panel-500x301.png | |
(domain_nosub === "mozilla.org" && src.match(/:\/\/[^/]*\/files\/+[0-9]{4}\/+[0-9]{2}\/+/)) || | |
// https://s3.amazonaws.com/pas-wordpress-media/content/uploads/2014/08/Robin-Williams-featured-e1407947796569-653x339.jpg | |
(amazon_container === "pas-wordpress-media" && src.indexOf("/uploads/") >= 0) || | |
// https://news.artnet.com/app/news-upload/2018/05/4_636613246135627500954662_53_METBALL_050718_SZ_010-1024x684.jpg | |
(domain === "news.artnet.com" && src.indexOf("/news-upload/") >= 0) || | |
// https://edmhunters-563e.kxcdn.com/mediafiles/song/images/199733-165x165.jpg | |
(domain === "edmhunters-563e.kxcdn.com" && src.indexOf("/mediafiles/") >= 0) || | |
// https://s3.amazonaws.com/bkt-respaldomtonline/uploads/2016/05/mikaela-banes-transformers-71359_1920_1278-megan-fox-returning-for-transformers-5-not-exactly-jpeg-136469-600x399.jpg | |
(amazon_container === "bkt-respaldomtonline" && src.indexOf("/uploads/") >= 0) || | |
// http://img.emao.net/news/w/nc/bca/ljfk-640x427.jpg | |
domain === "img.emao.net" || | |
// http://p.potv.bg/t/r/transfrevenge-still-19613v01-29870-625x0.jpg?1471529675894 | |
domain === "p.potv.bg" || | |
// http://media.yadbegir.com/yadmedia/2018/02/ema-180x120.jpg | |
domain === "media.yadbegir.com" || | |
// https://digitalb.vo.llnwd.net/triplemedia/site/uploads/55a674b1fff2c16856a6bd9e_emma-stone-aloha-miscast-1-560x416.jpg | |
(domain_nosub === "llnwd.net" && src.match(/\/site\/+uploads\/+/)) || | |
// http://cinemio.it/wp-content/upload/images125-300x168.jpg | |
(domain_nowww === "cinemio.it" && src.indexOf("/upload/") >= 0) || | |
// https://www.flavourmag.co.uk/files/2016/11/DF-07670R_rgb-300x194.jpg | |
(domain_nowww === "flavourmag.co.uk" && src.indexOf("/files/") >= 0) || | |
// https://img.ananweb.jp/2017/04/DF-07670R-768x513.jpg | |
domain === "img.ananweb.jp" || | |
// https://filmz.dk/files/gfx/6/67397-h668xw1000-edge-of-seventeen-4-filmz-1000x668.jpg | |
(domain_nowww === "filmz.dk" && src.indexOf("/files/") >= 0) || | |
// http://mit24h.com/g/2/ha/hailee-steinfeld-is-so-cool-she-gets-girls-and-fights-for-girl-kai-clean-tove-lo-mp3-free-download-habits-ideas-meaning-ytmp3-conversion-them-lady-860x1075.jpg | |
domain_nowww === "mit24h.com" || | |
// https://dimwhp0w2rs83.cloudfront.net/2017/11/1510667327-hailee-steinfeld-700x463.jpg | |
domain === "dimwhp0w2rs83.cloudfront.net" || | |
// http://cdn.macrumors.com/article-new/2018/05/haileesteinfeld-800x450.jpg | |
(domain === "cdn.macrumors.com" && src.indexOf("/article-new/") >= 0) || | |
// https://cam4-images.xcdnpro.com/7fd7d8cc-cdc2-4d37-af65-3b35e30d1a83-400x300.jpg -- upscaled | |
(domain_nosub === "xcdnpro.com" && domain.match(/images\./)) || | |
// https://www.lifezette.com/files/2017/03/Zac_Efron_Cannes_2012-851x1200.jpg | |
(domain_nowww === "lifezette.com" && src.indexOf("/files/") >= 0) || | |
// https://cdn.junglecreations.com/wp/junglecms/2019/04/34912930-zac-efron-as-ted-bundy-featured-image-1-200x106.jpg | |
(domain === "cdn.junglecreations.com" && src.indexOf("/wp/") >= 0) || | |
// http://rip-youth.jp/images/itsuki2-400x533.png | |
(domain_nowww === "rip-youth.jp" && src.indexOf("/images/") >= 0) || | |
// https://www.asian-sirens.net/uploads/2019/05/22280887_530817700592929_7113082934487154688_n1-500x500.jpg | |
(domain_nowww === "asian-sirens.net" && src.indexOf("/uploads/") >= 0) || | |
// https://cdn2-www.comingsoon.net/assets/uploads/2019/05/game-of-thrones-season-8-episode-6-daenerys-throne-face-225x150.jpg | |
(domain_nosub === "comingsoon.net" && src.match(/\/assets\/+uploads\//)) || | |
// https://cdn.zoomg.ir/2019/5/84b8175d-c88f-4287-9025-00e54d614b31-400x267.jpg | |
domain === "cdn.zoomg.ir" || | |
// https://wikiofthrones.com/static/uploads/2019/05/Emilia-Clarke-tells-parents-who-named-their-daughters-Khaleesi-not-to-worry-900x600.jpg | |
(domain_nowww === "wikiofthrones.com" && src.match(/\/static\/+uploads\//)) || | |
// https://files.theblemish.com/images/2014/06/kate-upton-body-paint-640x853.jpg | |
(domain === "files.theblemish.com" && src.indexOf("/images/") >= 0) || | |
// http://i2.esmas.com/galerias/fotos/2016/08/30/screams_960d5e11_acaf_b76f_82c9_a2e0d581e47b-468x624.jpg | |
// http://i2.esmas.com/editorial-televisa/2012/07/04/392000/vanessa-hudgens-290x474.jpg | |
(domain_nosub === "esmas.com" && domain.match(/^i[0-9]*\./)) || | |
// http://www.mortalfm.es/archivos/2015/04/artworks-000108247651-2kw5xk-t500x500-390x390.jpg | |
(domain_nowww === "mortalfm.es" && src.indexOf("/archivos/") >= 0) || | |
// https://d2yoo3qu6vrk5d.cloudfront.net/images/20171115152738/nicki-minaj2-482x320.jpg?itok=1510782120 | |
(domain === "d2yoo3qu6vrk5d.cloudfront.net" && src.indexOf("/images/") >= 0) || | |
// https://courrier.jp/media/2017/11/10041739/s_GettyImages-459754376-625x446.jpg | |
(domain_nowww === "courrier.jp" && src.indexOf("/media/") >= 0) || | |
// https://dieta.pourfemme.it/img/2010/07/dieta-vegana-8-420x260.jpg | |
(domain === "dieta.pourfemme.it" && src.indexOf("/img/") >= 0) || | |
// https://static.atmag.co.il/www/uploads/2017/02/GettyImages-634329518_h-2000x1125.jpg | |
(domain === "static.atmag.co.il" && src.indexOf("/uploads/") >= 0) || | |
// https://xtra.works/app/uploads/sites/2/2018/11/download-300x124.png | |
(domain_nowww === "xtra.works" && src.indexOf("/uploads/") >= 0) || | |
// https://www.myce.com/wp-content/images_posts/2017/07/adobe_logo-670x278.png | |
(domain_nowww === "myce.com" && src.indexOf("/images_posts/") >= 0) || | |
// https://www.unison.org.uk/content/uploads/2018/02/iceberg-tip-of1000x563-745x420.jpg | |
(domain_nowww === "unison.org.uk" && src.indexOf("/content/uploads/") >= 0) || | |
// https://www.businessinsider.fr/content/uploads/2016/11/icerberg-800x400.jpg | |
(domain_nowww === "businessinsider.fr" && src.indexOf("/content/uploads/") >= 0) || | |
// https://sfo2.digitaloceanspaces.com/btrtoday/uploads/20190611114017/ft.Cyberpunk2077-620x349.jpg | |
(domain === "sfo2.digitaloceanspaces.com" && src.indexOf("/uploads/") >= 0) || | |
// https://m8q3v4v6.stackpathcdn.com/2019/06/cf579a94-keanurevees-e3-min-1260x709.jpg | |
domain === "m8q3v4v6.stackpathcdn.com" || | |
// https://www.linda.nl/lindanl-assets/uploads/2018/10/19212659/Schermafbeelding-2015-02-23-om-10.55.31-600x803.png | |
(domain_nowww === "linda.nl" && src.indexOf("/uploads/") >= 0) || | |
// https://ww1.sites-telechargement.com/affiche/0842353-360x490.jpg | |
(domain === "ww1.sites-telechargement.com" && src.indexOf("/affiche/") >= 0) || | |
// https://d3n2u7gfnpd084.cloudfront.net/film/5b/23/6c/d3/38ff9109733f6aa8/5b236cd338ff9109733f6aa8-400x545.jpg?etag=684116adfdeae65ad86d1ab5618b9b26 | |
(domain === "d3n2u7gfnpd084.cloudfront.net" && src.match(/\/(?:[0-9a-f]{2}\/+){4}/)) || | |
// http://www.journal-farandole.com//content/uploads/2018/07/ANT-MAN-et-LA-GUEPE-624x850.jpeg | |
(domain_nowww === "journal-farandole.com" && src.match(/\/content\/+uploads\/+/)) || | |
// http://www.dpstreaming.live/upload/2018/07/0842353-752x1024.jpg | |
(domain_nowww === "dpstreaming.live" && src.indexOf("/upload/") >= 0) || | |
// http://cdn.videos.rollcall.com/hoh/Perabo-Getty-4912210451200x1700-238x330.jpg | |
domain === "cdn.videos.rollcall.com" || | |
// https://www.rawkblog.com/content/uploads/2019/05/carly-rae-jepsen-768x512.jpg | |
(domain_nowww === "rawkblog.com" && src.indexOf("/uploads/") >= 0) || | |
// https://cdn.stereo.vn/uploads/2015/08/carly-rae-jepsen-press-2015-billboard-650-770x462.jpg | |
(domain === "cdn.stereo.vn" && src.indexOf("/uploads/") >= 0) || | |
// http://dailybruin.com/images/2019/01/DSC_2847a-300x200.jpg | |
(domain_nowww === "dailybruin.com" && src.indexOf("/images/") >= 0) || | |
// http://razorpics.net/rachel-mcadams/HollywoodAwards-07-[Ravens_Young_Stars]%20Rachel%20Mcadams%203-150x150.jpg | |
domain_nowww === "razorpics.net" || | |
// https://www.1in.am/assets/uploads/2019/01/02-56-540x360.jpg | |
(domain_nowww === "1in.am" && src.indexOf("/assets/") >= 0) || | |
// https://cdn.entertainmentfuse.com/media/2016/06/funny-load-screen-MEC-800x450.png | |
(domain === "cdn.entertainmentfuse.com" && src.indexOf("/media/") >= 0) || | |
// https://www.n3rdabl3.com/wp-content/images/uploads/2015/04/FPS_Enix_DeusEX-720x423-720x423.jpg | |
(domain_nowww === "n3rdabl3.com" && /\/wp-content\/+images\/+uploads\/+/.test(src)) || | |
// https://kizsalsorunlar.com/k/uploads/2012/11/victorias-secret-2012-defile-19-160x239.jpg?x15615 | |
(domain_nowww === "kizsalsorunlar.com" && src.indexOf("/uploads/") >= 0) || | |
// https://neskaties.lv/2016/09/foto-parizes-modes-nedela-modeles-staiga-ar-kailiem-krutsgaliem-57eb682d1db29-672x1010.jpg | |
domain_nowww === "neskaties.lv" || | |
// https://img.eroero-gazou.net/images/2019/07/62471a0b7b42478eb16a1321e8799189-300x200.jpg | |
domain === "img.eroero-gazou.net" || | |
// https://media.sistemampa.com.br/2019/02/Camila-Cabello-Net-Worth-300x160.jpg | |
domain === "media.sistemampa.com.br" || | |
// https://img1.looper.com/img/uploads/2017/04/why-hollywood-won_t-cast-jessica-alba-anymore-780x438.jpg | |
(domain_nosub === "looper.com" && /^img[0-9]*\./.test(domain) && src.indexOf("/uploads/") >= 0) || | |
// https://i0.dtslb.com//2019/02/m8sCa24YbFIatKlElTMdiH18A5N-185x278.jpg | |
(domain_nosub === "dtslb.com" && /^i[0-9]*\./.test(domain)) || | |
// https://static.otvfoco.com.br/2019/08/rihanna-donald-trump-tweet-gun-control-130x86.jpg | |
domain === "static.otvfoco.com.br" || | |
// https://static2.diariouno.com.ar/media/2019/03/1543247666-rihanna-hermosa-y-talentosa-estrella-mundial-del-pop-y-del-universo-entero-416x234.jpg | |
(domain_nosub === "diariouno.com.ar" && /^static[0-9]*\./.test(domain) && src.indexOf("/media/") >= 0) || | |
// https://static-cdn.jtvnw.net/s3_vods/leansquad_/140652046/c72d3b49-5401-4df4-b22b-c8798f9cd2fc/thumb/custom0c0a29f5448f07b3-320x180.jpeg | |
(domain === "static-cdn.jtvnw.net" && src.indexOf("/s3_vods/") >= 0) || | |
// https://thugarmada.com/ta-files/2018/10/ayumi-hamasaki-japanese-trance-j-277x156.jpg | |
(domain_nowww === "thugarmada.com" && src.indexOf("/ta-files/") >= 0) || | |
// https://flipwallpapers.com/wallpapers/cute-anime-hd-desktop-wallpaper-For-desktop-Wallpaper-200x113.jpg | |
(domain_nowww === "flipwallpapers.com" && src.indexOf("/wallpapers/") >= 0) || | |
// http://hanamaru-photo.com/common/images/2019/08/EA62qgAU0AEXbDT-200x300.jpg | |
(domain_nowww === "hanamaru-photo.com" && /\/common\/+images\//.test(src)) || | |
// http://p.elle.bg/s/a/saweetie-and-quavo-of-migos-attend-the-2019-billboard-music-news-photo-1146346699-1556753469-123056-680x0.jpg | |
domain === "p.elle.bg" || | |
// https://illustrationwest.org/53/files/2014/10/Mayer_Bill_A_1-180x180.jpg | |
(domain_nowww === "illustrationwest.org" && src.indexOf("/files/") >= 0) || | |
// https://www.myjane.ru/data/cache/2018feb/14/28/773144_49860-250x0.jpg | |
(domain_nowww === "myjane.ru" && /\/data\/+cache\//.test(src)) || | |
// http://www.chickradar.net/content/uploads/2013/05/Barbara-Palvin-8-150x150.png | |
(domain_nowww === "chickradar.net" && /\/content\/+uploads\//.test(src)) || | |
// http://www.creepmachine.com/images/2012/07/yolandi_visser_soeymilk-610x765-520x400.jpg | |
(domain_nowww === "creepmachine.com" && src.indexOf("/images/") >= 0) || | |
// https://theinspirationgrid.com/app/uploads/2019/03/photography-neon-flowers-06-768x1023.jpg | |
(domain_nowww === "theinspirationgrid.com" && /\/app\/+uploads\//.test(src)) || | |
// https://static-koimoi.akamaized.net/wp-content/new-galleries/2013/05/Preity-Zinta-promotes-Ishkq-In-Paris-Pic-3-195x300.jpg | |
(domain === "static-koimoi.akamaized.net" && src.indexOf("/new-galleries/") >= 0) || | |
// https://img1.elperiodico.com/15/34/f6/keanu-reeves-465x310.jpg | |
(domain_nosub === "elperiodico.com" && /^img[0-9]*\./.test(domain)) || | |
// https://gsud.cdn-immedia.net/2019/08/MEGHAN-MARKLE-2-296x505.jpg | |
domain_nosub === "cdn-immedia.net" || | |
// https://mmglobalmovies.com/wp-content/upload_folders/mmglobalmovies.com/2019/04/MMGlobalMovies-Zoe-L%C3%A9a-Seydoux-214x317.jpg?v=1554664150250 | |
(domain_nowww === "mmglobalmovies.com" && /\/wp-content\/+upload_folders\//.test(src)) || | |
// https://images.in.com/uploads/2018/01/7746509462_deffbcb546_b-768x976.jpg | |
(domain === "images.in.com" && src.indexOf("/uploads/") >= 0) || | |
// https://staticuestudio.blob.core.windows.net/buhomag/2016/02/16170844/GettyImages-510506276-1000x793.jpg | |
domain === "staticuestudio.blob.core.windows.net" || | |
// https://cdn.imvges.com/hMJjQo2S-160x160.jpg | |
domain === "cdn.imvges.com" || | |
// http://media.pamper.my/2015/11/PAP-PE16-12-312x420.jpg | |
domain === "media.pamper.my" || | |
// https://www.rnbjunk.com/foto/2016/08/2016-vmas-hailee-steinfeld-300x450.jpg | |
(domain_nowww === "rnbjunk.com" && src.indexOf("/foto/") >= 0) || | |
// https://cdn.xpicsxx.com/uploads/2019/10/17151356/ahri-cosplay-364x485.jpg | |
(domain === "cdn.xpicsxx.com" && src.indexOf("/uploads/") >= 0) || | |
// https://zokatv.net//media/movies/2018/11/image_5a81a2557cb187f555946504aa8130f8-300x444.jpg | |
(domain_nowww === "zokatv.net" && src.indexOf("/media/") >= 0) || | |
// https://magazin.lufthansa.com/content/uploads/2018/07/Skytalk_Alicia_Vikander_Slider_LHM_08_2018-980x551.jpg | |
// https://magazin.lufthansa.com/content/uploads/2018/07/Skytalk_Alicia_Vikander_Slider_LHM_08_2018.jpg | |
(domain_nowww === "magazin.lufthansa.com" && /\/content\/+uploads\//.test(src)) || | |
// https://www.nexofin.com/archivos/2016/05/alicia-vikander-7-360x216.jpg | |
(domain_nowww === "nexofin.com" && src.indexOf("/archivos/") >= 0) || | |
// https://gallery.southindianactress.in/2019/11/priya-singh-photos-q9-fashion-studio-launch-21-720x411.jpg | |
// https://gallery.southindianactress.in/2019/11/priya-singh-photos-q9-fashion-studio-launch-21.jpg | |
domain === "gallery.southindianactress.in" || | |
// https://ffp4g1ylyit3jdyti1hqcvtb-wpengine.netdna-ssl.com/addons/files/2019/10/bj-160x160.jpg | |
(domain === "ffp4g1ylyit3jdyti1hqcvtb-wpengine.netdna-ssl.com" && /\/addons\/+files\//.test(src)) || | |
// https://medinaa.archolda.com/ime/a3d78b74fb613f5f-120x86.jpg | |
(domain === "medinaa.archolda.com" && src.indexOf("/ime/") >= 0) || | |
// https://londonsvenskar.com/kultur/files/2018/10/van-gogh-654x441.jpg | |
(domain_nowww === "londonsvenskar.com" && src.indexOf("/files/") >= 0) || | |
// https://ia.eferrit.com/ia/a3d78b74fb613f5f-1024x682.jpg -- upscaled (nearest)? | |
(domain === "ia.eferrit.com" && src.indexOf("/ia/") >= 0) || | |
// https://dokkaebi.tv/file/2017/05/60JODGfbtIIZ0FqE8SfLSs1QfHb-185x278.jpg | |
(domain_nowww === "dokkaebi.tv" && src.indexOf("/file/") >= 0) || | |
// https://1.soompi.io/wp-content/blogs.dir/8/files/2015/09/HA-TFELT-Wonder-Girls-590x730.jpg -- doesn't work | |
// https://cdn0.tnwcdn.com/wp-content/blogs.dir/1/files/2018/01/GTA-6-Female-Protag-796x417.jpg -- does work | |
/^[a-z]+:\/\/[^?]*\/wp(?:-content\/+(?:uploads|images|photos|blogs.dir)|\/+uploads)\//.test(src) | |
//src.indexOf("/wp-content/blogs.dir/") >= 0 || | |
// https://d13ezvd6yrslxm.cloudfront.net/wp/wp-content/images/x-men-apocalypse-700x300.jpg | |
//src.indexOf("/wp/wp-content/images/") >= 0 || | |
// http://ljshopch.com/wp-content/photos/2017/12/e6c61489857f770f1738b9a5b8702671-250x150.jpg | |
//src.indexOf("/wp-content/photos/") >= 0 || | |
// https://cdn.gamerant.com/wp-content/uploads/resident-evil-2-director-remake-faith-738x410.jpg.webp | |
// https://cdn.gamerant.com/wp-content/uploads/resident-evil-2-director-remake-faith.jpg.webp | |
//src.indexOf("/wp-content/uploads/") >= 0 || | |
/*src.indexOf("/wp/uploads/") >= 0*/ | |
) { | |
// http://arissa-x.com/miss-x-channel/wp-content/uploads/2017/06/IMG_0005.jpg | |
src = src.replace(/-[0-9]+x[0-9]+\.([^/]*(?:[?#].*)?)$/, ".$1"); | |
} | |
if ((domain === "store.pinseyun.com" && src.indexOf("/uploads/") >= 0) || | |
// https://media.coindesk.com/uploads/2018/07/shutterstock_703755544-860x430.jpg | |
(domain === "media.coindesk.com" && src.indexOf("/uploads/") >= 0)) { | |
// http://store.pinseyun.com/uploads/2016/10/20161021222440-150x150.jpg | |
// http://store.pinseyun.com/uploads/2016/06/201605work-94-150x150.jpg | |
return { | |
url: src.replace(/-[0-9]*x[0-9]*\.([^/.]*)$/, ".$1"), | |
can_head: false | |
}; | |
} | |
if (domain === "cdn.fashionmagazine.com") { | |
// https://cdn.fashionmagazine.com/wp-content/uploads/2018/04/CULaubrey_01_0518-480x600-c-top.jpg | |
// https://cdn.fashionmagazine.com/wp-content/uploads/2018/04/CULaubrey_01_0518.jpg | |
return src.replace(/(\/+wp-content\/+uploads\/+[0-9]{4}\/+[0-9]{2}\/+[^/]*)-[0-9]+x[0-9]+-c-[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2"); | |
} | |
// https://cdn.heatworld.com/one/lifestyle-legacy/fc/e7794/f8a77/be88e/964ad/02b2a/6e7bd/claude-littner_940x526.jpg | |
// https://cdn.heatworld.com/one/lifestyle-legacy/fc/e7794/f8a77/be88e/964ad/02b2a/6e7bd/claude-littner.jpg | |
if (domain === "cdn.heatworld.com" || | |
// http://www.sohobluesgallery.com/mm5/graphics/00000001/Rolling_Stones_Keith_Richards_Guitar_God_475x705.jpg | |
// http://www.sohobluesgallery.com/mm5/graphics/00000001/Rolling_Stones_Keith_Richards_Guitar_God.jpg | |
domain_nowww === "sohobluesgallery.com" || | |
// https://i.vimeocdn.com/video/530332183_780x439.jpg | |
domain === "i.vimeocdn.com" || | |
// https://media.indiatimes.in/media/content/2018/Feb/arun_jaitley_allocates_rs_1200_crore_to_promote_bamboo_cultivation_1517487222_100x150.jpg | |
domain === "media.indiatimes.in" || | |
// https://www.bangkokpost.com/media/content/20180126/c1_1401970_180126042828_620x413.jpg | |
// https://bangkokpost.com/media/content/20180126/c1_1401970_180126042828_620x413.jpg | |
domain_nowww === "bangkokpost.com" || | |
// https://media2.mensxp.com/media/content/2018/Feb/congress-takes-digs-at-bjp-and-pm-modi-with-a-valentines-day-video-1400x653-1518681640_401x187.jpg | |
//(domain_nosub === "mensxp.com" && domain.match(/media[0-9]*\.mensxp\.com/)) || | |
// http://media.new.mensxp.com/media/photogallery/2014/Nov/zoesaldana6_1415100628_100x50.jpg | |
// https://media1.mensxp.com/media/photogallery/2014/Nov/zoesaldana2_1415100585_100x50.jpg | |
(domain_nosub === "mensxp.com" && domain.match(/media[0-9]*\./) && src.indexOf("/media/") >= 0) || | |
// http://221.132.38.109/nvdata/uploads/thumbnail/2017/12/01/baogiohetbatlucnhintremamnonbibaohanh_20171201151535_220x124.jpg | |
domain === "221.132.38.109" || | |
// http://www.jpcoast.com/img/201403/21_DSC_1247_600x400.jpg | |
// http://jpcoast.com/img/201403/21_DSC_1247_600x400.jpg | |
(domain_nowww === "jpcoast.com" && src.indexOf("/img/") >= 0) || | |
// https://pics.prcm.jp/908a8687073fe/66459731/jpeg/66459731_220x241.jpeg | |
domain === "pics.prcm.jp" || | |
// http://s1.lprs1.fr/images/2017/08/17/7197618_sofia-solares-cover_940x500.PNG | |
(domain_nosub === "lprs1.fr" && domain.match(/s[0-9]*\.lprs1\.fr/)) || | |
// http://m.wsj.net/video/20170227/022717oscarsfashion/022717oscarsfashion_1280x720.jpg | |
domain === "m.wsj.net" || | |
// http://img.lifestyler.co.kr/uploads/program/1/1728/menu/16/board/0/0/f131717137323426000(0)_226x146.jpg | |
domain === "img.lifestyler.co.kr" || | |
// https://static-us-cdn.eporner.com/photos/537995_296x1000.jpg | |
(domain_nosub === "eporner.com" && domain.match(/static-(?:[a-z]+-)?cdn\.eporner\.com/)) || | |
// http://fototo.blox.pl/resource/rihanna_and_red_400x400.jpg | |
domain === "fototo.blox.pl" || | |
// http://media.nvyouj.com/photos/2017/1007/20/DLiF1LFVoAAdtbR_240x240.jpg | |
domain === "media.nvyouj.com" || | |
// http://cl.buscafs.com/www.tomatazos.com/public/uploads/images/184724_600x315.jpg | |
(domain === "cl.buscafs.com" && src.indexOf("/www.tomatazos.com/") >= 0) || | |
// http://tomatazos.buscafs.com/uploads/images/199130_600x759.jpg | |
(domain === "tomatazos.buscafs.com" && src.indexOf("/uploads/images/") >= 0) || | |
// http://nisfeldunia.ahram.org.eg/Media/NewsMedia/2017/6/4/2017-636321794648424569-842_242x160.jpg | |
(domain === "nisfeldunia.ahram.org.eg" && src.indexOf("/Media/") >= 0) || | |
// https://d2t7cq5f1ua57i.cloudfront.net/images/r_images/51261/54063/51261_54063_77_0_8968_20141223201250892_200x200.jpg | |
domain === "d2t7cq5f1ua57i.cloudfront.net" || | |
// https://image.ibb.co/fmOKNJ/h_54456811_768x530.jpg | |
//domain === "image.ibb.co" || | |
// http://socdn.smtown.com/upload/smtownnow/pictures/images/2018/06/15/o_1cg12bap41e5v3vh1iu2mhkjaj9_600x800.jpg | |
domain === "socdn.smtown.com" || | |
// http://www.lecturas.com/medio/2018/03/14/andrea-duro-4_6a8880f6_800x1200.jpg | |
(domain_nowww === "lecturas.com" && src.indexOf("/medio/") >= 0) || | |
// https://www.clara.es/medio/2018/02/26/margot-robbie-oscars-2017_f0ed3ed6_600x900.jpg | |
(domain_nowww === "clara.es" && src.indexOf("/medio/") >= 0) || | |
// https://images.anandtech.com/doci/12326/2018-01-09_14.26.05_678x452.jpg | |
domain === "images.anandtech.com" || | |
// https://cdn.popbela.com/content-images/post/20170217/foto-cover-tweak-10c04c1a30b06c260e3dedd966775b45_750x500.jpg | |
domain === "cdn.popbela.com" || | |
// http://cdnimg103.lizhi.fm/audio_cover/2017/06/01/2605105337514729479_320x320.png | |
(domain_nosub === "lizhi.fm" && domain.match(/^cdnimg[0-9]*\./)) || | |
// https://img.cf.47news.jp/public/photo/46f4777d8bbca4365d93bdd700e40cb4/photo_120x96.jpg | |
domain === "img.cf.47news.jp" || | |
// https://static.filmin.es/images/media/22272/4/still_1_3_790x398.jpg | |
domain === "static.filmin.es" || | |
// http://img0.ropose.com/story/9fNu_1496394464744_db0ebcd0_a337_350x525.jpeg | |
(domain_nosub === "ropose.com" && domain.match(/^img[0-9]*\./)) || | |
// http://resource.info.mn/infomn/images/2013/5/266c1f4994f07d060888db46a9100581/2013+Billboard+Music+Awards+Arrivals+19GjdCzDuPix_500x500.jpg | |
domain === "resource.info.mn" || | |
// http://image1.thegioitre.vn/2018/08/16/neu-khong-muon-vai-u-thit-bap-chi-em-dung-tap-6-bai-the-duc-nay-thumb_160x106.jpg | |
(domain_nosub === "thegioitre.vn" && domain.match(/^image[0-9]*\./)) || | |
// http://img.uduba.com/uduba/user_data/60/8c/608c39df8cadf0a631422b5000631aba_430x272.jpg?uduba_pid=3164615 | |
// http://img.uduba.com/uduba/user_data/60/8c/608c39df8cadf0a631422b5000631aba.jpg?uduba_pid=3164615 | |
domain === "img.uduba.com" || | |
// http://img.51ztzj.com//upload/image/20140929/dn201409304011_172x108.jpg | |
domain === "img.51ztzj.com" || | |
// http://mediaresources.idiva.com/media/photogallery/2011/May/isabel_lucas_india_inspired_320x240.jpg | |
(domain === "mediaresources.idiva.com" && src.indexOf("/media/") >= 0) || | |
// https://static.bangkokpost.com/media/content/20180913/c1_1539258_620x413.jpg | |
domain === "static.bangkokpost.com" || | |
// https://www.lepoint.fr/images/2016/12/23/6504996lpw-6505226-article-jpg_4470079_1250x625.jpg -- upscaled? | |
// https://static.lpnt.fr/images/2017/06/01/8809423lpw-8809517-article-rea249774071-jpg_4324942_660x281.jpg | |
((domain_nowww === "lepoint.fr" || domain === "static.lpnt.fr") && src.indexOf("/images/") >= 0) || | |
// https://i2.sdpnoticias.com/sdpnoticias/2018/11/07/1616_selena-gomez_620x350.jpg | |
// https://i2.sdpnoticias.com/sdpnoticias/2018/11/07/1616_selena-gomez.jpg | |
(domain_nosub === "sdpnoticias.com" && domain.match(/^i[0-9]*\./)) || | |
// https://s.thestreet.com/files/tsc/v2008/photos/contrib/uploads/1a72764a-38f2-11e8-840e-0fede5440c05_600x400.png | |
(domain === "s.thestreet.com" && src.indexOf("/files/") >= 0) || | |
// https://www.cosmopolitan.com.hk/var/cosmopolitanhk/storage/nodejs/legacy/images/lifestyle/lulu_0_708x708.jpeg | |
// https://www.cosmopolitan.com.hk/var/cosmopolitanhk/storage/nodejs/files/2017/03/02/15a8e0fe-a0a5-47be-91fe-760e8b48fe0d.15a8e0fe-a0ae-443f-be2a-74d53c711306_708x708.jpeg | |
(domain_nowww === "cosmopolitan.com.hk" && src.match(/\/storage\/+nodejs\/+(?:legacy\/+images|files)\//)) || | |
// http://s2.cdn.bbwc.cn/issue_0/articles/200058005/2016/1228/58639baea2fdb_640x426.png | |
(domain_nosub === "bbwc.cn" && domain.match(/^s[0-9]*\.cdn\./)) || | |
// https://d4zcrs0v202ys.cloudfront.net/images/2019/03/stone1_2_1200x0.jpg | |
(domain === "d4zcrs0v202ys.cloudfront.net" && src.indexOf("/images/") >= 0) || | |
// http://cdn2.sornamag.com/files/images/20195/25/2019525124338560410a_215x160.jpg | |
(domain_nosub === "sornamag.com" && src.match(/\/files\/+images\//)) || | |
// http://arhiva.nacional.hr/img/5/e/0/5e0d49042d5cb85f05d03d2485e2ba1b_700x550.jpg | |
(domain === "arhiva.nacional.hr" && src.indexOf("/img/") >= 0) || | |
// https://media.cbs8.com/assets/KFMB/images/7989a21b-212b-4cf2-b5ae-0e1798977c39/7989a21b-212b-4cf2-b5ae-0e1798977c39_750x422.jpg | |
(domain === "media.cbs8.com" && src.indexOf("/assets/") >= 0) || | |
// https://img.myvideo.net.tw/images/MUS030/0000/0254/201407071400064359_210x300.jpg | |
(domain === "img.myvideo.net.tw" && src.indexOf("/images/") >= 0) || | |
// https://image.apost.com/media/articletranslation/2019/05/21/15/c4ac945abf24c9a59a81cdc6130689b8_500x1.jpg | |
(domain === "image.apost.com" && src.indexOf("/media/") >= 0) || | |
// https://im.indiatimes.in/content/2014/Aug/s_1407321747_540x540.jpg | |
(domain === "im.indiatimes.in" && src.indexOf("/content/") >= 0) || | |
// http://admin.alo.rs/resources/images/0000/071/770/profimedia-0305047636_400x0.jpg | |
(domain === "admin.alo.rs" && /\/resources\/+images\//.test(src)) || | |
// http://images.cinefil.com/movies/1053952_1600x450.jpg | |
// http://images.cinefil.com/movies/1053952.jpg | |
domain === "images.cinefil.com") { | |
newsrc = src.replace(/_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
// http://www.mediaonlinevn.com/wp-content/uploads/2016/03/160315-pantech-launch-hcm-41_resize-680x365_c.jpg | |
// https://mediaonlinevn.com/wp-content/uploads/2016/03/160315-pantech-launch-hcm-41_resize-680x365_c.jpg | |
if (domain_nowww === "mediaonlinevn.com" || | |
// https://www.delas.pt/files/2017/07/Selena-Gomez-671x377_c.jpg | |
// https://www.delas.pt/files/2017/07/Selena-Gomez.jpg | |
// https://www.delas.pt/files/2016/08/hd-aspect-1459874430-hbz-jennifer-lawrence-may-2016-09-150x84.jpg | |
// https://www.delas.pt/files/2016/08/hd-aspect-1459874430-hbz-jennifer-lawrence-may-2016-09.jpg | |
(domain_nowww === "delas.pt" && src.indexOf("/files/") >= 0) || | |
// http://www.onthemoveworld.com/otm-fr/wp-content/uploads/2019/03/Carly-rae-jepsen-2018-cr-Natalie-OMoore-billboard-1548-347x246_c.jpg | |
// http://www.onthemoveworld.com/otm-fr/wp-content/uploads/2019/03/Carly-rae-jepsen-2018-cr-Natalie-OMoore-billboard-1548.jpg | |
domain_nowww === "onthemoveworld.com") { | |
src = src.replace(/-[0-9]*x[0-9]*(?:_[a-z])?(\.[^/.]*)(?:[?#].*)?$/, "$1"); | |
} | |
// http://felipepitta.com/blog/wp-content/uploads/2014/08/Harry-Potter-Hogwarts-Express-Jacobite-Fort-William-Scotland-Train(pp_w970_h646).jpg | |
// http://www.onelittlepicture.com.au/wp-content/uploads/2012/07/IMG_0077a-copy-682x1024(pp_w599_h900).jpg | |
if (src.indexOf("/wp-content/uploads/") >= 0 || | |
//domain.indexOf(".files.wordpress.com") >= 0 || -- no evidence of this actually working, other patterns don't work for it either | |
src.indexOf("/wp/uploads/") >= 0) { | |
src = src.replace(/\(pp_w[0-9]+_h[0-9]+\)(\.[^/.]*)$/, "$1"); | |
} | |
// doesn't work: | |
// https://thechive.files.wordpress.com/2018/06/funny-football-memes-fifa-world-cup-27-5b34f3ecb603a__700.jpg | |
if (//domain.indexOf(".files.wordpress.com") >= 0 || | |
// https://static.boredpanda.com/blog/wp-content/uploads/2017/08/GW-130817_DSC1426-copy-599f17eddebf2__880.jpg | |
// https://static.boredpanda.com/blog/wp-content/uploads/2017/08/GW-130817_DSC1426-copy-599f17eddebf2.jpg | |
src.indexOf("/wp-content/uploads/") >= 0 || | |
src.indexOf("/wp/uploads/") >= 0) { | |
// http://www.randomnude.com/wp-content/uploads/sites/39/2017/06/gomez__7__1.jpg | |
src = src.replace(/__[0-9]{2,}(\.[^/.]*)$/, "$1"); | |
} | |
// https://www.thetrace.org/wp-content/uploads/2017/04/Cleveland_Gun_Survivors_065-5394x0-c-default.jpg | |
if (src.indexOf("/wp-content/uploads/") >= 0 || | |
src.indexOf("/wp/uploads/") >= 0) { | |
src = src.replace(/-[0-9]+x[0-9]+-c-default(\.[^/.]*)$/, "$1"); | |
} | |
/*if (false && (domain === "storage.journaldemontreal.com" || | |
domain === "storage.torontosun.com" || | |
domain === "storage.ottawasun.com")) { | |
return { | |
url: src, | |
head_wrong_contenttype: true | |
}; | |
}*/ | |
if (domain === "pictures.ozy.com" || | |
// http://www.retail-jeweller.com/pictures/2000x2000fit/4/2/6/3007426_Pandora-ambassador-Tess-Daly-UK.jpg | |
// http://www.retail-jeweller.com/pictures/99999999x99999999/4/2/6/3007426_Pandora-ambassador-Tess-Daly-UK.jpg | |
domain_nowww === "retail-jeweller.com" || | |
// https://d1nslcd7m2225b.cloudfront.net/Pictures/2000x2000fit/1/7/5/1281175_lily_collins_wondercon_2013_555557.jpg | |
// https://d1nslcd7m2225b.cloudfront.net/Pictures/99999999x99999999/1/7/5/1281175_lily_collins_wondercon_2013_555557.jpg | |
domain === "d1nslcd7m2225b.cloudfront.net") { | |
// https://pictures.ozy.com/pictures/768xany/9/5/0/127950_LESLIE_HILL.jpg | |
// https://pictures.ozy.com/pictures/99999999x99999999/9/5/0/127950_LESLIE_HILL.jpg | |
// https://pictures.ozy.com/pictures/600x337fit/9/1/5/127915_sean_ozyfest_00628.jpg | |
// https://pictures.ozy.com/pictures/99999999x99999999/9/1/5/127915_sean_ozyfest_00628.jpg | |
// https://pictures.ozy.com/Pictures/385x385/4/3/1/111431_culligan_ozyfest_054.jpg | |
// https://pictures.ozy.com/Pictures/99999999x99999999/4/3/1/111431_culligan_ozyfest_054.jpg | |
// https://pictures.ozy.com/pictures/anyx296/2/0/5/70205_OZY_mix_tape_2.jpg | |
// https://pictures.ozy.com/pictures/99999999x99999999/2/0/5/70205_OZY_mix_tape_2.jpg | |
return src.replace(/(\/[Pp]ictures\/)[0-9any]+x[0-9any]+(?:[a-z]+)?\//, "$199999999x99999999/"); | |
} | |
if (domain === "static.gofugyourself.com" || | |
// https://static.stereogum.com/uploads/2017/02/CAMILA_MOBLEY-2-1487873904-640x427.jpg | |
// https://static.stereogum.com/uploads/2017/02/CAMILA_MOBLEY-2-1487873904.jpg | |
// http://static.stereogum.com/uploads/2009/07/megan_fox_car-compressed.jpg | |
// http://static.stereogum.com/uploads/2009/07/megan_fox_car.jpg | |
domain === "static.stereogum.com") { | |
// https://static.gofugyourself.com/uploads/2017/10/shutterstock_9134610ar-1507848416-353x560.jpg | |
// https://static.gofugyourself.com/uploads/2017/10/shutterstock_9134610ar-1507848416.jpg | |
// https://static.gofugyourself.com/uploads/2016/11/GettyImages-509071946-510x766-compressed.jpg | |
// https://static.gofugyourself.com/uploads/2016/11/GettyImages-509071946-510x766.jpg | |
// https://static.gofugyourself.com/uploads/2016/11/GettyImages-509071946.jpg -- doesn't work | |
return src.replace(/-(?:[0-9]+x[0-9]+|compressed)(\.[^/.]*)(?:[?#].*)?$/, "$1"); | |
} | |
if (domain === "hips.hearstapps.com") { | |
// https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/bgus-1060427-037-1-1510856807.jpg | |
// http://hmg-prod.s3.amazonaws.com/images/bgus-1060427-037-1-1510856807.jpg | |
// https://hips.hearstapps.com/rover/profile_photos/21445446-1bde-4290-a24e-2bdd274be027_1516741729.jpg?fill=1:1&resize=200:* | |
// https://hips.hearstapps.com/rover/profile_photos/21445446-1bde-4290-a24e-2bdd274be027_1516741729.jpg | |
newsrc = src.replace(/.*hips\.hearstapps\.com\/([^/]+\.[^/]+)/, "http://$1"); | |
if (newsrc !== src) | |
return newsrc; | |
return src.replace(/\?[^/]*$/, ""); | |
} | |
if (domain === "img.wennermedia.com") { | |
// http://img.wennermedia.com/social/benson-fe365ae4-d2a2-461d-a6c1-9468b99177a2.jpg | |
// http://img.wennermedia.com/benson-fe365ae4-d2a2-461d-a6c1-9468b99177a2.jpg | |
return src.replace(/:\/\/img\.wennermedia\.com\/[^?#]*\/([^/]*)$/, "://img.wennermedia.com/$1"); | |
} | |
// specials-images.forbesimg.com | |
if (domain_nosub === "forbesimg.com" && domain.indexOf("images.forbesimg.com") >= 0) { | |
// https://specials-images.forbesimg.com/imageserve/8988f42a4522469f9aeded6263f85183/960x0.jpg?fit=scale | |
// https://specials-images.forbesimg.com/imageserve/8988f42a4522469f9aeded6263f85183/0x0.jpg | |
return { | |
url: src.replace(/\/[0-9]*x[0-9]*\.([^/.?]*)(\?.*)?/, "/0x0.$1"), | |
head_wrong_contentlength: true | |
}; | |
} | |
if (domain === "pixel.nymag.com") { | |
// https://pixel.nymag.com/imgs/thecut/slideshows/2015/02/oscars-red-carpet/batch-7/464162110_10.nocrop.w443.h670.2x.jpg | |
// http://pixel.nymag.com/imgs/thecut/slideshows/2015/02/oscars-red-carpet/batch-7/464162110_10.jpg | |
// https://pixel.nymag.com/imgs/thecut/slideshows/2015/05/met-gala/23/472181460.o.jpg/a_4x-vertical.jpg | |
// https://pixel.nymag.com/imgs/thecut/slideshows/2015/05/met-gala/23/472181460.jpg -- 3280x4928 | |
// https://pixel.nymag.com/imgs/thecut/slideshows/lookbooks/lindsay-lohan/lindsay-lohan-2016-06-22.o.jpg/a_4x-vertical.jpg | |
// https://pixel.nymag.com/imgs/thecut/slideshows/lookbooks/lindsay-lohan/lindsay-lohan-2016-06-22.jpg | |
return src | |
.replace(/\/([^/.]*)(\.[^/]*)?\.([^/.]*)$/, "/$1.$3") | |
//.replace(/\/slideshows\/(?:[0-9]+\/[0-9]+\/[^/]*\/[^/]*\/[0-9]+(?:_[0-9]+)?)(?:\.[^/]*)?(\.[^/.]*)\/[^/]*$/, "$1$2"); | |
.replace(/(\/slideshows\/.*\/[^/]*)\.[a-z](\.[^/.]*)\/[^/]*(?:[?#].*)?$/, "$1$2"); | |
} | |
if (domain === "assets.nydailynews.com" || | |
// http://assets.nydailynews.com/polopoly_fs/1.1756087.1397507807!/img/httpImage/image.jpg_gen/derivatives/article_750/ccweb15s-2-web.jpg | |
// http://assets.nydailynews.com/polopoly_fs/1.1756087.1397507807!/img/httpImage/ccweb15s-2-web.jpg | |
// http://static1.nydailynews.com/polopoly_fs/1.2229393.1432140395!/img/httpImage/image.jpg_gen/derivatives/article_400/lopez21f-2-web.jpg | |
// http://static1.nydailynews.com/polopoly_fs/1.2229393.1432140395!/img/httpImage/lopez21f-2-web.jpg | |
(domain_nosub === "nydailynews.com" && domain.match(/^static[0-9]*\./)) || | |
// https://i.cbc.ca/1.4304676.1506225777!/fileImage/httpImage/edmonton-oilers.JPG?imwidth=720 | |
// https://i.cbc.ca/1.4304676.1506225777!/fileImage/httpImage/edmonton-oilers.JPG | |
domain === "i.cbc.ca" || | |
// http://cdn.newsday.com/polopoly_fs/1.6354403.1383272745!/httpImage/image.JPG_gen/derivatives/landscape_1280/image.JPG | |
// https://cdn.newsday.com/polopoly_fs/1.6354403.1383272745!/httpImage/image.JPG | |
domain === "cdn.newsday.com" || | |
// https://www.stripes.com/polopoly_fs/1.545877.1536091200!/image/image.jpg_gen/derivatives/300x200/image.jpg | |
// https://www.stripes.com/polopoly_fs/1.545877.1536091200!/image/image.jpg | |
domain_nowww === "stripes.com" || | |
// can't find any test case, disabling for now | |
//domain.indexOf("www.thetimesnews.com") >= 0 || | |
// https://www.irishtimes.com/polopoly_fs/1.3616909.1535987603!/image/image.jpg_gen/derivatives/box_300_160/image.jpg | |
// https://www.irishtimes.com/polopoly_fs/1.3616909.1535987603!/image/image.jpg | |
domain_nowww === "irishtimes.com" || | |
// https://www.ctvnews.ca/polopoly_fs/1.4071511.1535482319!/httpImage/image.jpg_gen/derivatives/landscape_300/image.jpg | |
// https://www.ctvnews.ca/polopoly_fs/1.4071511.1535482319!/httpImage/image.jpg | |
domain_nowww === "ctvnews.ca" || | |
// http://www.lancashirelife.co.uk/polopoly_fs/1.1596808!/image/2417471173.jpg_gen/derivatives/landscape_490/2417471173.jpg | |
// http://www.lancashirelife.co.uk/polopoly_fs/1.1596808!/image/2417471173.jpg | |
domain_nowww === "lancashirelife.co.uk" || | |
// http://images.archant.co.uk/polopoly_fs/1.5453783.1522228810!/image/image.jpg_gen/derivatives/landscape_630/image.jpg | |
// http://images.archant.co.uk/polopoly_fs/1.5453783.1522228810!/image/image.jpg | |
domain === "images.archant.co.uk" || | |
// https://www.tsn.ca/polopoly_fs/1.432481!/fileimage/httpImage/image.jpg_gen/derivatives/default/connor-mcdavid.jpg -- doesn't work | |
//domain === "www.tsn.ca" || | |
// http://images.glaciermedia.ca/polopoly_fs/1.23165389.1517899084!/fileImage/httpImage/image.jpg_gen/derivatives/landscape_804/edm110453004-jpg.jpg | |
// https://images.glaciermedia.ca/polopoly_fs/1.23165389.1517899084!/fileImage/httpImage/edm110453004-jpg.jpg | |
domain === "images.glaciermedia.ca" || | |
// https://static.gulfnews.com/polopoly_fs/1.2168576!/image/3397099558.jpg_gen/derivatives/box_460346/3397099558.jpg | |
// https://static.gulfnews.com/polopoly_fs/1.2168576!/image/3397099558.jpg | |
domain === "static.gulfnews.com" || | |
// cp24.com doesn't exist, only www. | |
// https://www.cp24.com/polopoly_fs/1.3742970.1514935441!/httpImage/image.jpg_gen/derivatives/landscape_150/image.jpg | |
// https://www.cp24.com/polopoly_fs/1.3742970.1514935441!/httpImage/image.jpg | |
domain === "www.cp24.com" || | |
// https://images.anandabazar.com/polopoly_fs/1.832890.1531660919!/image/image.jpg_gen/derivatives/box_375_281/image.jpg | |
// https://www.anandabazar.com/polopoly_fs/1.832890!/image/image.jpg_gen/derivatives/landscape_390/image.jpg | |
domain_nosub === "anandabazar.com" || | |
// http://www.islingtongazette.co.uk/polopoly_fs/1.957786!/image/89195513.jpg_gen/derivatives/landscape_490/89195513.jpg | |
// https://www.islingtongazette.co.uk/polopoly_fs/1.957786!/image/89195513.jpg | |
domain_nowww === "islingtongazette.co.uk" || | |
// http://www.vrak.tv/polopoly_fs/1.2821149.1499878585!/image/maddie-ziegler-2017-getty-resize.jpg_gen/derivatives/vrak_816_459/maddie-ziegler-2017-getty-resize.jpg | |
// http://www.vrak.tv/polopoly_fs/1.2821149.1499878585!/image/maddie-ziegler-2017-getty-resize.jpg | |
domain_nowww === "vrak.tv" || | |
// https://images.haaretz.co.il/polopoly_fs/1.5869852.1521547002!/image/2715066667.jpg_gen/derivatives/size_300xAuto/2715066667.jpg | |
// https://images.haaretz.co.il/polopoly_fs/1.5869852.1521547002!/image/2715066667.jpg | |
domain === "images.haaretz.co.il" || | |
// https://www.ltu.se/cms_fs/1.172775!/image/Iceberg_in_the_Arctic_with_its_underside_exposed.jpg_gen/derivatives/landscape_fullwidth/Iceberg_in_the_Arctic_with_its_underside_exposed.jpg | |
// https://www.ltu.se/cms_fs/1.172775!/image/Iceberg_in_the_Arctic_with_its_underside_exposed.jpg | |
domain_nowww === "ltu.se" || | |
// http://www.lanuovasardegna.it/polopoly_fs/1.17782426.1552123612!/httpImage/image.jpg_gen/derivatives/detail_558/image.jpg | |
// http://www.lanuovasardegna.it/polopoly_fs/1.17782426.1552123612!/httpImage/image.jpg | |
domain_nowww === "lanuovasardegna.it" || | |
// https://www.huntspost.co.uk/polopoly_fs/1.5817586.1544697986!/image/image.jpg_gen/derivatives/landscape_630/image.jpg | |
// https://www.huntspost.co.uk/polopoly_fs/1.5817586.1544697986!/image/image.jpg | |
domain_nowww === "huntspost.co.uk" || | |
// https://daqui.opopular.com.br/polopoly_fs/1.1791604.1557142930!/image/image.jpg_gen/derivatives/landscape_420/image.jpg | |
//domain_nosub === "opopular.com.br" || | |
// http://p1014p.quotidiano.net/polopoly_fs/1.3245998.1499154460!/httpImage/image.JPG_gen/derivatives/gallery_800/image.JPG -- doesn't work | |
//(domain_nosub === "quotidiano.net" && src.indexOf("/polopoly_fs/") >= 0) || | |
// http://www.edp24.co.uk/polopoly_fs/1.5540960!/image/image.jpg_gen/derivatives/landscape_630/image.jpg | |
// http://www.edp24.co.uk/polopoly_fs/1.5540960!/image/image.jpg | |
domain_nowww === "edp24.co.uk") { | |
newsrc = src | |
.replace(/(\/[^/.]*\.[^_/.]*)_gen\/+derivatives\/+[^/]*\/+/, "/") | |
.replace(/\/image\.[^_/]*_gen\/+derivatives\/+[^/]*\//, "/") | |
.replace(/\/image\/+[^_/]*_gen\/+derivatives\/+[^/]*\//, "/image/"); | |
if (newsrc !== src) { | |
return newsrc.replace(/\?.*/, ""); | |
} | |
// doesn't work for all: | |
// https://ludovica.opopular.com.br/polopoly_fs/1.850210.1431538905!/image/image.jpg_gen/derivatives/landscape_800/image.jpg | |
} | |
if (domain === "static.gulfnews.com") { | |
return { | |
url: src, | |
head_wrong_contenttype: true | |
}; | |
} | |
if (domain === "www.tsn.ca") { | |
// nowww doesn't exist | |
// https://www.tsn.ca/polopoly_fs/1.738832!/fileimage/httpImage/image.jpg_gen/derivatives/landscape_620/kyle-fuller.jpg | |
// https://www.tsn.ca/polopoly_fs/1.738832!/fileimage/httpImage/image.jpg_gen/derivatives/default/kyle-fuller.jpg | |
return src.replace(/(\/image\.[^_/]*_gen\/+derivatives\/+)[^/]*\//, "$1default/"); | |
} | |
if (domain_nosub === "bbci.co.uk" && domain.match(/^ichef(?:-[0-9]*)?\./)) { | |
newsrc = src.replace(/\/[0-9]+_[0-9]+\//, "/original/"); | |
if (newsrc !== src) | |
return newsrc; | |
// http://ichef.bbci.co.uk/corporate2/images/width/live/p0/55/fh/p055fhy8.jpg/624 | |
// http://ichef.bbci.co.uk/corporate2/images/width/live/p0/55/fh/p055fhy8.jpg/0 | |
newsrc = src.replace(/(\.[^/.]*)\/[0-9]+$/, "$1/0"); | |
if (newsrc !== src) | |
return newsrc; | |
// https://ichef.bbci.co.uk/images/ic/960x540/p03jg3g8.jpg | |
// https://ichef.bbci.co.uk/images/ic/raw/p03jg3g8.jpg | |
// https://ichef.bbci.co.uk/images/ic/720x405/p0517py6.jpg | |
// https://ichef.bbci.co.uk/images/ic/raw/p0517py6.jpg | |
// https://ichef.bbci.co.uk/images/ic/1920xn/p0698c1x.jpg | |
// https://ichef.bbci.co.uk/images/ic/raw/p0698c1x.jpg | |
// http://ichef.bbci.co.uk/images/ic/144x81/p02cbtdd.jpg | |
// http://ichef.bbci.co.uk/images/ic/raw/p02cbtdd.jpg | |
newsrc = src.replace(/(:\/\/[^/]*)\/images\/ic\/[0-9n]+x[0-9n]+\//, "$1/images/ic/raw/"); | |
if (newsrc !== src) | |
return newsrc; | |
// http://ichef.bbci.co.uk/wwhp/999/cpsprodpb/7432/production/_99764792_8e240163-62f5-4b0f-bf90-6def2cdc883b.jpg | |
// http://ichef.bbci.co.uk/news/999/cpsprodpb/7432/production/_99764792_8e240163-62f5-4b0f-bf90-6def2cdc883b.jpg | |
// https://c.files.bbci.co.uk/7432/production/_99764792_8e240163-62f5-4b0f-bf90-6def2cdc883b.jpg | |
// https://ichef.bbci.co.uk/news/999/media/images/79831000/jpg/_79831755_hewer2_bbc.jpg | |
// https://news.bbcimg.co.uk/media/images/79831000/jpg/_79831755_hewer2_bbc.jpg | |
// https://ichef-1.bbci.co.uk/news/235/cpsprodpb/A771/production/_99756824_trumpmueller.jpg | |
// https://c.files.bbci.co.uk/A771/production/_99756824_trumpmueller.jpg | |
// http://ichef.bbci.co.uk/news/999/mcs/media/images/79839000/jpg/_79839098_bbcnickhewer.jpg | |
// http://news.bbcimg.co.uk/media/images/79839000/jpg/_79839098_bbcnickhewer.jpg | |
// http://news.bbcimg.co.uk/news/special/2016/newsspec_15380/img/trump_annotated_976v2.png | |
// http://news.bbcimg.co.uk/news/special/2017/newsspec_17595/img/hurricane_globe_v6.gif | |
// http://ichef.bbci.co.uk/news/976/cpsprodpb/11B74/production/_88046527_getty_ora.jpg | |
// http://news.bbcimg.co.uk/media/images/88046527/jpg/_88046527_getty_ora.jpg -- not found | |
// http://c.files.bbci.co.uk/11B74/production/_88046527_getty_ora.jpg | |
// http://news.bbcimg.co.uk/media/images/74104000/jpg/_74104195_6671990f-809f-432b-8699-7b5b92d053a0.jpg | |
// http://news.bbcimg.co.uk/media/images/61015000/jpg/_61015960_3a79d215-7772-4ec1-b157-1655c66793ad.jpg | |
// http://news.bbcimg.co.uk/news/special/2016/newsspec_12799/content/full-width/common/img/italy_graves_intro_1400.jpg | |
// https://ichef.bbci.co.uk/onesport/cps/800/cpsprodpb/41F9/production/_98998861_ragnbone.jpg | |
// http://c.files.bbci.co.uk/28EE/production/_98587401_afoty_624x351_player5.jpg | |
// https://ichef.bbci.co.uk/live-experience/cps/800/cpsprodpb/vivo/live/images/2018/5/29/433b3e44-09ac-4366-a535-c1fbd8bc9cde.jpg | |
// https://c.files.bbci.co.uk/vivo/live/images/2018/5/29/433b3e44-09ac-4366-a535-c1fbd8bc9cde.jpg | |
// https://ichef.bbci.co.uk/food/ic/food_16x9_832/recipes/irish_fish_chowder_with_08587_16x9.jpg -- 832x468 | |
// https://food-images.files.bbci.co.uk/food/recipes/irish_fish_chowder_with_08587_16x9.jpg -- 5341x3004 | |
// | |
// | |
// larger images: | |
// https://news.files.bbci.co.uk/include/shorthand/40714/media/nk_family_tree_shorthand_la.png -- 2560x1440 | |
// http://www.bbc.co.uk/staticarchive/3950fd5e40621b9769250aecda90d060da592198.jpg -- 602x357 | |
// http://www.bbc.co.uk/sing/hallelujah/images/bbc_sing-hallelujah-london_fullsize.jpg -- 5616x3329 | |
// http://ichef.bbci.co.uk/images/ic/raw/p05k91nn.png -- 4001x3438 | |
// | |
// subdomains for files.bbci.co.uk: | |
// a | |
// b | |
// c | |
// nav | |
// news | |
// childrens-binary | |
// search | |
// m | |
// https://m.files.bbci.co.uk/modules/bbc-morph-sport-opengraph/1.1.1/images/bbc-sport-logo.png | |
// guides | |
// food | |
// podcasts | |
// mybbc | |
// bbcthree-web-cdn | |
// https://bbcthree-web-cdn.files.bbci.co.uk/bbcthree-web-server/2.9.0-257.x86_64/images/share-best-of.png | |
// bam | |
// https://bam.files.bbci.co.uk/bam/live/content/zm8497h/large | |
// https://bam.files.bbci.co.uk/bam/live/content/zm8497h/small -- different (but related) image | |
// subdomains for bbci.co.uk: | |
// static -- used for js etc. sometimes for images | |
// feeds -- used for rss feeds | |
// downloads | |
// http://downloads.bbc.co.uk/commissioning/site/CBBC_New_Logo_RGB.png | |
// android | |
// r | |
// [blank] | |
// www | |
// emp | |
// | |
// different cropping: | |
// https://ichef.bbci.co.uk/news/999/cpsprodpb/01C8/production/_99765400_hi039575218.jpg | |
// https://ichef.bbci.co.uk/news/999/cpsprodpb/DB2A/production/_99760165_hi039575218.jpg | |
// http://news.bbcimg.co.uk/media/images/99765000/jpg/_99765400_hi039575218.jpg - doesn't work | |
newsrc = src.replace(/.*\.bbci\.co\.uk\/news\/[0-9]*\/(?:[^/]*\/)?media\//, "http://news.bbcimg.co.uk/media/"); | |
if (newsrc !== src) | |
return newsrc; | |
newsrc = src.replace(/:\/\/[^/]*\/food\/ic\/[^/]*\//, "://food-images.files.bbci.co.uk/food/"); | |
if (newsrc !== src) | |
return newsrc; | |
// http://ichef.bbci.co.uk/naturelibrary/images/ic/credit/640x395/h/hu/hummingbird/hummingbird_1.jpg | |
// http://ichef.bbci.co.uk/naturelibrary/images/ic/640x395/h/hu/hummingbird/hummingbird_1.jpg | |
newsrc = src.replace(/\/images\/ic\/credit(\/[0-9]+x[0-9]+\/)/, "/images/ic$1"); | |
if (newsrc !== src) | |
return newsrc; | |
newsrc = src.replace(/.*\/cpsprodpb\//, "https://c.files.bbci.co.uk/"); | |
if (newsrc !== src) | |
return newsrc; | |
// https://ichef.bbci.co.uk/news/1024/branded_portuguese/D518/production/_102525545_mediaitem102524830.jpg | |
// https://c.files.bbci.co.uk/D518/production/_102525545_mediaitem102524830.jpg | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/news\/[0-9]+\/[^/]*\//, "https://c.files.bbci.co.uk/"); | |
if (newsrc !== src) | |
return newsrc; | |
/*var origsize = src.match(/\.bbci\.co\.uk\/[^/]*\/([0-9]*)\//); | |
if (origsize && false) { // scales up | |
var size = parseInt(origsize[1], 10); | |
if (size < 2048) { | |
return src.replace(/(\.bbci\.co\.uk\/[^/]*)\/[0-9]*\//, "$1/2048/"); | |
} | |
}*/ | |
} | |
if (domain === "amp.thisisinsider.com" || | |
// https://amp.insider.com/images/5c3e320e5241470201598c93-750-562.jpg | |
// https://static2.insider.com/image/5c3e320e5241470201598c93/ | |
domain === "amp.insider.com" || | |
domain === "amp.businessinsider.com") { | |
// nano defender disables javascript on here, so redirect via userscript doesn't work | |
// https://amp.thisisinsider.com/images/58c2c3d580c5ac1f008b47dc-960-1545.jpg | |
// https://static2.thisisinsider.com/image/58c2c3d580c5ac1f008b47dc/ | |
// https://amp.businessinsider.com/images/56dc9a3052bcd028008b4703-750-887.jpg | |
// https://static2.thisisinsider.com/image/56dc9a3052bcd028008b4703/ | |
// https://static2.businessinsider.com/image/56dc9a3052bcd028008b4703/ | |
// https://amp.businessinsider.com/images/5a383bcc7101ad309463675a-480-320.jpg | |
// https://static2.thisisinsider.com/image/5a383bcc7101ad309463675a/ -- doesn't work | |
// https://static2.businessinsider.com/image/5a383bcc7101ad309463675a.jpg | |
// https://static2.businessinsider.com/image/5a383bcc7101ad309463675a/ | |
// https://amp.businessinsider.com/images/59c5495519d2f523008b4c91-750-375.jpg | |
// https://static2.businessinsider.com/image/59c5495519d2f523008b4c91/ | |
// https://amp.businessinsider.com/images/58b36d34dd0895f4328b4c39-750-1125.jpg | |
// https://static2.businessinsider.com/image/58b36d34dd0895f4328b4c39/ | |
// https://amp.businessinsider.com/images/50be4860ecad04c541000001-750-562.jpg | |
// https://static2.businessinsider.com/image/50be4860ecad04c541000001/ | |
return src.replace(/^[a-z]+:\/\/amp\.([^/]*)\/images\/([a-f0-9]+)-[0-9]+(?:-[0-9]+)?(\.[^/.]*)$/, "https://static2.$1/image/$2/"); | |
} | |
if ((domain_nosub === "businessinsider.com" || | |
// https://static1.insider.com/image/5b52591b51dfbe21008b4592-400-300/gomez-was-all-smiles-at-the-premiere-of-hotel-transylvania-3-summer-vacation-in-june-2018.jpg | |
// https://static1.insider.com/image/5b52591b51dfbe21008b4592/ | |
domain_nosub === "insider.com" || | |
domain_nosub === "thisisinsider.com") && | |
domain.match(/^static[0-9]*\./)) { | |
// http://static2.thisisinsider.com/image/58c2c3d580c5ac1f008b47dc-200/ | |
// https://static2.thisisinsider.com/image/58c2c3d580c5ac1f008b47dc/ | |
// http://static6.uk.businessinsider.com/image/58ae09acdd089506308b4ad1-2377/undefined | |
// http://static6.uk.businessinsider.com/image/58ae09acdd089506308b4ad1/undefined | |
// http://static6.uk.businessinsider.com/image/58ae09acdd089506308b4ad1/ | |
// http://static.thisisinsider.com/image/59f0985d9091c139008b45da-750.jpg | |
// http://static.thisisinsider.com/image/59f0985d9091c139008b45da.jpg | |
//return src.replace(/(\/image\/[^/]*)-[0-9]*(\/[^/]*|\.[^/.]*)$/, "$1$2"); | |
//return src.replace(/\/image\/([^-/]*)[^/]*\//, "/image/$1/"); | |
return src.replace(/(\/image\/[0-9a-f]+)(?:-[^/]*|\.[^/]*)?(?:\/.*)?$/, "$1/"); | |
} | |
if (domain === "media.nbcwashington.com" || | |
// https://media.nbcnewyork.com/images/653*367/AP_18012240030020.jpg | |
domain === "media.nbcnewyork.com" || | |
// http://media.graytvinc.com/images/810*455/TAYLOR+SWIFT19.jpg | |
domain === "media.graytvinc.com" || | |
// https://media.telemundochicago.com/images/600*300/tlmd_leslie_grace_llega_a_radio_disney.jpg | |
domain === "media.telemundochicago.com" || | |
// https://media.nbcdfw.com/images/652*367/calboy+picture.JPG | |
// https://media.nbcdfw.com/images/calboy+picture.JPG | |
domain === "media.nbcdfw.com" || | |
// https://media.nbcphiladelphia.com/images/1200*675/600-Year-Old-Tree_Carl.jpg | |
domain === "media.nbcphiladelphia.com" || | |
// https://media.nbcsandiego.com/images/652*367/NBC+Article+Graphic.jpg | |
domain === "media.nbcsandiego.com" || | |
// http://media.heartlandtv.com/images/652*367/NBC.jpg | |
domain === "media.heartlandtv.com" || | |
// https://media.nbcmiami.com/images/652*367/120718+roku+nbc+6.jpg | |
domain === "media.nbcmiami.com" || | |
// https://media.nbcconnecticut.com/images/652*367/softball+team+nbc+connecticut.jpg | |
domain === "media.nbcconnecticut.com" || | |
// https://media.nbclosangeles.com/images/652*367/Chris-Hardwick-NBC-sexual-assault-review.jpg | |
domain === "media.nbclosangeles.com" || | |
// https://media.nbcboston.com/images/578*368/7am+weather+nbc+thumb.JPG | |
domain === "media.nbcboston.com" || | |
// https://media.nbcbayarea.com/images/652*397/FoC+2018+nbc.png | |
domain === "media.nbcbayarea.com" || | |
// https://media.winnipegfreepress.com/images/390*260/AVE201345020_high.jpg | |
domain === "media.winnipegfreepress.com" || | |
// https://media.brandonsun.com/images/648*432/AVE201345020_high.jpg | |
domain === "media.brandonsun.com" || | |
// https://media.necn.com/images/652*367/Anne4.jpg | |
domain === "media.necn.com" || | |
// https://media.telemundoareadelabahia.com/images/970*1393/GettyImages-865603188-tlmd-00.jpg | |
domain === "media.telemundoareadelabahia.com" || | |
// https://media.nbcchicago.com/images/652*367/t-swift-cover.jpg | |
domain === "media.nbcchicago.com") { | |
return src.replace(/\/images\/+[0-9]+\*[0-9]+\//, "/images/"); | |
} | |
if (domain_nowww === "bet.com") { | |
// https://www.bet.com/style/living/2018/01/29/chrissy-teigen-gender-reveal/_jcr_content/squareImage.featured1x1.dimg/__1517248018208__1517242933377/012918-style-chrissy-teigen-gender-reveal.jpg | |
// https://www.bet.com/style/living/2018/01/29/chrissy-teigen-gender-reveal/_jcr_content/bodycopycontainer/embedded_image_0/image.custom0fx0fx0xcrop.dimg/__1517248018208__1517242933377/012918-style-chrissy-teigen-gender-reveal.jpg | |
// https://www.bet.com/style/beauty/2018/01/30/cheap-beauty-products-celebrities-use/_jcr_content/bodycopycontainer/listiclecontainer/listicleitem_3/embedded_image/image.custom1200x1581.dimg/__1516987722286__1516987306610/012618-style-yara-shahidi-cheap-beauty-products.jpg | |
// https://www.bet.com/style/fashion/2018/01/28/see-all-the-looks-from-the-grammy-s-2018-red-carpet/_jcr_content/squareImage.featuredlist.dimg/__1517191072539__1517189173163/012818-style-grammy-looks-1.jpg | |
// https://www.bet.com/style/fashion/2018/01/28/see-rihanna-slay-a-patent-trench-as-she-accepted-a-grammy-award-/_jcr_content/image.ampheroimage.dimg/__1517189314895__1517188008118/012818-style-see-rihanna-slay-a-patent-trench-as-she-accepted-a-grammy-award.jpg | |
// https://www.bet.com/style/living/2018/02/01/leslie-jones-meagan-good-body-positivity-black-girl-magic/_jcr_content/squareImage.relatedinline1x1.dimg/__1517510003204__1517501332582/020118-Celebs-Leslie-Jones-Megan-Good.jpg | |
// https://www.bet.com/style/fashion/2018/01/31/jennifer-lopez-shows-off-toned-legs/_jcr_content/image.feedcontainer.dimg/__1517429162639__1517412507314/013118-style-jennifer-lopez-shows-off-toned-legs-3.jpg | |
return src | |
.replace(/\/(_jcr_content.*?\/[^/]*)\.custom[0-9]+fx[0-9]+fx[0-9]+xcrop\.([^/]*)\//, "/$1.custom0fx0fx0xcrop.$2/") | |
.replace(/\/(_jcr_content.*?\/[^/]*)\.custom[0-9]+x[0-9]+\.([^/]*)\//, "/$1.custom0fx0fx0xcrop.$2/") | |
.replace(/\/(_jcr_content.*?\/[^/]*)\.featured[0-9]+x[0-9]+\.([^/]*)\//, "/$1.custom0fx0fx0xcrop.$2/") | |
.replace(/\/(_jcr_content.*?\/[^/]*)\.featuredlist\.([^/]*)\//, "/$1.custom0fx0fx0xcrop.$2/") | |
.replace(/\/(_jcr_content.*?\/[^/]*)\.ampheroimage\.([^/]*)\//, "/$1.custom0fx0fx0xcrop.$2/") | |
.replace(/\/(_jcr_content.*?\/[^/]*)\.feedcontainer\.([^/]*)\//, "/$1.custom0fx0fx0xcrop.$2/") | |
.replace(/\/(_jcr_content.*?\/[^/]*)\.[^/.]*\.([^/]*)\//, "/$1.custom0fx0fx0xcrop.$2/") | |
.replace(/\/(_jcr_content.*?\/[^/]*)\.relatedinline[0-9]+x[0-9]+\.([^/]*)\//, "/$1.custom0fx0fx0xcrop.$2/"); | |
//.replace(/\/_jcr_content\/.*(\/[^/]*)$/, "/_jcr_content/bodycopycontainer/embedded_image_0/image.custom0fx0fx0xcrop.dimg/$1"); | |
} | |
if ((domain_nosub === "cbsistatic.com" && | |
// http://cbsnews1.cbsistatic.com/hub/i/r/2015/05/21/6836ca67-f2b8-48ae-ac4e-807d36830612/thumbnail/620x350/eca9fadfb6373619ab9174af67663e21/justin-bieber-and-james-cordon.jpg | |
// http://cbsnews1.cbsistatic.com/hub/i/r/2015/05/21/6836ca67-f2b8-48ae-ac4e-807d36830612/eca9fadfb6373619ab9174af67663e21/justin-bieber-and-james-cordon.jpg | |
(domain.match(/^cbsnews[0-9]*\./) || | |
// https://dl1.cbsistatic.com/i/r/2018/04/11/0b04d1c3-90d6-413f-9ac9-5fafeac65caa/thumbnail/170x134/3d7ad3678a8c4a7b72d72a8820e3c2f0/felicity-jones.jpg | |
// https://dl1.cbsistatic.com/i/r/2018/04/11/0b04d1c3-90d6-413f-9ac9-5fafeac65caa/3d7ad3678a8c4a7b72d72a8820e3c2f0/felicity-jones.jpg | |
domain.match(/^dl[0-9]*\./) || | |
// https://zdnet1.cbsistatic.com/hub/i/r/2018/01/12/2dcbd29f-f3fa-4283-b11a-e163c03bbc08/resize/770xauto/99721c4b340e885277343e7f6cb4b6c3/ndcboom1-alt.jpg | |
// https://zdnet1.cbsistatic.com/hub/i/r/2018/01/12/2dcbd29f-f3fa-4283-b11a-e163c03bbc08/99721c4b340e885277343e7f6cb4b6c3/ndcboom1-alt.jpg | |
// https://zdnet4.cbsistatic.com/hub/i/r/2018/02/06/1eef8bb5-4034-4e88-b356-ff9b035778d9/thumbnail/170x128/122ea3f0f9d0c3b86c23c3ff362ad252/brooke-cagle-195777.jpg | |
// https://zdnet4.cbsistatic.com/hub/i/r/2018/02/06/1eef8bb5-4034-4e88-b356-ff9b035778d9/122ea3f0f9d0c3b86c23c3ff362ad252/brooke-cagle-195777.jpg | |
domain.match(/zdnet[0-9]*\./))) || | |
// https://sportshub.cbsistatic.com/i/r/2017/12/07/49119fbe-9e96-49a6-8c87-503f699477f2/thumbnail/770x433/9994a568cadde287e9e29ef38cf2ef36/demarcus-cousins.jpg | |
// https://sportshub.cbsistatic.com/i/r/2017/12/07/49119fbe-9e96-49a6-8c87-503f699477f2/9994a568cadde287e9e29ef38cf2ef36/demarcus-cousins.jpg | |
domain === "sportshub.cbsistatic.com" || | |
// http://cimg.tvgcdn.net/i/r/2016/07/22/56a5114b-3639-4f72-8eac-12f22575c2e2/resize/900x600/2d6504f572963ac75616d4ef74dcc162/160722-news-rorys-boyfriends.jpg | |
// http://cimg.tvgcdn.net/i/r/2016/07/22/56a5114b-3639-4f72-8eac-12f22575c2e2/2d6504f572963ac75616d4ef74dcc162/160722-news-rorys-boyfriends.jpg | |
domain === "cimg.tvgcdn.net") { | |
newsrc = src | |
.replace(/\/resize\/[0-9a-z]*x[0-9a-z]*\//, "/") | |
.replace(/\/crop\/[^/]*\//, "/") | |
.replace(/\/thumbnail\/[^/]*\//, "/"); | |
if (newsrc !== src) { | |
return { | |
url: newsrc, | |
head_wrong_contentlength: true | |
}; | |
} | |
} | |
if (domain_nosub === "cbsistatic.com" && | |
domain.match(/cnet[0-9]*\.cbsistatic\.com/)) { | |
// https://cnet3.cbsistatic.com/img/FK8CGJDejVV-sEaEJZ2nXW8eM3k=/1600x900/2017/03/15/a2595ca5-43fc-4508-9c36-745b04dd49a1/coco2.jpg | |
// https://cnet3.cbsistatic.com/img/2017/03/15/a2595ca5-43fc-4508-9c36-745b04dd49a1/coco2.jpg | |
// https://cnet1.cbsistatic.com/img/nCMng7w4iuS_uxiPM4wghBjtQBg=/81x398:2438x2724/0x527/2017/05/08/9f832785-f506-4ec3-b175-f85723d123dc/ew-opener.jpg | |
// https://cnet1.cbsistatic.com/img/2017/05/08/9f832785-f506-4ec3-b175-f85723d123dc/ew-opener.jpg | |
// https://cnet1.cbsistatic.com/img/DIHwjRMV2yd28ex651bXyFnHQmE=/2017/12/27/3397f9e3-e1b9-4630-8e14-451a97546d32/dsc01630.jpg | |
// https://cnet1.cbsistatic.com/img/2017/12/27/3397f9e3-e1b9-4630-8e14-451a97546d32/dsc01630.jpg | |
// https://cnet1.cbsistatic.com/img/7WiR6Xi_Xc5FW2s5N7TdDmG6qLM=/fit-in/570x0/2017/12/12/c2363e6d-59e7-4027-9fda-7a5c467122fe/falcon-tie-finn.gif | |
// https://cnet1.cbsistatic.com/img/2017/12/12/c2363e6d-59e7-4027-9fda-7a5c467122fe/falcon-tie-finn.gif | |
return src.replace(/\/img\/[^/]*=\/(?:fit-in\/)?(?:[0-9]+x[0-9]+:[0-9]+x[0-9]+\/)?(?:[0-9]+x[0-9]+\/)?(.*)/, "/img/$1"); | |
} | |
if (domain_nosub === "cbsstatic.com" && | |
domain.match(/wwwimage[0-9]*(?:-secure)?\.cbsstatic\.com/)) { | |
// http://wwwimage2.cbsstatic.com/thumbnails/photos/w370/blog/abd70cf777ca6a77_marissa_golds_guide_1920.jpg | |
// http://wwwimage2.cbsstatic.com/base/files/blog/abd70cf777ca6a77_marissa_golds_guide_1920.jpg | |
// http://wwwimage.cbsstatic.com/thumbnails/photos/files/asset/10/00/56/47/927857742dd31df2_dianes_world.jpg | |
// http://wwwimage.cbsstatic.com/base/files/asset/10/00/56/47/927857742dd31df2_dianes_world.jpg | |
// http://wwwimage4.cbsstatic.com/thumbnails/videos/w270/CBS_Production_Entertainment_VMS/761/811/2018/02/06/1145406531709/CBS_SCORPION_416_IMAGE_NO_LOGO_thumb_Master.jpg | |
// http://wwwimage4.cbsstatic.com/thumbnails/videos/files/CBS_Production_Entertainment_VMS/761/811/2018/02/06/1145406531709/CBS_SCORPION_416_IMAGE_NO_LOGO_thumb_Master.jpg | |
// http://wwwimage2.cbsstatic.com/thumbnails/photos/770xh/danielle_big_brother_over_the_top.jpg | |
// http://wwwimage2.cbsstatic.com/thumbnails/photos/100q/danielle_big_brother_over_the_top.jpg | |
// https://wwwimage-secure.cbsstatic.com/thumbnails/photos/770xh/610a45ac16030991_lady-gaga-2-red-carpet-2018-grammy-awards.jpg | |
// | |
// error: | |
//Not enough parameters were given. | |
// | |
//Available parameters: | |
//w = Maximum width | |
//h = Maximum height | |
//c = Crop ratio (width:height) | |
//q = Quality (0-100) | |
//b = Background fill color (RRGGBB or RGB) | |
//p = Progressive (0 or 1) | |
// | |
//Example usage: | |
// http://wwwimage2.cbsstatic.com/thumbnails/photos/w300-h300-c1:1/path/to/image.jpg | |
return src | |
//.replace(/\/thumbnails\/([^/]*)\/[wh][0-9]*\//, "/thumbnails/$1/files/") | |
.replace(/\/thumbnails\/([^/]*)\/[-a-z0-9:]*\//, "/thumbnails/$1/files/") | |
.replace("/thumbnails/photos/files/", "/base/files/"); | |
} | |
if (domain === "api.fidji.lefigaro.fr") { | |
// http://api.fidji.lefigaro.fr/media/ext/1900x/madame.lefigaro.fr/sites/default/files/img/2015/01/defile-valentino-automne-hiver-2015-2016-paris-look-46.jpg | |
// http://i.f1g.fr/media/ext/1900x/madame.lefigaro.fr/sites/default/files/img/2015/01/defile-valentino-automne-hiver-2015-2016-paris-look-46.jpg | |
// http://api.fidji.lefigaro.fr/media/ext/1900x/img.tvmag.lefigaro.fr/ImCon/Arti/89615/PHO0ce17170-86bd-11e5-81ca-efc6b4cd613e-805x453.jpg | |
// http://i.f1g.fr/media/ext/1900x/img.tvmag.lefigaro.fr/ImCon/Arti/89615/PHO0ce17170-86bd-11e5-81ca-efc6b4cd613e-805x453.jpg | |
return src.replace("://api.fidji.lefigaro.fr/", "://i.f1g.fr/"); | |
} | |
if (domain === "i.f1g.fr") { | |
newsrc = src.replace(/.*i\.f1g\.fr\/media\/ext\/[^/]*\//, "http://"); | |
var newdomain = newsrc.replace(/^http:\/\/([^/]*)\/.*/, "$1"); | |
if (newsrc !== src && | |
newdomain !== "img.tvmag.lefigaro.fr") | |
return newsrc; | |
// http://svn.pimentech.org/pimentech/libcommonDjango/django_pimentech/pixr/views.py | |
// mirror: https://pastebin.com/D7zPvfa1 | |
// | |
// http://i.f1g.fr/media/figaro/493x100_crop/2017/03/28/XVM5540edbe-13a3-11e7-9e28-7b011fa4a165.jpg | |
// http://i.f1g.fr/media/figaro/orig/2017/03/28/XVM5540edbe-13a3-11e7-9e28-7b011fa4a165.jpg | |
// http://i.f1g.fr/media/eidos/493x178_crop/2017/11/05/XVM758e1cb8-c212-11e7-b1f9-8e8a8cad8fcc.jpg | |
// http://i.f1g.fr/media/eidos/orig/2017/11/05/XVM758e1cb8-c212-11e7-b1f9-8e8a8cad8fcc.jpg | |
return src.replace(/\/media\/([a-z]*)\/[^/]*\//, "/media/$1/orig/"); | |
} | |
if ((domain_nosub === "h-cdn.co" || | |
// http://cnl.h.cdn.cosmopolitan.nl/assets/14/52/480x419/nrm_1419442245-billboard-awards-2013.jpg | |
// http://cnl.h.cdn.cosmopolitan.nl/assets/14/52/nrm_1419442245-billboard-awards-2013.jpg | |
(domain_nosub === "cosmopolitan.nl" && domain.match(/h\.cdn\.cosmopolitan\./))) && | |
src.indexOf("/assets/") >= 0) { | |
// http://cos.h-cdn.co/assets/15/10/980x490/landscape_nrm_1425328178-tiffanypps2.jpg | |
// http://cos.h-cdn.co/assets/15/10/landscape_nrm_1425328178-tiffanypps2.jpg -- 1024x512 | |
// http://cos.h-cdn.co/assets/15/10/1425328178-tiffanypps2.jpg -- doesn't work | |
// http://cos.h-cdn.co/assets/15/10/nrm_1425328178-tiffanypps2.jpg -- works, 1024x576 | |
// http://ell.h-cdn.co/assets/15/24/980x490/landscape-1433956992-elle-wit.jpg | |
// http://ell.h-cdn.co/assets/15/24/landscape-1433956992-elle-wit.jpg -- 4000x2000 | |
// http://ell.h-cdn.co/assets/15/24/1433956992-elle-wit.jpg -- 4000x2000 | |
// http://cos.h-cdn.co/assets/16/23/sd-aspect-1465527150-kate-upton.jpg -- 4000x3000 | |
// http://cos.h-cdn.co/assets/16/23/1465527150-kate-upton.jpg -- 4000x3000 | |
return src | |
.replace(/\/[0-9]*x[0-9]*\//, "/") | |
.replace(/\/(?:landscape|[a-z]+-aspect)[-_]((?:nrm_)?[0-9]{5,}[^/]*)(?:[?#].*)?$/, "/$1"); | |
// return src.replace(/(\/assets\/[^/]*\/[^/]*\/)[0-9]+x[0-9]+\//, "$1"); | |
} | |
if (domain === "imgix.ranker.com") { | |
// https://imgix.ranker.com/user_node_img/50076/1001516851/original/sheldon-and-_39_s-in-an-insane-asylum-and-the-show-only-takes-place-in-his-head-photo-u1?w=600&q=50&fm=jpg | |
// https://imgix.ranker.com/user_node_img/50076/1001516851/original/sheldon-and-_39_s-in-an-insane-asylum-and-the-show-only-takes-place-in-his-head-photo-u1?fm=png | |
return src.replace(/\?[^/]*$/, "?fm=png"); | |
} | |
if (domain_nosub === "rnkr-static.com" && | |
domain.match(/^img[0-9]*\./)) { | |
// http://img1.rnkr-static.com/user_node_img/3369/67378502/C250/bree-daniels-people-in-film-photo-u1.jpg | |
// http://img1.rnkr-static.com/user_node_img/3369/67378502/full/bree-daniels-people-in-film-photo-u1.jpg -- has artifacts | |
// http://img1.rnkr-static.com/user_node_img/3369/67378502/full/bree-daniels-people-in-film-photo-u1.png -- 404 | |
// http://imgix.ranker.com/user_node_img/3369/67378502/original/bree-daniels-people-in-film-photo-u1?fm=png | |
// http://img1.rnkr-static.com/node_img/83/1644505/C100/namie-amuro-recording-artists-and-groups-photo-1.jpg | |
// https://imgix.ranker.com/node_img/83/1644505/original/namie-amuro-recording-artists-and-groups-photo-1?fm=png -- looks better, maybe original? | |
// http://img1.rnkr-static.com/node_img/83/1644505/full/namie-amuro-recording-artists-and-groups-photo-1.jpg -- edges are less blurry, but has artifacts | |
return src.replace(/^[a-z]+:\/\/[^/]*\/+((?:user_)?node_img\/+[0-9]+\/+[0-9]+)\/+[^/]*\/+([^/]*)\.[^/.]*(?:[?#].*)?$/, | |
"https://imgix.ranker.com/$1/original/$2?fm=png"); | |
} | |
if (domain_nosub === "imgix.net") { | |
// https://driftt.imgix.net/https%3A%2F%2Fdriftt.imgix.net%2Fhttps%253A%252F%252Fs3.amazonaws.com%252Fcustomer-api-avatars-prod%252F124400%252Fa382421eaa0c3184c7c1588a54a481014za77e245kzk%3Ffit%3Dmax%26fm%3Dpng%26h%3D200%26w%3D200%26s%3Db662f982cf04f9f733dcb1ce4522ee73?fit=max&fm=png&h=200&w=200&s=cd4c2695da2c9621a41fc14e92516b37 | |
// https://driftt.imgix.net/https%3A%2F%2Fs3.amazonaws.com%2Fcustomer-api-avatars-prod%2F124400%2Fa382421eaa0c3184c7c1588a54a481014za77e245kzk?fit=max&fm=png&h=200&w=200&s=b662f982cf04f9f733dcb1ce4522ee73 | |
// https://s3.amazonaws.com/customer-api-avatars-prod/124400/a382421eaa0c3184c7c1588a54a481014za77e245kzk | |
// https://pathwright.imgix.net/https%3A%2F%2Fcdn.filestackcontent.com%2Fapi%2Ffile%2FIKM4hngTeadpScVNjbD6%3Fsignature%3D888b9ea3eb997a4d59215bfbe2983c636df3c7da0ff8c6f85811ff74c8982e34%26policy%3DeyJjYWxsIjogWyJyZWFkIiwgInN0YXQiLCAiY29udmVydCJdLCAiZXhwaXJ5IjogNDYyMDM3NzAzMX0%253D?fit=crop&ixlib=python-1.1.0&w=500&s=7c58aa94c9a2446b0d7552e5574ac39e | |
// https://cdn.filestackcontent.com/api/file/IKM4hngTeadpScVNjbD6?signature=888b9ea3eb997a4d59215bfbe2983c636df3c7da0ff8c6f85811ff74c8982e34&policy=eyJjYWxsIjogWyJyZWFkIiwgInN0YXQiLCAiY29udmVydCJdLCAiZXhwaXJ5IjogNDYyMDM3NzAzMX0%3D | |
// https://mms-images-secure-prod.imgix.net/https%3A%2F%2Fmms-images.out.customink.com%2Fmms%2Fimages%2Fcatalog%2Fcolors%2F116200%2Fviews%2Falt%2Ffront_medium_extended.png%3Fdesign%3Ddjn0-00bm-qyge%26autoNegate%3D1%26digest%3D0000000013%26placeMax%3D1%26placeMaxPct%3D0.8%26placeUseProduct%3D1%26placeUseView%3Dfront?ixlib=rb-1.1.0&w=600&h=600&fit=fill&dpr=1&bg=ffffff&fm=pjpg&trim=auto&trimmd=0&q=50&auto=compress&s=e18d4010b5be78f8d517a26ed971d0a0 | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]+\.imgix\.net\/(https?%3A[^?]+).*?$/, "$1") | |
if (newsrc !== src) | |
return decodeURIComponent(newsrc); | |
} | |
if (domain === "data.whicdn.com") { | |
// https://data.whicdn.com/images/284282683/superthumb.jpg | |
// https://data.whicdn.com/images/284282683/original.jpg | |
return src.replace(/\/[^/.]*\.([^/.]*)$/, "/original.$1"); | |
} | |
if (domain_nosub === "whicdn.com" && domain.match(/^data[0-9]*\./)) { | |
// http://data3.whicdn.com/images/139561907/large.jpg | |
// http://data.whicdn.com/images/139561907/large.jpg | |
return src.replace(/:\/\/data[0-9]*\./, "://data."); | |
} | |
if (domain === "cdn.empireonline.com") { | |
// 12 | |
// https://cdn.empireonline.com/jpg/70/0/0/640/480/aspectfit/0/0/0/0/0/0/c/reviews_films/5a57bf3d652c21bb08ce7fc8/pixar-coco-concept-art.jpg | |
// https://cdn.empireonline.com/c/reviews_films/5a57bf3d652c21bb08ce7fc8/pixar-coco-concept-art.jpg | |
// https://cdn.empireonline.com/jpg/80/0/0/300/170/0/north/0/0/0/0/0/c/reviews_films/5a73e5036bb57fce0af3b5ab/den-of-thieves-1.jpg | |
// https://cdn.empireonline.com/c/reviews_films/5a73e5036bb57fce0af3b5ab/den-of-thieves-1.jpg | |
//return src.replace(/cdn\.empireonline\.com\/(?:jpg|png|gif)\/(?:[0-9]+\/){5}aspectfit\/(?:[0-9]+\/){6}/, "cdn.empireonline.com/"); | |
return src.replace(/cdn\.empireonline\.com\/(?:jpg|png|gif)\/(?:[^/.]+\/){12}/, "cdn.empireonline.com/"); | |
//return urljoin(src, src.replace(/cdn\.empireonline\.com\/(jpg)|(png)|(gif)\/[^/]*\/[^/]*\/[^/]*\/[^/]*\/[^/]*\/[^/]*\/[^/]*\/[^/]*\/[^/]*\/[^/]*\/[^/]*\/[^/]*\//, "/")); | |
} | |
if (domain_nosub === "celebmafia.com" || | |
domain_nosub === "hawtcelebs.com") { | |
return src.replace(/\/([^/]*)_thumbnail\.([^/.]*)$/, "/$1.$2"); | |
} | |
if ((domain_nosub === "pixhost.org" || | |
domain_nosub === "pixhost.to") && | |
domain.match(/^[a-z]*[0-9]*\./)) { | |
// https://t17.pixhost.to/thumbs/469/66269400_ns4w-org-2.jpg | |
// https://img17.pixhost.to/images/469/66269400_ns4w-org-2.jpg | |
// https://t16.pixhost.org/thumbs/419/63150269_dsera-023.jpg | |
// https://img16.pixhost.to/images/419/63150269_dsera-023.jpg | |
return src | |
.replace(/(:\/\/[^/]*\.)pixhost\.org\//, "$1pixhost.to/") | |
.replace(/\/t([0-9]*\.pixhost\.[a-z]*)\/thumbs\//, "/img$1/images/"); | |
} | |
/*if (false && domain.indexOf("ssli.ulximg.com") >= 0) { | |
return src.replace(/\/image\/[0-9]+x[0-9]+\//, "/image/full/"); | |
}*/ | |
if (domain_nosub === "ulximg.com" || | |
// https://www.hotnewhiphop.com/image/620x412/cover/1524605990_feb5e308477137cbfd1b33ec83a5ba73.jpg/a2190aede262d8430a74acf84c6fc2b3/1524605990_b78abf068561f64fc0d7a44ff44dde65.jpg | |
// https://www.hotnewhiphop.com/image/full/cover/1524605990_feb5e308477137cbfd1b33ec83a5ba73.jpg/a2190aede262d8430a74acf84c6fc2b3/1524605990_b78abf068561f64fc0d7a44ff44dde65.jpg | |
// https://www.hotnewhiphop.com/image/full/cover/1524605990_feb5e308477137cbfd1b33ec83a5ba73.jpg -- also works | |
domain_nowww === "hotnewhiphop.com") { | |
// https://sslh.ulximg.com/image/740x493/cover/1517447102_98a80a4ead45fe6ea39dba7f13d82d59.jpg/cf804979603806d94cb139fc0676f0ca/1517447102_4694e8c352198b439a03d90f0ea03910.jpg | |
// https://sslh.ulximg.com/image/full/cover/1517447102_98a80a4ead45fe6ea39dba7f13d82d59.jpg/cf804979603806d94cb139fc0676f0ca/1517447102_4694e8c352198b439a03d90f0ea03910.jpg | |
// https://sslb.ulximg.com/image/640xfull/gallery/1519079706_9a191bef4598aefcd89fdb14d43dd943.jpg/ab146c791e98eccd4a763e2a31fa10ce/1519079706_65c3b37c6f9215a3c80d86f6172920c2.jpg | |
// https://sslb.ulximg.com/image/full/gallery/1519079706_9a191bef4598aefcd89fdb14d43dd943.jpg/ab146c791e98eccd4a763e2a31fa10ce/1519079706_65c3b37c6f9215a3c80d86f6172920c2.jpg | |
// doesn't work for all: | |
// https://sslh.ulximg.com/image/740x493/cover/1517954740_3e7856551e64f1217860014d8853d1e1.jpg | |
return src | |
.replace(/\/image\/[0-9a-z]*x[0-9a-z]*\//, "/image/full/"); | |
//.replace(/(\/cover\/[^/.]*\.[^/.]*)\/.*/, "$1"); | |
} | |
if (domain === "fm.cnbc.com") { | |
// https://fm.cnbc.com/applications/cnbc.com/resources/img/editorial/2018/07/12/105325481-Preview10.600x400.jpeg?v=1531393316 | |
// https://fm.cnbc.com/applications/cnbc.com/resources/img/editorial/2018/07/12/105325481-Preview10.jpeg?v=1531393316 | |
return src.replace(/\.[0-9]+x[0-9]+\.([^/.]*)$/, ".$1"); | |
} | |
if (domain === "images.bwwstatic.com" || | |
// https://newimages.bwwstatic.com/upload11/1600837/tn-500_17stg11.jpg | |
// https://newimages.bwwstatic.com/upload11/1600837/17stg11.jpg | |
domain === "newimages.bwwstatic.com") { | |
// https://images.bwwstatic.com/upload/44785/tn-500_(23).jpg | |
// https://images.bwwstatic.com/upload/44785/(23).jpg | |
// https://images.bwwstatic.com/columnpic10/x170BDEF933D-7AF0-441D-B4212BE606623B0E.jpg.pagespeed.ic.fsaymxZU7N.jpg | |
// https://images.bwwstatic.com/columnpic10/BDEF933D-7AF0-441D-B4212BE606623B0E.jpg | |
// https://images.bwwstatic.com/columnpic10/155x64x170ACAF3A86-10F8-4C49-A5A20BCB3E5870DD.jpg.pagespeed.ic.XjIWMZEHy2.jpg | |
// https://images.bwwstatic.com/columnpic10/ACAF3A86-10F8-4C49-A5A20BCB3E5870DD.jpg | |
return src | |
.replace(/\/tn-[0-9]+_([^/]*)$/, "/$1") | |
.replace(/\/(?:[0-9]+)?x(?:[0-9]*)(?:x[0-9]+)?([^/]*)\.pagespeed\.[^/]*(?:[?#].*)?$/, "/$1"); | |
} | |
if (false && domain === "img.rasset.ie") { | |
// https://img.rasset.ie/000a704c-440.jpg | |
// https://img.rasset.ie/000a704c-9999.jpg -- wildly stretched (4096x6144) | |
return src.replace(/(\/[^/]*)-[0-9]*(\.[^/.]*)$/, "$1-9999$2"); | |
} | |
if (domain === "i.pinimg.com" || | |
// https://i-h2.pinimg.com/474x/2c/03/5a/2c035a1668bfe4fc71abbade44a9423d--flat-design-ui-design.jpg?b=t | |
// https://i-h2.pinimg.com/originals/2c/03/5a/2c035a1668bfe4fc71abbade44a9423d--flat-design-ui-design.jpg?b=t | |
// https://i-h2.pinimg.com/originals/2c/03/5a/2c035a1668bfe4fc71abbade44a9423d--flat-design-ui-design.jpg | |
// https://media-cache-ak0.pinimg.com/originals/fb/c6/9e/fbc69eb3d8a79379e81399ca94d410d2.jpg | |
// https://s-media-cache-ak0.pinimg.com/736x/d0/e6/7d/d0e67d12638858dbad180eaa6e9e4463--lesley-ann-brandt-gay-celebrities.jpg | |
// https://s-media-cache-ak0.pinimg.com/originals/d0/e6/7d/d0e67d12638858dbad180eaa6e9e4463--lesley-ann-brandt-gay-celebrities.jpg | |
(domain_nosub === "pinimg.com" && domain.match(/^(?:i|(?:s-)?media-cache)-[^.]*\.pinimg/)) || | |
// http://s3.amazonaws.com/media.pinterest.com/640x/c9/68/4a/c9684afc422e69662bed9f59835d2001.jpg | |
// http://s3.amazonaws.com/media.pinterest.com/originals/c9/68/4a/c9684afc422e69662bed9f59835d2001.jpg | |
// http://media.pinterest.com.s3.amazonaws.com/640x/c9/68/4a/c9684afc422e69662bed9f59835d2001.jpg | |
// http://media.pinterest.com.s3.amazonaws.com/originals/c9/68/4a/c9684afc422e69662bed9f59835d2001.jpg | |
amazon_container === "media.pinterest.com") { | |
// https://i.pinimg.com/640x/1f/3f/ed/1f3fed6c284955934c7d724d2fe13ecb.jpg | |
// https://i.pinimg.com/originals/1f/3f/ed/1f3fed6c284955934c7d724d2fe13ecb.png | |
// https://i.pinimg.com/640x/a7/db/c3/a7dbc392372f1ca8f744032ba3c5ade1.jpg | |
// https://i.pinimg.com/originals/a7/db/c3/a7dbc392372f1ca8f744032ba3c5ade1.gif | |
src = src.replace(/[?#].*$/, ""); | |
if (src.match(/:\/\/[^/]*\/media\.pinterest\.com\//)) | |
newsrc = src.replace(/(:\/\/[^/]*\/media\.pinterest\.com\/)[^/]*(\/.*\/[^/]*\.[^/.]*)$/, "$1originals$2"); | |
else | |
newsrc = src.replace(/(:\/\/[^/]*\/)[^/]*(\/.*\/[^/]*\.[^/.]*)$/, "$1originals$2"); | |
if (newsrc !== src) { | |
return add_extensions_gif({ | |
url: newsrc, | |
is_original: true | |
}); | |
} | |
} | |
// vg-images.condecdn.net | |
// gl-images.condecdn.net | |
if (domain_nosub === "condecdn.net" && domain.indexOf("images.condecdn.net") >= 0) { | |
// http://vg-images.condecdn.net/image/5LQVw4Pp8rR/crop/1020 | |
// https://vg-images.condecdn.net/image/5LQVw4Pp8rR/original/ | |
// https://gl-images.condecdn.net/image/DAwRBl12EGY/crop/810 | |
// https://gl-images.condecdn.net/image/DAwRBl12EGY/original/ | |
return src.replace(/(\/image\/[^/]*\/).*/, "$1original/"); | |
} | |
if (domain === "media.fromthegrapevine.com" || | |
// http://gretschpages.com/media/img/fretboard/2014/8/snake.jpg.540x540_q85_autocrop.jpg | |
// http://gretschpages.com/media/img/fretboard/2014/8/snake.jpg | |
(domain_nowww === "gretschpages.com" && src.indexOf("/media/img/") >= 0) || | |
// https://pornstars.me/media/pornstars/naomi-woods.jpg.960x0_q85.jpg | |
// https://pornstars.me/media/pornstars/naomi-woods.jpg | |
(domain_nowww === "pornstars.me" && src.indexOf("/media/") >= 0) || | |
// https://www.mediavillage.com/media/articles/alex-wong-17993-unsplash.jpg.1440x1000_q85_box-19%2C0%2C634%2C427_crop_detail.jpg | |
// https://www.mediavillage.com/media/articles/alex-wong-17993-unsplash.jpg | |
domain_nowww === "mediavillage.com") { | |
// https://media.fromthegrapevine.com/assets/images/2017/3/waiting-in-long-line.jpg.824x0_q71_crop-scale.jpg | |
// https://media.fromthegrapevine.com/assets/images/2017/3/waiting-in-long-line.jpg | |
return src.replace(/\/([^/.]*\.[^/.]*)\.[^/.]*\.[^/.]*$/, "/$1"); | |
} | |
if (domain_nosub === "acsta.net" && domain.search(/img[0-9]*\.acsta\.net/) >= 0) { | |
newsrc = src.replace(/acsta\.net\/[^/]*\/pictures\//, "acsta.net/pictures/"); | |
if (newsrc !== src) | |
return newsrc; | |
// http://fr.web.img4.acsta.net/r_640_360/videothumbnails/15/06/05/12/59/008779.jpg | |
// http://fr.web.img4.acsta.net/videothumbnails/15/06/05/12/59/008779.jpg | |
// http://fr.web.img2.acsta.net/c_208_117/videothumbnails/17/02/08/14/59/169562.jpg | |
// http://fr.web.img2.acsta.net/videothumbnails/17/02/08/14/59/169562.jpg | |
return src.replace(/\/[rc]_[0-9]+_[0-9]+\//, "/"); | |
} | |
if (domain === "em.wattpad.com") { | |
// https://em.wattpad.com/10c43b485be3ed7d7dd3e7e24ad6cb9d8a11a264/687474703a2f2f6a656e6d6172696577696c64652e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031352f30332f4576614642436f7665722e6a7067?s=fit&h=360&w=360&q=80 | |
// http://jenmariewilde.com/wp-content/uploads/2015/03/EvaFBCover.jpg | |
// https://em.wattpad.com/08067e2680eba0d36693e085bc95b85c9c0d8f8b/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f776174747061642d6d656469612d736572766963652f53746f7279496d6167652f3062446c6b2d786e5565654d54673d3d2d32303633363333342e313436393133373236306332313733383233313938393638383435332e6a7067?s=fit&w=720&h=720 | |
// https://s3.amazonaws.com/wattpad-media-service/StoryImage/0bDlk-xnUeeMTg==-20636334.1469137260c21738231989688453.jpg | |
return src.replace(/.*\.wattpad\.com\/[a-f0-9]*\/([a-f0-9]*).*/, "$1").replace(/([0-9A-Fa-f]{2})/g, function() { | |
return String.fromCharCode(parseInt(arguments[1], 16)); | |
}); | |
} | |
if (domain_nosub === "nocookie.net" && | |
domain.match(/^vignette[0-9]*\.wikia\./)) { | |
// https://vignette.wikia.nocookie.net/arresteddevelopment/images/2/2a/2015_MM_and_A_TGIT_Party_-_Portia_de_Rossi.jpg/revision/latest/top-crop/width/320/height/320?cb=20151215213157 | |
// https://vignette.wikia.nocookie.net/arresteddevelopment/images/2/2a/2015_MM_and_A_TGIT_Party_-_Portia_de_Rossi.jpg/revision/latest/?cb=20151215213157 | |
// https://vignette.wikia.nocookie.net/kpop/images/9/95/Various_Seulki_I_Only_Want_You_photo.png/revision/latest/scale-to-width-down/350 | |
// https://vignette.wikia.nocookie.net/kpop/images/9/95/Various_Seulki_I_Only_Want_You_photo.png/revision/latest/ | |
// http://vignette3.wikia.nocookie.net/kpop/images/d/da/Gugudan_debut_group_photo.png/revision/latest?cb=20160617225600 -- 200x133 | |
// https://vignette3.wikia.nocookie.net/kpop/images/d/da/Gugudan_debut_group_photo.png/revision/latest?cb=20160617225600 -- 1620x1080 | |
//return src.replace(/(\/images\/[^/]*\/.*)\/scale-to-width-down\/[0-9]*/, "$1"); | |
return src | |
.replace(/\/revision\/([^/]*)\/.*?(\?.*)?$/, "/revision/$1/$2") | |
.replace(/^http:\/\//, "https://"); | |
} | |
if (domain === "static.asiachan.com") { | |
// https://static.asiachan.com/600/38/06/50338.jpg | |
// https://static.asiachan.com/full/38/06/50338.jpg | |
// https://static.asiachan.com/Seohyun.600.171223.jpg | |
// https://static.asiachan.com/Seohyun.full.171223.jpg | |
return src | |
.replace(/(\/[^/]*\.)[0-9]*(\.[0-9]*\.[^/.]*$)/, "$1full$2") | |
.replace(/(:\/\/[^/]*\/)[0-9]+(\/[0-9]+\/[0-9]+\/[0-9]+\.[^/.]*)$/, "$1full$2"); | |
} | |
if (domain === "pic.xiami.net" || | |
// https://club-img.kdslife.com/attach/1k2/jm/36/p79ee9-1m6r.jpg@1o_1l_600w_90q.jpg | |
// https://club-img.kdslife.com/attach/1k2/jm/36/p79ee9-1m6r.jpg -- stretched? | |
domain === "club-img.kdslife.com" || | |
// http://p0.meituan.net/movie/86f093dd1c7dfb6306ab488c958be31d356758.png@200w_1l | |
// http://p0.meituan.net/movie/86f093dd1c7dfb6306ab488c958be31d356758.png | |
domain === "p0.meituan.net" || | |
// http://piccn.ihuaben.com/pic/mark/201903/1552277921814-Vi79361274_540-540.jpeg@200w | |
// http://piccn.ihuaben.com/pic/mark/201903/1552277921814-Vi79361274_540-540.jpeg | |
(domain === "piccn.ihuaben.com" && src.indexOf("/pic/") >= 0) || | |
// http://oss2.lanlanlife.com/188de9f8b0de57a55b503fca041f1781_846x564.jpg@!2-w750-80-jpg | |
// http://oss2.lanlanlife.com/188de9f8b0de57a55b503fca041f1781_846x564.jpg | |
(domain_nosub === "lanlanlife.com" && /^oss[0-9]*\./.test(domain)) || | |
// http://img.sdxapp.com/say/source/12/d2/12d2bb054022c4fc1038f3e4d279353d.jpg@600w_400h | |
// http://img.sdxapp.com/say/source/12/d2/12d2bb054022c4fc1038f3e4d279353d.jpg | |
domain === "img.sdxapp.com") { | |
// http://pic.xiami.net/images/artistlogo/43/15296162953243.png@!c-330-330 | |
// http://pic.xiami.net/images/artistlogo/43/15296162953243.png | |
newsrc = src.replace(/@[^/]*$/, ""); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "oss.tan8.com") { | |
// https://oss.tan8.com/resource/attachment/2019/201908/32b8d7076aa5dd7f340511ed1a7a5e78_thumb.jpg | |
// https://oss.tan8.com/resource/attachment/2019/201908/32b8d7076aa5dd7f340511ed1a7a5e78.jpg | |
return src.replace(/(\/resource\/+attachment\/+[0-9]{4}\/+[0-9]{6}\/+[0-9a-f]{20,})_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2"); | |
} | |
if (domain_nowww === "ultimate-guitar.com") { | |
// https://www.ultimate-guitar.com/static/storage/album/images/4/0/4073dfb6d00c5097ccffd68e6872014492625d3b.jpg@115 | |
// https://www.ultimate-guitar.com/static/storage/album/images/4/0/4073dfb6d00c5097ccffd68e6872014492625d3b.jpg | |
return src.replace(/(\/images\/+(?:[0-9a-f]\/+){2}[0-9a-f]+\.[^/.]*?)@[0-9]+(?:[?#].*)?$/, "$1"); | |
} | |
// img4.c.yinyuetai.com | |
if ((domain_nosub === "yinyuetai.com" && domain.match(/^img[0-9]*\.c\.yinyuetai\.com/)) || | |
// http://img0.yytcdn.com/video/mv/160701/2609575/-M-73056332b149ae15daed84981c3ba4c4_240x135.jpg | |
// http://img0.yytcdn.com/video/mv/160701/2609575/-M-73056332b149ae15daed84981c3ba4c4_0x0.jpg | |
(domain_nosub === "yytcdn.com" && domain.match(/^img[0-9]*\./))) { | |
// http://img0.c.yinyuetai.com/video/mv/180802/0/-M-f2e73b6131de7338d8375c82e7e60f70_240x135.jpg | |
// http://img0.c.yinyuetai.com/video/mv/180802/0/-M-f2e73b6131de7338d8375c82e7e60f70_0x0.jpg | |
// http://img1.c.yinyuetai.com/user/avatar/170813/4165907-1502610570582/-M-3fe425e60e2fcf46bad875cc638be60f_180x180.jpg | |
// http://img1.c.yinyuetai.com/user/avatar/170813/4165907-1502610570582/-M-3fe425e60e2fcf46bad875cc638be60f_0x0.jpg -- doesn't work | |
return src.replace(/[0-9]+x[0-9]+(\.[^/.]*)$/, "0x0$1"); | |
} | |
// it also has img7.qiyipic.com, which hosts /passport/, which doesn't work with this (mp2.qiyipic.com) | |
// test cases can be found, but can't find referer headers | |
if (domain.search(/mp[0-9]*\.qiyipic\.com/) >= 0 && src.indexOf("/passport/") < 0) { | |
return src.replace(/[0-9]*_[0-9]*(\.[^/.]*)$/, "0_0$1"); | |
} | |
if (domain === "b-ssl.duitang.com") { | |
// https://b-ssl.duitang.com/uploads/item/201508/01/20150801214854_2Vr53.thumb.700_0.jpeg -- 403 | |
// https://b-ssl.duitang.com/uploads/item/201508/01/20150801214854_2Vr53.jpeg -- works | |
return src.replace(/\.thumb\.[0-9]+_[0-9]+\./, "."); | |
} | |
if (domain_nosub === "vcimg.com" && | |
domain.match(/i-[0-9]\.vcimg.com/)) { | |
// http://i-7.vcimg.com/trim/8d8fb8b28853070f596166213f455c1c1806479/trim.jpg | |
// http://i-7.vcimg.com/8d8fb8b28853070f596166213f455c1c1806479/trim.jpg | |
// http://i-7.vcimg.com/crop/c626725e944a9b4bd836f20be4ebf264254823(600x)/thumb.jpg | |
// http://i-7.vcimg.com/c626725e944a9b4bd836f20be4ebf264254823(600x)/thumb.jpg | |
// http://i-7.vcimg.com/c626725e944a9b4bd836f20be4ebf264254823/thumb.jpg | |
// http://i-7.vcimg.com/7f4b42387d185e716a73dbe687badd6a54387%28280x%29/thumb.jpg | |
// http://i-7.vcimg.com/7f4b42387d185e716a73dbe687badd6a54387/thumb.jpg | |
// filename can be anything | |
return src.replace(/\/(?:crop|trim)\//, "/").replace(/(\/[0-9a-f]+)(?:\(|%28)[0-9]+x(?:[0-9]+)?(?:\)|%29)\//, "$1/"); | |
} | |
if (domain_nosub === "zhimg.com" && | |
domain.match(/pic[0-9]\.zhimg\.com/)) { | |
// https://pic1.zhimg.com/74c63994d55e7307d41d39066d53eb72_1200x500.jpg | |
// https://pic1.zhimg.com/74c63994d55e7307d41d39066d53eb72.jpg | |
// https://pic1.zhimg.com/74c63994d55e7307d41d39066d53eb72_r.jpg | |
// https://pic1.zhimg.com/80/4ae63ae895f29a18e035d78aad1804d8_hd.png | |
// https://pic1.zhimg.com/80/4ae63ae895f29a18e035d78aad1804d8.png | |
// https://pic1.zhimg.com/80/4ae63ae895f29a18e035d78aad1804d8_r.png | |
// https://pic3.zhimg.com/90/v2-d9e93a3b23f6fe8ff5bfbb07317dce9f_250x0.jpg | |
// https://pic3.zhimg.com/90/v2-d9e93a3b23f6fe8ff5bfbb07317dce9f_r.jpg | |
// https://pic1.zhimg.com/v2-6349cfe0f38eab94c9fc41a919c526c4_540x450.jpeg -- 540x540 | |
// https://pic1.zhimg.com/v2-6349cfe0f38eab94c9fc41a919c526c4_r.jpeg -- 540x540 | |
// doesn't work with google's referer | |
return { | |
url: src.replace(/\/((?:v[0-9]*-)?[0-9a-f]+)(?:_[^/._]*)?(\.[^/.]*)$/, "/$1_r$2"), | |
headers: { | |
Referer: "" | |
}, | |
referer_ok: { | |
same_domain: true | |
} | |
}; | |
} | |
// seems to returns 403 if 'referer' header is set: | |
// {"code":"40310014","msg":"invalid Referer header"} | |
if (domain === "img.hb.aicdn.com" || | |
// https://hbimg.huabanimg.com/bf5ac958cea88fb4342a6a1e7d1238eb428879613bb18-Rv4G6g_fw78 | |
// https://hbimg.huabanimg.com/bf5ac958cea88fb4342a6a1e7d1238eb428879613bb18-Rv4G6g | |
domain === "hbimg.huabanimg.com" || | |
domain_nosub === "upaiyun.com") { | |
// http://img.hb.aicdn.com/504850944a803cb529c8ea7672c7959aa930b911b37e7-FjZhoC_fw658 | |
// http://hbimg.b0.upaiyun.com/61a5e5496ff85c52aedb1a0b88cfa6cf2fab85b25baa4-OOfVFz_fw236 | |
// http://hbimg.b0.upaiyun.com/24c9187996fff6a463a6e0cf33e445a5c106f840110dad-GoXNdV_fw658 | |
// http://hbimg.b0.upaiyun.com/eb022d252413c843904d7929cd20efad6ce5ad1d1a13b-nuwiDc_fw236 | |
// http://hbimg.b0.upaiyun.com/2dee7739bd27dac4368381fc5e571fc5efffa0dc1b2530-76nu98 | |
// http://hbimg.b0.upaiyun.com/26f0536f7035fde61b7332a3bbf1e54bf0255c4d2d07b-gZ7snl_fw658 | |
return { | |
url: src.replace(/_[^/_]*$/, ""), | |
headers: { | |
Referer: "" | |
} | |
}; | |
// return src.replace(/_fw[0-9]*$/, ""); | |
} | |
if (domain === "imagev2.xmcdn.com") { | |
// http://imagev2.xmcdn.com/group22/M07/3C/67/wKgJM1rvlETB0ToJAAfrPV-PTII537.jpg!op_type=5&upload_type=album&device_type=ios&name=mobile_large&strip=0&quality=7 | |
// http://imagev2.xmcdn.com/group22/M07/3C/67/wKgJM1rvlETB0ToJAAfrPV-PTII537.jpg | |
// https://i2.wp.com/imagev2.xmcdn.com/group35/M08/4B/55/wKgJnFoJZEeyBE1iAAVLw1BLZEE066_mobile_large.jpg!op_type=5&upload_type=album&device_type=ios&name=mobile_large&magick=jpg&strip=1&quality=6 | |
// http://imagev2.xmcdn.com/group35/M08/4B/55/wKgJnFoJZEeyBE1iAAVLw1BLZEE066.jpg | |
// http://imagev2.xmcdn.com/group21/M01/EC/AE/wKgJKFiGm4_DV0_TAAJWeaCCpzE969.jpg!op_type=5&upload_type=album&device_type=ios&name=mobile_large&strip=0&quality=7 | |
// http://imagev2.xmcdn.com/group21/M01/EC/AE/wKgJKFiGm4_DV0_TAAJWeaCCpzE969.jpg | |
return src.replace(/![^/]*$/, "").replace(/(\/[^/]*?)(?:_[a-z_]+)?(\.[^/.]*)$/, "$1$2"); | |
} | |
if ((domain_nosub === "bdimg.com" || domain_nosub === "baidu.com") && | |
// https://timg04.bdimg.com/timg?wapbaike&quality=60&size=b396_593&sec=1349839550&di=55fd97fcbc1e84aca81eda03ac89fa53&src=http://imgsrc.baidu.com/baike/pic/item/a1ec08fa513d2697a2dc0cf653fbb2fb4316d80a.jpg | |
// http://imgsrc.baidu.com/baike/pic/item/a1ec08fa513d2697a2dc0cf653fbb2fb4316d80a.jpg | |
(domain.match(/timg.*?\.bdimg\.com/) || | |
domain.match(/timg.*?\.baidu\.com/))) { | |
// https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1490961932774&di=65b21e6bef59bf6b1f6e71f18f46008c&imgtype=0&src=http%3A%2F%2Fqcloud.dpfile.com%2Fpc%2FqqYXMqI9j2MqLzJ3hKYFqx6407skBHDx-gKkvyfBaUcZWk8eZQMRW2FeuVD9x_wbTYGVDmosZWTLal1WbWRW3A.jpg | |
// http://qcloud.dpfile.com/pc/qqYXMqI9j2MqLzJ3hKYFqx6407skBHDx-gKkvyfBaUcZWk8eZQMRW2FeuVD9x_wbTYGVDmosZWTLal1WbWRW3A.jpg | |
newsrc = decodeURIComponent(src.replace(/.*\/[^/]*[?&]src=([^&]*).*/, "$1")); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if ((domain_nosub === "bdstatic.com" || | |
domain_nosub === "baidu.com") && | |
domain.match(/gss[0-9]*\./)) { | |
if (src.indexOf("/timg?") >= 0) { | |
// https://gss3.bdstatic.com/84oSdTum2Q5BphGlnYG/timg?wapp&quality=80&size=b150_150&subsize=20480&cut_x=0&cut_w=0&cut_y=0&cut_h=0&sec=1369815402&srctrace&di=c10cad3328e6895cc32131aa4cfa7d32&wh_rate=null&src=http%3A%2F%2Fimgsrc.baidu.com%2Fforum%2Fpic%2Fitem%2F90529822720e0cf3c1045a710046f21fbf09aa4c.jpg | |
// http://imgsrc.baidu.com/forum/pic/item/90529822720e0cf3c1045a710046f21fbf09aa4c.jpg | |
return { | |
url: decodeURIComponent(src.replace(/.*?\/timg.*?[?&]src=([^&]*).*/, "$1")), | |
head_wrong_contenttype: true | |
}; | |
} | |
if (src.indexOf("/sign=") >= 0 || | |
src.indexOf("/pic/item/") >= 0) { | |
// HEAD request gives text/html | |
// https://gss1.bdstatic.com/9vo3dSag_xI4khGkpoWK1HF6hhy/baike/w%3D268%3Bg%3D0/sign=3cca8ea804087bf47dec50efcae83011/d058ccbf6c81800a388738edb73533fa838b47f6.jpg | |
// https://imgsrc.baidu.com/baike/pic/item/d058ccbf6c81800a388738edb73533fa838b47f6.jpg | |
return { | |
url: src.replace(/:\/\/[^/]*\/[^/]*\//, "://imgsrc.baidu.com/"), | |
head_wrong_contenttype: true | |
}; | |
} | |
} | |
if (domain === "imgsrc.baidu.com" || | |
// http://c.hiphotos.baidu.com/forum/w%3D272%3Bq%3D80%3Bg%3D0/sign=9a65dccd7f8da9774e2f812c826a8924/bf848226cffc1e175a7793cf4690f603728de936.jpg?&src=http%3A%2F%2Fimgsrc.baidu.com%2Fforum%2Fpic%2Fitem%2Fbf848226cffc1e175a7793cf4690f603728de936.jpg | |
// http://imgsrc.baidu.com/forum/pic/item/bf848226cffc1e175a7793cf4690f603728de936.jpg | |
// http://f.hiphotos.baidu.com/zhidao/wh=600,800/sign=be7fdbc3034f78f0805e92f54901266d/a9d3fd1f4134970a75dc55b895cad1c8a6865dfd.jpg | |
// http://f.hiphotos.baidu.com/zhidao/pic/item/a9d3fd1f4134970a75dc55b895cad1c8a6865dfd.jpg | |
(domain_nosub === "baidu.com" && domain.match(/^(?:[a-z]\.)?hiphotos\./)) || | |
// thanks to fireattack on github: https://github.com/qsniyg/maxurl/issues/22 | |
// https://imgsa.baidu.com/forum/w%3D580/sign=b48af07db34543a9f51bfac42e168a7b/2b3e91160924ab1890b8cfbe31fae6cd7a890b60.jpg | |
// https://imgsa.baidu.com/forum/pic/item/2b3e91160924ab1890b8cfbe31fae6cd7a890b60.jpg | |
domain === "imgsa.baidu.com") { | |
// http://imgsrc.baidu.com/forum/wh%3D200%2C90%3B/sign=a5aa97f7bb7eca80125031e5a113bbe4/f7582e381f30e924af22ade547086e061c95f734.jpg | |
// http://imgsrc.baidu.com/forum/wh=200,90;/sign=a5aa97f7bb7eca80125031e5a113bbe4/f7582e381f30e924af22ade547086e061c95f734.jpg | |
// http://imgsrc.baidu.com/forum/w%3D580%3B/sign=fc7fb3a148a98226b8c12b2fbab9bb01/7af40ad162d9f2d34097153ba2ec8a136227cc5b.jpg - slightly larger | |
// http://imgsrc.baidu.com/forum/pic/item/f7582e381f30e924af22ade547086e061c95f734.jpg - orig? | |
// http://imgsrc.baidu.com/forum/abpic/item/dda5e6fe9925bc31b6fe8f4b5edf8db1ca137017.jpg | |
// http://imgsrc.baidu.com/forum/pic/item/dda5e6fe9925bc31b6fe8f4b5edf8db1ca137017.jpg | |
// http://imgsrc.baidu.com/forum/w%3D415/sign=e28730d85edf8db1bc2e7d653c22dddb/b164910a304e251f2b2dd5b8a786c9177e3e536c.jpg | |
// http://imgsrc.baidu.com/forum/pic/item/b164910a304e251f2b2dd5b8a786c9177e3e536c.jpg | |
// https://gss1.bdstatic.com/9vo3dSag_xI4khGkpoWK1HF6hhy/baike/h%3D160/sign=750b8bdd9ceef01f52141cc3d0ff99e0/9345d688d43f879465467a97da1b0ef41ad53ac9.jpg | |
// https://gss1.bdstatic.com/9vo3dSag_xI4khGkpoWK1HF6hhy/baike/w%3D268%3Bg%3D0/sign=7f8d6ceafe246b607b0eb572d3c37d71/9345d688d43f879465467a97da1b0ef41ad53ac9.jpg | |
// https://gss1.bdstatic.com/9vo3dSag_xI4khGkpoWK1HF6hhy/baike/c0=baike933,5,5,933,330/sign=6ccfd69a7bf08202399f996d2a929088/9345d688d43f879465467a97da1b0ef41ad53ac9.jpg | |
// https://imgsrc.baidu.com/baike/c0=baike933,5,5,933,330/sign=6ccfd69a7bf08202399f996d2a929088/9345d688d43f879465467a97da1b0ef41ad53ac9.jpg | |
// http://imgsrc.baidu.com/baike/pic/item/9345d688d43f879465467a97da1b0ef41ad53ac9.jpg | |
newsrc = decodeURIComponent(src.replace(/.*\/[^/]*[?&]src=([^&]*).*/, "$1")); | |
if (newsrc !== src) | |
return newsrc; | |
newsrc = src | |
.replace("/abpic/item/", "/pic/item/") | |
.replace(/\/[^/]*(?:=|%3D)[^/]*\/sign=[^/]*\//, "/pic/item/"); | |
return { | |
url: newsrc, | |
head_wrong_contenttype: true | |
}; | |
} | |
if (domain_nosub === "baidu.com" && domain.indexOf("himg.baidu.com") >= 0) { | |
// http://tb.himg.baidu.com/sys/portrait/item/57cf0859 | |
// http://tb.himg.baidu.com/sys/portraitn/item/57cf0859 | |
// http://tb.himg.baidu.com/sys/portraitm/item/57cf0859 | |
// http://tb.himg.baidu.com/sys/portraitl/item/57cf0859 | |
// http://tb.himg.baidu.com/sys/original/item/57cf0859 (doesn't matter the text, can be anything other than the ones above) | |
// http://himg.baidu.com/sys/original/item/57cf4b616e6748796559656f6e0859 | |
return src.replace(/\/sys\/[^/]*\/item\//, "/sys/original/item/"); | |
} | |
// p2.xiaohx.net | |
// test urls can be found, but all are 403, even from the website | |
// https://www.xiaohx.org/ (new address) | |
// https://ftp.vpnx.cn:8080/WNZMFU.jpg | |
/*if (false && domain.search(/p[0-9]*\.xiaohx\.net/) >= 0) { | |
// http://p2.xiaohx.net/thumb/VZlQhgoo1.jpg | |
// http://p2.xiaohx.net/VZlQhgoo1.jpg | |
return src.replace("/thumb/", "/"); | |
}*/ | |
// img1.doubanio.com | |
if (domain_nosub === "doubanio.com" && | |
domain.match(/^img[0-9]*\./)) { | |
// https://img3.doubanio.com/lpic/s26811681.jpg | |
// https://img3.doubanio.com/opic/s26811681.jpg | |
// https://img3.doubanio.com/img/musician/small/24961.jpg | |
// https://img3.doubanio.com/img/musician/large/24961.jpg | |
// https://img3.doubanio.com/pview/musician/raw/public/p24961.jpg | |
// https://img3.doubanio.com/pview/event_poster/large/public/ac898415e6278f1.jpg | |
// https://img3.doubanio.com/pview/event_poster/raw/public/ac898415e6278f1.jpg | |
// https://img1.doubanio.com/img/celebrity/large/24687.jpg | |
// https://img1.doubanio.com/pview/celebrity/raw/public/p24687.jpg | |
// https://img1.doubanio.com/view/celebrity/l_ratio_celebrity/public/p24687.webp | |
// https://img1.doubanio.com/pview/celebrity/raw/public/p24687.jpg -- webp doesn't work | |
// https://img3.doubanio.com/view/photo/sqxs/public/p2223361605.webp | |
// https://img3.doubanio.com/pview/photo/raw/public/p2223361605.jpg | |
// https://img3.doubanio.com/view/subject/s/public/s4580920.jpg | |
// https://img3.doubanio.com/view/subject/raw/public/s4580920.webp | |
// https://img3.doubanio.com/view/subject/raw/public/s4580920.jpg | |
// https://img3.doubanio.com/img/trailer/small/2538645310.jpg? | |
// https://img3.doubanio.com/img/trailer/medium/2538645310.jpg? | |
newsrc = src.replace(/\/img\/+trailer\/+small\/+/, "/img/trailer/medium/"); | |
if (newsrc !== src) | |
return newsrc; | |
newsrc = src | |
.replace(/\/[a-z]+(\/public\/[a-f0-9]+\.[^/.]*)$/, "/raw$1") | |
.replace(/\/(?:small|medium)\//, "/large/") | |
.replace(/\/[a-z]pic\//, "/opic/") | |
.replace(/\/+img\/+([^/]*)\/+[^/]*\/+([0-9]+[^/]*)(?:[?#].*)?$/, | |
"/pview/$1/raw/public/p$2"); | |
if (newsrc !== src) | |
return newsrc; | |
newsrc = src.replace(/\/view\/+subject\/+[a-z]+\/+/, "/view/subject/raw/"); | |
if (newsrc !== src) | |
return newsrc; | |
if (src.match(/\/+view\/+([^/]*)\/+[^/]*\/+/)) { | |
newsrc = src.replace(/\/+view\/+([^/]*)\/+[^/]*\/+/, "/pview/$1/raw/"); | |
if (newsrc !== src) | |
return add_extensions(newsrc.replace(/\.webp(?:[?#].*)?$/, ".jpg")); | |
} | |
return { | |
url: src, | |
head_wrong_contentlength: true | |
}; | |
} | |
if (domain === "img.idol001.com") { | |
// https://img.idol001.com/thumbnail/2014/12/14/e7e8a98d3a6553e71c3014549e07c7301418560761.jpg | |
// https://img.idol001.com/origin/2014/12/14/e7e8a98d3a6553e71c3014549e07c7301418560761.jpg | |
// http://img.idol001.com/origin/2017/07/12/a4b9f31547c1a41a36606d1f6d94ceff1499865415_watermark.jpg | |
// http://img.idol001.com/origin/2017/07/12/a4b9f31547c1a41a36606d1f6d94ceff1499865415.jpg | |
return src | |
.replace(/(:\/\/[^/]*\/+)thumbnail\/+/, "$1origin/") | |
.replace(/(\/[0-9a-f]+)_watermark(\.[^/.]*)$/, "$1$2"); | |
} | |
if (domain === "star-img.idol001.com") { | |
// https://star-img.idol001.com/atlas/7179/images/2019/8/23/kCfYaPyRaS1566559898247.jpg/default-w720 | |
// https://star-img.idol001.com/atlas/7179/images/2019/8/23/kCfYaPyRaS1566559898247.jpg | |
return src.replace(/(\/images\/+[0-9]{4}\/+(?:[0-9]{1,2}\/+){2}[^/]+\.[^/.]+)\/+[^/]*(?:[?#].*)?$/, "$1"); | |
} | |
// for media.nrj.fr | |
// http://media.nrj.fr/1900x1200/2017/11/selena-gomez-et-ariana-grande_7134.jpg | |
// http://media.nrj.fr/800x600/2017/12/cover-ariana-grande-jpg5981_1375899.jpg | |
// http://media.nrj.fr/436x327/113-jpg_200414.jpg | |
// http://media.nrj.fr/1400x1400/2017/09/guillaume-radio-podcasts-_388327.jpg | |
// http://media.nrj.fr/360x270/2017/07/julien-dore_5171.jpg | |
// http://media.nrj.fr/300x500/2015/08/11907170-1042189502503923-8150073793944711126-n-jpg-9164253.jpg | |
// http://media.nrj.fr/160x120/2014/10/logodjbuzz-3159-1111-8790_8361.jpg | |
// http://media.nrj.fr/manu69/2017/06/fugitif-paris-2.jpg | |
// http://media.nrj.fr/217x326/2013/05/the-big-bang-theory-penny_9252.jpg | |
// http://media.nrj.fr/200x150/2017/01/cover-kanye-west-jpg638_1351247.jpg | |
// http://image-api.nrj.fr/02_5a02579e3cb49.png?w=730&h=410 | |
// http://image-api.nrj.fr/02_5a02579e3cb49.png | |
// http://image-api.nrj.fr/une-chance-sur-deux_5a7ad778514a1.jpg | |
// http://image-api.nrj.fr/6-jobs-etudiants-qui-recrutent-en-periode-de-fetes-istock-519555835_584fb5cc450ec.jpg | |
// http://players.nrjaudio.fm/live-metadata/player/img/600x/196622-202066.JPG | |
// http://www.nrj.fr/img/nrjactive/orientation/motivations/relever_des_defis.jpg | |
// http://cdn.nrj-platform.fr/uploads/pages/58c59bc78b042_capture-d-cran-2017-03-12--20-03-22.jpg | |
// while it can be downscaled, it can't be upscaled, can't find any other pattern | |
if (domain === "image-api.nrj.fr") { | |
// http://image-api.nrj.fr/http/players.nrjaudio.fm%2Flive-metadata%2Fplayer%2Fimg%2Fplayer-files%2Fnrj%2Flogos%2F640x640%2FP_logo_NRJ_wr_La_Playlist_du_jeudi_New.png?w=360&h=360 | |
// http://players.nrjaudio.fm/live-metadata/player/img/player-files/nrj/logos/640x640/P_logo_NRJ_wr_La_Playlist_du_jeudi_New.png | |
// https://image-api.nrj.fr/https/players.nrjaudio.fm%2Flive-metadata%2Fplayer%2Fimg%2Fplayer-files%2Fnosta%2Flogos%2Fmobile_2%2FPODCASTS-NOSTALGIE-La-Story-Nostalgie.jpg | |
// https://players.nrjaudio.fm/live-metadata/player/img/player-files/nosta/logos/mobile_2/PODCASTS-NOSTALGIE-La-Story-Nostalgie.jpg | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/(https?)\/([^/?&#]*).*?$/, "$1://$2"); | |
if (newsrc !== src) | |
return decodeURIComponent(newsrc); | |
//return "http://" + decodeURIComponent(src.replace(/.*\.nrj\.fr\/http\/([^/?&]*).*/, "$1")); | |
} | |
if (domain_nowww === "norwalkreflector.com" && | |
src.indexOf("/image/") >= 0) { | |
// http://www.norwalkreflector.com/image/2018/06/25/x700_q30/Scott-Hamernik-badge.jpg | |
// http://www.norwalkreflector.com/image/2018/06/25/Scott-Hamernik-badge.jpg | |
return src.replace(/(\/image\/[0-9]*\/[0-9]*\/[0-9]*\/)[^/]*\/([^/]+)$/, "$1$2"); | |
} | |
if (domain === "assets.bwbx.io") { | |
// https://assets.bwbx.io/images/users/iqjWHBFdfxIU/iY0p6s6mL24Q/v3/800x-1.png | |
// https://assets.bwbx.io/images/users/iqjWHBFdfxIU/iY0p6s6mL24Q/v3/-1x-1.png | |
// https://assets.bwbx.io/images/users/iqjWHBFdfxIU/iulaO7VvcFII/v0/1200x1200.jpg | |
// https://assets.bwbx.io/images/users/iqjWHBFdfxIU/iulaO7VvcFII/v0/-1x-1.jpg -- 800x533 | |
// https://assets.bwbx.io/images/users/iqjWHBFdfxIU/iulaO7VvcFII/v0/0x0.jpg -- 800x533 | |
return src.replace(/\/[-0-9]*x[-0-9]*(\.[^/]*)$/, "/-1x-1$1"); | |
} | |
if (domain === "file.osen.co.kr") { | |
// http://file.osen.co.kr/article_thumb/2018/01/25/201801251451774572_5a6975efc76bc_120x68.jpg | |
// http://file.osen.co.kr/article/2018/01/25/201801251451774572_5a6975efc76bc.jpg | |
// http://file.osen.co.kr/article/original/2018/01/25/201801251451774572_5a6975efc76bc.jpg | |
// thanks to Bobfrnw on greasyfork for reporting this issue: | |
// http://file.osen.co.kr/article/2019/02/21/201902211510774248_5c6e40fd4a1e8_1024x.jpg -- 1024x657 (proper) | |
// http://file.osen.co.kr/article/2019/02/21/201902211510774248_5c6e40fd4a1e8.jpg -- 650x417 (downscaled) | |
// http://file.osen.co.kr/article/original/2019/02/21/201902211510774248_5c6e40fd4a1e8.jpg -- 4731x3039 | |
// doesn't work for gifs? | |
// http://file.osen.co.kr/article/2017/05/16/201705162046770073_591ae7395381a.gif | |
// http://file.osen.co.kr/article/original/2017/05/16/201705162046770073_591ae7395381a.gif -- doesn't work | |
// doesn't work for older files? later 20120916 works, earlier 20120916 doesn't | |
// http://file.osen.co.kr/article_thumb/2012/08/22/201208221430778898_1_80x.jpg | |
// http://file.osen.co.kr/article/2012/08/22/201208221430778898_1.jpg | |
// http://file.osen.co.kr/article/original/2012/08/22/201208221430778898_1.jpg -- doesn't work | |
newsrc = src.replace(/\/article_thumb\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9]+(?:_[^/._]*)?)_[0-9]+x(?:[0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, | |
"/article/$1$2"); | |
if (newsrc !== src) | |
return newsrc; | |
return src | |
.replace("/article_thumb/", "/article/") | |
.replace(/\/article\/+([0-9]{4})\//, "/article/original/$1/") | |
.replace(/_[0-9]+x(?:[0-9]+)?(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "thumbnews.nateimg.co.kr") { | |
// http://thumbnews.nateimg.co.kr/news130/http://news.nateimg.co.kr/orgImg/nn/2018/03/30/201803302311296710_1.jpg | |
// http://news.nateimg.co.kr/orgImg/nn/2018/03/30/201803302311296710_1.jpg | |
// http://thumbnews.nateimg.co.kr/mnews105/http://news.nateimg.co.kr/orgImg/dh/2018/03/30/b38bab99257a78968bceed1266895c20.jpg | |
// http://news.nateimg.co.kr/orgImg/dh/2018/03/30/b38bab99257a78968bceed1266895c20.jpg | |
return src.replace(/.*\/(?:view|m?news)[0-9]*\//, ""); | |
} | |
if (domain === "thumb.pann.com") { | |
// http://thumb.pann.com/tc_100x75/http://fimg4.pann.com/new/download.jsp?FileID=45339728 | |
// http://fimg4.pann.com/new/download.jsp?FileID=45339728 | |
return src.replace(/^[a-z]+:\/\/[^/]*\/[^/]*\//, ""); | |
} | |
if (domain_nosub === "nate.com" && domain.indexOf(".video.nate.com") >= 0) { | |
// http://mpmedia003.video.nate.com/img/thumb/75_57/006/76/00/0F/B_20180413100402594366711006.jpg | |
// http://mpmedia003.video.nate.com/img/006/76/00/0F/B_20180413100402594366711006.jpg | |
return src.replace(/\/img\/thumb\/[0-9]+[^/]*\//, "/img/"); | |
} | |
if (false && domain.indexOf("img.sedaily.com") >= 0) { | |
// http://www.sedaily.com/Photo/Gallery/Viewer/2154#48592 | |
// http://img.sedaily.com/Photo/Gallery/2018/05/2154_b.jpg | |
// http://img.sedaily.com/Photo/Gallery/2018/05/2154.jpg -- completely different picture | |
// http://img.sedaily.com/Photo/Unit/2018/05/48592_s.jpg | |
// http://img.sedaily.com/Photo/Unit/2018/05/48592.jpg -- proper | |
// http://img.sedaily.com/Photo/Gallery/2018/05/2149_b.jpg | |
// http://img.sedaily.com/Photo/Gallery/2018/05/2149.jpg -- works | |
// http://img.sedaily.com/Photo/Unit/2018/05/48368.jpg -- same | |
// http://newsimg.sedaily.com/2018/05/20/1RZLV7PG9Q_2_m.jpg | |
// http://newsimg.sedaily.com/2018/05/20/1RZLV7PG9Q_2.jpg -- works | |
// http://newsimg.sedaily.com/2018/06/15/1S0TG51GGK_1_m.jpg | |
// http://newsimg.sedaily.com/2018/06/15/1S0TG51GGK_1.jpg -- works | |
// https://newsimg.sedaily.com/2018/07/15/1S23EZEURP_1_m.jpg | |
// https://newsimg.sedaily.com/2018/07/15/1S23EZEURP_1.jpg -- works | |
return src.replace(/(\/[0-9]*)_[^/.]*(\.[^/.]*)$/, "$1$2"); | |
} | |
if (domain === "newsimg.sedaily.com") { | |
// https://www.sedaily.com/NewsView/1VN4SN68DC | |
// https://newsimg.sedaily.com/2019/08/27/1VN4SN68DC_1_m.jpg | |
// https://newsimg.sedaily.com/2019/08/27/1VN4SN68DC_1.jpg | |
// other: | |
// https://newsimg.sedaily.com/2018/11/26/1S7C8XI4V3_1.jpg -- 4656x3091 | |
newsrc = src.replace(/(\/[0-9]{4}\/+(?:[0-9]{2}\/+){2}[^/_]+_[0-9]+)_[a-z](\.[^/.]*)(?:[?#].*)?$/, "$1$2"); | |
if (newsrc !== src) | |
return newsrc; | |
var extra = {}; | |
match = src.match(/\/[0-9]{4}\/+(?:[0-9]{2}\/+){2}([^/_]+)_[0-9]+(?:_[a-z])?\.[^/.]*(?:[?#].*)?$/); | |
if (match) { | |
extra.page = "https://www.sedaily.com/NewsView/" + match[1]; | |
} | |
return { | |
url: src, | |
extra: extra | |
}; | |
} | |
if (domain === "stat.ameba.jp" || | |
domain === "stat.profile.ameba.jp") { | |
return src.replace(/\/t[0-9]*_([^/]*)$/, "/o$1"); | |
} | |
//if (domain === "livedoor.blogimg.jp") { | |
if (domain_nosub === "blogimg.jp" || | |
// http://image.news.livedoor.com/newsimage/stf/5/6/5634f_249_20180424039-m.jpg | |
// http://image.news.livedoor.com/newsimage/stf/5/6/5634f_249_20180424039.jpg | |
domain === "image.news.livedoor.com") { | |
// http://lineofficial.blogimg.jp/en/imgs/c/5/c5832999-s.png | |
// http://lineofficial.blogimg.jp/en/imgs/c/5/c5832999.png | |
return src.replace(/(\/[^/.]*)-[sm](\.[^/.]*)/, "$1$2"); | |
} | |
if (domain === "image.cine21.com") { | |
// http://image.cine21.com/resize/IMGDB/people/2004/0504/large/105535_spe45[H800-].jpg?H300 | |
// http://image.cine21.com/IMGDB/people/2004/0504/large/105535_spe45.jpg | |
// http://image.cine21.com/resize/cine21/still/2017/1213/11_39_08__5a3092cc9f638[X50,60].jpg | |
// http://image.cine21.com/cine21/still/2017/1213/11_39_08__5a3092cc9f638.jpg | |
// http://image.cine21.com/resize/cine21/poster/2005/0603/M0010044_1[F230,329].jpg | |
// http://image.cine21.com/cine21/poster/2005/0603/M0010044_1.jpg | |
return src | |
.replace("/resize/", "/") | |
.replace(/\/(?:small|medium)(\/[^/]*)$/, "/large$1") | |
.replace(/\?.*$/, "") | |
.replace(/\[[WH][-0-9]*\](\.[^/.]*)$/, "$1") | |
.replace(/\[[XF][0-9]+,[0-9]+\](\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "cdnimg.melon.co.kr" || | |
// http://image.melon.co.kr/cm/album/images/022/91/986/2291986_500.jpg | |
// http://image.melon.co.kr/cm/album/images/022/91/986/2291986_org.jpg | |
domain === "image.melon.co.kr" || | |
// http://kakaoimg.melon.co.kr/cm/album/images/021/33/148/2133148_500.jpg/melon/resize/200x200/quality/80/optimize | |
// http://kakaoimg.melon.co.kr/cm/album/images/021/33/148/2133148_org.jpg | |
domain === "kakaoimg.melon.co.kr" || | |
domain === "cmtimg.melon.co.kr"/* && | |
(src.indexOf("/images/") >= 0 || | |
src.indexOf("/image/") >= 0 || | |
src.indexOf("/user_images/") >= 0)*/) { | |
// http://cdnimg.melon.co.kr/svc/user_images/plylst/2016/12/21/56/425022806_org.jpg?tm=20171210105300/melon/resize/x262/quality/100/optimize | |
// http://cdnimg.melon.co.kr/svc/user_images/plylst/2016/12/21/56/425022806_org.jpg | |
// http://cdnimg.melon.co.kr/cm/album/images/003/74/978/374978_500.jpg/melon/resize/120/quality/80/optimize | |
// http://cdnimg.melon.co.kr/cm/album/images/003/74/978/374978_org.jpg | |
// http://cdnimg.melon.co.kr/cm/artistcrop/images/006/72/337/672337_500.jpg?f88c5a23497a77f68d8ac296e218db02/melon/resize/416/quality/80/optimize | |
// http://cdnimg.melon.co.kr/cm/artistcrop/images/006/72/337/672337_org.jpg | |
// http://cdnimg.melon.co.kr/cm/artistcrop/images/010/24/317/1024317_500.jpg | |
// http://cdnimg.melon.co.kr/cm/mv/images/43/501/78/990/50178990_1_640.jpg/melon/quality/80/resize/144/optimize | |
// http://cdnimg.melon.co.kr/cm/mv/images/43/501/78/990/50178990_1_org.jpg | |
// http://cdnimg.melon.co.kr/svc/images/main/imgUrl20180123110250.jpg/melon/quality/80 | |
// http://cdnimg.melon.co.kr/svc/images/main/imgUrl20180123110250.jpg | |
// http://cdnimg.melon.co.kr/resource/mobile40/cds/event/image/201711/mixnine/artist/079.jpg/melon/quality/80/resize/134/optimize | |
// http://cmtimg.melon.co.kr/20180331/542/52/233808_0483.png/melon/resize/192x192/quality/80/optimize | |
newsrc = src.replace(/(\.[a-zA-Z]+)\/melon\/.*/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
if (src.indexOf("/images/main/") >= 0) { | |
return src.replace(/(images\/.*\/[^/_]*)((_[^/.]*)_)?(_?[^/._]*)?(\.[^/.?]*)(?:[?/].*)?$/, "$1$3$5"); | |
} else { | |
return src.replace(/(images\/.*\/[^/_]*)((_[^/.]*)_)?(_?[^/._]*)?(\.[^/.?]*)(?:[?/].*)?$/, "$1$3_org$5"); | |
} | |
} | |
// itunes, is4-ssl.mzstatic.com | |
if (domain_nosub === "mzstatic.com" && domain.match(/is[0-9](-ssl)?\.mzstatic\.com/) && | |
src.indexOf("/image/thumb/") >= 0) { | |
// https://is3-ssl.mzstatic.com/image/thumb/Music111/v4/e1/dc/68/e1dc6808-6d55-1e38-a34d-a3807d488859/191061355977.jpg/1200x630bb.jpg | |
// https://is3-ssl.mzstatic.com/image/thumb/Music111/v4/e1/dc/68/e1dc6808-6d55-1e38-a34d-a3807d488859/191061355977.jpg/999999999x0w.jpg | |
// http://is4.mzstatic.com/image/thumb/Music6/v4/4e/92/37/4e923792-948a-ae3a-dc5b-b7416c23807a/source/165x165bb.jpg | |
// http://is4.mzstatic.com/image/thumb/Music6/v4/4e/92/37/4e923792-948a-ae3a-dc5b-b7416c23807a/source/999999999x0w.jpg | |
// http://a3.mzstatic.com/us/r30/Video/v4/3e/8a/b0/3e8ab028-45f5-a0dd-6a6f-84daf9f93a11/101_Dalmatians_E-Distribution_Standard_Electronic_Apple_Taiwan.jpg | |
// https://s1.mzstatic.com/eu/r30/Purple71/v4/a6/be/93/a6be93ed-e301-5e91-68c2-2c5df31a4b8a/sc2732x2048.jpeg | |
// http://is5.mzstatic.com/image/thumb/Music62/v4/0b/1f/36/0b1f364c-cc8f-1c8c-74a4-70cfb01d8ef4/source/100000x100000-999.jpg | |
// http://a3.mzstatic.com/us/r30/Music5/v4/2e/0d/6d/2e0d6d8f-bd38-9240-b150-0e989f00374e/cover170x170.jpeg | |
// http://a4.mzstatic.com/us/r30/Music62/v4/fe/61/54/fe6154f6-b064-d788-d114-4b544def3d30/cover1400x1400.jpeg | |
// add -999 to always set the quality to the max value (https://github.com/qsniyg/maxurl/issues/164) | |
return src.replace(/\/[0-9]*x[0-9]*[a-z]*(?:-[0-9]+)?(\.[^/.]*)$/, "/999999999x0w-999$1"); | |
} | |
if (domain === "img-tmdetail.alicdn.com") { | |
// https://img-tmdetail.alicdn.com/bao/uploaded///img.alicdn.com/bao/uploaded/TB1_5tiidknBKNjSZKPXXX6OFXa_!!0-item_pic.jpg_160x160q90.jpg | |
// http://img.alicdn.com/bao/uploaded/TB1_5tiidknBKNjSZKPXXX6OFXa_!!0-item_pic.jpg | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+bao\/+uploaded\/+([^/]+\.[^/]+\/+)/, "$1"); | |
if (newsrc !== src) | |
return add_http(newsrc); | |
} | |
if (domain_nosub === "alicdn.com" && | |
(domain.match(/[0-9]*\.alicdn\.com/) || | |
//domain.match(/sc[0-9]*\.alicdn\.com/) || | |
domain === "img.alicdn.com")) { | |
// https://ae01.alicdn.com/kf/HTB1AMo8a4uaVKJjSZFjq6AjmpXai/BINYEAE-new-CD-seal-State-of-Grace-Paul-Schwartz-Lisbeth-Scott-CD-disc-free-shipping.jpg_640x640.jpg | |
// https://ae01.alicdn.com/kf/HTB1AMo8a4uaVKJjSZFjq6AjmpXai/BINYEAE-new-CD-seal-State-of-Grace-Paul-Schwartz-Lisbeth-Scott-CD-disc-free-shipping.jpg | |
// https://ae01.alicdn.com/kf/HT1N7knFG0dXXagOFbXQ/220255879/HT1N7knFG0dXXagOFbXQ.jpg?size=209686&height=1472&width=970&hash=b068627a285860c5226596bada694403 | |
// https://ae01.alicdn.com/kf/HT1N7knFG0dXXagOFbXQ/220255879/HT1N7knFG0dXXagOFbXQ.jpg | |
// https://cbu01.alicdn.com/img/ibank/2016/379/147/3522741973_1026601309.310x310.jpg | |
// https://cbu01.alicdn.com/img/ibank/2016/379/147/3522741973_1026601309.jpg | |
return src | |
.replace(/_[0-9]+x[0-9]+[^/]*?$/, "") | |
.replace(/\.[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1") | |
.replace(/\?.*/, ""); | |
} | |
if (domain_nosub === "1818lao.com" && | |
domain.match(/^i[0-9]*\./)) { | |
// http://i0.1818lao.com/aliexpress1/kf/HTB1PMR.QXXXXXaAXVXXq6xXFXXXP/anime-swimsuits-Cosplay-Costume-D-VA-SUKUMIZU-Spandex-Swimsuit-DVA-Costume-anime-cosplay-Su-ku-water.jpg | |
// http://ae01.alicdn.com/kf/HTB1PMR.QXXXXXaAXVXXq6xXFXXXP/anime-swimsuits-Cosplay-Costume-D-VA-SUKUMIZU-Spandex-Swimsuit-DVA-Costume-anime-cosplay-Su-ku-water.jpg -- no watermark | |
return src.replace(/:\/\/[^/]*\/aliexpress[0-9]*(\/kf\/)/, "://ae01.alicdn.com$1"); | |
} | |
if (false && domain === "thumbor.forbes.com") { | |
return decodeURIComponent(src.replace(/.*\/([^/]*%3A%2F%2F[^/]*).*/, "$1")); | |
} | |
if (domain === "lastfm-img2.akamaized.net" || | |
// thanks to TheLastZombie on github: https://github.com/qsniyg/maxurl/pull/171 | |
// https://lastfm.freetls.fastly.net/i/u/300x300/12b1bfb5e2ea09bf084888c6542de63d.jpg | |
// https://lastfm.freetls.fastly.net/i/u/34s/12b1bfb5e2ea09bf084888c6542de63d.jpg | |
// https://lastfm.freetls.fastly.net/i/u/12b1bfb5e2ea09bf084888c6542de63d.jpg | |
// https://lastfm.freetls.fastly.net/i/u/avatar170s/286c3c59c3c14f9037f0b4ce0fef9bf5.jpg | |
// https://lastfm.freetls.fastly.net/i/u/286c3c59c3c14f9037f0b4ce0fef9bf5.jpg | |
domain === "lastfm.freetls.fastly.net" || | |
// http://img2-ak.lst.fm/i/u/770x0/2c2ffdfa64ad4db8d6b5e8c47474fbe8.jpg | |
// http://img2-ak.lst.fm/i/u/2c2ffdfa64ad4db8d6b5e8c47474fbe8.jpg | |
domain_nosub === "lst.fm") { | |
return src.replace(/\/i\/+u\/+(?:avatar)?(?:[0-9]+x[0-9]+|[0-9]+s)\//, "/i/u/"); | |
} | |
if (domain_nosub === "myspacecdn.com" && | |
domain.match(/a[0-9](?:\...)?-images\.myspacecdn\.com/)) { | |
// http://a2.ec-images.myspacecdn.com/images02/152/52c2d549e3a647199831fab8c34c2b92/l.jpg | |
// http://a2.ec-images.myspacecdn.com/images02/152/52c2d549e3a647199831fab8c34c2b92/full.jpg | |
// https://a3-images.myspacecdn.com/images01/3/06c1249fcc1441046241101fa905b56b/300x300.jpg | |
// https://a3-images.myspacecdn.com/images01/3/06c1249fcc1441046241101fa905b56b/full.jpg | |
// doesn't work(?) for all: | |
// https://a1-images.myspacecdn.com/images02/81/20f202e46332442381bbd6ac7e96dd18/300x300.jpg | |
// https://a1-images.myspacecdn.com/images02/81/20f202e46332442381bbd6ac7e96dd18/full.jpg -- 503 (service temporarily unavailable), jpeg = 403, png = 503 | |
// however, the photo page tries to load /full too (and fails) | |
return src.replace(/\/[^/.]*(\.[^/.]*)$/, "/full$1"); | |
} | |
if (domain === "pics.vampirefreaks.com") { | |
// https://pics.vampirefreaks.com/S/Sn/Sno/SnowWhitePoisonApple/52205231_s.jpg | |
// https://pics.vampirefreaks.com/S/Sn/Sno/SnowWhitePoisonApple/52205231.jpg | |
return src.replace(/(\/[0-9]+)_s(\.[^/.]+)(?:[?#].*)?$/, "$1$2"); | |
} | |
// https://geo-media.beatport.com/image_size/250x250/e6997bab-e115-41b2-acab-3cae7bcf3615.jpg | |
if (domain === "geo-media.beatport.com") { | |
return src.replace(/\/image_size\/[0-9]*x[0-9]*\//, "/image_size/0x0/"); | |
} | |
if (domain_nosub === "tumblr.com" && | |
domain.indexOf("media.tumblr.com") >= 0) { | |
// some gifs don't play properly (same case with raw?) | |
// handle this? | |
// https://78.media.tumblr.com/25e643db76a1e626ff4e79faa2f7bb3d/tumblr_inline_mvspvogcB51sq8rci.jpg | |
// https://static.tumblr.com/2074b5c013a08663cbfe4f86f54aad99/b70lpcc/m9Vnkyvyw/tumblr_static_d04dkibmyqokwgwsgcwggkowg.jpg | |
// https://static.tumblr.com/978c2da2706d61fcdc5a13083a05c70c/yffueik/n9Znvprsi/tumblr_static_bp7fdwcxpbwc8k440ksocks8c.png | |
// https://static.tumblr.com/rpaguup/J6wmdtouh/tumblr_mdipupjoku1r2xx88o1_500.png | |
// http://data.tumblr.com/rpaguup/J6wmdtouh/tumblr_mdipupjoku1r2xx88o1_raw.png -- doesn't work | |
// http://media.tumblr.com/tumblr_m94wh56woC1ro0opg.png | |
// http://media.tumblr.com/bbeec3764efd6b63c14fe1e56f4f5b22/tumblr_inline_mn9bgayRCZ1qz4rgp.png | |
// http://media.tumblr.com/cd90bd6fe3989956567f086153430e4c/tumblr_inline_mimvhtpoYw1qz4rgp.gif | |
// https://78.media.tumblr.com/tumblr_m2p6yiRZNR1qha0cy.gif | |
// http://media.tumblr.com/tumblr_mah067upzv1rtyo86.gif | |
// https://static.tumblr.com/ae53741763a8e9a937e587fd71c24ee5/065fclu/Okon9yxx0/tumblr_static_filename_640_v2.jpg | |
// https://static.tumblr.com/9d9cb03d00947212897f5fa390615bb1/szhmsgg/PW8ok7jgi/tumblr_static_tumblr_static__640.jpg | |
// https://static.tumblr.com/9873073729f37d9fb36dce1576f1f3ee/gtqzlnb/34Ync89wm/tumblr_static_tumblr_static_79qnyyc3l2os0c84swcswowks_640.gif | |
// https://66.media.tumblr.com/76597bb3640f73e6af0f5cff3430f6e1/tumblr_inline_pa5nk1DnJW1twvjda_540.jpg | |
// https://66.media.tumblr.com/76597bb3640f73e6af0f5cff3430f6e1/tumblr_inline_pa5nk1DnJW1twvjda_1280.jpg | |
// http://static.tumblr.com/db01df3dee618afdc00cc6e886ed1591/xjv1zxw/8G6myp4yn/tumblr_static_kirigiri.kyouko.full.1546231.jpg | |
// http://media.tumblr.com/tumblr_mdsw17461H1qeaqka.jpg -- 2575x3500 | |
// https://static.tumblr.com/fd14a16bf8d1e9a1147933e8b5d545c1/esbkosq/XLdpbuqlf/tumblr_static_1x2wbomx0a2sko0k0s4wogw8w_2048_v2.jpg | |
// http://66.media.tumblr.com/3brTgWjvCqzpp6rkLtAuUGACo1_400.jpg | |
// http://66.media.tumblr.com/3brTgWjvCqzpp6rkLtAuUGACo1_1280.jpg | |
// | |
// working gifs: | |
// https://78.media.tumblr.com/4b9573a2fdd97a6e6cac771d4a0c0edd/tumblr_ntg9jreu9X1s5q5l6o4_400.gif | |
// http://data.tumblr.com/4b9573a2fdd97a6e6cac771d4a0c0edd/tumblr_ntg9jreu9X1s5q5l6o4_raw.gif | |
// https://78.media.tumblr.com/4b9573a2fdd97a6e6cac771d4a0c0edd/tumblr_ntg9jreu9X1s5q5l6o4_1280.gif -- works | |
// https://78.media.tumblr.com/e7976904bb598ed701324ee471056156/tumblr_ntg9jreu9X1s5q5l6o3_400.gif | |
// http://data.tumblr.com/e7976904bb598ed701324ee471056156/tumblr_ntg9jreu9X1s5q5l6o3_raw.gif | |
// https://78.media.tumblr.com/2d799573226814e336e0984263269507/tumblr_nwe2hfH0dX1u9vqklo1_250.gif | |
// https://s3.amazonaws.com/data.tumblr.com/2d799573226814e336e0984263269507/tumblr_nwe2hfH0dX1u9vqklo1_raw.gif | |
// https://78.media.tumblr.com/tumblr_lyqq4hsfo01qdphnvo1_500.gif | |
// https://78.media.tumblr.com/tumblr_lyqq4hsfo01qdphnvo1_1280.gif | |
// https://66.media.tumblr.com/cdcb216eb8e7af14c2e2d8e6d0aa0436/tumblr_nkopbvn3U81qaysjmo1_r2_500.jpg | |
// https://66.media.tumblr.com/cdcb216eb8e7af14c2e2d8e6d0aa0436/tumblr_nkopbvn3U81qaysjmo1_r2_1280.jpg | |
// | |
// semi-working gifs: (thanks to rEnr3n on github) | |
// https://78.media.tumblr.com/b6a2ed8abae3e9f0a64ccc5bd14b5bbf/tumblr_n8w8k50vpR1r3kk98o1_250.gif -- works | |
// https://78.media.tumblr.com/b6a2ed8abae3e9f0a64ccc5bd14b5bbf/tumblr_n8w8k50vpR1r3kk98o1_1280.gif -- doesn't work | |
// | |
// https://78.media.tumblr.com/a1dfad9537af0e38063ec186e2ff392e/tumblr_n87ft44o4Y1r3kk98o1_250.gif -- works | |
// https://78.media.tumblr.com/a1dfad9537af0e38063ec186e2ff392e/tumblr_n87ft44o4Y1r3kk98o1_500.gif -- doesn't work | |
// https://78.media.tumblr.com/a1dfad9537af0e38063ec186e2ff392e/tumblr_n87ft44o4Y1r3kk98o1_1280.gif -- doesn't work | |
// https://s3.amazonaws.com/data.tumblr.com/a1dfad9537af0e38063ec186e2ff392e/tumblr_n87ft44o4Y1r3kk98o1_raw.gif -- works | |
// https://78.media.tumblr.com/b6a2ed8abae3e9f0a64ccc5bd14b5bbf/tumblr_n8w8k50vpR1r3kk98o1_250.gif | |
// | |
// non-working gifs: (all sizes don't work, except for _raw, credit to rEnr3n again for finding these) | |
// https://78.media.tumblr.com/102fca5704db6aa1cc5e56ed7d9aa369/tumblr_n5ltfvGJC51r3kk98o1_250.gif | |
// https://s3.amazonaws.com/data.tumblr.com/102fca5704db6aa1cc5e56ed7d9aa369/tumblr_n5ltfvGJC51r3kk98o1_raw.gif -- works | |
// https://78.media.tumblr.com/257cce1bd6ec64e56b1c55129ddc547d/tumblr_n5lbkmnp5g1r3kk98o1_250.gif | |
// https://s3.amazonaws.com/data.tumblr.com/257cce1bd6ec64e56b1c55129ddc547d/tumblr_n5lbkmnp5g1r3kk98o1_raw.gif -- works | |
// | |
// raw doesn't work: | |
// https://78.media.tumblr.com/9968a8dffa5ade4eeaf6a77a1f5323e3/tumblr_inline_oca234l0kV1sszmh4_500.gif | |
// https://s3.amazonaws.com/data.tumblr.com/9968a8dffa5ade4eeaf6a77a1f5323e3/tumblr_inline_oca234l0kV1sszmh4_raw.gif | |
// | |
// new format: | |
// https://66.media.tumblr.com/2b129630fe50ae796d9383c5ba6ba35b/9e0fb8a88fdd1bdf-10/s640x960/d1a52d700422d91b37d653867fcadf46e933a1b1.jpg | |
// https://66.media.tumblr.com/2b129630fe50ae796d9383c5ba6ba35b/9e0fb8a88fdd1bdf-10/s1280x1920/8a3215ccfce8484f565a5a7b71745c49a72ff211.jpg | |
// https://78.media.tumblr.com/4efd905dfc517da760d1d53f98b5c5d4/tumblr_oy8m3u1aR01tsmy5xo1_1280.pnj | |
// https://78.media.tumblr.com/4efd905dfc517da760d1d53f98b5c5d4/tumblr_oy8m3u1aR01tsmy5xo1_1280.png | |
// https://s3.amazonaws.com/data.tumblr.com/4efd905dfc517da760d1d53f98b5c5d4/tumblr_oy8m3u1aR01tsmy5xo1_raw.png | |
// https://78.media.tumblr.com/b05b512a57c51e5ead1be5159d28b428/tumblr_p8665hUaJv1sejmmmo2_540.gifv | |
// https://78.media.tumblr.com/b05b512a57c51e5ead1be5159d28b428/tumblr_p8665hUaJv1sejmmmo2_540.gif | |
// https://s3.amazonaws.com/data.tumblr.com/b05b512a57c51e5ead1be5159d28b428/tumblr_p8665hUaJv1sejmmmo2_raw.gif | |
newsrc = src | |
.replace(/\.pnj(\?.*)?$/, ".png$1") | |
.replace(/\.gifv(\?.*)?$/, ".gif$1"); | |
if (newsrc !== src) | |
return newsrc; | |
// due to recent updates disabling _raw, until something is found, _1280 will have to suffice | |
var obj = { | |
problems: { | |
possibly_broken: false | |
} | |
}; | |
if (src.match(/_[0-9]*\.gif$/)) | |
obj.problems.possibly_broken = true; | |
// http://78.media.tumblr.com/avatar_43c10cb80f16_64.png | |
// http://78.media.tumblr.com/avatar_43c10cb80f16_512.png -- upscaled? | |
if (src.match(/\/avatar_[0-9a-f]+_(?:64|128)\./)) | |
return src.replace(/_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "_512$1"); | |
// https://66.media.tumblr.com/a304d969f5d0012df41d657d7e4f5c5e/tumblr_p5cne9vRBD1wsufgw_og_500.jpg | |
// https://66.media.tumblr.com/a304d969f5d0012df41d657d7e4f5c5e/tumblr_p5cne9vRBD1wsufgw_og_1280.jpg | |
newsrc = src.replace(/(\/(?:tumblr(?:_(?:static|inline))?_)?[0-9a-zA-Z]+(?:_og)?(?:_r[0-9]*)?)_[0-9]+(\.[^/.]*)$/, "$1_1280$2"); | |
if (newsrc !== src) { | |
obj.url = newsrc; | |
return obj; | |
} | |
} | |
if (domain_nosub === "tumblr.com" && /media\.tumblr\.com$/.test(domain) && options && options.element && | |
options.do_request && options.cb) { | |
// thanks to dogancelik on github: https://github.com/qsniyg/maxurl/issues/88#issuecomment-569612947 | |
// no trail: | |
// https://samirafee.tumblr.com/post/189953679332/lake-neusiedl-neusiedlersee-fert%C3%B6-largest | |
// https://samirafee.tumblr.com/post/189952698762/cat-art-by-elizabeth-katzenlinemensite | |
// trail: | |
// https://samirafee.tumblr.com/post/189567617202/kerovous-own-picture-337-my-friend-and | |
// custom domain: | |
// https://takashiyasui.com/ | |
var apikey = null; | |
if (options.rule_specific && options.rule_specific.tumblr_api_key) | |
apikey = options.rule_specific.tumblr_api_key; | |
var get_post_api = function(blogname, postid, cb) { | |
var cache_key = "tumblr_api_blog:" + blogname + ":post:" + postid; | |
api_cache.fetch(cache_key, cb, function(done) { | |
options.do_request({ | |
url: "https://api.tumblr.com/v2/blog/" + blogname + "/posts?api_key=" + apikey + "&id=" + postid + "&npf=true", | |
method: "GET", | |
onload: function(resp) { | |
if (resp.readyState !== 4) | |
return; | |
if (resp.status !== 200) { | |
console_error(resp); | |
return done(null, false); | |
} | |
try { | |
var json = JSON_parse(resp.responseText); | |
var post = json.response.posts[0]; | |
var content = post.content; | |
if (post.trail) { | |
for (var i = 0; i < post.trail.length; i++) { | |
[].push.apply(content, post.trail[i].content); | |
} | |
} | |
return done(content, 6*60*60); | |
} catch (e) { | |
console_error(e, resp); | |
return done(null, false); | |
} | |
} | |
}); | |
}); | |
}; | |
var get_post_http = function(blogname, postid, cb) { | |
var cache_key = "tumblr_blog_image:" + blogname + ":post:" + postid; | |
api_cache.fetch(cache_key, cb, function(done) { | |
options.do_request({ | |
url: "https://" + blogname + ".tumblr.com/image/" + postid + "/", | |
method: "GET", | |
onload: function(resp) { | |
if (resp.readyState !== 4) | |
return; | |
if (resp.status !== 200) { | |
console_error(resp); | |
return done(null, false); | |
} | |
var match = resp.responseText.match(/window\['___INITIAL_STATE___'\]\s*=\s*({.*?});\s*<\/script>/); | |
if (!match) { | |
console_warn("Unable to find match", resp); | |
return done(null, false); | |
} | |
// remove regex, as it's not valid JSON | |
var jsontxt = match[1].replace(/,\"[^"]+?\":\/.*?,\"/, ",\""); | |
try { | |
var json = JSON_parse(jsontxt); | |
// the json does contain apiFetchStore.API_TOKEN, but although it's also 50chars long, it returns 401 | |
// it also contains a csrfToken property, but I haven't seen either the api token or the csrf token being used | |
var imageresponse = json.ImagePage.photo.imageResponse; | |
var firstimage = {media: []}; | |
for (var i = 0; i < imageresponse.length; i++) { | |
imageresponse[i].media_key = imageresponse[i].mediaKey; | |
imageresponse[i].has_original_dimensions = imageresponse[i].hasOriginalDimensions; | |
firstimage.media.push(imageresponse[i]); | |
} | |
return done([firstimage], 6*60*60); | |
} catch(e) { | |
console_error(e); | |
return done(null, false); | |
} | |
} | |
}); | |
}); | |
} | |
var get_post = function(blogname, postid, cb) { | |
if (apikey) { | |
return get_post_api(blogname, postid, cb); | |
} else { | |
return get_post_http(blogname, postid, cb); | |
} | |
}; | |
var find_largest_from_media = function(media) { | |
var pixels = 0; | |
var obj = null; | |
for (var i = 0; i < media.length; i++) { | |
var ourobj = media[i]; | |
var ourpixels = ourobj.width * ourobj.height; | |
if (ourpixels > pixels) { | |
obj = ourobj; | |
pixels = ourpixels; | |
} | |
} | |
return obj; | |
}; | |
var find_mediakey_from_url = function(url) { | |
var match = url.match(/^[a-z]+:\/\/[^/]+\/+([0-9a-f]{32})\/+([0-9a-f]{16}-[0-9a-f]{2})\/+/); | |
if (match) { | |
return match[1] + ":" + match[2]; | |
} | |
return null; | |
}; | |
var find_media_from_post_mediakey = function(post, mediakey) { | |
for (var i = 0; i < post.length; i++) { | |
if (!post[i].media) | |
continue; | |
if (post[i].media[0].media_key === mediakey) { | |
return post[i].media; | |
} | |
} | |
return null; | |
}; | |
var find_blogname_from_url = function(url) { | |
match = url.match(/^[a-z]+:\/\/([^/.]+)\.tumblr\.com\//); | |
if (match) { | |
if (match[1] !== "www" && match[1] !== "support") | |
return match[1]; | |
} | |
return null; | |
}; | |
var find_blogname_id_from_url = function(url) { | |
match = url.match(/^[a-z]+:\/\/([^/.]+)\.tumblr\.com\/+post\/+([0-9]+)\//); | |
if (match) { | |
return { | |
blogname: match[1], | |
postid: match[2] | |
}; | |
} | |
return null; | |
}; | |
var find_blogname_from_head = function() { | |
if (!options.document) | |
return null; | |
var links = options.document.getElementsByTagName("link"); | |
for (var i = 0; i < links.length; i++) { | |
var href = links[i].href; | |
if (!href) | |
continue; | |
var match = href.match(/^android-app:\/\/com\.tumblr\/tumblr\/x-callback-url\/blog\?blogName=(.*?)(?:[&%].*)?$/); | |
if (match) { | |
return match[1]; | |
} | |
} | |
return null; | |
}; | |
var try_finding_info = function() { | |
var info = find_blogname_id_from_url(options.host_url); | |
if (info) | |
return info; | |
var blogname = find_blogname_from_url(options.host_url); | |
if (!blogname) { | |
blogname = find_blogname_from_head(); | |
} | |
if (blogname) { | |
var obj = { | |
blogname: blogname | |
}; | |
var currentel = options.element; | |
while ((currentel = currentel.parentElement)) { | |
if (currentel.tagName === "ARTICLE") { | |
var id = currentel.getAttribute("id"); | |
if (id) { | |
obj.postid = id; | |
return obj; | |
} | |
} | |
} | |
} else if (host_domain_nowww === "tumblr.com") { | |
// Tumblr homepage | |
var currentel = options.element; | |
while ((currentel = currentel.parentElement)) { | |
if (currentel.tagName === "DIV" && currentel.getAttribute("data-json")) { | |
var jsondata = currentel.getAttribute("data-json"); | |
try { | |
var json = JSON_parse(jsondata); | |
return { | |
blogname: json.tumblelog, | |
postid: json["post-id"] | |
}; | |
} catch(e) { | |
console_error(e); | |
} | |
// there likely won't be anything after this | |
return null; | |
} | |
} | |
} | |
return null; | |
}; | |
var mediakey = find_mediakey_from_url(src); | |
if (mediakey) { | |
var info = try_finding_info(); | |
if (info) { | |
get_post(info.blogname, info.postid, function(data) { | |
if (!data) | |
return options.cb(null); | |
var media = find_media_from_post_mediakey(data, mediakey); | |
if (!media) | |
return options.cb(null); | |
var largest = find_largest_from_media(media); | |
var obj = {url: largest.url}; | |
if (largest.has_original_dimensions) | |
obj.is_original = true; | |
return options.cb(obj); | |
}); | |
return { | |
waiting: true | |
}; | |
} | |
} | |
} | |
if (domain === "wc-ahba9see.c.sakurastorage.jp" || | |
// https://cdn.worldcosplay.net/553279/ydllsnlmqigtzjdeycnoucmbtreadgeplevutcww-740.jpg | |
// https://cdn.worldcosplay.net/553279/ydllsnlmqigtzjdeycnoucmbtreadgeplevutcww-3000.jpg | |
// other: | |
// https://cdn.worldcosplay.net/cv/31293/kiilaerajhaksniiiyobnuwhfshqsbstohlpdvws-store.jpg | |
// https://cdn.worldcosplay.net/cv/31293/kiilaerajhaksniiiyobnuwhfshqsbstohlpdvws-3000.jpg -- doesn't work | |
domain === "cdn.worldcosplay.net") { | |
newsrc = src; | |
if (src.indexOf("/max-1200/") >= 0) { | |
// https://wc-ahba9see.c.sakurastorage.jp/max-1200/59530/e929c45f84ace23cf416c2b6fc1c1eacb34f20bf-350x600.jpg | |
// https://wc-ahba9see.c.sakurastorage.jp/max-1200/59530/e929c45f84ace23cf416c2b6fc1c1eacb34f20bf-1200.jpg | |
newsrc = src.replace(/-[0-9a-z]+(\.[^/.]*)$/, "-1200$1"); | |
} else { | |
// https://wc-ahba9see.c.sakurastorage.jp/533191/ebqzwxdflpsovyghbvfmpvzowripdfdorrlkwogi-350x600.jpg | |
// https://wc-ahba9see.c.sakurastorage.jp/533191/ebqzwxdflpsovyghbvfmpvzowripdfdorrlkwogi-3000.jpg | |
// https://wc-ahba9see.c.sakurastorage.jp/424045/hmkianomuekqviktmyruykbxejilztchdqdwgsow-350x600.jpg | |
// https://wc-ahba9see.c.sakurastorage.jp/424045/hmkianomuekqviktmyruykbxejilztchdqdwgsow-3000.jpg | |
// doesn't work: | |
// https://wc-ahba9see.c.sakurastorage.jp/40021/5a4bd340b2c95e674a1816f9adece947d06b1df2-100.jpg | |
// https://wc-ahba9see.c.sakurastorage.jp/40021/5a4bd340b2c95e674a1816f9adece947d06b1df2-3000.jpg -- 404 | |
newsrc = src.replace(/-[0-9]+(?:x[0-9]+)?(\.[^/.]*)$/, "-3000$1"); | |
} | |
return { | |
url: newsrc, | |
can_head: false, | |
headers: { | |
Referer: "" | |
}, | |
referer_ok: { | |
same_domain: true | |
} | |
}; | |
} | |
if (domain_nowww === "nautiljon.com" && src.match(/\/images[a-z]*\//)) { | |
// nowww redirects to www | |
// https://www.nautiljon.com/imagesmin/anime/00/48/kuroko_no_basket_2184.jpg?1517340247 | |
// https://www.nautiljon.com/images/anime/00/48/kuroko_no_basket_2184.jpg?1517340247 | |
// https://www.nautiljon.com/images/86x86/people/00/51/il_hoon_btob_33715.jpg?1520059769 | |
// https://www.nautiljon.com/images/people/00/51/il_hoon_btob_33715.jpg?1520059769 | |
// https://www.nautiljon.com/images/actualite/00/68/medium/1525681783131_image.jpg -- 177x250 | |
// https://www.nautiljon.com/images/actualite/00/68/large/1525681783131_image.jpg -- 638x900 | |
// https://www.nautiljon.com/images/actualite/00/68/1525681783131_image.jpg -- 680x960 | |
return src | |
.replace(/\/imagesmin\//, "/images/") | |
.replace(/\/images\/[0-9]+x[0-9]+\//, "/images/") | |
.replace(/\/mini\/([^/]*)$/, "/$1") | |
.replace(/(\/[0-9]+\/[0-9]+\/)[a-z]+\/([^/]*)$/, "$1$2"); | |
} | |
// wall street journal: | |
// A, C, D, (E,F), G, H, P, J, M | |
// https://s.wsj.net/public/resources/images/BN-WV466_rotiss_A_20180103172646.jpg | |
// https://s.wsj.net/public/resources/images/BN-WV466_rotiss_C_20180103172646.jpg | |
// https://s.wsj.net/public/resources/images/BN-WV466_rotiss_D_20180103172646.jpg | |
// https://s.wsj.net/public/resources/images/BN-WV466_rotiss_G_20180103172646.jpg | |
// https://s.wsj.net/public/resources/images/BN-WV466_rotiss_M_20180103172646.jpg | |
// | |
// https://s.wsj.net/public/resources/images/BN-WV815_3m8WN_M_20180104143735.jpg | |
// https://si.wsj.net/public/resources/images/BN-WV794_apples_M_20180104140237.jpg (s.wsj.net works too) | |
// | |
// doesn't support J or M: | |
// | |
// A, C, D, E, F, G, P | |
// https://s.wsj.net/public/resources/images/OB-YL084_KoreaC_G_20130805214258.jpg | |
// https://s.wsj.net/public/resources/images/OB-YL082_KoreaC_P_20130805213748.jpg | |
// | |
// so far it seems that P is the largest common one, but M can be larger. maybe date has something to do with it? | |
// | |
// other: | |
// https://si.wsj.net/public/resources/images/BN-WW013_0105KO_Z120_20180104213322.jpg | |
// Z120 works with "newer" urls, but not with older ones (Z0, Z100, etc. don't work) | |
// | |
// https://art.wsj.net/api/photos/gams-files/BN-WV826_3fHQP_A_20180104144705.jpg?width=110&height=73 | |
// https://s.wsj.net/public/resources/images/BN-WV826_3fHQP_A_20180104144705.jpg | |
// width=0&height=0 returns a 1x1, same for width=-1&height=-1. width=8000&height=8000 results in a zoomed in image (but rather high quality nonetheless) | |
// https://art.wsj.net/api/photos/gams-files/BN-WV826_3fHQP_A_20180104144705.jpg (invalid, since it requires parameters) results in: | |
// {"message":"No HTTP resource was found that matches the request URI 'http://art.wsj.net/api/photos/gams-id:3fHQP/smartcrop?crophint=A'.","messageDetail":"No action was found on the controller 'PhotoApi' that matches the request."} | |
// http://art.wsj.net/api/photos/gams-id:3fHQP/smartcrop | |
// {"message":"No HTTP resource was found that matches the request URI 'http://art.wsj.net/api/photos/gams-id:3fHQP/smartcrop'.","messageDetail":"No action was found on the controller 'PhotoApi' that matches the request."} | |
// http://art.wsj.net/api/photos/gams-id:3fHQP - works! | |
// | |
// https://art.wsj.net/api/photos/gams-files/BN-WV815_3m8WN_A_20180104143735.jpg?width=110&height=61 | |
// https://art.wsj.net/api/photos/gams-id:3m8WN | |
// | |
// id is base62 using 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ as the alphabet | |
// | |
// most don't work with this though | |
// | |
// https://si.wsj.net/public/resources/images/BN-KS721_GerryB_AM_20151013072049.jpg | |
// M doesn't work, but P does (conversely, AM doesn't work with some old images, but seems to work with newer ones) | |
// https://si.wsj.net/public/resources/images/BN-WV959_SYRDET_ER_20180104172634.jpg | |
// https://s.wsj.net/public/resources/images/BN-WU361_SZA_01_D_20171229145931.jpg | |
if (domain === "art.wsj.net") { | |
if (src.indexOf("/api/photos/gams-files/") >= 0) { | |
return src.replace(/\/gams-files\/[^-_/.]*-[^-_/.]*_([^/_.]*)_.*$/, "/gams-id:$1"); | |
} | |
if (src.indexOf("/api/photos/gams-id:") >= 0) { | |
return src.replace(/(\/gams-id:[^/]*)\/.*$/, "$1"); | |
} | |
} | |
if (domain_nosub === "fanpop.com" && | |
domain.match(/images[0-9]*\.fanpop\.com/)) { | |
// http://images6.fanpop.com/image/photos/33100000/Zetsuen-No-Tempest-zetsuen-no-tempest-33126825-2048-2970.jpg | |
// http://images6.fanpop.com/image/photos/33100000/Zetsuen-No-Tempest-zetsuen-no-tempest-33126825.jpg | |
// http://images1.fanpop.com/images/image_uploads/cf-calista-flockhart-912712_525_700.jpg | |
// http://images1.fanpop.com/images/image_uploads/cf-calista-flockhart-912712.jpg | |
// http://images.fanpop.com/images/image_uploads/Emma-Watson--emma-watson-95242_500_400.jpg | |
// http://images.fanpop.com/images/image_uploads/Emma-Watson--emma-watson-95242.jpg | |
// http://images6.fanpop.com/image/answers/3197000/3197239_1364966408102.53res_426_300.jpg | |
// | |
// http://images6.fanpop.com/image/photos/38000000/Zayn-Malik-2015-one-direction-38049270-2121-2500.jpg | |
// http://images6.fanpop.com/image/photos/38000000/Zayn-Malik-2015-one-direction-38049270.jpg - doesn't work | |
return src | |
.replace(/([0-9]+)-[0-9]+-[0-9]+(\.[^/.]*)$/, "$1$2") | |
.replace(/([0-9]+)_[0-9]+_[0-9]+(\.[^/.]*)$/, "$1$2"); | |
} | |
if (domain === "image.jimcdn.com") { | |
// https://image.jimcdn.com/app/cms/image/transf/dimension=299x10000:format=png/path/s07f3459425dd27f2/image/i23aaf7ddb2a0e16d/version/1471508912/image.png | |
// https://image.jimcdn.com/app/cms/image/transf/none/path/s07f3459425dd27f2/image/i23aaf7ddb2a0e16d/version/1471508912/image.png | |
// https://github.com/thumbor/thumbor/issues/564 | |
return src.replace(/(\/app\/cms\/image\/transf\/)[^/]*\//, "$1none/"); | |
} | |
// useless, nearly impossible to test due to redirects | |
if (false && domain === "u.jimdo.com") { | |
// http://u.jimdo.com/www54/o/sef0c3710159530fc/img/i314f3a735d2ffdcc/1406803251/std/image.jpg | |
// https://image.jimcdn.com/app/cms/image/transf/none/path/sef0c3710159530fc/image/i314f3a735d2ffdcc/version/1440585179/cara-delevingne-wird-neues-kampagnengesicht-des-brit-labels-topshop.jpg | |
return src.replace(/:\/\/[^/]*\/www[0-9]*\/[a-z]\/([0-9a-z]+)\/img\/(i[0-9a-f]+)\/([0-9]+)\/[^/]*\/([^/]\.[^/.]*)$/, | |
"://image.jimcdn.com/app/cms/image/transf/none/path/$1/image/$2/version/$3/$4"); | |
} | |
if ((domain_nosub === "ladmedia.fr" || | |
domain_nosub === "lanmedia.fr") && | |
domain.match(/(?:resize|cdn)[0-9]*-[a-z]*\./)) { | |
// http://resize-parismatch.ladmedia.fr/r/625,417,center-middle,ffffff/img/var/news/storage/images/paris-match/people/meurtre-du-cousin-de-rihanna-un-suspect-en-detention-provisoire-1432127/23594795-1-fre-FR/Meurtre-du-cousin-de-Rihanna-un-suspect-en-detention-provisoire.jpg | |
// http://cdn-parismatch.ladmedia.fr/var/news/storage/images/paris-match/people/meurtre-du-cousin-de-rihanna-un-suspect-en-detention-provisoire-1432127/23594795-1-fre-FR/Meurtre-du-cousin-de-Rihanna-un-suspect-en-detention-provisoire.jpg | |
// http://resize1-parismatch.ladmedia.fr/r/300,300,center-middle,ffffff/img/var/news/storage/images/paris-match/people-a-z/rihanna/5971706-8-fre-FR/Rihanna.jpg | |
// http://cdn-parismatch.ladmedia.fr/var/news/storage/images/paris-match/people-a-z/rihanna/5971706-8-fre-FR/Rihanna.jpg | |
// http://resize1-doctissimo.ladmedia.fr/r/1010,,forcex/img/var/doctissimo/storage/images/fr/www/beaute/diaporamas/coiffure-de-star-coiffures-de-stars/coiffure-ciara/2440196-1-fre-FR/Le-Tie-Dye-rate-de-Ciara.jpg | |
// http://cdn-doctissimo.ladmedia.fr/var/doctissimo/storage/images/fr/www/beaute/diaporamas/coiffure-de-star-coiffures-de-stars/coiffure-ciara/2440196-1-fre-FR/Le-Tie-Dye-rate-de-Ciara.jpg | |
// https://resize-public.ladmedia.fr/rcrop/140,104/img/var/public/storage/images/toutes-les-photos/photos-emilie-nef-naf-torride-en-tout-petit-bikini-wahiba-ribery-sous-le-choc-1469251/38549175-1-fre-FR/Photos-Emilie-Nef-Naf-torride-en-tout-petit-bikini-Wahiba-Ribery-sous-le-choc-!.jpg | |
// https://resize-public.ladmedia.fr/img/var/public/storage/images/toutes-les-photos/photos-emilie-nef-naf-torride-en-tout-petit-bikini-wahiba-ribery-sous-le-choc-1469251/38549175-1-fre-FR/Photos-Emilie-Nef-Naf-torride-en-tout-petit-bikini-Wahiba-Ribery-sous-le-choc-!.jpg | |
// https://cdn-public.ladmedia.fr/var/public/storage/images/toutes-les-photos/photos-emilie-nef-naf-torride-en-tout-petit-bikini-wahiba-ribery-sous-le-choc-1469251/38549175-1-fre-FR/Photos-Emilie-Nef-Naf-torride-en-tout-petit-bikini-Wahiba-Ribery-sous-le-choc-!.jpg | |
// https://resize-elle.ladmedia.fr/r/625,,forcex/crop/625,625,center-middle,forcex,ffffff/img/var/plain_site/storage/images/loisirs/musique/news/selena-gomez-pourquoi-pose-t-elle-presque-nue-2982877/56148853-1-fre-FR/Selena-Gomez-pourquoi-pose-t-elle-presque-nue.png | |
// https://resize-elle.ladmedia.fr/crop/625,625,center-middle,forcex,ffffff/img/var/plain_site/storage/images/loisirs/musique/news/selena-gomez-pourquoi-pose-t-elle-presque-nue-2982877/56148853-1-fre-FR/Selena-Gomez-pourquoi-pose-t-elle-presque-nue.png | |
// https://resize-elle.ladmedia.fr/img/var/plain_site/storage/images/loisirs/musique/news/selena-gomez-pourquoi-pose-t-elle-presque-nue-2982877/56148853-1-fre-FR/Selena-Gomez-pourquoi-pose-t-elle-presque-nue.png | |
// https://cdn-elle.ladmedia.fr/var/plain_site/storage/images/loisirs/musique/news/selena-gomez-pourquoi-pose-t-elle-presque-nue-2982877/56148853-1-fre-FR/Selena-Gomez-pourquoi-pose-t-elle-presque-nue.png | |
// https://resize-parismatch.lanmedia.fr/r/620,/img/var/news/storage/images/media/images/capture-d-e-cran-2015-02-06-a-11-46-142/7312692-1-fre-FR/Capture-d-e-cran-2015-02-06-a-11.46.14_original_backup.png | |
// https://cdn-parismatch.lanmedia.fr/var/news/storage/images/media/images/capture-d-e-cran-2015-02-06-a-11-46-142/7312692-1-fre-FR/Capture-d-e-cran-2015-02-06-a-11.46.14.png | |
// | |
// https://cdn2-public.ladmedia.fr/var/public/storage/images/news/photos/photos-rihanna-elle-nous-refait-le-coup-de-la-robe-fendue-et-ultra-decolletee-197341/rihanna-a-la-soiree-stella-mccartney-hier-soir-a-londres-197343/1701021-1-fre-FR/Rihanna-a-la-soiree-Stella-McCartney-hier-soir-a-Londres_portrait_w674.jpg | |
// https://cdn2-public.ladmedia.fr/var/public/storage/images/news/photos/photos-rihanna-elle-nous-refait-le-coup-de-la-robe-fendue-et-ultra-decolletee-197341/rihanna-a-la-soiree-stella-mccartney-hier-soir-a-londres-197343/1701021-1-fre-FR/Rihanna-a-la-soiree-Stella-McCartney-hier-soir-a-Londres.jpg | |
return { | |
url: src | |
.replace(/\/(?:r|crop|rcrop)\/[^/]*\//, "/") | |
.replace(/:\/\/resize[0-9]*-([a-z]+[^/]*?)\/+img\/var\//, "://cdn-$1/var/") | |
.replace(/_[a-z0-9_]+(\.[^/.]*)$/, "$1"), | |
can_head: true | |
}; | |
} | |
if (domain_nosub === "imgbox.com" && | |
(domain.match(/^thumbs[0-9]*\./) || | |
domain.match(/images[0-9]*\./))) { | |
// https://thumbs2.imgbox.com/6b/e7/rklghXlY_t.jpg | |
// https://images2.imgbox.com/6b/e7/rklghXlY_o.jpg | |
// https://thumbs3.imgbox.com/63/1b/bUg59AO0_b.jpg | |
// https://images3.imgbox.com/63/1b/bUg59AO0_o.jpg | |
// https://5-t.imgbox.com/H8mh6PYR.jpg | |
// https://thumbs3.imgbox.com/a5/e8/H8mh6PYR_t.jpg | |
// https://images3.imgbox.com/a5/e8/H8mh6PYR_o.jpg | |
// https://1-t.imgbox.com/Q3x3sr3Z.jpg | |
// https://thumbs3.imgbox.com/9d/37/Q3x3sr3Z_t.jpg | |
// https://images3.imgbox.com/9d/37/Q3x3sr3Z_o.jpg | |
// http://0.t.imgbox.com/eLFM9k0c.jpg | |
// https://thumbs3.imgbox.com/e4/3f/eLFM9k0c_t.jpg | |
// https://images3.imgbox.com/e4/3f/eLFM9k0c_o.jpg | |
newsrc = src | |
.replace(/\/thumbs([0-9]*)\.imgbox\.com\//, "/images$1.imgbox.com/") | |
.replace(/_[a-z](\.[^/.]*)/, "_o$1"); | |
if (newsrc !== src) | |
return newsrc; | |
if (/\/(?:[0-9a-f]{2}\/+){2}[^/_.]+_o\./.test(src)) { | |
return { | |
url: src, | |
is_original: true | |
}; | |
} | |
} | |
if ((domain_nosub === "steamstatic.com" && domain.match(/cdn\.[^.]*\.steamstatic\.com/)) || | |
// https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/2c/2c43030ea4900ebfcd3c42a4e665e9d926b488ef_medium.jpg | |
// https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/2c/2c43030ea4900ebfcd3c42a4e665e9d926b488ef_full.jpg | |
(domain_nosub === "akamaihd.net" && domain.match(/steamcdn(?:-[a-z]*)?\.akamaihd\.net/))) { | |
// http://cdn.edgecast.steamstatic.com/steam/apps/405710/ss_8555059322d118b6665f1ddde6eaa987c54b2f31.600x338.jpg?t=1516755673 | |
// http://cdn.edgecast.steamstatic.com/steam/apps/405710/ss_8555059322d118b6665f1ddde6eaa987c54b2f31.jpg?t=1516755673 | |
// http://cdn.akamai.steamstatic.com/steam/apps/678950/ss_cd54f0430e919020ce554f6cfa8d2f3b0d062716.600x338.jpg | |
// http://cdn.akamai.steamstatic.com/steam/apps/678950/ss_cd54f0430e919020ce554f6cfa8d2f3b0d062716.jpg | |
// http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/c4/c44ec2d22a0c379d697c66b05e5ca8204827ce75.jpg | |
// http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/c4/c44ec2d22a0c379d697c66b05e5ca8204827ce75_full.jpg | |
if (src.indexOf("/public/images/avatars/") >= 0) { | |
src = src.replace(/(?:_[^/.]*)?(\.[^/.]*)$/, "_full$1"); | |
} | |
return src.replace(/\.[0-9]+x[0-9]+(\.[^/]*)$/, "$1"); | |
} | |
if (domain === "steamstore-a.akamaihd.net") { | |
// https://steamstore-a.akamaihd.net/public/images/v6/app/game_page_background_shadow.png?v=2 | |
if (/\/public\/+images\/+v[0-9]*\/+app\/+game_page.*/.test(src)) | |
return { | |
url: src, | |
bad: "mask" | |
}; | |
} | |
if (domain_nosub === "medium.com" && | |
(domain.match(/cdn-images-[0-9]*\.medium\.com/) || | |
// https://miro.medium.com/fit/c/240/240/1*Znlrcvh2KRPP4xG_s9Bp7A@2x.jpeg | |
// https://miro.medium.com/1*Znlrcvh2KRPP4xG_s9Bp7A@2x.jpeg | |
domain === "miro.medium.com")) { | |
// https://cdn-images-1.medium.com/fit/c/120/120/1*EBmQkTlD1aZEsZOHFiBcdg.png | |
// https://cdn-images-1.medium.com/1*EBmQkTlD1aZEsZOHFiBcdg.png | |
// https://cdn-images-1.medium.com/max/800/1*BvC8Rvz4L-CLuK5Ou37qoA.png | |
// https://cdn-images-1.medium.com/1*BvC8Rvz4L-CLuK5Ou37qoA.png | |
//return src.replace(/\/max\/[^/]*\//, "/"); | |
return src.replace(/(:\/\/[^/]*\/).*?\/([^/]*)$/, "$1$2"); | |
} | |
if ((domain_nosub === "zimbio.com" || | |
domain_nosub === "stylebistro.com" || | |
domain_nosub === "livingly.com") && | |
domain.match(/www[0-9]*\.pictures\.(.*\.)?[a-z]+\.com/)) { | |
// http://www4.pictures.zimbio.com/bg/Calista+Flockhart+2001+SAG+Awards+FuUveoCUR9_l.jpg | |
// http://www4.pictures.zimbio.com/bg/Calista+Flockhart+2001+SAG+Awards+FuUveoCUR9_x.jpg | |
// http://www4.pictures.stylebistro.com/gi/HeEXH_STdIGx.jpg | |
// http://www1.pictures.gi.zimbio.com/Katy+Perry+NRJ+Music+Awards+2009+uA-QnAhT6Wul.jpg | |
// http://www1.pictures.gi.zimbio.com/Katy+Perry+NRJ+Music+Awards+2009+uA-QnAhT6Wux.jpg | |
// http://www3.pictures.fp.zimbio.com/Emma+Watson+Celebs+Set+Harry+Potter+Deathly+T2P80JadJBDl.jpg | |
// http://www3.pictures.fp.zimbio.com/Emma+Watson+Celebs+Set+Harry+Potter+Deathly+T2P80JadJBDx.jpg -- doesn't work? | |
// x, l, m, p, s, c, t | |
return src.replace(/[a-z](\.[^/.]*)$/, "x$1"); | |
} | |
if (domain_nowww === "theplace2.ru" || | |
// https://www.theplace.ru/archive/jordyn_jones/img/jordyn_jones_social_media_03_26_2018_1_s.jpg | |
// https://theplace.ru/archive/jordyn_jones/img/jordyn_jones_social_media_03_26_2018_1.jpg | |
domain_nowww === "theplace.ru" || | |
// http://image.chaojimote.com/FashionCorrelation/%E7%BB%B4%E5%A4%9A%E5%88%A9%E4%BA%9A%C2%B7%E5%98%89%E4%B8%9D%E8%92%82_VictoriaJustice(13)_s.jpg -- 220x330 | |
// http://image.chaojimote.com/FashionCorrelation/%E7%BB%B4%E5%A4%9A%E5%88%A9%E4%BA%9A%C2%B7%E5%98%89%E4%B8%9D%E8%92%82_VictoriaJustice(13).jpg -- 1500x2250 | |
domain === "image.chaojimote.com" || | |
// http://moviepic.manmankan.com/yybpic/yanyuan/pic/12960/319665_s.jpg | |
// http://moviepic.manmankan.com/yybpic/yanyuan/pic/12960/319665.jpg | |
domain === "moviepic.manmankan.com" || | |
domain === "img.star.iecity.com") { | |
// https://www.theplace2.ru/archive/calista_flockhart/img/calista611924_s.jpg | |
// https://www.theplace2.ru/archive/calista_flockhart/img/calista611924.jpg | |
// http://img.star.iecity.com/Upload/File/201707/29/20170729202504241_s.jpg | |
newsrc = src.replace(/_[a-z](\.[^/.]*)$/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nowww === "theplace2.ru" || | |
// https://www.theplace.ru/cache/forum/pics/rachelle_lefevre_at_fox_la_screenings_gala_in_los_angeles_0-gthumb-gwdata1200-ghdata1800-gfitdatamax.jpg | |
// https://www.theplace.ru/forum/pics/rachelle_lefevre_at_fox_la_screenings_gala_in_los_angeles_0.jpg | |
domain_nowww === "theplace.ru") { | |
// https://www.theplace2.ru/cache/archive/rihanna/img/488408753_10-gthumb-gwdata1200-ghdata1200-gfitdatamax.jpg | |
// https://www.theplace2.ru/archive/rihanna/img/488408753_10.jpg | |
// https://www.theplace2.ru/cache/archive/jessica_stroup/img/Jessica_Stroup_dress-1-gthumb-gwdata1200-ghdata1200-gfitdatamax.jpg | |
// https://www.theplace2.ru/archive/jessica_stroup/img/Jessica_Stroup_dress.jpg -- different image | |
// https://www.theplace2.ru/archive/jessica_stroup/img/Jessica_Stroup_dress-1.jpg -- correct image | |
return src.replace(/(:\/\/[^/]*\/)cache\/(.*?)-g[^/.]*(\.[^/.]*)/, "$1$2$3"); | |
} | |
// NextGEN? | |
if ((domain_nosub === "craveonline.com" && domain.match(/cdn[0-9]*-www\.craveonline\.com/)) || | |
// http://www.legswiki.com/pics/rachel-riley/thumbs/thumbs_Rachel-Riley-Legs-Feet1.jpg | |
// http://www.legswiki.com/pics/rachel-riley/Rachel-Riley-Legs-Feet1.jpg | |
domain_nowww === "legswiki.com" || | |
// http://cdn1-www.mandatory.com/assets/uploads/gallery/milla-jovovich-of-resident-evil-at-her-hottest-mandatory/thumbs/thumbs_milla-jovovich-2.jpg | |
// http://cdn1-www.mandatory.com/assets/uploads/gallery/milla-jovovich-of-resident-evil-at-her-hottest-mandatory/milla-jovovich-2.jpg | |
// https://cdn2-www.mandatory.com/assets/uploads/2018/02/kate-upton1-390x261.jpg | |
// https://cdn2-www.mandatory.com/assets/uploads/2018/02/kate-upton1.jpg | |
(domain_nosub === "mandatory.com" && domain.match(/^cdn[0-9]*-www\./)) || | |
// https://www.indiancinemagallery.com/wp-content/photos/celebs/shraddha-das/thumbs/thumbs_shraddha-das-photo-shoot-stills-16.jpg | |
// https://www.indiancinemagallery.com/wp-content/photos/celebs/shraddha-das/shraddha-das-photo-shoot-stills-16.jpg | |
domain_nowww === "indiancinemagallery.com" || | |
// http://www.allwomensites.com/news/gallery/five-ways-of-making-a-woman-feel-loved-and-appreciated-picture/thumbs/thumbs_Five-ways-of-making-a-woman-feel-loved-and-appreciated.jpg | |
// http://www.allwomensites.com/news/gallery/five-ways-of-making-a-woman-feel-loved-and-appreciated-picture/Five-ways-of-making-a-woman-feel-loved-and-appreciated.jpg | |
(domain_nowww === "allwomensites.com" && src.indexOf("/gallery/") >= 0) || | |
// https://zemanceleblegs.com/wp-content/gallery/r/rachel-mcadams/thumbs/thumbs_Rachel-McAdams-Legs-Sexy-Celebrity-Picture-Zeman-Celebrity-Legs-00002.jpg | |
// https://zemanceleblegs.com/wp-content/gallery/r/rachel-mcadams/Rachel-McAdams-Legs-Sexy-Celebrity-Picture-Zeman-Celebrity-Legs-00002.jpg | |
domain_nowww === "zemanceleblegs.com" || | |
// http://cdn2-www.dogtime.com/assets/uploads/gallery/shih-tzu-dog-breed-pictures/thumbs/thumbs_shih-tzu-breed-picture-6.jpg | |
// http://cdn2-www.dogtime.com/assets/uploads/gallery/shih-tzu-dog-breed-pictures/shih-tzu-breed-picture-6.jpg | |
(domain_nosub === "dogtime.com" && domain.match(/cdn[0-9]*-www\.dogtime\.com/))) { | |
// http://cdn2-www.craveonline.com/assets/uploads/gallery/portia-de-rossi-has-arrested-development-mandatory/thumbs/thumbs_portiaderossihotpictures13.jpg | |
// http://cdn2-www.craveonline.com/assets/uploads/gallery/portia-de-rossi-has-arrested-development-mandatory/portiaderossihotpictures13.jpg | |
newsrc = src.replace("/thumbs/thumbs_", "/"); | |
if (newsrc !== src) | |
return newsrc; | |
newsrc = src.replace(/-[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "static.tvgcdn.net") { | |
// http://static.tvgcdn.net/mediabin/galleries/shows/a_f/bq_bz/brothersandsisters/season3/smallcrops/brothers-sisters282sm.jpg | |
// http://static.tvgcdn.net/mediabin/galleries/shows/a_f/bq_bz/brothersandsisters/season3/brothers-sisters282.jpg | |
// http://static.tvgcdn.net/mediabin/showcards/celebs/d-f/thumbs/felicity-jones_768x1024.png | |
// http://static.tvgcdn.net/mediabin/showcards/celebs/d-f/felicity-jones.png | |
// return src.replace(/\/thumbs\/([^/.]*)_[0-9]+x[0-9]+(\.[^/.]*)$/, "/$1$2"); | |
return src | |
.replace("/smallcrops/", "/") | |
.replace("/thumbs/", "/") | |
.replace(/sm(\.[^/.]*)$/, "$1") | |
.replace(/_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1"); | |
} | |
if (domain_nosub === "blogcdn.com") { | |
// https://s.blogcdn.com/slideshows/images/slides/506/163/7/S5061637/slug/l/selena-gomez-visits-the-elvis-duran-z100-morning-show-1.jpg | |
// http://www.blogcdn.com/slideshows/images/slides/289/321/4/S2893214/slug/l/2013-american-music-awards-arrivals-1.jpg | |
// http://www.blogcdn.com/slideshows/images/slides/289/305/8/S2893058/slug/l/2014-mtv-video-music-awards-arrivals-1.jpg | |
// https://www.blogcdn.com/slideshows/images/slides/851/019/S851019/s.jpg?1 | |
// https://www.blogcdn.com/slideshows/images/slides/851/019/S851019/l.jpg?1 | |
// only found /slug/s and /slug/l so far, tried a-z | |
return src | |
.replace(/(\/S[0-9]+\/)[a-z](\.[^/.]*)$/, "$1l$2") | |
.replace(/\/slug\/[a-z]\//, "/slug/l/"); | |
} | |
if (domain === "photos.imageevent.com") { | |
// https://photos.imageevent.com/afap/wallpapers/movies/soulsurfer/small/AnnaSophia%20Robb%20-%20Soul%20Surfer%20-9.jpg | |
// https://photos.imageevent.com/afap/wallpapers/movies/soulsurfer/large/AnnaSophia%20Robb%20-%20Soul%20Surfer%20-9.jpg | |
// http://photos.imageevent.com/afap/wallpapers/stars/bellathorne/icons/Bella%20Thorne%20and%20Zendaya%20Coleman.jpg | |
// http://photos.imageevent.com/afap/wallpapers/stars/bellathorne/Bella%20Thorne%20and%20Zendaya%20Coleman.jpg | |
return src.replace(/\/(?:small|large|huge|giant|icons)\/([^/]*)$/, "/$1"); | |
} | |
if (domain === "image.ajunews.com") { | |
// http://image.ajunews.com//content/image/2015/10/10/20151010181219457255_258_161.jpg | |
// http://image.ajunews.com//content/image/2015/10/10/20151010181219457255.jpg | |
return src.replace(/_[0-9]*_[0-9]*(\.[^/.]*)$/, "$1"); | |
} | |
if (domain_nosub === "telegraph.co.uk" && | |
(domain_nowww === "telegraph.co.uk" || | |
// https://secure.aws.telegraph.co.uk/content/dam/wellbeing/2016/12/28/graham5_trans_NvBQzQNjv4BqNyaloxhBNUSEitvcqmzeaNrVK9LoR4c_wZH1EhIay9c.jpg?imwidth=480 | |
// https://secure.aws.telegraph.co.uk/content/dam/wellbeing/2016/12/28/graham5_trans_NvBQzQNjv4BqNyaloxhBNUSEitvcqmzeaNrVK9LoR4c_wZH1EhIay9c.jpg | |
domain.indexOf("aws.telegraph.co.uk") >= 0 || | |
domain === "subscriber.telegraph.co.uk")) { | |
// http://www.telegraph.co.uk/content/dam/men/2016/02/26/Headerraz-small_trans_NvBQzQNjv4BqqVzuuqpFlyLIwiB6NTmJwfSVWeZ_vEN7c6bHu2jJnT8.jpg | |
// http://www.telegraph.co.uk/content/dam/men/2016/02/26/Headerraz_trans_NvBQzQNjv4BqqVzuuqpFlyLIwiB6NTmJwfSVWeZ_vEN7c6bHu2jJnT8.jpg | |
// http://www.telegraph.co.uk/content/dam/luxury/2018/01/17/018_MM4_9844-large_trans_NvBQzQNjv4BqeqwG1mMdY8c_ukC_8VAhqgb1Y9UHRh9-1rvsHveO7k8.JPG | |
// http://www.telegraph.co.uk/content/dam/luxury/2018/01/17/018_MM4_9844_trans_NvBQzQNjv4BqeqwG1mMdY8c_ukC_8VAhqgb1Y9UHRh9-1rvsHveO7k8.JPG | |
// http://www.telegraph.co.uk/content/dam/Author%20photos/Martin%20byline-small.png | |
// http://www.telegraph.co.uk/content/dam/Author%20photos/Martin%20byline.png | |
// http://www.telegraph.co.uk/content/dam/fashion/2016/10/11/110910109_ONLINE_USE_ONLY_ONE_USE_ONLY_MUST_CREDIT_Alexi_Lubomirski_-_Harpers__Bazaar_US__MUST_HOTLI_trans_NvBQzQNjv4BqqVzuuqpFlyLIwiB6NTmJwfSVWeZ_vEN7c6bHu2jJnT8.jpg | |
// http://www.telegraph.co.uk/content/dam/Travel/Cruise/titanic-1997-film-still-ship-xlarge.jpg | |
// http://www.telegraph.co.uk/content/dam/Travel/Cruise/titanic-1997-film-still-ship.jpg | |
// doesn't work: | |
// https://www.telegraph.co.uk/content/dam/fashion/2015/12/17/victoria-beckham-9-large_trans_NvBQzQNjv4Bq2oUEflmHZZHjcYuvN_Gr-bVmXC2g6irFbtWDjolSHWg.jpg?imwidth=480 | |
// https://www.telegraph.co.uk/content/dam/fashion/2015/12/17/victoria-beckham-9_trans_NvBQzQNjv4Bq2oUEflmHZZHjcYuvN_Gr-bVmXC2g6irFbtWDjolSHWg.jpg -- doesn't work | |
// https://www.telegraph.co.uk/content/dam/fashion/2015/12/17/victoria-beckham-9-large_trans_NvBQzQNjv4Bq2oUEflmHZZHjcYuvN_Gr-bVmXC2g6irFbtWDjolSHWg.jpg -- works | |
//return src.replace(/(\/[^/-]*[^-_])-(?:x*(?:large|medium|small))(_[^/]*)?(\.[^/.]*$)$/, "$1$2$3"); | |
return src.replace(/-(?:x*(?:large|medium|small))(_[^/]*)?(\.[^/.]*$)$/, "$1$2"); | |
} | |
if (false && (domain === "i.telegraph.co.uk" || | |
domain === "secure.i.telegraph.co.uk")) { | |
// works: | |
// http://i.telegraph.co.uk/multimedia/archive/03218/Hogwarts_3218917c.jpg | |
// k, a, m, i, b, n, l, c, d, e, f, g, o, p, j, h | |
// doesn't work: | |
// http://i.telegraph.co.uk/multimedia/archive/02804/Felicity-Jones_2804773c.jpg | |
// n, b, i, l, d, c, a, f, g, o, p, j, h | |
// doesn't work: | |
// https://secure.i.telegraph.co.uk/multimedia/archive/03443/London-Connections_3443046a.jpg | |
// | |
// https://i.telegraph.co.uk/multimedia/archive/03049/night-tube-full_3049237a.jpg | |
// https://i.telegraph.co.uk/multimedia/archive/03049/night-tube-full_3049237a.jpg - smaller | |
//return src.replace(/[a-z](\.[^/.]*)$/, "k$1"); | |
} | |
if (domain === "image.munhwa.com") { | |
// http://image.munhwa.com/gen_thumb/201605/20160510MW162123225413_120.jpg | |
// http://image.munhwa.com/gen_news/201605/20160510MW162123225413_b.jpg | |
// http://image.munhwa.com/gen_news/201708/2017081701032603000001_b.jpg | |
// http://marathon.munhwa.com/munhwa_anyadmin/amboard/imgview.php?no=785&fno=23996&group=basic&code=gallery - very large | |
// http://marathon.munhwa.com/netizen/index02.php?sno=60&group=basic&code=gallery&category=&&abmode=view&no=23996&bsort=&bfsort=&PHPSESSID=91245c6b3debc2a851d802574460ea78 - article | |
return src.replace("/gen_thumb/", "/gen_news/").replace(/_[^/._]*(\.[^/.]*$)/, "_b$1"); | |
} | |
if (domain_nosub === "dspmedia.co.kr") { | |
// http://kara.dspmedia.co.kr/data/file/karam41/thumb_125x215_100/1935537395_3AVlZGS5__YS_1284.jpg | |
// http://kara.dspmedia.co.kr/data/file/karam41/1935537395_3AVlZGS5__YS_1284.jpg | |
return src.replace(/(\/file\/[^/]*\/)thumb_[0-9]*x[0-9]*[^/]*\//, "$1"); | |
} | |
if (domain_nosub === "wixmp.com" && | |
options && options.do_request && options.cb && (!options._internal_info || !options._internal_info.deviantart_page)) { | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/bc11a5bd-c85a-4e07-a890-a83ce286cfee/dcqjbom-5b42308b-181c-4bb6-9108-5ce3508986e4.jpg | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/922c6655-afbf-45cb-929f-b971943216f4/d906aqf-b0e71f31-20c2-45f4-831f-2442087fbbad.jpg/v1/fill/w_1024,h_640,q_75,strp/goblin_naturists_by_warmics_d906aqf-fullview.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9NjQwIiwicGF0aCI6IlwvZlwvOTIyYzY2NTUtYWZiZi00NWNiLTkyOWYtYjk3MTk0MzIxNmY0XC9kOTA2YXFmLWIwZTcxZjMxLTIwYzItNDVmNC04MzFmLTI0NDIwODdmYmJhZC5qcGciLCJ3aWR0aCI6Ijw9MTAyNCJ9XV0sImF1ZCI6WyJ1cm46c2VydmljZTppbWFnZS5vcGVyYXRpb25zIl19.FTWlO6H5303XfAWoFjliFO73UtCmv0WvMNxADrjNBGs | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/3953b6c9-6b84-493b-9832-cc14ba59fa07/d1fl69c-907907a6-ce19-48b2-b915-f823507cbbc4.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7InBhdGgiOiJcL2ZcLzM5NTNiNmM5LTZiODQtNDkzYi05ODMyLWNjMTRiYTU5ZmEwN1wvZDFmbDY5Yy05MDc5MDdhNi1jZTE5LTQ4YjItYjkxNS1mODIzNTA3Y2JiYzQuanBnIn1dXSwiYXVkIjpbInVybjpzZXJ2aWNlOmZpbGUuZG93bmxvYWQiXX0.5IJp0mWnHzp_yKTxTaoNvw5c1r_1-PhUvzcvVdt_8Vk | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/3953b6c9-6b84-493b-9832-cc14ba59fa07/d1fl69c-907907a6-ce19-48b2-b915-f823507cbbc4.jpg | |
match = src.match(/^[a-z]+:\/\/(?:images-)?wixmp-[0-9a-f]+\.wixmp\.com\/+(?:intermediary\/+)?[^/]*\/+[-0-9a-f]+\/+([0-9a-z]+)-[-0-9a-f]+\.[^/.]+(?:\/+v[0-9]*\/.*?)?(?:[?#].*)?$/); | |
if (match) { | |
id = match[1]; | |
common_functions.deviantart_page_from_id(options.do_request, api_cache, id, function(result) { | |
options._internal_info.deviantart_page = (result && result.finalUrl) || true; | |
if (!result) { | |
return options.cb({ | |
url: null, | |
waiting: false | |
}); | |
} | |
common_functions.deviantart_fullimage(options, api_cache, src, id, function(obj) { | |
if (!obj) { | |
obj = { | |
url: src, | |
extra: { | |
page: result.finalUrl | |
} | |
}; | |
} | |
obj.forcerecurse = true; | |
if (!obj.extra) { | |
obj.extra = { | |
page: result.finalUrl | |
}; | |
} | |
return options.cb(obj); | |
}); | |
}); | |
return { | |
waiting: true | |
}; | |
} | |
} | |
if (domain === "static.wixstatic.com" || | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/bc11a5bd-c85a-4e07-a890-a83ce286cfee/dcqjbom-5b42308b-181c-4bb6-9108-5ce3508986e4.jpg/v1/fill/w_730,h_1095,q_70,strp/mileena_by_motesoegyi_dcqjbom-pre.jpg | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/bc11a5bd-c85a-4e07-a890-a83ce286cfee/dcqjbom-5b42308b-181c-4bb6-9108-5ce3508986e4.jpg | |
// doesn't work with new pattern: | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/5a49de59-57c5-45c7-a6fb-13cf111210fb/dd0k87w-e519b8c0-7eb7-4650-82e2-4c130db1f483.jpg/v1/fill/w_1055,h_757,q_70,strp/spider_gwen_by_geofffffff_dd0k87w-pre.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9OTE5IiwicGF0aCI6IlwvZlwvNWE0OWRlNTktNTdjNS00NWM3LWE2ZmItMTNjZjExMTIxMGZiXC9kZDBrODd3LWU1MTliOGMwLTdlYjctNDY1MC04MmUyLTRjMTMwZGIxZjQ4My5qcGciLCJ3aWR0aCI6Ijw9MTI4MCJ9XV0sImF1ZCI6WyJ1cm46c2VydmljZTppbWFnZS5vcGVyYXRpb25zIl19.zs91pq07IIAEgdwq2HSOfdOYkd6BNaYM6IziFXRjn2M | |
// however, adding intermediary does work: | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/5a49de59-57c5-45c7-a6fb-13cf111210fb/dd0k87w-e519b8c0-7eb7-4650-82e2-4c130db1f483.jpg/v1/fill/w_1055,h_757,q_70,strp/spider_gwen_by_geofffffff_dd0k87w-pre.jpg | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/5a49de59-57c5-45c7-a6fb-13cf111210fb/dd0k87w-e519b8c0-7eb7-4650-82e2-4c130db1f483.jpg | |
// intermediary no longer works: | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/58f002d0-3a61-4c38-9c1a-8cb2e93669b0/dd2w0bq-f554248d-cf71-4636-8969-cb10312b2e3e.png/v1/fill/w_1089,h_734,q_70,strp/tattletale_and_simurgh_by_flick_the_thief_dd2w0bq-pre.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9ODYzIiwicGF0aCI6IlwvZlwvNThmMDAyZDAtM2E2MS00YzM4LTljMWEtOGNiMmU5MzY2OWIwXC9kZDJ3MGJxLWY1NTQyNDhkLWNmNzEtNDYzNi04OTY5LWNiMTAzMTJiMmUzZS5wbmciLCJ3aWR0aCI6Ijw9MTI4MCJ9XV0sImF1ZCI6WyJ1cm46c2VydmljZTppbWFnZS5vcGVyYXRpb25zIl19.TMMxZM4DrSwX05FkjFjoFPkpZpO_wsuKg9kVtGmtL1Y | |
// smaller than original (thanks to Dragoniel on reddit): | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/d7920e4f-e2a6-4606-8a1d-3968edc0e298/dd0ns3a-3fcfe503-39bd-4e45-b6ca-9c3ed62e4721.png/v1/fill/w_1024,h_1152,q_80,strp/night_and_light_fury_by_luckycessy_dd0ns3a-fullview.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9MTE1MiIsInBhdGgiOiJcL2ZcL2Q3OTIwZTRmLWUyYTYtNDYwNi04YTFkLTM5NjhlZGMwZTI5OFwvZGQwbnMzYS0zZmNmZTUwMy0zOWJkLTRlNDUtYjZjYS05YzNlZDYyZTQ3MjEucG5nIiwid2lkdGgiOiI8PTEwMjQifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6aW1hZ2Uub3BlcmF0aW9ucyJdfQ.wZUZvqRaWdEZNYLJvvDcx8F8TbLV1tHVPqo-AgZO71I | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/d7920e4f-e2a6-4606-8a1d-3968edc0e298/dd0ns3a-3fcfe503-39bd-4e45-b6ca-9c3ed62e4721.png -- 2309x2598 | |
// original is 4000x4500 | |
domain_nosub === "wixmp.com") { | |
// https://static.wixstatic.com/media/c30de2_5bb577f8c9f949178994f77b47f5eb27~mv2_d_1500_2250_s_2.jpg/v1/fill/w_241,h_378,al_c,q_80,usm_0.66_1.00_0.01/c30de2_5bb577f8c9f949178994f77b47f5eb27~mv2_d_1500_2250_s_2.webp | |
// https://static.wixstatic.com/media/c30de2_5bb577f8c9f949178994f77b47f5eb27~mv2_d_1500_2250_s_2.jpg | |
// http://static.wixstatic.com/media/140a90_5b3fa9eb4568eac9b3d5e79cf37525d0.jpg_512 | |
// http://static.wixstatic.com/media/140a90_5b3fa9eb4568eac9b3d5e79cf37525d0.jpg | |
// http://static.wixstatic.com/media/4bd5ee_8328e23583d647c8bbc36a50b9bdaa77.jpg_srz_162_288_85_22_0.50_1.20_0.00_jpg_srz -- forces download? | |
// http://static.wixstatic.com/media/4bd5ee_8328e23583d647c8bbc36a50b9bdaa77.jpg | |
// https://static.wixstatic.com/media/964c6e_5f9921a4f67248ba807c0a69416a7ec4~mv2_d_3550_5325_s_4_2.jpg/v1/fill/w_183,h_274,al_c,q_80,usm_0.66_1.00_0.01/964c6e_5f9921a4f67248ba807c0a69416a7ec4~mv2_d_3550_5325_s_4_2.jpg | |
// https://static.wixstatic.com/media/964c6e_5f9921a4f67248ba807c0a69416a7ec4~mv2_d_3550_5325_s_4_2.jpg | |
// thanks to nywilds on github: https://github.com/qsniyg/maxurl/issues/93 | |
// https://www.deviantart.com/f1x-2/art/Nightfall-800934586 | |
// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/db0d85b1-b8b9-4790-bef0-121edb2dce7d/dd8ut2y-b61a578f-28be-496b-8044-559159433e36.jpg/v1/fill/w_1280,h_720,q_75,strp/nightfall_by_f1x_2_dd8ut2y-fullview.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9NzIwIiwicGF0aCI6IlwvZlwvZGIwZDg1YjEtYjhiOS00NzkwLWJlZjAtMTIxZWRiMmRjZTdkXC9kZDh1dDJ5LWI2MWE1NzhmLTI4YmUtNDk2Yi04MDQ0LTU1OTE1OTQzM2UzNi5qcGciLCJ3aWR0aCI6Ijw9MTI4MCJ9XV0sImF1ZCI6WyJ1cm46c2VydmljZTppbWFnZS5vcGVyYXRpb25zIl19.2ttX4dZcVj27yeTuh05fdJbZJSF2hj3pmgWaeCfh63Y | |
obj = {}; | |
if (options._internal_info && options._internal_info.deviantart_page && typeof options._internal_info.deviantart_page === "string") { | |
obj.extra = {page: options._internal_info.deviantart_page}; | |
} else { | |
obj._copy_old_props = ["extra"]; | |
} | |
newsrc = src.replace(/(:\/\/[^/]*\/)(f\/+[-0-9a-f]{36}\/+[0-9a-z]+-[-0-9a-f]{20,}(?:\.[^/.]*)?\/+v1\/+fill\/+w_[0-9]+,h_[0-9]+)(?:,[^/]+)?(\/+.*[?&]token=.*)$/, "$1$2,q_100$3"); | |
if (newsrc !== src) { | |
obj.url = newsrc; | |
return obj; | |
} | |
newsrc = src.replace(/(:\/\/[^/]*\/)(f\/+[-0-9a-f]{36}\/+.*?)[?&]token=.*$/, "$1intermediary/$2"); | |
if (newsrc !== src) { | |
obj.likely_broken = true; | |
obj.url = newsrc; | |
return obj; | |
} | |
if (!src.match(/[?&]token=.{30,}/)) { | |
newsrc = src | |
.replace(/(\.[^/.]*)\/v1\/.*/, "$1") | |
.replace(/(\/[^/.]*\.[^/.]*?)_[_0-9.a-z]*$/, "$1"); | |
if (newsrc !== src) { | |
obj.url = newsrc; | |
return obj; | |
} | |
} | |
} | |
if (domain_nosub === "kukinews.com" || | |
// http://www.inews365.com/data/cache/public/photos/20180205/art_15174759398393_648x365.jpg | |
// http://www.inews365.com/data/photos/20180205/art_15174723165416.jpg | |
domain_nowww === "inews365.com" || | |
// http://www.newsinstar.com/data/cache/public/photos/20180309/art_15200463472991_6c6a6f_90x60_c0.jpg | |
// http://www.newsinstar.com/data/photos/20180309/art_15200463472991_6c6a6f.jpg | |
domain_nowww === "newsinstar.com" || | |
// http://www.artkoreatv.com/data/cache/public/photos/20180311/art_15209739753682_ce7de1_260x364_c0.jpg | |
// http://www.artkoreatv.com/data/photos/20180311/art_15209739753682_ce7de1.jpg | |
domain_nowww === "artkoreatv.com" || | |
// http://www.cnbnews.com/data/cache/public/photos/cdn/20181251/art_1545381746_176x135.jpg | |
// http://www.cnbnews.com/data/photos/cdn/20181251/art_1545381746.jpg | |
domain_nowww === "cnbnews.com" || | |
// http://www.newsgg.net/data/cache/public/photos/20190521/art_1558846341886_b2bf4b_178x118.jpg | |
// http://www.newsgg.net/data/photos/20190521/art_1558846341886_b2bf4b.jpg | |
domain_nowww === "newsgg.net" || | |
// http://www.newsam.co.kr/data/cache/public/photos/20190834/art_15661884005506_506078_90x60_c0.jpg | |
// http://www.newsam.co.kr/data/photos/20190834/art_15661884005506_506078.jpg | |
domain_nowww === "newsam.co.kr" || | |
// http://www.fetv.co.kr/data/cache/public/photos/20191145/art_15732040131037_8d84e1_313x210_c0.jpg | |
// http://www.fetv.co.kr/data/photos/20191145/art_15732040131037_8d84e1.jpg | |
domain_nowww === "fetv.co.kr" || | |
// http://www.ddaily.co.kr/data/cache/public/photos/cdn/20180205/art_1517533165_58x58.jpg | |
domain_nowww === "ddaily.co.kr") { | |
// http://cdn.kukinews.com/data/cache/public/photos/cdn/20180104/art_1516601165_300x190.jpg | |
// http://cdn.kukinews.com/data/photos/cdn/20180104/art_1516601165.jpg | |
// http://news.kukinews.com/data/cache/public/photos/20180119/art_1516353322_300x190.jpg | |
// http://news.kukinews.com/data/photos/20180119/art_1516353322.jpg | |
// http://cdn.kukinews.com/data/photos/kukiArticle/2011/0719/2011071901.jpg - 3594x2202 | |
// http://m.kukinews.com/data/photos/kukiArticle/2013/0527/09251832521234.jpg - 4636x2891 | |
// http://cdn.kukinews.com/data/photos/kukiArticle/2013/1208/contax_34.jpg | |
// http://kukinews.com/data/cache/public/photos/20180510/art_1525933651_125x105.jpg | |
// http://kukinews.com/data/photos/20180510/art_1525933651.jpg | |
return src | |
.replace(/\/data\/+cache\/+public\//, "/data/") | |
.replace(/_[0-9]+x[0-9]+(?:_c[0-9]*)?\.([^/.]*)/, ".$1"); | |
} | |
// wip | |
// http://cdn.emetro.co.kr/html/image_view.php?f=20180116000114.jpg&x=175&y=120&b=0&p=tl&ds=320 | |
// http://cdn.emetro.co.kr/imagebank/2018/01/16/0480/20180116000114.jpg - 480 pixels (/0480/), removing doesn't work, but replacing with 0320, 0640, 1024 works (image is 568x329) | |
// http://cdn.emetro.co.kr/html/image_view.php?f=20180123000084.jpg&x=263&y=230&b=20&p=tc&ds=100000 | |
// http://cdn.emetro.co.kr/imagebank/2018/01/23/0320/20180123000047.jpg - 320 pixels | |
// http://cdn.emetro.co.kr/html/image_view.php?f=20180123000037.jpg&x=122&y=105&b=0&p=tc&ds=1024 | |
// http://cdn.emetro.co.kr/imagebank/2018/01/23/0640/20180123000037.jpg | |
// http://cdn.emetro.co.kr/html/image_view_maxw.php?f=20180207000150.jpg&x=640&ds=640 | |
// http://cdn.emetro.co.kr/html/image_view_maxw.php?f=20180207000150.jpg&x=9999&ds=9999 | |
// http://cdn.emetro.co.kr/html/image_view_maxw.php?f=20180207000150.jpg&x=9999999999&ds=9999999999 | |
// | |
// p: position (tl = top left, tc = top center?, etc.), optional | |
// d: quality? the higher it is, the less blurry it is, optional | |
// b: no idea, optional | |
// x, y: required, 0 doesn't work (blank page), -1 returns a 10x10? image, 1 returns 1px, larger stretches it | |
if (domain === "cdn.emetro.co.kr") { | |
return src | |
.replace(/\/image_view\.php.*?[?&]f=([^&]*).*/, "/image_view_maxw.php?f=$1&x=9999999999&ds=9999999999") | |
.replace(/\/imagebank\/[0-9]*\/[0-9]*\/[0-9]*\/[0-9]*\/([^/]*)$/, "/html/image_view_maxw.php?f=$1&x=9999999999&ds=9999999999") | |
.replace(/\/image_view_maxw.php.*?[?&]f=([^&]*).*/, "/image_view_maxw.php?f=$1&x=9999999999&ds=9999999999"); | |
/*origsize = src.match(/\/([0-9]*)\/[^/]*$/); | |
if (origsize) { | |
size = parseInt(origsize[1], 10); | |
if (size < 1024) { | |
return src.replace(/\/[0-9]*(\/[^/]*)$/, "/1024$1"); | |
} | |
}*/ | |
} | |
if (domain === "50.7.164.242:8182" || | |
// http://img80.imgspice.com/i/04137/o4sy99ejf4p1_t.jpg | |
(domain_nosub === "imgspice.com" && domain.match(/^img[0-9]*\./)) || | |
// http://img21.imageporter.com/i/01522/rcvaaktx2q05_t.jpg | |
// http://img21.imageporter.com/i/01522/rcvaaktx2q05.jpg | |
(domain_nosub === "imageporter.com" && domain.match(/^img[0-9]*\./)) || | |
// http://img150.pixroute.com/i/01807/71x1h0plzn0d_t.jpg | |
// http://img150.pixroute.com/i/01807/71x1h0plzn0d.jpg | |
(domain_nosub === "pixroute.com" && domain.match(/img[0-9]*\./))) { | |
// http://50.7.164.242:8182/i/05/00355/qpjey5skv52d_t.jpg | |
// http://50.7.164.242:8182/i/05/00355/qpjey5skv52d.jpg | |
newsrc = src.replace(/(\/i\/.*\/[^/.]*)_t(\.[^/.]*)$/, "$1$2"); | |
obj = { | |
url: src, | |
headers: { | |
Referer: "" | |
}, | |
bad_if: [ | |
{ | |
headers: { | |
"content-length": "40275", | |
"content-type": "image/jpeg", | |
"last-modified": "Sat, 09 Mar 2019 01:29:42 GMT" | |
} | |
} | |
] | |
}; | |
if (newsrc !== src) { | |
return fillobj_urls(add_extensions_jpeg(newsrc), obj); | |
} else { | |
return obj; | |
} | |
} | |
if (domain_nosub === "imagetwist.com" && src.match(/:\/\/[^/]*\/+error\.[^/.]*(?:[?#].*)?$/)) { | |
// https://imagetwist.com/error.jpg | |
return { | |
url: src, | |
bad: true | |
}; | |
} | |
if ((domain_nosub === "imagetwist.com" || | |
// https://img118.imagexport.com/th/31366/sg42bjfx22p4.jpg | |
// https://img118.imagetwist.com/i/31366/sg42bjfx22p4.jpg/101100-001.jpg | |
// https://imagexport.com/sg42bjfx22p4/101100-001.jpg.html | |
domain_nosub === "imagexport.com" || | |
// https://img200.imagenpic.com/th/24767/dokio7jjefsw.jpg | |
// https://img200.imagetwist.com/i/24767/dokio7jjefsw.png/yoshiki.png | |
domain_nosub === "imagenpic.com" || | |
// http://img26.picshick.com/th/13110/2ab7lhypu3l2.jpg | |
// http://img26.picshick.com/i/13110/2ab7lhypu3l2.jpg -- forces download | |
// some images return an error image with 200 | |
// there are many headers that could help identify (last-modified, content-length) | |
domain_nosub === "picshick.com") && | |
domain.match(/i(?:mg)?[0-9]*\./)) { | |
// https://i2.imagetwist.com/th/23629/qxpfyyv61890.jpg | |
// https://i2.imagetwist.com/i/23629/qxpfyyv61890.jpg | |
// http://img64.imagetwist.com/th/20956/qfucojvzag41.jpg | |
// http://img64.imagetwist.com/i/20956/qfucojvzag41.jpg | |
// https://img201.imagetwist.com/th/28668/v007u2hokmhj.jpg | |
// https://img201.imagetwist.com/i/28668/v007u2hokmhj.JPG | |
id = src.replace(/^([a-z]+:\/\/)(?:[^/.]*\.)?([^/.]+\.[^/.]+\/+)th\/+[0-9]+\/+([0-9a-z]+)(\.[^/.]*)?$/, | |
"$1$2$3/$4"); | |
//console_log(id); | |
if (id !== src && options && options.cb && options.do_request) { | |
options.do_request({ | |
method: "GET", | |
url: id, | |
onload: function(resp) { | |
//console_log(resp); | |
if (resp.readyState === 4) { | |
var match = resp.responseText.match(/<a\s+href=["'](https?:\/\/i(?:mg)?[0-9]*\.[^/]+\/+.*?)["'][^>]*\sdownload>/); | |
if (match) { | |
options.cb({ | |
url: match[1], | |
is_original: true | |
}); | |
} else { | |
options.cb(null); | |
} | |
} | |
} | |
}); | |
return { | |
waiting: true | |
}; | |
} | |
return { | |
url: src.replace(/\/th\//, "/i/"), | |
headers: { | |
Referer: src.replace(/:\/\/(?:[^/]*\.)?([^/.]*\.[^/.]*)\/.*/, "://$1/"), | |
Origin: src.replace(/:\/\/(?:[^/]*\.)?([^/.]*\.[^/.]*)\/.*/, "://$1/"), | |
"Sec-Metadata": "destination=image, site=same-site" | |
} | |
}; | |
} | |
if (domain_nosub === "fappic.com") { | |
// https://img100.fappic.com/i/00698/y86osh64in9k_t.jpg | |
// https://img100.fappic.com/img/lyhjsfz3nde7hsjrkaehbba63w5xjupbtmqt67awuu/0002.jpeg | |
// https://www.fappic.com/i/00536/vz6f4d6kubov_t.jpg | |
// https://www.fappic.com/img/lahkdnrgnddldsjyc4chbwyc2gbhthljxo25o7spsu/27afDSm-lhf_1091_0001.jpeg | |
id = src.replace(/^([a-z]+:\/\/)(?:[^/.]*\.)?([^/.]+\.[^/.]+\/+)(?:th|i)\/+[0-9]+\/+([0-9a-z]+)(?:_t)?(\.[^/.]*)?$/, | |
"$1$2$3/$4"); | |
//console_log(id); | |
if (id !== src && options && options.cb && options.do_request) { | |
options.do_request({ | |
method: "GET", | |
url: id, | |
onload: function(resp) { | |
//console_log(resp); | |
if (resp.readyState === 4) { | |
var match = resp.responseText.match(/<img\s+src=["'](https?:\/\/[^/]+\/+img\/+.*?)["'][^>]*\s+class=['"]pic["']/); | |
if (match) { | |
options.cb({ | |
url: match[1], | |
is_original: true | |
}); | |
} else { | |
options.cb(null); | |
} | |
} | |
} | |
}); | |
return { | |
waiting: true | |
}; | |
} | |
return { | |
url: src, | |
headers: { | |
Referer: src.replace(/:\/\/(?:[^/]*\.)?([^/.]*\.[^/.]*)\/.*/, "://$1/"), | |
Origin: src.replace(/:\/\/(?:[^/]*\.)?([^/.]*\.[^/.]*)\/.*/, "://$1/"), | |
"Sec-Metadata": "destination=image, site=same-site" | |
} | |
}; | |
} | |
if (domain_nosub === "imgflare.com" || | |
// http://i.imgbabes.com/i/00403/r0hjwo7rnsr4_t.jpg | |
// http://i.imgbabes.com/files/7/nxxbauvvaqq5ud/beyonce%20pubes.jpg | |
domain_nosub === "imgbabes.com") { | |
// http://www.imgflare.com/i/00026/u6j8ulxub2su_t.jpg | |
// http://www.imgflare.com/files/9/mug5ve6613zk84/403.jpg | |
id = src.replace(/^([a-z]+:\/\/)(?:[^/.]*\.)?([^/.]+\.[^/.]+\/+)i\/+[0-9]+\/+([0-9a-z]+)(?:_t)?(\.[^/.]*)?$/, | |
"$1www.$2$3/$4"); | |
//console_log(id); | |
if (id !== src && options && options.cb && options.do_request) { | |
common_functions.get_testcookie_cookie(options, api_cache, "http://www." + domain_nosub + "/", function (cookie) { | |
if (!cookie) { | |
return options.cb(null); | |
} | |
options.do_request({ | |
method: "GET", | |
headers: { | |
Referer: "", | |
Cookie: cookie | |
}, | |
url: id + ".html", | |
onload: function (resp) { | |
//console_log(resp); | |
if (resp.readyState === 4) { | |
var match = resp.responseText.match(/<img\s+src=["'](https?:\/\/[^/]+\/+files\/+.*?)["'][^>]*\s+class=['"]pic["']/); | |
if (match) { | |
options.cb({ | |
url: match[1], | |
is_original: true | |
}); | |
} else { | |
options.cb(null); | |
} | |
} | |
} | |
}); | |
}); | |
return { | |
waiting: true | |
}; | |
} | |
return { | |
url: src, | |
headers: { | |
Referer: src.replace(/:\/\/(?:[^/]*\.)?([^/.]*\.[^/.]*)\/.*/, "://$1/"), | |
Origin: src.replace(/:\/\/(?:[^/]*\.)?([^/.]*\.[^/.]*)\/.*/, "://$1/"), | |
"Sec-Metadata": "destination=image, site=same-site" | |
} | |
}; | |
} | |
if (domain === "www.theactuary.com") { | |
// nowww !== www | |
// http://www.theactuary.com/EasysiteWeb/getresource.axd?AssetID=552225&type=custom&servicetype=Inline&customSizeId=104 | |
// http://www.theactuary.com/EasysiteWeb/getresource.axd?AssetID=552225 | |
return src.replace(/getresource\.axd\?.*(AssetID=[0-9]*).*/, "getresource.axd?$1"); | |
} | |
if (domain === "static.new-magazine.co.uk" || | |
// http://star-magazine.co.uk.s3.amazonaws.com/prod/media/images/600x400_ct/834228_56665_1_85643f98ed384ea3c2910d34044488d9.jpg | |
// http://star-magazine.co.uk.s3.amazonaws.com/prod/media/images/original/834228_56665_1_85643f98ed384ea3c2910d34044488d9.jpg | |
amazon_container === "star-magazine.co.uk") { | |
// https://static.new-magazine.co.uk/prod/media/images/300x200_ct/1105261_334919_157_106_2_b4536ad77d2a7ac6c5c342d5ba94c83a.jpg | |
// https://static.new-magazine.co.uk/prod/media/images/625x833_ct/1105261_334919_157_106_2_b4536ad77d2a7ac6c5c342d5ba94c83a.jpg | |
// https://static.new-magazine.co.uk/prod/media/images/original/1105261_334919_157_106_2_b4536ad77d2a7ac6c5c342d5ba94c83a.jpg | |
return src.replace(/(\/prod\/media\/images\/)[^/]*\//, "$1original/"); | |
} | |
if (domain_nowww === "irishexaminer.com" || | |
// https://www.breakingnews.ie/remote/media.central.ie/media/images/r/roryBestShaneRoss6NationsTrophy_large.jpg?width=600&s=bn-833165 | |
// http://media.central.ie/media/images/r/roryBestShaneRoss6NationsTrophy_large.jpg | |
domain_nowww === "breakingnews.ie" || | |
// https://ip.index.hr/remote/indexnew.s3.index.hr/rethatrhtsrhgertr.jpg?width=765&height=440 | |
// http://indexnew.s3.index.hr/rethatrhtsrhgertr.jpg | |
domain === "ip.index.hr" || | |
// https://images.radiotimes.com/remote/images.atlas.metabroadcast.com/pressassociation.com/webANXloomintowerbbc.jpg?quality=60&mode=crop&width=700&height=422 | |
// http://images.atlas.metabroadcast.com/pressassociation.com/webANXloomintowerbbc.jpg | |
domain === "images.radiotimes.com" || | |
// https://www.mffashion.com/remote/static.classeditori.it/content_upload/img/2019/08/201908081535086700/keanu-gq-4-771138.jpg?width=370&height=220&mode=crop | |
// http://static.classeditori.it/content_upload/img/2019/08/201908081535086700/keanu-gq-4-771138.jpg | |
domain_nowww === "mffashion.com" || | |
// http://download.iask.ca/remote/img3.doubanio.com/view/photo/s_ratio_poster/public/p2568921730.jpg | |
// http://img3.doubanio.com/pview/photo/raw/public/p2568921730.jpg | |
domain === "download.iask.ca" || | |
domain === "ip.trueachievements.com") { | |
// removing ?.* entirely returns 500 | |
// https://www.irishexaminer.com/remote/image.assets.pressassociation.io/v2/image/production/144492a205ad478ef0233c59e6617054Y29udGVudHNlYXJjaCwxNTEzMDczMTc2/2.30748323.jpg?crop=0,102,3712,2190&ext=.jpg&width=600 | |
// https://www.irishexaminer.com/remote/image.assets.pressassociation.io/v2/image/production/144492a205ad478ef0233c59e6617054Y29udGVudHNlYXJjaCwxNTEzMDczMTc2/2.30748323.jpg?ext=.jpg&width=600 | |
// however, /remote/ is a remote address | |
// http://image.assets.pressassociation.io/v2/image/production/144492a205ad478ef0233c59e6617054Y29udGVudHNlYXJjaCwxNTEzMDczMTc2/2.30748323.jpg | |
// https://ip.trueachievements.com/remote/images-eds-ssl.xboxlive.com%2Fimage%3Furl%3D8Oaj9Ryq1G1_p3lLnXlsaZgGzAie6Mnu24_PawYuDYIoH77pJ.X5Z.MqQPibUVTcSEliFeYEcpYdMffymmILaXcS00LePBQajKrVx_Va4DQAxgf7VKT9o10FP5RijVvisttt9.R8el9KW5aWefdGAyAK7PHk.TSf1spbv8.x6hWsZrJa2pOp_PXzU7fSK76BcdJyPe_XVC7ZQNPT1kWf.D_KXVQtjCDHj7_wiu8ekYM-?width=1200&height=675 | |
// http://images-eds-ssl.xboxlive.com/image?url=8Oaj9Ryq1G1_p3lLnXlsaZgGzAie6Mnu24_PawYuDYIoH77pJ.X5Z.MqQPibUVTcSEliFeYEcpYdMffymmILaXcS00LePBQajKrVx_Va4DQAxgf7VKT9o10FP5RijVvisttt9.R8el9KW5aWefdGAyAK7PHk.TSf1spbv8.x6hWsZrJa2pOp_PXzU7fSK76BcdJyPe_XVC7ZQNPT1kWf.D_KXVQtjCDHj7_wiu8ekYM- | |
newsrc = src.replace(/.*:\/\/[^/]*\/remote\/([^?]*).*/, "$1"); | |
if (newsrc !== src) | |
return "http://" + decodeURIComponent(newsrc); | |
} | |
if (domain === "images.radiotimes.com") { | |
// https://images.radiotimes.com/namedimage/Benedict_Cumberbatch_has_the_best_nickname_for_Tom_Hiddleston.jpg?quality=85&mode=crop&width=620&height=374&404=tv&url=/uploads/images/original/113286.jpg | |
// https://images.radiotimes.com/uploads/images/original/113286.jpg | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/namedimage\/[^?]*.*?[?&]url=([^&]*).*?$/, "$1"); | |
if (newsrc !== src) | |
return urljoin(src, newsrc, true); | |
} | |
if (domain === "images.radiotimes.com" || | |
domain_nowww === "radiotimes.com") { | |
// https://images.radiotimes.com/uploads/images/Medium/24523.jpg?quality=60&mode=crop&404=tv | |
// https://images.radiotimes.com/uploads/images/medium/24523.jpg?quality=60&mode=crop&404=tv | |
// https://images.radiotimes.com/uploads/images/medium/24523.jpg | |
// https://images.radiotimes.com/uploads/images/original/24523.jpg -- image not available, but 200 | |
// https://www.radiotimes.com/uploads/images/original/140622.d01d7e34-379c-4bcd-9a84-4caea87320db.jpg?width=426&height=256&mode=crop&quality=60 | |
// https://www.radiotimes.com/uploads/images/original/140622.d01d7e34-379c-4bcd-9a84-4caea87320db.jpg | |
// https://images.radiotimes.com/uploads/images/original/140622.d01d7e34-379c-4bcd-9a84-4caea87320db.jpg | |
return src.replace(/(\/uploads\/+images\/+[a-zA-Z]+\/+[0-9]+(?:\.[-0-9a-f]+)?\.[^/.?]*)(?:[?#].*)?$/, "$1"); | |
} | |
if ((domain === "tellymix-spykawebgroup.netdna-ssl.com" || | |
// http://static6.tellymixcdn.com/ts/800/450/www.tellymix.co.uk/files/2013/06/Tess-Daly.jpg | |
// https://tellymix.co.uk/wp-content/uploads/2013/06/Tess-Daly.jpg | |
domain_nosub === "tellymixcdn.com") && | |
src.match(/:\/\/[^/]*\/+ts\//)) { | |
// https://tellymix-spykawebgroup.netdna-ssl.com/ts/800/450/tellymix-spykawebgroup.netdna-ssl.com/wp-content/uploads/2016/10/the-apprentice-2016-sugar.jpg | |
// http://tellymix-spykawebgroup.netdna-ssl.com/wp-content/uploads/2016/10/the-apprentice-2016-sugar.jpg | |
return src.replace(/^[a-z]+:\/\/[^/]*\/+ts\/+[0-9]*\/+[0-9]*\/+/, "http://"); | |
} | |
if (domain === "assets.goodhousekeeping.co.uk") { | |
// http://assets.goodhousekeeping.co.uk/main/embedded/37045/nick_hewer__large.jpg?20170224112427 | |
// http://assets.goodhousekeeping.co.uk/main/embedded/37045/nick_hewer.jpg?20170224112427 | |
// http://assets.goodhousekeeping.co.uk/main/embedded/37045/scams_2__medium.jpg | |
// http://assets.goodhousekeeping.co.uk/main/embedded/37045/scams_2.jpg | |
// http://assets.goodhousekeeping.co.uk/main/embedded/961/DH-esther-rantzen-170913-de__medium.jpg | |
// http://assets.goodhousekeeping.co.uk/main/embedded/961/DH-esther-rantzen-170913-de.jpg | |
// http://assets.goodhousekeeping.co.uk/main/galleries/22679/brilliant-hairstyles-at-the-baftas---felicity-jones__small.jpg?20150209111956 | |
// http://assets.goodhousekeeping.co.uk/main/galleries/22679/brilliant-hairstyles-at-the-baftas---felicity-jones.jpg?20150209111956 | |
// | |
// doesn't work: | |
// http://assets.goodhousekeeping.co.uk/main/options/sized-good-housekeeping-institute-cookery-school-outside-institute__medium.jpg | |
return src.replace(/(\/(?:embedded|galleries)\/+(?:[0-9]*\/+)[^/]*)__[^/.]*(\.[^/]*)$/, "$1$2"); | |
//return src.replace(/(\/main\/+galleries\/+[0-9]+\/+[^/]*)__small(\.[^/.]*)(?:[?#].*)?$/, "$1$2"); | |
} | |
if (false && ((domain_nowww === "femalefirst.co.uk" || | |
domain_nowww === "malextra.com") && | |
src.indexOf("/image-library/"))) { | |
// wip, need a better way to find numbers ... seems to stretch the image | |
// http://www.femalefirst.co.uk/image-library/square/1000/n/nick-hewer.jpg.pagespeed.ce.hpbDLhN-Bn.jpg | |
// http://www.femalefirst.co.uk/image-library/square/1000/n/nick-hewer.jpg | |
// http://www.femalefirst.co.uk/image-library/square/250/i/125x125xi-am-health-ledger.jpg.pagespeed.ic.FlFI8UcEzf.webp | |
// http://www.femalefirst.co.uk/image-library/square/250/i/i-am-health-ledger.jpg | |
// http://www.femalefirst.co.uk/image-library/partners/bang/land/1000/b/xbruno-mars-bdb9ea9c22850bc313ff7ac8e630fb1d828ffc4f.jpg.pagespeed.ic.rBtqQphklp.jpg | |
// http://www.femalefirst.co.uk/image-library/partners/bang/land/1000/b/bruno-mars-bdb9ea9c22850bc313ff7ac8e630fb1d828ffc4f.jpg | |
// https://www.femalefirst.co.uk/image-library/partners/bang/port/1000/c/camila-cabello-03bdc9bf2a1513d9a06c55f25c33f87ea098a0e3.jpg | |
// http://www.femalefirst.co.uk/image-library/partners/bang/square/250/l/lord-alan-sugar-d9c582eb51a37f070569b849b1ec3916e0bb28e0.jpg | |
// http://www.femalefirst.co.uk/image-library/partners/bang/square/1000/l/lord-alan-sugar-d9c582eb51a37f070569b849b1ec3916e0bb28e0.jpg -- stretched | |
// http://www.femalefirst.co.uk/image-library/deluxe/d/despicable-me-3-character-poster-5.jpg (4050x6000) | |
// http://www.femalefirst.co.uk/image-library/deluxe/r/real-housewives-of-beverly-hills-season-8-camille-grammer-deluxe-image.jpg (2249x3000) | |
// http://www.femalefirst.co.uk/image-library/deluxe/w/world-of-warcraft-battle-for-azeroth-logo-deluxe.jpg (4500x2400) | |
// https://www.femalefirst.co.uk/image-library/deluxe/s/starsdance-1.jpg -- 404, returns blank document (0 bytes), but "original" etc. return a proper 404 html page | |
//return src.replace(/\/(?:[0-9]+x[0-9]+x)?x*([^/.]*\.[^/.]*)[^/]*$/, "/$1"); | |
src = src.replace(/\/[0-9x]*([^/.]*\.[^/.]*)[^/]*$/, "/$1"); | |
origsize = src.match(/\/([0-9]*)\/.\/[^/]*$/); | |
if (origsize) { | |
size = origsize[1]; | |
if (parseInt(size, 10) < 1000) { | |
src = src.replace(/\/[0-9]*(\/.\/[^/]*)$/, "/1000$1"); | |
} | |
} | |
return src; | |
} | |
if (domain === "img.buzzfeed.com") { | |
// wip | |
// https://img.buzzfeed.com/buzzfeed-static/static/2014-11/19/17/enhanced/webdr10/longform-original-17700-1416435430-4.png | |
// https://img.buzzfeed.com/buzzfeed-static/static/2014-11/19/17/campaign_images/webdr03/nick-hewer-has-just-done-his-best-ever-facial-exp-2-32167-1416437197-0_dblbig.jpg | |
// https://img.buzzfeed.com/buzzfeed-static/static/2018-01/26/9/campaign_images/buzzfeed-prod-fastlane-03/the-us-olympic-committee-demands-all-usa-gymnasti-2-2591-1516975268-0_dblwide.jpg | |
// https://img.buzzfeed.com/buzzfeed-static/static/2018-01/26/8/campaign_images/buzzfeed-prod-fastlane-01/the-supreme-court-stopped-alabama-from-executing--2-14117-1516973637-0_dblwide.jpg | |
// https://img.buzzfeed.com/buzzfeed-static/static/2018-01/25/22/asset/buzzfeed-prod-fastlane-02/sub-buzz-5552-1516935824-2.jpg -- unrelated? | |
// https://img.buzzfeed.com/buzzfeed-static/static/2016-05/12/16/enhanced/webdr08/original-6479-1463084088-1.jpg | |
// https://img.buzzfeed.com/buzzfeed-static/static/2017-08/22/15/enhanced/buzzfeed-prod-fastlane-01/original-18338-1503431220-9.png | |
// https://img.buzzfeed.com/buzzfeed-static/static/2018-04/11/8/enhanced/buzzfeed-prod-web-03/original-16715-1523449517-2.jpg | |
return src | |
.replace(/_big(\.[^/.]*)$/, "_dblbig$1") | |
.replace(/_wide(\.[^/.]*)$/, "_dblbig$1") | |
.replace(/_dblwide(\.[^/.]*)$/, "_dblbig$1"); | |
} | |
if (domain_nowww === "thegenealogist.co.uk") { | |
// https://www.thegenealogist.co.uk/images/featuredarticles/header_sm/wdytya2016_dyer.jpg | |
// https://www.thegenealogist.co.uk/images/featuredarticles/header_lg/wdytya2016_dyer.jpg | |
return src.replace(/\/images\/+featuredarticles\/+header_sm\//, "/images/featuredarticles/header_lg/"); | |
} | |
if (domain === "251d2191a60056d6ba74-1671eccf3a0275494885881efb0852a4.ssl.cf1.rackcdn.com" || | |
// https://8583b52b4a309671f69d-b436b898353c7dc300b5887446a26466.ssl.cf1.rackcdn.com/20971239_donatella-arpaia-announces-shes_9eb94af2_m.jpg?bg=C6BDA4 | |
// https://8583b52b4a309671f69d-b436b898353c7dc300b5887446a26466.ssl.cf1.rackcdn.com/20971239_donatella-arpaia-announces-shes_9eb94af2.jpg | |
domain === "8583b52b4a309671f69d-b436b898353c7dc300b5887446a26466.ssl.cf1.rackcdn.com" || | |
// https://2e0a24317f4a9294563f-26c3b154822345d9dde0204930c49e9c.ssl.cf1.rackcdn.com/10033326_legends-of-tomorrow-casts-maisie-richardson-_35dcb2d4_m.jpg?bg=686658 | |
// https://2e0a24317f4a9294563f-26c3b154822345d9dde0204930c49e9c.ssl.cf1.rackcdn.com/10033326_legends-of-tomorrow-casts-maisie-richardson-_35dcb2d4.jpg | |
domain === "2e0a24317f4a9294563f-26c3b154822345d9dde0204930c49e9c.ssl.cf1.rackcdn.com" || | |
// https://7f9c61237bd6e732e57e-5fa18836a2ae6b5e7c49abcc89b20237.ssl.cf1.rackcdn.com/21774981_asia-argento-allegedly-admitted-to-sex_c58de1d1_m.jpg?bg=5E5E5E | |
// https://7f9c61237bd6e732e57e-5fa18836a2ae6b5e7c49abcc89b20237.ssl.cf1.rackcdn.com/21774981_asia-argento-allegedly-admitted-to-sex_c58de1d1.jpg | |
domain === "7f9c61237bd6e732e57e-5fa18836a2ae6b5e7c49abcc89b20237.ssl.cf1.rackcdn.com" || | |
// http://homerumah.info/biggest-single-pon-de-replay | |
// https://b6c18f286245704fe3e9-05e2055f4cd9122af02914269431c9f6.ssl.cf1.rackcdn.com/20635950_rihanna-is-still-jamming-out-to-pon_c63473e4_m.jpg?bg=554F57 | |
// https://b6c18f286245704fe3e9-05e2055f4cd9122af02914269431c9f6.ssl.cf1.rackcdn.com/20635950_rihanna-is-still-jamming-out-to-pon_c63473e4.jpg | |
domain === "b6c18f286245704fe3e9-05e2055f4cd9122af02914269431c9f6.ssl.cf1.rackcdn.com" || | |
// https://www.notey.com/blogs/her-source-%7C-hip-hop-beauty-trends | |
// https://41dcdfcd4dea0e5aba20-931851ca4d0d7cdafe33022cf8264a37.ssl.cf1.rackcdn.com/18305364_some-fans-are-now-realizing-rihanna_97a66a0b_m.jpg?bg=503D37 | |
// https://41dcdfcd4dea0e5aba20-931851ca4d0d7cdafe33022cf8264a37.ssl.cf1.rackcdn.com/18305364_some-fans-are-now-realizing-rihanna_97a66a0b.jpg | |
domain === "41dcdfcd4dea0e5aba20-931851ca4d0d7cdafe33022cf8264a37.ssl.cf1.rackcdn.com" || | |
// https://www.notey.com/blogs/taryn-manning?page=2 | |
// https://575717b777ff8d928c6b-704c46a8034042e4fc898baf7b3e75d9.ssl.cf1.rackcdn.com/11492238_taryn-manning-flaunts-a-colorful-80s-inspired_f0ada11c_m.jpg?bg=A08D87 | |
// https://575717b777ff8d928c6b-704c46a8034042e4fc898baf7b3e75d9.ssl.cf1.rackcdn.com/11492238_taryn-manning-flaunts-a-colorful-80s-inspired_f0ada11c.jpg | |
domain === "575717b777ff8d928c6b-704c46a8034042e4fc898baf7b3e75d9.ssl.cf1.rackcdn.com" || | |
// https://598d5fcf392acad97538-395e64798090ee0a3a571e8c148d44f2.ssl.cf1.rackcdn.com/19551117_israeli-vr-tech-takes-fashiontv_2f7b85b8_m.jpg?bg=2A323B | |
// https://598d5fcf392acad97538-395e64798090ee0a3a571e8c148d44f2.ssl.cf1.rackcdn.com/19551117_israeli-vr-tech-takes-fashiontv_2f7b85b8.jpg | |
domain === "598d5fcf392acad97538-395e64798090ee0a3a571e8c148d44f2.ssl.cf1.rackcdn.com") { | |
// https://251d2191a60056d6ba74-1671eccf3a0275494885881efb0852a4.ssl.cf1.rackcdn.com/11860912_countdowns-nick-hewer-amstrad-should_6d456945_m.jpg?bg=7C7374 | |
// https://251d2191a60056d6ba74-1671eccf3a0275494885881efb0852a4.ssl.cf1.rackcdn.com/11860912_countdowns-nick-hewer-amstrad-should_6d456945.jpg | |
return src.replace(/(\/[^/.]*)_[a-z](\.[^/.?]*)(?:\?[^/]*)?$/, "$1$2"); | |
} | |
if (domain === "be35832fa5168a30acd6-5c7e0f2623ae37b4a933167fe83d71b5.ssl.cf3.rackcdn.com") { | |
// https://be35832fa5168a30acd6-5c7e0f2623ae37b4a933167fe83d71b5.ssl.cf3.rackcdn.com/2827/holly-willoughby-head-shot__hero.jpg?1469632555 | |
// https://be35832fa5168a30acd6-5c7e0f2623ae37b4a933167fe83d71b5.ssl.cf3.rackcdn.com/2827/holly-willoughby-head-shot.jpg?1469632555 | |
return src.replace(/__hero(\.[^/.]*)(?:[?#].*)?$/, "$1"); | |
} | |
if (domain === "cdn.shopify.com") { | |
// https://cdn.shopify.com/s/files/1/0947/6410/products/a2178934757_10_1024x1024.jpeg?v=1458824230 | |
// https://cdn.shopify.com/s/files/1/0947/6410/products/a2178934757_10.jpeg?v=1458824230 | |
// https://cdn.shopify.com/s/files/1/0947/6410/products/Om-Sweet-Om_1024x1024.png?v=1450196316 | |
// https://cdn.shopify.com/s/files/1/0947/6410/products/Om-Sweet-Om.png?v=1450196316 | |
// https://cdn.shopify.com/s/files/1/2220/9229/products/Siticker_laptop_image_2048x.jpg | |
// https://cdn.shopify.com/s/files/1/2220/9229/products/Siticker_laptop_image.jpg | |
// https://cdn.shopify.com/s/files/1/0846/3086/products/DM21_copy2_large.jpg?v=1464040850 | |
// https://cdn.shopify.com/s/files/1/0846/3086/products/DM21_copy2.jpg?v=1464040850 | |
// http://cdn.shopify.com/s/files/1/0683/4117/products/IMG_6727_grande.jpg?v=1514569448 | |
// https://cdn.shopify.com/s/files/1/0683/4117/products/IMG_6727.jpg?v=1514569448 | |
// https://cdn.shopify.com/s/files/1/1581/4309/articles/stealherstyle-emmawatsonmetgala-tutorial02_1400x.progressive.jpg?v=1490365007 | |
// https://cdn.shopify.com/s/files/1/1581/4309/articles/stealherstyle-emmawatsonmetgala-tutorial02.jpg?v=1490365007 | |
// https://cdn.shopify.com/s/files/1/2684/7106/products/LKE600_720x@2x.jpg?v=1514632635 | |
// https://cdn.shopify.com/s/files/1/2684/7106/products/LKE600.jpg?v=1514632635 | |
// https://cdn.shopify.com/s/files/1/1066/4366/products/MG_84122_compact.jpg?v=1527671088 | |
// https://cdn.shopify.com/s/files/1/1066/4366/products/MG_84122.jpg?v=1527671088 | |
// https://cdn.shopify.com/s/files/1/1878/3879/products/N0690_400x_crop_center.jpg?v=1510258264 | |
// https://cdn.shopify.com/s/files/1/1878/3879/products/N0690.jpg?v=1510258264 | |
// https://cdn.shopify.com/s/files/1/2656/7538/files/de-mining_large.jpg?v=1524250443-/format/auto/-/stretch/off/-/resize/3000x/-/quality/lighter/-/format/auto/-/stretch/off/-/resize/3000x/-/quality/lighter/-/format/auto/-/stretch/off/-/resize/3000x/-/quality/lighter/ | |
// https://cdn.shopify.com/s/files/1/2656/7538/files/de-mining.jpg | |
return src.replace(/_(?:large|medium|small|grande|compact|[0-9]+x(?:[0-9]+)?)(?:@[0-9]+x)?(?:_crop_[a-z]+)?(?:\.progressive)?(\.[^/.]*)(?:[?#].*)?$/, "$1"); | |
} | |
if (domain === "cdn.itv.com") { | |
// https://cdn.itv.com/uploads/editor/medium_DyTW1moFnODLSb6a6IiBigbhufrsOXe2y3XWw1ekUN8.jpg | |
// https://cdn.itv.com/uploads/editor/DyTW1moFnODLSb6a6IiBigbhufrsOXe2y3XWw1ekUN8.jpg | |
return src.replace(/\/[a-z]*_([^/_]*)$/, "/$1"); | |
} | |
if (domain === "thumbnailer.mixcloud.com") { | |
// https://thumbnailer.mixcloud.com/unsafe/300x300/extaudio/8/4/1/d/f744-6169-4217-8d70-fe2abfd417f2 | |
// https://thumbnailer.mixcloud.com/unsafe/0x0/extaudio/8/4/1/d/f744-6169-4217-8d70-fe2abfd417f2 | |
return src.replace(/\/unsafe\/[0-9]+x[0-9]+\//, "/unsafe/0x0/"); | |
} | |
if (domain === "d3mkh5naggjddw.cloudfront.net" || | |
// https://img.blvds.com/unsafe/fit-in/smart/https://res.cloudinary.com/hynomj8e0/image/upload/v1487089435/ajb3zxdwskxppk9ih7fi.jpg | |
// https://res.cloudinary.com/hynomj8e0/image/upload/ajb3zxdwskxppk9ih7fi.jpg | |
domain === "img.blvds.com" || | |
// https://resizer.mundotkm.com/unsafe/700x1050/http://cfglobal01.mundotkm.com/2017/07/147114_MP1_1318-e1500065093615.jpg | |
// http://cfglobal01.mundotkm.com/2017/07/147114_MP1_1318-e1500065093615.jpg | |
// https://resizer.mundotkm.com/unsafe/http://cfglobal01.mundotkm.com/2017/07/147114_MP1_1037-e1500064972548.jpg | |
// https://resizer.mundotkm.com/unsafe/smart/http://cfglobal01.mundotkm.com/2016/12/leslie.jpg | |
// http://cfglobal01.mundotkm.com/2016/12/leslie.jpg | |
domain === "resizer.mundotkm.com" || | |
// https://d2isyty7gbnm74.cloudfront.net/unsafe/646x646/https://square-production.s3.amazonaws.com/files/6b56d9597b7a852f61ae767adb0bbe68f722cc80/original.jpeg | |
// https://square-production.s3.amazonaws.com/files/6b56d9597b7a852f61ae767adb0bbe68f722cc80/original.jpeg | |
domain === "d2isyty7gbnm74.cloudfront.net" || | |
// http://thumb.connect360.vn/unsafe/0x0/imgs.emdep.vn/Share/Image/2015/05/14/1-100345208.jpg | |
// http://imgs.emdep.vn/Share/Image/2015/05/14/1-100345208.jpg | |
domain === "thumb.connect360.vn" || | |
// https://img.movietimes.com/unsafe/fit-in/300x500/smart/https://assets.movietimes.com/v1/celebrity_images/6589/2DN3Hi8AxyiUClzCun7ANG3YBhS.jpg | |
// https://assets.movietimes.com/v1/celebrity_images/6589/2DN3Hi8AxyiUClzCun7ANG3YBhS.jpg | |
domain === "img.movietimes.com" || | |
// https://t.t2online.co.in/unsafe/smart/filters:format(webp)/images.anandabazar.com/polopoly_fs/1.855966.1535611606!/image/image.jpg_gen/derivatives/landscape_390/image.jpg | |
// http://images.anandabazar.com/polopoly_fs/1.855966.1535611606!/image/image.jpg_gen/derivatives/landscape_390/image.jpg | |
domain === "t.t2online.co.in" || | |
// http://thum.buzzni.com/unsafe/320x320/center/smart/http://image.gsshop.com/image/31/58/31580182_L1.jpg | |
// http://image.gsshop.com/image/31/58/31580182_L1.jpg | |
domain === "thum.buzzni.com" || | |
// https://resizer.mundotkm.com/unsafe/smart/http://cfus01.mundotkm.com/2015/12/nicki-look.jpg | |
// http://cfus01.mundotkm.com/2015/12/nicki-look.jpg | |
domain === "resizer.mundotkm.com" || | |
// https://quicksilver.scoopwhoop.com/unsafe/200x105/center/https://s4.scoopwhoop.com/anj2/5cf6091cd0aa382561bf481b/e32a27fe-26ce-4a41-93c9-e96200aa57bf.jpg | |
// https://s4.scoopwhoop.com/anj2/5cf6091cd0aa382561bf481b/e32a27fe-26ce-4a41-93c9-e96200aa57bf.jpg | |
domain === "quicksilver.scoopwhoop.com" || | |
// https://m.telegraphindia.com/unsafe/620x350/smart/static.telegraphindia.com/derivative/THE_TELEGRAPH/1691157/16X9/imagef8c0f45f-486b-4aba-9ee8-21091dce0902.jpg | |
// https://static.telegraphindia.com/derivative/THE_TELEGRAPH/1691157/16X9/imagef8c0f45f-486b-4aba-9ee8-21091dce0902.jpg | |
domain_nosub === "telegraphindia.com" || | |
// https://mediacdn.libertatea.ro/unsafe/1260x708/smart/filters:contrast(8):quality(80)/https://static4.libertatea.ro/wp-content/uploads/2019/12/morga-timisoaraprofimedia-0416497986.jpg | |
// https://static4.libertatea.ro/wp-content/uploads/2019/12/morga-timisoaraprofimedia-0416497986.jpg | |
domain === "mediacdn.libertatea.ro" || | |
// https://t2.genius.com/unsafe/220x0/https%3A%2F%2Fimages.genius.com%2F4e99624bb74700cf1a5ac40f142cb7cf.1000x1000x1.jpg | |
// https://images.genius.com/4e99624bb74700cf1a5ac40f142cb7cf.1000x1000x1.jpg | |
(domain_nosub === "genius.com" && domain.match(/t[0-9]*\.genius\.com/))) { | |
// https://d3mkh5naggjddw.cloudfront.net/unsafe/smart/filters:format(jpeg)/http%3A%2F%2Fi.dailymail.co.uk%2Fi%2Fpix%2F2017%2F08%2F10%2F19%2F43248C1D00000578-0-image-a-10_1502389640540.jpg | |
// http://i.dailymail.co.uk/i/pix/2017/08/10/19/43248C1D00000578-0-image-a-10_1502389640540.jpg | |
return add_http(decodeURIComponent(src | |
.replace(/.*\/unsafe\/(?:fit-in\/)?(?:[0-9]+x[0-9]+\/)?smart\/(?:filters:[^/]*\/)?/, "") | |
.replace(/.*\/unsafe\/fit-in\/smart\//, "") | |
.replace(/.*\/unsafe\/(?:fit-in\/)?(?:[0-9]*x[0-9]*\/)?(?:center\/)?(?:smart\/)?/, ""))); | |
} | |
if (domain === "cdn.uwants.com") { | |
// https://cdn.uwants.com/t/d72610/f/320x0/filters:extract_cover()/https://img.uwants.com/attachments/day_160614/20160614_9242d5cc975b38a704016qYhzjhCytoI.jpg | |
// https://img.uwants.com/attachments/day_160614/20160614_9242d5cc975b38a704016qYhzjhCytoI.jpg | |
// https://cdn.uwants.com/t/03d004/f/800x0/https://img.uwants.com/attachments/day_160614/20160614_9242d5cc975b38a704016qYhzjhCytoI.jpg | |
// https://img.uwants.com/attachments/day_160614/20160614_9242d5cc975b38a704016qYhzjhCytoI.jpg | |
return src.replace(/^[a-z]+:\/\/[^/]*\/+t\/+[0-9a-f]+\/+f\/+[0-9]+x[0-9]+\/+(?:filters:[^/]*\/+)?(https?:)/, "$1"); | |
} | |
if (domain === "elsewhere.scdn3.secure.raxcdn.com") { | |
// seems to be the number of pixels?? | |
// https://elsewhere.scdn3.secure.raxcdn.com/images/v95000/articles/the-rolling-stones-2013-glastonbury-festival-35.jpg -- 267x354 | |
// https://elsewhere.scdn3.secure.raxcdn.com/images/v9999999999999/articles/the-rolling-stones-2013-glastonbury-festival-35.jpg -- 754x1000 | |
// https://elsewhere.scdn3.secure.raxcdn.com/images/downloads/articles/the-rolling-stones-2013-glastonbury-festival-35.jpg -- 754x1000 | |
// https://elsewhere.scdn3.secure.raxcdn.com/images/s290/articles/Bj%C3%B6rk-Debut-1993.png -- 290x290 | |
// https://elsewhere.scdn3.secure.raxcdn.com/images/downloads/articles/Bj%C3%B6rk-Debut-1993.png | |
// https://elsewhere.scdn3.secure.raxcdn.com/images/v9500/articles/Bj%C3%B6rk-Debut-1993.png -- 97x97 | |
// https://elsewhere.scdn3.secure.raxcdn.com/images/downloads/articles/Bj%C3%B6rk-Debut-1993.png -- 316x316 | |
//return src.replace(/\/images\/v[0-9]*\//, "/images/v999999999999999999/"); | |
return src.replace(/\/images\/[sv][0-9]+\/articles\//, "/images/downloads/articles/"); | |
} | |
if (domain === "japantoday-asset.scdn3.secure.raxcdn.com") { | |
// https://japantoday-asset.scdn3.secure.raxcdn.com/img/store/76/9f/6cd5af44f1b594cd199d09b52aa23fea5659/amuro/_w850.jpg | |
// https://japantoday-asset.scdn3.secure.raxcdn.com/img/store/76/9f/6cd5af44f1b594cd199d09b52aa23fea5659/amuro.jpg | |
return src.replace(/(\/+img\/+store\/+[0-9a-f]{2}\/+[0-9a-f]{2}\/+[0-9a-f]+\/+[^/]*)(?:\/+_[wh][0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2"); | |
} | |
if (domain === "static01.nyt.com" || | |
// http://graphics8.nytimes.com/images/2011/11/17/fashion/17felicityspan/17felicityspan-thumbStandard.jpg | |
// http://graphics8.nytimes.com/images/2011/11/17/fashion/17felicityspan/17felicityspan-jumbo.jpg | |
(domain_nosub === "nytimes.com" && domain.match(/^graphics[0-9]*\./)) || | |
domain === "cdn1.nyt.com") { | |
// https://static01.nyt.com/images/2015/08/30/arts/30RICHARDSJP5/30RICHARSJP5-superJumbo.jpg | |
// https://static01.nyt.com/images/2015/09/17/arts/17KEITH/17KEITH-jumbo.jpg | |
// https://static01.nyt.com/images/2015/09/17/arts/17KEITH/17KEITH-thumbStandard.jpg | |
// https://static01.nyt.com/images/2015/08/30/arts/30RICHARDS1/30RICHARDS1-master1050.jpg | |
// https://static01.nyt.com/images/2015/08/30/arts/30RICHARDSSUB4/30RICHARDSSUB4-master675.jpg | |
// https://static01.nyt.com/images/2018/02/03/arts/03playlist/merlin_123145877_5ed2acde-72d5-4afb-a19a-93dbc29b5d2f-superJumbo.jpg?quality=100&auto=webp | |
// https://static01.nyt.com/newsgraphics/2018/02/11/mens-slopestyle/assets/images/composite-2-2000_x2.jpg (4000x2058) | |
// https://static01.nyt.com/images/2018/02/23/nyregion/23WOMEN01/merlin_134412716_f1cbfeaa-8204-41b1-9576-8cc8c5063348-threeByTwoLargeAt2X.jpg (3600x2400) | |
// https://static01.nyt.com/newsgraphics/2014/09/24/private-lives/assets/private_lives_nilsen_1400_v1.png | |
// https://static01.nyt.com/packages/flash/Lens/2011/06/20110629-KM-Weiwei/012-20110629-KM-Weiwei.JPG (4193x3307) | |
// https://static01.nyt.com/images/2018/02/23/us/politics/23dc-note/merlin_134350481_6712d7ba-b262-4d9e-97f3-8094cc9de088-threeByTwoLargeAt2X.jpg | |
// https://static01.nyt.com/newsgraphics/2017/10/31/yellen-legacy/50c5752d6294e63077f7e841ccf62b880fd1599e/yellen-office-alt-1.jpg (5472x3648) | |
// https://static01.nyt.com/packages/flash/Lens/2010/10/20101025-NK-Joao/20101025-Joao-extra4.jpg (3200x2108) | |
// https://static01.nyt.com/images/2010/10/06/nyregion/20101006Nocturnalist/20101006Nocturnalist-custom1.jpg (5120x3413) | |
// https://static01.nyt.com/images/2010/10/06/nyregion/20101006Nocturnalist/20101006Nocturnalist-custom2.jpg ^ | |
// https://static01.nyt.com/images/2009/02/08/sports/20090209-SIOUX-S.JPG | |
// https://static01.nyt.com/images/2010/01/05/arts/supperbig2.jpg (3000x2000) | |
// https://static01.nyt.com/images/2015/10/25/t-magazine/25tmag-11well_rihanna-t_CA0/25tmag-11well_rihanna-t_CA0-facebookJumbo.jpg (1050x550) | |
// https://static01.nyt.com/images/2015/10/25/t-magazine/25tmag-11well_rihanna-t_CA0/25tmag-11well_rihanna-t_CA0-superJumbo.jpg (1639x2048) | |
// https://static01.nyt.com/images/2015/10/12/t-magazine/12tmag-rihanna-toc-t/12tmag-rihanna-toc-t-blog427.jpg | |
// https://static01.nyt.com/images/2015/10/12/t-magazine/12tmag-rihanna-toc-t/12tmag-rihanna-toc-t-superJumbo.jpg | |
// https://static01.nyt.com/images/2016/11/03/fashion/03SKIN1/03SKIN1-master1050-v2.jpg | |
// https://static01.nyt.com/images/2016/11/03/fashion/03SKIN1/03SKIN1-superJumbo-v2.jpg | |
// https://static01.nyt.com/images/2013/07/02/fashion/01RUNWAYVERSACE1/01RUNWAYVERSACE1-articleInline.jpg | |
// https://static01.nyt.com/images/2013/07/02/fashion/01RUNWAYVERSACE1/01RUNWAYVERSACE1-superJumbo.jpg | |
// https://static01.nyt.com/images/2018/10/03/opinion/the-argument-album-art/the-argument-album-art-square320-v3.png | |
// https://static01.nyt.com/images/2018/10/03/opinion/the-argument-album-art/the-argument-album-art-superJumbo-v3.png | |
// https://static01.nyt.com/images/2018/11/02/arts/02NOVEMBER-STREAM-grid/02NOVEMBER-STREAM-grid-videoSixteenByNineJumbo1600.jpg | |
// https://static01.nyt.com/images/2018/11/02/arts/02NOVEMBER-STREAM-grid/02NOVEMBER-STREAM-grid-superJumbo.jpg | |
// https://static01.nyt.com/images/2017/02/06/opinion/RFD-Uber-boycott/RFD-Uber-boycott-sfSpan.jpg | |
// https://static01.nyt.com/images/2017/02/06/opinion/RFD-Uber-boycott/RFD-Uber-boycott-superJumbo.jpg | |
// https://static01.nyt.com/images/2018/11/07/upshot/up-amazonLIC/merlin_146433831_bfa25793-62a9-4d41-9317-28c0706c4664-videoLarge.jpg | |
// https://static01.nyt.com/images/2018/11/07/upshot/up-amazonLIC/merlin_146433831_bfa25793-62a9-4d41-9317-28c0706c4664-superJumbo.jpg | |
// https://static01.nyt.com/images/2018/09/20/style/XXtinylove-promo-4/XXtinylove-promo-4-videoLarge-v2.jpg | |
// https://static01.nyt.com/images/2018/09/20/style/XXtinylove-promo-4/XXtinylove-promo-4-superJumbo.jpg | |
// https://static01.nyt.com/images/2018/08/10/dining/10SKILLET3/10SKILLET3-mediumThreeByTwo252-v2.jpg | |
// https://static01.nyt.com/images/2018/08/10/dining/10SKILLET3/10SKILLET3-superJumbo-v2.jpg | |
// https://static01.nyt.com/images/2018/01/14/arts/14CAMILA1/14CAMILA1-articleLarge.jpg | |
// https://static01.nyt.com/images/2018/01/14/arts/14CAMILA1/14CAMILA1-superJumbo.jpg | |
// https://cdn1.nyt.com/images/2018/01/14/arts/14CAMILA1/14CAMILA1-thumbLarge-v2.jpg | |
// https://cdn1.nyt.com/images/2018/01/14/arts/14CAMILA1/14CAMILA1-superJumbo.jpg | |
// https://static01.nyt.com/images/2018/01/14/arts/14CAMILA1/14CAMILA1-videoSixteenByNine768-v2.jpg | |
// https://static01.nyt.com/images/2018/01/14/arts/14CAMILA1/14CAMILA1-superJumbo.jpg | |
// https://static01.nyt.com/images/2018/01/14/arts/14CAMILA1/14CAMILA1-watch308-v2.jpg | |
// https://static01.nyt.com/images/2018/01/14/arts/14CAMILA1/14CAMILA1-superJumbo.jpg | |
// https://static01.nyt.com/images/2019/05/22/arts/22got-clarke/9f1eb2dc57734232b6f8cd0f13567ce9-threeByTwoSmallAt2X.jpg | |
// https://static01.nyt.com/images/2019/05/22/arts/22got-clarke/9f1eb2dc57734232b6f8cd0f13567ce9-superJumbo.jpg | |
// | |
// smaller: | |
// https://static01.nyt.com/images/2019/02/14/nyregion/14NYAMAZON2/merlin_146867472_15c39bb2-67e7-40b9-9ae6-ef4693dd2ce9-videoSixteenByNine3000.jpg -- 3000x1688 | |
// https://static01.nyt.com/images/2019/02/14/nyregion/14NYAMAZON2/merlin_146867472_15c39bb2-67e7-40b9-9ae6-ef4693dd2ce9-superJumbo.jpg --2048x1366 | |
// | |
// other urls: | |
// https://static01.nyt.com/images/2018/04/14/business/dealbook/14db-anotherview1/merlin_136623336_403f4f04-e65b-4a16-8483-f7770fb63093-threeByTwoLargeAt2X.jpg -- 5823x3882 | |
// https://static01.nyt.com/images/2018/04/14/business/dealbook/14db-anotherview1/merlin_136623336_403f4f04-e65b-4a16-8483-f7770fb63093-superJumbo.jpg -- 2048x1365 | |
// https://static01.nyt.com/images/2018/06/04/us/05DC-trump/05DC-trump-threeByTwoLargeAt2X.jpg -- 5472x3648 | |
// https://static01.nyt.com/images/2018/06/15/opinion/14endorseWeb-slide-B0R2/14endorseWeb-slide-B0R2-horizontalMediumAt2X.jpg -- 6510x4340 | |
// https://static01.nyt.com/images/2010/06/03/garden/03qanda-2/03qanda-2-popup.jpg -- 3744x5616 | |
// | |
// doesn't work: | |
// https://static01.nyt.com/images/2010/10/24/arts/RICHARDS-Jp-1/RICHARDS-Jp-1-popup.jpg | |
// https://static01.nyt.com/images/2011/11/17/fashion/17felicityspan/17felicityspan-jumbo.jpg | |
// https://static01.nyt.com/images/2007/05/04/fashion/06love.1.ready/06love.1.ready-videoLarge-v3.jpg | |
var matched = src.match(/-([^-_/.]*?)(?:-v[0-9]*)?\.[^/.]*$/); | |
if (matched) { | |
if (matched[1] === "jumbo" || | |
matched[1] === "thumbStandard" || | |
matched[1] === "facebookJumbo" || | |
matched[1] === "articleInline" || | |
matched[1] === "articleLarge" || | |
matched[1] === "sfSpan" || | |
matched[1] === "videoLarge" || | |
matched[1] === "thumbLarge" || | |
matched[1].match(/^videoSixteenByNine(?:Jumbo)?(?:[0-9]{0,3}|[01][0-9]{3}|20[0-4][0-9])?$/) || | |
matched[1].match(/^mediumThreeByTwo[0-9]*/) || | |
matched[1].match(/^threeByTwoSmall/) || | |
matched[1].match(/^watch[0-9]*$/) || | |
matched[1].slice(0, 6) === "master" || | |
matched[1].slice(0, 6) === "square" || | |
matched[1].slice(0, 4) === "blog") { | |
newsrc = src.replace(/-[^-_/.]*(-v[0-9]*)?(\.[^/.]*)$/, "-superJumbo$1$2"); | |
if (newsrc !== src) { | |
if (newsrc.match(/-v[0-9]*\.[^/.]*$/)) { | |
return [ | |
newsrc, | |
newsrc.replace(/-v[0-9]*(\.[^/.]*)$/, "$1") | |
]; | |
} else { | |
return [ | |
newsrc, | |
newsrc.replace(/-superJumbo(\.[^/.]*)$/, "-jumbo$1") | |
]; | |
} | |
} | |
} | |
} | |
} | |
if (domain === "render.fineartamerica.com") { | |
// https://render.fineartamerica.com/images/rendered/search/print/images-medium-5/keith-richards-andre-koekemoer.jpg | |
// https://images.fineartamerica.com/images-medium-large-5/keith-richards-andre-koekemoer.jpg | |
return src.replace(/render\.fineartamerica\.com\/images\/rendered\/search\/print\/[^/]*(-[0-9]*)\/([^/]*)$/, "images.fineartamerica.com/images-medium-large$1/$2"); | |
} | |
if (domain === "media.npr.org") { | |
// https://media.npr.org/assets/artslife/arts/2010/10/keith-richards/keith-richards-730d749c083f177cc443b4114ee1b19b1e257988-s400-c85.jpg | |
// https://media.npr.org/assets/artslife/arts/2010/10/keith-richards/keith-richards-730d749c083f177cc443b4114ee1b19b1e257988.jpg | |
// https://media.npr.org/assets/img/2018/04/13/ap_17339773700572_wide-5b2806a60758e44c259842da1f23f45ac58b1c47.jpg | |
// https://media.npr.org/assets/img/2018/04/13/ap_17339773700572-5b2806a60758e44c259842da1f23f45ac58b1c47.jpg | |
// https://media.npr.org/assets/img/2018/02/27/ap_17299821347425-0a0868f089eae2f95d1e5a4aaa0252c2176f1334-s800-c85.jpg | |
// https://media.npr.org/assets/img/2018/02/27/ap_17299821347425-0a0868f089eae2f95d1e5a4aaa0252c2176f1334.jpg | |
// https://media.npr.org/assets/img/2018/04/13/gettyimages-111077711_wide-7cec6f88bb5f86c005767e5866a00404396e869e.jpg?s=400 | |
// https://media.npr.org/assets/img/2018/04/13/gettyimages-111077711-7cec6f88bb5f86c005767e5866a00404396e869e.jpg | |
// https://media.npr.org/assets/img/2018/01/27/rtx4ixrd_sq-744e57fe23b306ed1ccb050b38967d41b5a9c8bd-s400-c85.jpg | |
// https://media.npr.org/assets/img/2018/01/27/rtx4ixrd-744e57fe23b306ed1ccb050b38967d41b5a9c8bd.jpg | |
// thanks to kuchenmitsahne on github: https://github.com/qsniyg/maxurl/issues/96 | |
// https://media.npr.org/assets/img/2018/09/17/linnaeus_custom-e310e859d180def59eb94bbe2f4e5415271451ab-s600-c85.jpg | |
// https://media.npr.org/assets/img/2018/09/17/linnaeus_custom-e310e859d180def59eb94bbe2f4e5415271451ab.jpg | |
// removing _custom changes the crop | |
return { | |
url: src | |
.replace(/(\/[^/]*)-[sc][0-9]*(?:-[sc][0-9]*)?(\.[^/.]*)/, "$1$2") | |
.replace(/(_custom)?(?:_[a-z]+)?-([a-f0-9]{30,})(\.[^/.]*)$/, "$1-$2$3"), | |
head_wrong_contentlength: true | |
}; | |
} | |
if (domain_nosub === "pbsrc.com" && domain.match(/rs[0-9]*\.pbsrc\.com/)) { | |
// http://rs375.pbsrc.com/albums/oo198/ZaraTTucker/Get%20Italian%20Translation%20Services%20to%20Boost_zpsms99llho.jpg~c400 | |
// http://i375.photobucket.com/albums/oo198/ZaraTTucker/Get%20Italian%20Translation%20Services%20to%20Boost_zpsms99llho.jpg | |
// http://i843.photobucket.com/albums/zz352/loaloauk/dlp%20encounter/New%20Album%2042/4640363830_9e9c2ae51b_z.jpg~original | |
// http://oi843.photobucket.com/albums/zz352/loaloauk/dlp%20encounter/New%20Album%2042/4640363830_9e9c2ae51b_z.jpg | |
// http://rs414.pbsrc.com/albums/pp228/sweetblonda/NATURA.jpg?w=280&h=210&fit=crop | |
// http://i414.photobucket.com/albums/pp228/sweetblonda/NATURA.jpg | |
return src | |
.replace(/rs([0-9]*)\.pbsrc\.com/, "i$1.photobucket.com") | |
.replace(/\?.*/, "") | |
.replace(/(?:~[^/.]*)?$/, "~original"); | |
} | |
if (domain_nosub === "photobucket.com" && /^i(?:[0-9]+|mg)\./.test(domain)) { | |
// https://i785.photobucket.com/albums/yy140/Impzor/points.png?1568174690926&1568174703483 -- watermark | |
// https://oi785.photobucket.com/albums/yy140/Impzor/points.png?1568174690926&1568174703483 -- no watermark | |
// https://oi785.photobucket.com/albums/yy140/Impzor/points.png | |
// http://s785.photobucket.com/user/Impzor/media/points.png.html?o=4 | |
// https://photobucket.com/gallery/https://s785.photobucket.com/user/Impzor/media/points.png.html?o=4 | |
// https://photobucket.com/gallery/user/Impzor/media/cGF0aDovcG9pbnRzLnBuZw==?ref= | |
// atob: path:/points.png | |
// https://i785.photobucket.com/albums/yy140/Impzor/points.png?width=100&height=100&crop=1:1,smart | |
// https://oi785.photobucket.com/albums/yy140/Impzor/points.png | |
// http://i843.photobucket.com/albums/zz352/loaloauk/dlp%20encounter/New%20Album%2042/4640363830_9e9c2ae51b_z.jpg~original | |
// http://oi843.photobucket.com/albums/zz352/loaloauk/dlp%20encounter/New%20Album%2042/4640363830_9e9c2ae51b_z.jpg -- ~original works too | |
// http://i496.photobucket.com/albums/rr323/878990/555.jpg | |
// http://oi496.photobucket.com/albums/rr323/878990/555.jpg | |
// https://photobucket.com/gallery/user/878990/media/bWVkaWFJZDoyMTgwODM0OA==/?ref= | |
newsrc = src.replace(/\?.*/, ""); | |
if (newsrc !== src) | |
return newsrc; | |
newsrc = src.replace(/(?:~[^/.]*)?(?:[?#].*)?$/, "~original"); | |
if (newsrc !== src) | |
return newsrc; | |
return src.replace(/:\/\/i((?:[0-9]+|mg)\..*?)(?:~original)?(?:[?#].*)?$/, "://oi$1"); | |
} | |
if (domain_nosub === "photobucket.com" && /^o?i(?:[0-9]*|mg)\./.test(domain)) { | |
match = src.match(/^[a-z]+:\/\/[a-z]*([0-9]+)?\.[^/]*\/+albums\/+[a-z]{1,2}[0-9]+\/+([^/]+)\/+([^/]+\.[^/.~]*?)(?:~[^/.]*)?(?:[?#].*)?$/); | |
if (match) { | |
var domain = "www"; | |
if (match[1]) | |
domain = "s" + match[1]; | |
var page = "http://" + domain + ".photobucket.com/user/" + match[2] + "/media/" + match[3] + ".html"; | |
return { | |
url: src, | |
headers: { | |
Referer: page | |
}, | |
extra: { | |
page: page | |
} | |
}; | |
} | |
} | |
if (domain === "www.welt.de") { | |
// nowww !== www | |
// https://www.welt.de/img/kultur/pop/mobile132505066/0972501497-ci102l-w1024/Keith-Richards-mit-Enkel-Otto.jpg | |
// https://www.welt.de/img/kultur/pop/mobile132505066/0972501497-ci102l-w0/Keith-Richards-mit-Enkel-Otto.jpg | |
return src.replace(/-w[0-9]*(\/[^/]*)$/, "-w0$1"); | |
} | |
if (domain === "cdn.baeblemusic.com" && src.indexOf("/images/") >= 0) { | |
// https://cdn.baeblemusic.com/images/bblog/5-8-2017/keith-richards-almost-died-580.jpg | |
// https://cdn.baeblemusic.com/images/bblog/5-8-2017/keith-richards-almost-died.jpg | |
return src.replace(/-[0-9]*(\.[^/.]*)$/, "$1"); | |
} | |
if (domain_nosub === "deviantart.net" && domain.match(/^t[0-9]*\./)) { | |
// https://t00.deviantart.net/7PiX79OLWVS6WAzA0thSVYzWarQ=/300x200/filters:fixed_height(100,100):origin()/pre00/f044/th/pre/i/2004/235/7/b/megaman.jpg | |
// https://pre00.deviantart.net/f044/th/pre/i/2004/235/7/b/megaman.jpg | |
// https://t00.deviantart.net/lNDj1np7JyLzN7U1MHhJlzp38Vs=/300x200/filters:fixed_height(100,100):origin()/pre00/4328/th/pre/f/2011/194/b/6/megaman_tribute_by_saiyagina-d3odj4t.jpg | |
// https://pre00.deviantart.net/4328/th/pre/f/2011/194/b/6/megaman_tribute_by_saiyagina-d3odj4t.jpg | |
// https://t00.deviantart.net/hbXtsO07Julo2fHWk6VyTkPgU5Y=/fit-in/700x350/filters:fixed_height(100,100):origin()/pre00/034f/th/pre/i/2017/346/6/5/abyss___chibi_by_nightstar234-dbwhn28.png | |
// https://pre00.deviantart.net/034f/th/pre/i/2017/346/6/5/abyss___chibi_by_nightstar234-dbwhn28.png | |
return src.replace(/:\/\/.*?\.deviantart\.net\/.*?\/[0-9]*x[0-9]*\/[^/]*\/([^/]*)\/(.*)/, "://$1\.deviantart\.net/$2"); | |
} | |
if (domain_nosub === "grazia.fr" && domain.match(/img[0-9]*\.grazia\.fr/) || | |
// https://www.glamour.de/var/condenast/storage/images/mode/mode-news/galerien/kleider-die-wir-nicht-vergessen/margot-robbie-oscar-2016-gettyimages-512917014/13287889-1-ger-DE/margot-robbie-oscar-2016-gettyimages-512917014_gallery_large_portrait.jpg | |
// https://www.glamour.de/var/condenast/storage/images/mode/mode-news/galerien/kleider-die-wir-nicht-vergessen/margot-robbie-oscar-2016-gettyimages-512917014/13287889-1-ger-DE/margot-robbie-oscar-2016-gettyimages-512917014.jpg | |
// https://www.glamour.de/var/condenast/storage/images/media/images/artikelbilder/mode-bilder/margot-robbie-oscar-2016-gettyimages-512917014/13287964-1-ger-DE/margot-robbie-oscar-2016-gettyimages-512917014_g1500xx.jpg | |
// https://www.glamour.de/var/condenast/storage/images/media/images/artikelbilder/mode-bilder/margot-robbie-oscar-2016-gettyimages-512917014/13287964-1-ger-DE/margot-robbie-oscar-2016-gettyimages-512917014.jpg | |
domain_nowww === "glamour.de" || | |
// https://asia.nikkei.com/var/site_cache/storage/images/node_43/node_51/2018/201802/20180208t/20180208_malaysia-worker/8879284-1-eng-GB/20180208_Malaysia-worker_article_thumbnail.jpg | |
// https://asia.nikkei.com/var/site_cache/storage/images/node_43/node_51/2018/201802/20180208t/20180208_malaysia-worker/8879284-1-eng-GB/20180208_Malaysia-worker_article_main_image.jpg | |
// https://asia.nikkei.com/var/site_cache/storage/images/node_43/node_51/2018/201802/0217n/0217n-audi/8939471-1-eng-GB/0217N-Audi_large_image.jpg | |
// https://asia.nikkei.com/var/site_cache/storage/images/node_43/node_51/2018/201802/20180213t/20180213_rocket/8908091-1-eng-GB/20180213_rocket_photo_galleries_thumbnail.jpg | |
// https://asia.nikkei.com/var/site_cache/storage/images/node_43/node_51/2018/201802/20180213t/20180213_rocket/8908091-1-eng-GB/20180213_rocket_article_main_image.jpg | |
// https://asia.nikkei.com/var/site_cache/storage/images/node_43/node_51/2018/201802/20180205t/20180130citiesocial-founder-eric-wang/8846170-2-eng-GB/20180130Citiesocial-Founder-Eric-Wang_more_in_thumbnail.jpg | |
// https://asia.nikkei.com/var/site_cache/storage/images/node_43/node_51/2018/201802/20180205t/20180130citiesocial-founder-eric-wang/8846170-2-eng-GB/20180130Citiesocial-Founder-Eric-Wang.jpg | |
// https://asia.nikkei.com/var/site_cache/storage/images/top/viewpoints/humphrey-hawksley/5784021-2-app-WF/Humphrey-Hawksley_square80_thumbnail.png | |
// https://asia.nikkei.com/var/site_cache/storage/images/top/magazine/20180215/8920429-1-app-WF/FREEDOM-OF-THE-OPPRESSION_cover_image.jpg | |
// https://asia.nikkei.com/var/site_cache/storage/images/node_43/node_51/2018/201802/20180217t/20180217_panda/8940872-1-eng-GB/20180217_Panda_medium_thumbnail.jpg | |
domain === "asia.nikkei.com" || | |
// http://www.elle.co.jp/var/ellejp/storage/images/fashion/celeb/selenagomez-bestsnap-2016_17_02/node_1087470/19466418-1-jpn-JP/2017-6-7-NY_image_size_900_x.jpg | |
// http://elle.co.jp/var/ellejp/storage/images/fashion/celeb/selenagomez-bestsnap-2016_17_02/node_1087470/19466418-1-jpn-JP/2017-6-7-NY.jpg | |
// http://img.elle.co.jp/var/ellejp/storage/images/fashion/celeb/selenagomez-bestsnap-2016_17_02/node_1087470/19466418-1-jpn-JP/2017-6-7-NY_image_size_192_x.jpg | |
// http://img.elle.co.jp/var/ellejp/storage/images/fashion/celeb/selenagomez-bestsnap-2016_17_02/node_1087470/19466418-1-jpn-JP/2017-6-7-NY.jpg | |
domain_nosub === "elle.co.jp" || | |
// http://harpersbazaar.jp/var/hb/storage/images/news/rihanna-30th-birhtday-bad-girl-style-180220-hns/node_54568/658313-1-jpn-JP/2017-9-7_image_size_150_x.jpg | |
// http://harpersbazaar.jp/var/hb/storage/images/news/rihanna-30th-birhtday-bad-girl-style-180220-hns/node_54568/658313-1-jpn-JP/2017-9-7.jpg | |
domain_nowww === "harpersbazaar.jp" || | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/media/imagenes/recursos/irnidos/137969938-1-esl-ES/irnidos_reference.jpg | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/media/imagenes/recursos/irnidos/137969938-1-esl-ES/irnidos.jpg | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/cinefilia/vicky-luengo-fotomaton/138002962-1-esl-ES/Fotomaton-a-Vicky-Luengo_line.jpg | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/cinefilia/vicky-luengo-fotomaton/138002962-1-esl-ES/Fotomaton-a-Vicky-Luengo.jpg | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/noticias-cine/bryan-singer-resuelve-agujero-guion-franquicia-x-men/138127548-1-esl-ES/Bryan-Singer-resuelve-uno-de-los-mayores-agujeros-de-guion-de-la-franquicia-X-Men_columna.jpg | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/noticias-cine/bryan-singer-resuelve-agujero-guion-franquicia-x-men/138127548-1-esl-ES/Bryan-Singer-resuelve-uno-de-los-mayores-agujeros-de-guion-de-la-franquicia-X-Men.jpg | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/media/imagenes/recursos/david/138049887-1-esl-ES/david_reference.jpg | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/media/imagenes/recursos/david/138049887-1-esl-ES/david.jpg -- 4283x2855 | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/cinefilia/fotomaton-a-andrea-duro/77425064-1-esl-ES/Fotomaton-a-Andrea-Duro_dos_elementos.jpg | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/cinefilia/fotomaton-a-andrea-duro/77425064-1-esl-ES/Fotomaton-a-Andrea-Duro.jpg | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/cinefilia/documentales-musicales-que-tienes-que-ver/85507133-3-esl-ES/Documentales-musicales-que-tienes-que-ver_inferior-seccion-mos.jpg | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/cinefilia/documentales-musicales-que-tienes-que-ver/85507133-3-esl-ES/Documentales-musicales-que-tienes-que-ver.jpg | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/cinefilia/ant-man-avispa-peliculas-personajes-reducidos-diminutos/138126801-1-esl-ES/Ant-Man-y-la-Avispa-y-otras-10-peliculas-con-protagonistas-reducidos_inferior-seccion-mos_portrait.jpg | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/cinefilia/ant-man-avispa-peliculas-personajes-reducidos-diminutos/138126801-1-esl-ES/Ant-Man-y-la-Avispa-y-otras-10-peliculas-con-protagonistas-reducidos.jpg | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/noticias-cine/michelle-pfeiffer-entrevista-ant-man-y-la-avispa/138123067-1-esl-ES/El-heroico-retorno-de-Michelle-Pfeiffer-Nunca-pense-a-mi-edad-volver-al-universo-de-los-superheroes_slideshow_principal.jpg | |
// http://www.fotogramas.es/var/ezflow_site/storage/images/noticias-cine/michelle-pfeiffer-entrevista-ant-man-y-la-avispa/138123067-1-esl-ES/El-heroico-retorno-de-Michelle-Pfeiffer-Nunca-pense-a-mi-edad-volver-al-universo-de-los-superheroes.jpg | |
domain_nowww === "fotogramas.es" || | |
// http://ellegirl.jp/var/assets/storage/images/article/f_c_daisy_ridley_17_1214/20160410/2386181-1-jpn-JP/MTV-2016_rect600_315.jpg | |
// http://img.ellegirl.jp/var/assets/storage/images/article/f_c_daisy_ridley_17_1214/20160410/2386181-1-jpn-JP/MTV-2016.jpg | |
// http://img.ellegirl.jp/var/assets/storage/images/article/f_c_daisy_ridley_17_1214/20160410/2386181-1-jpn-JP/MTV-2016_rect490.jpg | |
// http://img.ellegirl.jp/var/assets/storage/images/article/f_c_daisy_ridley_17_1214/20160410/2386181-1-jpn-JP/MTV-2016.jpg | |
// http://img.ellegirl.jp/var/assets/storage/images/article/c_jennifer_aniston_been_treated_worse_by_women_18_0803/2717464-1-jpn-JP/_1_square64.jpg | |
// http://img.ellegirl.jp/var/assets/storage/images/article/c_jennifer_aniston_been_treated_worse_by_women_18_0803/2717464-1-jpn-JP/_1.jpg | |
domain_nosub === "ellegirl.jp" || | |
// https://esquire.jp/var/mensclubjp/storage/images/fashion/news/jimmy-choo-dakota-fanning-170313-hns/03/910674-3-jpn-JP/03_rect480.jpg | |
// https://esquire.jp/var/mensclubjp/storage/images/fashion/news/jimmy-choo-dakota-fanning-170313-hns/03/910674-3-jpn-JP/03.jpg | |
domain_nosub === "esquire.jp" || | |
// http://img.25ans.jp/var/25ansjp/storage/images/news/fashion/2018-oscar-after-party-by-vanityfair-180306-hns/xcx/1397821-1-jpn-JP/XCX_image_630_x.jpg | |
// http://img.25ans.jp/var/25ansjp/storage/images/news/fashion/2018-oscar-after-party-by-vanityfair-180306-hns/xcx/1397821-1-jpn-JP/XCX.jpg | |
domain === "img.25ans.jp" || | |
// https://www.cosmopolitan.com.hk/var/cosmopolitanhk/storage/images/love/1547654e3981d65/154765314ff54c10933edc096fec3b76154765314fff4e8c9f9d0bdc6dc79fd6/1644822-1-chi-HK/154765314ff54c10933edc096fec3b76154765314fff4e8c9f9d0bdc6dc79fd6_img_750_h.png | |
// https://www.cosmopolitan.com.hk/var/cosmopolitanhk/storage/images/love/1547654e3981d65/154765314ff54c10933edc096fec3b76154765314fff4e8c9f9d0bdc6dc79fd6/1644822-1-chi-HK/154765314ff54c10933edc096fec3b76154765314fff4e8c9f9d0bdc6dc79fd6.png | |
domain_nowww === "cosmopolitan.com.hk" || | |
// https://www.elle.com.hk/var/ellehk/storage/images/fashion/style_insight/the-most-memorable-oscar-dresses-of-all-time/margot-robbie-2016/22000015-1-chi-HK/MARGOT-ROBBIE-2016_img_885_590.jpg | |
// https://www.elle.com.hk/var/ellehk/storage/images/fashion/style_insight/the-most-memorable-oscar-dresses-of-all-time/margot-robbie-2016/22000015-1-chi-HK/MARGOT-ROBBIE-2016.jpg | |
// https://www.elle.com.hk/var/ellehk/storage/images/fashion/celeb_style/billboard-music-awards-red-carpet-dresses-2019/node_1745454/29920879-1-chi-HK/Chantel-jeffries-attends-the-2019-billboard-music-awards-at-news-photo-1140612654-1556748941_img_885_590.jpg | |
// https://www.elle.com.hk/var/ellehk/storage/images/fashion/celeb_style/billboard-music-awards-red-carpet-dresses-2019/node_1745454/29920879-1-chi-HK/Chantel-jeffries-attends-the-2019-billboard-music-awards-at-news-photo-1140612654-1556748941.jpg | |
domain_nowww === "elle.com.hk" || | |
// http://m.vogue.de/var/vogue/storage/images/home/vogue/fashion-shows/kollektionen/fruehjahr-2017-hc/paris/alexandre-vauthier/runway/_arc0726/23291608-1-ger-DE/_arc0726_v540x910.jpg | |
// https://m.vogue.de/var/vogue/storage/images/home/vogue/fashion-shows/kollektionen/fruehjahr-2017-hc/paris/alexandre-vauthier/runway/_arc0726/23291608-1-ger-DE/_arc0726.jpg | |
domain_nosub === "vogue.de" || | |
// https://img1.telestar.fr/var/telestar/storage/images/2/9/0/290401/1732584-1/Calista-Flockhart-dans-la-serie-Ally-McBeal-en-1997_width1024.jpg | |
// https://img1.telestar.fr/var/telestar/storage/images/2/9/0/290401/1732584-1/Calista-Flockhart-dans-la-serie-Ally-McBeal-en-1997.jpg | |
(domain_nosub === "telestar.fr" && domain.match(/img[0-9]*\.telestar\.fr/)) || | |
// http://www.haz.de/var/storage/images/np/nachrichten/medien/uebersicht/lena-meyer-landrut-hat-in-der-schule-keinen-musikunterricht/5676757-1-ger-DE/Lena-Meyer-Landrut-hat-in-der-Schule-keinen-Musikunterricht_big_teaser_article.jpg | |
// http://www.haz.de/var/storage/images/np/nachrichten/medien/uebersicht/lena-meyer-landrut-hat-in-der-schule-keinen-musikunterricht/5676757-1-ger-DE/Lena-Meyer-Landrut-hat-in-der-Schule-keinen-Musikunterricht.jpg | |
domain_nowww === "haz.de" || | |
// https://www.connexionfrance.com/var/connexion/storage/images/media/images/notre-dame-light/564377-1-eng-GB/notre-dame-light_articleimage.jpg | |
// https://www.connexionfrance.com/var/connexion/storage/images/media/images/notre-dame-light/564377-1-eng-GB/notre-dame-light.jpg | |
domain_nowww === "connexionfrance.com" || | |
// http://www.novilist.hr/var/novilist/storage/images/znanost-i-tehnologija/znanost/znanstvenici-objasnili-enigmu-zelenih-ledenjaka-uskoro-cemo-otkriti-koliko-su-oni-vazni!/15766267-1-cro-HR/Znanstvenici-objasnili-enigmu-zelenih-ledenjaka-Uskoro-cemo-otkriti-koliko-su-oni-vazni!_ca_large.jpg -- upscaled? 518x291 | |
// http://www.novilist.hr/var/novilist/storage/images/znanost-i-tehnologija/znanost/znanstvenici-objasnili-enigmu-zelenih-ledenjaka-uskoro-cemo-otkriti-koliko-su-oni-vazni!/15766267-1-cro-HR/Znanstvenici-objasnili-enigmu-zelenih-ledenjaka-Uskoro-cemo-otkriti-koliko-su-oni-vazni!.jpg -- 299x168 | |
// http://www.novilist.hr/var/novilist/storage/images/_aliases/fb_friendly_img/znanost-i-tehnologija/znanost/znanstvenici-objasnili-enigmu-zelenih-ledenjaka-uskoro-cemo-otkriti-koliko-su-oni-vazni!/15766267-1-cro-HR/Znanstvenici-objasnili-enigmu-zelenih-ledenjaka-Uskoro-cemo-otkriti-koliko-su-oni-vazni!.jpg -- very upscaled | |
// http://www.novilist.hr/var/novilist/storage/images/znanost-i-tehnologija/znanost/znanstvenici-objasnili-enigmu-zelenih-ledenjaka-uskoro-cemo-otkriti-koliko-su-oni-vazni!/15766267-1-cro-HR/Znanstvenici-objasnili-enigmu-zelenih-ledenjaka-Uskoro-cemo-otkriti-koliko-su-oni-vazni!.jpg | |
domain_nowww === "novilist.hr" || | |
// http://www.ville-wasquehal.fr/var/ptic/storage/images/services-en-ligne/agenda/ant-man-et-la-guepe/406908-48-fre-FR/Ant-Man-et-la-guepe_zoom_colorbox.jpg | |
// http://www.ville-wasquehal.fr/var/ptic/storage/images/services-en-ligne/agenda/ant-man-et-la-guepe/406908-48-fre-FR/Ant-Man-et-la-guepe.jpg | |
domain_nowww === "ville-wasquehal.fr" || | |
// https://www.gq-magazin.de/var/gq/storage/images/media/images/artikelbilder/unterhaltung/aquaman-workout-quer/7121951-1-ger-DE/aquaman-workout-quer_article_landscape.jpg | |
// https://www.gq-magazin.de/var/gq/storage/images/media/images/artikelbilder/unterhaltung/aquaman-workout-quer/7121951-1-ger-DE/aquaman-workout-quer.jpg | |
domain_nowww === "gq-magazin.de" || | |
// http://www.esa.int/var/esa/storage/images/esa_multimedia/images/2019/07/edrs-c_being_fuelled/19645582-1-eng-GB/EDRS-C_being_fuelled_latestnews.jpg | |
// http://www.esa.int/var/esa/storage/images/esa_multimedia/images/2019/07/edrs-c_being_fuelled/19645582-1-eng-GB/EDRS-C_being_fuelled.jpg | |
domain_nowww === "esa.int" || | |
// http://www.quejadore.com/var/quejadore_fr/storage/images/culture/cine-tv-series-dvd/autour-d-un-verre-avec-solene-rigot-a-l-affiche-de-les-revoltes-cette-semaine-56359-15-07-2015/986942-1-fre-MASTER/Autour-d-un-verre-avec-Solene-Rigot-a-l-affiche-de-Les-revoltes-cette-semaine_carrousel_quejadore.jpg | |
// http://www.quejadore.com/var/quejadore_fr/storage/images/culture/cine-tv-series-dvd/autour-d-un-verre-avec-solene-rigot-a-l-affiche-de-les-revoltes-cette-semaine-56359-15-07-2015/986942-1-fre-MASTER/Autour-d-un-verre-avec-Solene-Rigot-a-l-affiche-de-Les-revoltes-cette-semaine.jpg | |
domain_nowww === "quejadore.com" || | |
// https://file1.grazia.fr/var/grazia/storage/images/media/images/galerie/2016-05-18-en-images.-la-folle-soiree-de-grisogno-a-cannes/barbara-palvin/13423851-2-fre-FR/Barbara-Palvin_width1024.jpg | |
// https://file1.grazia.fr/var/grazia/storage/images/media/images/galerie/2016-05-18-en-images.-la-folle-soiree-de-grisogno-a-cannes/barbara-palvin/13423851-2-fre-FR/Barbara-Palvin.jpg | |
(domain_nosub === "grazia.fr" && /^file[0-9]*\./.test(domain)) || | |
// https://www.esquirehk.com/var/esquirehk/storage/images/people/women_we_love/2015-girl-group-korea-hong-kong-japn-hottest/girl-s-day-yura/293873-1-chi-HK/Girl-s-Day-Yura_img_1032_688.jpg | |
// https://www.esquirehk.com/var/esquirehk/storage/images/people/women_we_love/2015-girl-group-korea-hong-kong-japn-hottest/girl-s-day-yura/293873-1-chi-HK/Girl-s-Day-Yura.jpg | |
domain_nosub === "esquirehk.com" || | |
// http://gfx.elle.ci/var/ezflow_site/storage/images/people-lifestyle/people/les-senegalais-refusent-de-recevoir-rihanna-dans-leur-pays/42914-1-eng-GB/Les-Senegalais-refusent-de-recevoir-Rihanna-dans-leur-Pays_article_north.jpg | |
// http://gfx.elle.ci/var/ezflow_site/storage/images/people-lifestyle/people/les-senegalais-refusent-de-recevoir-rihanna-dans-leur-pays/42914-1-eng-GB/Les-Senegalais-refusent-de-recevoir-Rihanna-dans-leur-Pays.jpg | |
domain === "gfx.elle.ci" || | |
// https://img3.closermag.fr/var/closermag/storage/images/bio-people/biographie-jose-garcia-112817/827937-1-fre-FR/Jose-Garcia_square500x500.jpg | |
// https://img3.closermag.fr/var/closermag/storage/images/bio-people/biographie-jose-garcia-112817/827937-1-fre-FR/Jose-Garcia.jpg | |
// https://img1.closermag.fr/var/closermag/storage/images/media/images-des-contenus/actu-people/people-anglo-saxons/20151129-selena/selena-gomez-pose-pour-in-style/4987068-1-fre-FR/Selena-Gomez-pose-pour-In-Style.png?v1/focus=0x0/cover=626x768 | |
// https://img1.closermag.fr/var/closermag/storage/images/media/images-des-contenus/actu-people/people-anglo-saxons/20151129-selena/selena-gomez-pose-pour-in-style/4987068-1-fre-FR/Selena-Gomez-pose-pour-In-Style.png | |
// https://file1.closermag.fr/var/closermag/storage/images/media/images-des-contenus/actu-people/people-anglo-saxons/20151129-selena/selena-gomez-pose-pour-in-style/4987068-1-fre-FR/Selena-Gomez-pose-pour-In-Style_exact1024x768_p.png | |
// https://file1.closermag.fr/var/closermag/storage/images/media/images-des-contenus/actu-people/people-anglo-saxons/20151129-selena/selena-gomez-pose-pour-in-style/4987068-1-fre-FR/Selena-Gomez-pose-pour-In-Style.png | |
(domain_nosub === "closermag.fr" && domain.match(/(?:img|file)[0-9]*\.closermag\.fr/))) { | |
// https://img3.grazia.fr/var/grazia/storage/images/article/cinema-solene-rigot-grande-petite-849768/13583494-1-fre-FR/Cinema-Solene-Rigot-grande-petite_exact1900x908_l.jpg | |
// https://img3.grazia.fr/var/grazia/storage/images/article/cinema-solene-rigot-grande-petite-849768/13583494-1-fre-FR/Cinema-Solene-Rigot-grande-petite.jpg | |
return src | |
.replace(/(:\/\/[^/]*\/var\/+(?:[^/]*\/+)?storage\/+images\/+.*\/[^/]+?)(?:_[a-z][^-/._]*(?:_[0-9]+){0,})?(\.[^/.?]*)(?:[?#].*)?$/, "$1$2") | |
.replace(/\/storage\/+images\/+_aliases\/+[^/]*\/+/, "/storage/images/"); | |
//return src.replace(/_(?:article|large|medium|photo_galleries|more_in_thumbnail|square[0-9]*|cover_image)(?:_[a-z_]*)?(\.[^/.]*)$/, "$1"); | |
//return src.replace(/_image_size_[0-9]+_x(?:_[0-9]+)?(\.[^/.]*)$/, "$1"); | |
//return src.replace(/_image_[0-9]+_x(\.[^/.]*)$/, "$1"); | |
//return src.replace(/_(?:columna|line|reference|dos_elementos|inferior-seccion-mos|portrait|slideshow|principal)(\.[^/.]*)$/, "$1"); | |
//return src.replace(/_(?:rect|square)[0-9]+(?:_[0-9]+)?(\.[^/.]*)$/, "$1"); | |
//return src.replace(/_img_[0-9]+_[a-z](\.[^/.]*)$/, "$1"); | |
//return src.replace(/_img_[0-9]+_[0-9]+(\.[^/.]*)$/, "$1"); | |
//return src.replace(/_v[0-9]*x[0-9]*\.([^/]*)$/, ".$1"); | |
//return src.replace(/_width[0-9]*(\.[^/.]*)$/, "$1"); | |
} | |
if ((domain_nosub === "purepeople.com" || | |
// http://static1.purepeople.com.br/articles/2/21/41/22/@/2458737-camila-queiroz-admitiu-que-nunca-consegu-950x0-3.jpg | |
// http://static1.purepeople.com.br/articles/2/21/41/22/@/2458737-camila-queiroz-admitiu-que-nunca-consegu-999999999x0-3.jpg | |
domain_nosub === "purepeople.com.br" || | |
// http://static1.purebreak.com/articles/8/59/23/8/@/208690-ciara-800x0-2.jpg | |
// http://static1.purebreak.com/articles/8/59/23/8/@/208690-ciara-0x0-2.jpg -- white padding? | |
domain_nosub === "purebreak.com" || | |
// http://static1.purebreak.com.br/articles/5/63/38/5/@/250333-fifth-harmony-releva-desejo-de-fazer-par-696x0-2.jpg | |
// http://static1.purebreak.com.br/articles/5/63/38/5/@/250333-fifth-harmony-releva-desejo-de-fazer-par-999999999x0-2.jpg | |
domain_nosub === "purebreak.com.br" || | |
// http://static1.get-the-look.ca/articles/7/11/03/7/@/35882-for-a-perfect-matte-complexion-like-barb-1000x0-2.jpg | |
// http://static1.get-the-look.ca/articles/7/11/03/7/@/35882-for-a-perfect-matte-complexion-like-barb-999999999x0-2.jpg | |
domain_nosub === "get-the-look.ca" || | |
// http://static1.hairstyle.com/articles/2/29/32/@/9632-barbara-palvin-s-slicked-back-updo-if-905x0-2.jpg | |
// http://static1.hairstyle.com/articles/2/29/32/@/9632-barbara-palvin-s-slicked-back-updo-if-999999999x0-2.jpg | |
domain_nosub === "hairstyle.com" || | |
// http://static1.puretrend.com/articles/5/13/91/15/@/1572135-ciara-joue-un-jeu-dangeureux-en-robe-950x0-2.jpg | |
// http://static1.puretrend.com/articles/5/13/91/15/@/1572135-ciara-joue-un-jeu-dangeureux-en-robe-999999999x0-2.jpg | |
domain_nosub === "puretrend.com") && | |
domain.match(/^static[0-9]*\./)) { | |
// http://static1.purepeople.com/articles/8/21/01/98/@/2822958-l-actrice-solene-rigot-pour-le-film-en-950x0-1.jpg | |
// http://static1.purepeople.com/articles/8/21/01/98/@/2822958-l-actrice-solene-rigot-pour-le-film-en-0x0-1.jpg | |
// http://static1.purepeople.com/articles/8/21/01/98/@/2822931-l-acteur-jose-garcia-pour-le-film-a-fon-114x114-1.jpg | |
// http://static1.purepeople.com/articles/8/21/01/98/@/2822931-l-acteur-jose-garcia-pour-le-film-a-fon-0x0-1.jpg | |
// http://static1.purepeople.com/articles/4/20/07/24/@/2631120-solene-rigot-photocall-de-la-soiree-de-opengraph_1200-1.jpg | |
// http://static1.purepeople.com/articles/4/20/07/24/@/2631120-solene-rigot-photocall-de-la-soiree-de-opengraph_99999999x0-1.jpg | |
// http://static1.purepeople.com/articles/4/20/07/24/@/2631120-solene-rigot-photocall-de-la-soiree-de-950x0-1.jpg | |
// http://static1.purepeople.com/articles/4/20/07/24/@/2631120-solene-rigot-photocall-de-la-soiree-de-999999999x0-1.jpg | |
//return src.replace(/-[0-9]+x[0-9]+(-[0-9]*)?(\.[^/.]*)$/, "-0x0$1$2"); | |
return src.replace(/([-_])[0-9]+(?:x[0-9]+)?(-[0-9]\.[^/.]*)/, "$1999999999x0$2"); | |
} | |
if (domain_nosub === "belezaextraordinaria.com.br" && domain.match(/^static[0-9]*\./)) { | |
// http://static1.belezaextraordinaria.com.br/articles/3/52/3/@/3604--article_versus-4.jpg | |
// http://static1.belezaextraordinaria.com.br/articles/3/52/3/@/3604--article_news-4.jpg | |
// http://static1.belezaextraordinaria.com.br/articles/2/23/29/2/@/237944-para-comecar-o-penteado-separe-uma-mech-article_thumb_medium-2.jpg | |
// http://static1.belezaextraordinaria.com.br/articles/2/23/29/2/@/237944-para-comecar-o-penteado-separe-uma-mech-article_news-2.jpg | |
// http://static1.belezaextraordinaria.com.br/articles/4/13/38/4/@/161764-o-efeito-ondulado-valoriza-o-corte-e-as-opengraph_1200-3.jpg | |
// http://static1.belezaextraordinaria.com.br/articles/4/13/38/4/@/161764-o-efeito-ondulado-valoriza-o-corte-e-as-article_news-3.jpg | |
// using 999999999x0 does work, but it adds black borders around the image | |
return src.replace(/([-_])(?:[0-9]+(?:x[0-9]+)?|(?:article|opengraph)_[^-/.]+)(-[0-9]\.[^/.]*)/, "$1article_news$2"); | |
} | |
if (domain === "medias.unifrance.org") { | |
// https://medias.unifrance.org/medias/143/107/27535/format_web/media.jpg | |
// https://medias.unifrance.org/medias/143/107/27535/format_page/jose-garcia.jpg | |
return src.replace("/format_web/", "/format_page/"); | |
} | |
if (domain_nosub === "lisimg.com" || | |
domain_nosub === "listal.com") { | |
// http://iv1.lisimg.com/image/10752485/628full-sol%C3%A8ne-rigot.jpg | |
// http://iv1.lisimg.com/image/10752485/0full-sol%C3%A8ne-rigot.jpg | |
// http://i5.lisimg.com/10752485/70.jpg | |
// http://i5.lisimg.com/10752485/0full.jpg | |
// http://lb1.lisimg.com/10752485/70.jpg | |
// http://lb1.lisimg.com/10752485/0full.jpg | |
// http://ilarge.lisimg.com/image/6915143/780full-sol%C3%A8ne-rigot.jpg | |
// http://ilarge.lisimg.com/image/6915143/0full.jpg | |
// http://iv1.lisimg.com/image/2916057/516full-rachel-riley.jpg | |
// http://ilarge.lisimg.com/image/2916057/0full.jpg | |
return src | |
.replace(/:\/\/[^\./]*\.lisimg\.com\//, "://ilarge.lisimg.com/") | |
.replace(/\/([^/]*)\.jpg$/, "/99999999999full.jpg"); | |
//.replace(/\/([^/]*)\.jpg$/, "/0full.jpg"); | |
} | |
if (domain_nosub === "lesinrocks.com") { | |
// https://www.lesinrocks.com/content/thumbs/uploads/2017/03/width-1120-height-612-srcset-1/solene-rigot-1.jpg - stretched | |
// https://www.lesinrocks.com/content/thumbs/uploads/2017/03/width-0-height-0-srcset-1/solene-rigot-1.jpg | |
// https://statics.lesinrocks.com/content/thumbs/uploads/2017/12/width-100-height-100/nerd-no-one-ever-really-dies-album-cover-release-date-1.jpg | |
// https://www.lesinrocks.com/content/thumbs/uploads/2017/12/width-0-height-0/nerd-no-one-ever-really-dies-album-cover-release-date-1.jpg | |
return src.replace(/\/width-[0-9]*-height-[0-9]*/, "/width-0-height-0"); | |
} | |
if (domain === "media.senscritique.com") { | |
// https://media.senscritique.com/media/000006647807/150_200/Solene_Rigot.png | |
// https://media.senscritique.com/media/000006647807/0_0/Solene_Rigot.png | |
// https://media.senscritique.com/media/000017848056/130/Ant_Man_et_la_Guepe.jpg | |
// https://media.senscritique.com/media/000017848056/0/Ant_Man_et_la_Guepe.jpg | |
// https://media.senscritique.com/media/000004655645/150x230/Sanja_Mikitisin.jpg | |
// https://media.senscritique.com/media/000004655645/0/Sanja_Mikitisin.jpg | |
// https://media.senscritique.com/media/000017420993/source_big/Ano_hi_mita_hana_no_namae_o_bokutachi_wa_mada_shiranai.jpg -- 666x1000 | |
// https://media.senscritique.com/media/000017420993/0/Ano_hi_mita_hana_no_namae_o_bokutachi_wa_mada_shiranai.jpg -- 666x1000 | |
return src.replace(/(\/media\/+[0-9]{8,}\/+)[0-9]+(?:[_x][0-9]+)?\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "$10/$2"); | |
//return src.replace(/\/[0-9]*_[0-9]*\/([^/]*)$/, "/0_0/$1"); | |
} | |
if (domain_nowww === "franceinter.fr" || | |
// https://cdn.radiofrance.fr/s3/cruiser-production/2017/01/10918994-f2f3-453e-952c-37dc27f8db33/maxnewsfrthree604614.jpg | |
// https://cdn.radiofrance.fr/s3/cruiser-production/2017/01/10918994-f2f3-453e-952c-37dc27f8db33/maxnewsfrthree604614.jpg | |
domain === "cdn.radiofrance.fr") { | |
// https://www.franceinter.fr/s3/cruiser-production/2017/03/e97f73a2-2cba-4d48-bdc4-e50392aad75a/640_orpheline.jpg | |
// https://www.franceinter.fr/s3/cruiser-production/2017/03/e97f73a2-2cba-4d48-bdc4-e50392aad75a/orpheline.jpg | |
return src.replace(/\/[0-9]+(?:x[0-9]+)?_([^/]*\.[^/.]+)(?:[?#].*)?$/, "/$1"); | |
} | |
if (domain === "1645110239.rsc.cdn77.org") { | |
// https://1645110239.rsc.cdn77.org/image/s300/q50/mm/befr/movies14119/posters/puppylove.0.jpg | |
// https://1645110239.rsc.cdn77.org/image/mm/befr/movies14119/posters/puppylove.jpg | |
// https://1645110239.rsc.cdn77.org/image/x1200x800/q80/mm/been/movies17158/posters/orpheline-1.jpg | |
// https://1645110239.rsc.cdn77.org/image/mm/been/movies17158/posters/orpheline-1.jpg | |
return src | |
.replace(/\/image\/[a-z][0-9]+\//, "/image/") // to be repeated | |
.replace(/\/image\/x[0-9]+x[0-9]+\//, "/image/") | |
.replace(/\/([^/.]*)\.[0-9]+(\.[^/.]*)$/, "/$1$2"); | |
} | |
if (domain_nowww === "diymag.com" && src.indexOf("/media/img") >= 0) { | |
// http://diymag.com/media/img/Artists/B/Beck/_1500x1000_crop_center-center_75/Beck-UpAllNightVideo.jpg | |
// http://diymag.com/media/img/Artists/B/Beck/Beck-UpAllNightVideo.jpg | |
return src.replace(/(\/media\/img\/.*\/)_[^/]*\/([^/]*)$/, "$1$2"); | |
} | |
if (false && domain === "1.fwcdn.pl") { | |
// http://1.fwcdn.pl/ph/73/52/737352/569269_1.2.jpg | |
// http://1.fwcdn.pl/ph/73/52/737352/569269_1.jpg | |
// http://1.fwcdn.pl/ph/73/52/737352/569269_1.1.jpg | |
// shrinks some: | |
// http://1.fwcdn.pl/an/np/875720/2018/15046_1.9.jpg -- 320x180 | |
// http://1.fwcdn.pl/an/np/875720/2018/15046_1.1.jpg -- 90x90 | |
return src.replace(/(\/[^/.]*)(?:\.[0-9]*)?(\.[^/.]*)$/, "$1.1$2"); | |
} | |
if (domain_nowww === "semainedelacritique.com" && src.indexOf("/ttimg-rsz") >= 0) { | |
// http://www.semainedelacritique.com/ttimg-rsz?src=/uploads/galleriemedia/ed9cf1c0cd7756b1e7e782f8bc2bc3d2.jpg&w=1200&h=800&q=100&zc=2&a=c | |
// http://www.semainedelacritique.com/uploads/galleriemedia/ed9cf1c0cd7756b1e7e782f8bc2bc3d2.jpg | |
newsrc = src.replace(/.*\/ttimg-rsz\?(?:.*&)?src=([^&]*).*/, "$1"); | |
if (newsrc !== src) | |
return urljoin(src, newsrc, true); | |
} | |
if (domain_nosub === "pmdstatic.net" && domain.match(/img\..*?pmdstatic\.net$/)) { | |
// https://gal.img.pmdstatic.net/fit/https.3A.2F.2Fphoto.2Egala.2Efr.2Fupload.2Fslideshow.2Fquels-parrains-pour-les-revelations-cesar-les-photos-de-la-soiree-chanel-au-petit-palais-27606.2Fsolene-rigot-chien-et-son-parrain-samuel-benchetrit-475504.2Ejpg/400x600/quality/65/solene-rigot-chien-et-son-parrain-samuel-benchetrit.jpg | |
// https://photo.gala.fr/upload/slideshow/quels-parrains-pour-les-revelations-cesar-les-photos-de-la-soiree-chanel-au-petit-palais-27606/solene-rigot-chien-et-son-parrain-samuel-benchetrit-475504.jpg | |
// http://gal.img.pmdstatic.net/fit/https.3A.2F.2Fi.2Eimgur.2Ecom.2FQK42KsW.2Ejpg/400x600/quality/65/test.jpg | |
// https://i.imgur.com/QK42KsW.jpg | |
// http://img.tra.pmdstatic.net/fit/http.3A.2F.2Fwww.2Efoodreporter.2Efr.2Fupload.2Foriginal.2F5.2Fc.2Fz.2F8.2Fu.2F1258707.2Ejpg/312x240/quality/100/picture.jpg | |
return decodeURIComponent(src.replace(/.*?\.pmdstatic\.net\/fit\/([^/]*).*/, "$1").replace(/\./g, "%")); | |
} | |
if (domain === "photo.gala.fr") { | |
// gives content-length of 0 | |
// https://photo.gala.fr/upload/slideshow/quels-parrains-pour-les-revelations-cesar-les-photos-de-la-soiree-chanel-au-petit-palais-27606/solene-rigot-chien-et-son-parrain-samuel-benchetrit-475504.jpg | |
return { | |
url: src, | |
head_wrong_contentlength: true | |
}; | |
} | |
if (domain === "cdn.cnn.com" || | |
(domain_nosub === "turner.com" && domain.match(/(?:i[0-9]*\.)?cdn\.turner\.com/))) { | |
// https://cdn.cnn.com/cnnnext/dam/assets/170301101237-emma-watson-selfies-exlarge-169.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/170301101237-emma-watson-selfies.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/171226214729-carl-bernstein-12-26-super-169.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/171226214729-carl-bernstein-12-26.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/170220104445-mark-turner-volvo-ocean-race-super-169.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/170220104445-mark-turner-volvo-ocean-race.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/170303101934-emma-watson---premiere-full-169.jpg (definitely not full) | |
// https://cdn.cnn.com/cnnnext/dam/assets/170303101934-emma-watson---premiere.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/170307035422-emma-watson-on-kimmel-02-large-169.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/170307035422-emma-watson-on-kimmel-02.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/180209072938-33-winter-olympics-opening-ceremony-0209-overlay-tease.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/180209072938-33-winter-olympics-opening-ceremony-0209.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/180209112927-10-winter-olympics-opening-ceremony-0209-large-tease.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/180209112927-10-winter-olympics-opening-ceremony-0209.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/180208122950-palestinian-deportee-6-large-alt-11.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/180208122950-palestinian-deportee-6.jpg | |
// http://i2.cdn.turner.com/cnn/dam/assets/130318122753-emma-watson-january-2013-story-top.jpg | |
// http://i2.cdn.turner.com/cnn/dam/assets/130318122753-emma-watson-january-2013.jpg | |
// http://cdn.cnn.com/cnnnext/dam/assets/170428012205-28-met-gala-kurkova.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/180405060923-plastic-bags-edinburgh-beach-file-restricted-exlarge-169.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/180405060923-plastic-bags-edinburgh-beach-file-restricted.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/141027170602-victoria-beckham-fashion-horizontal-large-gallery.jpg | |
// https://cdn.cnn.com/cnnnext/dam/assets/141027170602-victoria-beckham-fashion.jpg | |
// doesn't work: | |
// http://cdn.cnn.com/cnnnext/dam/assets/140630134917-12-canada-most-beautiful-places-super-169.jpg | |
// http://cdn.cnn.com/cnnnext/dam/assets/140630134917-12-canada-most-beautiful-places-large-169.jpg | |
// http://cdn.cnn.com/cnnnext/dam/assets/140630134917-12-canada-most-beautiful-places-exlarge-169.jpg | |
// http://cdn.cnn.com/cnnnext/dam/assets/140630134917-12-canada-most-beautiful-places-full-169.jpg | |
//return src.replace(/-(?:small|medium|large|exlarge|super|full|overlay)-[0-9]*(\.[^/.]*)$/, "$1"); | |
return { | |
url: src.replace(/-(?:small|medium|large|exlarge|super|full|overlay|alt|tease|story-top|horizontal)(?:-(?:small|medium|large|exlarge|super|full|overlay|alt|tease))?(?:-(?:[0-9]+|gallery))?(\.[^/.]*)$/, "$1"), | |
can_head: false | |
}; | |
//return src.replace(/-[a-z]*-(?:169|tease)(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "ugc.kn3.net"/* && | |
src.indexOf("/i/origin/") >= 0*/) { | |
// https://ugc.kn3.net/i/origin/http://media3.popsugar-assets.com/files/2013/09/16/795/n/1922564/b962955383f6b80f_1592163256t6a65.xxxlarge_2x/i/Emma-Watson-all-legs-sexy-Peter-Pilotto-cutout-minidress.jpg | |
// https://ugc.kn3.net/i/760x/https://butacadavidciana.files.wordpress.com/2015/01/hatefuleightposter.jpg | |
// https://ugc.kn3.net/i/c_960x720/http://damimage.com/upload/big/2017/04/13/58eee7857d1f5.png | |
// http://damimage.com/upload/big/2017/04/13/58eee7857d1f5.png | |
//return src.replace(/.*?\/i\/origin\//, ""); | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/i\/(?:c_)?[0-9a-z]+\//, ""); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "media.shoko.fr" || | |
// https://media.fan2.fr/article-2548712-ajust_1020-f205148/dove-cameron-devoile-un-trailer-du-nouveau.jpg | |
// https://media.fan2.fr/article-2548712-redim-f205148/dove-cameron-devoile-un-trailer-du-nouveau.jpg | |
domain === "media.fan2.fr" || | |
// https://media.melty.it/article-2883254-so-f1/media.jpg | |
// https://media.melty.it/article-2883254-redim-f1/media.jpg | |
domain === "media.melty.it" || | |
// https://media.virginradio.fr/article-3917679-ratio265_400-f5/media.jpg | |
// https://media.virginradio.fr/article-3917679-redim-f5/media.jpg | |
// different image: | |
// https://www.virginradio.fr/selena-gomez-et-demi-lovato-s-eclatent-avec-les-muppets-dans-un-teaser-a615462.html -- header is nonexistent | |
// https://media.virginradio.fr/article-3545974-thumb-f8/selena-gomez-et-demi-lovato-s-apos-eclatent.jpg | |
// https://media.virginradio.fr/article-3545974-redim-f8/selena-gomez-et-demi-lovato-s-apos-eclatent.jpg -- different image! | |
domain === "media.virginradio.fr" || | |
// https://media.melty.mx/article-2260674-ajust_930-f1424195409/selena-gomez-en-v-magazine-marzo-2015.jpg -- upscaled | |
// https://media.melty.mx/article-2260674-redim-f1424195409/selena-gomez-en-v-magazine-marzo-2015.jpg | |
domain === "media.melty.mx" || | |
// https://media.melty.fr/article-3657708-thumb-f8/quantico-saison-3-priyanka-chopra-alex-tease.jpg | |
// https://media.melty.fr/article-3658090-head-f4/rihanna-anniversaire-pornhub-film-porno-pornographie.jpg | |
// https://media.melty.fr/article-3658090-full/booba-veut-arreter-sa-carriere-fergie-en.jpg | |
// https://media.melty.fr/article-923024-head/meltylife-meryl-melty-fr-redactrice-travaille.jpg | |
domain === "media.melty.fr") { | |
// https://media.shoko.fr/article-3410081-ajust_1000-f1483450645/emma-watson-en-2013-a-l-avant-premiere-de.jpg | |
// https://media.shoko.fr/article-3410093-ratio_100-f1483451011/emma-watson-en-1998-une-star-est-nee.jpg | |
// https://media.shoko.fr/media_aggregate-3410071-ajust_700-f1483450315/emma-watson-2014-look-red-carpet-harry-potter.jpg | |
// https://media.shoko.fr/article-3410071-redim-f1483450315/emma-watson-en-2014-aux-brit-fashion-awards.jpg | |
// https://media.shoko.fr/article-1234470-head/emma-watson-peoples-choice-awards-2013.jpg | |
// https://media.shoko.fr/emma-watson-harry-potter-et-les-reliques-image-393422-article-head.jpg | |
// different: | |
// https://media.melty.fr/article-3657733-thumb-f8/julia-les-marseillais-australia-celibataire.jpg | |
// https://media.melty.fr/article-3657733-redim-f8/julia-les-marseillais-australia-celibataire.jpg | |
// others: | |
// https://media.melty.fr/article-3835215-so/media.jpg -- 2283x3110 | |
// https://media.melty.fr/article-3835215-redim/media.jpg -- 2283x3110 | |
return src | |
.replace(/(:\/\/[^/]*)\/([^/]*?)-[^-/]*((?:-f[^/]*)?\.[^/.]*)$/, "$1/$2-redim$3") | |
.replace(/(:\/\/[^/]*)\/([^/-]*?-[0-9]*-)[^/-]*(-f[^/]*)?\//, "$1/$2redim$3/"); | |
} | |
if (domain_nosub === "vogue.fr" || | |
// http://www.glamourparis.com/uploads/images/thumbs/201637/48/rodarte_jpg_8718_north_458x687_white.jpg | |
domain_nowww === "glamourparis.com" || | |
// http://www.gqmagazine.fr/uploads/images/thumbs/201803/b7/_vui0653_jpg_9983_north_640x960_transparent.jpg | |
// http://www.gqmagazine.fr/uploads/images/201803/b7/_vui0653_jpg_9983.jpg | |
domain_nowww === "gqmagazine.fr") { | |
// https://en.vogue.fr/uploads/images/thumbs/201804/a0/tee_1841.jpeg_north_499x_white.jpg | |
// https://en.vogue.fr/uploads/images/201804/a0/tee_1841.jpeg | |
// https://en.vogue.fr/uploads/images/thumbs/201725/26/emma_watson__jpg_3972_jpeg_2620.jpeg_north_499x_white.jpg | |
// https://en.vogue.fr/uploads/images/201725/26/emma_watson__jpg_3972_jpeg_2620.jpeg | |
// https://en.vogue.fr/uploads/images/thumbs/201725/55/emma_watson_miu_miu_the_circle_premiere_21_06_2017_paris_jpg_8082_jpeg_7667.jpeg_north_499x_white.jpg | |
// https://en.vogue.fr/uploads/images/201725/55/emma_watson_miu_miu_the_circle_premiere_21_06_2017_paris_jpg_8082_jpeg_7667.jpeg | |
// | |
// https://en.vogue.fr/uploads/images/thumbs/201712/d2/gettyimages_647393804_jpg_9242_north_499x_white.jpg | |
// https://en.vogue.fr/uploads/images/201712/d2/gettyimages_647393804_jpg_9242.jpg | |
// https://en.vogue.fr/uploads/images/thumbs/201712/a4/emma_watson_in_givenchy_hc_par_rt_jpg_340_north_499x_white.jpg | |
// https://en.vogue.fr/uploads/images/201712/a4/emma_watson_in_givenchy_hc_par_rt_jpg_340.jpg | |
src = src.replace(/\/images\/+thumbs\//, "/images/"); | |
newsrc = src.replace(/(\.[^/._]*)_[^/]*$/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
return src.replace(/_north_[0-9]*x(?:[0-9]+)?_(?:white|transparent)(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "img.culturacolectiva.com") { | |
// https://img.culturacolectiva.com/featured/2017/10/bdfd42e4-138b-4037-8b56-8c309a3dc385-high.jpg | |
// https://img.culturacolectiva.com/featured/2018/01/24/1516840709928/le-moine-le-moine-the-monk-13-07-2011-1-g_a_l-medium.jpg | |
newsrc = src.replace(/-(?:high|medium|low)(\.[^/.]*)$/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if ((domain_nosub === "reveliststatic.com" || | |
// http://cdn-ugc.cafemom.com/gen/min/200/200/85/2010/10/06/01/9n/1n/pobz17xl441b0sg.jpg?imageId=19848772 | |
// http://cdn-ugc.cafemom.com/gen/full/2010/10/06/01/9n/1n/pobz17xl441b0sg.jpg?imageId=19848772 | |
domain_nosub === "cafemom.com" || | |
// https://ugc-01.cafemomstatic.com/gen/resize/256/386/80/2012/02/16/10/ci/6g/pofsu3tdkw.jpg | |
// https://ugc-01.cafemomstatic.com/gen/full/2012/02/16/10/ci/6g/pofsu3tdkw.jpg | |
// https://ugc-01.cafemomstatic.com/gen/crop/9999/9999/0/2018/02/01/11/4g/tr/po8puaj0cg72.png | |
// https://ugc-01.cafemomstatic.com/gen/full/2018/02/01/11/4g/tr/po8puaj0cg72.png | |
// http://ugc-01.cafemomstatic.com/gen/crop/9999/9999/0/2018/01/25/11/44/8r/ph1gxpvbeo2qbwe.jpg -- stretched | |
// http://ugc-01.cafemomstatic.com/gen/full/2018/01/25/11/44/8r/ph1gxpvbeo2qbwe.jpg | |
// https://static-01.cafemomstatic.com/images/stir_2014/special/celebrate-dad/celebrate_dad_activities_header.jpg | |
domain_nosub === "cafemomstatic.com") && | |
domain.match(/^(?:cdn-)?ugc(?:-[0-9]*)?\./)) { | |
// http://ugc.reveliststatic.com/gen/constrain/800/800/80/2017/05/09/10/6x/ix/phdkya0kkk2qbwe.jpg | |
// http://ugc.reveliststatic.com/gen/full/2017/05/09/10/6x/ix/phdkya0kkk2qbwe.jpg | |
//return src.replace(/\/gen\/crop\/[0-9]*\/[0-9]*\/[0-9]*\//, "/gen/crop/9999/9999/0/"); | |
//return src.replace(/\/gen\/crop\/[0-9]+\/[0-9]+\/[0-9]+\//, "/gen/full/"); | |
return src.replace(/\/gen\/(?:constrain|crop|resize|min)\/[0-9]*\/[0-9]*\/[0-9]*\//, "/gen/full/"); | |
} | |
if (domain === "images.shazam.com") { | |
// https://images.shazam.com/coverart/t113448093-b320004845_s400.jpg | |
// https://images.shazam.com/coverart/t113448093-b320004845_s0.jpg | |
return src.replace(/_s[0-9]+(\.[^/.]*)$/, "_s0$1"); | |
} | |
if (domain_nosub === "ebayimg.com") { | |
// https://i.ebayimg.com/images/g/2lIAAOSwsS1Zkh1k/s-l300.jpg | |
// https://i.ebayimg.com/images/g/2lIAAOSwsS1Zkh1k/s-l9999.jpg | |
// https://ssli.ebayimg.com/images/g/nqQAAOSwh2RZ6b1q/s-l500.jpg | |
// https://ssli.ebayimg.com/images/g/nqQAAOSwh2RZ6b1q/s-l9999.jpg | |
// http://i.ebayimg.com/images/i/121630247122-0-1/s-l1000.jpg -- 9999 doesn't work | |
// http://i.ebayimg.com/images/i/262923537353-0-1/s-l1000.jpg -- 9999 | |
// https://i.ebayimg.com/images/g/6OoAAOSw3gJZHI1d/s-l1000.jpg | |
// https://i.ebayimg.com/thumbs/images/g/2FMAAOSw4A5Y0l-Z/s-l200.jpg | |
// https://i.ebayimg.com/images/g/2FMAAOSw4A5Y0l-Z/s-l9999.jpg | |
// http://i.ebayimg.com/t/Trashy-Red-Riding-Hood-Gingham-Cute-Dress-Up-Halloween-Sexy-Teen-Adult-Costume-/00/s/MzUwWDM1MA==/z/be8AAMXQxVZRCdlO/$T2eC16VHJHgE9n0yFji(BRCdlO!Zpg~~60_35.JPG | |
// http://i.ebayimg.com/00/s/MzUwWDM1MA==/z/be8AAMXQxVZRCdlO/$T2eC16VHJHgE9n0yFji(BRCdlO!Zpg~~60_35.JPG | |
// http://i.ebayimg.com/images/g/be8AAMXQxVZRCdlO/s-l9999.jpg | |
newsrc = src.replace(/\/t\/.*?(\/[0-9]+\/s\/)/, "$1"); | |
if (newsrc !== src) { | |
return newsrc; | |
} | |
// http://i.ebayimg.com/00/s/NjAwWDQ1MA==/z/mEAAAOSwKIpWBa25/$_23.JPG | |
// http://i.ebayimg.com/images/g/mEAAAOSwKIpWBa25/s-l9999.jpg | |
// doesn't work for all: | |
// https://i.ebayimg.com/00/s/MTAyNVg4Mjc=/$(KGrHqR,!rYE-VkK4Bl!BQHN8IC(F!~~60_35.JPG?set_id=880000500F | |
newsrc = src.replace(/\/[0-9]+\/[a-z]+\/[^/]*\/[a-z]+\/([^/]+)\/[^/.]*(\.[^/.]*)$/, "/images/g/$1/s-l9999$2"); | |
if (newsrc !== src) { | |
newsrc = newsrc.replace(/(.*\.)[^/.]*$/, "$1") + newsrc.replace(/.*\.([^/.]*)$/, "$1").toLowerCase(); | |
return newsrc; | |
} | |
newsrc = src | |
.replace(/\/thumbs\/images\//, "/images/") | |
.replace(/-l[0-9]+(\.[^/.]*)$/, "-l9999$1"); | |
if (newsrc !== src) | |
return newsrc; | |
return { | |
url: src, | |
can_head: false, // fixme: does it hang here too? | |
bad_if: [{ | |
headers: { | |
"x-ebay-c-extension": "responsecode=404,responsemessage=Not Found" | |
} | |
}] | |
}; | |
} | |
if ((domain_nosub === "ebaystatic.com" && domain.match(/thumbs[0-9]*\.ebaystatic\.com/)) || | |
// https://securethumbs.ebay.com/d/l140/m/mk1ADy4oa1rnraV-rOti0YQ.jpg | |
// https://ssli.ebayimg.com/images/m/mk1ADy4oa1rnraV-rOti0YQ/s-l9999.jpg | |
domain === "securethumbs.ebay.com") { | |
// https://thumbs2.ebaystatic.com/m/mKuDpR7Z1yrk82zzlihfOCw/140.jpg | |
// https://ssli.ebayimg.com/images/m/mKuDpR7Z1yrk82zzlihfOCw/s-l9999.jpg | |
// https://thumbs2.ebaystatic.com/d/l225/m/mjVOwmkHHi8X0sPdlQhUV7Q.jpg | |
// https://ssli.ebayimg.com/images/m/mjVOwmkHHi8X0sPdlQhUV7Q/s-l9999.jpg | |
// https://thumbs.ebaystatic.com/d/l225/pict/400793189705_4.jpg | |
// https://i.ebayimg.com/images/g/X20AAOSwgN9bTFxs/s-l9999.jpg | |
// https://thumbs.ebaystatic.com/d/l9999/pict/400793189705_4.jpg | |
// http://thumbs4.ebaystatic.com/pict/1723764064234040_2.jpg | |
// for 404: x-ebay-c-extension: responsecode=404,responsemessage=Not Found | |
newsrc = src | |
.replace(/^[a-z]*:\/\/[^/]*\/(.*?)\/[0-9]+(\.[^/.]*)$/, "https://ssli.ebayimg.com/images/$1/s-l9999$2") | |
.replace(/^[a-z]*:\/\/[^/]*\/d\/l[0-9]+\/([a-z]\/[^/]*)(\.[^/.]*)$/, "https://ssli.ebayimg.com/images/$1/s-l9999$2"); | |
if (newsrc !== src) { | |
return newsrc; | |
} | |
newsrc = src.replace(/\/d\/[a-z][0-9]+\/pict\//, "/d/l9999/pict/"); | |
if (newsrc !== src) { | |
return newsrc; | |
} | |
return { | |
url: src, | |
can_head: false, // it just hangs | |
bad_if: [{ | |
headers: { | |
"x-ebay-c-extension": "responsecode=404,responsemessage=Not Found" | |
} | |
}] | |
}; | |
} | |
if (domain_nowww === "picclickimg.com") { | |
// https://www.picclickimg.com/d/l400/pict/232427221641_/Dove-Cameron-Delicate-8x10-Photo-Picture-Celebrity-Print.jpg | |
// https://thumbs.ebaystatic.com/d/l400/pict/232427221641_/Dove-Cameron-Delicate-8x10-Photo-Picture-Celebrity-Print.jpg | |
// https://www.picclickimg.com/d/l9999/pict/232427221641_/Dove-Cameron-Delicate-8x10-Photo-Picture-Celebrity-Print.jpg | |
// https://thumbs.ebaystatic.com/d/l9999/pict/232427221641_/Dove-Cameron-Delicate-8x10-Photo-Picture-Celebrity-Print.jpg | |
// https://www.picclickimg.com/00/s/ODAwWDgwMA==/z/qYUAAOSwzqFY-smJ/$/Overwatch-Swimsuit-OW-Game-D-Va-Swimwear-Cosplay-_1.jpg | |
// https://i.ebayimg.com/00/s/ODAwWDgwMA==/z/qYUAAOSwzqFY-smJ/$/Overwatch-Swimsuit-OW-Game-D-Va-Swimwear-Cosplay-_1.jpg | |
return src | |
.replace(/:\/\/www.picclickimg.com\/d\//, "://thumbs.ebaystatic.com/d/") | |
.replace(/:\/\/www.picclickimg.com(\/[0-9]+\/s\/)/, "://i.ebayimg.com$1"); | |
} | |
if (domain_nowww === "ezcorporateembroidery.com") { | |
// http://www.ezcorporateembroidery.com/images/scale/l200/pict/323407082997_1.jpg | |
// http://thumbs4.ebaystatic.com/d/l200/pict/323407082997_1.jpg | |
// https://securethumbs.ebay.com/d/l200/pict/323407082997_1.jpg | |
// https://securethumbs.ebay.com/d/l9999/pict/323407082997_1.jpg | |
// http://www.ezcorporateembroidery.com/packs/imageslarge/http://www.ezcorporateembroidery.com/images/scale/l400/pict/323407082997_1.jpg | |
// http://www.ezcorporateembroidery.com/images/scale/l400/pict/323407082997_1.jpg | |
// https://securethumbs.ebay.com/d/l9999/pict/323407082997_1.jpg | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/packs\/images[a-z]+\/(https?:\/\/)/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
return src.replace(/^[a-z]+:\/\/[^/]*\/images\/scale\/([a-z][0-9]+\/)/, "https://securethumbs.ebay.com/d/$1"); | |
} | |
if (domain_nowww === "dealsanimg.com") { | |
// https://www.dealsanimg.com/d/l400/pict/302538448607_/selena-gomez-poster-6-4-sizes-you-choose-uk-seller-uk.jpg | |
// https://securethumbs.ebay.com/d/l9999/pict/302538448607_/selena-gomez-poster-6-4-sizes-you-choose-uk-seller-uk.jpg | |
return src.replace(/^[a-z]+:\/\/[^/]*\/+d\//, "https://securethumbs.ebay.com/d/"); | |
} | |
if (domain === "i.slkimg.com") { | |
// https://i.slkimg.com/isv1/album/v5d0aa81654166d6a/3248641/web/3/fill/5,0/600.jpg | |
// https://i.slkimg.com/isv1/album/v5d0aa81654166d6a/3248641/web/3/999999999.jpg | |
return src | |
.replace(/\/fill\/[0-9]+,[0-9]+\//, "/") | |
.replace(/[0-9]+(\.[^/.]*)$/, "999999999$1"); | |
} | |
if (domain === "i.vimeocdn.com" && src.indexOf("/filter/overlay") >= 0) { | |
// https://i.vimeocdn.com/filter/overlay?src0=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F504371620_1280x720.jpg&src1=https%3A%2F%2Ff.vimeocdn.com%2Fimages_v6%2Fshare%2Fplay_icon_overlay.png | |
// https://i.vimeocdn.com/video/504371620_1280x720.jpg | |
return decodeURIComponent(src.replace(/.*\/overlay\?.*?src0=([^&]*).*/, "$1")); | |
} | |
if (domain === "imagelab.nownews.com") { | |
// https://imagelab.nownews.com/?w=300&q=70&src=https://rssimg.nownews.com/images/5a6f132bda68fc5330825347_201801292027.jpg | |
// https://rssimg.nownews.com/images/5a6f132bda68fc5330825347_201801292027.jpg | |
// https://imagelab.nownews.com/?w=300&q=70&src=https%3A%2F%2Fimg.nownews.com%2Fnownews_production%2Fimages%2F5a6f3bb53d666a52fa4894d8_201801292320.png | |
// https://img.nownews.com/nownews_production/images/5a6f3bb53d666a52fa4894d8_201801292320.png | |
return decodeURIComponent(src.replace(/.*[/?&]src=(.*)$/, "$1")); | |
} | |
if (domain === "cdn.discordapp.com") { | |
// https://cdn.discordapp.com/avatars/191394916771823617/a_0cc6551148c73504703e5c4dba44bc0a.png?size=128 | |
// https://cdn.discordapp.com/avatars/191394916771823617/a_0cc6551148c73504703e5c4dba44bc0a.png?size=2048 | |
return src.replace(/\?size=[0-9]*$/, "?size=4096"); | |
} | |
if (domain_nosub === "discordapp.net" && domain.match(/images-ext-[0-9]*\.discordapp\.net/)) { | |
// https://images-ext-1.discordapp.net/external/2rLDB8F8wm8zJBuYqxmLrM31K-VuJavo6cBLu62McoY/%3Fsize%3D1024/https/cdn.discordapp.com/avatars/378382650597179392/10a9986e76557e24e53f8da2a573e6d1.webp?width=80&height=80 | |
// https://cdn.discordapp.com/avatars/378382650597179392/10a9986e76557e24e53f8da2a573e6d1.webp?size=1024 | |
// https://images-ext-1.discordapp.net/external/Yu5JBnNXOrtdA4di9Pom8R5u-FXQVuHwUQVNA5VE6TQ/https/instagram.ftxl1-1.fna.fbcdn.net/vp/43a40cdb127e4b2731e0d73056813310/5B049080/t51.2885-15/e35/26293979_199841880752391_9218323895503814656_n.jpg?width=240&height=300 | |
// https://instagram.ftxl1-1.fna.fbcdn.net/vp/43a40cdb127e4b2731e0d73056813310/5B049080/t51.2885-15/e35/26293979_199841880752391_9218323895503814656_n.jpg | |
return decodeURIComponent(src.replace(/.*\/external\/[^/]*\/(?:([^/]*)\/)?(https?)\/(.*?)(?:\?[^/]*)?$/, "$2://$3$1")); | |
} | |
if (domain_nowww === "hot-korea.net") { | |
// https://hot-korea.net/uploads/gallery/thumbs/1238.jpg | |
// https://hot-korea.net/uploads/gallery/1238.jpg | |
return src.replace(/\/uploads\/+([^/]*\/+)thumbs\//, "/uploads/$1"); | |
} | |
if (domain_nosub === "sndcdn.com" && domain.match(/i[0-9]*\.sndcdn\.com/)) { | |
// https://i1.sndcdn.com/avatars-000300362115-78ogrs-t500x500.jpg | |
// https://i1.sndcdn.com/avatars-000300362115-78ogrs-original.jpg | |
return src.replace(/-[^-/.]*(\.[^/.]*)$/, "-original$1"); | |
} | |
if (domain === "media.licdn.com") { | |
// https://media.licdn.com/mpr/mpr/shrinknp_200_200/AAEAAQAAAAAAAAIsAAAAJDI3NTdjMDNhLWM3ZWMtNGQzZS04MGE1LWJjMzlkNWIzNDlhNw.jpg | |
// https://media.licdn.com/mpr/mpr/AAEAAQAAAAAAAAIsAAAAJDI3NTdjMDNhLWM3ZWMtNGQzZS04MGE1LWJjMzlkNWIzNDlhNw.jpg | |
return src.replace(/\/shrinknp_[0-9]+_[0-9]+\//, "/"); | |
} | |
if ((domain_nosub === "townnews.com" && domain.match(/bloximages\..*vip\.townnews\.com/)) || | |
// https://s3-ap-southeast-2.amazonaws.com/syd.cdn.coreweb.com.au/136/1734561-our-neighbourhood-650x360.jpg | |
// http://syd.cdn.coreweb.com.au/136/1734561-our-neighbourhood-650x360.jpg | |
amazon_container === "syd.cdn.coreweb.com.au") { | |
// https://bloximages.chicago2.vip.townnews.com/tucson.com/content/tncms/assets/v3/editorial/9/e1/9e16bd10-2343-5819-a7c7-89a7d520c38e/5a653cb109be0.image.jpg?resize=750%2C1067 | |
// https://bloximages.newyork1.vip.townnews.com/roanoke.com/content/tncms/assets/v3/editorial/5/fd/5fd9841d-3b33-5f9a-b8e7-efb5a1730a65/5408aee812bf4.image.jpg | |
// https://bloximages.newyork1.vip.townnews.com/heraldmailmedia.com/content/tncms/assets/v3/editorial/1/9a/19a45cfe-354a-11e3-939d-001a4bcf6878/5800f2836b369.image.jpg?resize=1200%2C675 | |
return src.replace(/^(.*?:\/\/)[^/]*\//, "http://"); | |
} | |
if (domain_nosub === "psbin.com" && domain.match(/cdn[^.]*\.psbin\.com/)) { | |
// http://cdnak1.psbin.com/img/mw=160/mh=210/cr=n/d=choz0/0gdge8mcb86p3dfk.jpg | |
// http://cdnak1.psbin.com/img/0gdge8mcb86p3dfk.jpg | |
return { | |
url: src.replace(/\/img\/[^/]*=[^/]*\//, "/img/"), // repeated | |
head_wrong_contentlength: true | |
}; | |
} | |
if (domain === "wac.450f.edgecastcdn.net") { | |
// http://wac.450f.edgecastcdn.net/80450F/k99.com/files/2013/01/JohnnyCarson_Facebook-630x477.jpg | |
// http://wac.450f.edgecastcdn.net/80450F/banana1015.com/files/2013/04/Daryl-Salad-ft.jpg?w=600&h=0&zc=1&s=0&a=t&q=89 | |
// http://wac.450f.edgecastcdn.net/80450F/thefw.com/files/2012/06/Jimmy-Kimmel-Hooks-Kids-Up-to-Fake-Lie-Detector1.jpg | |
// http://wac.450f.edgecastcdn.net/80450F/wokq.com/files/2015/11/12011246_10153099160181766_6355448705489009380_n.jpg | |
// http://wac.450f.edgecastcdn.net/80450F/mix106radio.com/files/2017/05/RS8710_177369626.jpg?w=630&h=420&zc=1&s=0&a=t&q=89 | |
return src.replace(/^(.*?:\/\/)[^/]*\/80450F\/(.*?)$/, "http://$2"); | |
} | |
if (domain === "gp1.wac.edgecastcdn.net") { | |
// https://gp1.wac.edgecastcdn.net/802892/http_public_production/musicians/images/458607/original/resize:248x186/crop:x0y8w740h554/hash:1467386813/1425323540_10201484920743713_511360204_n.jpg?1467386813 | |
// https://gp1.wac.edgecastcdn.net/802892/http_public_production/musicians/images/458607/original/1425323540_10201484920743713_511360204_n.jpg?1467386813 | |
return src.replace(/(\/images\/[0-9]*\/[^/]*\/)[^/]*:[^/]*\//, "$1"); // repeated | |
} | |
if (domain === "www.century21.com") { | |
// https://www.century21.com/c21/photo/320x240/c21.azureedge.net/1103i96/6m7cc0c7t2ke40abf3a2tgy386i96 | |
// http://c21.azureedge.net/1103i96/6m7cc0c7t2ke40abf3a2tgy386i96 | |
// https://www.century21.com/c21/photo/maxxmax/c21.azureedge.net/1i103/rk8yf7dx6g8z4na3er4jc4m9b1i103 | |
// http://c21.azureedge.net/1i103/rk8yf7dx6g8z4na3er4jc4m9b1i103 | |
return src.replace(/.*?\/photo\/[0-9a-z]*x[0-9a-z]*\//, "http://"); | |
} | |
if (domain === "cdn.instructables.com") { | |
// https://cdn.instructables.com/FK3/KJ6O/J1WW1VNZ/FK3KJ6OJ1WW1VNZ.RECTANGLE1.jpg | |
// https://cdn.instructables.com/ORIG/FK3/KJ6O/J1WW1VNZ/FK3KJ6OJ1WW1VNZ.jpg | |
return src.replace(/(:\/\/[^/]*\/)(.*)\.[^/.]*(\.[^/.]*)$/, "$1ORIG/$2$3"); | |
} | |
if (domain_nosub === "pressreader.com" && domain.match(/cdn[0-9]*-img\.pressreader\.com/)) { | |
// https://cdn2-img.pressreader.com/pressdisplay/docserver/getimage.aspx?regionKey=nsDHuRjfHcgbdqHuZt9cKQ%3D%3D&scale=100 | |
// https://cdn2-img.pressreader.com/pressdisplay/docserver/getimage.aspx?regionKey=nsDHuRjfHcgbdqHuZt9cKQ%3D%3D | |
return src.replace(/getimage\.aspx[^/]*[?&](regionKey=[^&]*).*$/, "getimage.aspx?$1"); | |
} | |
if (domain_nowww === "layfielddesign.com") { | |
// http://layfielddesign.com/assets/uploads/project_images/_fullSize/harpers-bazaar-statistics.jpg | |
// http://layfielddesign.com/assets/uploads/project_images/harpers-bazaar-statistics.jpg | |
return src.replace(/\/uploads\/+([^/]*)\/+_[^/]*\//, "/uploads/$1/"); | |
} | |
if (googlestorage_container === "mediaslide-europe") { | |
// https://mediaslide-europe.storage.googleapis.com/uno/pictures/423/24823/large-1489494252-0801f3a26891df01462bae3da66cf8e7.jpg | |
// https://mediaslide-europe.storage.googleapis.com/uno/pictures/423/24823/1489494252-0801f3a26891df01462bae3da66cf8e7.jpg | |
return src.replace(/\/[a-z]*-([^/]*)$/, "/$1"); | |
} | |
if (domain_nosub === "netinfo.bg" && domain.match(/m[^.]*\.netinfo\.bg/)) { | |
// https://www.vesti.bg/galerii/foto/zvezdite-s-dve-razlichni-obuvki-na-cherveniia-kilim-4877/32735277 | |
// | |
// https://mm.netinfo.bg/resize/resize_on_the_fly.php?address=media/images/32735/32735277/r-1024-768-obuvki-cherven-kilim-znamenitosti.jpg | |
// https://mm.netinfo.bg/resize/resize_on_the_fly.php?address=media/images/32735/32735277/orig-orig-obuvki-cherven-kilim-znamenitosti.jpg | |
// https://m5.netinfo.bg/media/images/32735/32735277/r-1024-768-obuvki-cherven-kilim-znamenitosti.jpg | |
// https://m5.netinfo.bg/media/images/32735/32735277/r-976-734-obuvki-cherven-kilim-znamenitosti.jpg | |
// https://m5.netinfo.bg/media/images/32735/32735277/80-49-obuvki-cherven-kilim-znamenitosti.jpg | |
// https://mm.netinfo.bg/resize/resize_on_the_fly.php?address=media/images/32713/32713259/orig-orig-emili-ratajkovski.jpg | |
// https://mm.netinfo.bg/resize/resize_on_the_fly.php?address=media/images/32735/32735277/orig-orig-obuvki-cherven-kilim-znamenitosti.jpg | |
// | |
// https://m.netinfo.bg/media/images/32735/32735274/80-49-obuvki-cherven-kilim-znamenitosti.jpg | |
return src.replace(/([/=]media\/images\/[0-9]*\/[0-9]*\/)(?:r-)?[^-/.]*-[^-/.]*/, "$1orig-orig"); | |
} | |
if (domain === "i.imgur.com") { | |
// https://i.imgur.com/ajsLfCab.jpg | |
// https://i.imgur.com/ajsLfCam.jpg | |
// https://i.imgur.com/ajsLfCal.jpg | |
// https://i.imgur.com/ajsLfCa_d.jpg?maxwidth=520&shape=thumb&fidelity=high | |
// https://i.imgur.com/ajsLfCa.jpg | |
// https://i.imgur.com/ajsLfCa.mp4 | |
// https://i.imgur.com/2t5WVj6.jpg | |
// https://35photo.pro/photos_main/465/2325482.jpg | |
// ?fb, ?fbplay both scale down the image too | |
// h, r, l, g, m, t, b, s | |
if (src.match(/\/removed\.[a-zA-Z]+(?:[?#].*)?$/)) | |
return { | |
url: src, | |
bad: true | |
}; | |
var baseobj = { | |
url: src.replace(/\?.*/, ""), | |
headers: { | |
Referer: null | |
}, | |
referer_ok: { | |
same_domain_nosub: true | |
} | |
}; | |
var idregex = /^[a-z]+:\/\/[^/]+\/+([a-zA-Z0-9]{7})\./; | |
newsrc = src.replace(/\/([a-zA-Z0-9]{7})(?:[hrlgmtbs]|_d)(\.[^/.?]*)$/, "/$1$2"); | |
if (newsrc !== src) { | |
baseobj.url = newsrc; | |
match = newsrc.match(idregex); | |
if (match) { | |
baseobj.extra = {page: "https://imgur.com/" + match[1]}; | |
} | |
return baseobj; | |
} | |
match = src.match(idregex); | |
var idhash; | |
if (match) { | |
idhash = match[1]; | |
baseobj.extra = {page: "https://imgur.com/" + idhash}; | |
} | |
if (options && options.cb && options.do_request && baseobj.extra) { | |
var parse_imageinfo = function(baseobj, json) { | |
var retobj = []; | |
try { | |
if (json.description || json.title) { | |
baseobj.extra.caption = json.description || json.title; | |
} | |
var realfilename = null; | |
if (json.hash && json.ext) { | |
realfilename = json.hash + json.ext; | |
var obj = deepcopy(baseobj); | |
obj.url = "https://i.imgur.com/" + realfilename; | |
if (/^video\//.test(json.mimetype)) { | |
obj.video = true; | |
retobj.push(obj); | |
var obj = deepcopy(baseobj); | |
obj.url = "https://i.imgur.com/" + json.hash + ".jpg" | |
retobj.push(obj); | |
} else { | |
// Prefer video if possible | |
if (json.animated && json.prefer_video) { | |
var newobj = deepcopy(baseobj); | |
newobj.url = "https://i.imgur.com/" + json.hash + ".mp4"; | |
newobj.video = true; | |
retobj.push(newobj); | |
} | |
retobj.push(obj); | |
} | |
} | |
if (json.source && /^https?:\/\//.test(json.source)) { | |
if (!("rule_specific" in options) || !("imgur_source" in options.rule_specific) || options.rule_specific.imgur_source === true) { | |
var newobj = {url: json.source}; | |
retobj.unshift(newobj); | |
} | |
} | |
} catch (e) { | |
console_error(e); | |
console_log(match); | |
retobj = []; | |
} | |
return retobj; | |
}; | |
var imageinfo = api_cache.get("imgur_imageinfo:" + idhash); | |
if (imageinfo) { | |
var retobj = parse_imageinfo(baseobj, imageinfo); | |
if (retobj.length > 0) { | |
return retobj; | |
} | |
} | |
var nsfw_headers = undefined; | |
if (options.rule_specific && options.rule_specific.imgur_nsfw_headers) { | |
nsfw_headers = options.rule_specific.imgur_nsfw_headers; | |
} | |
common_functions.fetch_imgur_webpage(options.do_request, api_cache, nsfw_headers, baseobj.extra.page, function(data) { | |
if (!data) { | |
return options.cb(obj); | |
} | |
var retobj = []; | |
if (data.ogvideo) { | |
var obj = deepcopy(baseobj); | |
obj.url = data.ogvideo; | |
obj.video = true; | |
retobj.push(obj); | |
} | |
if (data.ogimage) { | |
var obj = deepcopy(baseobj); | |
obj.url = data.ogimage; | |
retobj.push(obj); | |
} | |
if (data.imageinfo) { | |
var newretobj = parse_imageinfo(baseobj, data.imageinfo); | |
if (newretobj.length > 0) { | |
retobj = newretobj; | |
} | |
return options.cb(retobj); | |
} else { | |
return options.cb(retobj); | |
} | |
}); | |
return { | |
waiting: true | |
}; | |
} | |
return baseobj; | |
} | |
if (domain === "imgur.dcard.tw" || | |
// https://i.wgirlz.us/iYezyBA.jpg | |
// https://i.imgur.com/iYezyBA.jpg | |
domain === "i.wgirlz.us") { | |
// https://imgur.dcard.tw/gyU7d4s.jpg | |
// https://i.imgur.com/gyU7d4s.jpg | |
return src.replace(/:\/\/[^/]*\//, "://i.imgur.com/"); | |
} | |
if (domain_nowww === "siamzone.com") { | |
// https://www.siamzone.com/board/imgur.php?R7wGOGq.jpg | |
// https://www.siamzone.com/board/imgur/R/R7wGOGq.jpg | |
// https://i.imgur.com/R7wGOGq.jpg | |
return src | |
.replace(/^[a-z]+:\/\/[^/]*\/board\/+(?:imgur\.php\?|imgur\/+.\/+)([^/]*)$/, "https://i.imgur.com/$1"); | |
} | |
if (domain_nowww === "vidble.com" || | |
// https://i.vidble.com//FLJ23AtOz0_sqr.jpg | |
// https://i.vidble.com//FLJ23AtOz0.jpg | |
domain === "i.vidble.com") { | |
// https://www.vidble.com/ZNOTKNmw6y_sqr.jpg | |
// https://www.vidble.com/ZNOTKNmw6y.jpg | |
return src.replace(/_[^/._]*(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "itpro.nikkeibp.co.jp") { | |
// http://itpro.nikkeibp.co.jp/pc/article/interview/20130319/1083744/thumb_420_ph2_px420.jpg | |
// http://itpro.nikkeibp.co.jp/pc/article/interview/20130319/1083744/ph2_px420.jpg | |
return src.replace(/\/thumb_[0-9]+_([^/]*)$/, "/$1"); | |
} | |
if (domain === "media-cdn.tripadvisor.com") { | |
// https://media-cdn.tripadvisor.com/media/photo-s/0e/8d/a4/5e/hogwarts-express.jpg | |
// https://media-cdn.tripadvisor.com/media/photo-s/0e/8d/a4/5e/hogwarts-express.jpg | |
// o, s, f, i, l, t | |
return src.replace(/\/media\/photo-[a-z]\//, "/media/photo-o/"); | |
} | |
if (domain_nowww === "traveller.com.au" || | |
// https://resources.stuff.co.nz/content/dam/images/1/3/q/g/e/a/image.related.StuffLandscapeSixteenByNine.620x349.1inizt.png/1492742323724.jpg | |
// https://resources.stuff.co.nz/content/dam/images/1/3/q/g/e/a/image. | |
domain === "resources.stuff.co.nz" || | |
// https://www.fairfaxstatic.com.au/content/dam/images/g/p/f/d/b/e/image.gallery.tallPortrait.400x600.gpfddu.png/1465447253403.jpg | |
// https://www.fairfaxstatic.com.au/content/dam/images/g/p/f/d/b/e/image. | |
domain_nowww === "fairfaxstatic.com.au" || | |
// https://www.smh.com.au/content/dam/images/g/r/0/l/p/v/image.gallery.landscape.620x413.gr2z10.png/1472359686893.jpg | |
// https://www.smh.com.au/content/dam/images/g/r/0/l/p/v/image. | |
domain_nowww === "smh.com.au" || | |
// http://www.dailylife.com.au/content/dam/images/2/x/v/6/k/image.related.articleLeadNarrow.300x0.2y0pa.png/1385226001000.jpg | |
// http://www.dailylife.com.au/content/dam/images/2/x/v/6/k/image. | |
domain_nowww === "dailylife.com.au" || | |
// http://www.essentialbaby.com.au/content/dam/images/4/6/9/8/d/image.gallery.articleLeadwide.620x349.23z5t.png | |
// http://www.essentialbaby.com.au/content/dam/images/4/6/9/8/d/image. | |
domain_nowww === "essentialbaby.com.au") { | |
// http://www.traveller.com.au/content/dam/images/3/5/o/g/5/image.related.articleLeadwide.620x349.gz1l7v.png/1508294036655.jpg | |
// http://www.traveller.com.au/content/dam/images/3/5/o/g/5/image.related.articleLeadwide.620x349.gz1l7v.png | |
// http://www.traveller.com.au/content/dam/images/3/5/o/g/5/image. | |
// http://www.traveller.com.au/content/dam/images/1/0/f/c/k/q/image. | |
//return src.replace(/(\/images\/[0-9a-z]\/[0-9a-z]\/[0-9a-z]\/[0-9a-z]\/[0-9a-z]\/image\.).*$/, "$1"); | |
return src.replace(/(\/images\/+(?:[0-9a-z]\/+){4,}image\.).*$/, "$1"); | |
} | |
if (domain_nowww === "getwallpapers.com" || | |
// http://hintergrundbild.org/wallpaper/small/f/5/3/71029-full-size-freundschaft-hintergrundbilder-1920x1080.jpg | |
// http://hintergrundbild.org/wallpaper/full/f/5/3/71029-full-size-freundschaft-hintergrundbilder-1920x1080.jpg | |
domain_nowww === "hintergrundbild.org" || | |
// https://wallpapertag.com/wallpaper/small/3/3/8/7792-anime-backgrounds-1920x1200-smartphone.jpg | |
// https://wallpapertag.com/wallpaper/full/3/3/8/7792-anime-backgrounds-1920x1200-smartphone.jpg | |
domain_nowww === "wallpapertag.com") { | |
// http://getwallpapers.com/wallpaper/small/4/b/a/573224.jpg | |
// http://getwallpapers.com/wallpaper/full/4/b/a/573224.jpg | |
return src.replace(/\/wallpaper\/+[^/]*\/+((?:[0-9a-f]\/+){3})/, "/wallpaper/full/$1"); | |
} | |
if (domain === "ideascdn.lego.com") { | |
// https://ideascdn.lego.com/community/projects/be9/7b9/163334/2794778-o_1b5ccku8lf9a1sep1r8of4to8j7-thumbnail-b5Us8BCO1UerJg.png | |
// https://ideascdn.lego.com/community/projects/be9/7b9/163334/2794778-o_1b5ccku8lf9a1sep1r8of4to8j7.png | |
// https://ideascdn.lego.com/community/projects/be9/7b9/163334/2794790-o_1b5ccmo8e53mofh1gnao2ag8ef-square-100.png | |
return src | |
.replace(/-thumbnail[^/.]*(\.[^/.]*)$/, "$1") | |
.replace(/-square[^/.]*(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "images.newindianexpress.com" || | |
// https://images.indulgexpress.com/uploads/user/imagelibrary/2019/4/12/w600X300/rihanna-barbados-ambassador.jpg | |
// https://images.indulgexpress.com/uploads/user/imagelibrary/2019/4/12/original/rihanna-barbados-ambassador.jpg | |
domain === "images.indulgexpress.com") { | |
// http://images.newindianexpress.com/uploads/user/imagelibrary/2018/2/2/w100X65/d5cd2a22045a49e1a1bfef3810b0144f.jpg | |
// http://images.newindianexpress.com/uploads/user/imagelibrary/2018/2/2/original/d5cd2a22045a49e1a1bfef3810b0144f.jpg | |
return src.replace(/\/[wh][0-9]+X[0-9]*\//, "/original/"); | |
} | |
if (false && domain === "image.spreadshirtmedia.com") { | |
// https://image.spreadshirtmedia.com/image-server/v1/designs/1001957174,width=178,height=178/harry-potter-hogwarts-express-coffee-mug.png | |
// https://image.spreadshirtmedia.com/image-server/v1/designs/1001957174/harry-potter-hogwarts-express-coffee-mug.png | |
// doesn't work: | |
// https://image.spreadshirtmedia.com/image-server/v1/mp/products/T812A2MPA1663PT17X49Y58D1014395106S29/views/1,width=1200,height=1200,appearanceId=2,backgroundColor=E8E8E8,modelId=115,crop=detail,version=1515071979/deathgrips-men-s-premium-t-shirt.webp - 1200x1200 | |
// https://image.spreadshirtmedia.com/image-server/v1/mp/products/T812A2MPA1663PT17X49Y58D1014395106S29/views/1/deathgrips-men-s-premium-t-shirt.webp -- 190x190, different image | |
// https://image.spreadshirtmedia.com/content/w_650/cms/cyo/seo/cheaptshirts/6_us_desktop.png | |
// https://image.spreadshirtmedia.com/content/cms/cyo/seo/cheaptshirts/6_us_desktop.png | |
return src | |
.replace(/\/content\/+w_[0-9]+\/+cms\/+/, "/content/cms/"); | |
//.replace(/(\/[0-9]*),(?:[^=/,]*=[^=/,]*,?){1,}(\/[^/]*$)/, "$1$2"); | |
} | |
if (domain_nosub === "blastingcdn.com" && domain.match(/staticr[0-9]*\.blastingcdn\.com/)) { | |
// http://staticr1.blastingcdn.com/media/photogallery/2017/10/14/660x290/b_586x276/a-family-was-rescued-by-the-harry-potter-hogwarts-express-in-the-scottish-highlands-image-credit-pixabaycc0_1631843.jpg | |
// http://static.blastingnews.com/media/photogallery/2017/10/14/main/a-family-was-rescued-by-the-harry-potter-hogwarts-express-in-the-scottish-highlands-image-credit-pixabaycc0_1631843.jpg | |
// https://staticr1.blastingcdn.com/media/listicle/2018/12/07/b_660xauto/3345b197-deb8-4f4c-8994-c68ae08e7e06.jpg | |
// https://staticr1.blastingcdn.com/media/listicle/2018/12/07/3345b197-deb8-4f4c-8994-c68ae08e7e06.jpg | |
//return src.replace(/(\/media\/+listicle\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2})[a-z]_[auto0-9]+x[auto0-9]+\/+/, "$1"); | |
return src | |
.replace(/\/b_[auto0-9]+x[auto0-9]+\/([^/]*)$/, "/$1") | |
.replace(/\/[0-9]+x[0-9]+\/([^/]*)$/, "/main/$1"); | |
} | |
if (domain_nowww === "gjdream.com") { | |
// http://www.gjdream.com/news/contents/UPFILE/2018/20180201485362_tmb.jpg | |
// http://www.gjdream.com/news/contents/UPFILE/2018/20180201485362.jpg | |
return src.replace(/_tmb(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "www.imaeil.com") { | |
// http://www.imaeil.com/m_wiz/imgsrc3.php?w=261&h=142&t=&rate=100&src=/news_img/event_plus/2018.02.02.14.04.38_mainphoto01_1.jpg | |
// http://www.imaeil.com//news_img/event_plus/2018.02.02.14.04.38_mainphoto01_1.jpg | |
return src.replace(/\/m_wiz\/imgsrc[0-9]\.php.*?[?&]src=([^&]*).*/, "/$1"); | |
} | |
if (domain === "www.kwnews.co.kr") { | |
// untested due to it requiring download | |
// http://www.kwnews.co.kr/kwnews_view.asp?kwurl=20180202-218020100137-3001.jpg | |
// http://www.kwnews.co.kr/newsphoto/2018/02/218020100137.jpg | |
return src.replace(/\/kwnews_view\.asp?.*?kwurl=([0-9]{4})([0-9]{2})[0-9]*-([0-9]*)-[0-9]*(\.[^/.]*)$/, "/newsphoto/$1/$2/$3$4"); | |
} | |
if (domain_nowww === "yeongnam.com" && | |
src.indexOf("/Photo/") >= 0) { | |
// http://www.yeongnam.com/Photo/2018/01/26/S20180126.99001151846332501.jpg | |
// http://www.yeongnam.com/Photo/2018/01/26/R20180126.99001151846332501.jpg | |
// R, L, M, S | |
return src.replace(/\/[A-Z]([^/]*)$/, "/R$1"); | |
} | |
// doesn't always work, due to .jpg/.jpeg | |
if (domain_nowww === "yeongnam.com" && | |
src.indexOf("/news/screennews/") >= 0) { | |
// http://www.yeongnam.com/news/screennews/159_20180329_L20180327_99001152405345001.jpg | |
// http://www.yeongnam.com/Photo/2018/03/27/R20180327.99001152405345001.jpeg | |
return src | |
.replace(/\/news\/screennews\/[0-9]+_[0-9]+_[A-Z]([0-9]{4})([0-9]{2})([0-9]{2})_([0-9]+)(\.[^/.]*)/, | |
"/Photo/$1/$2/$3/R$1$2$3.$4.jpeg"); | |
} | |
if (domain === "db.kookje.co.kr") { | |
// http://www.kookje.co.kr/news2011/asp/newsbody.asp?key=20180202.22001000306 | |
// http://db.kookje.co.kr/news2000/photo/2018/0202/L20180202.22001000306i1.jpg -- 600x403 | |
// http://db.kookje.co.kr/news2000/photo/2018/0202/20180202.22001000306i1.jpg -- 300x202 | |
// http://db.kookje.co.kr/news2000/photo/2012/0414/20120414.99002182507i1.jpg - 2568x1640 | |
// http://db.kookje.co.kr/news2000/photo/2012/0414/L20120414.99002182507i1.jpg ??? (website overloaded, try again later, also generic 404 page) | |
// http://db.kookje.co.kr/news2000/photo/2013/1003/20131003.99002193930i2.jpeg -- 1674x2718 | |
// http://db.kookje.co.kr/news2000/photo/2013/1003/L20131003.99002193930i2.jpeg -- 600x974 | |
// http://db.kookje.co.kr/news2000/photo/2016/0514/L20160514.33001222704i1.jpg -- 4738x2604 | |
// http://db.kookje.co.kr/news2000/photo/download/20190123.jpg | |
// http://db.kookje.co.kr/news2000/photo/download/20171121-1.jpg | |
// L, S | |
match = src.match(/\/[A-Z]?([0-9]{8}\.[0-9]+)i[0-9]+\.[^/.]*(?:[?#].*)?$/); | |
var extra = {}; | |
if (match) { | |
extra.page = "http://www.kookje.co.kr/news2011/asp/newsbody.asp?key=" + match[1]; | |
} | |
return { | |
url: src.replace(/\/[A-Z]([0-9]{8}\.[0-9]+i[0-9]+\.[^/.]*)(?:[?#].*)?$/, "/L$1"), | |
extra: extra | |
}; | |
} | |
if (domain_nowww === "kookje.co.kr") { | |
// http://www.kookje.co.kr/news2011/screennews/thumb/466_20180305_20180305.99099001307i1.jpg | |
// http://www.kookje.co.kr/news2011/screennews/466_20180305_20180305.99099001307i1.jpg | |
// http://db.kookje.co.kr/news2000/photo/2018/0305/20180305.99099001307i1.jpg | |
// http://db.kookje.co.kr/news2000/photo/2018/0305/L20180305.99099001307i1.jpg | |
// http://www.kookje.co.kr/news2011/screennews/466_20180305_20180305.99099001300i1.jpg | |
// http://db.kookje.co.kr/news2000/photo/2018/0305/20180305.99099001300i1.jpg | |
// http://db.kookje.co.kr/news2000/photo/2018/0305/L20180305.99099001300i1.jpg | |
// http://www.kookje.co.kr/news2011/screennews/thumb/466_20180305_20180211.99099004174i1.jpg | |
// http://db.kookje.co.kr/news2000/photo/2018/0211/20180211.99099004174i1.jpg | |
// http://db.kookje.co.kr/news2000/photo/2018/0211/L20180211.99099004174i1.jpg | |
return src | |
.replace("/thumb/", "/") | |
.replace(/.*\/[0-9]+_[0-9]+_([0-9]{4})([0-9]{4})([^/]*)$/, "http://db.kookje.co.kr/news2000/photo/$1/$2/L$1$2$3"); | |
} | |
if (domain_nowww === "joongdo.co.kr" || | |
// http://www.viva100.com/mnt/images/webdata/content/2020y/01m/17d/crop2020011701001363700060161.jpg | |
// http://www.viva100.com/mnt/images/file/2020y/01m/17d/2020011701001363700060161.jpg | |
domain_nowww === "viva100.com") { | |
// http://www.joongdo.co.kr/mnt/images/webdata/content/2018y/02m/01d/crop2018020101000198000004991.jpg | |
// http://www.joongdo.co.kr/mnt/images/file/2018y/02m/01d/2018020101000198000004991.jpg | |
return src.replace(/\/webdata\/+content\/+([0-9]{4}y\/+[0-9]{2}m\/+[0-9]{2}d\/+)crop([0-9]+\.[^/.]+)(?:[?#].*)?$/, "/file/$1$2"); | |
} | |
if (false && domain === "img.asiatoday.co.kr") { | |
// http://img.asiatoday.co.kr/webdata/content/2018y/02m/28d/20180228002024152_77_58.jpg | |
// http://img.asiatoday.co.kr/file/2018y/02m/28d/20180228002024152_1.jpg | |
// http://img.asiatoday.co.kr/webdata/content/2018y/03m/09d/20180309010004779_77_58.jpg | |
// http://img.asiatoday.co.kr/file/2018y/03m/09d/20180309010004779_1.jpg - doesn't work | |
// http://img.asiatoday.co.kr/file/2018y/03m/09d/2018030901000828800047791.jpg - works | |
// http://img.asiatoday.co.kr/webdata/content/2017y/03m/31d/20170331010021088_300_300.jpg | |
// http://img.asiatoday.co.kr/file/2017y/03m/31d/2017033101002937000210881.jpg | |
// http://img.asiatoday.co.kr/webdata/content/2018y/09m/12d/20180912010007252_300_300.jpg | |
// http://img.asiatoday.co.kr/file/2018y/09m/12d/201809120100072521.jpg -- doesn't work | |
// http://img.asiatoday.co.kr/file/2018y/09m/12d/2018091201000933500072521.jpg | |
regex = /\/webdata\/content\/(.*)_[0-9]+_[0-9]+(\.[^/.]*)$/; | |
return [ | |
src.replace(regex, "/file/$1_1$2"), | |
src.replace(regex, "/file/$11$2") | |
]; | |
} | |
if (false && domain === "img.asiatoday.co.kr") { | |
// http://img.asiatoday.co.kr/thum/thumbnail/2012y/04m/25d/thumb631124(0)-100120_98432.jpg | |
// http://img.asiatoday.co.kr/file/2012y/04m/25d/631124(0)-100120_98432.jpg -- doesn't work | |
// http://img.asiatoday.co.kr/file/2012y/04m/25d/631124(0)-480640_98432.jpg -- actual full image | |
return src.replace(/\/thum\/+thumbnail\/+([0-9]+y\/+[0-9]+m\/+[0-9]+d\/+)thumb/, "/file/$1"); | |
} | |
if (domain === "img.asiatoday.co.kr") { | |
// http://img.asiatoday.co.kr/file/2019y/06m/27d/20190627000744579_350.jpg | |
// http://img.asiatoday.co.kr/file/2019y/06m/27d/20190627000744579_1561589714_1.jpg?1561589714 | |
// http://www.asiatoday.co.kr/view.php?key=20190627000744579 | |
// http://img.asiatoday.co.kr/webdata/content/2019y/09m/10d/20190910010006235_77_58.jpg | |
// http://img.asiatoday.co.kr/file/2019y/09m/10d/2019091001001161400069161.jpg | |
// http://www.asiatoday.co.kr/view.php?key=20190910010006235 | |
match = src.match(/\/[0-9]{4}y\/+[0-9]{2}m\/+[0-9]{2}d\/+([0-9]{15,})_[0-9]+(?:_[0-9]+)?\./); | |
if (match) { | |
return { | |
url: src, | |
extra: { | |
page: "http://www.asiatoday.co.kr/view.php?key=" + match[1] | |
} | |
}; | |
} | |
} | |
if (domain === "jmagazine.joins.com" || | |
// http://www.urbanbug.net/uploads/gallery/photos/2083/thumb_31888-170-05-005.jpg | |
// http://www.urbanbug.net/uploads/gallery/photos/2083/31888-170-05-005.jpg | |
(domain === "www.urbanbug.net" && src.indexOf("/uploads/") >= 0) || | |
// https://shobiddak.com/uploads/picture/stuff/name/159476/thumb_maxresdefault.jpg | |
// https://shobiddak.com/uploads/picture/stuff/name/159476/maxresdefault.jpg | |
(domain_nowww === "shobiddak.com" && /\/uploads\/+picture\//.test(src)) || | |
// http://celebs-news.ru/images/persons/natalie-portman/1611/thumb_natalie_portman_32.jpg | |
// http://celebs-news.ru/images/persons/natalie-portman/1611/natalie_portman_32.jpg | |
(domain_nowww === "celebs-news.ru" && src.indexOf("/images/") >= 0)) { | |
// https://jmagazine.joins.com/_data/photo/2018/01/thumb_237268740_ZeJ4MpkI_1.jpg | |
return src.replace(/\/thumb_([^/]*)$/, "/$1"); | |
} | |
if (domain === "cdn.ppomppu.co.kr" || | |
// https://www.popco.net/zboard/data/sigma_forum/2018/04/25/thumb_53666d20e05f8691128b91b8456961a7.jpeg | |
// https://popco.net/zboard/data/sigma_forum/2018/04/25/53666d20e05f8691128b91b8456961a7.jpeg | |
domain_nowww === "popco.net") { | |
// https://cdn.ppomppu.co.kr/zboard/data3/2017/0619/m_20170619132334_ibiwqsfv.jpg | |
// https://cdn.ppomppu.co.kr/zboard/data3/2017/0619/20170619132334_ibiwqsfv.jpg | |
return src.replace(/(\/zboard\/+data[0-9]*\/+(?:[^/]*\/+)?[0-9]{4}\/+[0-9]{2}\/*[0-9]{2}\/+)(?:thumb|m)_/, "$1"); | |
} | |
if (domain === "media.codeweavers.com") { | |
// https://media.codeweavers.com/pub/crossover/website/appdb/thumb_7be7461d09f5dfd6c43f533ff8d1f62b.png | |
// https://media.codeweavers.com/pub/crossover/website/appdb/7be7461d09f5dfd6c43f533ff8d1f62b.png | |
return src.replace(/\/thumb_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "/$1"); | |
} | |
if (domain === "img.tvreport.co.kr" || | |
// http://img.tvreportcdn.de/images/20150612/20150612_1434098756_42297100_1.jpg?1434125364 | |
// other: | |
// https://img.tvreportcdn.de/cms-content/uploads/2019/08/23/312163f3-8749-409c-96b9-d6f4b519ff69.jpg | |
domain === "img.tvreportcdn.de") { | |
// http://img.tvreport.co.kr/images/20171017/20171017_1508207555_22483100_4.jpg?1512513157 | |
// http://img.tvreport.co.kr/images/20171017/20171017_1508207555_22483100_0.jpg?1512513157 | |
// http://img.tvreport.co.kr/images/20171211/20171211_1512955026_44177100_1.jpg (stretched) | |
// http://img.tvreport.co.kr/images/20171211/20171211_1512955026_44177100_0.jpg (smaller, but not stretched) | |
// http://img.tvreport.co.kr/images/20171203/20171203_1512266720_61938500_1.jpg | |
// http://img.tvreport.co.kr/images/20171203/20171203_1512266720_61938500_0.jpg (larger) | |
// 0 = original | |
// 1 = large | |
return src.replace(/_[0-9]*(\.[^/.]*)$/, "_0$1"); | |
} | |
if (domain === "ojsfile.ohmynews.com") { | |
// http://ojsfile.ohmynews.com/CT_T_IMG/2018/0131/IE002278988_APP.jpg?4957 | |
// http://ojsfile.ohmynews.com/PHT_IMG_FILE/2018/0131/IE002278988_PHT.jpg | |
// http://ojsfile.ohmynews.com/BIG_IMG_FILE/2018/0131/IE002278988_BIG.jpg | |
// http://ojsfile.ohmynews.com/ORG_IMG_FILE/2018/0131/IE002278988_ORG.jpg | |
// http://ojsfile.ohmynews.com/CT_T_IMG/2018/0201/IE002279450_APP.jpg?2034 | |
// http://ojsfile.ohmynews.com/PHT_IMG_FILE/2018/0201/IE002279450_PHT.jpg | |
// http://ojsfile.ohmynews.com/BIG_IMG_FILE/2018/0201/IE002279450_BIG.jpg | |
// http://ojsfile.ohmynews.com/ORG_IMG_FILE/2018/0201/IE002279450_ORG.jpg | |
// http://ojsfile.ohmynews.com/STD_IMG_FILE/2013/0705/IE001596678_STD.jpg | |
// http://ojsfile.ohmynews.com/ORG_IMG_FILE/2013/0705/IE001596678_ORG.jpg | |
// http://ojsfile.ohmynews.com/STD_IMG_FILE/2012/0714/IE001464177_STD.jpg -- 550x399 | |
// http://ojsfile.ohmynews.com/PHT_IMG_FILE/2012/0714/IE001464177_PHT.jpg -- 800x581 | |
// http://ojsfile.ohmynews.com/ORG_IMG_FILE/2012/0714/IE001464177_ORG.jpg -- 404 | |
// other: | |
// http://ojsfile.ohmynews.com/CRI_T_IMG/2019/0530/A0002541423_T.jpg -- 5225x3392 | |
newsrc = src.replace(/\/STD(_IMG_FILE\/+.*?)_STD(\.[^/.]*)(?:[?#].*)?$/, "/PHT$1_PHT$2"); | |
if (newsrc !== src) | |
return newsrc; | |
return src | |
.replace(/\/CT_T_IMG\/(.*?)\/([^/]*)_[A-Z]+(\.[^/.]*?)(?:\?.*)?$/, "/ORG_IMG_FILE/$1/$2_ORG$3") | |
.replace(/\/[A-Z]*_IMG_FILE\/(.*?)\/([^/]*)_[A-Z]*(\.[^/.]*)(?:\?.*)?$/, "/ORG_IMG_FILE/$1/$2_ORG$3"); | |
} | |
if (domain === "cmsimg.mnet.com" || | |
// thanks to Fray on greasyfork: https://greasyfork.org/en/forum/discussion/47633/x | |
// http://cmsimg.global.mnet.com/clipimage/artist/240/000/428/428228.jpg | |
// http://cmsimg.global.mnet.com/clipimage/artist/1024/000/428/428228.jpg | |
domain === "cmsimg.global.mnet.com") { | |
// wip | |
// http://cmsimg.mnet.com/clipimage/artist/240/000/428/428228.jpg | |
// http://cmsimg.mnet.com/clipimage/artist/Other/610/000/167/167134.jpg | |
// http://cmsimg.mnet.com/clipimage/artist/Other/1024/000/167/167134.jpg | |
// http://cmsimg.mnet.com/clipimage/artist/Other/000/167/167134.jpg -- 404 | |
// http://cmsimg.mnet.com/clipimage/vod/Other/000/058/58694.jpg | |
// http://cmsimg.mnet.com/clipimage/vod/Other/610/000/058/58694.jpg -- scaled down to 400x600 | |
// http://static.global.mnet.com/data/ucc/000/162/359 | |
// http://static.global.mnet.com/data/ucc/000/162/442 | |
// http://mnetimg.mnet.com/tvmnetimg/admin/poll/2014/10/1_1413538495789.jpg | |
// http://cmsimg.mwave.me/pgmVideo/contentImgUrl/201711/10/0b694d59-29d6-4d36-8470-0e2db3a32e8f.jpg | |
// https://cjmwave-prd.s3.ap-northeast-2.amazonaws.com/ion/front/editor/201801/10/e6d980fe-53c3-4604-bce7-08d98c7f2d99.jpg | |
// http://mnetimg.mnet.com/L_uimg/adupload/special/2017/08/22/1401090000.jpg | |
//return src.replace(/(\/clipimage\/[^/]*)\/[0-9]*\//, "$1/1024/"); | |
regex = /(\/clipimage\/.*?[^0-9]\/)[0-9]+\/([0-9]+\/[0-9]+\/[0-9]+\.[^/.]*)$/; | |
return [ | |
src.replace(regex, "$1$2"), | |
src.replace(regex, "$11024/$2") | |
]; | |
} | |
if (domain === "image.cloud.sbs.co.kr") { | |
// http://image.cloud.sbs.co.kr/smr/clip/201605/20/ihv2JuZcKz8ChXAsxFPPpC_320.jpg | |
// http://image.cloud.sbs.co.kr/smr/clip/201605/20/ihv2JuZcKz8ChXAsxFPPpC.jpg | |
return src.replace(/_[0-9]*(\.[^/.]*)$/, "$1"); | |
} | |
if (domain_nosub === "st-hatena.com" && | |
(domain.match(/cdn-ak-scissors\.[a-z]\.st-hatena\.com/) || | |
domain === "cdn.image.st-hatena.com")) { | |
// https://cdn-ak-scissors.b.st-hatena.com/image/scale/6b49da1455b11be153a6a5c060fbb6a65ada1cde/enlarge=0;height=480;type=max;version=1;width=480/https%3A%2F%2Fcdn.image.st-hatena.com%2Fimage%2Fscale%2F4220af82af99afcb2b70c52a3d4ee7a5cea0ba38%2Fbackend%3Dimager%3Benlarge%3D0%3Bheight%3D1000%3Bversion%3D1%3Bwidth%3D1200%2Fhttps%253A%252F%252Fcdn.user.blog.st-hatena.com%252Fdefault_entry_og_image%252F672828%252F1514219817468589 | |
// https://cdn.image.st-hatena.com/image/scale/4220af82af99afcb2b70c52a3d4ee7a5cea0ba38/backend=imager;enlarge=0;height=1000;version=1;width=1200/https%3A%2F%2Fcdn.user.blog.st-hatena.com%2Fdefault_entry_og_image%2F672828%2F1514219817468589 | |
// https://cdn.user.blog.st-hatena.com/default_entry_og_image/672828/1514219817468589 | |
// https://cdn-ak-scissors.b.st-hatena.com/image/square/2fc5e622ac7d1dc703f1059dcacff46f0afbb002/height=90;version=1;width=120/http://livedoor.blogimg.jp/milano/imgs/1/b/1b341774.jpg | |
newsrc = src.replace(/.*?\/image\/(?:scale|square)\/[^/]*\/[^/]*\/(.*)$/, "$1"); | |
if (newsrc !== src) | |
return decodeURIComponent(newsrc); | |
} | |
if (domain_nosub === "st-hatena.com" && domain.match(/cdn(?:-[a-z]+)\.[a-z]\.st-hatena\.com/)) { | |
// https://cdn-ak.f.st-hatena.com/images/fotolife/A/Amayadori-June/20180419/20180419183448_120.jpg | |
// https://cdn-ak.f.st-hatena.com/images/fotolife/A/Amayadori-June/20180419/20180419183448.jpg | |
// https://cdn-ak.f.st-hatena.com/images/fotolife/k/kara-hara_8825/20100909/20100909200143_m.jpg | |
// https://cdn-ak.f.st-hatena.com/images/fotolife/k/kara-hara_8825/20100909/20100909200143.jpg | |
return src.replace(/_(?:[0-9]+|m)(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "nimage.newsway.kr") { | |
// http://nimage.newsway.kr/phpwas/restmb_idxmake.php?idx=6&simg=20180116000099_0640.jpg | |
// http://nimage.newsway.kr/phpwas/restmb_idxmake.php?idx=200&simg=20180202000058_1024.jpg | |
// http://nimage.newsway.kr/phpwas/restmb_idxmake.php?idx=138&simg=%2Fphoto%2F2016%2F06%2F02%2F20160602000250_0640.jpg | |
// http://nimage.newsway.kr/photo/2016/06/02/20160602000250_0640.jpg | |
if (src.match(/[?&]simg=[%/]/)) { | |
return decodeURIComponent(src.replace(/\/phpwas\/restmb_idxmake\.php.*?simg=([^&]*).*?$/, "$1")); | |
} | |
//return src.replace(/\/phpwas\/restmb_idxmake\.php.*?simg=([0-9]{4})([0-9]{2})([0-9]{2})([^&]*).*?$/, "/photo/$1/$2/$3/$1$2$3$4"); | |
// http://nimage.newsway.kr/photo/2018/02/01/20180201000273_0480.jpg | |
// doesn't work for all: | |
// http://nimage.newsway.kr/photo/2016/08/26/20160826000014_0640.png | |
//return src.replace(/_[0-9]+(\.[^/.]*)$/, "_1024$1"); | |
} | |
if (domain === "imgsrv.piclick.me") { | |
// http://imgsrv.piclick.me/publish.php?pid=1319 | |
// https://imgsrv.piclick.me/cimg/1319.jpg | |
newsrc = src.replace(/\/publish\.php\?(?:.*&)?pid=([0-9]+)(?:[?#].*)?$/, "/cimg/$1.jpg"); | |
if (newsrc !== src) | |
return newsrc; | |
// http://imgsrv.piclick.me/cimg/163x220xN_477539.jpg | |
// https://imgsrv.piclick.me/cimg/N_477539.jpg | |
// https://imgsrv.piclick.me/cimg/477539.jpg -- same | |
newsrc = src.replace(/\/cimg\/+[0-9]+x[0-9]+x/, "/cimg/"); | |
if (newsrc !== src) | |
return newsrc; | |
// https://imgsrv.piclick.me/cimg/N_477539.jpg | |
// https://imgsrv.piclick.me/cimg/477539.jpg | |
newsrc = src.replace(/\/cimg\/+N_/, "/cimg/"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nowww === "slate.com") { | |
// http://www.slate.com/content/dam/slate/blogs/browbeat/2017/12/01/how_pixar_made_coco_the_biggest_box_office_hit_in_mexico_s_history/cocorgb_c041_41a_pubpub16565.jpg.CROP.promo-xlarge2.jpg | |
// http://www.slate.com/content/dam/slate/blogs/browbeat/2017/12/01/how_pixar_made_coco_the_biggest_box_office_hit_in_mexico_s_history/cocorgb_c041_41a_pubpub16565.jpg | |
return src.replace(/(\/[^/.]*\.[^/.]*)\.[^/]*$/, "$1"); | |
} | |
if (domain === "img.cinemablend.com" || | |
// https://img.minq.com/filter:scale/slides/3/6/0/0/9/0/3600901349/29fc1d2cc8d2499990adfafcce8f922ac2e6df13.jpeg?mw=615 | |
// https://img.minq.com/slides/3/6/0/0/9/0/3600901349/29fc1d2cc8d2499990adfafcce8f922ac2e6df13.jpeg | |
domain === "img.minq.com") { | |
// https://img.cinemablend.com/filter:scale/quill/3/d/0/6/a/d/3d06addd736f79f9449400bed217e59f98ff86af.jpg?mw=600 | |
// https://img.cinemablend.com/quill/3/d/0/6/a/d/3d06addd736f79f9449400bed217e59f98ff86af.jpg | |
return src.replace(/(:\/\/[^/]*\/)filter:[^/]*\/(.*?)(?:\?[^/]*)?$/, "$1$2"); | |
} | |
if (((domain_nosub === "abcimg.es" && domain.match(/r[0-9]*\.abcimg\.es/)) || | |
// https://resizer.lasprovincias.es/resizer/resizer.php?imagen=http://www.lasprovincias.es/multimedia/201405/30/media/s18.jpg&nuevoalto=480 | |
// https://static.lasprovincias.es/multimedia/201405/30/media/s18.jpg | |
domain === "resizer.lasprovincias.es" || | |
// https://resizer.larioja.com/resizer/resizer.php?imagen=/deliverty/demo/resources/jpg/5/2/1281441365725.jpg&nuevoancho=950&nuevoalto=570©right=conCopyright&encrypt=false | |
// https://resizer.larioja.com/deliverty/demo/resources/jpg/5/2/1281441365725.jpg -- not found | |
// tried with main domain as well, no luck | |
//domain === "resizer.larioja.com" || | |
// https://resizer.elcorreo.com/resizer/resizer.php?imagen=http://www.elcorreo.com/multimedia/201408/30/media/06-modelos-halle-berry.jpg&nuevoalto=480 | |
// https://www.elcorreo.com/multimedia/201408/30/media/06-modelos-halle-berry.jpg | |
domain === "resizer.elcorreo.com") && | |
src.indexOf("/resizer.php") >= 0) { | |
// http://r1.abcimg.es/resizer/resizer.php?imagen=http%3A%2F%2Fwww.abc.es%2Fmedia%2Fsociedad%2F2018%2F02%2F01%2Freina-letizia-kYuH--420x236%40abc.jpg&nuevoancho=128&nuevoalto=73&crop=1&medio=abc | |
// http://www.abc.es/media/sociedad/2018/02/01/reina-letizia-kYuH--420x236@abc.jpg | |
// http://www.abc.es/media/sociedad/2018/02/01/reina-letizia-kgrH-U213052464546JvF-620x370@abc.jpg | |
return decodeURIComponent(src.replace(/.*\/resizer\.php.*?[?&]imagen=([^&]*).*$/, "$1")); | |
} | |
if (domain === "resizer.elnortedecastilla.es" || | |
// https://resizer.ideal.es/resizer/resizer.php?imagen=http://www.ideal.es/multimedia/201505/18/media/sel/s7.jpg&nuevoalto=480 | |
// https://www.ideal.es/multimedia/201505/18/media/sel/s7.jpg | |
domain === "resizer.ideal.es" || | |
// https://resizer.nortecastilla.es/resizer/resizer.php?imagen=/deliverty/demo/resources/jpg/1/3/1295942905031.jpg&nuevoancho=950&nuevoalto=570©right=conCopyright&encrypt=false | |
// https://foto-cache.elnortedecastilla.es/jpg/1/3/1295942905031.jpg | |
domain === "resizer.nortecastilla.es") { | |
// https://resizer.elnortedecastilla.es/resizer/resizer.php?imagen=/deliverty/demo/resources/jpg/1/3/1295942905031.jpg&nuevoancho=950&nuevoalto=570©right=conCopyright&encrypt=false | |
// https://resizer.elnortedecastilla.es/resizer/resizer.php?imagen=/deliverty/demo/resources/jpg/1/3/1295942905031.jpg -- 1182x1809 | |
// https://foto-cache.elnortedecastilla.es/jpg/1/3/1295942905031.jpg -- 1182x1809 | |
if (false) { | |
return { | |
url: src.replace(/\/+resizer\.php.*?[?&](imagen=[^&]*).*/, "/resizer.php?$1"), | |
head_wrong_contentlength: true | |
}; | |
} else { | |
return src | |
.replace(/:\/\/[^/]*\/+resizer\/+resizer\.php.*?[?&]imagen=\/+deliverty\/+[^/]*\/resources\/+([^&]*).*/, "://foto-cache.elnortedecastilla.es/$1") | |
.replace(/^[a-z]+:\/\/[^/]*\/+resizer\/+resizer\.php.*?[?&]imagen=(http[^&]*).*/, "$1"); | |
} | |
} | |
if (domain === "vz.cnwimg.com") { | |
// https://vz.cnwimg.com/thumbc-300x300/wp-content/uploads/2012/03/coco.jpg | |
// https://vz.cnwimg.com/thumb-300x170/wp-content/uploads/2018/01/GettyImages-127497645.jpg | |
return src.replace(/\/thumb[a-z]*-[0-9]+x[0-9]+\//, "/"); | |
} | |
if (domain_nowww === "coleman-rayner.com" && | |
src.indexOf("/watermark/insertwm.php?") >= 0) { | |
// http://www.coleman-rayner.com/watermark/insertwm.php?src=http%3A%2F%2Fwww.coleman-rayner.com%2Fwp-content%2Fuploads%2F2014%2F09%2F05.-INSIDE-COCO%E2%80%99S-LAS-VEGAS-WARDROBE-1000.jpg | |
return { | |
can_head: false, | |
url: decodeURIComponent(src.replace(/.*\/watermark\/insertwm\.php.*?[?&]src=([^&]*).*$/, "$1")) | |
}; | |
} | |
if (domain === "media.guestofaguest.com") { | |
// http://media.guestofaguest.com/t_card_medium/wp-content/uploads/wppa/Coco_Austin6.jpg | |
// http://media.guestofaguest.com/wp-content/uploads/wppa/Coco_Austin6.jpg | |
// http://media.guestofaguest.com/t_card_medium/gofg-media/2016/05/1/46413/533596622.jpg | |
// http://media.guestofaguest.com/gofg-media/2016/05/1/46413/533596622.jpg | |
return src.replace(/(:\/\/[^/]*\/)[^/]*\/(wp-content|gofg-media)\//, "$1$2/"); | |
} | |
if (domain_nosub === "heartyhosting.com" && | |
domain.match(/i[0-9]*\.heartyhosting\.com/)) { | |
// https://i0.heartyhosting.com/starmagazine.com/wp-content/uploads/2016/01/ice-t-coco-austin-baby-chanel-body-anniversary-dress-05.jpg | |
return src.replace(/.*?:\/\/[^/]*\//, "http://"); | |
} | |
if (domain === "images.contactmusic.com") { | |
// http://images.contactmusic.com/newsimages/wenn2949343_1_14734_24-cm.jpg | |
// http://images.contactmusic.com/newsimages/wenn2949343_1_14734_24.jpg | |
// http://images.contactmusic.com/newsimages/wenn90807_1_16815_34-cm.jpg | |
// http://images.contactmusic.com/newsimages/wenn90807_1_16815_34.jpg -- 403 | |
newsrc = src.replace(/-cm(\.[^/.]*)$/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nowww === "contactmusic.com") { | |
// http://www.contactmusic.com/pics/mn/20180304/040318_oscarawards2018arrivals/oscar-awards-2018-arrivals_6016429.jpg -- watermark | |
// http://www.contactmusic.com/pics/sn/20180304/040318_oscarawards2018arrivals/oscar-awards-2018-arrivals_6016429.jpg -- no watermark | |
// http://www.contactmusic.com/pics/ln/20180304/040318_oscarawards2018arrivals/oscar-awards-2018-arrivals_6016429.jpg -- larger, watermark | |
// http://www.contactmusic.com/pics/sn/20130516/160513_cw_upfront_2/kristin-kreuk-2013-cw-upfront-presentation-_3667039.jpg -- no watermark | |
// http://www.contactmusic.com/pics/sa/kerrang_arrivals_210808/thirty_seconds_to_mars_with_jared_leto_5177350.jpg -- 110x139, no watermark | |
// http://www.contactmusic.com/pics/la/kerrang_arrivals_210808/thirty_seconds_to_mars_with_jared_leto_5177350.jpg -- 1747x2200, watermark | |
// http://www.contactmusic.com/images/feature-images/the-leftovers-s1-justin-theroux-636-380.jpg -- 3888x2592, no watermark | |
// http://www.contactmusic.com/pics/s/dwp_pizza_sculptures_071107/a_sculpture_of_pope_benedict_xvi_1652401.jpg -- 110x160, no watermark | |
// http://www.contactmusic.com/pics/l/dwp_pizza_sculptures_071107/a_sculpture_of_pope_benedict_xvi_1652401.jpg -- 2058x3000, watermark | |
var retarray = []; | |
newsrc = src.replace(/\/pics\/[a-z]([a-z]?\/)/,"/pics/s$1"); | |
if (newsrc !== src) | |
retarray.push({ | |
url: newsrc, | |
problems: { | |
smaller: true | |
} | |
}); | |
newsrc = src.replace(/\/pics\/[a-z]([a-z]?\/)/,"/pics/l$1"); | |
if (newsrc !== src) | |
retarray.push({ | |
url: newsrc, | |
problems: { | |
watermark: true | |
} | |
}); | |
if (retarray.length > 0) | |
return retarray; | |
} | |
if (domain === "d15mj6e6qmt1na.cloudfront.net") { | |
// https://d15mj6e6qmt1na.cloudfront.net/i/19186419/600/c | |
// https://d15mj6e6qmt1na.cloudfront.net/i/19186419 | |
return src.replace(/(\/i\/[0-9]*)\/.*/, "$1"); | |
} | |
if ((domain_nosub === "bing.net" && domain.match(/tse[0-9]*\.(?:mm|explicit)\.bing\.net/)) || | |
domain_nosub === "bing.com") { | |
// http://tse4.mm.bing.net/th?id=OGC.aea12e4c5efc00f2b1e95e6cf2a165e1&pid=1.7&rurl=https%3A%2F%2Fthumbs.gfycat.com%2FYellowTornCockatiel-size_restricted.gif&ehk=YrV%2F46NR4yeQKcnktlbKNA | |
// https://thumbs.gfycat.com/YellowTornCockatiel-size_restricted.gif | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/th[^/]*[?&]rurl=([^&]*).*?$/, "$1"); | |
if (newsrc !== src) | |
return decodeURIComponent(newsrc); | |
// https://tse1.mm.bing.net/th?id=Ad9e81485410912702a018d5f48ec0f5c&w=136&h=183&c=8&rs=1&qlt=90&pid=3.1&rm=2 | |
// https://www.bing.com/th?id=OPN.RTNews_jJZmvGD6PzvUt22LbHHUUg&w=186&h=88&c=7&rs=2&qlt=80&cdv=1&pid=News | |
newsrc = src.replace(/(:\/\/[^/]*)\/th[^/]*[?&]id=([^&]*)&[^/]*$/, "$1/th?id=$2"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "cdn.4archive.org") { | |
// https://cdn.4archive.org/img/t4Drepmm.jpg | |
// https://cdn.4archive.org/img/t4Drepm.jpg | |
return src.replace(/(\/img\/[^/.]{7})m(\.[^/.]*)$/, "$1$2"); | |
} | |
if (domain === "i.4cdn.org" || | |
// https://i.4pcdn.org/pol/1495294640794s.jpg | |
// https://i.4pcdn.org/pol/1495294640794.jpg | |
domain === "i.4pcdn.org") { | |
// http://i.4cdn.org/hr/1517608108705s.jpg | |
// http://i.4cdn.org/hr/1517608108705.jpg | |
return fillobj_urls(add_extensions(src.replace(/(\/[0-9]*)s(\.[^/.]*)$/, "$1$2")), { | |
headers: { | |
Referer: "" | |
}, | |
referer_ok: { | |
same_domain_nosub: true | |
} | |
}); | |
} | |
if (domain_nowww === "thebarchive.com" || | |
// https://desu-usergeneratedcontent.xyz/int/thumb/1512/86/1512866510412s.jpg | |
// https://desu-usergeneratedcontent.xyz/int/image/1512/86/1512866510412.png | |
// https://cdn2.desu-usergeneratedcontent.xyz/int/thumb/1506/02/1506029481182s.jpg | |
// https://cdn2.desu-usergeneratedcontent.xyz/int/image/1506/02/1506029481182.jpg | |
domain_nosub === "desu-usergeneratedcontent.xyz" || | |
// https://archiveofsins.com/data/s/thumb/1477/81/1477816195263s.jpg | |
// https://archiveofsins.com/data/s/image/1477/81/1477816195263.jpg | |
domain_nowww === "archiveofsins.com") { | |
// https://www.thebarchive.com/data/b/thumb/1473/37/1473370176558s.jpg | |
// https://www.thebarchive.com/data/b/image/1473/37/1473370176558.jpg | |
return add_extensions(src.replace(/(\/)thumb(\/.*\/[0-9]+)s(\.[^/.]*)$/, "$1image$2$3")); | |
} | |
if (domain === "arch.b4k.co") { | |
// https://arch.b4k.co/files/jp/thumb/1578/68/1578682104565s.jpg | |
// https://i.4cdn.org/jp/1578682104565.jpg | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+files\/+([^/]+)\/+thumb\/+[0-9]+\/+[0-9]+\/+([0-9]+s\.[^/.]*)$/, "https://i.4cdn.org/$1/$2"); | |
if (newsrc !== src) | |
return newsrc | |
} | |
if (domain === "ii.yakuji.moe" || | |
// https://iichan.hk/c/thumb/1483306651580s.jpg | |
// https://iichan.hk/c/src/1483306651580.jpg | |
domain_nowww === "iichan.hk" || | |
// https://zip.2chan.net/1/thumb/1577237595290s.jpg | |
// https://zip.2chan.net/1/src/1577237595290.jpg | |
domain_nosub === "2chan.net" || | |
// http://aqua.komica.org/60/thumb/1509040275477s.jpg | |
// http://aqua.komica.org/60/src/1509040275477.jpg | |
domain === "aqua.komica.org") { | |
// http://ii.yakuji.moe/b/thumb/1534110350035s.jpg | |
// http://ii.yakuji.moe/b/src/1534110350035.jpg | |
newsrc = src.replace(/\/thumb\/([0-9]+)s(\.[^/.]*)$/, "/src/$1$2"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "file.tinnhac.com" || | |
domain === "file.tintuckpop.net" || | |
// http://media.bongda.com.vn/resize/455x300/files/hai.phan/2017/03/08/er10-1546.jpg | |
domain === "media.bongda.com.vn" || | |
// https://3.404content.com/resize/730x-/1/8C/F7/1206431106501707365/fullsize.jpg | |
// https://3.404content.com/1/8C/F7/1206431106501707365/fullsize.jpg | |
domain_nosub === "404content.com" || | |
// https://image.vtcns.com/resize/480x270/files/thuylinh/2018/08/01/selenagomez2225x1498instylephotoshoothot2017hd8852-1052581.jpg | |
// https://image.vtcns.com/files/thuylinh/2018/08/01/selenagomez2225x1498instylephotoshoothot2017hd8852-1052581.jpg | |
domain === "image.vtcns.com" || | |
// https://media.cungcau.vn/resize/174x104/files/buithuy/2019/07/09/305-2224.jpg | |
// https://media.cungcau.vn/files/buithuy/2019/07/09/305-2224.jpg | |
domain === "media.cungcau.vn" || | |
// different though? - and crop doesn't work | |
// https://image.vtc.vn/resize/80x60/files/news/2018/02/21/-210540.jpg | |
domain === "image.vtc.vn") { | |
// https://file.tinnhac.com/crop/97x74/music/2018/02/03/3-e875.jpg | |
// https://file.tinnhac.com/music/2018/02/03/3-e875.jpg | |
// https://file.tinnhac.com/resize/600x-/2016/05/25/1eca49c4b-0953.jpg | |
// https://file.tinnhac.com/2016/05/25/1eca49c4b-0953.jpg | |
// http://file.tintuckpop.net/resize/640x-/2016/05/16/1a922-1670.jpg | |
// http://file.tintuckpop.net/crop/210x158/tintuckpop/2018/02/22/shinminah-1519107250-d126.jpg | |
return src | |
.replace(/\/crop\/+[-0-9]+x[-0-9]+\//, "/") | |
.replace(/\/resize\/+[-0-9]+x[-0-9]+\//, "/"); | |
} | |
if (domain_nosub === "zadn.vn" && domain.match(/^photo-resize-/)) { | |
// https://photo-resize-zmp3.zadn.vn/w240h240_jpeg/covers/9/d/9df0d52438b40d91aeaef1c1c2338e92_1476548588.jpg | |
// https://photo-resize-zmp3.zadn.vn/w240h240_jpeg/covers/9/d/9df0d52438b40d91aeaef1c1c2338e92_1476548588.jpg -- gets redirected to: | |
// http://org.photo-resize.mp3.zdn.vn/covers/9/d/9df0d52438b40d91aeaef1c1c2338e92_1476548588.jpg | |
newsrc = src.replace(/(:\/\/[^/]*\/+)w[0-9]+h[0-9]+(?:_[a-z]+)?\/+/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "image.mp3.zdn.vn") { | |
// http://image.mp3.zdn.vn/thumb/240_240/covers/e/0/e06d061a77a7bde916b8a91163029d41_1341286111.jpg | |
// http://image.mp3.zdn.vn/covers/e/0/e06d061a77a7bde916b8a91163029d41_1341286111.jpg | |
return src.replace(/\/thumb\/+[0-9]+_[0-9]+\/+/, "/"); | |
} | |
if (domain_nosub === "zadn.vn" || | |
// https://images.vov.vn/h500/uploaded/wgyyweux2icrb7fgmumzw/2017_05_21/6_LLVB.jpg | |
// https://images.vov.vn/uploaded/wgyyweux2icrb7fgmumzw/2017_05_21/6_LLVB.jpg | |
(domain_nosub === "vov.vn" && domain.match(/images?\.(?:[^/.]*\.)?vov\.vn/)) || | |
// https://ss-images.catscdn.vn/w620/2018/06/15/3005641/35380238_1893554624043549_7227395902841815040_n.jpg | |
// https://ss-images.catscdn.vn/2018/06/15/3005641/35380238_1893554624043549_7227395902841815040_n.jpg | |
// https://ss-images.catscdn.vn/-x250/2018/08/21/3516394/south-korea-peace-sign-v-sign.jpg | |
// https://ss-images.catscdn.vn/2018/08/21/3516394/south-korea-peace-sign-v-sign.jpg | |
// https://ss-images.catscdn.vn/wp600/2018/06/24/3075529/taeyeon-14.jpg | |
// https://ss-images.catscdn.vn/2018/06/24/3075529/taeyeon-14.jpg | |
domain === "ss-images.catscdn.vn" || | |
// http://img.v3.news.zdn.vn/w660/Uploaded/cqxrcajwp/2014_12_14/t13.jpg | |
// http://img.v3.news.zdn.vn/Uploaded/cqxrcajwp/2014_12_14/t13.jpg | |
//domain === "img.v3.news.zdn.vn" || | |
// http://znews-photo.d.za.zdn.vn/w660/Uploaded/xbhunku/2017_01_08/batchston.jpg | |
// http://znews-photo.d.za.zdn.vn/Uploaded/xbhunku/2017_01_08/batchston.jpg | |
domain_nosub === "zdn.vn" || | |
// https://media.stylenews.vn/w660/2018/11/22/rihanna-barbados-ambassador-1542884388587820599121.jpg | |
// https://media.stylenews.vn/2018/11/22/rihanna-barbados-ambassador-1542884388587820599121.jpg | |
domain === "media.stylenews.vn" || | |
// https://img.vietnamplus.vn/t660/Uploaded/ifysy/2015_02_10/grammy_10.jpg | |
// https://img.vietnamplus.vn/Uploaded/ifysy/2015_02_10/grammy_10.jpg | |
domain === "img.vietnamplus.vn" || | |
// https://cdnimg.vietnamplus.vn/t660/Uploaded/ifysv/2014_12_12/x39.jpg | |
// https://cdnimg.vietnamplus.vn/Uploaded/ifysv/2014_12_12/x39.jpg | |
domain === "cdnimg.vietnamplus.vn" || | |
// https://image.baonghean.vn/w607/Uploaded/2018/nkdkswkqoc/201602/original/image_7593475.jpg | |
// https://image.baonghean.vn/Uploaded/2018/nkdkswkqoc/201602/original/image_7593475.jpg | |
// https://image.baonghean.vn/80x60/Uploaded/2018/ftgbtgazsnzm/2018_09_19/trantieuvy1381crop15372615750611556122614_jlls.jpg | |
// https://image.baonghean.vn/Uploaded/2018/ftgbtgazsnzm/2018_09_19/trantieuvy1381crop15372615750611556122614_jlls.jpg | |
// https://image2.baonghean.vn/w607/Uploaded/2018/nkdkswkqoc/201406/original/images997829_fan8_7857_1403158274.jpg | |
// https://image2.baonghean.vn/Uploaded/2018/nkdkswkqoc/201406/original/images997829_fan8_7857_1403158274.jpg | |
(domain_nosub === "baonghean.vn" && domain.match(/^image[0-9]*\./)) || | |
// http://image.baophapluat.vn/230x160/Uploaded/2018/hfobdvicbuhvoc/2014_08_14/v_-_bao_phap_luat_zycd.jpg | |
// http://image.baophapluat.vn/Uploaded/2018/hfobdvicbuhvoc/2014_08_14/v_-_bao_phap_luat_zycd.jpg | |
domain === "image.baophapluat.vn" || | |
// https://image.giaoducthoidai.vn/Uploaded/tranghn/2014_08_06/v1_ZDNQ.jpg?width=100 | |
// https://image.giaoducthoidai.vn/Uploaded/tranghn/2014_08_06/v1_ZDNQ.jpg | |
domain === "image.giaoducthoidai.vn" || | |
// http://image.laodong.com.vn/Uploaded/phanthiphuongthuy/2014_06_22/ht4_HDEY.jpg.ashx?width=660 | |
// http://image.laodong.com.vn/Uploaded/phanthiphuongthuy/2014_06_22/ht4_HDEY.jpg | |
domain === "image.laodong.com.vn" || | |
// https://cdn-images.saostar.vn/wp600/2017/04/10/1210695/exid-teaser2.jpg | |
// https://cdn-images.saostar.vn/2017/04/10/1210695/exid-teaser2.jpg | |
domain === "cdn-images.saostar.vn" || | |
// https://image.tienphong.vn/w665/Uploaded/2018/pcgycivo/2016_08_25/5_pyxg.jpg -- stretched | |
// https://image.tienphong.vn/Uploaded/2018/pcgycivo/2016_08_25/5_pyxg.jpg | |
// https://image3.tienphong.vn/w665/Uploaded/2018/khunflu/2016_07_03/jessica_alba_braun_beauty_campaign_2016_adds_04_redb.jpg | |
// https://image3.tienphong.vn/Uploaded/2018/khunflu/2016_07_03/jessica_alba_braun_beauty_campaign_2016_adds_04_redb.jpg | |
(domain_nosub === "tienphong.vn" && domain.match(/image[0-9]*\.tienphong\.vn/)) || | |
// https://img.infonet.vn/w490/Uploaded/2019/hb_yuqzfdgzs/2017_02_04/thai_kim_dinh.jpg | |
// https://img.infonet.vn/Uploaded/2019/hb_yuqzfdgzs/2017_02_04/thai_kim_dinh.jpg | |
// https://img2.infonet.vn/w480/Uploaded/2018/rog/469/t469361.jpg | |
// https://img2.infonet.vn/Uploaded/2018/rog/469/t469361.jpg | |
(domain_nosub === "infonet.vn" && /^img[0-9]*/.test(domain)) || | |
// https://img.giaoduc.net.vn/w1050/uploaded/2019/rutmne/2012_11_14/nicole-kidman-giaoduc.net.vn.jpg -- upscaled? | |
// https://img.giaoduc.net.vn/uploaded/2019/rutmne/2012_11_14/nicole-kidman-giaoduc.net.vn.jpg | |
domain === "img.giaoduc.net.vn" || | |
domain === "media.laodong.vn") { | |
// https://znews-photo-td.zadn.vn/w960/Uploaded/qfssu/2017_11_05/NGT.jpg | |
// https://znews-photo-td.zadn.vn/Uploaded/qfssu/2017_11_05/NGT.jpg | |
// http://image.english.vov.vn/w490/uploaded/wzzqbijjvws/2016_02_25/tara_GCLM.jpg | |
// http://image.english.vov.vn/uploaded/wzzqbijjvws/2016_02_25/tara_GCLM.jpg | |
// http://image.english.vov.vn/130x82/Uploaded/TmT2B47lHgLy8UZVeuKg/2018_02_04/Xoang_singing_DPVE.jpg | |
// http://image.english.vov.vn/Uploaded/TmT2B47lHgLy8UZVeuKg/2018_02_04/Xoang_singing_DPVE.jpg | |
// http://image.english.vov.vn/h500/uploaded/wzzqbijjvws/2016_03_14/tara_2_KUJE.jpg | |
// http://image.english.vov.vn/uploaded/wzzqbijjvws/2016_03_14/tara_2_KUJE.jpg | |
// https://baomoi-photo-2-td.zadn.vn/w700_r1m/16/03/13/105/18868393/9_65381.jpg | |
// https://baomoi-photo-2-td.zadn.vn/16/03/13/105/18868393/9_65381.jpg | |
// https://baomoi-photo-3.zadn.vn/w460x/17/10/23/94/23663774/11_117795.jpg | |
// https://baomoi-photo-3.zadn.vn/17/10/23/94/23663774/11_117795.jpg | |
// https://baomoi-photo-3-td.zadn.vn/w720x480/18/07/13/100/26873675/2_45090.jpeg | |
// https://baomoi-photo-3-td.zadn.vn/18/07/13/100/26873675/2_45090.jpeg | |
// https://media.laodong.vn/Uploaded/thuctapsinh/2016_03_13/6_QVZZ.jpg?w=629&h=419&crop=auto&scale=both | |
newsrc = src | |
.replace(/(:\/\/[^/]*)\/+[wht]p?[0-9]+x?(?:_[^/]*)?(?:[0-9]+)?\//, "$1/") | |
.replace(/(:\/\/[^/]*)\/+[-0-9]+x[-0-9]+\//, "$1/") | |
.replace(/(?:\.ashx)?\?.*$/, ""); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "cdn.tuoitre.vn" || | |
// https://dantricdn.com/thumb_w/640/487bd2df65/2016/09/24/chipi-1474675645816.jpg | |
// https://dantricdn.com/487bd2df65/2016/09/24/chipi-1474675645816.jpg | |
// https://dantricdn.com/zoom/327_245/2018/2/22/img4232-15192810897621333688893.jpg | |
// https://dantricdn.com/thumb_w/600/2018/2/22/img4232-15192810897621333688893.jpg | |
// https://dantricdn.com/2018/2/22/img4232-15192810897621333688893.jpg | |
domain_nowww === "dantricdn.com" || | |
// http://afamilycdn.com/thumb_w/660/2017/taf-0942-1509860607829.jpg | |
// http://afamilycdn.com/2017/taf-0942-1509860607829.jpg | |
domain_nowww === "afamilycdn.com" || | |
// https://cafebiz.cafebizcdn.vn/thumb_w/600/2016/14593683-10210661710609628-1503569961-n-1475666918244-crop-1475673547715.jpg | |
// https://cafebiz.cafebizcdn.vn/2016/14593683-10210661710609628-1503569961-n-1475666918244-crop-1475673547715.jpg | |
// http://cafebiz.cafebizcdn.vn/2016/14593683-10210661710609628-1503569961-n-1475666918244.jpg | |
domain_nosub === "cafebizcdn.vn" || | |
// http://sohanews.sohacdn.com/thumb_w/1000/2017/photo-1-1510035508692-0-57-337-600-crop-1510035607740.jpg | |
// http://sohanews.sohacdn.com/2017/photo-1-1510035508692.jpg | |
domain_nosub === "sohacdn.com" || | |
// http://kenh14cdn.com/thumb_w/300/2016/img-6763-1458013125674-25-0-650-1000-crop-1458013471506.jpg | |
// http://kenh14cdn.com/2016/img-6763-1458013125674.jpg | |
domain_nosub === "kenh14cdn.com" || | |
// https://cafebiz.cafebizcdn.vn/zoom/420_264/2018/2/22/photo1519268407880-15192684078814005972.jpg | |
domain === "cafebiz.cafebizcdn.vn" || | |
// http://afamily1.vcmedia.vn/thumb_w/600/dnPHhBsGbzUbzOL6NIfgilSBRC2AR0/Image/2014/10/Jiyeon-20f88.jpg | |
// http://afamily1.vcmedia.vn/dnPHhBsGbzUbzOL6NIfgilSBRC2AR0/Image/2014/10/Jiyeon-20f88.jpg | |
domain_nosub === "vcmedia.vn" || | |
// https://genknews.genkcdn.vn/thumb_w/600/2016/photo-1-1471225578014.jpg | |
// https://genknews.genkcdn.vn/2016/photo-1-1471225578014.jpg | |
domain_nosub === "genkcdn.vn" || | |
// https://icdn.dantri.com.vn/thumb_w/640/2018/4/12/selena9-15235036066921137660736.jpg | |
// https://icdn.dantri.com.vn/2018/4/12/selena9-15235036066921137660736.jpg | |
domain === "icdn.dantri.com.vn" || | |
// https://vtv1.mediacdn.vn/zoom/93_93/2018/2/22/nauy-crop-1519281533709468961755.jpg | |
// https://vtv1.mediacdn.vn/2018/2/22/nauy.jpg -- doesn't work | |
// https://vtv1.mediacdn.vn/2018/2/22/nauy-crop-1519281533709468961755.jpg | |
domain_nosub === "mediacdn.vn") { | |
// https://cdn.tuoitre.vn/thumb_w/640/2017/5-nguoi-ham-mo-1509855071319.jpg | |
// https://cdn.tuoitre.vn/2017/5-nguoi-ham-mo-1509855071319.jpg | |
return src | |
.replace(/\/zoom\/[^/]*\//, "/") | |
.replace(/-[0-9]+-[0-9]+-[0-9]+-[0-9]+-crop-[0-9]+(\.[^/.]*)$/, "$1") | |
.replace(/-crop-[0-9]{13,}(\.[^/.]*)$/, "$1") | |
.replace(/(:\/\/[^/]*)\/thumb_[a-z]\/[0-9]+\//, "$1/"); | |
} | |
if (domain_nosub === "24hstatic.com" || | |
// https://image-us.24h.com.vn/upload/2-2018/images/2018-06-07/medium/nguoi-gay-an-gi-av-1528357320-626-width640height480.jpg | |
// https://image-us.24h.com.vn/upload/2-2018/images/2018-06-07/nguoi-gay-an-gi-av-1528357320-626-width640height480.jpg | |
// https://image-us.24h.com.vn/upload/1-2018/images/2018-02-09/1518170617-487-sao--8--1518169128-width650height482_97_125.jpg | |
// https://image-us.24h.com.vn/upload/1-2018/images/2018-02-09/1518170617-487-sao--8--1518169128-width650height482.jpg | |
// https://image-us.24h.com.vn/upload/1-2018/images/2018-03-21/1521627412-702-152162041273441-thumbnail-auto-crop-640x335-watermark.jpg | |
// https://image-us.24h.com.vn/upload/1-2018/images/2018-03-21/1521627412-702-152162041273441-thumbnail.jpg | |
domain_nosub === "24h.com.vn" || | |
// http://streaming1.danviet.vn/upload/1-2018/images/2018-03-12/miko-matsuda-01-1520847171-width650height650-1520848378-width650height650.jpg | |
(domain_nosub === "danviet.vn" && domain.match(/^streaming[0-9]*\./)) || | |
// https://image-us.eva.vn/upload/2-2018/images/2018-06-10/medium/image_dai_dien_gifava-1528642487-944-width640height480.jpg | |
// https://image-us.eva.vn/upload/2-2018/images/2018-06-10/image_dai_dien_gifava-1528642487-944-width640height480.jpg | |
(domain_nosub === "eva.vn" && domain.match(/^image(?:-[a-z]+)?\./)) || | |
// http://anh.24h.com.vn//upload/4-2017/images/2017-11-08/medium/1510125598-629-151011694144796-chi-pu-5.jpg | |
domain === "anh.eva.vn") { | |
// https://eva-img.24hstatic.com/upload/1-2017/images/2017-01-18/large/1484712995-1ava.jpg | |
// https://eva-img.24hstatic.com/upload/1-2017/images/2017-01-18/large/1484712995-1ava.jpg | |
// https://eva-img.24hstatic.com/upload/1-2017/images/2017-01-18/san-khau-dem-nhac-bi-chay-t-ara-van-nhiet-tinh-het-minh-vi-khan-gia-1-1484711458-width500height334.jpg | |
// https://eva-img.24hstatic.com/upload/4-2017/images/2017-10-15/extra_large/1508037671-thumbnail.jpg | |
// https://eva-img.24hstatic.com/upload/4-2017/images/2017-10-15/1508037671-thumbnail.jpg | |
// https://eva-img.24hstatic.com/upload/1-2018/images/2018-02-01/thumbnail/cover1-1517500750-188-width640height480.jpg | |
// https://eva-img.24hstatic.com/upload/1-2018/images/2018-02-01/cover1-1517500750-188-width640height480.jpg | |
// https://anh.eva.vn///upload/1-2016/images/2016-03-13/medium/1457807610-ava1.jpg | |
if (src.match(/\/upload\/+[0-9]+-[0-9]{4}\/+images\//)) { | |
return src | |
.replace(/(\/images\/.*)_[0-9]+_[0-9]+(\.[^/.]*)$/, "$1$2") | |
.replace(/-watermark(\.[^/.]*)$/, "$1") | |
.replace(/-auto-crop-[0-9]+x[0-9]+(\.[^/.]*)$/, "$1") | |
.replace(/(\/images\/[0-9]*-[0-9]*-[0-9]*\/)[^/]*\/([^/]*)$/, "$1$2"); | |
} | |
} | |
if ((domain_nosub === "yan.vn" && domain.match(/static[0-9]*\.yan\.vn/)) || | |
// https://car2.autoimg.cn/cardfs/product/g30/M01/A3/D2/640x480_autohomecar__wKgHHFs7NY6AUXLiAAj8ddqKSUg436.jpg | |
// https://car2.autoimg.cn/cardfs/product/g30/M01/A3/D2/autohomecar__wKgHHFs7NY6AUXLiAAj8ddqKSUg436.jpg | |
(domain_nosub === "autoimg.cn" && domain.match(/^car[0-9]*\.autoimg\.cn/)) || | |
// https://myzutv.ro/uploads/modules/news/0/2018/3/9/37130/560x400_15205880152019549a.jpg | |
// https://myzutv.ro/uploads/modules/news/0/2018/3/9/37130/15205880152019549a.jpg | |
(domain_nowww === "myzutv.ro" && src.indexOf("/uploads/") >= 0) || | |
// http://www.rainews.it/dl/img/2018/07/640x360_1531473973863.rainews_20180713112334780.jpg | |
// http://www.rainews.it/dl/img/2018/07/1531473973863.rainews_20180713112334780.jpg | |
(domain_nowww === "rainews.it" && src.indexOf("/img/") >= 0) || | |
// https://a.jeu.cc/images/jeux/600x372_wedgie-toss.jpg -- upscaled | |
// https://a.jeu.cc/images/jeux/wedgie-toss.jpg | |
(domain === "a.jeu.cc" && src.indexOf("/images/") >= 0) || | |
// https://www.soyuz.ru/public/uploads/files/22/2435186/740x457_201601140813318f7f7e924d.jpg | |
// https://www.soyuz.ru/public/uploads/files/22/2435186/201601140813318f7f7e924d.jpg | |
(domain_nowww === "soyuz.ru" && /\/uploads\/+files\//.test(src)) || | |
// https://www.mjuznews.com/public/photos/1000/236/604x320_236-Wikluh_Sky.jpg | |
// https://www.mjuznews.com/public/photos/1000/236/236-Wikluh_Sky.jpg | |
(domain === "www.mjuznews.com" && src.indexOf("/photos/") >= 0)) { | |
// http://static2.yan.vn/YanThumbNews/2167221/201711/260x130_414f9ea4-e35b-4b11-aed5-883b288ea050.jpg | |
// http://static2.yan.vn/YanThumbNews/2167221/201711/414f9ea4-e35b-4b11-aed5-883b288ea050.jpg | |
return src.replace(/\/[0-9]+x[0-9]+_([^/]*)$/, "/$1"); | |
} | |
if (domain === "image.thanhnien.vn") { | |
// https://image.thanhnien.vn/1600/Uploaded/phangiang/2016_03_12/anh_lfyk.jpg | |
// https://image.thanhnien.vn/Uploaded/phangiang/2016_03_12/anh_lfyk.jpg | |
// https://image.thanhnien.vn/Uploaded/phinp/2018_02_19/thumnail-bi-mat-tuan-anh_cms_VOVN.jpg?width=178&height=100&crop=auto&scale=both | |
// https://image.thanhnien.vn/Uploaded/phinp/2018_02_19/thumnail-bi-mat-tuan-anh_cms_VOVN.jpg | |
// https://image.thanhnien.vn/c150x100/0,23,0,79/Uploaded/binhhh/2020_01_09/selena_gomez_UURR.jpg | |
// https://image.thanhnien.vn/Uploaded/binhhh/2020_01_09/selena_gomez_UURR.jpg | |
return { | |
url: src | |
.replace(/\?.*/, "") | |
.replace(/(:\/\/[^/]*)\/+(?:[0-9]+|c[0-9]+x[0-9]+\/+[0-9]+(?:,[0-9]+){3})\/+(uploaded\/)/i, "$1/$2"), | |
can_head: false // hangs? | |
}; | |
//return src.replace(/\/c[0-9]+x[0-9]+\/+[0-9]+(?:,[0-9]+){3}\/+Uploaded\/+/i, "/Uploaded/"); | |
} | |
if (domain === "media-local.phunu365.net" || | |
// http://media-local.mywow.vn/api1x1/res/ext/0x0/r/img.v3.news.zdn.vn/w660/Uploaded/nphpayp/2014_09_11/4.jpg | |
// http://img.v3.news.zdn.vn/w660/Uploaded/nphpayp/2014_09_11/4.jpg | |
// http://img.v3.news.zdn.vn/Uploaded/nphpayp/2014_09_11/4.jpg | |
domain === "media-local.mywow.vn") { | |
// http://media-local.phunu365.net/api1x1/res/ext/0x0/r/image.24h.com.vn/upload/1-2017/images/2017-01-16/1484562734-148456151330358-dia-1.jpg | |
return src.replace(/.*?\/api[0-9]+x[0-9]+\/res\/ext\/[0-9]+x[0-9]+\/[^/]*\//, "http://"); | |
} | |
if ((domain_nosub === "nguoiduatin.vn" && domain.match(/.*media[0-9]*\.nguoiduatin\.vn/)) || | |
// http://media.doisongphapluat.com/thumb_x200x/352/2015/2/9/lady-gaga-grammy-doisongphapluat.jpg | |
// http://media.doisongphapluat.com/352/2015/2/9/lady-gaga-grammy-doisongphapluat.jpg | |
domain === "media.doisongphapluat.com" || | |
// http://media.vietq.vn/thumb_x394x263/upload/2017/01/14/chup-anh-gio-ngon-tay-chu-v-co-the-se-bi-hack-van-tay-de-lam-gia8.jpg | |
// http://media.vietq.vn/upload/2017/01/14/chup-anh-gio-ngon-tay-chu-v-co-the-se-bi-hack-van-tay-de-lam-gia8.jpg | |
domain === "media.vietq.vn" || | |
// https://baouc.com/thumb_x550x400/upload/thanhxuan/2017/11/13/nhung-cach-giu-cua-can-than-toi-noi-sieu-trom-nhin-xong-cung-thay-chan-han1510543145.jpg | |
// https://baouc.com/upload/thanhxuan/2017/11/13/nhung-cach-giu-cua-can-than-toi-noi-sieu-trom-nhin-xong-cung-thay-chan-han1510543145.jpg | |
domain_nowww === "baouc.com" || | |
// https://media.hay.tv/thumb_x108x130//upload/default/star/24122016/photo/got1.jpg | |
// https://media.hay.tv//upload/default/star/24122016/photo/got1.jpg | |
domain === "media.hay.tv" || | |
// http://media.hotbirthdays.com/thumb_x200x204/upload/2015/10/27/emilia-clarke.jpg | |
// http://media.hotbirthdays.com/upload/2015/10/27/emilia-clarke.jpg | |
domain === "media.hotbirthdays.com") { | |
// http://xmedia.nguoiduatin.vn/amp_thumb_x1120x832/ndt/16/03/12/202/18865226/8_288040.jpg | |
// http://xmedia.nguoiduatin.vn/ndt/16/03/12/202/18865226/8_288040.jpg | |
// http://media1.nguoiduatin.vn/thumb_x680x354/media/le-nham-than/2018/02/04/hoa.png | |
// http://media1.nguoiduatin.vn/media/le-nham-than/2018/02/04/hoa.png | |
return src.replace(/(:\/\/[^/]*)\/[^/]*x[0-9]+x(?:[0-9]+)?\//, "$1/"); | |
} | |
if (domain === "www.wowkorea.live" || | |
// http://fotofap.net/img/1541304288/1_m.jpg | |
// http://fotofap.net/img/1541304288/1.jpg | |
(domain_nowww === "fotofap.net" && src.indexOf("/img/") >= 0) || | |
// http://images.vfl.ru/ii/1517170346/e739011e/20348673_s.jpg | |
// http://images.vfl.ru/ii/1517170346/e739011e/20348673.jpg | |
domain === "images.vfl.ru") { | |
// http://www.wowkorea.live/img/album/8/42081/76033_m.jpg | |
return src.replace(/(\/[0-9]*)_[a-z](\.[^/.]*)$/, "$1$2"); | |
} | |
if (domain === "content.erooups.com") { | |
// http://content.erooups.com/img3/20141213/37/wonderful_blonde_girl_in_purple_-_bree_daniels_2_m.jpg?1422153720 | |
// http://content.erooups.com/img3/20141213/37/wonderful_blonde_girl_in_purple_-_bree_daniels_2.jpg?1422153720 | |
return src.replace(/(\/img[0-9]*\/+[0-9]{8}\/+[0-9]+\/+[^/]*)_m(\.[^/.]*)(?:[?#].*)?$/, "$1$2"); | |
} | |
if (domain_nosub === "seoul.co.kr" && domain.match(/img[^.]*\.seoul\.co\.kr/)) { | |
// http://img.seoul.co.kr/img/upload/2018/02/04/SSI_20180204221012_V.jpg | |
// http://img.seoul.co.kr/img/upload/2018/02/04/SSI_20180204221012.jpg | |
// none, O, V, L, S, N, N2, N3, N4, N5 | |
// http://img.seoul.co.kr//img/upload/2017/02/20/SSI_20170220101030_V.jpg | |
// http://img.seoul.co.kr//img/upload/2017/02/20/SSI_20170220101030.jpg | |
// (V, none), O, L, S, N,... | |
// http://imgnn.seoul.co.kr/img//upload/2009/01/20/SSI_20090120114407_V.jpg | |
// | |
// http://img.seoul.co.kr/img/upload/2015/12/29/SSI_20151229090141_V.jpg | |
// http://img.seoul.co.kr/img/upload/2015/12/29/SSI_20151229090141.jpg - 2500x3235 | |
return src.replace(/_[A-Z](?:[0-9]){0,2}(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "img.yonhapnews.co.kr" || | |
// http://vmg.yonhapnews.co.kr/etc/inner/KR/2015/08/20/AKR20150820090700005_01_i_P4.jpg | |
domain === "vmg.yonhapnews.co.kr" || | |
// https://img2.yna.co.kr/etc/inner/KR/2018/12/07/AKR20181207074000005_01_i_P2.jpg | |
// https://img2.yna.co.kr/etc/inner/KR/2018/12/07/AKR20181207074000005_01_i.jpg -- no difference | |
// https://img1.yna.co.kr/etc/inner/JP/2019/02/19/AJP20190219001100882_02_i_T2.jpg | |
// https://img1.yna.co.kr/etc/inner/JP/2019/02/19/AJP20190219001100882_02_i.jpg | |
// https://img.yna.co.kr/etc/inner/CK/2019/02/19/ACK20190219001100881_01_i_P2.jpg | |
// https://img.yna.co.kr/etc/inner/CK/2019/02/19/ACK20190219001100881_01_i.jpg | |
(domain_nosub === "yna.co.kr" && domain.match(/^img[0-9]*\./))) { | |
// http://img.yonhapnews.co.kr/photo/yna/YH/2017/12/30/PYH2017123017200001300_P1.jpg | |
// http://img.yonhapnews.co.kr/photo/yna/YH/2017/12/30/PYH2017123017200001300_P4.jpg | |
// https://img5.yna.co.kr/etc/inner/EN/2018/12/31/AEN20181231122400315_04_i_P4.jpg | |
// https://img5.yna.co.kr/etc/inner/EN/2018/12/31/AEN20181231122400315_04_i.jpg | |
// http://img.yonhapnews.co.kr/etc/graphic/YH/2017/10/25/GYH2017102500160004400.jpg | |
// http://img.yonhapnews.co.kr/etc/inner/EN/2018/02/19/AEN20180219010000315_02_i.jpg | |
// http://img.yonhapnews.co.kr/etc/graphic/YH/2013/11/28/GYH2013112800040003900_P2.jpg | |
// http://img.yonhapnews.co.kr/etc/inner/KR/2017/04/28/AKR20170428061900017_01_i.jpg | |
// http://img.yonhapnews.co.kr/mpic/YH/2018/02/23/MYH20180223017200038.jpg (1920x1080) | |
// http://img.yonhapnews.co.kr/etc/inner/KR/2016/11/03/AKR20161103119100061_01_i.jpg (3810x2704) | |
// returns 400 even if it exists | |
var extra = {}; | |
match = src.match(/\/(PYH[0-9]{17})[0-9]{2}[_.][^/]*(?:[?#].*)?$/); | |
if (match) { | |
extra.page = "https://www.yna.co.kr/view/" + match[1]; | |
} | |
return { | |
url: src | |
.replace(/(\/PYH[^/_.]*)_[^/.]*(\.[^/.]*)$/, "$1_P4$2") | |
.replace(/(\/A(?:KR|JP|CK|EN)[^/_.]*_[0-9]+_i)_[^/.]*(\.[^/.]*)$/, "$1$2"), | |
can_head: false, // 400 | |
extra: extra | |
}; | |
} | |
if (domain_nosub === "yonhapnews.co.kr" && domain.match(/big[0-9]*\.yonhapnews\.co\.kr/)) { | |
// http://big5.yonhapnews.co.kr:83/gate/big5/img.yonhapnews.co.kr/basic/template/ck/2018/02/09/tmp_4504_20180209103744.jpg | |
// http://img.yonhapnews.co.kr/basic/template/ck/2018/02/09/tmp_4504_20180209103744.jpg | |
return src.replace(/.*:\/\/[^/]*\/gate\/[^/]*\//, "http://"); | |
} | |
if (domain_nosub === "bunjang.net") { | |
// http://seoul-p-studio.bunjang.net/product/64557873_1_1514396938_w320.jpg | |
// http://seoul-p-studio.bunjang.net/product/64557873_1_1514396938.jpg | |
return { | |
url: src.replace(/_[wh][0-9]*(\.[^/.]*)$/, "$1"), | |
can_head: false // 404 | |
}; | |
} | |
if (domain === "betanews.heraldcorp.com" || | |
domain_nowww === "betanews.net") { | |
// http://betanews.heraldcorp.com:8080/imagedb/thumb/2017/0821/acc59960.jpg | |
// http://betanews.heraldcorp.com:8080/imagedb/orig/2017/0821/acc59960.jpg | |
// http://www.betanews.net/imagedb/first/2018/0204/d37686d0.jpg | |
// http://betanews.net/imagedb/orig/2018/0204/d37686d0.jpg | |
// http://www.betanews.net/imagedb/main/thumb/805/805660.jpg | |
// http://www.betanews.net/imagedb/main/orig/805/805660.jpg | |
return src | |
.replace(/(\/imagedb\/(:?[^/]*\/)?)(?:first|thumb)\//, "$1orig/"); | |
} | |
if (domain === "img.smlounge.co.kr") { | |
// http://img.smlounge.co.kr/upload/grazia/article/201611/thumb/32609-190630-sampleM.jpg | |
// http://img.smlounge.co.kr/upload/grazia/article/201611/32609-190630.jpg | |
// http://www.smlounge.co.kr/upload/grazia/article/201801/thumb/37419-279467-sample.jpg | |
// http://img.smlounge.co.kr/upload/grazia/article/201801/37419-279467.jpg | |
return src.replace(/\/thumb\/([^/.]*)-sample[^/.-]*(\.[^/.]*)$/, "/$1$2"); | |
} | |
if (false && domain === "img.etoday.co.kr") { | |
// wip | |
// http://www.etoday.co.kr/news/section/newsview_photo.php?idxno=1315836&seq=1 | |
// http://img.etoday.co.kr/pto_db/2016/04/20160412091428_851269_450_691.jpg (450x691) | |
// http://img.etoday.co.kr/html/lib_img_crop.php?id=851269&mw=300&mh=225 (doesn't go up to 691, stretches) | |
// http://img.etoday.co.kr/html/lib_img_mxwidth.php?idxno=1220670&maxw=530 | |
} | |
if (domain === "img.etoday.co.kr") { | |
// http://img.etoday.co.kr/pto_db/2013/04/600/20130425103458_292642_1800_3052.jpg | |
// http://img.etoday.co.kr/pto_db/2013/04/20130425103458_292642_1800_3052.jpg | |
return src.replace(/(\/pto_db\/+[0-9]{4}\/+[0-9]{2}\/+)[0-9]+\/+([0-9]+_[0-9]+[^/]*)(?:[?#].*)?$/, | |
"$1$2"); | |
} | |
if (domain === "image.tving.com" && | |
src.indexOf("tving.com/resize.php") >= 0) { | |
// http://image.tving.com/resize.php?u=http://image.tving.com/upload/smr/clip/2018/02/04/C01_150548_0405.jpg&w=228 | |
return src.replace(/.*:\/\/[^/]*\/resize\.php.*?[?&]u=([^&]*).*/, "$1"); | |
} | |
if (domain === "cdn.pastemagazine.com") { | |
// https://cdn.pastemagazine.com/www/articles/assets_c/2015/02/skyrim%20mod%206-thumb-500x281-138387.jpg | |
// https://cdn.pastemagazine.com/www/articles/skyrim%20mod%206.jpg | |
// https://cdn.pastemagazine.com/www/system/images/photo_albums/robin-williams/medium/14-williams-deadagain.jpg?1384968217 | |
// https://cdn.pastemagazine.com/www/system/images/photo_albums/robin-williams/original/14-williams-deadagain.jpg?1384968217 | |
return src | |
.replace(/(\/[^/]*\/)assets_[^/]*\/[0-9]*\/[0-9]*\/([^-]*)-.*(\.[^/.]*)$/, "$1$2$3") | |
.replace(/(\/www\/+system\/+images\/+.*\/)[a-z]+\/+([^/]*)(?:[?#].*)?$/, "$1original/$2"); | |
} | |
if (domain_nowww === "beauty-co.jp") { | |
// https://www.beauty-co.jp/news/assets_c/2018/02/180228_lucy_01-thumb-142xauto-21539.jpg | |
// https://www.beauty-co.jp/news/img/180228_lucy_01.jpg | |
return src.replace(/\/news\/+assets_[^/]*\/+[0-9]{4}\/+[0-9]{2}\/+([^-]*)-.*(\.[^/.]*)$/, "/news/img/$1$2"); | |
} | |
if (domain_nowww === "seichimap.jp") { | |
// https://seichimap.jp/contents/assets_c/2015/08/P8150066-thumb-400xauto-539.jpg | |
// https://seichimap.jp/contents/pht/P8150066.JPG | |
newsrc = src.replace(/(\/[^/]*\/)assets_[^/]*\/+[0-9]{4}\/+[0-9]{2}\/+([^-]*)-.*(\.[^/.]*)$/, "$1pht/$2$3"); | |
if (newsrc !== src) { | |
return add_extensions_upper(newsrc); | |
} | |
} | |
if (domain === "www.agencyteo.com") { | |
// http://www.agencyteo.com/news/download/28302/w/600/KakaoTalk_20161121_144905918.jpg | |
// http://www.agencyteo.com/news/download/28302/KakaoTalk_20161121_144905918.jpg | |
// http://www.agencyteo.com/news/download/48614/w/600/735318-800w.jpg | |
// // http://www.agencyteo.com/news/download/48614/735318.jpg | |
return src | |
.replace(/-[0-9]*[wh]*(\.[^/.]*)$/, "$1") | |
.replace(/(\/download\/[0-9]*\/)[wh]\/[0-9]*\//, "$1"); | |
} | |
if (domain_nosub === "riotpixels.net" && domain.match(/s[0-9]*\.riotpixels\.net/)) { | |
// http://s01.riotpixels.net/data/37/29/3729e0a0-9e4c-4efa-9eb2-f89f17dde8fa.jpg.240p.jpg | |
// http://s01.riotpixels.net/data/37/29/3729e0a0-9e4c-4efa-9eb2-f89f17dde8fa.jpg/screenshot.assassins-creed-origins.1920x1080.2017-11-25.87.jpg | |
// http://s01.riotpixels.net/data/37/29/3729e0a0-9e4c-4efa-9eb2-f89f17dde8fa.jpg | |
// http://s01.riotpixels.net/data/b5/d0/b5d0cf29-9c4e-44f1-a2f4-1a5613453006.jpg.240p.jpg | |
return src.replace(/(\/data\/[a-f0-9]*\/[a-f0-9]*\/[^./]*\.[^/.]*)[./].*$/, "$1"); | |
} | |
if ((domain_nosub === "ignimgs.com" || | |
domain_nosub === "ign.com") && | |
(domain.match(/^assets[0-9]*\./) || | |
// http://moviesmedia.ign.com/movies/image/article/996/996170/transformers-revenge-of-the-fallen-20090618000150436_640w.jpg | |
// http://moviesmedia.ign.com/movies/image/article/996/996170/transformers-revenge-of-the-fallen-20090618000150436.jpg | |
// https://ps3media.ign.com/ps3/image/object/114/114861/Saints-Row-2-Greatest-Hits_US_ESRB_PS3.jpg?width=188 | |
// https://ps3media.ign.com/ps3/image/object/114/114861/Saints-Row-2-Greatest-Hits_US_ESRB_PS3.jpg | |
// doesn't work for all: | |
// http://media.ign.com/games/image/object/143/14304363/Saints-Row-2_LOGOboxart_160w.jpg | |
// http://media.ign.com/games/image/object/143/14304363/Saints-Row-2_LOGOboxart.jpg -- doesn't work | |
domain.match(/^[^.]*media\./))) { | |
// http://assets1.ignimgs.com/2018/02/02/ac-origins-the-hidden-ones---button-1517533272073_180h.jpg | |
// http://assets1.ignimgs.com/2018/02/02/ac-origins-the-hidden-ones---button-1517533272073.jpg | |
// http://assets1.ignimgs.com/2018/02/06/nightinthewoods-deck-ff6c25-1517944777381_358w.jpg | |
// http://assets1.ignimgs.com/2018/02/06/nightinthewoods-deck-ff6c25-1517944777381.jpg | |
// http://assets1.ignimgs.com/2017/05/09/1-1-1494366320371_grande.jpg | |
// http://assets1.ignimgs.com/2017/05/09/1-1-1494366320371.jpg | |
// https://assets.ign.com/thumbs/userUploaded/2014/9/19/20823568_fatalframewiiu_tgs2014trailer_ign-1411150047803_medium.jpg | |
// https://assets1.ignimgs.com/thumbs/userUploaded/2019/6/9/ignnow060919-cyberpunkblogroll-1560126294042.jpg?fit=bounds&dpr=1&quality=75&crop=16%3A9&width=300&format=pjpg | |
// https://assets1.ignimgs.com/thumbs/userUploaded/2019/6/9/ignnow060919-cyberpunkblogroll-1560126294042.jpg | |
//return src.replace(/_[0-9]*[wh](\.[^/.]*)$/, "$1"); | |
newsrc = src.replace(/[?#].*$/, ""); | |
if (newsrc !== src) | |
return newsrc; | |
return src.replace(/_(?:[0-9]+[hw]|medium|grande)(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "i.neoseeker.com" && | |
src.match(/\/size\/[0-9]+x[0-9]+\//)) { | |
// https://i.neoseeker.com/size/166x85/1/n/1/1500662379_dbz_disc_display.jpg | |
// https://i.neoseeker.com/size/0x0/1/n/1/1500662379_dbz_disc_display.jpg | |
return src.replace(/\/size\/[0-9]+x[0-9]+\//, "/size/0x0/"); | |
} | |
if (domain === "i.neoseeker.com" && | |
src.match(/\/p\/[0-9]*\/[0-9]*\//)) { | |
// https://i.neoseeker.com/p/206/46/dragon-ball-fighterz_thumb_pOUTR.jpg | |
// https://i.neoseeker.com/screenshots/MjA2LzQ2Lw==/dragon-ball-fighterz_image_pOUTR.jpg | |
// https://i.neoseeker.com/p/206/46/dragon-ball-fighterz_image_pOUTR.jpg | |
return src.replace(/_thumb_([^/]*$)/, "_image_$1"); | |
} | |
if (domain === "resource.supercheats.com") { | |
// https://resource.supercheats.com/library/640w/ember/emb_intro.jpg | |
// https://resource.supercheats.com/library/ember/emb_intro.jpg | |
// https://resource.supercheats.com/library/thumbs/2018/1515877801dlc.png | |
// https://resource.supercheats.com/library/2018/1515877801dlc.png | |
return src.replace(/\/library\/(?:(?:[0-9]*[wh])|thumbs)\//, "/library/"); | |
} | |
if (amazon_container === "intergi-phoenix") { | |
// https://intergi-phoenix.s3.amazonaws.com/1021319/videos/5450791/images/thumb_large_Cod-WWII-dlc.jpg | |
// https://intergi-phoenix.s3.amazonaws.com/1021319/videos/5450791/images/Cod-WWII-dlc.jpg | |
return src.replace(/\/images\/thumb_large_([^/]*)$/, "/images/$1"); | |
} | |
if (domain === "www.primagames.com" || | |
// https://www.rockpapershotgun.com/images/16/jun/mirrorsedgecatalyst3.jpg/RPSS/resize/760x-1/format/jpg/quality/90 | |
// https://www.rockpapershotgun.com/images/16/jun/mirrorsedgecatalyst3.jpg | |
domain_nowww === "rockpapershotgun.com" || | |
// http://images.eurogamer.net/2015/articles//a/1/8/3/4/8/3/6/Fri_Jun_3_11_42_35_UTC2B0100_2016.png/EG11/resize/600x-1/quality/80/format/jpg | |
// http://images.eurogamer.net/2015/articles//a/1/8/3/4/8/3/6/Fri_Jun_3_11_42_35_UTC2B0100_2016.png | |
domain === "images.eurogamer.net" || | |
// https://assets.rockpapershotgun.com/images/2018/09/acship.jpg/RPSS/resize/760x-1/format/jpg/quality/70 | |
// https://assets.rockpapershotgun.com/images/2018/09/acship.jpg | |
domain === "assets.rockpapershotgun.com") { | |
// https://www.primagames.com/media/images/news/Playdead-Inside-ResearchFacility-40.jpg/PRIMA/resize/100x/format/jpg | |
// https://www.primagames.com/media/files/news/dragon-age-inquisition-landing-page/dragon-age-inquisition-cover-ce.png/PRIMAP/resize/618x/format/jpg/quality/80 -- scaled up | |
// https://www.primagames.com/media/files/news/dragon-age-inquisition-landing-page/dragon-age-inquisition-cover-ce.png | |
//return src.replace(/\/PRIMAP?\/.*/, ""); | |
return src.replace(/(\/[^/]*\.[^/.]*)\/[A-Z0-9]+\/(?:resize|format|crop|quality)?\/.*$/, "$1"); | |
} | |
if ((domain_nosub === "ixquick.com" || | |
domain_nosub === "startpage.com") && | |
domain.match(/s[0-9]*-[^.]*\./)) { | |
// https://s15-us2.ixquick.com/cgi-bin/serveimage?url=http%3A%2F%2Ft0.gstatic.com%2Fimages%3Fq%3Dtbn%3AANd9GcQybc24UPrYyg-TnWPRUYH7zgzbQXgL4P86ngojIWv8J-Fzom7dAA&sp=ea6bc994daf22079cacb1e62879fa8d4&anticache=581224 | |
// http://t0.gstatic.com/images?q=tbn:ANd9GcQybc24UPrYyg-TnWPRUYH7zgzbQXgL4P86ngojIWv8J-Fzom7dAA | |
// https://s16-us2.startpage.com/cgi-bin/serveimage?url=https%3A%2F%2Fshop.r10s.jp%2Fcandy%2Fcabinet%2Fcrossmoll%2Fs3%2F3140-thum10n.jpg&sp=da601974efae2ac4b74ed8d2f7727366 | |
// https://shop.r10s.jp/candy/cabinet/crossmoll/s3/3140-thum10n.jpg | |
// https://s17-us2.startpage.com/cgi-bin/serveimage?url=https%3A%2F%2Fpbs.twimg.com%2Fmedia%2FDqzGRf3UwAAI1dG.jpg&sp=2c361f2da4eb784198142d2423391c87 | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+cgi-bin\/+serveimage.*?[?&]url=([^&]*).*?$/, "$1"); | |
if (newsrc !== src) | |
return decodeURIComponent(newsrc); | |
//return decodeURIComponent(src.replace(/.*\/serveimage.*?[?&]url=([^&]*).*/, "$1")); | |
} | |
if (domain === "beta.ems.ladbiblegroup.com") { | |
// http://beta.ems.ladbiblegroup.com/s3/content/353x199/0b7434735a7a95090e0210baf66f63ed.png | |
// http://beta.ems.ladbiblegroup.com/s3/content/0b7434735a7a95090e0210baf66f63ed.png | |
return src.replace(/\/s3\/content\/[0-9]+x[0-9]+\//, "/s3/content/"); | |
} | |
if (domain === "mtv-intl.mtvnimages.com") { | |
// http://mtv-intl.mtvnimages.com/uri/mgid:arc:content:mtvasia.com:cdeab016-8964-423d-96ae-8ec187190fef?ep=mtvasia.com&stage=live&format=jpg&quality=0.8&quality=0.85&width=656&height=369&crop=true | |
// http://mtv-intl.mtvnimages.com/uri/mgid:arc:content:mtvasia.com:cdeab016-8964-423d-96ae-8ec187190fef | |
return src.replace(/(\?ep=[^&]*).*/, "$1"); | |
} | |
if (domain === "gaia.adage.com") { | |
// http://gaia.adage.com/images/bin/image/x-large/GettyImages90319988832.jpg?1515686676 | |
// http://gaia.adage.com/images/bin/image/GettyImages90319988832.jpg?1515686676 | |
// http://gaia.adage.com/images/bin/image/medium/Bud-Light-Super-Bowl-2018---Bud-Knight.jpg?1517433099 | |
// http://gaia.adage.com/images/bin/image/Bud-Light-Super-Bowl-2018---Bud-Knight.jpg?1517433099 | |
return src.replace(/\/images\/bin\/image\/[^/]*\//, "/images/bin/image/"); | |
} | |
if (domain === "t-eska.cdn.smcloud.net") { | |
// http://t-eska.cdn.smcloud.net/hotplota/t/2/t/image/98343cf69b8e6bfcd82fd21c1573c5b4IMU2KOV8-en-0.jpg/ru-0-r-600,600-n-98343cf69b8e6bfcd82fd21c1573c5b4IMU2KOV8en0.jpg | |
// http://t-eska.cdn.smcloud.net/hotplota/t/2/t/image/98343cf69b8e6bfcd82fd21c1573c5b4IMU2KOV8-en-0.jpg/n-98343cf69b8e6bfcd82fd21c1573c5b4IMU2KOV8en0.jpg | |
// http://t-eska.cdn.smcloud.net/hotplota/t/2/t/image/adc18921067ea9ca27d451b35ac4b964a2tUvABZ-prze.PNG/ru-0-ra-280,255-n-adc18921067ea9ca27d451b35ac4b964a2tUvABZprze.PNG | |
// http://t-eska.cdn.smcloud.net/hotplota/t/2/t/image/adc18921067ea9ca27d451b35ac4b964a2tUvABZ-prze.PNG/n-adc18921067ea9ca27d451b35ac4b964a2tUvABZprze.PNG | |
return src.replace(/\/[^/]*?n-([^/]*)$/, "/n-$1"); | |
} | |
if (domain === "cdn.wegow.com") { | |
// https://cdn.wegow.com/media/artist-media/bad-gyal/bad-gyal-4132.-1x2560.jpg - stretched | |
// https://cdn.wegow.com/media/artist-media/bad-gyal/bad-gyal-4132.jpg | |
return src.replace(/\.[-0-9]*x[-0-9]*(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "www.ecestaticos.com") { | |
// https://www.ecestaticos.com/image/clipping/330/74d2adf4c3ccfa3144086c71e16eabf3/alba-farelo-es-bad-gyal-una-de-las-mujeres-que-lidera-el-dancehall-espanol-gerard-lopez.jpg | |
// https://www.ecestaticos.com/image/clipping/0/74d2adf4c3ccfa3144086c71e16eabf3/alba-farelo-es-bad-gyal-una-de-las-mujeres-que-lidera-el-dancehall-espanol-gerard-lopez.jpg | |
return src.replace(/\/clipping\/[0-9]*\//, "/clipping/0/"); | |
} | |
if (domain_nowww === "sonarreykjavik.com" || | |
// http://www.gamer.ru/system/attached_images/images/000/314/112/normal/8636.jpg | |
// http://www.gamer.ru/system/attached_images/images/000/314/112/original/8636.jpg | |
domain_nowww === "gamer.ru" || | |
// https://li1613-47.members.linode.com/system/App/BlogBody/photos/000/225/791/medium/44a50f07b4bdc57740901280f9eddaf5.PNG | |
// https://li1613-47.members.linode.com/system/App/BlogBody/photos/000/225/791/original/44a50f07b4bdc57740901280f9eddaf5.PNG | |
domain_nosub === "linode.com" || | |
// http://img.noritter.com/system/App/BlogBody/photos/000/169/173/largethumb/44558aadbc23ffc36240198c7e47a0bb.jpg | |
// http://img.noritter.com/system/App/BlogBody/photos/000/169/173/original/44558aadbc23ffc36240198c7e47a0bb.jpg | |
domain === "img.noritter.com" || | |
// https://esportivo.net/system/post_pictures/files/000/000/007/medium/Bez_tytu%C5%82u.jpg?1500980126 | |
// https://esportivo.net/system/post_pictures/files/000/000/007/original/Bez_tytu%C5%82u.jpg?1500980126 | |
// https://esportivo.net/system/posts/posters/000/001/303/thumb/fortnite.jpg?1536761386 | |
// https://esportivo.net/system/posts/posters/000/001/303/original/fortnite.jpg?1536761386 | |
domain_nowww === "esportivo.net" || | |
// http://pvgroup.ru/system/post_pictures/pictures/000/000/260/medium/Thermoplast_2018-9.jpg?1531233838 | |
// http://pvgroup.ru/system/post_pictures/pictures/000/000/260/original/Thermoplast_2018-9.jpg?1531233838 -- doesn't work | |
// http://pvgroup.ru/system/post_pictures/pictures/000/000/072/medium/DSC09097.JPG?1425970948 | |
// http://pvgroup.ru/system/post_pictures/pictures/000/000/072/original/DSC09097.JPG?1425970948 -- works | |
domain_nowww === "pvgroup.ru" || | |
// http://leit.is/system/events/images/000/002/054/small/6-mind-blowing-ways-wear-your-steampunk-goggles.w654.jpg?1433916032 | |
// http://leit.is/system/events/images/000/002/054/original/6-mind-blowing-ways-wear-your-steampunk-goggles.w654.jpg?1433916032 | |
domain_nowww === "leit.is" || | |
// http://www.rovina-project.eu/system/post_pictures/assets/000/000/054/big/premiazione-fabrizio.jpg?1450022017 -- 600x417 | |
// http://www.rovina-project.eu/system/post_pictures/assets/000/000/054/original/premiazione-fabrizio.jpg?1450022017 -- 1319x917 | |
domain_nowww === "rovina-project.eu" || | |
// https://mmorpg.org.pl/system/post_pictures/files/000/006/015/thumb/40668144_2172392399469743_8786830147845095424_n.jpg?1537099596 | |
// https://mmorpg.org.pl/system/post_pictures/files/000/006/015/original/40668144_2172392399469743_8786830147845095424_n.jpg?1537099596 | |
domain_nowww === "mmorpg.org.pl" || | |
// http://girlspolish.jp/system/item_images/images/000/017/452/medium/13c97c51-60d1-4dfc-b9e6-5b8df642af16.jpg?1468969209 | |
// http://girlspolish.jp/system/item_images/images/000/017/452/original/13c97c51-60d1-4dfc-b9e6-5b8df642af16.jpg?1468969209 | |
domain_nowww === "girlspolish.jp" || | |
// http://joah-girls.com/system/item_images/images/000/112/476/medium/a9faac95-20df-48f5-a855-0c9791e1ec11.jpg?1513993165 | |
// http://joah-girls.com/system/item_images/images/000/112/476/original/a9faac95-20df-48f5-a855-0c9791e1ec11.jpg?1513993165 | |
// http://joah-girls.com/system/articles/images/000/005/369/square/2964aa6c-389c-4920-b383-83083f5d2279.jpg?1547101266 | |
domain_nowww === "joah-girls.com" || | |
// http://listas.eleconomista.es/system/items/000/106/409/medium/listas-eleconomista-enma-stone.jpg?1518398807 | |
// http://listas.eleconomista.es/system/items/000/106/409/original/listas-eleconomista-enma-stone.jpg?1518398807 | |
domain === "listas.eleconomista.es" || | |
// https://gonintendo.com/system/file_uploads/uploads/000/011/876/medium/New-Super-Mario-Bros-U_2012_06-05-12_012.jpg | |
// https://gonintendo.com/system/file_uploads/uploads/000/011/876/original/New-Super-Mario-Bros-U_2012_06-05-12_012.jpg | |
domain_nowww === "gonintendo.com" || | |
// https://gozzip.id/system/App/BlogBody/photos/000/203/493/medium/24f76634ce96b927cfdcdd6dce44e5ef.jpg | |
// https://gozzip.id/system/App/BlogBody/photos/000/203/493/original/24f76634ce96b927cfdcdd6dce44e5ef.jpg | |
(domain_nowww === "gozzip.id" && /\/BlogBody\/+photos\//.test(src)) || | |
// https://greasyfork.org/system/screenshots/screenshots/000/010/208/thumb/Snipaste_2018-03-05_12-28-39.png?1520224343 | |
// https://greasyfork.org/system/screenshots/screenshots/000/010/208/original/Snipaste_2018-03-05_12-28-39.png?1520224343 | |
domain_nowww === "greasyfork.org" || | |
// https://static.themezy.com/system/resources/previews/000/000/244/non_2x/web-designer-portfolio-website-template.jpg | |
// https://static.themezy.com/system/resources/previews/000/000/244/original/web-designer-portfolio-website-template.jpg | |
domain === "static.themezy.com" || | |
// https://hairhapi.com/images/item_images/images/000/037/150/medium/27b4ce4e-b343-4d78-a4f4-7d610099257f.jpg | |
// https://hairhapi.com/images/item_images/images/000/037/150/original/27b4ce4e-b343-4d78-a4f4-7d610099257f.jpg | |
domain_nowww === "hairhapi.com" || | |
// http://babyfashion.me/system/pictures/imgs/000/026/436/gallery_view/altuzarra-vesna-leto-2017_545153pw_7516888955953422.jpg?1477389806 | |
// http://babyfashion.me/system/pictures/imgs/000/026/436/original/altuzarra-vesna-leto-2017_545153pw_7516888955953422.jpg?1477389806 | |
domain_nowww === "babyfashion.me" || | |
// https://sonar.es/system/attached_images/18702/medium/badgyal_xs_sonar2017_fernandoschlaepfer_004.jpg?1497713257 -- stretched? | |
// https://sonar.es/system/attached_images/18702/original/badgyal_xs_sonar2017_fernandoschlaepfer_004.jpg?1497713257 | |
domain_nowww === "sonar.es") { | |
// https://sonarreykjavik.com/system/attached_images/19379/medium/BadGyal_AlexisG%C3%B3mez.jpg?1513685256 | |
// https://sonarreykjavik.com/system/attached_images/19379/large/BadGyal_AlexisG%C3%B3mez.jpg?1513685256 | |
// https://sonarreykjavik.com/system/attached_images/19379/original/BadGyal_AlexisG%C3%B3mez.jpg?1513685256 | |
return src | |
.replace(/(\/attached_images\/+[0-9]+\/+)[a-z]+\/+/, "$1original/") | |
.replace(/(\/(?:system|images)\/+(?:(?:attached|item)_images|App\/+BlogBody|post_pictures|events|posts|items|articles|file_uploads|screenshots|resources|pictures)\/+(?:(?:images|photos|files|assets|pictures|posters|uploads|screenshots|previews|imgs)\/+)?(?:[0-9]{3}\/+){3})[a-z_0-9]+\/+/, "$1original/"); | |
//return src.replace(/(\/system\/(?:post_pictures\/(?:files|assets|pictures)\/|posts\/posters\/|events\/images\/)(?:[0-9]+\/){3})[a-z]+(\/[^/]*)$/, "$1original$2"); | |
//return src.replace(/\/[a-z]*\/([-0-9a-f]*\.[^/.]*)$/, "/original/$1"); | |
//return src.replace(/(\/[0-9]+\/[0-9]+\/[0-9]+)\/[a-z]+\/([^/]*)$/, "$1/original/$2"); | |
//return src.replace("/thumb/", "/original/"); | |
} | |
if (domain === "pgw.udn.com.tw") { | |
// https://pgw.udn.com.tw/gw/photo.php?u=https://uc.udn.com.tw/photo/2016/08/03/99/2447700.jpg&x=0&y=0&sw=0&sh=0&sl=W&fw=750 | |
// https://pgw.udn.com.tw/gw/photo.php?u=https://uc.udn.com.tw/photo/2018/05/16/realtime/4742890.jpg&x=0&y=0&sw=0&sh=0&sl=W&fw=1050&exp=3600 | |
// https://uc.udn.com.tw/photo/2018/05/16/realtime/4742890.jpg | |
return src.replace(/.*\/photo\.php.*?[?&]u=([^&]*).*/, "$1"); | |
} | |
if (domain === "uc.udn.com.tw") { | |
// https://uc.udn.com.tw/photo/2018/05/16/realtime/4742890.jpg -- HEAD returns 404 | |
return { | |
url: src, | |
can_head: false | |
}; | |
} | |
if ((domain_nosub === "hdslb.com" && domain.match(/i[0-9]*\.hdslb\.com/)) || | |
// https://img.xiaohongshu.com/avatar/5b56be0014de415b2db830a6.jpg@160w_160h_92q_1e_1c_1x.jpg | |
// https://img.xiaohongshu.com/avatar/5b56be0014de415b2db830a6.jpg | |
domain === "img.xiaohongshu.com" || | |
// http://alcdn.img.xiaoka.tv/20160708/899/367/44745628/899367337e05da1af210de07ff2740e6.jpg@1e_1c_0o_0l_640h_640w_100q_1pr.jpg | |
// http://alcdn.img.xiaoka.tv/20160708/899/367/44745628/899367337e05da1af210de07ff2740e6.jpg | |
// https://alcdn.img.xiaoka.tv/20161017/a33/379/27774175/a333797899a6aa5d2766de56d58dc7a3.jpg@1e_1c_0o_0l_330h_330w | |
// https://alcdn.img.xiaoka.tv/20161017/a33/379/27774175/a333797899a6aa5d2766de56d58dc7a3.jpg | |
(domain_nosub === "xiaoka.tv" && domain.match(/alcdn\.img\.xiaoka\.tv/))) { | |
// https://i0.hdslb.com/bfs/bangumi/546991a5d3add9b550925b1168abf0a460e5f552.jpg@240w_320h.jpg | |
// https://i2.hdslb.com/bfs/archive/6b1d06f79ec31b6e23e4ecb7eb87c53ccd86f965.jpg@.webp | |
// https://i2.hdslb.com/bfs/archive/6b1d06f79ec31b6e23e4ecb7eb87c53ccd86f965.jpg | |
// http://i0.hdslb.com/320_180/u_user/a5ab2c18e8e4a62240fad3f0b040ba00.jpg | |
// http://i0.hdslb.com/u_user/a5ab2c18e8e4a62240fad3f0b040ba00.jpg | |
return src | |
.replace(/(:\/\/[^/]*\/)[0-9]+_[0-9]+\//, "$1") | |
//.replace(/(\.[^/.]*)@(?:[0-9]*[a-z](?:_[0-9]*[wh])?)?(\.[^/.]*)$/, "$1"); | |
.replace(/(\.[^/.]*)@[_0-9a-z]*(?:\.[^/.]*)?$/, "$1"); | |
} | |
if (domain === "d.ifengimg.com") { | |
// http://d.ifengimg.com/w204_h115/p0.ifengimg.com/pmop/2017/1230/E538B9A1631291D8B1578F161157F26647C97944_size296_w448_h252.png | |
// http://d.ifengimg.com/w600/p0.ifengimg.com/pmop/2017/0726/F4057A55111AE62724AF9C914EFEE425FEBD79C7_size41_w750_h422.jpeg | |
// http://d.ifengimg.com/q100/p0.ifengimg.com/pmop/2017/0726/F4057A55111AE62724AF9C914EFEE425FEBD79C7_size41_w750_h422.jpeg | |
// https://d.ifengimg.com/mw640_q100/y3.ifengimg.com/yidian/2015_46/4321111b2929329_w366_h550.jpg | |
// http://y3.ifengimg.com/yidian/2015_46/4321111b2929329_w366_h550.jpg | |
return src.replace(/.*?\/[a-z]+[0-9]*(?:_[whq][0-9]*)?\//, "http://"); | |
//return src.replace(/(:\/\/[^/]*\/)[wh][0-9]+(?:_[wh][0-9]*)?\//, "$1w0/"); | |
} | |
if (domain === "www.nationalgeographic.com") { | |
// https://www.nationalgeographic.com/content/dam/magazine/rights-exempt/2012/04/unseen-titanic/01-port-bow-titanic-3x2.ngsversion.1492030266842.adapt.1900.1.jpg | |
// https://www.nationalgeographic.com/content/dam/magazine/rights-exempt/2012/04/unseen-titanic/01-port-bow-titanic-3x2.jpg | |
return src.replace(/\.[^/]*(\.[^/.]*)$/, "$1"); | |
} | |
// fixme: find other and merge with it | |
if (domain === "media.mnn.com" || | |
// https://alljapantours.com/places-to-visit-in-japan/most-beautiful-places-in-japan/img/issue_04most_photo01.jpg.pagespeed.ce.woxsyqYnu2.jpg | |
domain_nowww === "alljapantours.com" || | |
// http://shows.gqimg.com.cn/showspic/FashionImages/F2018MEN/paris/louis-vuitton/collection/_VUI0653h.jpg.100X150.jpg | |
domain === "shows.gqimg.com.cn" || | |
// http://shows.vogueimg.com.cn/showspic/FashionImages/S2017CTR/paris/alexandre-vauthier/collection/_ARC0726h.jpg.100X150.jpg | |
domain === "shows.vogueimg.com.cn" || | |
// https://smedia.webcollage.net/rwvfp/wc/cp/22757735/module/cpwalmart/_cp/products/1472244742078/tab-0e3f8313-5e4d-4103-9de5-caca68cf8437/eaddf5d5-afe7-4086-9bc7-149b6b486cdd.jpg.w480.jpg | |
// https://media3.webcollage.net/a8d14734c22ff05fcb5aa464bcde656048f8ec9b?response-content-type=image%2Fjpeg&AWSAccessKeyId=AKIAIIE5CHZ4PRWSLYKQ&Expires=1893510561&Signature=eqN507piWJYrWEhhc72wNlKeaao%3D | |
// https://smedia.webcollage.net/rwvfp/wc/cp/22757735/module/cpwalmart/_cp/products/1472244742078/tab-0e3f8313-5e4d-4103-9de5-caca68cf8437/eaddf5d5-afe7-4086-9bc7-149b6b486cdd.jpg | |
// https://media3.webcollage.net/0ddf5fd70a8e0511dcd624ae9620bae32ae1ca4b?response-content-type=image%2Fjpeg&AWSAccessKeyId=AKIAIIE5CHZ4PRWSLYKQ&Expires=1893509612&Signature=cb7UbzZXRXb4S%2BLblX1crSDyOB0%3D | |
(domain_nosub === "webcollage.net" && domain.indexOf("media.webcollage.net") >= 0) || | |
// http://www.metronews.ca/content/dam/thestar/uploads/2017/3/29/oilers.jpg.size.xxlarge.promo.jpg | |
domain_nowww === "metronews.ca" || | |
// https://images.meredith.com/content/dam/bhg/Images/life-in-color/arnold%20gian.jpg.rendition.largest.jpg | |
domain === "images.meredith.com" || | |
// http://img-cdn.jg.jugem.jp/584/719314/20131206_802590.jpg.thumb.jpg | |
domain === "img-cdn.jg.jugem.jp" || | |
// http://anime-thai.net/bbs/data/attachment/album/201405/22/171403xnhmbbh70bx5kp47.jpg.thumb.jpg | |
domain_nowww === "anime-thai.net" || | |
// https://www.mymypic.net/data/attachment/forum/201903/15/1709395e0xsg17jxi0x1g9.jpg.thumb.jpg | |
domain_nowww === "mymypic.net" || | |
// http://styleyen.com/galleries/6/image_slide/2/taylor-swift-bangs.jpg.thumb_200_width.jpg | |
domain_nowww === "styleyen.com" || | |
// http://www.nbstr.org/sitebuildercontent/sitebuilderpictures/webassets/hercules.jpg.w300h300.jpg | |
domain_nowww === "nbstr.org" || | |
// https://dyn0.media.forbiddenplanet.com/products/201226.jpg.maxheight-285_square-true_size-285.jpg | |
(domain_nosub === "forbiddenplanet.com" && domain.match(/^dyn[0-9]*\.media\.forbiddenplanet\.com/)) || | |
// https://media.treehugger.com/assets/images/2018/02/16300451622_c972b01dae_b_1.jpg.860x0_q70_crop-smart.jpg | |
domain === "media.treehugger.com" || | |
// https://attitude.co.uk/media/images/2018/01/rise-series-order-nbc.jpg.750x400_q85_box-0%2C27%2C650%2C373_crop_detail.jpg | |
(domain_nowww === "attitude.co.uk" && src.indexOf("/media/images/") >= 0) || | |
// http://media.allyou.net/2/28690/images/7918324/MarieClaire-72.jpg.5000x640_q90.jpg | |
domain === "media.allyou.net" || | |
// https://image.pbs.org/poster_images/assets/IcebergCultureBlank_JPEG1.jpg.resize.710x399.jpg | |
domain === "image.pbs.org" || | |
// http://plasticsurgerystar.com/images/measurements2/jennifer-lawrence-body-height-weight-bra-size/jennifer-lawrence-weight.jpg.thumb_100_width.jpg | |
(domain_nowww === "plasticsurgerystar.com" && src.indexOf("/images/") >= 0) || | |
// http://www.peoplite.com/public/album_photo/e7/23/02/71fbf88a7a3d6ee2d1ff7cca9a1fd736.jpg.pagespeed.ce.SiSZg6-g3I.jpg | |
// http://www.peoplite.com/public/album_photo/e7/23/02/71fbf88a7a3d6ee2d1ff7cca9a1fd736.jpg | |
(domain_nowww === "peoplite.com" && src.indexOf("/public/album_photo/") >= 0) || | |
// https://cdn.admireme.vip/media/cdeecc80-7cf7-4083-9e2e-9690ad143432.jpg.288x288_q85_crop_upscale.jpg | |
(domain === "cdn.admireme.vip" && src.indexOf("/media/") >= 0) || | |
// https://estaticos.globoradio.globo.com/fotos/2019/05/6311f398-e2fb-4267-8cbb-2adba1dae8eb.jpg.640x360_q75_box-0%2C0%2C1024%2C576_crop_detail.jpg | |
// https://estaticos.globoradio.globo.com/fotos/2019/05/6311f398-e2fb-4267-8cbb-2adba1dae8eb.jpg | |
(domain_nosub === "globo.com" && src.indexOf("/fotos/") >= 0) || | |
// https://d26oc3sg82pgk3.cloudfront.net/files/media/uploads/zinnia/2017/08/22/0824-felicity-jones_cred_shutterstock-featureflash-photo-agency.jpg.644x420_q100.jpg | |
// https://d26oc3sg82pgk3.cloudfront.net/files/media/uploads/zinnia/2017/08/22/0824-felicity-jones_cred_shutterstock-featureflash-photo-agency.jpg | |
domain === "d26oc3sg82pgk3.cloudfront.net" || | |
// https://memberme.net/media/creator/creators/d60239d1-4877-445c-913a-4cc837875214.jpg.300x300_q85_crop-50%2C%2050_detail_upscale.jpg | |
(domain_nowww === "memberme.net" && src.indexOf("/media/") >= 0) || | |
// https://funasia.net/site_media/coverphoto/7aef660a-9d55-4f48-a75f-4b500f821312.jpg.260x0_q85.jpg | |
(domain_nowww === "funasia.net" && src.indexOf("/site_media/") >= 0) || | |
// https://image.photocnc.com/photocnc/2019-06/21/201906210455231280.jpg.h200.jpg | |
domain === "image.photocnc.com" || | |
// https://d53l9d6fqlxs2.cloudfront.net/photos/41/41127-tokyos-tak.jpg.660x0_q80_crop-scale_upscale.jpg | |
// https://d53l9d6fqlxs2.cloudfront.net/photos/41/41127-tokyos-tak.jpg | |
domain === "d53l9d6fqlxs2.cloudfront.net") { | |
// https://media.mnn.com/assets/images/2017/03/cyclops-2-titanic-wreck.jpg.653x0_q80_crop-smart.jpg | |
// https://media.mnn.com/assets/images/2017/03/cyclops-2-titanic-wreck.jpg | |
newsrc = src.replace(/(\/[^/.]*\.[^/.]*)\.[^/]*$/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "media.contentapi.ea.com") { | |
// https://media.contentapi.ea.com/content/dam/ea/dragonage/inquisition-refresh/videos/2018/01/90614bfc-1566-7230-3359-3ea9a1f39577.youtube/subassets/poster.jpg.adapt.crop16x9.1920w.jpg | |
// https://media.contentapi.ea.com/content/dam/ea/dragonage/inquisition-refresh/videos/2018/01/90614bfc-1566-7230-3359-3ea9a1f39577.youtube/subassets/poster.jpg | |
// https://media.contentapi.ea.com/content/dam/ea/dragonage/inquisition-refresh/images/2018/01/ea-hero-medium-dai-homepage-7x2-xl.jpg.adapt.crop3x5.320w.jpg | |
// https://media.contentapi.ea.com/content/dam/ea/dragonage/inquisition-refresh/images/2018/01/ea-hero-medium-dai-homepage-7x2-xl.jpg | |
newsrc = src.replace(/(\/[^/.]*\.[^/.]*)\.[^/]*$/, "$1"); | |
if (newsrc !== src) | |
return { | |
url: newsrc, | |
can_head: false | |
}; | |
} | |
if (domain === "img.bleacherreport.net") { | |
// https://img.bleacherreport.net/cms/media/image/fa/2f/08/6e/dfb9/4c1f/b030/48ba951160bd/crop_exact_USATSI_10579599.jpg?w=460&h=259&q=75 | |
// https://img.bleacherreport.net/cms/media/image/fa/2f/08/6e/dfb9/4c1f/b030/48ba951160bd/USATSI_10579599.jpg?w=999999999999&h=999999999999 | |
return src | |
.replace(/\/crop_exact_([^/]*)$/, "/$1") | |
.replace(/\?.*$/, "?w=999999999999&h=999999999999"); | |
} | |
if (domain === "images.gr-assets.com") { | |
// https://images.gr-assets.com/books/1403200898m/7923163.jpg | |
// https://images.gr-assets.com/authors/1281489919p2/3443203.jpg | |
// https://images.gr-assets.com/users/1268072620p2/1668975.jpg | |
return src | |
.replace(/(\/(?:authors|users)\/[0-9]*p)[0-9]\//, "$18/") | |
.replace(/(\/books\/[0-9]*)[a-z]\//, "$1l/"); | |
} | |
if (domain === "dynamic.indigoimages.ca") { | |
// https://dynamic.indigoimages.ca/books/1506701655.jpg?altimages=false&scaleup=true&maxheight=515&width=380&quality=85&sale=0&lang=en | |
// https://dynamic.indigoimages.ca/books/1506701655.jpg?width=999999999 | |
return src.replace(/(\?.*)?$/, "?width=999999999"); | |
} | |
if (domain === "cdn.mos.cms.futurecdn.net") { | |
// https://cdn.mos.cms.futurecdn.net/wtXpUq7DAuPqftGRshxtzD-650-80.jpg | |
// https://cdn.mos.cms.futurecdn.net/wtXpUq7DAuPqftGRshxtzD.jpg | |
return src.replace(/-[0-9]+-[0-9]+(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "www.allkpop.com") { | |
// https://www.allkpop.com/upload/2018/02/af/12101614/clc.jpg | |
// https://www.allkpop.com/upload/2018/02/af_org/12101614/clc.jpg | |
return src.replace(/\/af\/([0-9]*\/[^/]*)$/, "/af_org/$1"); | |
} | |
if (domain === "cwcontent.asiae.co.kr") { | |
return src | |
//.replace(/\/amgimagelink\/[0-9]*\//, "/amgimagelink/0/") | |
.replace(/^(.*?:\/\/).*\/[^/]*resize\/[0-9]*\/([^/]*)$/, "$1cphoto.asiae.co.kr/listimglink/4/$2"); | |
// http://cwcontent.asiae.co.kr/stooresize/32/2018020812382111881_1518061101.jpg | |
// http://cwcontent.asiae.co.kr/stooresize/28/2018020812382111881_1518061101.jpg | |
// http://cphoto.asiae.co.kr/listimglink/7/2018020812382111881_1518061101.jpg | |
// http://cphoto.asiae.co.kr/listimglink/4/2018020812382111881_1518061101.jpg - max | |
// http://cwcontent.asiae.co.kr/amgimagelink/98/2018020408443101207A_1.jpg | |
// http://cphoto.asiae.co.kr/listimglink/4/201110161718307486692A_1.jpg - different | |
// http://cwcontent.asiae.co.kr/asiaresize/80/2018021210005919425_1518397258.jpg | |
// http://cwcontent.asiae.co.kr/asiaresize/113/2018021210005919425_1518397258.jpg | |
// http://cwcontent.asiae.co.kr/asiaresize/132/2018021210005919425_1518397258.jpg | |
// http://cphoto.asiae.co.kr/listimglink/4/2018021210005919425_1518397258.jpg - max, same as above | |
// http://cwcontent.asiae.co.kr/asiaresize/103/2018021210300316119_2.jpg | |
// http://cphoto.asiae.co.kr/listimglink/4/2018021210300316119_2.jpg - doesn't work | |
// http://cphoto.asiae.co.kr/listimglink/4/2018021210291519546_1518398953.jpg - proper | |
// http://cwcontent.asiae.co.kr/amgimagelink/98/2018031311511632721A_1.jpg -- not | |
// http://cwcontent.asiae.co.kr/amgimagelink/0/2018031311511632721A_1.jpg -- gif | |
// http://cwcontent.asiae.co.kr/listimglink/4/2018031311511632721A_1.jpg -- doesn't work | |
// http://cwcontent.asiae.co.kr/amgimagelink/98/2017092915472067985A_1.jpg -- not | |
// http://cwcontent.asiae.co.kr/amgimagelink/0/2017092915472067985A_1.jpg -- gif?? | |
// http://cwcontent.asiae.co.kr/listimglink/4/2017092915472067985A_1.jpg -- doesn't work | |
// http://cwcontent.asiae.co.kr/amgimagelink/0/201411151911520388001A_1.jpg -- watermark | |
// http://cwcontent.asiae.co.kr/listimglink/4/201411151911520388001A_1.jpg -- without | |
// http://cphoto.asiae.co.kr/listimglink/4/2016051308263757999_1.jpg | |
// http://cwcontent.asiae.co.kr/amgimagelink/0/2016051308263757999_1.jpg -- smaller | |
// http://cwcontent.asiae.co.kr/amgimagelink/0/2016051308263757999_1.jpg -- slightly larger | |
// http://cwcontent.asiae.co.kr/stooresize/33/2018031311332188690A_1.jpg | |
// http://cphoto.asiae.co.kr/listimglink/4/2018031311332188690A_1.jpg -- content length: 0 | |
// http://cwcontent.asiae.co.kr/amgimagelink/0/2018031311332188690A_1.jpg -- proper | |
// http://cwcontent.asiae.co.kr/amgimagelink/0/2018030609164136390A_1.jpg -- 540x607 | |
// http://cwcontent.asiae.co.kr/amgimagelink/98/2018030609164136390A_1.jpg -- 1080x1215 | |
// http://cwcontent.asiae.co.kr/amgimagelink/0/2014091709013891379_1.jpg -- 540x379 | |
// http://cwcontent.asiae.co.kr/listimglink/4/2014091709013891379_1.jpg -- larger (885x623) | |
// http://cwcontent.asiae.co.kr/amgimagelink/98/201410202126598761515A_1.jpg | |
// http://cphoto.asiae.co.kr/listimglink/4/201410202126598761515A_1.jpg -- same size, without watermark | |
// http://wcontent.asiaeconomy.co.kr/amgimage_link.htm?idx=0&no=2008090309143458665_1.jpg | |
// http://photo.asiae.co.kr/listimg_link.php?idx=2&no=2018031212153472858_1520824535.jpg | |
// http://cwstoo.asiae.co.kr/freeimg_get.htm?img=1371 -- download | |
// resize: | |
// 28, 1, 20, 16, 3, 34, 18, 9, 35, 13, 21, 24, 39, 7, 15, 2, 23, 44, 11, 5, 22, 30, 4, 6, 25, 40, 8, 36, 47, 27, 48, 43, 46, 33, 17, 38, 41, 37, 14, 32, 45, 42, 31, 26, 12, 29, 10, 19 | |
// listimglink: | |
// (4, 5 [=download]), 7, 6, 2, 3 | |
// amgimagelink: | |
// (98, 12, 0), 11, 3, 14, 10, 4 | |
} | |
if (domain === "cphoto.asiae.co.kr") { | |
// http://cphoto.asiae.co.kr/listimglink/4/2015101609215433891_1.jpg - 2598x3354 | |
// http://cphoto.asiae.co.kr/listimg_link.php?idx=3&no=2010070915075405717_2.jpg | |
// http://cphoto.asiae.co.kr/listimg_link.php?idx=4&no=2010070915075405717_2.jpg | |
// http://cphoto.asiae.co.kr/resizeimglink/2/201012011609040182464A_1.jpg | |
// http://cphoto.asiae.co.kr/listimglink/4/201012011609040182464A_1.jpg | |
return src | |
.replace(/\/listimglink\/[0-9]*\//, "/listimglink/4/") | |
.replace(/\/resizeimglink\/[0-9]*\//, "/listimglink/4/") | |
.replace(/\/listimg_link\.php.*?[?&]no=([^&]*).*?$/, "/listimg_link.php?idx=4&no=$1"); | |
} | |
if (domain === "thumbs-prod.si-cdn.com") { | |
// https://thumbs-prod.si-cdn.com/eoEYA_2Hau4795uKoecUZZgz-3w=/800x600/filters:no_upscale()/https://public-media.smithsonianmag.com/filer/52/f9/52f93262-c29b-4a4f-b031-0c7ad145ed5f/42-33051942.jpg | |
// https://public-media.smithsonianmag.com/filer/52/f9/52f93262-c29b-4a4f-b031-0c7ad145ed5f/42-33051942.jpg | |
return src.replace(/.*\/(https?:\/\/)/, "$1"); | |
} | |
if (domain === "assets.atlasobscura.com") { | |
// https://assets.atlasobscura.com/article_images/800x/17628/image.jpg | |
// https://assets.atlasobscura.com/article_images/17628/image.jpg | |
return src.replace(/\/article_images\/[0-9]*x\//, "/article_images/"); | |
} | |
if (domain_nowww === "wonderopolis.org" && src.indexOf("/_img") >= 0) { | |
// https://wonderopolis.org/_img?img=/wp-content/uploads/2012/01/squirell_shutterstock_6383917.jpg&transform=resizeCrop,720,450 | |
// https://wonderopolis.org/_img?img=/wp-content/uploads/2012/01/squirell_shutterstock_6383917.jpg | |
// https://www.wonderopolis.org/wp-content/uploads/2012/01/squirell_shutterstock_6383917.jpg | |
newsrc = src.replace(/\/_img\?(?:.*&)?(img=[^&]*).*/, "/_img?$1"); | |
if (newsrc !== src) | |
return newsrc; | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+_img\?img=([^&]*).*?$/, "$1"); | |
if (newsrc !== src) | |
return urljoin(src, newsrc, true); | |
} | |
if (domain_nowww === "thehindu.com" || | |
domain_nowww === "gloria.hr" || | |
// http://i4.mirror.co.uk/incoming/article1323853.ece/ALTERNATES/s1227b/Sky%20Sports%20news%20female%20presenters | |
// http://i4.mirror.co.uk/incoming/article1323853.ece/BINARY/Sky%20Sports%20news%20female%20presenters | |
((domain_nosub === "mirror.co.uk" || | |
// https://i2-prod.birminghammail.co.uk/incoming/article15152252.ece/ALTERNATES/s615/2_NWP_BEM_130918Bailey01JPG.jpg | |
// https://i2-prod.birminghammail.co.uk/incoming/article15152252.ece/BINARY/2_NWP_BEM_130918Bailey01JPG.jpg | |
domain_nosub === "birminghammail.co.uk" || | |
// https://i2-prod.dailypost.co.uk/incoming/article15148144.ece/BINARY/2_Joint-owner-Jules-Peters-has-opened-a-new-coffee-shop-called-Haus-on-Penrhyn-Road-Colwyn-Bay-Image.jpg | |
// https://i2-prod.dailypost.co.uk/incoming/article15148144.ece/BINARY/2_Joint-owner-Jules-Peters-has-opened-a-new-coffee-shop-called-Haus-on-Penrhyn-Road-Colwyn-Bay-Image.jpg | |
domain_nosub === "dailypost.co.uk" || | |
// https://i2-prod.bristolpost.co.uk/incoming/article1628442.ece/ALTERNATES/s615/BristolMagsCourtPNG.png | |
// https://i2-prod.bristolpost.co.uk/incoming/article1628442.ece/BINARY/BristolMagsCourtPNG.png | |
domain_nosub === "bristolpost.co.uk" || | |
// https://i2-prod.irishmirror.ie/incoming/article8862957.ece/ALTERNATES/s615b/abb08375.jpg | |
// https://i2-prod.irishmirror.ie/incoming/article8862957.ece/BINARY/abb08375.jpg | |
// https://i2-prod.irishmirror.ie/incoming/article12859145.ece/ALTERNATES/s615b/0_Holly-Willoughby.jpg | |
// https://i2-prod.irishmirror.ie/incoming/article12859145.ece/BINARY/0_Holly-Willoughby.jpg -- head is 403, but works | |
domain_nosub === "irishmirror.ie" || | |
// https://i2-prod.coventrytelegraph.net/incoming/article14083906.ece/ALTERNATES/s1200/Davina-McCall-1.jpg | |
// https://i2-prod.coventrytelegraph.net/incoming/article14083906.ece/BINARY/Davina-McCall-1.jpg | |
domain_nosub === "coventrytelegraph.net" || | |
// https://i2-prod.dublinlive.ie/incoming/article14444188.ece/ALTERNATES/s458/CC-METRO-FIRE190393751.jpg | |
// https://i2-prod.dublinlive.ie/incoming/article14444188.ece/BINARY/CC-METRO-FIRE190393751.jpg | |
domain_nosub === "dublinlive.ie") && | |
domain.match(/i[0-9]*(?:-prod)?\./)) || | |
// https://www.mirror.co.uk/incoming/article1323853.ece/ALTERNATES/s1227b/Sky%20Sports%20news%20female%20presenters -- upscaled? | |
// https://www.mirror.co.uk/incoming/article1323853.ece/BINARY/Sky%20Sports%20news%20female%20presenters | |
domain_nowww === "mirror.co.uk" || | |
// https://beta.images.theglobeandmail.com/76a/sports/hockey/article38351471.ece/ALTERNATES/w620/web-sp-hk-senators-0326.JPG | |
// https://beta.images.theglobeandmail.com/339/sports/article34852751.ece/BINARY/w620/hk-moss28sp3.JPG | |
domain === "beta.images.theglobeandmail.com" || | |
// http://www.globalblue.com/destinations/uk/london/article288436.ece/alternates/LANDSCAPE2_970/cara_delevingne_rochas.jpg -- upscaled? | |
// https://www.globalblue.com/destinations/uk/london/article288436.ece/BINARY/cara_delevingne_rochas.jpg | |
domain_nowww === "globalblue.com" || | |
// https://cdn-04.belfasttelegraph.co.uk/entertainment/film-tv/news/article36669885.ece/ALTERNATES/w620/bpanews_d1dbd5df-f462-4575-86fd-ef234930e632_embedded235347559 | |
// https://cdn-04.belfasttelegraph.co.uk/entertainment/film-tv/news/article36669885.ece/BINARY/bpanews_d1dbd5df-f462-4575-86fd-ef234930e632_embedded235347559 | |
// https://www.belfasttelegraph.co.uk/migration_catalog/article25788206.ece/ALTERNATES/h342/SamanthaMumba | |
(domain_nosub === "belfasttelegraph.co.uk" && domain.match(/^(?:cdn(-[0-9]+)?|www)\./)) || | |
// http://www.ladylike.gr/articles/galleries/photostories/article2773870.ece/ALTERNATES/w60/olsen.jpg | |
// http://www.ladylike.gr/articles/galleries/photostories/article2773872.ece/BINARY/original/Rihanna.jpg | |
// http://www.ladylike.gr/articles/galleries/photostories/article2773872.ece/BINARY/Rihanna.jpg -- same | |
domain_nowww === "ladylike.gr" || | |
// http://www.24horas.cl/incoming/iceberg-en-groenlandia-2764254/ALTERNATES/w620h350/iceberg%20en%20Groenlandia | |
// http://www.24horas.cl/incoming/iceberg-en-groenlandia-2764254/BINARY/iceberg%20en%20Groenlandia | |
domain_nowww === "24horas.cl" || | |
// https://www.jyllands-posten.dk/pictures/image/10752571/qz36h4/ALTERNATES/g-5_3/innarsuit | |
domain_nowww === "jyllands-posten.dk" || | |
// https://www.svtstatic.se/image-cms/svtse/1531589739/nyheter/article18662486.svt/alternates/large/180714-gronlandisberg-715344-a001nh-jpg | |
// https://www.svtstatic.se/image-cms/svtse/1531589739/nyheter/article18662486.svt/BINARY/180714-gronlandisberg-715344-a001nh-jpg | |
domain_nowww === "svtstatic.se" || | |
// https://www.adressa.no/incoming/article17124160.ece/9r0lq0/ALTERNATES/w980-default/td0459ed.jpg | |
domain_nowww === "adressa.no" || | |
// https://www.miamiherald.com/entertainment/celebrities/b166pq/picture149952302/alternates/FREE_1140/cabello | |
// https://www.miamiherald.com/entertainment/celebrities/b166pq/picture149952302/BINARY/cabello -- 403 HEAD, but fine with GET | |
domain_nowww === "miamiherald.com" || | |
// https://www.filmweb.no/bilder/migration_catalog/article583908.ece/representations/w1500/Megan%20Fox%20i%20Transformers | |
// https://www.filmweb.no/bilder/migration_catalog/article583908.ece/BINARY/Megan%20Fox%20i%20Transformers | |
domain_nowww === "filmweb.no" || | |
// https://www.kansascity.com/entertainment/movies-news-reviews/14x5cd/picture115119338/alternates/FREE_1140/edge%20of%20seventeen(2) | |
// https://www.kansascity.com/entertainment/movies-news-reviews/14x5cd/picture115119338/BINARY/edge%20of%20seventeen(2) | |
domain_nowww === "kansascity.com" || | |
// https://www.sanluisobispo.com/entertainment/movies-news-reviews/i9fla8/picture189785229/alternates/LANDSCAPE_160/COVER%201%20Zac%20Efron | |
// https://www.sanluisobispo.com/entertainment/movies-news-reviews/i9fla8/picture189785229/BINARY/COVER%201%20Zac%20Efron | |
domain_nowww === "sanluisobispo.com" || | |
// https://www.star-telegram.com/living/home-garden/neil-sperry/bfdn9z/picture162479848/alternates/FREE_1140/Photo%202%20Arch%20adds%20more%20curves%20to%20Sperry%20landscape.%20Walk%20stones%20made%20at%20home | |
domain_nowww === "star-telegram.com" || | |
// thanks to heptal on github (#83) | |
// https://sportske.jutarnji.hr/incoming/dalic_moskva_pletikosajpg/9013841/alternates/FREE_680/Dalic_Moskva_pletikosa.jpg | |
// https://sportske.jutarnji.hr/incoming/dalic_moskva_pletikosajpg/9013841/alternates/BASE_FREE/Dalic_Moskva_pletikosa.jpg -- 1180x786 | |
// https://sportske.jutarnji.hr/incoming/dalic_moskva_pletikosajpg/9013841/BINARY/Dalic_Moskva_pletikosa.jpg -- 2048x1365 | |
// https://www.jutarnji.hr/incoming/davorin_rudolf1-220316jpg/6319624/ALTERNATES/LANDSCAPE_380/davorin_rudolf1-220316.jpg | |
// https://www.jutarnji.hr/incoming/davorin_rudolf1-220316jpg/6319624/BINARY/davorin_rudolf1-220316.jpg | |
domain_nosub === "jutarnji.hr" || | |
// https://www.oneman.gr/gynaikes/special_edition/article5512371.ece/ALTERNATES/w300/Eurovision1.jpg | |
// https://www.oneman.gr/gynaikes/special_edition/article5512371.ece/BINARY/Eurovision1.jpg | |
domain_nowww === "oneman.gr" || | |
// https://th.thgim.com/migration_catalog/article10518620.ece/alternates/FREE_660/15mar_TCJPPHI-k+MA16_KERALA.jpg.jpg | |
// https://th.thgim.com/migration_catalog/article10518620.ece/BINARY/15mar_TCJPPHI-k+MA16_KERALA.jpg.jpg | |
domain_nowww === "th.thgim.com" || | |
// https://www.thehindubusinessline.com/opinion/6hdv46/article27406353.ece/ALTERNATES/LANDSCAPE_1200/SMRITI | |
domain_nowww === "thehindubusinessline.com" || | |
// https://d30fl32nd2baj9.cloudfront.net/media/2019/05/03/tundra-landscape.jpg/ALTERNATES/w640/tundra-landscape.jpg | |
// https://d30fl32nd2baj9.cloudfront.net/media/2019/05/03/tundra-landscape.jpg/BINARY/tundra-landscape.jpg | |
domain === "d30fl32nd2baj9.cloudfront.net" || | |
src.match(/\/(?:article[0-9]+\.(?:ece|svt)|[0-9a-z]+\/+picture[0-9]{4,})\/+(?:[^/]*\/)?alternates\//i) || | |
src.match(/:\/\/i[0-9]*(?:-prod)?\..*\/article[^/]*\.(?:ece|svt)\//i) || | |
// https://www.independent.ie/world-news/article37114917.ece/ALTERNATES/h342/ipanews_2350b658-06c1-4a29-b747-cbfdcd1b624c_1 | |
// https://www.independent.ie/world-news/article37114917.ece/BINARY/ipanews_2350b658-06c1-4a29-b747-cbfdcd1b624c_1 | |
// https://cdn-01.independent.ie/incoming/article35675982.ece/70a4f/AUTOCROP/w940/675787992.jpg | |
// https://cdn-01.independent.ie/incoming/article35675982.ece/70a4f/BINARY/675787992.jpg | |
domain_nosub === "independent.ie") { | |
// http://www.thehindu.com/migration_catalog/article14926809.ece/alternates/FREE_660/30MPSQUIRREL | |
// http://www.thehindu.com/migration_catalog/article14926809.ece/alternates/FREE_960/30MPSQUIRREL | |
// http://www.thehindu.com/migration_catalog/article14926809.ece | |
// http://www.thehindu.com/news/national/kerala/article22745555.ece/alternates/LANDSCAPE_100/Priya | |
// http://www.thehindu.com/news/national/kerala/article22745555.ece/alternates/FREE_460/Priya | |
// https://i2-prod.mirror.co.uk/incoming/article7024597.ece/ALTERNATES/s615/PAY-Three-cute-squirrels-CUDDLING.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article236507.ece/ALTERNATES/s615/FA8A36EC-B0C4-D13B-383835E6F08D4428.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article11181827.ece/ALTERNATES/s615b/PROD-JRP_LEC_140117lsquirral_002JPG.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article11691534.ece/ALTERNATES/s1227b/PAY-SQUIRREL-AND-BIRD.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article11691532.ece/ALTERNATES/s1227b/PAY-SQUIRREL-AND-BIRD.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article5603898.ece/ALTERNATES/s1200/PAY-Squirrels.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article11263183.ece/ALTERNATES/s1168v/VIDEO-SQUIRREL.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article12021721.ece/ALTERNATES/s1176b/MGP_MDG_1302182281JPG.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article12021243.ece/ALTERNATES/s270b/MAIN-paddy.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article8949472.ece/ALTERNATES/s270b/National-Lottery-Euromillions-ticket.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article8949472.ece/ALTERNATES/s810/National-Lottery-Euromillions-ticket.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article12021158.ece/ALTERNATES/s508/RIP-Pizza-Express-give-away-free-meals-to-certain-customers-who-do-this-one-thing.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article12021158.ece/ALTERNATES/s615/RIP-Pizza-Express-give-away-free-meals-to-certain-customers-who-do-this-one-thing.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article12021158.ece/ALTERNATES/s810/RIP-Pizza-Express-give-away-free-meals-to-certain-customers-who-do-this-one-thing.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article12021158.ece/ALTERNATES/s1200/RIP-Pizza-Express-give-away-free-meals-to-certain-customers-who-do-this-one-thing.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article4997473.ece/ALTERNATES/s298/Actress-Felicity-Jones.jpg | |
// http://www.dailymirror.lk/article/Rare-albino-squirrel-posing-in-his-white-suit--126748.html | |
// http://static.dailymirror.lk/media/images/image_1491276569-ba3932b3dc.jpg | |
// http://static.dailymirror.lk/media/images/image_1491276584-77a6a42e37.jpg | |
// http://static.dailymirror.lk/media/images/image_1491276594-bc6ed40255.jpg | |
// https://i2-prod.birminghammail.co.uk/news/midlands-news/article8438687.ece/ALTERNATES/s615b/Felicity-Jones-The-Worst-Witch.jpg | |
// https://i2-prod.birminghammail.co.uk/news/midlands-news/article8438687.ece/BINARY/Felicity-Jones-The-Worst-Witch.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article9801836.ece/ALTERNATES/s810/SUNDAYPEOPLE-PROD-Tara-Palmer-Tomkinson.jpg | |
// https://i2-prod.mirror.co.uk/incoming/article7009917.ece/BINARY/CS85701845-1.png | |
// https://i2-prod.dailypost.co.uk/incoming/article12849370.ece/binary/BigBubble.jpg | |
// https://i2-prod.bristolpost.co.uk/incoming/article1143957.ece/BINARY/Elise-Britten-profile-pic-square.jpg | |
// https://www.gloria.hr/moda/novosti/naomicampbell01jpg/6949668/alternates/FREE_580/NaomiCampbell01.jpg | |
// doesn't work for all: | |
// https://www.inforum.com/entertainment/article542555.ece/alternates/BASE_LANDSCAPE/Herbs%20like%20dill%20can%20make%20a%20nice%20addition%20to%20an%20edible%20landscape.%20%20Photo%20special%20to%20The%20Forum.%20 | |
// https://www.inforum.com/entertainment/article542555.ece/BINARY/Herbs%20like%20dill%20can%20make%20a%20nice%20addition%20to%20an%20edible%20landscape.%20%20Photo%20special%20to%20The%20Forum.%20 -- 404 | |
// https://www.fccnn.com/incoming/886099-A-row-of-wind-turbines-towers-over-the-landscape-near-Edgeley-N.D.-in-this-file-photo.-Darren-Gibbins-Forum-News-Service/alternates/BASE_LANDSCAPE/A%20row%20of%20wind%20turbines%20towers%20over%20the%20landscape%20near%20Edgeley%2C%20N.D.%20Darren%20Gibbins%20%20Forum%20News%20Service | |
// https://www.fccnn.com/incoming/886099-A-row-of-wind-turbines-towers-over-the-landscape-near-Edgeley-N.D.-in-this-file-photo.-Darren-Gibbins-Forum-News-Service/BINARY/A%20row%20of%20wind%20turbines%20towers%20over%20the%20landscape%20near%20Edgeley%2C%20N.D.%20Darren%20Gibbins%20%20Forum%20News%20Service -- 404, similar layout to above? | |
//return src.replace(/(\/article[0-9]*\.ece\/.*?)(?:alternates|ALTERNATES|AUTOCROP|autocrop)\/[^/]*\//, "$1BINARY/"); | |
newsrc = src.replace(/(?:alternates|autocrop|binary)\/+[^/]*\/+([^/]*)$/i, "BINARY/$1"); | |
if (newsrc !== src) | |
return newsrc; | |
newsrc = src.replace(/\/representations\/+[^/]*\/+([^/]*)(?:[?#].*)?$/i, "/BINARY/$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nowww === "ekstrabladet.dk") { | |
// https://ekstrabladet.dk/incoming/urkamg/6524751/IMAGE_ALTERNATES/relationSmall_150/reality-awards | |
// https://ekstrabladet.dk/incoming/urkamg/6524751/IMAGE_BINARY/original/reality-awards | |
return src.replace(/\/IMAGE_ALTERNATES\/+[^/]*\/+/, "/IMAGE_BINARY/original/"); | |
} | |
if (domain === "images.fandango.com" || | |
// http://www.statf.com/ImageRenderer/0/0/redesign/static/img/default_poster.png/0/images/masterrepository/other/INTRO-1_Getty_139033234.jpg | |
// http://www.statf.com/images/masterrepository/other/INTRO-1_Getty_139033234.jpg | |
domain_nowww === "statf.com") { | |
// no noticeable change though | |
// https://images.fandango.com/ImageRenderer/0/0/redesign/static/img/default_poster.png/0/images/masterrepository/performer%20images/p237485/thetempest2010-mv-19.jpg | |
// https://images.fandango.com/images/masterrepository/performer%20images/p237485/thetempest2010-mv-19.jpg | |
// http://images.fandango.com/ImageRenderer/0/0/redesign/static/img/default_poster.png/0/images/masterrepository/performer%20images/p237485/felicityjones-cheri-7.jpg | |
// http://images.fandango.com/images/masterrepository/performer%20images/p237485/felicityjones-cheri-7.jpg | |
newsrc = src.replace(/\/ImageRenderer\/.*?\/images\//, "/images/"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "images.fandango.com") { | |
// http://images.fandango.com/mdcsite/images/featured/201612/felicity-jones-rogue-one_188x188.jpg | |
// http://images.fandango.com/mdcsite/images/featured/201612/felicity-jones-rogue-one.jpg | |
return src.replace(/_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1"); | |
} | |
if (amazon_container === "assets.forward.com") { | |
// https://s3.amazonaws.com/assets.forward.com/images/cropped/gettyimages-655344102-1500478034.jpg | |
// http://assets.forward.com/images/gettyimages-655344102-1500478034.jpg | |
return src.replace(/.*:\/\/[^/]*\//, "http://"); | |
} | |
if (domain === "assets.forward.com" || | |
// https://assets.forwardcdn.com/images/cropped/1020-5-1524514529.jpeg | |
// https://assets.forwardcdn.com/images/1020-5-1524514529.jpeg | |
domain === "assets.forwardcdn.com") { | |
// http://assets.forward.com/images/cropped/gettyimages-655344102-1500478034.jpg | |
// http://assets.forward.com/images/gettyimages-655344102-1500478034.jpg | |
return src.replace(/\/images\/cropped\//, "/images/"); | |
} | |
if (domain === "www.thejewelleryeditor.com") { | |
// http://www.thejewelleryeditor.com/media/images_thumbnails/filer_public_thumbnails/old/21228/Felicity-Jones-Finch-Oscars-2013.jpg__1536x0_q75_crop-scale_subsampling-2_upscale-false.jpg - stretched | |
// http://www.thejewelleryeditor.com/media/images/old/21228/Felicity-Jones-Finch-Oscars-2013.jpg | |
return src.replace(/\/images_thumbnails\/[^/]*_thumbnails\/([^/]*\/[0-9]*\/[^/.]*\.[^_/.]*)__[^/]*$/, "/images/$1"); | |
} | |
if (domain_nowww === "sass.com.ua") { | |
// https://sass.com.ua/static/media/public_thumbnails/public/2017/11/11/03.jpg__1024x1024_q85_subsampling-2.jpg | |
// https://sass.com.ua/static/media/public/2017/11/11/03.jpg | |
return src.replace(/\/static\/media\/[^/]*(\/public\/.*\/[^/]*?\.[a-z]+)__[^/]*$/, "/static/media$1"); | |
} | |
if (domain === "files.sharenator.com") { | |
// https://files.sharenator.com/felicity-jones-s3504x4800-453760-1020.jpg | |
// https://files.sharenator.com/felicity-jones-s3504x4800-453760.jpg | |
// https://files.sharenator.com/453760.jpg -- 3504x4800 | |
// https://files.sharenator.com/jessica-alba-s700x1001-432323.jpg | |
// https://files.sharenator.com/432323.jpg -- 700x1001 | |
return src.replace(/(:\/\/[^/]*\/)[^/.]+-s[0-9]+x[0-9]+-([0-9]{4,})(?:-[0-9]*)?(\.[^/.]*)$/, "$1$2$3"); | |
} | |
if (domain === "cdn.jolie.de" || | |
// https://cdn.maedchen.de/51531-726241-1/image360w/emma-watson-getty-images-300x500-1122033.jpg | |
// https://cdn.maedchen.de/51531-726241-1/original/emma-watson-getty-images-300x500-1122033.jpg | |
domain === "cdn.maedchen.de") { | |
// http://cdn.jolie.de/297989-4137908-2/image160w/felicity-jones-oscars-2017.jpg | |
// http://cdn.jolie.de/297989-4137908-2/original/felicity-jones-oscars-2017.jpg | |
return src.replace(/\/image[0-9]*[wh]\//, "/original/"); | |
} | |
if (domain === "img.mp.itc.cn" || | |
// http://wallpapercraze.com/images/wallpapers/02_CGI_Robert_Downey_Jr_th.png | |
// http://wallpapercraze.com/images/wallpapers/02_CGI_Robert_Downey_Jr.png | |
(domain_nowww === "wallpapercraze.com" && src.indexOf("/images/wallpapers/") >= 0) || | |
// http://img.mp.sohu.com/upload/20170512/af6d692d7b6b493b9c3e002db2feebd1_th.png | |
// http://img.mp.sohu.com/upload/20170512/af6d692d7b6b493b9c3e002db2feebd1.png | |
domain === "img.mp.sohu.com") { | |
// http://img.mp.itc.cn/upload/20170227/aa7bad178ad94c1e94428c87b6227fc7_th.jpeg | |
// http://img.mp.itc.cn/upload/20170227/aa7bad178ad94c1e94428c87b6227fc7.jpeg | |
return src.replace(/_th(\.[^/.]*)$/, "$1"); | |
} | |
if (domain_nosub === "qpic.cn") { | |
// http://mmbiz.qpic.cn/mmbiz_jpg/HiaNy8LPboMwzXqYuvrlHAicCbwUffgUbjY2EgQa81icMQxeKHeG5dTmhupXk7MKHibwKQAtNxEbeceH7elpaTT2fw/640?wx_fmt=jpeg&_ot=1514246400129 | |
// https://puui.qpic.cn/vcover_vt_pic/0/7m7cvdfbslfme4u1478827029/260 | |
// http://t3.qpic.cn/mblogpic/afb2a8f5fc3b14b0015e/0 | |
// http://t3.qpic.cn/mblogpic/afb2a8f5fc3b14b0015e/2000 | |
// http://mmbiz.qpic.cn/mmbiz_jpg/BKb3XsZIgQaRTBiaocsuNJlzpfAqVOx8kzJRt8icY75kPjiaD42TE7F75Vf5xicn0L8YKQ2FYpFK2znwMfBSKWCAsg/640.jpeg | |
// http://mmbiz.qpic.cn/mmbiz_jpg/BKb3XsZIgQaRTBiaocsuNJlzpfAqVOx8kzJRt8icY75kPjiaD42TE7F75Vf5xicn0L8YKQ2FYpFK2znwMfBSKWCAsg/0 | |
if (src.match(/\/mblogpic\//)) | |
return { | |
url: src.replace(/\/[0-9]*(?:\.[^/.]*)?(?:\?.*)?$/, "/2000"), | |
headers: { | |
Referer: "" // if not, it redirects to t100.qpic.cn, which doesn't work | |
} | |
}; | |
return src.replace(/\/[0-9]*(?:\.[^/.]*)?(?:\?.*)?$/, "/0"); | |
} | |
if ((domain_nosub === "49qmz.com" || | |
// http://img1.ii77.com/mmbiz_jpg/OBQWTDeVLCNaib0HP024ucQ9A58IVjEes79snzkTRnI2nBpRYrkIRcKHveGb6XdKDtIrD8K8UtXBnNtibLOjPrCg/640?wx_fmt=jpeg | |
// http://mmbiz.qpic.cn/mmbiz_jpg/OBQWTDeVLCNaib0HP024ucQ9A58IVjEes79snzkTRnI2nBpRYrkIRcKHveGb6XdKDtIrD8K8UtXBnNtibLOjPrCg/0 | |
domain_nosub === "ii77.com" || | |
// http://img1.vhaor.com/mmbiz_jpg/Keiao0PZ6AuK6HmUvlxH25mwI1FQ1kbicMzSwX70C1KojImoefyiclDcWIcIO5oUfmicMRz1KpkMk9HjPIzciaBV3ow/0?wx_fmt=jpeg | |
// http://mmbiz.qpic.cn/mmbiz_jpg/Keiao0PZ6AuK6HmUvlxH25mwI1FQ1kbicMzSwX70C1KojImoefyiclDcWIcIO5oUfmicMRz1KpkMk9HjPIzciaBV3ow/0 | |
domain_nosub === "vhaor.com") | |
&& domain.match(/^img[0-9]*\./)) { | |
// http://img1.49qmz.com/mmbiz_jpg/Cf63e80XA9vKicOgBW17jh3FpL6rUiczfspSKgDuJYlTeZ6icWhqlL5YibMRuXaaLeInw2jr2Dj0p2rWbZtMYhhGjw/640?wx_fmt=jpeg | |
// http://mmbiz.qpic.cn/mmbiz_jpg/Cf63e80XA9vKicOgBW17jh3FpL6rUiczfspSKgDuJYlTeZ6icWhqlL5YibMRuXaaLeInw2jr2Dj0p2rWbZtMYhhGjw/0 | |
return src.replace(/:\/\/[^/]*\/mmbiz_jpg\//, "://mmbiz.qpic.cn/mmbiz_jpg/"); | |
} | |
if (domain_nowww === "vod.lu" && /\/media\/+cache\//.test(src)) { | |
// https://github.com/liip/LiipImagineBundle/issues/912 related? | |
// http://www.vod.lu/media/cache/resolve/400x225/97/0c/970c16f8-fd8f-11e6-823c-d10fb8a0c611.jpg | |
// http://www.vod.lu/media/cache/resolve/9999999x9999999/97/0c/970c16f8-fd8f-11e6-823c-d10fb8a0c611.jpg | |
// http://www.vod.lu/media/97/0c/970c16f8-fd8f-11e6-823c-d10fb8a0c611.jpg | |
// http://www.vod.lu/media/cache/190x253/92/7d/927da5b5-fd8f-11e6-9eab-ed7742afa678.jpg | |
// http://www.vod.lu/media/cache/9999999x9999999/92/7d/927da5b5-fd8f-11e6-9eab-ed7742afa678.jpg | |
// http://www.vod.lu/media/92/7d/927da5b5-fd8f-11e6-9eab-ed7742afa678.jpg | |
//return src.replace(/\/media\/+cache\/+(?:resolve\/+)?[0-9]+x[0-9]+\//, "/media/cache/$19999999x9999999/"); | |
return src.replace(/\/media\/+cache\/+(?:resolve\/+)?[0-9]+x[0-9]+\/+/, "/media/"); | |
} | |
if (domain_nowww === "vogue.ua") { | |
// https://vogue.ua/media/cache/resolve/inline_620x/uploads/article-inline/319/d10/af8/56b9af8d10319.jpeg | |
// https://vogue.ua/cache/inline_620x/uploads/article-inline/319/d10/af8/56b9af8d10319.jpeg | |
// https://vogue.ua/cache/gallery_x1160_watermark/uploads/image/dc0/ab2/a48/58b3a48ab2dc0.jpeg | |
// https://vogue.ua/uploads/image/dc0/ab2/a48/58b3a48ab2dc0.jpeg | |
// https://vogue.ua/cache/gallery_x315_watermark/upload/photogallery/139961_original.jpg | |
// https://vogue.ua/upload/photogallery/139961_original.jpg | |
return src | |
.replace(/\/media\/+cache\/+resolve\//, "/cache/") | |
.replace(/\/cache\/+[^/]+\/+(uploads?)\//, "/$1/"); | |
} | |
if (domain === "bt.bmcdn.dk") { | |
// https://bt.bmcdn.dk/media/cache/resolve/image_420/image/103/1032257/17913568-.jpg | |
// https://bt.bmcdn.dk/media/cache/resolve/image/image/103/1032257/17913568-.jpg | |
// doesn't work: | |
// https://bdk.bmcdn.dk/media/cache/resolve/image_910x511/image/97/976522/21478831-isfjeld-grundstdt-lige-uden-f.jpeg | |
return src.replace(/\/image_[0-9]+(?:x[0-9]+)?\/+image\//, "/image/image/"); | |
} | |
if (domain_nosub === "blogspot.es") { | |
// http://creaeventos.blogspot.es/cache/media/files/00/248/376/2014/05/lupita-nyongo-met-gala-2014.jpg -- 600x822 | |
// http://creaeventos.blogspot.es/files/00/248/376/2014/05/lupita-nyongo-met-gala-2014.jpg -- 747x1024 | |
// http://girlpotatolistas.blogspot.es/media/cache/resolve/media/files/01/140/838/2016/05/shingeki-no-kyojin-574-1365335049.jpg | |
// http://girlpotatolistas.blogspot.es/files/01/140/838/2016/05/shingeki-no-kyojin-574-1365335049.jpg | |
return src.replace(/(?:\/media)?\/+cache\/+(?:resolve\/+)?media\/+files\//, "/files/"); | |
} | |
if (domain === "csn.naekranie.pl") { | |
// https://csn.naekranie.pl/media/cache/resolve/thumb-big/2017/01/Shot-31_129_R5_2.jpg | |
// https://csn.naekranie.pl/media/cache/thumb-big/2017/01/Shot-31_129_R5_2.jpg | |
// https://csn.naekranie.pl/wp-content/uploads/2017/01/Shot-31_129_R5_2.jpg | |
return src.replace(/\/media\/+cache\/+(?:resolve\/+)?[^/]*\/+([0-9]{4}\/+[0-9]{2}\/+)/, | |
"/wp-content/uploads/$1"); | |
} | |
if (domain === "imagesvc.timeincuk.net" || | |
// https://imagesvc.meredithcorp.io/v3/mm/image?url=https%3A%2F%2Fimages.hellogiggles.com%2Fuploads%2F2019%2F01%2F18152040%2Fariana-grande-seven-rings.jpg&w=450&c=sc&poi=face&q=85 | |
// https://images.hellogiggles.com/uploads/2019/01/18152040/ariana-grande-seven-rings.jpg | |
// http://imagesvc.meredithcorp.io/v3/tardis/image?url=https%3A%2F%2Fpeopledotcom.files.wordpress.com%2F2019%2F09%2Fleamichele_02.jpg&h=1000&f=jpg&q=80 | |
// https://peopledotcom.files.wordpress.com/2019/09/leamichele_02.jpg | |
domain === "imagesvc.meredithcorp.io") { | |
// https://imagesvc.timeincuk.net/v3/keystone/image?w=441&url=http://ksassets.timeincuk.net/wp/uploads/sites/46/2016/12/Felicity-Jonesw-style-file-december-2016.jpg&q=82 | |
return decodeuri_ifneeded(src.replace(/^[a-z]+:\/\/[^/]*\/v3\/+[a-z]+\/+image.*?[?&]url=([^&]*).*/, "$1")); | |
} | |
if (domain === "img.timeinc.net") { | |
// http://img.timeinc.net/time/daily/2010/1003/360_afestival_0315.jpg | |
// http://img.timeinc.net/time/daily/2010/1003/afestival_0315.jpg | |
// http://img.timeinc.net/time/daily/2010/1011/360_br10q_1129.jpg -- upscaled? | |
// http://img.timeinc.net/time/daily/2010/1011/br10q_1129.jpg | |
return src.replace(/\/[0-9]+_([^/_]+_[0-9]+(?:_[^/]*)?\.[^/.]*)$/, "/$1"); | |
} | |
if (domain === "i.ksd-i.com") { | |
// http://i.ksd-i.com/s/800_86400_8a0ec3922bafcaa900bb552e00d9685c/static.koreastardaily.com/2014-08-22/46572-256196.jpg | |
// http://static.koreastardaily.com/2014-08-22/46572-256196.jpg | |
// https://a.ksd-i.com/a/2014-08-22/46572-256196.jpg | |
return src.replace(/^[a-z]+:\/\/[^/]*\/+s\/+[0-9]+_[0-9]+_[0-9a-f]+\/+/, "http://"); | |
} | |
if (domain === "a.ksd-i.com") { | |
// https://a.ksd-i.com/s/160l_86400_82d10665e8e8ca12632547568577442d/static.koreastardaily.com/2017-10-24/99264-550368.jpg | |
// https://a.ksd-i.com/s/480x_86400_53c96fbf9a6baa55c9b527dcbeb4928e/static.koreastardaily.com/2017-10-24/99264-550368.jpg | |
// http://static.koreastardaily.com/2017-10-24/99264-550368.jpg | |
// https://a.ksd-i.com/s/160l_86400_aaf286b862dc657320f390e272bd7cb8/static.koreastardaily.com/2017-06-26/95799-521086.jpg | |
// https://a.ksd-i.com/s/480x_86400_63072b0849030d169deca9872c37d761/static.koreastardaily.com/2017-10-24/99264-550364.jpg | |
return src.replace(/.*:\/\/[^/]*\/s\/[^/]*\//, "http://"); | |
} | |
if (domain === "static.koreastardaily.com") { | |
// http://static.koreastardaily.com/2017-04-13/93388-506687.jpg | |
// https://a.ksd-i.com/a/2017-04-13/93388-506687.jpg -- same (but HTTPS) | |
return src.replace(/.*:\/\/[^/]*\/([0-9]+-[0-9]+-[0-9]+\/[0-9]+-[0-9]+\.[^/.]*)$/, "https://a.ksd-i.com/a/$1"); | |
} | |
if (domain === "pic.pimg.tw") { | |
// https://pic.pimg.tw/silvia17895/1518597084-877783212_n.jpg | |
// https://pic.pimg.tw/silvia17895/1518597084-877783212.jpg | |
// http://pic.pimg.tw/kflim/normal_4a56a95bbedef.jpg | |
// http://pic.pimg.tw/kflim/4a56a95bbedef.jpg | |
// https://pic.pimg.tw/typhoon1212/1528283365-3372533556_wn.jpg | |
// https://pic.pimg.tw/typhoon1212/1528283365-3372533556.jpg | |
// (none, l), b, m, n, q, s, t | |
return src | |
.replace(/\/[a-z]+_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "/$1") | |
.replace(/_w?[a-z](\.[^/]*)$/, "$1"); | |
} | |
if (domain === "imageproxy.pimg.tw") { | |
// https://imageproxy.pimg.tw/zoomcrop?url=http%3A%2F%2Fimage.newsis.com%2F2013%2F06%2F21%2FNISI20130621_0008354474_web.jpg&width=380&height=228 | |
// http://image.newsis.com/2013/06/21/NISI20130621_0008354474_web.jpg | |
// https://imageproxy.pimg.tw/resize?url=https%3A%2F%2Ffarm5.staticflickr.com%2F4597%2F39252323662_13f70176d7_c.jpg&maxwidth=500&maxheight=350 | |
// https://farm5.staticflickr.com/4597/39252323662_13f70176d7_c.jpg | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+(?:zoomcrop|resize)\?(?:.*?&)?url=([^&]*).*?$/, "$1"); | |
if (newsrc !== src) | |
return decodeuri_ifneeded(newsrc); | |
} | |
if (domain_nowww === "helloidol.com" && | |
src.indexOf("/script/get_pic.php") >= 0) { | |
// http://www.helloidol.com/script/get_pic.php?src=https://1.bp.blogspot.com/-iblNAdULcFY/WnkEGyGjySI/AAAAAAAADHQ/pgVIIcLeHOo6IngbASGuakOIpxBwHr8dACLcBGAs/s1600/Eulachacha-Waikiki.jpg&h=256&w=400&zc=1 | |
return src.replace(/.*\/script\/get_pic\.php.*?[?&]src=([^&]*).*?$/, "$1"); | |
} | |
if (domain === "yams.akamaized.net" && | |
src.indexOf("/Assets/") >= 0) { | |
// https://yams.akamaized.net/Assets/56/610/p0082761056.jpg | |
return src.replace(/\/(?:[^/._]*_)?([^/_]*)$/, "/l_$1"); | |
} | |
if (domain_nosub === "pixpo.net" && domain.match(/img[0-9]\.pixpo\.net/)) { | |
// https://img1.pixpo.net/img/da/4/0dwxci32wc/sg_0DwXCi32Wc_t324x216.jpg | |
// https://img1.pixpo.net/img/da/4/0dwxci32wc/sg_0DwXCi32Wc.jpg | |
return src.replace(/_t[0-9]+x[0-9]+(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "www.mirrormedia.mg" && | |
src.indexOf("/assets/images/") >= 0) { | |
// https://www.mirrormedia.mg/assets/images/20170626110017-7cd692da02e985b28918adaf10d858ad-desktop.jpg | |
return src.replace(/-desktop(\.[^/.]*)$/, "$1"); | |
} | |
if (domain_nosub === "kknews.cc" && domain.match(/i[0-9]*\.kknews\.cc/)) { | |
// https://i1.kknews.cc/SIG=32hj89t/p6700021qr20759nn46_s.jpg | |
// https://i1.kknews.cc/SIG=32hj89t/p6700021qr20759nn46.jpg | |
return src.replace(/_[a-z]*(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "resource.holyshare.com.tw") { | |
// http://resource.holyshare.com.tw/uploads/article/85x65/1443691071QSo_1.png | |
// http://resource.holyshare.com.tw/uploads/article/600x0/1413181844EmZ_1.jpg | |
return src.replace(/\/article\/[0-9]*x[0-9]*\//, "/article/"); | |
} | |
if (domain_nowww === "kyeongin.com") { | |
// http://www.kyeongin.com/mnt/file_m/201802/2018021501001103400052931.jpg | |
// http://www.kyeongin.com/mnt/file/201802/2018021501001103400052931.jpg | |
// http://www.kyeongin.com/mnt/thum/201903/20190326001657091_1.jpg | |
// http://www.kyeongin.com/mnt/file/201903/20190326001657091_1.jpg | |
// http://www.kyeongin.com/mnt/file/201704/20170425010008610_1.jpg | |
// http://www.kyeongin.com/mnt/org/201704/20170425010008610_1.jpg | |
// other: | |
// http://www.kyeongin.com/mnt/file/201908/2019082701001971400094231.jpg | |
// http://www.kyeongin.com/main/view.php?key=20190827010009423 | |
var extra = {}; | |
match = src.match(/^[a-z]+:\/\/[^/]+\/+mnt\/+[^/]+\/+[0-9]{6}\/+([0-9]{17})(?:_[0-9]+)?\.[^/.]+(?:[?#].*)?$/); | |
if (match) { | |
extra.page = "http://www.kyeongin.com/main/view.php?key=" + match[1]; | |
} | |
regex = /\/mnt\/+(?:thum|file(?:_[a-z]+)?)\/+/; | |
if (regex.test(src)) { | |
// FIXME: for some reason deepcopy(extra) is needed when using an array? | |
return [ | |
{ | |
url: src.replace(regex, "/mnt/org/"), | |
extra: deepcopy(extra) | |
}, | |
{ | |
url: src.replace(regex, "/mnt/file/"), | |
extra: deepcopy(extra) | |
} | |
]; | |
} else { | |
return { | |
url: src, | |
extra: extra | |
}; | |
} | |
//return src.replace("/file_m/", "/file/"); | |
} | |
if (domain_nowww === "wallpaperup.com") { | |
// https://www.wallpaperup.com/uploads/wallpapers/2013/04/05/70727/793b48d70207428a317f912ac9f1342e-250.jpg | |
// https://www.wallpaperup.com/uploads/wallpapers/2013/04/05/70727/793b48d70207428a317f912ac9f1342e.jpg | |
return src.replace(/-[0-9]+(\.[^/.]*)$/, "$1"); | |
} | |
if ((domain_nosub === "wallhere.com" || | |
domain_nosub === "pxhere.com") && | |
domain.match(/^[a-z]*\./)) { | |
// https://c.wallhere.com/photos/e2/9a/women_brunette_model_Marina_Shimkovich_window_sill_jean_shorts_legs_barefoot-285016.jpg!d | |
// https://get.wallhere.com/photo/women_brunette_model_Marina_Shimkovich_window_sill_jean_shorts_legs_barefoot-285016.jpg | |
// https://get.wallhere.com/photo/Asian-Sunny-Girls-Generation-SNSD-Person-Kwon-Yuri-Jessica-Jung-Im-Yoona-Choi-Sooyoung-Kim-Taeyeon-Kim-Hyoyeon-Seohyun-Tiffany-Hwang-finger-2560x1600-px-523643.jpg | |
// https://get.wallhere.com/photo/Asian-Sunny-Girls-Generation-SNSD-Person-Kwon-Yuri-Jessica-Jung-Im-Yoona-Choi-Sooyoung-Kim-Taeyeon-Kim-Hyoyeon-Seohyun-Tiffany-Hwang-finger-523643.jpg | |
// https://get.wallhere.com/photo/5333x3000-px-Girls-Generation-K-pop-Korean-Lee-Soonkyu-Sunny-989174.jpg | |
// https://get.wallhere.com/photo/Girls-Generation-K-pop-Korean-Lee-Soonkyu-Sunny-989174.jpg | |
// https://c.pxhere.com/photos/73/fc/women_model_sauna_beauty_girl_pretty_sexy_woman_photography-696156.jpg!s | |
// https://get.pxhere.com/photo/women_model_sauna_beauty_girl_pretty_sexy_woman_photography-696156.jpg | |
// https://c.pxhere.com/images/38/fe/762e69512e53d94f4b4711f60d0e-1419055.png!s | |
// https://get.pxhere.com/photo/762e69512e53d94f4b4711f60d0e-1419055.png | |
return src | |
.replace(/[a-z]*\.wallhere\.com/, "get.wallhere.com") | |
.replace(/[a-z]*\.pxhere\.com/, "get.pxhere.com") | |
.replace(/\/(?:photos|images)\/[0-9a-f]*\/[0-9a-f]*\/([^/.]*\.[^/.!]*).*?$/, "/photo/$1") | |
.replace(/\/[0-9]+x[0-9]+-px-([^/]*)$/, "/$1") | |
.replace(/-[0-9]+x[0-9]+-px-([0-9]+\.[^/.]*)$/, "-$1"); | |
} | |
if (domain === "img.grouponcdn.com") { | |
// https://img.grouponcdn.com/deal/nx2giiTu5SBQbemLQteLqW/shutterstock_140728459-2-1500x900/v1/c300x182.jpg | |
return src.replace(/\/v[0-9]+\/[^/]*$/, ""); | |
} | |
if ((domain_nosub === "goodfon.com" || | |
// https://img1.goodfon.ru/original/2560x1440/8/18/devochka-povyazka-kniga-bluzka.jpg | |
// https://img1.goodfon.ru/wallpaper/original/8/18/devochka-povyazka-kniga-bluzka.jpg | |
domain_nosub === "goodfon.ru" || | |
// https://img3.badfon.ru/wallpaper/big/c/b0/devushka-nagota-dlinnye-volosy.jpg | |
// https://img3.badfon.ru/wallpaper/original/c/b0/devushka-nagota-dlinnye-volosy.jpg | |
domain_nosub === "badfon.ru") && | |
domain.match(/^img[0-9]*\./)) { | |
// https://img4.goodfon.com/wallpaper/middle/2/86/brevno-sova-ptitsa.jpg | |
// https://img4.goodfon.com/wallpaper/original/2/86/brevno-sova-ptitsa.jpg | |
// https://img2.goodfon.com/original/1280x720/0/e6/venera-ray-devushka-krasivaya.jpg | |
// https://img2.goodfon.com/wallpaper/original/0/e6/venera-ray-devushka-krasivaya.jpg | |
return src.replace(/(:\/\/[^/]*\/)[^/]*\/[^/]*\//, "$1wallpaper/original/"); | |
//return src.replace(/\/wallpaper\/[^/]*\//, "/wallpaper/original/"); | |
} | |
if (domain_nosub === "greatfon.com" && domain.match(/^cdn[0-9]*\./)) { | |
// http://cdn3.greatfon.com/uploads/picture/477/111/111477/thumbs_elisha-cuthbert-happy-endings.jpg | |
// http://cdn3.greatfon.com/uploads/picture/477/111/111477/elisha-cuthbert-happy-endings.jpg | |
return src.replace(/(\/uploads\/+picture\/.*\/)thumbs_([^/]*)(?:[?#].*)?$/, "$1$2"); | |
} | |
if ((domain_nosub === "yimg.jp" && domain.indexOf(".c.yimg.jp") >= 0) && | |
src.match(/:\/\/[^/]*\/im_/)) { | |
// https://lpt.c.yimg.jp/im_siggiQbAsU9YOpUOxobTU3EtUg---x200-y200/amd/20180215-00205238-okinawat-000-view.jpg | |
// https://lpt.c.yimg.jp/amd/20180215-00205238-okinawat-000-view.jpg | |
// https://amd.c.yimg.jp/im_siggfkAIHQmt2wB5qZ4fql1LCw---x900-y506-q90-exp3h-pril/amd/20180216-00010002-ksbv-000-1-view.jpg | |
// https://amd.c.yimg.jp/amd/20180216-00010002-ksbv-000-1-view.jpg | |
// https://iwiz-news-profile.c.yimg.jp/im_sigg6aeoTpWVSD8ZSZj4Bo7mBA---x64-y64-pril-n1-exp30d/d/iwiz-news-profile/img/nb34khhuyczsy7o6f4dsott4zq.png?1477551484 | |
// https://iwiz-news-profile.c.yimg.jp/d/iwiz-news-profile/img/nb34khhuyczsy7o6f4dsott4zq.png?1477551484 | |
//return src.replace(/(:\/\/[^/]*)\/[^/]*(\/amd\/[^/]*)$/, "$1$2"); | |
return src.replace(/(:\/\/[^/]*\/)im_[^/]*\//, "$1"); | |
} | |
if ((domain_nosub === "yimg.jp" && domain.indexOf(".c.yimg.jp") >= 0) && | |
src.match(/:\/\/[^/]*\/sim\?/)) { | |
// https://wing-auctions.c.yimg.jp/sim?furl=auctions.c.yimg.jp/images.auctions.yahoo.co.jp/image/dr000/auc0402/users/0/4/9/4/ane6371969-img600x425-1518659462gyve6525845.jpg&dc=1&sr.fs=20000 | |
// http://auctions.c.yimg.jp/images.auctions.yahoo.co.jp/image/dr000/auc0402/users/0/4/9/4/ane6371969-img600x425-1518659462gyve6525845.jpg | |
return src.replace(/.*:\/\/[^/]*\/sim.*?[?&]furl=([^&]*).*/, "http://$1"); | |
} | |
if ((domain_nosub === "yimg.jp" && domain.indexOf(".c.yimg.jp") >= 0) && | |
src.match(/\/Images\/(?:[a-z]_)?[0-9]+(\.[^/]*)$/)) { | |
// https://daily.c.yimg.jp/gossip/2015/06/16/Images/08127258.jpg | |
// https://daily.c.yimg.jp/gossip/2015/06/16/Images/f_08127258.jpg | |
// f, d, g, e, b, a | |
return src.replace(/\/Images\/(?:[a-z]_)?([0-9]+\.[^/.]*)$/, "/Images/f_$1"); | |
} | |
if (domain_nosub === "yimg.jp" && domain.indexOf(".c.yimg.jp") >= 0 && | |
src.match(/:\/\/[^/]*\/yjimage\?/)) { | |
// https://msp.c.yimg.jp/yjimage?q=SXErbsYXyLGSwqjcra07dAdtU7oG4sOUUXYButchAcGfrPPO0AFW2QnVBOjrLkIHN.SUOzCFDQcmuyDlnejSiBuj0wolEJkWkN379HL35K5_JOwQpplbsz0KNgGrbHRtY.dBoqXpBFPiZFOcSQ--&sig=138glqrj7&x=30&y=16 | |
// https://msp.c.yimg.jp/yjimage?q=SXErbsYXyLGSwqjcra07dAdtU7oG4sOUUXYButchAcGfrPPO0AFW2QnVBOjrLkIHN.SUOzCFDQcmuyDlnejSiBuj0wolEJkWkN379HL35K5_JOwQpplbsz0KNgGrbHRtY.dBoqXpBFPiZFOcSQ--&sig=138glqrj7 | |
return src.replace(/^([a-z]+:\/\/[^/]*\/yjimage).*$/, "$1") + "?q=" + url.searchParams.get("q") + "&sig=" + url.searchParams.get("sig"); | |
} | |
if (domain === "av.watch.impress.co.jp") { | |
// https://av.watch.impress.co.jp/img/avw/docs/1106/827/01_s.jpg | |
// https://av.watch.impress.co.jp/img/avw/docs/1106/827/01_o.jpg | |
return src.replace(/(\/[0-9]+)_s(\.[^/.]*)$/, "$1_o$2"); | |
} | |
if (domain === "internet.watch.impress.co.jp") { | |
// https://internet.watch.impress.co.jp/img/iw/docs/1106/860/01_s.jpg | |
// https://internet.watch.impress.co.jp/img/iw/docs/1106/860/01.jpg | |
return src.replace(/(\/[0-9]+)_s(\.[^/.]*)$/, "$1$2"); | |
//return src.replace(/_s(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "media.image.infoseek.co.jp") { | |
// https://media.image.infoseek.co.jp/isnews/photos/mag2news/mag2news_350262_0-small.jpg | |
// https://media.image.infoseek.co.jp/isnews/photos/gree/gree_164114_0-small.jpg | |
// https://media.image.infoseek.co.jp/isnews/photos/gree/gree_164114_0.jpg | |
// https://media.image.infoseek.co.jp/isnews/photos/sirabee/sirabee_20161410960_0-small.jpg | |
// https://media.image.infoseek.co.jp/isnews/photos/sirabee/sirabee_20161410960_0.jpg | |
return src.replace(/-[a-z]*(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "bundles.sfd.pl") { | |
// https://bundles.sfd.pl/SFD/2018/2/27/448ea4267069482cb09dfc5cac173927-small.jpg | |
// https://bundles.sfd.pl/SFD/2018/2/27/448ea4267069482cb09dfc5cac173927.jpg | |
return src.replace(/(\/SFD\/+[0-9]{4}\/+[0-9]+\/+[0-9]+\/+[0-9a-f]{10,})-small(\.[^/.]*)(?:[?#].*)?$/, "$1$2"); | |
} | |
if (domain === "s.eximg.jp") { | |
// https://s.eximg.jp/exnews/feed/President/President_24421_0d46_1_s.jpg | |
// https://s.eximg.jp/exnews/feed/Reuters/Reuters_newsml_KCN1G009M_1_s.jpg | |
// https://s.eximg.jp/exnews/feed/Reuters/Reuters_newsml_KCN1G009M_1.jpeg | |
// | |
// https://s.eximg.jp/exnews/feed/Getnews/Getnews_1869376_84b6_1_s.jpg | |
// https://s.eximg.jp/exnews/feed/Getnews/Getnews_1869376_84b6_1.jpg | |
return src.replace(/(_[0-9]+)_s(\.[^/.]*)$/, "$1$2"); | |
} | |
if (domain === "imgc.eximg.jp") { | |
// https://imgc.eximg.jp/i=https%253A%252F%252Fs.eximg.jp%252Fexnews%252Ffeed%252FShouhin%252FShouhin_93784_1.jpg,zoom=400,type=jpg | |
// https://s.eximg.jp/exnews/feed/Shouhin/Shouhin_93784_1.jpg | |
// https://imgc.eximg.jp/cv/resize?i=https%3A%2F%2Fs.eximg.jp%2Fexnews%2Ffeed%2FCobs%2FCobs_1893125_c14f_1.jpg&t=jpeg&q=70&w=600 | |
// https://s.eximg.jp/exnews/feed/Cobs/Cobs_1893125_c14f_1.jpg | |
// https://imgc.eximg.jp/cv/trim?i=https%3A%2F%2Fs.eximg.jp%2Fexnews%2Ffeed%2FOricon%2FOricon_2132644_21df_1.jpg&t=webp&q=100&trim=1&w=184&h=184 | |
// https://s.eximg.jp/exnews/feed/Oricon/Oricon_2132644_21df_1.jpg | |
newsrc = src.replace(/.*?\/i=([^,&]*).*?$/, "$1"); | |
if (newsrc !== src) | |
return decodeuri_ifneeded(newsrc); | |
newsrc = src.replace(/.*?\/cv\/+(?:resize|trim)\?i=([^&]*).*?$/, "$1"); | |
if (newsrc !== src) | |
return decodeuri_ifneeded(newsrc); | |
} | |
if (domain === "image.itmedia.co.jp" && | |
!src.match(/\/l_[^/]*$/) && | |
!src.match(/\/[0-9]+_[^/]*$/)) { | |
// http://image.itmedia.co.jp/news/articles/1802/16/koya_AP18039560928544.jpg | |
// http://image.itmedia.co.jp/news/articles/1802/16/l_koya_AP18039560928544.jpg | |
// http://image.itmedia.co.jp/news/articles/1802/16/mm_houseten_02.jpg | |
// http://image.itmedia.co.jp/news/articles/1802/16/l_mm_houseten_02.jpg | |
// http://image.itmedia.co.jp/news/articles/1802/16/nu_nec0216_02.jpg | |
// doesn't work: | |
// http://image.itmedia.co.jp/news/articles/1802/16/240_news084.jpg | |
return src.replace(/\/([^/]*)$/, "/l_$1"); | |
} | |
if (domain_nosub === "bigcommerce.com" && domain.match(/cdn[0-9]*\.bigcommerce\.com/)) { | |
// http://cdn7.bigcommerce.com/s-aeyni5y9/images/stencil/500x659/products/517/520/bear_papa_7328_2__12787.1400287249.jpg?c=2 | |
// http://cdn7.bigcommerce.com/s-aeyni5y9/images/stencil/original/products/517/520/bear_papa_7328_2__12787.1400287249.jpg?c=2 | |
// https://cdn7.bigcommerce.com/s-c14n6tful3/images/stencil/735x374/products/136/460/checkbox-categories-filter-for-product-search-preview-734x374__10327.1518675514.jpg?c=2&imbypass=on | |
// https://cdn7.bigcommerce.com/s-c14n6tful3/images/stencil/original/products/136/460/checkbox-categories-filter-for-product-search-preview-734x374__10327.1518675514.jpg?c=2&imbypass=on -- zero length head | |
// other: | |
// https://cdn2.bigcommerce.com/server5100/wxfmbm/products/7017/images/70970/MVB_0261_92322.1440979988.501.751_1__27160.1444692485.60.90.jpg?c=2 | |
// https://cdn2.bigcommerce.com/server5100/wxfmbm/images/stencil/original/products/7017/70970/MVB_0261_92322.1440979988.501.751_1__27160.1444692485.jpg?c=2 | |
newsrc = src.replace(/\/images\/+stencil\/+[0-9]+x[0-9]+\//, "/images/stencil/original/"); | |
if (newsrc !== src) | |
return newsrc; | |
newsrc = src.replace(/\/products\/+([0-9]+)\/+images\/+([0-9]+)\/+(.*\.[0-9]{8,})(?:\.[0-9]+\.[0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, "/images/stencil/original/products/$1/$2/$3$4"); | |
if (newsrc !== src) | |
return newsrc; | |
return { | |
url: src, | |
head_wrong_contentlength: true | |
}; | |
} | |
if (domain_nosub === "behance.net") { | |
// https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/9e81bc25691931.5634a6d5ee11a.png | |
// https://mir-s3-cdn-cf.behance.net/project_modules/1400/9e81bc25691931.5634a6d5ee11a.png | |
// https://mir-s3-cdn-cf.behance.net/project_modules/disp/9e81bc25691931.5634a6d5ee11a.png | |
// https://mir-s3-cdn-cf.behance.net/project_modules/hd/9e81bc25691931.5634a6d5ee11a.png | |
// https://mir-s3-cdn-cf.behance.net/project_modules/fs/9e81bc25691931.5634a6d5ee11a.png | |
// | |
// https://mir-s3-cdn-cf.behance.net/project_modules/1400/828dc625691931.5634a721e19dd.jpg | |
// https://mir-cdn.behance.net/v1/rendition/project_modules/1400/828dc625691931.5634a721e19dd.jpg | |
// https://mir-s3-cdn-cf.behance.net/project_modules/fs/828dc625691931.5634a721e19dd.jpg | |
// | |
// https://mir-s3-cdn-cf.behance.net/project_modules/hd/ad62c919260569.562e23ee8f6be.jpg | |
// https://mir-s3-cdn-cf.behance.net/project_modules/fs/ad62c919260569.562e23ee8f6be.jpg | |
// | |
// thanks to rahidz on github: | |
// https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/27452674022631.5c1db814e8a02.jpg | |
// https://mir-s3-cdn-cf.behance.net/project_modules/source/27452674022631.5c1db814e8a02.jpg | |
// | |
// https://mir-cdn.behance.net/v1/rendition/project_modules/1400_opt_1/4df4d449362517.58b2d9b3b3a2e.jpg | |
// https://mir-cdn.behance.net/v1/rendition/project_modules/source/4df4d449362517.58b2d9b3b3a2e.jpg -- 404 on head, but works | |
// | |
// https://mir-s3-cdn-cf.behance.net/projects/404/a6273165478883.5af575c34bbad.jpg | |
// https://mir-s3-cdn-cf.behance.net/projects/source/a6273165478883.5af575c34bbad.jpg | |
// | |
// doesn't work for all: | |
// https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/1cd9f445156279.58286c59a16f6.jpg | |
// https://mir-s3-cdn-cf.behance.net/project_modules/fs/1cd9f445156279.58286c59a16f6.jpg -- doesn't work | |
// https://mir-s3-cdn-cf.behance.net/project_modules/source/1cd9f445156279.58286c59a16f6.jpg -- works | |
// https://mir-s3-cdn-cf.behance.net/project_modules/disp/568ec59308969.560cc39b2569a.jpg | |
// https://mir-cdn.behance.net/v1/rendition/project_modules/fs/568ec59308969.560cc39b2569a.jpg -- 404 | |
// https://mir-s3-cdn-cf.behance.net/project_modules/source/568ec59308969.560cc39b2569a.jpg -- works | |
return [ | |
{ | |
url: src.replace(/(\/project(?:_modules|s)\/+)[^/]*\//, "$1source/"), | |
is_original: true | |
}, | |
src.replace(/(\/project(?:_modules|s)\/+)[^/]*\//, "$1fs/") | |
]; | |
} | |
if (domain === "www.worldatlas.com") { | |
// https://www.worldatlas.com/r/w728-h425-c728x425/upload/22/a1/0a/shutterstock-330445028.jpg | |
// https://www.worldatlas.com/upload/22/a1/0a/shutterstock-330445028.jpg | |
return src.replace(/(:\/\/[^/]*\/)r\/[^/]*\/(upload\/)/, "$1$2"); | |
} | |
if (domain_nosub === "thrillist.com" && domain.match(/assets[0-9]*\.thrillist\.com/)) { | |
// https://assets3.thrillist.com/v1/image/2642818/size/tmg-article_default_mobile.jpg | |
// https://assets3.thrillist.com/v1/image/2642818/size/tl-horizontal_main.jpg | |
// https://assets3.thrillist.com/v1/image/2729043/size/tl-right_rail_short.jpg | |
// https://assets3.thrillist.com/v1/image/2728632/size/gn-gift_guide_variable_c.jpg | |
// https://assets3.thrillist.com/v1/image/2442399/size/tmg-article_tall.jpg | |
// https://assets3.thrillist.com/v1/image/2442399 | |
// http://assets3.thrillist.com/v1/image/1210040 | |
return src.replace(/\/size\/[^/]*$/, ""); | |
} | |
if (domain_nowww === "vacationidea.com" && | |
src.indexOf("/pix/") >= 0) { | |
// http://vacationidea.com/pix/img25Hy8R/articles/t-b4_beautiful_places_oia,_santorin_27304_mobi.jpg | |
// http://vacationidea.com/pix/img25Hy8R/articles/t-b4_beautiful_places_oia,_santorin_27304.jpg | |
return src.replace(/_mobi(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "qph.fs.quoracdn.net") { | |
// https://qph.fs.quoracdn.net/main-qimg-0f9434ad2ebdb0024bab1b334ce791a9-c | |
// https://qph.fs.quoracdn.net/main-raw-392620873-joffqkghcbjrhnyvxrzwyzwepvyuubyh.jpeg | |
return src.replace(/-[a-z]$/, ""); | |
} | |
if (false && domain_nosub === "fan.pw" && | |
src.indexOf("/cpg/albums/") >= 0) { | |
// coppermine | |
// http://actresses.fan.pw/cpg/albums/userpics/10001/thumb_001~64.jpg | |
// http://actresses.fan.pw/cpg/albums/userpics/10001/normal_002~51.jpg | |
// http://actresses.fan.pw/cpg/albums/userpics/10001/002~51.jpg | |
return src.replace(/\/[a-z]*_([^/]*)$/, "/$1"); | |
} | |
if (domain_nosub === "haibao.cn" && domain.match(/c[0-9]*\.haibao\.cn/)) { | |
// http://c3.haibao.cn/pic/0_0_100_0/litQzsnR5qDSo/imagecut/0_400/piccommon/1215/12155/litQzsnR5qDSo.jpg | |
// http://c3.haibao.cn/pic/0_0_100_0/litQzsnR5qDSo/piccommon/1215/12155/litQzsnR5qDSo.jpg | |
// http://c1.haibao.cn/pic/0_0_100_0/liJjsVbbnxshY/imagecut/0_400/piccommon/1218/12184/liJjsVbbnxshY.jpg | |
// http://c1.haibao.cn/pic/0_0_100_0/liJjsVbbnxshY/piccommon/1218/12184/liJjsVbbnxshY.jpg -- 404 | |
// http://c3.haibao.cn/pic/0_0_100_0/liJjsVbbnxshY/piccommon/1218/12184/liJjsVbbnxshY.jpg -- works | |
newsrc = src.replace(/:\/\/[^/]*\/(.*)\/+imagecut\/+[0-9]+_[0-9]+\/+/, "://c3.haibao.cn/$1/"); | |
if (newsrc !== src) { | |
return { | |
url: newsrc, | |
can_head: false | |
}; | |
} | |
} | |
if (domain.match(/c[0-9]*\.haibao\.cn/)) { | |
// http://c3.haibao.cn/img/600_0_100_0/1258349756.6184/bigfiles/200946/1258349756.6184.jpg -- doesn't work | |
// http://c4.haibao.cn/img/0_0_0_0/1258349756.6184/bigfiles/200946/1258349756.6184.jpg | |
// doesn't work: (any changes fail) | |
// http://c3.haibao.cn/img/600_0_100_1/1443219715.4295/44ceff65db35a823fafb9572341a17e4.jpg | |
// http://c4.haibao.cn/img/0_0_100_1/1443219715.4295/44ceff65db35a823fafb9572341a17e4.jpg | |
// http://c4.haibao.cn/img/0_0_0_0/1443219715.4295/44ceff65db35a823fafb9572341a17e4.jpg -- works | |
// http://c2.haibao.cn/img/3620_5430_100_1/1498032292.4375/e2097b3504fdeefd6d94c0fbd8e3bcd6.jpg | |
// works: | |
// http://c4.haibao.cn/img/480_640_100_0/1337160726.1610/bigfiles/201220/1337160726.1610.jpg | |
// http://c4.haibao.cn/img/0_0_100_0/1337160726.1610/bigfiles/201220/1337160726.1610.jpg | |
// http://c4.haibao.cn/img/0_0_0_0/1337160726.1610/bigfiles/201220/1337160726.1610.jpg | |
newsrc = src.replace(/:\/\/[^/]*\/img\/+[0-9]+(?:_[0-9]+){3}\//, "://c4.haibao.cn/img/0_0_0_0/"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nosub === "hbimg.cn" && domain.match(/cdn[0-9]*\.hbimg\.cn/)) { | |
// http://cdn4.hbimg.cn/store/thumbs/130_165/piccommon/1214/12147/D52599CFADB3EFF2DCBE83AF.jpg | |
// http://cdn4.hbimg.cn/store/wm/piccommon/1214/12147/D52599CFADB3EFF2DCBE83AF.jpg | |
// http://cdn4.hbimg.cn/store/tuku/310_999/piccommon/1219/12199/D525A1EAE883EFE5E98291834B.jpg | |
// http://cdn4.hbimg.cn/store/wm/piccommon/1219/12199/D525A1EAE883EFE5E98291834B.jpg -- watermark | |
// http://cdn0.hbimg.cn/store/snsthumbs/650_2000/album/201311/817ADEBDE8AD9BB085F5C3C148AB89FACA8528F5F89F.jpg | |
// other: | |
// http://cdn4.hbimg.cn/store/wm/bigfiles/201227/887FDBBCEFC69CBB85FFD5C245A685.jpg | |
// http://cdn4.hbimg.cn/store/bigfiles/201227/887FDBBCEFC69CBB85FFD5C245A685.jpg -- doesn't work | |
// http://cdn4.hbimg.cn/store/bigfiles/201408/li0ORMvGTBRLE.jpg | |
// http://cdn4.hbimg.cn/store/wm/bigfiles/201408/li0ORMvGTBRLE.jpg -- doesn't work | |
// http://cdn0.hbimg.cn/store/data/attachment/album/201402/18/140655t3v2373scoavo5li.jpg | |
// http://cdn0.hbimg.cn/store/data/attachment/forum/201607/07/231331f3pud2uuth88su8w.jpg | |
// http://cdn6.hbimg.cn/store/uploads/2015/0602/1433227913.8475.jpg | |
// http://cdn2.hbimg.cn/store/piccommon/1220/12205/limmXaa8StWk.jpg | |
return { | |
url: src.replace(/\/(?:thumbs|tuku|snsthumbs)\/[0-9]+(?:_[0-9]+)\//, "/wm/"), | |
problems: { | |
watermark: true | |
} | |
}; | |
} | |
if (domain_nowww === "wallpaperset.com") { | |
// https://wallpaperset.com/w/small/6/7/2/314686.jpg | |
// https://wallpaperset.com/w/full/6/7/2/314686.jpg | |
return src.replace(/(:\/\/[^/]*\/w\/)[^/]*\//, "$1full/"); | |
} | |
// disabled due to redirects | |
if (domain_nosub === "wallpapermania.eu") { | |
// http://www.wallpapermania.eu/download/2012-04/1037/emma-roberts-11-sexy-hd-wallpaper_1366x768.jpg | |
// http://www.wallpapermania.eu/images/data/2012-04/1037_emma-roberts-11-sexy-hd-wallpaper.jpg | |
// http://static.wallpapermania.eu/images/thumbs/2012-04/1030_emma-roberts-4-sexy-hd-wallpaper.jpg | |
// http://www.wallpapermania.eu/images/data/2012-04/1030_emma-roberts-4-sexy-hd-wallpaper.jpg | |
// http://www.wallpapermania.eu/wallpaper/victoria-justice-6-sexy-hd-wallpaper | |
// http://www.wallpapermania.eu/images/lthumbs/2012-04/2210_victoria-justice-6-sexy-hd-wallpaper.jpg | |
// http://www.wallpapermania.eu/images/data/2012-04/2210_victoria-justice-6-sexy-hd-wallpaper.jpg | |
newsrc = src | |
.replace("://static.wallpapermania.eu/", "://www.wallpapermania.eu/") | |
.replace(/\/images\/[a-z]?thumbs\//, "/images/data/") | |
.replace(/\/download\/([^/]*)\/([0-9]*)\/([^/.]*)_[0-9]+x[0-9]+(\.[^/.]*)$/, "/images/data/$1/$2_$3$4"); | |
if (newsrc !== src) { | |
var referer = newsrc.replace(/.*\/[0-9]+_([^/.]*)(?:_[0-9]+x[0-9]+)?\.[^/.]*$/, | |
"http://www.wallpapermania.eu/wallpaper/$1"); | |
return { | |
url: newsrc, | |
headers: { | |
"Referer": referer | |
} | |
}; | |
} | |
//return newsrc; | |
} | |
if (domain === "img-aws.ehowcdn.com" || | |
domain === "img.aws.ehowcdn.com" || | |
domain === "img.aws.livestrongcdn.com" || | |
domain === "img-aws.livestrongcdn.com") { | |
// wip | |
// https://img-aws.ehowcdn.com/750x428p/photos.demandstudios.com/getty/article/165/202/96162194.jpg | |
// http://photos.demandstudios.com/getty/article/165/202/96162194.jpg | |
// | |
// https://img-aws.ehowcdn.com/1440x520/cme/uploadedimages.demandmedia/chocmouse.jpg | |
// | |
// https://img-aws.ehowcdn.com/640/cme/photography.prod.demandstudios.com/8f9cba5d-f28d-47e7-bcc7-985cc310ce6a.jpg | |
// https://img-aws.ehowcdn.com/1440/cme/photography.prod.demandstudios.com/8f9cba5d-f28d-47e7-bcc7-985cc310ce6a.jpg | |
// http://img.aws.ehowcdn.com/intl-300m200/ds-photo/getty/article/129/156/86543427.jpg | |
// http://img.aws.ehowcdn.com/intl-1200x630/ehow/images/a04/8n/pn/sell-wholesale-pandora-jewelry-800x800.jpg | |
// http://img-aws.ehowcdn.com/default/ds-photo/getty/article/190/38/153473402_XS.jpg | |
// https://img-aws.ehowcdn.com/default/getty/xc/87706466.jpg?v=1&c=EWSAsset&k=2&d=910C62E22B9F47AA92D0F6B5F9282134E184698B84D1D7E2E240CBB021893A9E | |
// | |
// http://img.aws.livestrongcdn.com/ls-article-image-400/cme/cme_public_images/www_livestrong_com/photos.demandstudios.com/getty/article/106/30/113475809_XS.jpg | |
/*newsrc = src.replace(/.*?:\/\/[^/]*\/[0-9]+x[0-9]+p\//, "http://") | |
if (newsrc !== src) { | |
return newsrc; | |
}*/ | |
newsrc = src | |
.replace(/(:\/\/[^/]*\/)[^/]*\//, "$1default/"); | |
// breaks some urls: | |
// https://img-aws.ehowcdn.com/150X100/getty/xc/87613263.jpg?v=1&c=EWSAsset&k=2&d=860EC25688CC8B2E9617B166F6C00C467D8EB72EFB52D4B89BE18AFE639C03A0 | |
// https://img-aws.ehowcdn.com/default/getty/xc/87613263.jpg?v=1&c=EWSAsset&k=2&d=860EC25688CC8B2E9617B166F6C00C467D8EB72EFB52D4B89BE18AFE639C03A0 | |
//.replace(/\?.*$/, ""); | |
if (newsrc !== src) { | |
return newsrc; | |
} | |
// http://img-aws.ehowcdn.com/300x200/photos.demandstudios.com/getty/article/88/150/87682980.jpg | |
// http://img.aws.livestrongcdn.com/default/cme/cme_public_images/www_livestrong_com/photos.demandstudios.com/getty/article/92/185/472711312_XS.jpg | |
newsrc = src.replace(/.*?:\/\/[^/]*\/.*?\/(photos\.demandstudios\.com\/)/, "http://$1"); | |
if (newsrc !== src) { | |
return newsrc; | |
} | |
// https://img-aws.ehowcdn.com/640/ehow-food-blog-us/files/2014/12/edits-2282-1024x682.jpg | |
// http://food-ehow-com.blog.ehow.com/files/2014/12/edits-2282-1024x682.jpg | |
// http://food-ehow-com.blog.ehow.com/files/2014/12/edits-2282.jpg | |
newsrc = src.replace(/.*?:\/\/[^/]*\/[^/]*\/ehow-([^-/.]*)-blog-([^/.]*)\//, "http://$1-ehow-com.blog.ehow.com/"); | |
if (newsrc !== src) { | |
return newsrc; | |
} | |
// http://img-aws.ehowcdn.com/615x200/cpi-studiod-com/www_ehow_com/i.ehow.com/images/a07/ai/07/prevent-soggy-graham-cracker-crust-800x800.jpg | |
// http://i.ehow.com/images/a07/ai/07/prevent-soggy-graham-cracker-crust-800x800.jpg | |
// https://img-aws.ehowcdn.com/default/cme/cme_public_images/www_ehow_com/i.ehow.com/images/a04/pc/d6/season-pizza-stone-800x800.jpg | |
// http://img-aws.ehowcdn.com/default/cme/cme_public_images/www_ehow_com/cdn-write.demandstudios.com/upload/image/18/2F/99D61A9C-FD10-4110-9241-BAA39E072F18/99D61A9C-FD10-4110-9241-BAA39E072F18.jpg | |
// http://cdn-write.demandstudios.com/upload/image/18/2F/99D61A9C-FD10-4110-9241-BAA39E072F18/99D61A9C-FD10-4110-9241-BAA39E072F18.jpg | |
// doesn't work: | |
// https://img-aws.ehowcdn.com/default/s3.amazonaws.com/cme_public_images/www_demandstudios_com/sitelife.studiod.com/ver1.0/Content/images/store/5/12/45fe6090-8ca0-4f71-9cb1-14efedc73b2e.Small.jpg | |
newsrc = src.replace(/.*?:\/\/[^/]*\/.*?\/www_ehow_com\/([^/.]*\.[^/]*)\//, "http://$1/"); | |
if (newsrc !== src) { | |
return newsrc; | |
} | |
// https://img-aws.ehowcdn.com/default/s3.amazonaws.com/cme_public_images/www_demandstudios_com/sitelife.studiod.com/ver1.0/Content/images/store/5/12/45fe6090-8ca0-4f71-9cb1-14efedc73b2e.Small.jpg | |
newsrc = src.replace(/.*?:\/\/[^/]*\/[^/]*\/s3\.amazonaws\.com\//, "https://s3.amazonaws.com/"); | |
if (newsrc !== src) { | |
return newsrc; | |
} | |
} | |
if (amazon_container === "cme_public_images") { | |
// http://s3.amazonaws.com/cme_public_images/www_livestrong_com/photos.demandstudios.com/getty/article/142/9/78291574_XS.jpg | |
// http://cme_public_images.s3.amazonaws.com/www_livestrong_com/photos.demandstudios.com/getty/article/142/9/78291574_XS.jpg | |
newsrc = src.replace(/.*?:\/\/[^/]*\/.*?\/(photos\.demandstudios\.com\/)/, "http://$1"); | |
if (newsrc !== src) { | |
return newsrc; | |
} | |
} | |
if (domain === "imageproxy.themaven.net") { | |
// https://imageproxy.themaven.net/http%3A%2F%2Fimg.aws.livestrongcdn.com%2Fls-1200x630%2Fcme%2Fcme_public_images%2Fwww_livestrong_com%2Fphotos.demandstudios.com%2Fgetty%2Farticle%2F178%2F99%2F79711775_XS.jpg | |
// https://imageproxy.themaven.net/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fmaven-user-photos%2Fthe-maven%2Fpress%2FhAfH0nLTEU-5d4pCxu-TUA%2F2wNFvsqAbUaqAch2Ndhq9w?w=688&q=75&h=512&auto=format&fit=crop | |
// https://s3-us-west-2.amazonaws.com/maven-user-photos/the-maven/press/hAfH0nLTEU-5d4pCxu-TUA/2wNFvsqAbUaqAch2Ndhq9w | |
return decodeURIComponent(src.replace(/^.*?:\/\/[^/]*\//, "").replace(/\?.*/, "")); | |
} | |
if ((domain_nosub === "demandstudios.com" && domain.match(/photos[0-9]*\.demandstudios\.com/)) && | |
src.indexOf("/dm-resize/") >= 0) { | |
// http://photos2.demandstudios.com/dm-resize/s3.amazonaws.com%2Fcme_public_images%2Fwww_livestrong_com%2Fphotos.demandstudios.com%2Fgetty%2Farticle%2F142%2F9%2F78291574_XS.jpg?w=267&h=10000&keep_ratio=1 | |
return decodeURIComponent(src.replace(/.*?\/dm-resize\/([^/?]*).*/, "http://$1")); | |
} | |
if (domain_nosub === "demandstudios.com" && domain.match(/photos[0-9]*\.demandstudios\.com/)) { | |
// http://photos.demandstudios.com/getty/article/92/121/114336181_XS.jpg | |
// http://photos.demandstudios.com/getty/article/92/121/114336181.jpg | |
// http://photos.demandstudios.com/getty/article/94/77/145190904_XS.jpg | |
// http://photos.demandstudios.com/getty/article/225/172/476257962_XS.jpg | |
// doesn't work: | |
// photos.demandstudios.com/74/208/fotolia_608243_XS.jpg | |
return src.replace(/(\/[0-9]+)_XS(\.[^/.]*)$/, "$1$2"); | |
} | |
if (domain_nosub === "abcnews.com") { | |
// https://s.abcnews.com/images/International/WireAP_118c1517b7f34b8bb7746eedfc01c12d_12x5_992.jpg | |
// https://s.abcnews.com/images/International/WireAP_118c1517b7f34b8bb7746eedfc01c12d.jpg | |
// https://s.abcnews.com/images/US/chicago-pd-funeral-02-ap-jrl-180217_16x9t_240.jpg | |
// https://s.abcnews.com/images/US/chicago-pd-funeral-02-ap-jrl-180217.jpg | |
// http://a.abcnews.com/images/Entertainment/GTY_sophie_turner_jef_150528_7x10_1600.jpg | |
// http://a.abcnews.com/images/Entertainment/GTY_sophie_turner_jef_150528.jpg | |
return src.replace(/_[0-9]+x[0-9]+[a-z]?_[0-9]+(\.[^/.]*)$/, "$1"); | |
} | |
if (domain_nowww === "nationmultimedia.com") { | |
// http://www.nationmultimedia.com/img/gallery/2017/10/14/194/9ef48d31930c4bbe00957654ab1aaf1a-vps.jpeg | |
// http://www.nationmultimedia.com/img/gallery/2017/10/14/194/9ef48d31930c4bbe00957654ab1aaf1a.jpeg | |
// http://www.nationmultimedia.com/img/news/2018/02/18/30339149/b4065a2adeea2230b7d230a13eda5701-atwb.jpeg | |
// http://www.nationmultimedia.com/img/news/2018/02/18/30339149/b4065a2adeea2230b7d230a13eda5701.jpeg | |
return src.replace(/-[^/.]*(\.[^/.]*)$/, "$1"); | |
} | |
if (domain_nosub === "indiatimes.com" || | |
// https://img.etimg.com/thumb/msid-63592870,width-643,imgsize-125649,resizemode-4/how-rihannas-song-became-howard-universitys-protest-anthem.jpg | |
// https://img.etimg.com/photo/63592870.cms | |
domain === "img.etimg.com" || | |
// https://etimg.etb2bimg.com/thumb/msid-62837430,imgsize-,width-800,height-434,overlay-etenergyworld/canada-s-meg-energy-to-sell-pipeline-storage-assets-for-c-1-61-bln.jpg | |
// https://etimg.etb2bimg.com/photo/62837430.cms | |
domain === "etimg.etb2bimg.com" || | |
// https://telugu.samayam.com/thumb/msid-65304761,width-600,resizemode-4/photo-gallery/bollywood/amy-jackson-hot-pics.jpg | |
// https://telugu.samayam.com/photo/65304761.cms | |
domain === "telugu.samayam.com" || | |
// https://static.langimg.com/thumb/msid-69234694,resizemode-4,width-250,height-172/%E0%B2%88%E0%B2%97%E0%B2%B2%E0%B3%87-%E0%B2%AC%E0%B2%95%E0%B3%8D%E0%B2%95%E0%B2%A4%E0%B2%B2%E0%B3%86-%E0%B2%86%E0%B2%97%E0%B2%BF%E0%B2%A6%E0%B3%86,-%E0%B2%87%E0%B2%A8%E0%B3%8D%E0%B2%A8%E0%B3%81-%E0%B2%AE%E0%B2%A6%E0%B3%81%E0%B2%B5%E0%B3%86-%E0%B2%AF%E0%B2%BE%E0%B2%95%E0%B3%86-%E0%B2%8E%E0%B2%82%E0%B2%A6-%E0%B2%85%E0%B2%B0%E0%B3%8D%E0%B2%9C%E0%B3%81%E0%B2%A8%E0%B3%8D-%E0%B2%95%E0%B2%AA%E0%B3%82%E0%B2%B0%E0%B3%8D.jpg | |
domain === "static.langimg.com" || | |
// https://m.timesofindia.com/thumb/msid-69414219,imgsize-84774,width-800,height-600,resizemode-4/69414219.jpg | |
domain_nosub === "timesofindia.com" || | |
// https://m.vijaykarnataka.com/thumb/msid-69234694,width-300,height-200,resizemode-4/pic.jpg | |
domain_nosub === "vijaykarnataka.com" || | |
domain === "static.toiimg.com") { | |
// https://timesofindia.indiatimes.com/thumb/msid-62829284,width-400,resizemode-4/62829284.jpg | |
// https://timesofindia.indiatimes.com/photo/62829284.cms | |
// http://photogallery.indiatimes.com/thumb/62742103.cms?width=164&height=122 | |
// http://photogallery.indiatimes.com/photo/62742103.cms | |
// https://economictimes.indiatimes.com/thumb/msid-62966896,width-274,height-198/how-the-rs-11k-cr-nirav-modi-scandal-will-affect-diamantaires.jpg | |
// https://economictimes.indiatimes.com/photo/62966896.cms | |
// https://static.toiimg.com/thumb/imgsize-376350,msid-62972146,width-200,resizemode-4/62972146.jpg | |
// https://static.toiimg.com/photo/62972146.cms | |
newsrc = src.replace(/(:\/\/[^/]*\/)thumb\//, "$1photo/"); | |
if (newsrc !== src) | |
return newsrc; | |
newsrc = src.replace(/\/(?:thumb|photo)\/[^/]*msid-([0-9]*)[,/].*$/, "/photo/$1.cms"); | |
if (newsrc !== src) | |
return newsrc; | |
newsrc = src.replace(/\/(?:thumb|photo)\/(?:[^/]*\/)?([0-9]*)\.[^/.]*$/, "/photo/$1.cms"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain === "opt.toiimg.com") { | |
// https://opt.toiimg.com/recuperator/img/toi/m-65021637,h-114,w-204/65021637.jpg?pl=175598 | |
// https://opt.toiimg.com/recuperator/img/toi/65021637.cms | |
return src.replace(/\/recuperator\/+img\/+toi\/+m-([0-9]+)(?:,[^/]*)\/+.*/, | |
"/recuperator/img/toi/$1.cms"); | |
} | |
if (domain_nowww === "jawapos.com") { | |
// https://www.jawapos.com/thumbs/xs/news/2018/02/18/tips-menghadapi-kulit-kering-di-musim-hujan_m_189572.jpeg | |
// https://www.jawapos.com/thumbs/l/news/2018/02/18/tips-menghadapi-kulit-kering-di-musim-hujan_m_189572.jpeg | |
// https://www.jawapos.com/uploads/news/2018/02/18/tips-menghadapi-kulit-kering-di-musim-hujan_m_189572.jpeg | |
return src.replace(/\/thumbs\/+[^/]*\//, "/uploads/"); | |
} | |
if (domain_nowww === "tnnthailand.com") { | |
// http://www.tnnthailand.com/stocks/media/thumb_big/0656a4.jpg | |
// http://www.tnnthailand.com/stocks/media/0656a4.jpg | |
return src.replace(/\/media\/+[^/]+\/+([^/]+)(?:[?#].*)?$/, "/media/$1"); | |
} | |
if ((domain_nosub === "ibtimes.co.in" || | |
domain_nosub === "ibtimes.sg") && | |
domain.match(/data[0-9]*\.ibtimes\./)) { | |
// http://data1.ibtimes.co.in/cache-img-0-450/en/full/554638/1420537417_beant-singh.jpg | |
// http://data1.ibtimes.co.in/en/full/554638/1420537417_beant-singh.jpg | |
// https://data1.ibtimes.co.in/cache-img-900-0-photo/en/full/66506/-62170003800_cannes-2017-aishwarya-rai-bachchan-looks-stunning-she-walks-red-carpet.jpg | |
// https://data1.ibtimes.co.in/en/full/66506/-62170003800_cannes-2017-aishwarya-rai-bachchan-looks-stunning-she-walks-red-carpet.jpg -- doesn't work | |
// The requested URL /en/full/6/65/66506.jpg was not found on this server. | |
// https://data.ibtimes.sg/en/full/16882/changi-airport.jpg?w=564&h=340&l=50&t=40 | |
// https://data.ibtimes.sg/en/thumb/21008/finance-minister-heng-swee-keat.jpg | |
return src | |
.replace(/(:\/\/[^/]*\/)cache-img-[0-9]*-[0-9]*(?:-photo)?\//, "$1") | |
.replace(/\/[a-z]*(\/[0-9]+\/[^/]*)$/, "/full$1") | |
.replace(/\?.*$/, ""); | |
} | |
if (amazon_container === "astro-image-resizer" || | |
// https://static03.astro.com.my/8/resize/xuan/media/xuan-assets/2019/june/05/768x432_kara_banner.jpg | |
// https://astrokentico.s3.amazonaws.com/xuan/media/xuan-assets/2019/june/05/kara_banner.jpg | |
domain_nosub === "astro.com.my") { | |
// http://astro-image-resizer.s3-ap-southeast-1.amazonaws.com/17/resize/rojakdaily/media/jessica-chua/news/2018/jan/saying%20goodbye%20to%20anw%20pj%20outlet/115x76_a-w.png | |
// http://astrokentico.s3.amazonaws.com/rojakdaily/media/jessica-chua/news/2018/jan/saying%20goodbye%20to%20anw%20pj%20outlet/a-w.png?ext=.png | |
// http://astrokentico.s3.amazonaws.com/rojakdaily/media/jessica-chua/news/2018/jan/saying%20goodbye%20to%20anw%20pj%20outlet/a-w.png | |
// http://s3-ap-southeast-1.amazonaws.com/astro-image-resizer/17/resize/rojakdaily/media/jessica-chua/news/2018/jan/saying%20goodbye%20to%20anw%20pj%20outlet/115x76_a-w.png | |
// http://astrokentico.s3.amazonaws.com/rojakdaily/media/jessica-chua/news/2018/jan/saying%20goodbye%20to%20anw%20pj%20outlet/a-w.png | |
return src | |
.replace(/:\/\/(?:astro-image-resizer\.([^.]*\.)?amazonaws\.com|static[0-9]*\.astro\.com\.my)\/+/, "://astrokentico.s3.amazonaws.com/") | |
.replace(/(:\/\/s3[^/.]*\.amazonaws\.com\/+)astro-image-resizer\//, "://astrokentico.s3.amazonaws.com/") | |
.replace(/(:\/\/[^/]*)\/[0-9]*\/+resize\//, "$1/") | |
.replace(/\/[0-9]+x[0-9]+_/, "/"); | |
} | |
if ((amazon_container && amazon_container.indexOf("nxs-wkrgtv-media") >= 0) || | |
// http://pic1.win4000.com/pic/f/bd/9db51148625_130_170.jpg | |
// http://pic1.win4000.com/pic/f/bd/9db51148625.jpg | |
(domain_nosub === "win4000.com" && domain.match(/^pic[0-9]*\.win4000\.com/)) || | |
// https://media.fox29.com/media.fox29.com/photo/2018/07/09/GETTY_thai_cave_rescue_ambulance_070918%20_OP_2_CP__1531142830871.jpg_5770639_ver1.0_640_360.jpg | |
// https://media.fox29.com/media.fox29.com/photo/2018/07/09/GETTY_thai_cave_rescue_ambulance_070918%20_OP_2_CP__1531142830871.jpg_5770639_ver1.0.jpg | |
domain === "media.fox29.com" || | |
// https://media.foxla.com/media.foxla.com/photo/2018/06/11/Panga_boat_lands_on_Laguna_Beach_shore___0_5651395_ver1.0_640_360.jpg | |
// https://media.foxla.com/media.foxla.com/photo/2018/06/11/Panga_boat_lands_on_Laguna_Beach_shore___0_5651395_ver1.0.jpg | |
domain === "media.foxla.com" || | |
// https://sharedmedia.grahamdigital.com/photo/2016/04/06/Rachel+McAdams_19105756_10868403_ver1.0_160_90.jpg | |
// https://sharedmedia.grahamdigital.com/photo/2016/04/06/Rachel+McAdams_19105756_10868403_ver1.0.jpg | |
domain === "sharedmedia.grahamdigital.com" || | |
// http://pic.sucaibar.com/pic/201606/20/b79d344371_184_320.jpg | |
// http://pic.sucaibar.com/pic/201606/20/b79d344371.jpg | |
(domain === "pic.sucaibar.com" && src.match(/\/pic\/+[0-9]{6}\/+/)) || | |
// https://mediaassets.wxyz.com/photo/2018/05/22/poster_22074aded9dd4214ae42eb62a4404769_87749608_ver1.0_320_240.jpg | |
// https://mediaassets.wxyz.com/photo/2018/05/22/poster_22074aded9dd4214ae42eb62a4404769_87749608_ver1.0.jpg | |
domain === "mediaassets.wxyz.com") { | |
// http://s3.amazonaws.com/nxs-wkrgtv-media-us-east-1/photo/2018/02/17/Bail_Bonds_0_34542427_ver1.0_320_180.jpg | |
// http://s3.amazonaws.com/nxs-wkrgtv-media-us-east-1/photo/2018/02/17/Bail_Bonds_0_34542427_ver1.0.jpg | |
newsrc = src.replace(/_[0-9]+_[0-9]+(\.[^/.]*)$/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nosub === "win4000.com" && domain.match(/^pic[0-9]*\./)) { | |
// http://pic1.win4000.com/pic/0/84/7a3a1529019.jpg?down | |
return src.replace(/\?down$/, ""); // removes forced downloading | |
} | |
if (domain === "bobcat.grahamdigital.com") { | |
// https://bobcat.grahamdigital.com/image/upload/view?width=320&height=180&method=crop&url=https://sharedmedia.grahamdigital.com/photo/2019/05/19/1140268550_1558269024435_21870279_ver1.0_1280_720.jpg | |
// https://sharedmedia.grahamdigital.com/photo/2019/05/19/1140268550_1558269024435_21870279_ver1.0_1280_720.jpg | |
return src.replace(/^[a-z]+:\/\/[^/]*\/image\/+upload\/+view.*?[?&]url=([^&]*).*?$/, "$1"); | |
} | |
if ((domain === "image.photohito.k-img.com" || | |
domain === "photohito.k-img.com") && | |
src.indexOf("/uploads/") >= 0) { | |
// http://image.photohito.k-img.com/uploads/photo33/user32067/a/7/a77a9f46cca054d6d488ab039382d140/a77a9f46cca054d6d488ab039382d140_s.jpg | |
// http://image.photohito.k-img.com/uploads/photo33/user32067/a/7/a77a9f46cca054d6d488ab039382d140/a77a9f46cca054d6d488ab039382d140_o.jpg | |
// http://photohito.k-img.com/uploads/photo82/user81866/5/4/54cc586ea0191c8ad108c74bfff0a09d/54cc586ea0191c8ad108c74bfff0a09d_l.jpg | |
// http://photohito.k-img.com/uploads/photo82/user81866/5/4/54cc586ea0191c8ad108c74bfff0a09d/54cc586ea0191c8ad108c74bfff0a09d_o.jpg -- 4000x6016 | |
// o, l, s | |
return src.replace(/_[a-z]*(\.[^/]*)/, "_o$1"); | |
} | |
if (domain === "eiga.k-img.com") { | |
// https://eiga.k-img.com/images/person/83193/300x.jpg | |
// https://eiga.k-img.com/images/person/83193/original.jpg | |
// https://eiga.k-img.com/images/buzz/67970/b4763ecf68d81f0e/160.jpg?1505989880 | |
// https://eiga.k-img.com/images/buzz/67970/b4763ecf68d81f0e.jpg?1505989880 | |
// https://eiga.k-img.com/images/movie/87956/photo/2a98637bcfd5c2c2/640.jpg?1531358070 | |
// https://eiga.k-img.com/images/movie/87956/photo/2a98637bcfd5c2c2.jpg?1531358070 | |
// https://eiga.k-img.com/images/anime/news/104504/photo/ca6b941587bf429e/640.jpg | |
// https://eiga.k-img.com/images/anime/news/104504/photo/ca6b941587bf429e.jpg | |
return src | |
.replace(/(\/images\/+[a-z]+\/+(?:[a-z]+\/+)?[0-9]+\/)[0-9]+x(?:[0-9]+)?(\.[^/.]*)$/, "$1original$2") | |
.replace(/(\/images\/+[a-z]+\/+(?:[a-z]+\/+)?[0-9]+\/(?:[a-z]+\/)?[0-9a-f]+)\/[0-9]+(\.[^/.]*)$/, "$1$2"); | |
} | |
if (domain === "akiba-souken.k-img.com" || | |
// http://image.akiba-souken.k-img.com/images/article/000/602/t640_602346.jpg | |
// http://image.akiba-souken.k-img.com/images/article/000/602/602346.jpg | |
domain === "image.akiba-souken.k-img.com") { | |
// https://akiba-souken.k-img.com/assets/images/article/000/602/t640_602120.jpg | |
// https://akiba-souken.k-img.com/assets/images/article/000/602/602120.jpg | |
// thanks to fireattack on github: https://github.com/qsniyg/maxurl/issues/199 | |
// https://akiba-souken.k-img.com/thumbnail/images/official/71/71cea5d83dfa537e053b8b8e31b98649.jpg?w=60&h=60 | |
// https://akiba-souken.k-img.com/assets/images/official/71/71cea5d83dfa537e053b8b8e31b98649.jpg | |
return src | |
.replace(/\/thumbnail\/+images\/+/, "/assets/images/") | |
.replace(/(\/images\/+[^/]+\/+(?:(?:[0-9]{3}\/+){2}|[0-9a-f]{2}\/+))(?:t[0-9]+_)?([^/]+?)(?:[?#].*)?$/, "$1$2"); | |
} | |
if (domain === "image.yes24.com") { | |
// http://image.yes24.com/goods/24213246/S | |
// http://image.yes24.com/goods/24213246 | |
// http://image.yes24.com/goods/24213246/L | |
// http://image.yes24.com/dms/201802/%EC%8A%A4%EC%B9%B4%EC%9D%B4-%EA%B3%A0%EC%A0%95%EC%9A%B1.jpg | |
// http://image.yes24.com/Goods/57840388/800x0 | |
// http://image.yes24.com/goods/76075109/L -- 3000x3000 | |
// http://image.yes24.com/goods/76175408/1150x1150 -- 150x150 | |
return src.replace(/(:\/\/[^/]*\/goods\/[0-9]+)(?:\/S)?$/i, "$1/L"); | |
} | |
if (domain === "img.danawa.com" || | |
// http://wallpoper.com/images/00/26/57/27/taylor-momsen_00265727_thumb.jpg | |
// http://wallpoper.com/images/00/26/57/27/taylor-momsen_00265727.jpg | |
domain_nowww === "wallpoper.com" || | |
// https://cdn.maximsfinest.com/930d55d5bae81ab5ab5c4bca2a2eab8b42e503f85bbd48086c9a9c89945f12e7_thumb.jpg | |
domain === "cdn.maximsfinest.com" || | |
// https://www.phileweb.com/news/photo/d-av/437/43780/2_thumb.jpg | |
// https://www.phileweb.com/news/photo/d-av/437/43780/2.jpg | |
domain_nowww === "phileweb.com" || | |
// https://imgpic.org/upload/images/e91e1c3d-938d-f6b0-ab71-593bcbf52253_thumb.jpg | |
// https://imgpic.org/upload/images/e91e1c3d-938d-f6b0-ab71-593bcbf52253.jpg | |
(domain_nowww === "imgpic.org" && src.indexOf("/upload/images/") >= 0) || | |
// http://img10.imgdino.com/images/21620746826144988852_thumb.jpg | |
// http://img10.imgdino.com/images/21620746826144988852.jpg | |
(domain_nosub === "imgdino.com" && domain.match(/img[0-9]*\.imgdino\.com/) && src.indexOf("/images/") >= 0) || | |
// https://storage.cobak.co/uploads/1524570414485762_2d28e314d0_thumb.jpg | |
(domain === "storage.cobak.co" && src.indexOf("/uploads/") >= 0) || | |
// https://mycotopia.net/uploads/monthly_11_2016/post-147969-0-17237500-1479361240_thumb.jpg | |
(domain_nowww === "mycotopia.net" && src.indexOf("/uploads/") >= 0) || | |
// http://static.becomegorgeous.com/img/arts/2011/Apr/28/4386/pixielotthairstyles_thumb.jpg | |
(domain === "static.becomegorgeous.com" && src.indexOf("/img/") >= 0) || | |
// http://i.imagepow.com/2-68/barbara-palvin-10_thumb.jpg | |
domain === "i.imagepow.com" || | |
// https://cdn2.techadvisor.co.uk/cmsdata/features/3651601/gta6rumoursgtaonline_thumb.png | |
(domain_nosub === "techadvisor.co.uk" && domain.match(/^cdn[0-9]*\./)) || | |
// http://www.funtasticecards.com/postcard/images/quote-japanese-animated-girl-love_thumb.gif | |
(domain_nowww === "funtasticecards.com" && src.indexOf("/images/") >= 0) || | |
// https://www.hockey-live.sk/images/ovechkin_thumb.jpg | |
(domain_nowww === "hockey-live.sk" && src.indexOf("/images/") >= 0) || | |
// https://khaandaniha.ir/Upload/Public/Content/Images/1398/03/04/0159330066e_thumb.jpeg | |
(domain_nowww === "khaandaniha.ir" && src.match(/\/Upload\/+Public\/+Content\/+Images\/+/)) || | |
// https://imagecurl.com/images/25047944450893600587_thumb.jpg | |
(domain_nowww === "imagecurl.com" && src.indexOf("/images/") >= 0) || | |
// https://www.mediavida.com/imagenes/2009/7/cine-musica-libros-y-comics/62369_harry_potter_misterio_principe_2009_0_thumb.jpg | |
(domain_nowww === "mediavida.com" && src.indexOf("/imagenes/") >= 0) || | |
// http://img.twitrer.com/upload/2/53/253ba5e34957482d46887976a716d5d3_thumb.jpg | |
(domain === "img.twitrer.com" && src.indexOf("/upload/") >= 0) || | |
// http://img.beevar.com/upload/1/92/192d08bf43ce0dc8_thumb.jpg | |
(domain === "img.beevar.com" && src.indexOf("/upload/") >= 0) || | |
// http://adobe-abid.waphall.com/images/Adobe-Logos-HD_1_thumb.png | |
(domain === "adobe-abid.waphall.com" && src.indexOf("/images/") >= 0) || | |
// https://cdn2.cdnme.se/cdn/9-2/631991/images/2011/emmood-3_143059858_thumb.jpg | |
(domain_nosub === "cdnme.se" && src.indexOf("/images/") >= 0) || | |
// https://znews-photo.zadn.vn/Uploaded/neg_yslewlx/2019_04_26/selenagomezwedayapril252019billboard1548_thumb.jpg | |
// https://znews-photo.zadn.vn/uploaded/neg_yslewlx/2019_04_26/selenagomezwedayapril252019billboard1548.jpg | |
(domain_nosub === "zadn.vn" && src.match(/\/uploaded\//i)) || | |
// https://www.bellazon.com/main/uploads/monthly_01_2015/post-40923-0-58758100-1422215257_thumb.jpg | |
domain_nowww === "bellazon.com") { | |
// http://img.danawa.com/cms/img/2010/11/19/%C7%D6%C6%D1_thumb.png | |
newsrc = src.replace(/_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1"); | |
if (newsrc !== src) | |
return newsrc; | |
} | |
if (domain_nosub === "pcgames.com.cn" && domain.match(/^img[0-9]*\./)) { | |
// http://img.pcgames.com.cn/images/upload/upc/tx/gamephotolib/1510/29/c3/14626065_1446106131090_small.jpg | |
// http://img.pcgames.com.cn/images/upload/upc/tx/gamephotolib/1510/29/c3/14626065_1446106131090.jpg | |
// http://img0.pcgames.com.cn/pcgames/1412/19/4672783_11386975_980x1200_0_thumb.jpg | |
// http://img0.pcgames.com.cn/pcgames/1412/19/4672783_11386975_980x1200_0.jpg | |
// http://img0-arch.pconline.com.cn/pcgames/1412/19/4672783_11386975.jpg -- doesn't work | |
// http://img0-arch.pconline.com.cn/pcgames/1412/19/4672783_11386975_0.jpg -- doesn't work | |
return src.replace(/_(?:thumb|small|medium)(\.[^/.]*)$/, "$1"); | |
} | |
if (domain_nowww === "mosaicon.hu" && src.indexOf("/wallpapers/") >= 0) { | |
// http://mosaicon.hu/wallpapers/sztarok/fullhd-hatterkep-368046462-rihanna_thumb.jpg | |
// http://mosaicon.hu/wallpapers/sztarok/fullhd-hatterkep-368046462-rihanna_largethumb.jpg | |
// http://mosaicon.hu/wallpapers/sztarok/fullhd-hatterkep-368046462-rihanna.jpg | |
return src.replace(/_(?:large)?thumb(\.[^/.]*)$/, "$1"); | |
} | |
if (domain === "item.ssgcdn.com") { | |
// http://item.ssgcdn.com/58/31/79/item/1000023793158_i1_1000.jpg | |
// http://item.ssgcdn.com/58/31/79/item/1000023793158_i1.jpg | |
return src.replace(/(\/item\/[^/]*)_[0-9]+(\.[^/.]*)$/, "$1$2"); | |
} | |
if (domain_nosub === "coupangcdn.com" && domain.match(/thumbnail[0-9]*\.coupangcdn\.com/)) { | |
// https://thumbnail3.coupangcdn.com/thumbnails/remote/48x48ex/image/product/image/vendoritem/2016/11/02/3054079121/95e6ce14-cd6e-43ef-89af-6f50046c19e8.jpg | |
// https://image3.coupangcdn.com/image/product/image/vendoritem/2016/11/02/3054079121/95e6ce14-cd6e-43ef-89af-6f50046c19e8.jpg | |
return src | |
.replace(/thumbnail([0-9]*\.coupangcdn\.com)/, "image$1") | |
.replace(/\/thumbnails\/remote\/[^/]*\//, "/"); | |
} | |
if (domain === "image.notepet.co.kr") { | |
// http://image.notepet.co.kr/resize/540x-/seimage/20160127%2F201601271000_61120010294826_1.jpg | |
return src.replace(/\/resize\/[^/]*\//, "/"); | |
} | |
// https://echosting.cafe24.com/Main/ | |
if (domain_nowww === "koreamg.com" || | |
// http://yufit.co.kr/web/product/medium/201802/1402_shop1_771117.jpg | |
domain_nowww === "yufit.co.kr" || | |
// http://lovelanc.com/web/product/small/gz20171225_j32.jpg | |
// http://lovelanc.com/web/product/big/gz20171225_j32.jpg | |
domain_nowww === "lovelanc.com" || | |
// http://mimibabi.com/web/product/small/201606/8563_shop1_617841.jpg | |
domain_nowww === "mimibabi.com" || | |
// https://akamai.poxo.com/socal/getbarrel.com/web/product/medium/go_eve-white_black0.jpg | |
// https://akamai.poxo.com/socal/getbarrel.com/web/product/big/go_eve-white_black00.jpg | |
// https://akamai.poxo.com/socal/getbarrel.com/web/product/tiny/w_eve_rashguard_papayawht0.jpg | |
// https://akamai.poxo.com/socal/getbarrel.com/web/product/big/w_eve_rashguard_papayawht00.jpg | |
domain === "akamai.poxo.com" || | |
// http://getbarrel.com/web/product/big/go_eve-white_black00.jpg | |
domain_nowww === "getbarrel.com" || | |
// http://sexypet.co.kr/web/product/medium/201711/856_shop1_379496.jpg | |
// http://sexypet.co.kr/web/product/big/201711/856_shop1_379496.jpg -- upscaled? | |
domain_nowww === "sexypet.co.kr" || | |
// https://withdrama.net/web/product/medium/withdrama_901.jpg | |
// https://withdrama.net/web/product/big/withdrama_901.jpg | |
domain_nowww === "withdrama.net" || | |
// http://bookculture.co.kr/product/detail.html?product_no=107573&cate_no=164&display_group=1 | |
// http://bookculture.co.kr/web/product/medium/201905/a9dd5883f1bc104d7ddeb6c4faf9a1b1.jpg | |
// http://bookculture.co.kr/web/product/big/201905/90957b7ab17a2d2ca15f038b9220c295.jpg | |
//domain_nowww === "bookculture.co.kr" || | |
// http://www.comicbookclub.co.kr/product/detail.html?product_no=4155&cate_no=1&display_group=3 | |
// http://www.comicbookclub.co.kr/web/product/tiny/201902/09b398f5996561b79ae039567e888e33.jpg | |
// http://www.comicbookclub.co.kr/web/product/big/201902/2db1140f95b2b01f650064710bc3a32e.jpg | |
//domain_nowww === "comicbookclub.co.kr" || | |
// http://fncstore.com/web/product/small/201805/624_shop1_15268628600267.jpg | |
domain_nowww === "fncstore.com") { | |
// http://koreamg.com/web/product/big/201511/1198_shop1_844046.jpg | |
newsrc = src.replace(/\/web\/+product\/+(?:tiny|small|medium)\//, "/web/product/big/"); | |
if (newsrc !== src) { | |
return [newsrc, newsrc.replace(/0(\.[^/.]*)(?:[?#].*)?$/, "00$1")]; | |
} | |
} | |
if (domain_nosub === "mynavi.jp") { | |
// https://news.mynavi.jp/article/20160717-a030/images/004.jpg | |
// https://news.mynavi.jp/article/20160717-a030/images/004l.jpg | |
// https://news.mynavi.jp/article/20180219-586202/index_images/index.jpg/iapp | |
// https://news.mynavi.jp/article/20180219-586202/index_images/index.jpg | |
// https://news.mynavi.jp/article/20180219-586202/images/001l.jpg | |
return src | |
.replace(/\/index_images\/[^/]*(?:\/[^/]*)?$/, "/images/001l.jpg") | |
.replace(/\/images\/([0-9]+)(\.[^/.]*)$/, "/images/$1l$2"); | |
} | |
if (domain === "cdn.deview.co.jp") { | |
// https://cdn.deview.co.jp/imgs/news_image.img.php?am_file=757f7eac8208248ef689a9c8f195cc0a.jpg&am_width=10&am_height=10 | |
// https://cdn.deview.co.jp/imgs/news_image.img.php?am_file=8a0abbef91348f3b44e2225c761fe8e8.jpg&am_width=0&am_height=0 | |
// https://cdn.deview.co.jp/imgs/news/8/a/0/8a0abbef91348f3b44e2225c761fe8e8.jpg | |
//return src.replace(/\/imgs\/news_image\.img\.php.*?(am_file=[^&]*).*/, "/imgs/news_image.img.php?$1&am_width=0&am_height=0"); | |
return src.replace(/\/imgs\/news_image\.img\.php.*?am_file=([^&])([^&])([^&])([^&]*).*/, "/imgs/news/$1/$2/$3/$1$2$3$4"); | |
} | |
if (domain === "imgcache.dealmoon.com") { | |
// http://imgcache.dealmoon.com/fsvr.dealmoon.com/dealmoon/082/3a3/a3a/e33/eed/93a/ffd/aae/d10/29e/37.jpg_600_0_15_363b.jpg | |
// http://fsvr.dealmoon.com/dealmoon/082/3a3/a3a/e33/eed/93a/ffd/aae/d10/29e/37.jpg | |
return src.replace(/.*?:\/\/[^/]*\/(.*?)(\.[^/._]*)_[^/]*?$/, "http://$1$2"); | |
} | |
// magento | |
if (domain === "www.usmall.us" || | |
// http://www.sofiehouse.co/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/E/l/Elegant-Sweetheart-Long-Gold-Sequined-Taylor-Swift-Red-Carpet-Celebrity-Dress_2.jpg | |
// http://www.sofiehouse.co/media/catalog/product/E/l/Elegant-Sweetheart-Long-Gold-Sequined-Taylor-Swift-Red-Carpet-Celebrity-Dress_2.jpg | |
domain === "www.sofiehouse.co" || | |
// https://www.thecelebritydresses.com/media/catalog/product/cache/1/small_image/295x/040ec09b1e35df139433887a97daa66f/t/a/taylor_swift_red_lace_party_dress_iheartradio_music_festival_2012_dresses_5.jpg | |
// https://www.thecelebritydresses.com/media/catalog/product/cache/1/image/650x/040ec09b1e35df139433887a97daa66f/t/a/taylor_swift_red_lace_party_dress_iheartradio_music_festival_2012_dresses_5.jpg | |
// https://www.thecelebritydresses.com/media/catalog/product/t/a/taylor_swift_red_lace_party_dress_iheartradio_music_festival_2012_dresses_5.jpg | |
domain === "www.thecelebritydresses.com" || | |
// https://www.celebredcarpetdresses.com/media/catalog/product/cache/8/image/9df78eab33525d08d6e5fb8d27136e95/t/a/taylor-swift-at-the-2012-billboard-music-awards-2.jpg | |
// https://www.celebredcarpetdresses.com/media/catalog/product/t/a/taylor-swift-at-the-2012-billboard-music-awards-2.jpg | |
domain === "www.celebredcarpetdresses.com" || | |
// https://www.minimal.co.id/media/catalog/product/cache/1/small_image/252x/7b8fef0172c2eb72dd8fd366c999954c/1/3/136_02_02dsc00253ed.jpg | |
// https://www.minimal.co.id/media/catalog/product/1/3/136_02_02dsc00253ed.jpg | |
domain === "www.minimal.co.id" || | |
// http://www.bridesmaidca.ca/media/catalog/product/cache/1/thumbnail/56x90/9df78eab33525d08d6e5fb8d27136e95/B/D/BD2305-1832-01/BD2305CA1832-Mermaid-Trumpet-Blue-Stretch-Satin-V-Neck-Floor-Length-Bridesmaid-Dresses-11.jpg | |
// http://www.bridesmaidca.ca/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/B/D/BD2305-1832-01/BD2305CA1832-Mermaid-Trumpet-Blue-Stretch-Satin-V-Neck-Floor-Length-Bridesmaid-Dresses-31.jpg | |
// http://www.bridesmaidca.ca/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/B/D/BD1749-03/Short-Lace-and-Tulle-Black-Bridesmaid-Dress-BD-CA1749-33.jpg | |
// http://www.bridesmaidca.ca/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/B/D/BD1749-02/Short-Lace-and-Tulle-Black-Bridesmaid-Dress-BD-CA1749-32.jpg | |
domain === "www.bridesmaidca.ca" || // doesn't work | |
// http://www.sisley-paris.com/ko-KR/media/catalog/product/cache/3/sisley_hd_image/450x/9df78eab33525d08d6e5fb8d27136e95/sisley_hd_image/3473311704000.jpg | |
// http://www.sisley-paris.com/ko-KR/media/catalog/product/cache/3/sisley_hd_image/9df78eab33525d08d6e5fb8d27136e95/sisley_hd_image/3473311704000.jpg | |
// http://www.sisley-paris.com/ko-KR/media/catalog/product/sisley_hd_image/3473311704000.jpg | |
domain === "www.sisley-paris.com" || | |
// https://d2ovdo5ynwfl3w.cloudfront.net/media/catalog/product/cache/5/image/03deeb199a85666540b12534551b8531/0/0/001CH-003-03172-1_1_1-DS.jpg | |
// https://d2ovdo5ynwfl3w.cloudfront.net/media/catalog/product/0/0/001CH-003-03172-1_1_1-DS.jpg -- doesn't work | |
domain === "d2ovdo5ynwfl3w.cloudfront.net" || | |
// https://d1cizyvjjqnss7.cloudfront.net/media/catalog/product/cache/1/image/700x700/af097278c5db4767b0fe9bb92fe21690/2/0/2017-9-26-isabelle-31991_2_2.jpg | |
// https://d1cizyvjjqnss7.cloudfront.net/media/catalog/product/2/0/2017-9-26-isabelle-31991_2_2.jpg | |
domain === "d1cizyvjjqnss7.cloudfront.net" || | |
// https://executiveponies.com/media/catalog/product/cache/2/thumbnail/90x144/9df78eab33525d08d6e5fb8d27136e95/3/2/327a6104_copy.jpg | |
// https://executiveponies.com/media/catalog/product/3/2/327a6104_copy.jpg | |
domain_nowww === "executiveponies.com" || | |
// http://www.trendygowns.com/media/catalog/product/cache/1/image/1190x1920/5e06319eda06f020e43594a9c230972d/s/c/scd303-03/isabel-lucas-2011-met-ball-dresses-ball-gown-floor-length-charmeuse-dresses(scd303)-33.jpg | |
domain_nowww === "trendygowns.com" || | |
// https://www.bramimi.com/static/ecommerce/251/251360/media/catalog/product/cache/1/thumbnail/40x56/9df78eab33525d08d6e5fb8d27136e95/b/a/ba0b1a68-1e98-43cf-bd66-97b4e41700fc-549-0000006e636e9c3d/www.bramimi.com-m05-11.jpeg | |
// https://www.bramimi.com/static/ecommerce/251/251360/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/b/a/ba0b1a68-1e98-43cf-bd66-97b4e41700fc-549-0000006e636e9c3d/www.bramimi.com-m05-31.jpeg | |
// 11.jpeg -> 31.jpeg | |
//domain_nowww === "bramimi.com" || | |
domain === "www.lizandliz.com" || | |
// https://cdn-4.cdp.pl/media/catalog/product/cache/1/image/x100/17f82f742ffe127f42dca9de82fb58b1/7/3/7321930350823a_1_1.jpg | |
// https://cdn-4.cdp.pl/media/catalog/product/7/3/7321930350823a_1_1.jpg | |
(domain_nosub === "cdp.pl" && domain.match(/^cdn-[0-9]+\./)) || | |
src.match(/(?:\/media)?\/catalog\/product\/cache\/(?:[0-9]*\/[^/]*\/)?(?:[0-9]+x(?:[0-9]+)?\/)?[0-9a-f]{32}\//)) { | |
// https://www.sonassi.com/blog/knowledge-base/deconstructing-the-cache-image-path-on-magento | |
// | |
// http://www.usmall.us/media/catalog/product/cache/16/image/600x600/d58d44b981214661663244ef00ea7e30/1/7/17_9__2.jpg | |
// http://www.usmall.us/media/catalog/product/cache/16/image/d58d44b981214661663244ef00ea7e30/1/7/17_9__2.jpg | |
// https://www.lizandliz.com/media/catalog/product/cache/4/thumbnail/492x705/9df78eab33525d08d6e5fb8d27136e95/t/a/taylor-swift-red-dress-cma-awards-2013-02.jpg | |
// https://www.lizandliz.com/media/catalog/product/cache/4/thumbnail/9df78eab33525d08d6e5fb8d27136e95/t/a/taylor-swift-red-dress-cma-awards-2013-02.jpg | |
// https://www.lizandliz.com/media/catalog/product/t/a/taylor-swift-red-dress-cma-awards-2013-02.jpg | |
// https://www.lizandliz.com/media/catalog/product/cache/4/image/492x705/9df78eab33525d08d6e5fb8d27136e95/t/a/taylor-swift-red-dress-cma-awards-2013-01.jpg | |
// https://www.lizandliz.com/media/catalog/product/cache/4/image/9df78eab33525d08d6e5fb8d27136e95/t/a/taylor-swift-red-dress-cma-awards-2013-01.jpg | |
// https://www.lizandliz.com/media/catalog/product/t/a/taylor-swift-red-dress-cma-awards-2013-01.jpg | |
// https://www.naturehills.com/media/catalog/product/cache/5643cdae475c4be953fc8c21f6960dc2/f/o/forsythia-fiesta-medium-shrub-425x425.jpg | |
// https://www.naturehills.com/media/catalog/product/f/o/forsythia-fiesta-medium-shrub-425x425.jpg | |
/*return src | |
.replace(/(\/cache\/[0-9]*\/)small_image\//, "$1/image/") | |
.replace(/\/(thumbnail|image)\/[0-9]+x[0-9]+\//, "/$1/");*/ | |
newsrc = src.replace(/\/+cache\/+(?:[0-9]*\/+[^/]*\/+)?(?:[0-9]*x[0-9]*\/+)?[0-9a-f]{32}\/+((?:.\/+.\/+)|(?:[^/]*\/+))([^/]*)$/, "/$1$2"); | |
if (newsrc !== src) | |
return newsrc; | |
// doesn't work: | |
/*newsrc = src.replace(/(\/+cache\/+[0-9]+\/+)thumbnail\/+[0-9]+x[0-9]+\/+/, "$1image/"); | |
if (newsrc !== src) | |
return newsrc;*/ | |
//return src.replace(/\/image\/[0-9]+x[0-9]+\//, "/image/"); | |
} | |
if (domain === "cdn.okdress.co.nz" || | |
// https://www.promshopau.com/media/catalog/product/cache/1/small_image/400x600/va/cymz2697/5wxh3src.jpg?1496649473 | |
// forbidden | |
(domain_nowww === "promshopau.com" && false)) { | |
// https://cdn.okdress.co.nz/media/catalog/product/cache/1/small_image/400x600/va/crqx3207/yhhv4ee5.jpg?1497240049 | |
// https://cdn.okdress.co.nz/media/catalog/product/va/crqx3207/yhhv4ee5.jpg?1497240049 | |
return src.replace(/(\/media\/catalog\/product\/)cache\/[0-9]*\/[^/]*\/[0-9]+x[0-9]+\//, "$1"); | |
} | |
if (domain === "img.nextmag.com.tw") { | |
// http://img.nextmag.com.tw//campaign/28/640x_dc09fc97b8f881555c21e8df08f39d01.jpg | |
return src.replace(/\/[0-9]+x(?:[0-9]+)?_([^/]*)$/, "/$1"); | |
} | |
if (domain_nosub === "meitudata.com") { | |
// http://mvimg10.meitudata.com/568fd904846585397.jpg!thumb320 | |
return src.replace(/![^/]*$/, ""); | |
} | |
if (domain === "www.shogakukan.co.jp") { | |
// https://www.shogakukan.co.jp/thumbnail/books/09682221 | |
// https://www.shogakukan.co.jp/thumbnail/snsbooks/09682221 | |
return src.replace(/\/thumbnail\/books\//, "/thumbnail/snsbooks/"); | |
} | |
if (domain === "images.sysapi.mtg.now.com") { | |
// https://images.sysapi.mtg.now.com/mposter/album/m/VASB00139622A_m.jpg | |
// https://images.sysapi.mtg.now.com/mposter/album/o/VASB00139622A_o.jpg | |
return src.replace(/\/[a-z]\/([^/]*)_[a-z](\.[^/.]*)$/, "/o/$1_o$2"); | |
} | |
if (domain_nosub === "lst.fm" && domain.match(/img[0-9]*[^.]*\.lst\.fm/)) { | |
// http://img2-ak.lst.fm/i/u/174s/ac79a7aa21de5694760ad9228e15c6a5.png | |
// http://img2-ak.lst.fm/i/u/ac79a7aa21de5694760ad9228e15c6a5.png | |
// http://img2-ak.lst.fm/i/u/avatar170s/42333f92bcb14d3e89e3ad2d5e800977.jpg | |
// http://img2-ak.lst.fm/i/u/42333f92bcb14d3e89e3ad2d5e800977.jpg | |
return src.replace(/(\/i\/[a-z]\/)(?:avatar)?[0-9]+s\//, "$1"); | |
} | |
if (domain === "www.hdwallpapers.in" || | |
// http://www.bhmpics.com/thumbs/empty_road_on_a_mountain-t2.jpg | |
// http://www.bhmpics.com/walls/empty_road_on_a_mountain-wide.jpg | |
// doesn't work for all: | |
// http://www.bhmpics.com/wallpapers/selena_gomez_gq-852x480.jpg | |
domain_nowww === "bhmpics.com" || | |
domain_nowww === "freshwallpapers.in") { | |
// https://www.hdwallpapers.in/download/selena_gomez_2018_4k_8k-1440x2560.jpg | |
// https://www.hdwallpapers.in/thumbs/2018/selena_gomez_2018_4k_8k-t2.jpg | |
// https://www.hdwallpapers.in/walls/selena_gomez_2018_4k_8k-wide.jpg | |
// http://freshwallpapers.in/thumbs/sonam_kapoor_sexy_wallpaper-t1.jpg | |
// http://freshwallpapers.in/walls/sonam_kapoor_sexy_wallpaper-wide.jpg | |
return src | |
.replace(/\/(?:download|thumbs)\//, "/walls/") | |
.replace(/-[^-_/.]*(\.[^/.]*)$/, "-wide$1"); | |
} | |
if (false && (domain.indexOf("images.deezer.com") >= 0 || | |
domain.indexOf("images.dzcdn.net") >= 0)) { | |
// not reliable, can upscale | |
// http://e-cdn-images.deezer.com/images/artist/7d026f08b34a098e270a663839d8ae8e/200x200-000000-80-0-0.jpg | |
// http://e-cdn-images.deezer.com/images/artist/7d026f08b34a098e270a663839d8ae8e/99999999999x99999999999-000000-100-0-0.jpg -- 1200x1200, unscaled | |
// http://e-cdn-images.deezer.com/images/artist/7d026f08b34a098e270a663839d8ae8e/99999999999x0-000000-100-0-0.jpg -- 800x1200, unscaled, more height, less detail | |
// https://e-cdns-images.dzcdn.net/images/artist/aca61b38901f884503e9cb0fbf0b93b4/200x200-000000-80-0-0.jpg | |
// https://e-cdns-images.dzcdn.net/images/artist/aca61b38901f884503e9cb0fbf0b93b4/99999999999x0-000000-100-0-0.jpg -- 801x1200, definitely scaled | |
// http://e-cdn-images.deezer.com/images/artist/076659ecd6d7dc5042df677a6a24ea9a/500x500.jpg | |
// https://e-cdns-images.dzcdn.net/images/artist/7d026f08b34a098e270a663839d8ae8e/999x999.jpg | |
return src.replace(/\/[0-9]+x[0-9]+-[0-9]+-[0-9]+-[0-9]+-[0-9]+(\.[^/.]*)$/, "/99999999999x0-000000-100-0-0$1"); | |
} | |
if (domain === "cdn.wallpaper.com") { | |
// https://cdn.wallpaper.com/main/styles/wp_medium_grid/s3/2018/02/astonmartindb11volantefrontsideview.jpg | |
// https://cdn.wallpaper.com/main/astonmartindb11volantefrontsideview.jpg | |
// https://cdn.wallpaper.com/main/styles/wp_large/s3/2018/02/go_gardenofrussolo.jpg | |
// https://cdn.wallpaper.com/main/go_gardenofrussolo.jpg | |
// https://cdn.wallpaper.com/main/styles/responsive_920w_scale/s3/baldacchino-by-stanton-williams-c-saverio-lombardi-vallauri_006_0.jpg | |
// https://cdn.wallpaper.com/main/baldacchino-by-stanton-williams-c-saverio-lombardi-vallauri_006_0.jpg | |
// https://cdn.wallpaper.com/main/styles/wp_large/s3/l-kosmosbywonderglass_photoleonardoduggento02.jpg | |
// https://cdn.wallpaper.com/main/kosmosbywonderglass_photoleonardoduggento02.jpg | |
// https://cdn.wallpaper.com/main/styles/wp_medium_grid/s3/2018/04/hermessalonedelmobile2018.jpg | |
// https://cdn.wallpaper.com/main/2018/04/hermessalonedelmobile2018.jpg | |
// https://cdn.wallpaper.com/main/hermessalonedelmobile2018.jpg -- doesn't work | |
regex = /\/main\/styles\/[^/]*\/[^/]*\/(.*\/)?(?:l-)?([^/]*)/; | |
return [src.replace(regex, "/main/$2"), src.replace(regex, "/main/$1$2")]; | |
//return src.replace(/\/styles\/[^/]*\/s[0-9]*\/[0-9]+\/[0-9]+\/([^/]*)$/, "/$1"); | |
} | |
if (domain === "cdn.wallpaper.com") { | |
// https://cdn.wallpaper.com/main/styles/responsive_920w_scale/s3/baldacchino-by-stanton-williams-c-saverio-lombardi-vallauri_006_0.jpg | |
return src.replace(/\/main\/styles\/[^/]*\/[^/]*\//, "/"); | |
} | |
if (domain === "static.warthunder.com") { | |
// https://static.warthunder.com/upload/image/wallpapers/_thumbs/280x/magach_3_1920x1080_logo_com_73e9f4582d0d841a6abf1f2c75beaf4d.jpg | |
// https://static.warthunder.com/upload/image/wallpapers/magach_3_1920x1080_logo_com_73e9f4582d0d841a6abf1f2c75beaf4d.jpg | |
return src.replace(/\/_thumbs\/[0-9]+x(?:[0-9]+)?\//, "/"); | |
} | |
if (domain === "cdn.wallpaperdirect.com") { | |
// https://cdn.wallpaperdirect.com/shared-assets/images/products/094269_163x163_thumb.jpg | |
// https://cdn.wallpaperdirect.com/shared-assets/images/products/094269orig.jpg | |
return src.replace(/(\/[0-9]*)_[^/.]*(\.[^/.]*)$/, "$1orig$2"); | |
} | |
if (domain_nosub === "bamcontent.com") { | |
// https://nhl.bamcontent.com/images/photos/291203200/2568x1444/cut.jpg | |
// https://nhl.bamcontent.com/images/photos/291203200/raw.jpg | |
return src.replace(/(\/images\/photos\/[0-9]*\/)[0-9]+x[0-9]+\/[^/.]*(\.[^/.]*)$/, "$1raw$2"); | |
} | |
if (domain_nosub === "mail.ru" && | |
domain.match(/filed.*\.mail\.ru$/) && | |
src.match(/:\/\/[^/]*\/pic/)) { | |
// https://filed17-26.my.mail.ru/pic?url=https%3A%2F%2Fcontent-17.foto.my.mail.ru%2Fmail%2Faudioknigi.online%2F_musicplaylistcover%2Fi-760.jpg&sigt=a2f820fc2604a1526688be9b380e7e24&ts=1519171200&mw=156&mh=156&croped=1 | |
// https://content-17.foto.my.mail.ru/mail/audioknigi.online/_musicplaylistcover/i-760.jpg | |
// https://filed17-26.my.mail.ru/pic?url=https%3A%2F%2Fcontent-25.foto.my.mail.ru%2Fdraw%2Fmusic%2Fplaylist%2F4649700154%2Ftracks%2Fcover%3F1505444126&mw=&mh=&sig=7f6083a07f204187e8d76ecde06923a9 | |
// https://content-25.foto.my.mail.ru/draw/music/playlist/4649700154/tracks/cover?1505444126 | |
return decodeURIComponent(src.replace(/.*\/pic.*?[?&]url=([^&]*).*?$/, "$1")); | |
} | |
if (domain_nosub === "mail.ru" && | |
domain.match(/^avt.*\.foto\.mail\.ru/)) { | |
// https://avt-30.foto.mail.ru/mail/philimonova56/_avatar180? | |
// https://avt-30.foto.mail.ru/mail/philimonova56/_avatar | |
// https://avt-30.foto.mail.ru/mail/philimonova56/_avatarbig | |
return src.replace(/\/_avatar[0-9]*(?:[?#].*)?$/, "/_avatarbig"); | |
} | |
if (domain === "games.mail.ru") { | |
// https://games.mail.ru/pre_1000x1000_resize/pic/pc/article/2018/1/f3d5c09.jpeg | |
// https://games.mail.ru/pic/pc/article/2018/1/f3d5c09.jpeg | |
// https://games.mail.ru/pre_xl_resize/pic/pc/gallery/b6/63/ae529711.jpeg | |
// https://games.mail.ru/pic/pc/gallery/b6/63/ae529711.jpeg | |
// https://games.mail.ru/pre_700x393_resize/hotbox/content_files/article/2019/06/11/d2cf96b1bf514e9e8b9c641d76da8879.png | |
// https://games.mail.ru/hotbox/content_files/article/2019/06/11/d2cf96b1bf514e9e8b9c641d76da8879.png | |
return src.replace(/\/pre_(?:[0-9]+x[0-9]+|[a-z]+)_resize\/+(pic|hotbox)\/+/, "/$1/"); | |
} | |
if (domain === "mg.soupingguo.com") { | |
// http://mg.soupingguo.com/attchment2/AppImg/110x73/2016/01/26/c2d275d9-ffc4-4ca3-86d0-70f717f789dc.jpg | |
// http://mg.soupingguo.com/attchment2/AppImg/0x0/2016/01/26/c2d275d9-ffc4-4ca3-86d0-70f717f789dc.jpg | |
return src.replace(/(\/attchment[^/]*\/[^/]*Img\/)[0-9]+x[0-9]+\//, "$10x0/"); | |
} | |
if (domain === "img.yaplog.jp") { | |
// http://img.yaplog.jp/img/17/mo/y/a/m/yamu98/24/24094.jpg | |
// http://img.yaplog.jp/img/17/pc/y/a/m/yamu98/24/24094.jpg | |
return src.replace(/(\/img\/[^/]*\/)mo\//, "$1pc/"); | |
} | |
if (domain === "www.hochi.co.jp") { | |
// http://www.hochi.co.jp/photo/20180220/20180220-OHT1I50164-L.jpg | |
// L, T, N | |
return src.replace(/-[A-Z](\.[^/.]*)$/, "-L$1"); | |
} | |
if (domain_nosub === "wikispaces.com") { | |
// https://sweetteaandscience.wikispaces.com/file/view/111.jpg/539497268/460x315/111.jpg | |
// https://sweetteaandscience.wikispaces.com/file/view/111.jpg | |
return src.replace(/(\/view\/[^/]*\.[^/]*)\/.*?$/, "$1"); | |
} | |
if (false && domain === "cdn.mdpr.jp") { | |
// wip | |
// https://cdn.mdpr.jp/photo/images/9b/c4b/244c1e_129677c70cb47761dc2243224aee09db43068c042b172144.jpg | |
// aligned: | |
// https://cdn.mdpr.jp/photo/images/9b/c4b/244c1e_ 129677c70cb47761dc2243224aee09db43068c042b172144.jpg | |
// https://cdn.mdpr.jp/photo/images/9b/c4b/w700c-ez_129677c70cb47761dc22432245d7f66fdae68c042b172144.jpg | |
// https://mdpr.jp/photo/images/2016/02/21/e_1997280.jpg | |
// https://mdpr.jp/photo/images/2016/02/21/1997280.jpg | |
// https://mdpr.jp/photo/detail/3179461 | |
// https://cdn.mdpr.jp/photo/images/73/014/w700c-ez_923f6fd535f050dd50a0c1844e00845cfda81f02f814a731.jpg | |
// https://mdpr.jp/news/detail/1319088 | |
// https://mdpr.jp/photo/images/2014/01/17/600c-_1181978.jpg | |
// https://mdpr.jp/photo/images/2014/01/17/e_1181978.jpg | |
// https://cdn.mdpr.jp/photo/images/de/f96/w700c-ez_5f31b9207ce33a447ceff0069f5057adc853bf29a07018d6.jpg | |
// https://cdn.mdpr.jp/photo/images/ff/357/w720c-e_86733135a9e323a66d900f9f12614d8db65c8521f7b16fdc.jpg | |
// http://mdpr.jp/news/detail/1672412 | |
// https://cdn.mdpr.jp/photo/images/cb/aba/0_3c3602ff62198c52f8e11a287cfbf2542e7a8470e1cfdbc2.jpg | |
// https://mdpr.jp/photo/detail/2714005 | |
// https://cdn.mdpr.jp/photo/images/4d/9be/0_eb892aca2b6f152631f04dbe0b7ec6d67bad6240e6373cd5.jpg | |
// https://cdn.mdpr.jp/photo/images/4d/9be/0_eb892aca2b6f152631f04dbe05759594bb7ec6d6e6373cd5.jpg - broken | |
// https://cdn.mdpr.jp/photo/images/4d/9be/w700c-ez_eb892aca2b6f152631f04dbe05759594bb7ec6d6e6373cd5.jpg | |
// https://cdn.mdpr.jp/photo/images/4d/9be/eb892aca2b6f152631f04dbe0b7ec6d67bad6240e6373cd5.jpg | |
} | |
if (domain_nowww === "sponichi.co.jp") { | |
// http://www.sponichi.co.jp/entertainment/news/2017/12/12/jpeg/20171211s00041000381000p_thum.jpg | |
// http://www.sponichi.co.jp/entertainment/news/2017/12/12/jpeg/20171211s00041000381000p_view.jpg | |
// https://www.sponichi.co.jp/entertainment/news/2018/04/01/jpeg/20180331s00041000612000p_thum.jpg | |
// https://www.sponichi.co.jp/entertainment/news/2018/04/01/jpeg/20180331s00041000612000p_view.jpg | |
return { | |
url: src.replace(/_thum(\.[^/.]*)$/, "_view$1"), | |
can_head: false | |
}; | |
} | |
if (domain === "thumbnail.image.rakuten.co.jp") { | |
// source: | |
// https://books.rakuten.co.jp/rb/12499383/?scid=af_pc_etc&sc2id=af_111_1_10000673 | |
// | |
// https://thumbnail.image.rakuten.co.jp/@0_mall/book/cabinet/3966/4907953093966.jpg?_ex=76x76 | |
// https://tshop.r10s.jp/book/cabinet/3966/4907953093966.jpg?fitin=200:300&composite-to=*,*|200:300 | |
// https://shop.r10s.jp/book/cabinet/3966/4907953093966.jpg | |
return src.replace(/.*?:\/\/[^/]*\/@[^/]*\/([^?]*).*?$/, "http://shop.r10s.jp/$1"); | |
} | |
if (domain === "tshop.r10s.com") { | |
// https://tshop.r10s.com/4bf21390-ec8c-11e4-9162-005056b75bda/upload/np/A685-M1.jpg?_ex=330x330 | |
// https://shop.r10s.com/4bf21390-ec8c-11e4-9162-005056b75bda/upload/np/A685-M1.jpg | |
return src.replace(/:\/\/[^/]*\/(.*?)(?:[?#].*)?$/, "://shop.r10s.com/$1"); | |
} | |
if (domain_nowww === "billboard-japan.com" || | |
// https://fotos.jornaldacidadeonline.com.br/uploads/fotos/650x0_1472919049_979715540.jpeg -- upscaled | |
// https://fotos.jornaldacidadeonline.com.br/uploads/fotos/1472919049_979715540.jpeg | |
domain === "fotos.jornaldacidadeonline.com.br") { | |
// http://www.billboard-japan.com/scale/news/00000057/57632/800x_image.jpg - upscaled | |
// http://www.billboard-japan.com/scale/news/00000057/57632/image.jpg | |
// http://www.billboard-japan.com/scale/news/00000057/57981/170x170_image.jpg | |
// http://www.billboard-japan.com/scale/news/00000057/57981/image.jpg | |
// http://www.billboard-japan.com/scale/news/00000044/44202/x200_sub_image99541.jpg | |
// http://www.billboard-japan.com/scale/news/00000044/44202/sub_image99541.jpg | |
return src.replace(/\/(?:[0-9]+)?x(?:[0-9]+)?_([^/]*)$/, "/$1"); | |
} | |
if (domain_nosub === "tsite.jp" && | |
domain.indexOf("top.tsite.jp") >= 0 && | |
src.indexOf("/contents_image/") >= 0) { | |
// http://cdn.top.tsite.jp/static/top/sys/contents_image/038/778/192/38778192_0_sl.jpg | |
// http://cdn.top.tsite.jp/static/top/sys/contents_image/038/778/192/38778192_0.jpg | |
// http://cdn.top.tsite.jp/static/top/sys/contents_image/034/410/417/34410417_0_rl.jpg | |
// http://cdn.top.tsite.jp/static/top/sys/contents_image/034/410/417/34410417_0.jpg | |
// http://top.tsite.jp/static/top/sys/contents_image/038/780/255/38780255_133963.jpg | |
// http://cdn.top.tsite.jp/static/top/sys/contents_image/media_image/035/136/128/35136128_0.jpeg | |
//return src.replace(/_sl(\.[^/.]*)$/, "$1"); | |
return src.replace(/(\/[0-9]+)_[0-9]+(?:_[^/.]+)?(\.[^/.]*)$/, "$1_0$2"); | |
} | |
if (domain === "www.sanspo.com") { | |
// http://www.sanspo.com/geino/images/20171108/geo17110807000004-m1.jpg | |
// http://www.sanspo.com/geino/images/20171108/geo17110807000004-p1.jpg | |
// http://www.sanspo.com/geino/images/20140818/oth14081805030011-s3.jpg | |
// http://www.sanspo.com/geino/images/20140818/oth14081805030011-p3.jpg | |
// http://www.sanspo.com/geino/images/20140818/oth14081805030011-m1.jpg | |
// http://www.sanspo.com/geino/images/20140818/oth14081805030011-p1.jpg | |
// | |
// p, m, n, s | |
// https://sankei2img.durasite.net/images//uploads/creative/image1/111885/20180221_bmw_150x150.jpg | |
// http://www.sankei.com/images/news/180221/lif1802210001-p1.jpg -- unrelated? | |
return src.replace(/(\/images\/[0-9]*\/[^/]*-)[a-z]([0-9]+\.[^/.]*)$/, "$1p$2"); | |
} | |
if (domain === "www.sonymusicshop.jp") { | |
// https://www.sonymusicshop.jp/img/1/item/SRC/L00/000/SRCL000009658_SHOP__576_320_102400_jpg.jpg?tf=gray | |
// https://www.sonymusicshop.jp/img/1/item/SRC/L00/000/SRCL000009658_SHOP__9999999999999999_9999999999999999_102400_jpg.jpg?tf=gray | |
// https://www.sonymusicshop.jp/img/1/item/SRC/L00/000/SRCL000009658_SHOP_jpg.jpg | |
//return src.replace(/__[0-9]+_[0-9]+(_[0-9]+_[a-z]+\.[a-z]*)(?:\?.*)?$/, "__9999999999999999_9999999999999999$1"); | |
return src.replace(/__[0-9]+_[0-9]+_[0-9]+_([a-z]+\.[a-z]*)(?:\?.*)?$/, "_$1"); | |
} | |
if (domain_nowww === "prtimes.jp") { | |
// https://prtimes.jp/i/13546/1204/thumb/68x45/d13546-1204-280004-0.jpg | |
// https://prtimes.jp/i/13546/1204/original/d13546-1204-280004-0.jpg | |
// https://prtimes.jp/api/file.php?c=13546&r=1204&t=thumb&d=68x45&f=d13546-1204-280004-0.jpg&e=rss | |
// https://prtimes.jp/i/13546/1204/original/d13546-1204-280004-0.jpg | |
// https://prtimes.jp/i/13546/826/resize/d13546-826-654115-3.jpg | |
// https://prtimes.jp/i/13546/826/original/d13546-826-654115-3.jpg | |
// https://prtimes.jp/i/19948/3/origin/d19948-3-285038-0.jpg -- 3072x4608 | |
// https://prtimes.jp/i/19948/3/original/d19948-3-285038-0.jpg -- 3072x4608 | |
// https://prtimes.jp/img/664/1363/thumb/d664-1363-463559-0.jpg | |
// https://prtimes.jp/img/664/1363/original/d664-1363-463559-0.jpg | |
if (/\/api\/file\.php\?/.test(src)) { | |
var c = url.searchParams.get("c"); | |
var r = url.searchParams.get("r"); | |
var f = url.searchParams.get("f"); | |
return "https://prtimes.jp/i/" + c + "/" + r + "/original/" + f; | |
} | |
return src | |
.replace(/\/thumb\/+(?:[0-9]+x[0-9]+\/+)?(d[0-9]+-)/, "/original/$1") | |
.replace(/\/resize\/+([^/]*)$/, "/original/$1"); | |
} | |
if (domain_nosub === "vietbao.vn") { | |
// http://vietbao.vn/The-gioi-giai-tri/Hot-girl-Le-Huyen-Anh-Mong-xuan-nay-co-nguoi-som-hoi-cuoi/2147799797/235/ - article | |
// http://img.vietbao.vn/images/280/vn888/hot/v2014/cropping-1518416661-27540512-1833666450263816-461803420186171326-n.jpeg | |
// http://img.vietbao.vn/images/0/vn888/hot/v2014/cropping-1518416661-27540512-1833666450263816-461803420186171326-n.jpeg - larger, not full | |
// http://a9.vietbao.vn/images/vn888/hot/v2014/cropping-1518416661-27540512-1833666450263816-461803420186171326-n.jpeg - same | |
// | |
// filename can be anything for img.vietbao.vn, but not for a9.vietbao.vn | |
// http://img.vietbao.vn/images/0/vn999/upload/hangct/27540512_1833666450263816_461803420186171326_n.jpg - full | |
// http://a9.vietbao.vn/images/vn999/upload/hangct/27540512_1833666450263816_461803420186171326_n.jpg - orig | |
// | |
// http://vietbao.vn/The-gioi-giai-tri/Thieu-gia-giau-nhat-Trung-Quoc-lao-dao-vi-tin-chong-lung-tang-sieu-xe-tien-ty-cho-Tara/55932319/235/ - article | |
// http://a9.vietbao.vn/images/vn888/hot/v2014/cropping-1515483333-nhat-trung-quoc-lao-dao-vi-tin-chong-lung-tang-sieu-xe-tien-ty-cho-t-ara-1.jpeg | |
// http://a9.vietbao.vn/images/vn999/55/2018/01/20180109-ia-giau-nhat-trung-quoc-lao-dao-vi-tin-chong-lung-tang-sieu-xe-tien-ty-cho-t-ara-1.jpg | |
return src | |
//.replace(/\/images\/[0-9]+\//, "/images/0/") | |
.replace(/:\/\/img\.vietbao\.vn\/images\/[0-9]+\//, "://a9.vietbao.vn/images/"); | |
} | |
if (domain === "media.tinnong.net.vn") { | |
// http://media.tinnong.net.vn/uploaded/Images/Thumb/2018/02/22/Toi_dau_don_roi_bo_anh_de_den_voi_mot_nguoi_khong_binh_thuong_vi_mot_chu_hieu2_2202144833.jpg | |
// http://media.tinnong.net.vn/uploaded/Images/Original/2018/02/22/Toi_dau_don_roi_bo_anh_de_den_voi_mot_nguoi_khong_binh_thuong_vi_mot_chu_hieu2_2202144833.jpg | |
return src.replace(/\/Images\/[^/]*\//, "/Images/Original/"); | |
} | |
if (domain === "images.kienthuc.net.vn" || | |
// https://images.khoeplus24h.vn/zoomh/500/uploaded/anhtuan/2016_09_27/3/taylor-switt-dep-the-nao-moi-lan-xuat-hien-ben-ban-trai.jpg | |
// https://images.khoeplus24h.vn/uploaded/anhtuan/2016_09_27/3/taylor-switt-dep-the-nao-moi-lan-xuat-hien-ben-ban-trai.jpg | |
domain === "images.khoeplus24h.vn") { | |
// http://images.kienthuc.net.vn/zoomh/500/uploaded/nguyenvan/2018_02_22/vang/vang-1_CUMV.jpg | |
// http://images.kienthuc.net.vn/uploaded/nguyenvan/2018_02_22/vang/vang-1_CUMV.jpg | |
return src.replace(/\/zoom[a-z]\/[0-9]*\//, "/"); | |
} | |
if (domain === "rez.cdn.kul.vn" || | |
// https://www.glamour.pl/media/cache/gallery_view/uploads/media/default/0003/13/8ad84df2c40d8f28bf21ef23b50967e212f697fc.jpeg | |
// https://www.glamour.pl/uploads/media/default/0003/13/8ad84df2c40d8f28bf21ef23b50967e212f697fc.jpeg | |
domain_nowww === "glamour.pl" || | |
// https://al3arabi.com/media/cache/homepage_editors_pick_content/uploads/cms/standalone-content/thumbnail/5acb65aedaa4d.jpg | |
// https://al3arabi.com/uploads/cms/standalone-content/thumbnail/5acb65aedaa4d.jpg | |
domain_nowww === "al3arabi.com" || | |
// http://www.starwars-holocron.net/media/cache/iloweb_news_front_blog/uploads/media/files/actualites/star-wars-rogue-one/emilia-clarke-1.jpg | |
// http://www.starwars-holocron.net/uploads/media/files/actualites/star-wars-rogue-one/emilia-clarke-1.jpg | |
domain_nowww === "starwars-holocron.net" || | |
// https://www.elle.pl/media/cache/default_view/uploads/media/default/0001/88/elle-style-awards-2014_20.jpeg | |
// https://www.elle.pl/uploads/media/default/0001/88/elle-style-awards-2014_20.jpeg | |
domain_nowww === "elle.pl" || | |
// https://www.gala.pl/media/cache/default_view/uploads/media/default/0003/51/8a53ff2963b8374d1aeefc68d73069421ab0edb1.jpeg | |
// https://www.gala.pl/uploads/media/default/0003/51/8a53ff2963b8374d1aeefc68d73069421ab0edb1.jpeg | |
domain_nowww === "gala.pl" || | |
// https://i.moveek.com/media/cache/full_fixed/media/ee46a470620916e0524592d6859d54a467ad2fb6.jpg | |
// https://i.moveek.com/media/ee46a470620916e0524592d6859d54a467ad2fb6.jpg | |
domain === "i.moveek.com" || | |
// https://shukrabar.nagariknetwork.com/media/cache/nagarik_thumbnail_389_283/uploads/media/Camila%20Cabello.jpg | |
// https://shukrabar.nagariknetwork.com/uploads/media/Camila%20Cabello.jpg | |
//domain === "shukrabar.nagariknetwork.com" || | |
// http://longtake.it/media/cache/medium_poster/uploads/du/dunkirk/poster-dunkirk.jpeg | |
// http://longtake.it/uploads/du/dunkirk/poster-dunkirk.jpeg | |
domain_nowww === "longtake.it" || | |
src.match(/^[a-z]+:\/\/[^/]*\/+media\/+cache\/+[^/]*\/+uploads\/+media\//)) { | |
// http://rez.cdn.kul.vn/media/cache/thumbnail_16x10_672x420/uploads/media/thumbnail/59db/29/thumbnail_16x9_t-ara4.jpg | |
// http://rez.cdn.kul.vn/uploads/media/kul/59db/28/kul_news_t-ara4.jpg | |
return src.replace(/\/media\/+cache\/+[^/]*\//, "/"); | |
} | |
if (domain_nowww === "themebeta.com") { | |
// https://www.themebeta.com/media/cache/400x225/files/windows/images/201701/19/c712fcf69f2a15163f1e9cfbdc62b5f8.jpeg | |
// https://www.themebeta.com/files/windows/images/201701/19/c712fcf69f2a15163f1e9cfbdc62b5f8.jpeg | |
return src.replace(/\/media\/+cache\/+[0-9]+x[0-9]+\/+files\//, "/files/"); | |
} | |
if (domain === "static.kstyle.com") { | |
// http://static.kstyle.com/stf/ad622b862613fa27895446d446bca918.jpg/r.580x0 | |
// http://static.kstyle.com/stf/ad622b862613fa27895446d446bca918.jpg | |
return src.replace(/\/r\.[0-9]+x[0-9]+$/, ""); | |
} | |
if (amazon_container === "lifesite-cache" || | |
// http://www.golocalprov.com/cache/images/cached/cache/images/remote/http_s3.amazonaws.com/images.golocalprov.com/Emma_Watson_dress_360_533_90.jpg | |
// http://s3.amazonaws.com/images.golocalprov.com/Emma_Watson_dress.jpg | |
domain_nowww === "golocalprov.com" || | |
// https://d1lfxha3ugu3d4.cloudfront.net/assets/system-images/made/assets/system-images/remote/https_d1lfxha3ugu3d4.cloudfront.net/exhibitions/images/2020_African_Arts_Global_Conversations_41.222_threequarter_right_PS11_1719w_729_800.jpg | |
// https://d1lfxha3ugu3d4.cloudfront.net/exhibitions/images/2020_African_Arts_Global_Conversations_41.222_threequarter_right_PS11_1719w.jpg | |
// needs to be updated somehow for this url: | |
// https://d1lfxha3ugu3d4.cloudfront.net/assets/system-images/made/assets/system-images/remote/https_d1lfxha3ugu3d4.cloudfront.net/assets/system-images/made/assets/system-images/remote/https_d1lfxha3ugu3d4.cloudfront.net/exhibitions/images/2020_African_Arts_Global_Conversations_41.222_threequarter_right_PS11_1719w_600_658_220_220_c1_c_t_0_0.jpg | |
(domain === "d1lfxha3ugu3d4.cloudfront.net" && /\/assets\/+system-images\/+remote\/+http/.test(src)) || | |
// https://cdn2.thelineofbestfit.com/images/remote/https_cdn2.thelineofbestfit.com/galleries/2014/11_clean_bandit-bts_rdn1016_bc.jpg | |
// https://cdn2.thelineofbestfit.com/galleries/2014/11_clean_bandit-bts_rdn1016_bc.jpg | |
(domain_nosub === "thelineofbestfit.com" && domain.match(/^cdn[0-9]*\.thelineofbestfit\.com/))) { | |
// https://lifesite-cache.s3.amazonaws.com/images/made/images/remote/https_s3.amazonaws.com/lifesite/man_and_woman_arguing_with_signs_810_500_55_s_c1.jpg | |
// https://s3.amazonaws.com/lifesite/man_and_woman_arguing_with_signs.jpg | |
// https://lifesite-cache.s3.amazonaws.com/images/made/images/remote/https_s3.amazonaws.com/lifesite/Billy_Graham__finger_pointing_720_470_55_s_c1.jpg | |
// https://s3.amazonaws.com/lifesite/Billy_Graham__finger_pointing.jpg | |
// https://s3.amazonaws.com/lifesite-cache/images/made/images/remote/https_s3.amazonaws.com/lifesite/man_and_woman_arguing_with_signs_810_500_55_s_c1.jpg | |
// https://s3.amazonaws.com/lifesite/man_and_woman_arguing_with_signs.jpg | |
return src | |
.replace(/.*\/(?:system-)?images\/+remote\/+(https?)_(.*?)(?:(?:_[0-9]+)?_[0-9]+_[0-9]+(?:_[a-z]_[a-z][0-9])?)?(\.[^/.]*)$/, "$1://$2$3"); | |
} | |
if (domain === "d1lfxha3ugu3d4.cloudfront.net") { | |
// https://d1lfxha3ugu3d4.cloudfront.net/exhibitions/images/2020_African_Arts_Global_Conversations_41.222_threequarter_right_PS11_1719w.jpg | |
// https://d1lfxha3ugu3d4.cloudfront.net/exhibitions/images/2020_African_Arts_Global_Conversations_41.222_threequarter_right_PS11.jpg | |
return src.replace(/(\/exhibitions\/+images\/+[^/]+)_[0-9]+w(\.[^/.]+)(?:[?#].*)?$/, "$1$2"); | |
} | |
if (domain_nosub === "fap.to" || | |
// http://images.imagefap.com/images/thumb/62/114/1146416891.jpg | |
// http://images.imagefap.com/images/full/62/114/1146416891.jpg | |
(domain_nosub === "imagefap.com" && /^(?:www|images)\./.test(domain))) { | |
// http://x3.fap.to/images/thumb/62/114/1146416891.jpg | |
// http://x3.fap.to/images/full/62/114/1146416891.jpg | |
// http://x.fap.to/h175q90/images/full/57/401/401519803.jpg | |
// http://x.fap.to/images/full/57/401/401519803.jpg | |
// http://x.fap.to/h60q90c35.444444x10.666667x57.555556x25.407407/images/full/57/401/401519803.jpg | |
// http://x.fap.to/images/full/57/401/401519803.jpg | |
return src | |
.replace(/:\/\/x[0-9]*\./, "://x.") // temporary error? | |
.replace(/(:\/\/[^/]*\/)[a-z0-9.]+\/images\//, "$1images/") | |
.replace(/\/images\/[a-z]*\//, "/images/full/"); | |
} | |
if (domain === "cdn.imagefap.com") { | |
// cdn.* contains a required signature (?end=...&secure=...), but images.* works | |
return src.replace(/:\/\/cdn\.(.*?)(?:[?#].*)?$/, "://images.$1"); | |
} | |
if (domain === "www.gannett-cdn.com" && | |
src.indexOf("/-ip-/") >= 0) { | |
// https://www.gannett-cdn.com/-ip-/https://media.gannett-cdn.com/29906170001/29906170001_5720100432001_5720093419001-vs.jpg?pubId=29906170001&quality=10 | |
// https://media.gannett-cdn.com/29906170001/29906170001_5720100432001_5720093419001-vs.jpg | |
return src.replace(/.*?\/-ip-\//, ""); | |
} | |
if (domain === "cdn.mainichi.jp") { | |
// https://cdn.mainichi.jp/vol1/2018/02/19/20180219p2g00m0sp060000p/4.jpg | |
// https://cdn.mainichi.jp/vol1/2018/02/19/20180219p2g00m0sp060000p/9.jpg | |
return src.replace(/\/[0-9]+(\.[^/.]*)$/, "/9$1"); | |
} | |
if (domain === "img.evbuc.com") { | |
// forces download? | |
// https://img.evbuc.com/https%3A%2F%2Fcdn.evbuc.com%2Fimages%2F37338904%2F45878487997%2F1%2Foriginal.jpg?w=1000&rect=0%2C236%2C1890%2C945&s=53555af848d3afd2d9a9b2cb603d9516 | |
return decodeURIComponent(src.replace(/.*:\/\/[^/]*\/([^?]*).*/, "$1")); | |
} | |
if (domain === "img.cdandlp.com") { | |
// https://img.cdandlp.com/2017/08/imgL/118890893.jpg | |
// https://img.cdandlp.com/2017/08/imgS/118890893.jpg | |
// https://img.cdandlp.com/img_ssl/1274211304-73249-1.jpg | |
// https://ring.cdandlp.com/sleazyx/photo_grande/115030078-3.jpg | |
// https://content.cdandlp.com/superflyrecords/catalogue/40106.jpg | |
// https://www.soundfinder.jp/img/products/102065/1507215600/59d727b5-151c-4c14-8768-62417697bade/1180602.jpg | |
// https://img.cdandlp.com/2014/09/imgM/117153395.jpg | |
return src.replace("/imgS/", "/imgL/").replace("/imgM/", "/imgL/"); | |
} | |
if (domain === "walter.trakt.tv") { | |
// https://walter.trakt.tv/images/shows/000/082/248/fanarts/thumb/04342b5daf.jpg.webp | |
// https://walter.trakt.tv/images/shows/000/082/248/fanarts/full/04342b5daf.jpg.webp | |
return src.replace(/\/thumb\/([^/]*)$/, "/full/$1"); | |
} | |
if (domain === "cdn.apk-cloud.com" || | |
// https://apk-dl.com/detail/screenshot/Xg3DPZyvIegjKqZll4OzWpK41znXorY76j3MDa759ZNFkCv72CRkHI9yUcPx_Q1V2g=h300.png | |
// https://apk-dl.com/detail/screenshot/Xg3DPZyvIegjKqZll4OzWpK41znXorY76j3MDa759ZNFkCv72CRkHI9yUcPx_Q1V2g=h0.png | |
domain_nowww === "apk-dl.com") { | |
// http://cdn.apk-cloud.com/detail/screenshot/sYpEJNqANEbHAkHjLbYOOdRyn3sIhEtHgF8qSEpKXE38UR0RpI4X7b2eQfTQIiiljCrL.png | |
// http://cdn.apk-cloud.com/detail/screenshot/sYpEJNqANEbHAkHjLbYOOdRyn3sIhEtHgF8qSEpKXE38UR0RpI4X7b2eQfTQIiiljCrL=h400.png | |
return src | |
.replace(/(?:=[a-z][0-9]*)?(\.[^/.]*)$/, "=h0$1"); | |
} | |
if (domain_nosub === "polyvoreimg.com") { | |
// down? | |
// https://ak2.polyvoreimg.com/cgi/img-thing/size/l/tid/3884489.jpg | |
// https://www.polyvore.com/cgi/img-thing?.out=jpg&size=l&tid=3884489 | |
// https://cfc.polyvoreimg.com/cgi/img-set/.sig/9ndQlKC89OQ6ut3OULMg/cid/230139023/id/tsrtpPy65xGAdEGMmAc2pA/size/c1024x1024.jpg | |
// https://cfc.polyvoreimg.com/cgi/img-set/cid/230139023/id/tsrtpPy65xGAdEGMmAc2pA/size/c1024x1024.jpg | |
// https://cfc.polyvoreimg.com/cgi/img-set/cid/230139023/size/c1024x1024.jpg | |
// https://www.polyvore.com/cgi/img-set?.out=jpg&.sig=9ndQlKC89OQ6ut3OULMg&cid=230139023&id=tsrtpPy65xGAdEGMmAc2pA&size=c1024x1024 | |
// http://ak2.polyvoreimg.com/cgi/img-set/cid/39051735/id/XHw8HlYH4RGZj34mPmiMmg/size/y.jpg | |
// http://ak2.polyvoreimg.com/cgi/img-set/cid/39051735/size/y.jpg | |
// y, x, e, l, g, m, s, t | |
var cginame = src.replace(/.*\/cgi\/([^/]*)\/.*/, "$1"); | |
var paramsbase = src.replace(/.*\/cgi\/[^/]*/, ""); | |
var params = paramsbase.replace(/\/([^/]*)\/([^/]*)/g, "$1=$2&"); | |
params = params | |
.replace(/(.*)\.([^/.&]*)&$/, ".out=$2&$1"); | |
return "https://www.polyvore.com/cgi/" + cginame + "?" + params; | |
} | |
if (domain === "www.polyvore.com" && | |
src.indexOf("/cgi/") >= 0) { | |
// https://www.polyvore.com/cgi/img-thing?.out=jpg&size=l&tid=95293327 | |
// https://www.polyvore.com/cgi/img-thing?.out=jpg&size=y&tid=95293327 | |
// https://www.polyvore.com/cgi/img-set?.out=jpg&.sig=9ndQlKC89OQ6ut3OULMg&cid=230139023&id=tsrtpPy65xGAdEGMmAc2pA&size=c1024x1024 | |
// https://www.polyvore.com/cgi/img-set?.out=jpg&.sig=9ndQlKC89OQ6ut3OULMg&cid=230139023&id=tsrtpPy65xGAdEGMmAc2pA&size=c99999x99999 | |
return src | |
.replace(/\/img-set(.*?)&size=[^&]*/, "/img-set$1&size=c99999x99999"); | |
//.replace(/\/img-thing(.*?)&size=[^&]*/, "/img-thing$1&size=y"); // doesn't work well | |
} | |
if (domain === "aliyun-cdn.hypebeast.cn" && | |
src.indexOf("/hypebeast.com/") >= 0) { | |
// https://aliyun-cdn.hypebeast.cn/hypebeast.com/wp-content/blogs.dir/4/files/2018/01/louis-vuitton-2018-fall-winter-50.jpg?q=75&w=400 | |
return src.replace(/.*:\/\/[^/]*\//, "http://"); | |
} | |
if (domain_nowww === "girlscene.nl" || | |
// https://www.trendalert.nl/thumb/200x200/ckfinder/userfiles/images/Fashionscene/Beelden%202016/April%202016/Cara%20Delevingne%20Fashionscene14.jpg | |
// https://www.trendalert.nl/ckfinder/userfiles/images/Fashionscene/Beelden%202016/April%202016/Cara%20Delevingne%20Fashionscene14.jpg | |
domain_nowww === "trendalert.nl") { | |
// https://www.girlscene.nl/thumb/782x0/ckfinder/userfiles/images/Beauty/2015/mei/Braun%20Silk-epil%209%20-%20Jessica%20Alba.jpg -- stretched | |
// https://www.girlscene.nl/ckfinder/userfiles/images/Beauty/2015/mei/Braun%20Silk-epil%209%20-%20Jessica%20Alba.jpg | |
return src.replace(/\/thumb\/+[0-9]+x[0-9]+\/+ckfinder\/+/, "/ckfinder/"); | |
} | |
if (domain_nowww === "hdfullfilmizle.com" || | |
// https://www.sinemangoo.org/thumb/183x284/uploads/film/2017/01/arrival-gelis-turkce-altyazili-izle-255.jpg | |
// https://www.sinemangoo.org/uploads/film/2017/01/arrival-gelis-turkce-altyazili-izle-255.jpg | |
domain_nowww === "sinemangoo.org") { | |
// http://www.hdfullfilmizle.com/thumb/131x150/uploads/oyuncu/2018/04/milla-jovovich-744.jpg | |
// http://www.hdfullfilmizle.com/uploads/oyuncu/2018/04/milla-jovovich-744.jpg | |
return src.replace(/\/thumb\/+[0-9]+x[0-9]+\/+uploads\//, "/uploads/"); | |
} | |
if (domain_nowww === "hairstyleinsider.com" || | |
// https://sites.eveyo.com/thumbnail.php?file=images/Lady_Amelia_279174293.jpg&size=article_large | |
// https://sites.eveyo.com/files.php?file=images/Lady_Amelia_279174293.jpg | |
// https://sites.eveyo.com/files/images/Lady_Amelia_279174293.jpg | |
domain === "sites.eveyo.com" || | |
// http://24sata.info/files.php?file=news/2016/Mart_2016/lopez_haljina_1_199914503.jpg | |
// http://24sata.info/files/news/2016/Mart_2016/lopez_haljina_1_199914503.jpg | |
domain_nowww === "24sata.info" || | |
// http://www.alankabout.com/thumbnail.php?file=photo_galleries/celebrities/western_celebrities/milla_jovovich/Milla-Jovovich-37.JPG&size=article_medium | |
// http://www.alankabout.com/files/photo_galleries/celebrities/western_celebrities/milla_jovovich/Milla-Jovovich-37.JPG | |
domain_nowww === "alankabout.com" || | |
// https://www.cosmopolitan.rs/files.php?file=2017/11/ovo_nije_bio_crveni_tepih_na_kakav_smo_navikli_747279824.jpg | |
// https://www.cosmopolitan.rs/files/2017/11/ovo_nije_bio_crveni_tepih_na_kakav_smo_navikli_747279824.jpg | |
domain_nowww === "cosmopolitan.rs" || | |
domain_nowww === "elle.rs") { | |
// https://www.hairstyleinsider.com/thumbnail.php?file=2015/Emma_Watson_Bobby_Pinned_Updo_629726963.jpg&size=article_large | |
// https://www.hairstyleinsider.com/files/2015/Emma_Watson_Bobby_Pinned_Updo_629726963.jpg | |
// https://www.hairstyleinsider.com/files.php?file=2015/Emma_Watson_Bobby_Pinned_Updo_629726963.jpg | |
// http://www.elle.rs/files.php?file=images/2018/01/kate_i_naomi_na_reviji_1_169904615.jpg | |
// http://www.elle.rs/thumbnail.php?file=images/2018/02/gucci_moschino_fall_winter_2018_abs___983890735.jpg&size=summary_large | |
// http://www.elle.rs/files.php?file=images/2018/02/gucci_moschino_fall_winter_2018_abs___983890735.jpg | |
// https://www.elle.rs/files/images/2018/02/gucci_moschino_fall_winter_2018_abs___983890735.jpg | |
//return src.replace(/\/thumbnail.php.*?file=([^&]*).*/, "/files.php?file=$1"); | |
return src.replace(/\/(?:thumbnail|files).php.*?file=([^&]*).*/, "/files/$1"); | |
} | |
if (domain_nowww === "zkpm.net" || | |
// https://www.zyzpes.com/img.php?url=http://inews.gtimg.com/newsapp_match/0/4982172462/0 | |
// http://inews.gtimg.com/newsapp_match/0/4982172462/0 | |
domain_nowww === "zyzpes.com" || | |
// https://yoptel.ru/vk/img.php?url=https://pp.userapi.com/c849320/v849320861/dda30/ooRORXzkxuU.jpg | |
// https://pp.userapi.com/c849320/v849320861/dda30/ooRORXzkxuU.jpg | |
domain_nowww === "yoptel.ru" || | |
// http://img.viyuedu.com/img.php?url=http://mmbiz.qpic.cn/mmbiz/HiaNy8LPboMzo9U0Dg38XibJQia6sicM2D26icquxZic0eRPVRNLGDSMYu2tgnZ6RjqOaZEJ3608def8gpZEicX2WAM2Q/0?wx_fmt=jpeg | |
// http://mmbiz.qpic.cn/mmbiz/HiaNy8LPboMzo9U0Dg38XibJQia6sicM2D26icquxZic0eRPVRNLGDSMYu2tgnZ6RjqOaZEJ3608def8gpZEicX2WAM2Q/0?wx_fmt=jpeg | |
domain === "img.viyuedu.com") { | |
// http://www.zkpm.net/img.php?url=http://mmbiz.qpic.cn/mmbiz_jpg/Hey2N7g1r13EPyvv9cxxvy7uYsT9NZuAkbahJGeFoQGO9r0Wwicu7Oh2YiceaMgfObxznBkn4hx61JzCYnwWwMNA/0?wx_fmt=jpeg | |
// http://mmbiz.qpic.cn/mmbiz_jpg/Hey2N7g1r13EPyvv9cxxvy7uYsT9NZuAkbahJGeFoQGO9r0Wwicu7Oh2YiceaMgfObxznBkn4hx61JzCYnwWwMNA/0 | |
return src.replace(/.*\/img\.php.*?url=(.*)/, "$1"); | |
} | |
if (domain_nowww === "aidu360.com") { | |
// https://www.aidu360.com/img.php?u=http://inews.gtimg.com/newsapp_match/0/4587106415/0 | |
// http://inews.gtimg.com/newsapp_match/0/4587106415/0 | |
newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+img\.php\?(?:.*?&)?u=([^&]*).*?$/, "$1"); | |
if (newsrc !== src) | |
return decodeuri_ifneeded(newsrc); | |
} | |
if (domain === "img.xiaohuazu.com") { | |
// http://img.xiaohuazu.com/?tag=a&url=mmbizz-zqpicz-zcn/mmbiz_jpg/bm1gUegOAnjmwzCcibTuzlH2uqYZnAgPqZHUjew7icxAIAGIkfUdxFaBMuGs5wVEiboyXw4dS94DHATt6ibPhgCK1Q/0?wx_fmt=jpeg | |
// http://mmbiz.qpic.cn/mmbiz_jpg/bm1gUegOAnjmwzCcibTuzlH2uqYZnAgPqZHUjew7icxAIAGIkfUdxFaBMuGs5wVEiboyXw4dS94DHATt6ibPhgCK1Q/0?wx_fmt=jpeg | |
return src.replace(/.*?[?&]url=(.*)/, "$1").replace(/z-z/g, ".").replace(/^/, "http://"); | |
} | |
if (domain === "www.viewsofia.com") { | |
// https://www.viewsofia.com/upload/fck_editor_thumb/fck_editor/Image/LV18/_VUI0653.jpg | |
// https://www.viewsofia.com/upload/fck_editor/fck_editor/Image/LV18/_VUI0653.jpg | |
return src.replace("/fck_editor_thumb/", "/fck_editor/"); | |
} | |
if (domain_nosub === "condenast.ru" && domain.indexOf(".static.media.condenast.ru") >= 0) { | |
// https://d6.static.media.condenast.ru/vogue/collection/49d7fa92bdcb9696c7ebac700ca6983e.jpg/0ce73d99/o/t214x320 | |
// https://d6.static.media.condenast.ru/vogue/collection/49d7fa92bdcb9696c7ebac700ca6983e.jpg/0ce73d99/o/w99999999 | |
// http://static.glamour.ru/iblock/d4c/71048307.jpg | |
return src.replace(/\/[a-z][0-9]*(?:x[0-9]+)?$/, "/w99999999"); | |
} | |
if (domain === "www.vogue.co.jp") { | |
// https://www.vogue.co.jp/uploads/media/2017/01/25/ALEXANDRE_VAUTHIER_2017SS_Haute_Couture_Collection_runway_gallery-26-171-256.jpg | |
// https://www.vogue.co.jp/uploads/media/2017/01/25/ALEXANDRE_VAUTHIER_2017SS_Haute_Couture_Collection_runway_gallery-26.jpg | |
return src.replace(/-[0-9]+-[0-9]+(\.[^/.]*)$/, "$1"); | |
} | |
if (domain_nosub === "vogue.mx" || | |
// https://cdn.glamour.mx/uploads/images/thumbs/mx/glam/2/s/2018/20/looks_de_billboard_awards_2018_3250_413x620.jpg | |
// https://cdn.glamour.mx/uploads/images/mx/glam/s/2018/20/looks_de_billboard_awards_2018_3250.jpg | |
domain_nosub === "glamour.mx" || | |
// https://cdn.glamour.es/uploads/images/thumbs/es/glam/4/s/2017/35/gigi_hadid_bella_desfile_victorias_secret_china_2017_6551_2505x.jpg | |
// https://cdn.glamour.es/uploads/images/es/glam/s/2017/35/gigi_hadid_bella_desfile_victorias_secret_china_2017_6551.jpg | |
// https://cdn2.glamour.es/uploads/images/thumbs/es/glam/4/s/2017/20/selena_gomez_met_5352_1200x630.jpg | |
// https://cdn2.glamour.es/uploads/images/es/glam/s/2017/20/selena_gomez_met_5352.jpg | |
// http://cdn.glamour.es/uploads/images/thumbs/201419/gala_met_2014_todos_los_vestidos_de_la_alfombra_roja_343183988_667x1000.jpg | |
// http://cdn.glamour.es/uploads/images/201419/gala_met_2014_todos_los_vestidos_de_la_alfombra_roja_343183988.jpg | |
// http://cdn.glamour.es/uploads/images/thumbs/201546/el_desfile_de_victorias_secret_la_alfombra_rosa_244031781_335x.jpg | |
// http://cdn.glamour.es/uploads/images/201546/el_desfile_de_victorias_secret_la_alfombra_rosa_244031781.jpg | |
domain_nosub === "glamour.es" || | |
// https://cdn.gq.com.mx/uploads/images/thumbs/201543/anna_sizykh__272304971_2954x1969.jpg | |
// https://cdn.gq.com.mx/uploads/images/201543/anna_sizykh__272304971.jpg | |
// https://cdn.gq.com.mx/uploads/images/thumbs/mx/gq/2/s/2016/03/la_belleza_de_margot_robbie_956194671_977x1454.jpg | |
// https://cdn.gq.com.mx/uploads/images/mx/gq/2/s/2016/03/la_belleza_de_margot_robbie_956194671.jpg -- doesn't work | |
// https://cdn.gq.com.mx/uploads/images/mx/gq/s/2016/03/la_belleza_de_margot_robbie_956194671.jpg -- works | |
domain === "cdn.gq.com.mx" || | |
// http://cdn.revistavanityfair.es/uploads/images/thumbs/201519/todos_los_looks_fabulosamente_indescriptibles_de_rihanna_38784214_93x125.jpg | |
// http://cdn.revistavanityfair.es/uploads/images/201519/todos_los_looks_fabulosamente_indescriptibles_de_rihanna_38784214.jpg | |
// https://cdn.revistavanityfair.es/uploads/images/thumbs/es/vf/2/s/2018/07/karen_gillan_1730_1199x1800.jpg | |
// http://cdn.revistavanityfair.es/uploads/images/es/vf/s/2018/07/karen_gillan_1730.jpg | |
domain === "cdn.revistavanityfair.es" || | |
// http://cdn.vogue.es/uploads/images/thumbs/201541/top_looks_las_mejor_vestidas_de_la_semana_del_2_al_9_de_octubre_de_2015_758656006_800x.jpg | |
// http://cdn.vogue.es/uploads/images/201541/top_looks_las_mejor_vestidas_de_la_semana_del_2_al_9_de_octubre_de_2015_758656006.jpg | |
// https://cdn2.vogue.es/uploads/images/thumbs/201541/top_looks_las_mejor_vestidas_de_la_semana_del_2_al_9_de_octubre_de_2015_758656006_800x.jpg | |
// https://cdn2.vogue.es/uploads/images/201541/top_looks_las_mejor_vestidas_de_la_semana_del_2_al_9_de_octubre_de_2015_758656006.jpg | |
domain_nosub === "vogue.es") { | |
// http://cdn.vogue.mx/uploads/images/thumbs/mx/vog/2/c/2017/04/alexandre_vauthier_pasarela_387309230_377x566.jpg | |
// http://cdn.vogue.mx/uploads/images/thumbs/mx/vog/2/c/2017/04/alexandre_vauthier_pasarela_387309230_1200x1800.jpg | |
// http://cdn.vogue.mx/uploads/images/mx/vog/c/2017/04/alexandre_vauthier_pasarela_170811342.jpg | |
// http://cdn.vogue.mx/uploads/images/thumbs/mx/vog/2/c/2017/04/alexandre_vauthier_pasarela_170811342_185x278.jpg | |
// http://cdn.vogue.mx/uploads/images/mx/vog/c/2017/04/alexandre_vauthier_pasarela_170811342.jpg | |
// http://cdn.vogue.mx/uploads/images/mx/vog/s/2016/10/familia_real_britanica_780685680.jpg | |
newsrc = src | |
.replace(/\/uploads\/+images\/+thumbs(?:(\/+(?:mx|es)\/+(?:vog|glam|gq|vf)\/+)[0-9]*\/+([a-z]))?(\/+(?:[0-9]{4}\/+[0-9]+|[0-9]{4,})\/+[^/]*)_[0-9]+x(?:[0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, "/uploads/images$1$2$3$4"); | |
if (newsrc !== src) | |
return newsrc; | |
//return src.replace(/\/thumbs\/([0-9]+\/[^/.]*)_[0-9]+x[0-9]+(\.[^/.]*)$/, "/$1$2"); | |
//return src.replace(/(\/uploads\/images)\/thumbs(?:(\/[a-z]+\/(?:vf|gq))\/[0-9]+)?(\/.*)_[0-9]+x(?:[0-9]+)?(\.[^/.]*)$/, "$1$2$3$4"); | |
} | |
if (domain_nosub === "ykt.ru" || | |
domain_nosub === "ykt2.ru") { | |
// http://cs-msk-fd-4.ykt2.ru/media/upload/photo/2015/11/16/thumb/561772143a52dw350h530cr.jpeg | |
// http://www.news.ykt.ru/upload/image/2017/04/55619/thumb/58ec2ea7219bd.jpg | |
return src.replace(/\/thumb\/([^/]*)$/, "/$1"); | |
} | |
if (domain === "i.guim.co.uk") { | |
// https://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2014/6/2/1401727592551/Jeremy-Paxman--014.jpg | |
// https://static.guim.co.uk/sys-images/Observer/Pix/pictures/2012/4/4/1333534694618/Lily-Collins-003.jpg | |
// https://i.guim.co.uk/img/media/25e99cf42defaf460da04eb3fa08fac1f10aac55/0_138_3500_2100/master/3500.jpg?w=600&q=20&auto=format&usm=12&fit=max&dpr=2&s=5366bc1d02c96c9062f7c1c19318626f | |
// https://media.guim.co.uk/25e99cf42defaf460da04eb3fa08fac1f10aac55/0_138_3500_2100/master/3500.jpg | |
// https://i.guim.co.uk/img/static/sys-images/Guardian/Pix/pictures/2015/2/18/1424261816248/34329776-7c4a-488a-a767-57ee9477cad3-2060x1236.jpeg | |
// https://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2015/2/18/1424261816248/34329776-7c4a-488a-a767-57ee9477cad3-2060x1236.jpeg | |
return src.replace(/:\/\/[^/]*\/img\/([^/]*)\/([^?]*).*?$/, "://$1.guim.co.uk/$2"); | |
} | |
if (domain === "media.guim.co.uk") { | |
// https://media.guim.co.uk/25e99cf42defaf460da04eb3fa08fac1f10aac55/0_138_3500_2100/master/3500.jpg | |
// https://media.guim.co.uk/25e99cf42defaf460da04eb3fa08fac1f10aac55/0_138_3500_2100/3500.jpg | |
// https://media.guim.co.uk/5cef1f5322cece5683b42385ce834bdb45b153a3/0_0_1994_2993/666.jpg -- 666x1000 | |
// https://media.guim.co.uk/5cef1f5322cece5683b42385ce834bdb45b153a3/0_0_1994_2993/1994.jpg -- 1994x2993 | |
return src | |
.replace(/\/((?:[0-9]*_){3}[0-9]*)\/[^/]*\/([0-9]*\.[^/.]*)$/, "/$1/$2") | |
.replace(/(\/[0-9]+_[0-9]+_([0-9]+)_[0-9]+\/)[0-9]+(\.[^/.]*)$/, "$1$2$3"); | |
} | |
if (domain_nowww === "g2d.co.in") { | |
// https://www.g2d.co.in/img/Photo/385/sml_amy-jackson-latest-hot-and-bold-pics-0-amy-jackson-18-08-04-02-08-42.jpeg | |
// https://www.g2d.co.in/img/Photo/385/amy-jackson-latest-hot-and-bold-pics-0-amy-jackson-18-08-04-02-08-42.jpeg | |
return src.replace(/(\/img\/+Photo\/+[0-9]+\/+)(?:sml|med)_([^/]*\.[^/.]*)(?:[?#].*)?$/, | |
"$1$2"); | |
} | |
if (domain === "vogue.gjstatic.nl" || | |
// https://glamour.gjstatic.nl/thumbnails/GenjGalleryBundle/Item/fileUpload/detail/02/00/69/candice-swanepoel-7-20069.jpg -- doesn't work | |
domain === "glamour.gjstatic.nl") { | |
// https://vogue.gjstatic.nl/thumbnails/GenjArticleBundle/Article/fileUpload/medium/00/58/12/dit-heeft-gigi-hadid-te-zeggen-tegen-al-haar-body-shamers-5812.jpg | |
// https://vogue.gjstatic.nl/thumbnails/GenjArticleBundle/Article/fileUpload/big/00/58/12/dit-heeft-gigi-hadid-te-zeggen-tegen-al-haar-body-shamers-5812.jpg | |
// https://vogue.gjstatic.nl/thumbnails/GenjArticleBundle/Article/fileUpload/detail/01/06/15/glitter-sparkle-shine-alexa-chung-staat-op-de-cover-van-vogue-december-2017-10615.jpg -- 1000x1295 | |
// https://vogue.gjstatic.nl/thumbnails/GenjArticleBundle/Article/fileUpload/big/01/06/15/glitter-sparkle-shine-alexa-chung-staat-op-de-cover-van-vogue-december-2017-10615.jpg -- 1600x2072 | |
// https://vogue.gjstatic.nl/uploads/media/image/dolce-gabbana-make-capri-a-paparazzi-free-zone_9.jpg | |
// https://vogue.gjstatic.nl/uploads/media/image/singer-songwriter-angela-vertelt-de-californie-hea-1.jpg | |
// https://vogue.gjstatic.nl/thumbnails/GenjArticleBundle/Article/teaserFileUpload/teaser/00/84/17/tommy-x-gigi-has-landed-dit-zijn-vogue-s-favorieten-uit-de-ultieme-cali-girl-collectie-8417.jpg | |
// https://vogue.gjstatic.nl/thumbnails/GenjArticleBundle/Article/fileUpload/detail/00/84/17/tommy-x-gigi-has-landed-dit-zijn-vogue-s-favorieten-uit-de-ultieme-cali-girl-collectie-8417.jpg | |
// https://vogue.gjstatic.nl/thumbnails/GenjArticleBundle/Article/fileUpload/detail/00/89/30/gigi-hadid-verlengt-samenwerking-met-tommy-hilfiger-8930.jpg | |
// https://vogue.gjstatic.nl/thumbnails/GenjArticleBundle/Article/fileUpload/big/00/89/30/gigi-hadid-verlengt-samenwerking-met-tommy-hilfiger-8930.jpg | |
// https://designer-vintage.gjstatic.nl/thumbnails/GenjArticleBundle/Article/fileUpload/detail/00/13/27/the-exclusive-designer-vintage-summer-sale-1327.jpg -- 1000x1249 | |
// https://designer-vintage.gjstatic.nl/uploads/media/image/the-exclusive-designer-vintage-summer-sale.jpg -- 4048x5059 | |
// https://designer-vintage.gjstatic.nl/thumbnails/GenjArticleBundle/Article/fileUpload/detail/00/19/42/the-top-5-best-snow-white-winter-bags-1942.jpg | |
// https://designer-vintage.gjstatic.nl/uploads/medi/image/the-top-5-best-snow-white-winter-bags.jpg -- doesn't work, error 500 | |
return src | |
.replace(/\/teaserFileUpload\//, "/fileUpload/") // doesn't work on all | |
.replace(/\/fileUpload\/[^/]*\//, "/fileUpload/big/"); | |
} | |
if (domain_nosub === "favim.com" && domain.match(/^s[0-9]*\./)) { | |
// https://s10.favim.com/mini/171202/book-Favim.com-5265965.jpeg | |
// https://s10.favim.com/orig/171202/book-Favim.com-5265965.jpeg | |
// https://s8.favim.com/mini/151114/girls-generation-icons-snsd-taeyeon-Favim.com-3566828.png | |
// https://s8.favim.com/orig/151114/girls-generation-icons-snsd-taeyeon-Favim.com-3566828.png | |
return src.replace(/(:\/\/[^/]*\/)[^/]*\//, "$1orig/"); | |
} | |
if (domain_nowww === "derpicdn.net") { | |
// https://derpicdn.net/img/2018/2/24/1664344/thumb.png | |
// https://derpicdn.net/img/2018/2/24/1664344/large.png | |
// https://derpicdn.net/img/2018/2/24/1664344/full.png | |
// https://derpicdn.net/img/2016/10/9/1268708/large.png -- 1280x973 | |
// https://derpicdn.net/img/2016/10/9/1268708/full.png -- 4603x3500 | |
return src.replace(/\/(?:thumb|large)(\.[^/.]*)$/, "/full$1"); | |
} | |
if (domain_nosub === "iimg.me") { | |
// http://mnetjapan.iimg.me/interest.php?url=http%3A%2F%2Fjp.mnet.com%2Fdata%2Fwww.mnetjapan.com%2Fadmin%2F000%2F172%2F494 | |
// http://jp.mnet.com/data/www.mnetjapan.com/admin/000/172/494 | |
// http://s.iimg.me/profile.php?url=http%3A%2F%2Fs.iimg.me%2FprofileImage%2Fg%2F9%2F98g_1423385594_profile | |
newsrc = src.replace(/.*\/[a-z]*\.php.*?[?&]url=([^&]*).*?$/, "$1"); | |
if (newsrc !== src && newsrc.indexOf("http") === 0) { | |
return decodeURIComponent(newsrc); | |
} | |
} | |
if (domain === "pix.avaxnews.com" || | |
// https://pix.avax.news/avaxnews/7d/39/0005397d_medium.jpeg | |
// https://pix.avax.news/avaxnews/7d/39/0005397d.jpeg | |
domain === "pix.avax.news" || | |
// https://pixhost.icu/avaxhome/36/ae/0061ae36_medium.jpg | |
// https://pixhost.icu/avaxhome/36/ae/0061ae36.jpg | |
domain_nowww === "pixhost.icu" || | |
// https://pxhst.co/avaxhome/90/ce/0029ce90_medium.jpeg | |
// https://pxhst.co/avaxhome/90/ce/0029ce90.jpeg | |
domain_nowww === "pxhst.co") { | |
// http://pix.avaxnews.com/avaxnews/99/e2/0002e299_medium.jpeg | |
// http://pix.avaxnews.com/avaxnews/99/e2/0002e299.jpeg | |
// https://pix.avaxnews.com/avaxnews/9c/e2/0002e29c_medium.jpeg | |
// https://pix.avaxnews.com/avaxnews/9c/e2/0002e29c.jpeg | |
return src.replace(/_[^/]*(\.[^/.]*)$/, "$1"); | |
} | |
if (domain_nosub === "hurimg.com" || | |
// http://img.posta.com.tr/img/78/567x391/5ae22558ae298b8e001426ff | |
// http://img.posta.com.tr/img/78/0x0/5ae22558ae298b8e001426ff | |
// http://img.posta.com.tr/img/100/0x0/5ae22558ae298b8e001426ff | |
domain === "img.posta.com.tr" || | |
// http://icdn.pstimg.com/img/80/700x410/5ae2c6f066a97c82afd94131 | |
// http://icdn.pstimg.com/img/100/0x0/5ae2c6f066a97c82afd94131 | |
domain === "icdn.pstimg.com" || | |
// http://img.fanatik.com.tr/img/78/394x0/5b0d157966a97c43510a1c3d | |
// http://img.fanatik.com.tr/img/100/0x0/5b0d157966a97c43510a1c3d | |
domain === "img.fanatik.com.tr" || | |
// https://assets.dogannet.tv/img/10/640x0/5ac6231aae298b8e01213bed | |
// https://assets.dogannet.tv/img/100/0x0/5ac6231aae298b8e01213bed | |
domain === "assets.dogannet.tv" || | |
// https://img2.fanatik.com.tr/img/78/364x364/5af541ee66a97c82afdd810f | |
// https://img2.fanatik.com.tr/img/100/0x0/5af541ee66a97c82afdd810f | |
domain_nosub === "fanatik.com.tr" || | |
// https://i.pstimaj.com/img/78/394x0/5ae2d796ae298b8e001550d0 | |
// https://i.pstimaj.com/img/100/0x0/5ae2d796ae298b8e001550d0 | |
((domain_nosub === "pstimaj.com" || | |
// https://i.milimaj.com/i/milliyet/90/0x420/5c8d444445d2a05010d4f31f.jpg | |
// https://i.milimaj.com/i/milliyet/100/0x0/5c8d444445d2a05010d4f31f.jpg | |
domain_nosub === "milimaj.com" || | |
// https://i.cnnturk.com/ps/cnnturk/75/630x0/582064a15659341ab0aea248.jpg | |
// https://i.cnnturk.com/ps/cnnturk/75/0x0/582064a15659341ab0aea248.jpg | |
// https://i.cnnturk.com/ps/cnnturk/100/0x0/582064a15659341ab0aea248.jpg | |
// https://i2.cnnturk.com/i/cnnturk/75/350x0/55d45591e50aa915d0fba246.jpg | |
// https://i2.cnnturk.com/i/cnnturk/100/0x0/55d45591e50aa915d0fba246.jpg | |
domain_nosub === "cnnturk.com") && /^i[0-9]*\./.test(domain))) { | |
// http://i.hurimg.com/i/hdn/10/100x0/5a8becad18c7731320697a39.jpg | |
// http://i.hurimg.com/i/hdn/100/0x0/5a8becad18c7731320697a39.jpg | |
// http://i.hurimg.com/i/hurriyet/75/770x0/563f20410f2544733cbe7185 | |
// http://i.hurimg.com/i/hurriyet/100/0x0/563f20410f2544733cbe7185 | |
// http://i4.hurimg.com/i/hurriyet/75/590x332/5d89e33a67b0a903f89d0d99.jpg | |
// http://i4.hurimg.com/i/hurriyet/100/0x0/5d89e33a67b0a903f89d0d99.jpg | |
//return src.replace(/(\/i\/[a-z]+\/)[0-9]+\/[0-9]+x[0-9]+\//, "$1100/0x0/"); | |
//return src.replace(/\/[0-9]+x[0-9]+\/([0-9a-f]+)$/, "/0x0/$1"); | |
//return src.replace(/\/img\/[0-9]+\/[0-9]+x[0-9]+\/([0-9a-f]+)(?:[?#].*)?$/, "/img/100/0x0/$1") | |
return src.replace(/\/[0-9]+\/[0-9]+x[0-9]+\/([0-9a-f]+(?:\.[^/.]*)?)([?#].*)?$/, "/100/0x0/$1"); | |
} | |
if (domain === "www.kurtkomaromi.com" || | |
// http://fashionwedd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment