// @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
// @name:en           Image Max URL
// @name:ar           Image Max URL
// @name:cs           Image Max URL
// @name:da           Image Max URL
// @name:de           Image Max URL
// @name:el           Image Max URL
// @name:eo           Image Max URL
// @name:es           Image Max URL
// @name:fi           Image Max URL
// @name:fr           Image Max URL
// @name:fr-CA        Image Max URL
// @name:he           Image Max URL
// @name:hi           Image Max URL
// @name:hu           Image Max URL
// @name:id           Image Max URL
// @name:it           Image Max URL
// @name:ja           Image Max URL
// @name:ko           Image Max URL
// @name:nb           Image Max URL
// @name:nl           Image Max URL
// @name:pl           Image Max URL
// @name:pt-BR        Image Max URL
// @name:ru           Image Max URL
// @name:bg           Image Max URL
// @name:uk           Image Max URL
// @name:th           Image Max URL
// @name:tr           Image Max URL
// @name:vi           Image Max URL
// @name:zh-CN        Image Max URL
// @name:zh-TW        Image Max URL
// @name:zh-HK        Image Max URL
// @description       Finds larger or original versions of images and videos for 9400+ websites, including a powerful media popup and download feature
// @description:en    Finds larger or original versions of images and videos for 9400+ websites, including a powerful media popup and download feature
// @description:ar    البحث عن نسخ أكبر أو أصلية من الصور لأكثر من 9400 موقع ويب
// @description:cs    Vyhledá větší nebo původní verze obrázků a videí pro více než 9400 webů
// @description:da    Finder større eller originale versioner af billeder og videoer til mere end 9400 websteder
// @description:de    Sucht nach größeren oder originalen Versionen von Bildern und Videos für mehr als 9400 Websites
// @description:el    Βρίσκει μεγαλύτερες ή πρωτότυπες εκδόσεις εικόνων και βίντεο για περισσότερους από 9400 ιστότοπους
// @description:eo    Trovas pli grandajn aŭ originalajn versiojn de bildoj kaj filmetoj por pli ol 9400 retejoj
// @description:es    Encuentra imágenes más grandes y originales para más de 9400 sitios
// @description:fi    Etsii suurempia tai alkuperäisiä versioita kuvista ja videoista yli 9400 verkkosivustolle
// @description:fr    Trouve des versions plus grandes ou originales d'images et de vidéos pour plus de 9 400 sites web, y compris une puissante fonction de popup média
// @description:fr-CA Trouve des versions plus grandes ou originales d'images et de vidéos pour plus de 9 400 sites web, y compris une puissante fonction de popup média
// @description:he    מוצא גרסאות גדולות יותר או מקוריות של תמונות וסרטונים עבור יותר מ-9400 אתרים
// @description:hi    9400 से अधिक वेबसाइटों के लिए फ़ोटो और वीडियो के बड़े या मूल संस्करण ढूँढता है
// @description:hu    Több mint 9400 webhely képének és videóinak nagyobb vagy eredeti változatát találja
// @description:id    Menemukan versi gambar dan video yang lebih besar atau orisinal untuk lebih dari 9400 situs web
// @description:it    Trova versioni più grandi o originali di immagini e video per oltre 9400 siti web
// @description:ja    9400以上のウェブサイトで高画質や原本画像を見つけ出します
// @description:ko    9400개 이상의 사이트에 대해 고화질이나 원본 이미지를 찾아드립니다
// @description:nb    Finner større eller originale versjoner av bilder og videoer for mer enn 9400 nettsteder
// @description:nl    Vindt grotere of originele versies van foto's en video's voor meer dan 9400 websites
// @description:pl    Wyszukuje większe lub oryginalne wersje obrazów i filmów dla ponad 9400 stron internetowych
// @description:pt-BR Encontra versões maiores ou originais de imagens e vídeos para mais de 9400 sites
// @description:ru    Находит увеличенные или оригинальные версии изображений и видео для 9400+ сайтов. Имеет мощную функцию всплывающего окна и скачивание медиафайлов.
// @description:bg    Намира увеличени или оригинални версии на изображения за повече от 9400 уеб сайтове
// @description:uk    Знаходить збільшені або оригінальні версії зображень для більш ніж 9400 веб-сайтів
// @description:th    หาที่ใหญ่กว่าหรือเวอร์ชั่นดั้งเดิมของภาพทั้งหมดและวีดีโอสำหรับมากกว่า 9400 งเว็บไซต์
// @description:tr    9400'den fazla web sitesi için resim ve videoların daha büyük veya orijinal sürümlerini bulur
// @description:vi    Tìm phiên bản lớn hơn hoặc phiên bản gốc của hình ảnh và video cho hơn 9400 trang web
// @description:zh-CN 在近万个网站上查找尺寸更大或原版的图像/视频，提供媒体文件小弹窗和下载功能
// @description:zh-TW 為9400多個網站查找更大或原始圖像
// @description:zh-HK 為9400多個網站查找更大或原始圖像
// @namespace         http://tampermonkey.net/
// @version           2024.8.0
// @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_download
// @grant             GM_openInTab
// @grant             GM.openInTab
// @grant             GM_notification
// @grant             GM.notification
// @grant             GM_setClipboard
// @grant             GM.setClipboard
// @connect           *
// api.github.com is used for checking for updates (can be disabled through the "Check Updates" setting)
// @connect           api.github.com
// @run-at            document-start
// @license           Apache-2.0
// non-greasyfork/oujs versions need updateURL and downloadURL to auto-update for certain userscript managers
// @updateURL         https://raw.githubusercontent.com/qsniyg/maxurl/master/userscript.meta.js
// @downloadURL       https://raw.githubusercontent.com/qsniyg/maxurl/master/userscript_smaller.user.js
// imu:require_rules  (this is replaced by the build system for userscript versions that require external rules)
// ==/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 "Allow 3rd-party libraries" setting.
//       3rd-party libraries are disabled by default for security reasons.
// Search for do_request, api_query, and website_query if you want to see what the code does exactly.
//
// Please contact me if you have any questions or concerns regarding the script.
//
// Project links:
//
//   * Github:          https://github.com/qsniyg/maxurl
//   * Discord:         https://discord.gg/fH9Pf54
//   * Reddit:          https://www.reddit.com/r/MaxImage/
//   * Website:         https://qsniyg.github.io/maxurl/
//   * Guide:           https://qsniyg.github.io/maxurl/guide.html
//   * Userscript:
//     * OpenUserJS:    https://openuserjs.org/scripts/qsniyg/Image_Max_URL
//     * Github:        https://raw.githubusercontent.com/qsniyg/maxurl/master/userscript_smaller.user.js
//     * Github (beta): https://raw.githubusercontent.com/qsniyg/maxurl/master/userscript.user.js
//   * Firefox addon:   https://addons.mozilla.org/firefox/addon/image-max-url/
//   * Opera extension: https://addons.opera.com/en/extensions/details/image-max-url/

/// All comments within bigimage() have been removed to ensure the file remains within Greasyfork and AMO limits
/// You can view the original source code here: https://github.com/qsniyg/maxurl/blob/master/userscript.user.js
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_ = false;
	if (_nir_debug_) {
		_nir_debug_ = {
			no_request: false,
			no_recurse: false,
			no_redirect: true,
			// channels
			map: false,
			cache: false,
			bigimage_recursive: false,
			input: false,
			check_image_get: false,
			find_source: true
		};
		console.log("Loaded");
	}
	var nullfunc = function() { };
	var is_extension = false;
	var is_webextension = false;
	var is_extension_bg = false;
	var is_firefox_webextension = false;
	var extension_send_message = null;
	var extension_error_handler = function(context) { };
	var extension_options_page = null;
	var is_terminated = false;
	var is_extension_options_page = false;
	var is_options_page = false;
	var is_maxurl_website = false;
	var window_location = null;
	var options_page = "https://qsniyg.github.io/maxurl/options.html";
	// todo: update
	var archive_options_page = "https://web.archive.org/web/20210328063940/https://qsniyg.github.io/maxurl/options.html";
	var preferred_options_page = options_page;
	var firefox_addon_page = "https://addons.mozilla.org/en-US/firefox/addon/image-max-url/";
	var userscript_update_url = "https://raw.githubusercontent.com/qsniyg/maxurl/master/userscript_smaller.user.js";
	var greasyfork_update_url = userscript_update_url;
	//var greasyfork_update_url = "https://greasyfork.org/scripts/36662-image-max-url/code/Image%20Max%20URL.user.js";
	var github_issues_page = "https://github.com/qsniyg/maxurl/issues";
	var imu_icon = "https://raw.githubusercontent.com/qsniyg/maxurl/b5c5488ec05e6e2398d4e0d6e32f1bbad115f6d2/resources/logo_256.png";
	var current_version = "2024.8.0";
	var imagetab_ok_override = false;
	var has_ffmpeg_lib = true;
	// -- Currently this is unused, it'll be used in a future release (to workaround the 1MB and 2MB limits for OUJS and Greasyfork respectively) --
	// This is only set for the Greasyfork/OUJS versions if it fails to @require the rules (contents of bigimage).
	// The likely causes would be either a CDN failure, or that the userscript manager doesn't support @require.
	var require_rules_failed = false;
	var get_raw_window = function() {
		if (typeof (unsafeWindow) !== "undefined")
			return unsafeWindow || this.window || window;
		return this.window || window;
	};
	var get_window = function() {
		var raw_window = get_raw_window();
		// https://github.com/qsniyg/maxurl/issues/678#issuecomment-791855176
		// userscript under firefox violentmonkey under twitter's unsafeWindow returns Sandbox, which isn't an EventTarget (breaks "message" handler)
		// .self returns the actual window, which is an EventTarget
		if (raw_window.self)
			return raw_window.self;
		else
			return raw_window;
	};
	var termination_hooks = [];
	var is_suspended = function(full) {
		if (is_terminated || !settings.imu_enabled) {
			return true;
		}
		if (full && is_extension) {
			try {
				chrome.runtime.getURL("manifest.json");
			} catch (e) {
				set_terminated(true);
				return true;
			}
		}
		return false;
	};
	var set_terminated = function(terminated) {
		var was_terminated = is_terminated;
		is_terminated = terminated;
		if (terminated && !was_terminated) {
			array_foreach(termination_hooks, function(hook) {
				hook();
			});
		}
	};
	try {
		window_location = window.location.href;
		(function() {
			var our_url = window_location.replace(/^[a-z]+:\/\/web\.archive\.org\/+web\/+[0-9]+\/+(https?:\/\/)/, "$1");
			if (/^https?:\/\/qsniyg\.github\.io\/+maxurl\/+options\.html/.test(our_url) ||
				/^file:\/\/.*\/maxurl\/site\/options\.html/.test(window_location)) {
				is_options_page = true;
				is_maxurl_website = true;
			} else if (/^https?:\/\/qsniyg\.github\.io\/+maxurl\/+/.test(our_url) ||
				/^file:\/\/.*\/maxurl\/site\/(?:index|about|options)\.html/.test(window_location)) {
				is_maxurl_website = true;
			}
		})();
	} catch (e) {
	}
	var check_if_extension = function() {
		// in sendvid.com, chrome is null, which typeof === "object"
		if (typeof chrome !== "object" || !chrome || typeof chrome.runtime !== "object")
			return;
		try {
			var extension_manifest = chrome.runtime.getManifest();
			is_extension = extension_manifest.name === "Image Max URL";
			if (!is_extension)
				return;
			extension_error_handler = function(context) {
				try {
					var last_error = chrome.runtime.lastError;
					if (last_error) {
						console.error(last_error.message, context);
					}
				} catch (e) {
					console.error(e);
				}
			};
			is_extension_bg = /^([-a-z]+)extension:\/\/[^/]+\/+_generated_background_page\.html/.test(window_location);
			extension_options_page = chrome.runtime.getURL("extension/options.html");
			is_extension_options_page = window_location.replace(/[?#].*$/, "") === extension_options_page;
			is_options_page = is_options_page || is_extension_options_page;
			//options_page = extension_options_page; // can't load from website
			preferred_options_page = extension_options_page;
			is_webextension = true;
			if (navigator.userAgent.indexOf("Firefox") >= 0)
				is_firefox_webextension = true;
			current_version = extension_manifest.version;
			extension_send_message = function(message, respond) {
				message = deepcopy(message, { json: true });
				if (!respond)
					respond = nullfunc;
				if (is_extension_bg) {
					return userscript_extension_message_handler(message, respond);
				} else {
					if (!respond || respond === nullfunc) {
						return chrome.runtime.sendMessage(null, message);
					} else {
						return chrome.runtime.sendMessage(null, message, null, function() {
							extension_error_handler(message);
							return respond.apply(this, arguments);
						});
					}
				}
			};
			if (!is_extension_bg) {
				// firefox doesn't load the runtime listener immediately
				setTimeout(function() {
					var runtime_port = chrome.runtime.connect();
					runtime_port.onDisconnect.addListener(function(e) {
						console.error(e);
						extension_error_handler();
						set_terminated(true);
					});
				}, 10);
			}
			extension_error_handler();
		} catch (e) {
			if (is_extension) {
				console.error(e);
				extension_error_handler();
			}
		}
		;
	};
	check_if_extension();
	var is_node = false;
	var is_node_main = false;
	if ((typeof module !== 'undefined' && module.exports) &&
		typeof window === 'undefined' && typeof document === 'undefined') {
		is_node = true;
		try {
			if (require.main === module)
				is_node_main = true;
		} catch (e) { }
	}
	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;
	// https://stackoverflow.com/a/326076
	var check_in_iframe = function() {
		try {
			return window.self !== window.top;
		} catch (e) {
			return true;
		}
	};
	var is_in_iframe = check_in_iframe();
	var is_remote_possible = false;
	var is_interactive = (is_extension || is_userscript) && !is_extension_bg;
	var userscript_manager = "unknown";
	var userscript_manager_version = "";
	if (is_userscript) {
		var gm_info = void 0;
		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);
		}
		try {
			current_version = gm_info.script.version;
		} catch (e) {
			current_version = null;
		}
		;
	}
	var is_native = function(x) {
		var x_str = x.toString();
		if (x_str.length < 80 && /native code/.test(x_str)) {
			return true;
		} else {
			return false;
		}
	};
	// 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 raw_console_log = console.log;
	var console_log = function() {
		var args = [];
		for (var _i = 0; _i < arguments.length; _i++) {
			args[_i] = arguments[_i];
		}
		if (settings && !settings.enable_console_logging)
			return;
		return raw_console_log.apply(this, arguments);
	};
	var console_error = console.error;
	var console_warn = console.warn;
	var console_trace = console.trace;
	// twitter overrides console.error to a broken function
	if (!is_native(console_error)) {
		console_error = function() {
			var _args = [];
			for (var _i = 0; _i < arguments.length; _i++) {
				_args[_i] = arguments[_i];
			}
			var args = ["[ERROR]"];
			for (var i = 0; i < arguments.length; i++) {
				args.push(arguments[i]);
			}
			return console_log.apply(this, args);
		};
	}
	var nir_debug = function() {
		var args = [];
		for (var _i = 0; _i < arguments.length; _i++) {
			args[_i] = arguments[_i];
		}
	};
	if (_nir_debug_) {
		// fixme: (channel:string, ...args)
		nir_debug = function() {
			var _args = [];
			for (var _i = 0; _i < arguments.length; _i++) {
				_args[_i] = arguments[_i];
			}
			var channel = arguments[0];
			if (!_nir_debug_[channel])
				return;
			var args = [];
			for (var i = 1; i < arguments.length; i++) {
				args.push(arguments[i]);
			}
			console_log.apply(this, args);
		};
	}
	var JSON_stringify;
	var JSON_parse = JSON.parse;
	// parseInt occasionally crashes for tagesspiegel.de with brave shields and violentmonkey 2.13.0
	// seems to be a race, as it sometimes works, and it always works in the console
	var parse_int = function(x) {
		// -0 instead of |0 because 1846699492419 returns -136444861 otherwise (>32bit)
		// -0 works for strings too, but TS doesn't like it
		var asnumber = x - 0;
		var floor = asnumber | 0;
		var diff = floor - asnumber;
		// Math.abs
		if (diff < 0)
			diff = -diff;
		if (diff > 1) {
			// todo: use Math.floor if available
			var floored_string = (x + "").replace(/\..*/, "");
			return floored_string - 0;
		}
		return floor;
	};
	// https://stackoverflow.com/a/15016605
	// unminified version: https://stackoverflow.com/a/3058974
	var base64_decode_base = function(s, dict) {
		var e = {}, i, b = 0, c, x, l = 0, a, r = '', w = string_fromcharcode, L = s.length;
		if (!dict)
			dict = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
		var A = dict;
		for (i = 0; i < 64; i++) {
			e[string_charat(A, i)] = i;
		}
		for (x = 0; x < L; x++) {
			c = e[string_charat(s, x)];
			b = (b << 6) + c;
			l += 6;
			while (l >= 8) {
				((a = (b >>> (l -= 8)) & 0xff) || (x < (L - 2))) && (r += w(a));
			}
		}
		return r;
	};
	// RFC 4648 section 5
	var base64_decode_urlsafe = function(s) {
		return base64_decode_base(s, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_");
	};
	var base64_decode, base64_encode, is_array, array_indexof, string_indexof, 
	// https://www.bing.com/ overrides Blob
	// https://www.dpreview.com/ overrides URL
	native_blob, native_URL, new_blob, our_EventTarget, our_addEventListener, our_removeEventListener, string_fromcharcode, string_charat, array_reduce, array_reduce_prototype, document_createElement;
	if (is_node) {
		base64_decode = function(a) {
			return Buffer.from(a, 'base64').toString('binary');
		};
		base64_encode = function(a) {
			return Buffer.from(a).toString('base64');
		};
	}
	var get_compat_functions = function() {
		var native_functions_to_get = [];
		// ublock prevents JSON.stringify from being used on foxnews.com
		var get_json_stringify = function() {
			try {
				JSON_stringify = JSON.stringify;
			} catch (e) {
				console_warn("Cannot use native JSON.stringify, using slow implementation instead", e);
				var is_json_undefined = function(x) {
					return x === void 0 || typeof x === "function";
				};
				// probably incorrect (especially regarding string handling) and doesn't support formatting
				// does it matter?
				JSON_stringify = function(x) {
					if (is_json_undefined(x))
						return void 0;
					if (typeof x === "string") {
						return '"' + x
							.replace(/\\/g, "\\\\")
							.replace(/"/g, '\\"') + '"';
					}
					if (x === null)
						return "null";
					if (typeof x === "number")
						return x + "";
					if (is_array(x)) {
						var els = [];
						for (var i = 0; i < x.length; i++) {
							var stringified = JSON_stringify(x[i]);
							if (stringified === void 0)
								stringified = "null";
							els.push(stringified);
						}
						return "[" + els.join(",") + "]";
					}
					if (typeof x === "object") {
						var els = [];
						for (var key in x) {
							var stringified = JSON_stringify(x[key]);
							if (stringified === void 0)
								continue;
							els.push('"' + key + '":' + JSON_stringify(x[key]));
						}
						return "{" + els.join(",") + "}";
					}
					// does this happen?
					return void 0;
				};
			}
		};
		get_json_stringify();
		// Nano Defender(?) overrides this on some sites.
		var get_orig_eventtarget = function() {
			// native_functions returns iframe
			var EventTarget_addEventListener, EventTarget_removeEventListener;
			if (is_interactive) {
				our_EventTarget = EventTarget;
				EventTarget_addEventListener = our_EventTarget.prototype.addEventListener;
				EventTarget_removeEventListener = our_EventTarget.prototype.removeEventListener;
			}
			var eventhandler_map = null;
			var init_eventhandler_map = function() {
				if (!eventhandler_map)
					eventhandler_map = new_map();
			};
			our_addEventListener = function(element, event, handler, options) {
				// VM compatibility
				if (element === window && element.unsafeWindow)
					element = element.unsafeWindow;
				// performance
				var suspended_check = function() { return is_suspended(true); };
				if (event === "mousemove") {
					suspended_check = function() { return is_suspended(false); };
				}
				var real_handler = handler;
				handler = function(e) {
					if (suspended_check()) {
						if (is_terminated)
							our_removeEventListener(element, event, real_handler);
						return;
					}
					return real_handler(e);
				};
				// i??.fastpic.ru: needles are 'click' and 'popMagic'
				var new_handler = function(e) {
					return handler(e);
				};
				init_eventhandler_map();
				map_set(eventhandler_map, real_handler, new_handler);
				EventTarget_addEventListener.call(element, event, new_handler, options);
			};
			our_removeEventListener = function(element, event, handler, options) {
				init_eventhandler_map();
				var new_handler = map_get(eventhandler_map, handler);
				if (!new_handler) {
					console_warn("Modified handler not found, defaulting to specified handler");
					new_handler = handler;
				} else {
					map_remove(eventhandler_map, new_handler);
				}
				EventTarget_removeEventListener.call(element, event, new_handler, options);
			};
		};
		get_orig_eventtarget();
		// i??.fastpic.ru with violentmonkey
		var get_orig_createelement = function() {
			var HTMLDocument_createElement;
			if (is_interactive || is_scripttag || typeof HTMLDocument === "function") {
				HTMLDocument_createElement = HTMLDocument.prototype.createElement;
			}
			document_createElement = function(element) {
				if (!HTMLDocument_createElement) {
					console_error("Unable to create element", element, ", HTMLDocument.prototype.createElement does not exist");
					return;
				}
				return HTMLDocument_createElement.call(document, element);
			};
		};
		get_orig_createelement();
		var sanity_test = function(orig, correct, check, native_func) {
			if (!orig)
				return correct;
			if (check) {
				try {
					if (check(orig))
						return orig;
				} catch (e) { }
				;
			}
			if (native_func) {
				native_functions_to_get.push(native_func);
			}
			return correct;
		};
		var get_is_array = function() {
			var is_array_orig = Array.isArray;
			var is_array_correct = function(x) {
				return x instanceof Array;
			};
			if (is_array_orig) {
				is_array = is_array_orig;
			} else {
				is_array = is_array_correct;
			}
			// FIXME: why is there no check? is this a bug, or was this intentional?
			//is_array = sanity_test(is_array_orig, is_array_correct);
		};
		get_is_array();
		// kickass.com
		var get_compat_string_fromcharcode = function() {
			var string_fromcharcode_orig = null;
			// ublock on clipwatching blocks this entirely
			try {
				string_fromcharcode_orig = String.fromCharCode;
			} catch (e) { }
			var fromcharcode_check = function(func) {
				return func(50) === "2" && func(100) === "d" && func("50", "100") === "2d";
			};
			var fromcharcode_correct = function() {
				var unicode = "";
				for (var i = 0; i < arguments.length; i++) {
					unicode += "\\u" + ("0000" + parseInt(arguments[i]).toString(16)).slice(-4);
				}
				return JSON_parse('"' + unicode + '"');
			};
			string_fromcharcode = sanity_test(string_fromcharcode_orig, fromcharcode_correct, fromcharcode_check);
		};
		get_compat_string_fromcharcode();
		// porn.com (ublock)
		var get_compat_string_charat = function() {
			var string_prototype_charat = String.prototype.charAt;
			var string_charat_orig = function(string, x) {
				return string_prototype_charat.call(string, x);
			};
			var string_charat_correct = function(string, x) {
				var result = string[x];
				if (result === void 0)
					result = "";
				return result;
			};
			var string_charat_check = function(func) {
				var test_string = "abc";
				if (func(test_string, 0) === "a" &&
					func(test_string, 1) === "b" &&
					func(test_string, -1) === "" &&
					func(test_string, 3) === "") {
					return true;
				}
				return false;
			};
			string_charat = sanity_test(string_charat_orig, string_charat_correct, string_charat_check);
		};
		get_compat_string_charat();
		var get_compat_base64 = function() {
			if (is_node)
				return;
			// Some websites replace atob, so we have to provide our own implementation in those cases
			var base64_decode_correct = function(s) {
				return base64_decode_base(s);
			};
			var base64_decode_test = function(func) {
				if (func("dGVzdA==") === "test") {
					return true;
				}
				return false;
			};
			base64_decode = sanity_test(atob, base64_decode_correct, base64_decode_test, "atob");
			var base64_encode_test = function(func) {
				if (func("test") === "dGVzdA==") {
					return true;
				}
				return false;
			};
			var fake_base64_encode = function(s) {
				console_warn("Using fake base64 encoder");
				return s;
			};
			base64_encode = sanity_test(btoa, fake_base64_encode, base64_encode_test, "btoa");
		};
		get_compat_base64();
		var get_compat_array_indexof = function() {
			// https://www.mycomicshop.com/search?minyr=1938&maxyr=1955&TID=29170235
			// this site replaces Array.indexOf
			// cache Array.prototype.indexOf in case it changes while the script is executing
			var array_prototype_indexof = Array.prototype.indexOf;
			var array_indexof_orig = function(array, x) {
				return array_prototype_indexof.call(array, x);
			};
			var array_indexof_correct = function(array, x) {
				if (typeof array === "string") {
					// TODO: make sure Array.from is sane
					array = Array.from(array);
				}
				for (var i = 0; i < array.length; i++) {
					if (array[i] === x) {
						return i;
					}
				}
				return -1;
			};
			var array_indexof_check = function(func) {
				var test_array = ["a", "b"];
				var test_string = "abc";
				if (func(test_array, "not here") === -1 &&
					func(test_array, "b") === 1 &&
					func(test_string, "n") === -1 &&
					func(test_string, "b") === 1 &&
					func(test_string, "bc") === -1) {
					return true;
				}
				return false;
			};
			array_indexof = sanity_test(array_indexof_orig, array_indexof_correct, array_indexof_check);
		};
		get_compat_array_indexof();
		// idol.sankakucomplex.com overrides this with a broken one
		var get_compat_array_reduce = function() {
			var array_prototype_reduce = Array.prototype.reduce;
			var array_reduce_orig = function(array, cb, initial) {
				if (typeof initial !== "undefined")
					return array_prototype_reduce.call(array, cb, initial);
				else
					return array_prototype_reduce.call(array, cb);
			};
			var array_reduce_correct = function(array, cb, initial) {
				var firstindex = 0;
				if (typeof initial === "undefined") {
					if (!array.length) {
						throw new TypeError("Reduce of empty array with no initial value");
					}
					initial = array[0];
					firstindex = 1;
				}
				var acc = initial;
				for (var i = firstindex; i < array.length; i++) {
					acc = cb(acc, array[i], i, array);
				}
				return acc;
			};
			var array_reduce_check = function(func) {
				// should throw 'undefined is not a function'
				try {
					func([]);
					return false;
				} catch (e) { }
				// should throw 'Reduce of empty array with no initial value'
				try {
					func([], function() { });
					return false;
				} catch (e) { }
				var reducer = function(acc, cur, i) { return acc.x + cur.x + i; };
				if (isNaN(func([{ x: 2 }, { x: 2 }, { x: 2 }], reducer)) &&
					func([{ x: 2 }, { x: 6 }], reducer) === 9 &&
					func([{ x: 2 }], reducer).x === 2 &&
					func([{ x: 2 }], reducer, { x: 6 }) === 8) {
					return true;
				}
				return false;
			};
			array_reduce = sanity_test(array_reduce_orig, array_reduce_correct, array_reduce_check);
			array_reduce_prototype = function(cb, initial) {
				return array_reduce(this, cb, initial);
			};
		};
		get_compat_array_reduce();
		var get_compat_string_indexof = function() {
			var string_prototype_indexof = String.prototype.indexOf;
			var string_indexof_orig = function(string, x) {
				return string_prototype_indexof.call(string, x);
			};
			var string_indexof_correct = function(string, x) {
				if (x.length === 0)
					return 0;
				var x_i = 0;
				for (var i = 0; i < string.length; i++) {
					if (string_charat(string, i) === string_charat(x, x_i)) {
						if (x_i + 1 === x.length) {
							return i - x_i;
						} else {
							x_i++;
						}
					} else {
						x_i = 0;
					}
				}
				return -1;
			};
			var string_indexof_check = function(func) {
				var test_string = "abc";
				if (func(test_string, "n") === -1 &&
					func(test_string, "b") === 1 &&
					func(test_string, "bc") === 1 &&
					func(test_string, "bcz") === -1 &&
					func(test_string, "") === 0) {
					return true;
				}
				return false;
			};
			string_indexof = sanity_test(string_indexof_orig, string_indexof_correct, string_indexof_check);
		};
		get_compat_string_indexof();
		var get_compat_url = function() {
			if (is_node)
				return;
			var native_url_check = function(URL) {
				if (typeof URL !== "function" || typeof URL.prototype !== "object")
					return false;
				if (!("searchParams" in URL.prototype))
					return false;
				if (is_interactive) {
					if (!("createObjectURL" in URL) || !("revokeObjectURL" in URL))
						return false;
				}
				return true;
			};
			var orig_URL = URL || webkitURL;
			native_URL = sanity_test(orig_URL, nullfunc, native_url_check, "URL");
		};
		get_compat_url();
		var get_compat_blob = function() {
			if (is_node)
				return;
			var native_blob_check = function(Blob) {
				if (typeof Blob !== "function" || typeof Blob.prototype !== "object")
					return false;
				// doesn't seem to work under Firefox
				// it does exist after a while, but not while checking
				if (false && Blob.name !== "Blob")
					return false;
				if ( /*!("arrayBuffer" in Blob.prototype) ||*/ // Not implemented in pale moon
				!("slice" in Blob.prototype) ||
					!("size" in Blob.prototype))
					return false;
				return true;
			};
			var fake_blob = function() {
				console_warn("This is a fake Blob object, you will almost certainly encounter problems.");
			};
			new_blob = function(data, cb, options) {
				cb(new native_blob([data], options));
			};
			native_blob = sanity_test(Blob, fake_blob, native_blob_check, "Blob");
			if (native_blob !== Blob) {
				// todo: sanity check Response and File
				if (typeof Response === "function") {
					new_blob = function(data, cb, options) {
						var response_opt = {};
						if (options && options.type) {
							response_opt.headers = {
								"Content-Type": options.type
							};
						}
						new Response(data, response_opt).blob().then(function(resp) {
							cb(resp);
						});
					};
				} else if (typeof File === "function") {
					new_blob = function(data, cb, options) {
						cb(new File([data], "", options));
					};
				}
			}
		};
		get_compat_blob();
		// this is rather slow (~25ms according to fireattack's profile)
		var native_functions = {};
		var get_native_functions = function(functions) {
			// thanks to tophf here: https://github.com/violentmonkey/violentmonkey/issues/944
			var iframe = document_createElement("iframe");
			iframe.srcdoc = ""; //"javascript:0"
			document.documentElement.appendChild(iframe);
			var frame_window = iframe.contentWindow;
			for (var i = 0; i < functions.length; i++) {
				var func = functions[i];
				native_functions[func] = frame_window[func];
			}
			iframe.parentElement.removeChild(iframe);
		};
		// FIXME: this doesn't work under pale moon: https://github.com/qsniyg/maxurl/issues/349
		if (native_functions_to_get.length > 0) {
			try {
				get_native_functions(native_functions_to_get);
			} catch (e) {
				console_error(e);
			}
			if ("Blob" in native_functions) {
				native_blob = native_functions["Blob"];
			}
			if ("URL" in native_functions) {
				native_URL = native_functions["URL"];
			}
			if ("atob" in native_functions) {
				base64_decode = native_functions["atob"];
			}
			if ("btoa" in native_functions) {
				base64_encode = native_functions["btoa"];
			}
		}
	};
	get_compat_functions();
	var force_array = function(arrayornot) {
		if (!is_array(arrayornot)) {
			return [arrayornot];
		} else {
			return arrayornot;
		}
	};
	var array_extend = function(array, other) {
		other = force_array(other);
		[].push.apply(array, other);
	};
	var array_foreach = function(array, cb, do_shallow_copy) {
		if (do_shallow_copy) {
			var newarray = [];
			for (var i = 0; i < array.length; i++) {
				newarray.push(array[i]);
			}
			array = newarray;
		}
		for (var i = 0; i < array.length; i++) {
			if (cb(array[i], i) === false)
				return;
		}
	};
	var array_map = function(array, cb) {
		var out = [];
		for (var i = 0; i < array.length; i++) {
			out[i] = cb(array[i]);
		}
		return out;
	};
	var array_or_null = function(array) {
		if (!array || !array.length)
			return null;
		return array;
	};
	var array_upush = function(array, item) {
		if (array_indexof(array, item) < 0)
			array.push(item);
	};
	var string_replaceall = function(str, find, replace) {
		// TODO: make faster
		return str.split(find).join(replace);
	};
	var match_all = function(str, regex) {
		var global_regex = new RegExp(regex, "g");
		var matches = str.match(global_regex);
		if (!matches)
			return null;
		var result = [];
		for (var _i = 0, matches_1 = matches; _i < matches_1.length; _i++) {
			var match = matches_1[_i];
			result.push(match.match(regex));
		}
		return result;
	};
	var obj_foreach = function(obj, cb) {
		for (var key in obj) {
			if (cb(key, obj[key]) === false)
				return;
		}
	};
	var obj_extend = function(obj, otherobj) {
		for (var key in otherobj) {
			obj[key] = otherobj[key];
		}
		return obj;
	};
	// todo: make type CommonFunctions
	var common_functions = {};
	common_functions["nullfunc"] = function() { };
	common_functions["nullobjfunc"] = function() {
		var x = {
			func: function() { }
		};
		return x;
	};
	common_functions["run_arrayd_string"] = function(str, options) {
		str = str.split("");
		options.cb(str);
		return str.join("");
	};
	common_functions["new_vm"] = function() {
		// si[n] = nth stack item (last = 0)
		var vm_arch = [
			// 0: Push data to the stack
			function(vm) {
				vm.stack.unshift(vm.data);
			},
			// 1: Push arg to the stack
			function(vm) {
				vm.stack.unshift(vm.arg);
			},
			// 2: Pop si[0] .. si[arg]
			function(vm) {
				for (var i = 0; i < vm.arg; i++) {
					vm.stack.shift();
				}
			},
			// 3: Push si[arg] to si[0]
			function(vm) {
				vm.stack.unshift(vm.stack[vm.arg]);
			},
			// 4: Append si[1] to si[0]
			function(vm) {
				vm.stack[0].push(vm.stack[1]);
			},
			// 5: Prepend si[1] to si[0]
			function(vm) {
				vm.stack[0].unshift(vm.stack[1]);
			},
			// 6: Reverse si[0]
			function(vm) {
				vm.stack[0].reverse();
			},
			// 7: Swaps the values at si[1] and si[2] in si[0]
			function(vm) {
				var register = vm.stack[0][vm.stack[2]];
				vm.stack[0][vm.stack[2]] = vm.stack[0][vm.stack[1] % vm.stack[0].length];
				vm.stack[0][vm.stack[1] % vm.stack[0].length] = register;
			},
			// 8: Removes si[1] (id) from si[0]
			function(vm) {
				vm.stack[0].splice(vm.stack[1], 1);
			},
			// 9: Removes everything from the beginning of si[0] to si[1]
			function(vm) {
				vm.stack[0].splice(0, vm.stack[1]);
			},
			// 10: Removes everything from si[1] to the end of si[0]
			function(vm) {
				vm.stack[0].splice(vm.stack[1], vm.stack[0].length);
			},
			// 11: Adds si[2] to the value at si[1] in si[0]
			function(vm) {
				vm.stack[0][vm.stack[1]] += vm.stack[2];
			},
			// 12: Multiplies si[2] with the value at si[1] in si[0]
			function(vm) {
				vm.stack[0][vm.stack[1]] *= vm.stack[2];
			},
			// 13: Negates the value at si[1] in si[0]
			function(vm) {
				vm.stack[0][vm.stack[1]] *= -1;
			},
		];
		var _run_vm = function(ops, data) {
			var vm = {
				stack: [],
				data: data
			};
			for (var i = 0; i < ops.length; i += 2) {
				var inst = ops[i];
				var arg = ops[i + 1];
				vm.arg = arg;
				vm_arch[inst](vm);
			}
			return data;
		};
		var run_vm = function(ops, data) {
			if (typeof data === "string") {
				return common_functions["run_arrayd_string"](data, {
					cb: function(data) {
						return _run_vm(ops, data);
					}
				});
			} else {
				return _run_vm(ops, data);
			}
		};
		return {
			arch: vm_arch,
			op_start: 4, // first 4 are push/pop
			total_instrs: Object.keys(vm_arch).length,
			run: run_vm
		};
	};
	common_functions["create_vm_ops"] = function(instructions) {
		var ops = [];
		// initialize stack
		for (var i = 0; i < 3; i++) {
			ops.push(1, 0);
		}
		array_foreach(instructions, function(inst) {
			var opcode = inst[0];
			// push arguments
			for (var i = 1; i < inst.length; i++) {
				ops.push(1, inst[i]);
			}
			var args_count = inst.length - 1;
			ops.push(
			// push data
			0, null, 
			// run operation
			opcode, null, 
			// pop data+args
			2, 1 + args_count);
		});
		// cleanup
		ops.push(2, 3);
		return ops;
	};
	// ublock blocks accessing Math on sites like gfycat
	var Math_floor, Math_round, Math_random, Math_max, Math_min, Math_abs, Math_pow;
	var get_compat_math = function() {
		if (is_node)
			return;
		try {
			Math_floor = Math.floor;
			Math_round = Math.round;
			Math_random = Math.random;
			Math_max = Math.max;
			Math_min = Math.min;
			Math_abs = Math.abs;
			Math_pow = Math.pow;
		} catch (e) {
			Math_floor = function(x) {
				return x | 0;
			};
			Math_round = function(x) {
				return Math_floor(x + 0.5);
			};
			var math_seed = Date.now();
			var math_vm = null;
			Math_random = function() {
				if (!math_vm) {
					math_vm = common_functions["new_vm"]();
				}
				if (math_vm) {
					var total_instrs = math_vm.total_instrs - math_vm.op_start;
					var bad_instrs = [8, 9, 10, 13];
					var instructions = [];
					var times = math_seed & 0xf;
					if (!times)
						times = 4;
					for (var i = 0; i < times; i++) {
						var instr = (((math_seed >> 4) & 0xf) + ((math_seed >> (i % 8)) & 0xf)) % total_instrs + math_vm.op_start;
						if (array_indexof(bad_instrs, instr) >= 0) {
							times++;
							continue;
						}
						instructions.push([
							instr,
							(math_seed & 0xff) + i,
							((math_seed & 0xf) + i) % 5
						]);
					}
					var ops = common_functions["create_vm_ops"](instructions);
					try {
						var new_math_seed = parseFloat(math_vm.run(ops, math_seed + ""));
						if (!isNaN(new_math_seed))
							math_seed += new_math_seed;
					} catch (e) {
						//console_warn(e);
					}
				}
				math_seed += Date.now();
				math_seed %= 1e8;
				return math_seed / 1e8;
			};
			Math_max = function() {
				var max = -Infinity;
				for (var i = 0; i < arguments.length; i++) {
					if (arguments[i] > max)
						max = arguments[i];
				}
				return max;
			};
			Math_min = function() {
				var min = Infinity;
				for (var i = 0; i < arguments.length; i++) {
					if (arguments[i] < min)
						min = arguments[i];
				}
				return min;
			};
			Math_abs = function(x) {
				if (x < 0)
					return -x;
				return x;
			};
			// incorrect but good enough for now
			Math_pow = function(x, y) {
				for (var i = 1; i < y; i++) {
					x *= x;
				}
				return x;
			};
		}
	};
	get_compat_math();
	var get_random_text = function(length, num) {
		var text = "";
		while (text.length < length) {
			var newnum = Math_floor(Math_random() * 10e8);
			var newtext;
			if (!num) {
				newtext = newnum.toString(26);
			} else {
				newtext = newnum.toString(10);
			}
			text += newtext;
		}
		text = text.substr(0, length);
		return text;
	};
	var get_random_id = function() {
		return get_random_text(10) + Date.now();
	};
	var _version_compare_pad_0 = function(array, amount) {
		if (amount <= 0)
			return;
		for (var i = 0; i < amount; i++) {
			array.push("0");
		}
	};
	function version_compare(a, b) {
		// just in case
		if (typeof a !== "string" || typeof b !== "string")
			return null;
		var version_regex = /^[0-9]+(\.[0-9]+){0,}$/;
		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) {
			_version_compare_pad_0(a_split, b_split.length - a_split.length);
			_version_compare_pad_0(b_split, a_split.length - b_split.length);
		}
		for (var i = 0; i < a_split.length; i++) {
			var an = parse_int(a_split[i]);
			var bn = parse_int(b_split[i]);
			if (an < bn)
				return 1;
			if (an > bn)
				return -1;
		}
		return 0;
	}
	var get_options_page = function() {
		if (is_extension)
			return preferred_options_page;
		if (settings && settings.use_webarchive_for_lib) {
			return archive_options_page;
		} else {
			return preferred_options_page;
		}
	};
	var id_to_iframe = {};
	// todo: move to do_mouseover
	var get_frame_info = function() {
		return {
			id: current_frame_id,
			//url: window.location.href, // doesn't get updated for the iframe src's attribute?
			url: current_frame_url,
			size: [
				//document.documentElement.scrollWidth,
				//document.documentElement.scrollHeight
				// indavideo.hu has iframes with more height than what is displayed
				window.innerWidth,
				window.innerHeight
			]
		};
	};
	// todo: move to do_mouseover
	var find_iframe_for_info = function(info) {
		if (info.id in id_to_iframe)
			return id_to_iframe[info.id];
		var finish = function(iframe) {
			if (!iframe)
				return iframe;
			id_to_iframe[info.id] = iframe;
			return iframe;
		};
		var iframe_els = document.getElementsByTagName("iframe");
		var newiframes = [];
		for (var i = 0; i < iframe_els.length; i++) {
			if (iframe_els[i].src !== info.url)
				continue;
			newiframes.push(iframe_els[i]);
		}
		// useful for later if we don't have the length <= 1 check
		var ignored_src = false;
		if (newiframes.length === 0) {
			// e.g. indavideo, frame's src != iframe src because it gets redirected (/ at the end is removed)
			//newiframes = iframes as Array<HTMLIFrameElement>; // FIXME: iframes doesn't exist?
			newiframes = [];
			ignored_src = true;
		} else if (newiframes.length <= 1) {
			return finish(newiframes[0]);
		}
		var iframes = newiframes;
		newiframes = [];
		for (var i = 0; i < iframes.length; i++) {
			if (iframes[i].scrollWidth !== info.size[0] ||
				iframes[i].scrollHeight !== info.size[1]) {
				continue;
			}
			newiframes.push(iframes[i]);
		}
		if (newiframes.length <= 1)
			return finish(newiframes[0]);
		// TODO: check cursor too
		return null;
	};
	var iframe_to_id = function(iframe) {
		for (var id in id_to_iframe) {
			if (id_to_iframe[id] === iframe)
				return id;
		}
		return null;
	};
	var id_to_iframe_window = function(id) {
		if (!(id in id_to_iframe))
			return null;
		// no need for contentWindow in top
		if (id !== "top") {
			try {
				if (id_to_iframe[id].contentWindow)
					return id_to_iframe[id].contentWindow;
			} catch (e) {
				// not allowed
				return false;
			}
		}
		return id_to_iframe[id];
	};
	var remote_send_message = null;
	var remote_send_reply = null;
	var remote_reply_ids = {};
	var current_frame_id = null;
	var current_frame_url = null;
	var raw_remote_send_message = null;
	var remote_send_message = common_functions["nullfunc"];
	var remote_send_reply = common_functions["nullfunc"];
	var imu_message_key = "__IMU_MESSAGE__";
	if (is_extension) {
		raw_remote_send_message = function(to, message) {
			extension_send_message(message);
		};
		is_remote_possible = true;
	} else if (is_interactive) {
		if (is_in_iframe && window.parent) {
			id_to_iframe["top"] = window.parent;
		}
		raw_remote_send_message = function(to, message) {
			if (!to && is_in_iframe)
				to = "top"; // fixme?
			var specified_window;
			if (to && to in id_to_iframe) {
				specified_window = id_to_iframe_window(to);
				if (!specified_window) {
					if (_nir_debug_) {
						console_warn("Unable to find window for", to, { is_in_iframe: is_in_iframe, id_to_iframe: id_to_iframe });
					}
					// not allowed
					return;
				}
			}
			message.imu = true;
			var wrapped_message = {};
			wrapped_message[imu_message_key] = serialize_event(message);
			if (!specified_window) {
				for (var i = 0; i < window.frames.length; i++) {
					try {
						window.frames[i].postMessage(wrapped_message, "*");
					} catch (e) {
						if (_nir_debug_) {
							console_warn("Unable to send message to", window.frames[i], e);
						}
						// not allowed
						continue;
					}
				}
			} else {
				specified_window.postMessage(wrapped_message, "*");
			}
		};
		is_remote_possible = true;
		if (window.location.hostname === "cafe.daum.net") {
			// unfortunately they interpret all message events, leading to bugs in their website. thanks to ambler on discord for noticing
			is_remote_possible = false;
		}
	}
	if (is_remote_possible) {
		current_frame_url = window_location;
		current_frame_id = get_random_id() + " " + current_frame_url;
		if (!is_in_iframe)
			current_frame_id = "top";
		remote_send_message = function(to, data, cb) {
			var id = void 0;
			if (cb) {
				id = get_random_id();
				remote_reply_ids[id] = cb;
			}
			var message = {
				type: "remote",
				data: data,
				to: to,
				from: current_frame_id,
				response_id: id
			};
			if (_nir_debug_) {
				console_log("remote_send_message", to, message);
			}
			//console_log("remote", to, data);
			raw_remote_send_message(to, message);
		};
		remote_send_reply = function(to, response_id, data) {
			raw_remote_send_message(to, {
				type: "remote_reply",
				data: data,
				response_id: response_id
			});
		};
	}
	var can_use_remote = function() {
		return is_remote_possible && settings.allow_remote;
	};
	var can_iframe_popout = function() {
		return can_use_remote() && settings.mouseover_use_remote;
	};
	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;
		if (request.headers) {
			obj_foreach(request.headers, function(header_name, header_value) {
				try {
					xhr.setRequestHeader(header_name, header_value);
				} catch (e) { }
			});
		}
		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,
				timeout: xhr.timeout
			};
			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);
		add_handler("ontimeout", true);
		try {
			xhr.send(request.data);
		} catch (e) {
			// net::ERR_NETWORK_CHANGED can throw an error
			// thanks to AdClear247 for reporting: https://github.com/qsniyg/maxurl/issues/747
			console_error(e);
			xhr.abort();
		}
		return {
			abort: function() {
				xhr.abort();
			}
		};
	};
	try {
		if (typeof XMLHttpRequest !== "function") {
			do_request_browser = null;
		}
	} catch (e) {
		// adblock on jizzbunker.com, sends an exception with a random magic string if XMLHttpRequest is accessed
		do_request_browser = null;
	}
	var extension_requests = {};
	var do_request_raw = null;
	if (is_extension) {
		do_request_raw = function(data) {
			var reqid;
			var do_abort = false;
			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
				};
				if (do_abort) {
					extension_send_message({
						type: "abort_request",
						data: reqid
					});
					return;
				}
			});
			return {
				abort: function() {
					if (reqid === void 0) {
						console_warn("abort() was called before the request was initialized");
						do_abort = true;
						return;
					}
					extension_send_message({
						type: "abort_request",
						data: reqid
					});
				}
			};
		};
	} else if (typeof (GM_xmlhttpRequest) !== "undefined") {
		// idol.sankakucomplex.com overrides array.prototype.reduce
		// not an issue for newer Violentmonkey versions
		if (userscript_manager === "Violentmonkey" && version_compare(userscript_manager_version, "2.12.7") <= 0) {
			do_request_raw = function(data) {
				var orig_cbs = {};
				var is_native = function(x) {
					var x_str = x.toString();
					if (x_str.length < 80 && string_indexof(x_str, "native code") > 0) {
						return true;
					} else {
						return false;
					}
				};
				var revert = [];
				if (Array.prototype.reduce !== array_reduce_prototype && !is_native(Array.prototype.reduce)) {
					var old_reduce = Array.prototype.reduce;
					Array.prototype.reduce = array_reduce_prototype;
					revert.push(function() {
						Array.prototype.reduce = old_reduce;
					});
				}
				var reverted = false;
				var onfinal = function(x, args) {
					if (!reverted) {
						array_foreach(revert, function(revert_func) {
							revert_func();
						});
						reverted = true;
					}
					return orig_cbs[x].apply(this, args);
				};
				if (revert.length) {
					var replace = ["onload", "onabort", "onerror", "ontimeout"];
					array_foreach(replace, function(x) {
						if (x in data) {
							orig_cbs[x] = data[x];
							data[x] = function() {
								return onfinal(x, arguments);
							};
						}
					});
				}
				return GM_xmlhttpRequest(data);
			};
		} else {
			do_request_raw = GM_xmlhttpRequest;
		}
	} else if (typeof (GM) !== "undefined" && typeof (GM.xmlHttpRequest) !== "undefined") {
		do_request_raw = GM.xmlHttpRequest;
	}
	if (is_extension && !is_extension_bg) {
		// used for clearing menu items
		extension_send_message({
			type: "init"
		});
	}
	var register_menucommand = common_functions["nullfunc"];
	var unregister_menucommand = common_functions["nullfunc"];
	var num_menucommands = 0;
	var menucommands_map = {};
	var transform_menucommand_func = function(func) {
		if (typeof func === "string") {
			var dest = func;
			func = function() {
				// this gets run for every frame the script is injected in
				if (is_in_iframe)
					return;
				open_in_tab_imu({
					url: dest
				}, false);
			};
		}
		return func;
	};
	if (is_userscript) {
		if (typeof (GM_registerMenuCommand) !== "undefined") {
			register_menucommand = function(name, func) {
				num_menucommands++;
				func = transform_menucommand_func(func);
				var caption = "[" + num_menucommands + "] " + name;
				var id = GM_registerMenuCommand(caption, func);
				if (id === void 0 || id === null)
					id = caption;
				return id;
			};
		}
		if (typeof (GM_unregisterMenuCommand) !== "undefined") {
			unregister_menucommand = function(id) {
				num_menucommands--;
				return GM_unregisterMenuCommand(id);
			};
		}
	} else if (is_extension && !is_extension_bg) {
		register_menucommand = function(name, func) {
			var id = get_random_id();
			func = transform_menucommand_func(func);
			menucommands_map[id] = {
				name: name,
				func: func
			};
			extension_send_message({
				type: "register_menucommand",
				data: {
					id: id,
					name: name
				}
			});
			return id;
		};
		unregister_menucommand = function(id) {
			extension_send_message({
				type: "unregister_menucommand",
				data: {
					id: id
				}
			});
			delete menucommands_map[id];
		};
	}
	var open_in_tab = common_functions["nullfunc"];
	// todo: move below settings for options page
	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 (false && open_in_tab !== common_functions["nullfunc"]) {
			register_menucommand("Options", get_options_page());
			register_menucommand("Request support for this page", function() {
				if (is_in_iframe)
					return;
				var location = window.location.href;
				open_in_tab("https://qsniyg.github.io/maxurl/#imu-request-site&url=" + encodeURIComponent(location));
			});
		}
	}
	var open_in_tab_imu = function(imu, bg, cb) {
		if (is_extension) {
			extension_send_message({
				type: "newtab",
				data: {
					imu: imu,
					background: bg || false
				}
			}, cb);
		} else if (is_userscript && open_in_tab) {
			open_in_tab(imu.url, bg);
			if (cb) {
				cb();
			}
		}
	};
	if ((is_userscript && open_in_tab !== common_functions["nullfunc"]) || is_extension) {
		if (is_userscript)
			register_menucommand("Options", get_options_page());
		register_menucommand("Request support for this page", function() {
			if (is_in_iframe)
				return;
			var location = window.location.href;
			open_in_tab_imu({
				url: "https://qsniyg.github.io/maxurl/#imu-request-site&url=" + encodeURIComponent(location)
			}, false);
		});
	}
	var check_tracking_blocked = function(result) {
		// FireMonkey returns null for result if blocked
		// GreaseMonkey returns null for status if blocked
		if (!result || result.status === 0 || result.status === null) {
			if (result && result.finalUrl && /^file:\/\//.test(result.finalUrl))
				return false;
			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));
			}
			// For cross-origin cookies
			if (!("withCredentials" in data)) {
				data.withCredentials = true;
			}
			if (!("headers" in data)) {
				data.headers = {};
			}
			if (data.imu_mode) {
				var headers_to_set = {};
				if (data.imu_mode === "document" || data.imu_mode === "iframe") {
					//headers_to_set["accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9";
					headers_to_set["accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8";
					headers_to_set["Sec-Fetch-Dest"] = data.imu_mode === "document" ? "document" : "iframe";
					headers_to_set["Sec-Fetch-Mode"] = "navigate";
					headers_to_set["Sec-Fetch-Site"] = data.imu_mode === "document" ? "same-origin" : "cross-site";
					headers_to_set["Sec-Fetch-User"] = "?1";
				} else if (data.imu_mode === "xhr") {
					headers_to_set["accept"] = "*/*";
					headers_to_set["Sec-Fetch-Dest"] = "empty";
					headers_to_set["Sec-Fetch-Mode"] = "cors";
					headers_to_set["Sec-Fetch-Site"] = "same-origin";
					headers_to_set["origin"] = data.url.replace(/^([a-z]+:\/\/[^/]+)(?:\/+.*)?$/, "$1");
				} else if (data.imu_mode === "image") {
					headers_to_set["accept"] = "image/webp,image/apng,image/*,*/*;q=0.8";
					headers_to_set["Sec-Fetch-Dest"] = "image";
					headers_to_set["Sec-Fetch-Mode"] = "no-cors";
					headers_to_set["Sec-Fetch-Site"] = "same-site";
				} else if (data.imu_mode === "video") {
					headers_to_set["accept"] = "*/*";
					headers_to_set["Sec-Fetch-Dest"] = "video";
					headers_to_set["Sec-Fetch-Mode"] = "no-cors";
					headers_to_set["Sec-Fetch-Site"] = "same-site";
				}
				delete data.imu_mode;
				for (var header in headers_to_set) {
					if (headerobj_get(data.headers, header) === void 0) {
						headerobj_set(data.headers, header, headers_to_set[header]);
					}
				}
			}
			if (data.imu_multipart) {
				//var boundary = "-----------------------------" + get_random_text(20);
				var boundary = "----WebKitFormBoundary" + get_random_text(16);
				// TODO: fix? only tested for one key
				var postdata = "";
				for (var key in data.imu_multipart) {
					var value = data.imu_multipart[key];
					postdata += "--" + boundary + "\r\nContent-Disposition: form-data; name=\"" + key + "\"\r\n\r\n";
					postdata += value + "\r\n";
				}
				postdata += "--" + boundary + "--\r\n";
				headerobj_set(data.headers, "Content-Type", "multipart/form-data; boundary=" + boundary);
				data.data = postdata;
				delete data.imu_multipart;
			}
			var orig_data = deepcopy(data);
			if (typeof data.url === "string")
				data.url = data.url.replace(/#.*/, "");
			if (!data.onerror)
				data.onerror = data.onload;
			if (!data.ontimeout)
				data.ontimeout = data.onerror;
			var raw_request_do = do_request_raw;
			if (is_userscript && settings.allow_browser_request) {
				if (userscript_manager === "Falkon GreaseMonkey" ||
					// USI doesn't properly support blob responses: https://bitbucket.org/usi-dev/usi/issues/13/various-problems-with-gm_xmlhttprequest
					(userscript_manager === "USI" && data.need_blob_response)) {
					raw_request_do = do_request_browser;
					delete data.trackingprotection_failsafe;
				}
			}
			if (data.retry_503) {
				if (data.retry_503 === true || typeof data.retry_503 !== "number")
					data.retry_503 = parse_int(settings.retry_503_times);
				if (data.retry_503 > 0) {
					var real_onload_503 = data.onload;
					var real_onerror_503 = data.onerror;
					var finalcb_503 = function(resp, iserror) {
						if (_nir_debug_) {
							console_log("do_request's finalcb_503:", resp, iserror, deepcopy(data));
						}
						if (resp.status === 503) {
							console_warn("Received status 503, retrying request", resp, orig_data);
							orig_data.retry_503 = data.retry_503 - 1;
							setTimeout(function() {
								do_request(orig_data);
							}, parse_int(settings.retry_503_ms) || 1);
						} else {
							if (iserror) {
								real_onerror_503(resp);
							} else {
								real_onload_503(resp);
							}
						}
					};
					data.onload = function(resp) {
						finalcb_503(resp, false);
					};
					data.onerror = function(resp) {
						finalcb_503(resp, 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 (_nir_debug_) {
						console_log("do_request's finalcb:", resp, iserror);
					}
					if (check_tracking_blocked(resp)) {
						// Workaround for a bug in FireMonkey where it calls both onload and onerror: https://github.com/erosman/support/issues/134
						data.onload = null;
						data.onerror = null;
						var newdata = shallowcopy(data);
						newdata.onload = real_onload;
						newdata.onerror = real_onerror;
						if (newdata.imu_responseType === "blob") {
							newdata.responseType = "blob";
						}
						return do_request_browser(newdata);
					} else {
						if (iserror) {
							real_onerror(resp);
						} else {
							real_onload(resp);
						}
					}
				};
				data.onload = function(resp) {
					finalcb(resp, false);
				};
				data.onerror = function(resp) {
					finalcb(resp, true);
				};
			}
			if (data.responseType === "blob" && !settings.use_blob_over_arraybuffer) {
				(function(real_onload) {
					data.onload = function(resp) {
						var newresp = resp;
						var final = function() {
							if (_nir_debug_) {
								console_log("do_request's arraybuffer->blob:", deepcopy(resp), newresp);
							}
							real_onload(newresp);
						};
						if (resp.response) {
							var mime = null;
							// hack for extension for performance
							if (is_extension && "_responseEncoded" in resp && resp._responseEncoded.type) {
								mime = resp._responseEncoded.type;
							} else if (resp.responseHeaders) {
								var parsed_headers = headers_list_to_dict(parse_headers(resp.responseHeaders));
								if (parsed_headers["content-type"]) {
									mime = parsed_headers["content-type"];
								}
							}
							newresp = shallowcopy(resp);
							var blob_options = void 0;
							if (mime) {
								blob_options = { type: mime };
							}
							new_blob(resp.response, function(blob) {
								newresp.response = blob;
								final();
							}, blob_options);
						} else {
							final();
						}
					};
				})(data.onload);
				data.responseType = "arraybuffer";
				data.imu_responseType = "blob";
			}
			if (_nir_debug_) {
				console_log("do_request (modified data):", deepcopy(data));
			}
			return raw_request_do(data);
		};
	} else if (is_interactive) {
		console.warn("Unable to initialize do_request, most functions will likely fail");
	}
	var fixup_filename = function(filename) {
		var special_regex = /["<>/:?\\*|\^]/g;
		if (settings.filename_replace_special_underscores)
			return filename.replace(special_regex, "_");
		return filename;
	};
	var is_same_origin = function(url1, url2) {
		// https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy
		// FIXME: this returns failure for http://site.com:80/ and http://site.com/
		var norm = function(url) { return url.replace(/^([a-z]+:\/\/[^/]+\/+).*/, "$1"); };
		return norm(url1) === norm(url2);
	};
	var do_browser_download = function(imu, filename, cb) {
		if (_nir_debug_) {
			console_log("do_browser_download", imu, filename, cb);
		}
		var a = document_createElement("a");
		a.href = imu.url;
		if (filename && filename.length > 0) {
			a.setAttribute("download", fixup_filename(filename));
		} else {
			var attr = document.createAttribute("download");
			a.setAttributeNode(attr);
		}
		// download only works for same-origin urls: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
		if (!is_same_origin(window_location, a.href)) {
			a.setAttribute("target", "_blank");
		}
		a.style.display = "none";
		a.onclick = function(e) {
			e.stopPropagation();
			e.stopImmediatePropagation();
			return true;
		};
		document.body.appendChild(a);
		a.click();
		setTimeout(function() {
			document.body.removeChild(a);
		}, 500);
		if (cb)
			cb();
	};
	var do_download = function(imu, filename, size, cb) {
		if (true || _nir_debug_) {
			console_log("do_download", imu, filename, size, cb);
		}
		if (false) {
			request_chunked(imu, {
				onload: function(data) {
					console_log("finished", data);
					var blob = new native_blob([data.data], {
						type: data.mime || void 0
					});
					var objurl = create_objecturl(blob);
					do_browser_download({
						url: objurl,
					}, filename, cb);
					setTimeout(function() {
						revoke_objecturl(objurl);
					}, 500);
				},
				onprogress: function(progobj) {
					console_log(progobj.percent, progobj);
				}
			});
			return;
		}
		var use_gm_download = is_userscript && typeof GM_download !== "undefined" && settings.enable_gm_download;
		var gm_download_max = parseFloat(settings.gm_download_max) || 0;
		if (use_gm_download && size && gm_download_max) {
			if ((gm_download_max * 1024 * 1024) < size) {
				use_gm_download = false;
			}
		}
		var is_data = false;
		if (imu && imu.url) {
			is_data = /^data:/.test(imu.url);
		}
		// hacky but works for now
		if (is_data) {
			return do_browser_download(imu, filename, cb);
		}
		if (is_extension) {
			extension_send_message({
				type: "download",
				data: {
					imu: imu,
					filename: fixup_filename(filename),
					force_saveas: !!settings.enable_webextension_download
				}
			}, function() {
				if (cb)
					cb();
			});
		} else if (use_gm_download) {
			var headers;
			if (imu.headers) {
				if (false) {
					// why? this breaks both tampermonkey and violetmonkey
					headers = headers_dict_to_list(imu.headers);
				} else {
					headers = imu.headers;
				}
			}
			var download_obj = {
				url: imu.url,
				headers: headers,
				saveAs: true,
				onerror: function(error) {
					if (error && error.error && error.error !== "not_succeeded") {
						do_browser_download(imu, filename, cb);
					}
				}
			};
			if (filename) {
				download_obj["name"] = fixup_filename(filename);
			} else {
				download_obj["name"] = "download"; // it can't be blank
			}
			if (_nir_debug_) {
				console_log("GM_download", deepcopy(download_obj));
			}
			GM_download(download_obj);
		} else {
			do_browser_download(imu, filename, cb);
		}
	};
	var do_blob_download = function(blob, filename, cb) {
		var objurl = create_objecturl(blob);
		do_browser_download({
			url: objurl,
		}, filename);
		setTimeout(function() {
			revoke_objecturl(objurl);
			if (cb)
				cb();
		}, 500);
	};
	var multiqueue = function(options, cb) {
		var running = false;
		var currently_running = 0;
		// todo: support adding new items mid-run
		var run_single = function() {
			if (!options.queue.length) {
				if (currently_running <= 0) {
					return cb();
				}
				return;
			}
			var item = options.queue.shift();
			currently_running++;
			options.runner(item, function() {
				currently_running--;
				run_single();
			});
		};
		var run = function() {
			if (running)
				return;
			running = true;
			for (var i = options.concurrency; i > 0; i--) {
				run_single();
			}
		};
		return {
			add: function(x) {
				options.queue.push(x);
			},
			start: run
		};
	};
	var ImpreciseProgress = function(options) {
		this.elements_num = options.elements_num || 0;
		this.total_size = options.total_size || 0;
		//this.total_size_known = false;
		this.known_elements = {};
		this.finished = false;
		var last_percent = 0;
		this.calc_completion = function() {
			var known_total = 0;
			var known_num = 0;
			var known_progress = 0;
			var approx = [];
			obj_foreach(this.known_elements, function(id, obj) {
				if (!obj.size && obj.progress_ratio) {
					approx.push(obj);
					return;
				}
				known_total += obj.size;
				known_progress += obj.progress;
				known_num++;
			});
			var total = this.total_size;
			var total_accurate = true;
			if (approx.length) {
				total_accurate = false;
				var average_length = 1;
				if (known_num) {
					average_length = known_total / known_num;
				}
				array_foreach(approx, function(obj) {
					known_total += average_length;
					known_progress += obj.progress_ratio * average_length;
					known_num++;
				});
			}
			if (!total) {
				total = known_total;
				var unknown_count = this.elements_num - known_num;
				if (unknown_count > 0 && known_num > 0) {
					total += (known_total / known_num) * unknown_count;
					total_accurate = false;
				}
			}
			var retobj = {
				percent: known_progress / total,
				total: total,
				total_accurate: total_accurate,
				loaded: known_progress
			};
			if (this.finished) {
				retobj.percent = 1;
				retobj.loaded = retobj.total;
			}
			return retobj;
		};
		this._do_cb = function() {
			var completion = this.calc_completion();
			if (completion.percent === last_percent)
				return;
			last_percent = completion.percent;
			options.cb(completion);
		};
		this.update = function(id, progress, size) {
			if (!(id in this.known_elements)) {
				this.known_elements[id] = {
					progress: 0,
					size: 0
				};
			}
			if (size || !progress) {
				this.known_elements[id].progress = progress;
				this.known_elements[id].size = size;
			} else if (this.known_elements[id].size) {
				this.known_elements[id].progress = progress * this.known_elements[id].size;
			} else {
				this.known_elements[id].progress_ratio = progress;
			}
			this._do_cb();
		};
		this.update_progobj = function(id, progobj) {
			this.update(id, progobj.loaded, progobj.total);
		};
		this.finish_id = function(id) {
			this.update(id, 1);
		};
		this.finish = function() {
			this.finished = true;
			this._do_cb();
		};
	};
	var request_chunked = function(xhrobj, options) {
		if (!xhrobj.headers) {
			xhrobj.headers = {};
		}
		xhrobj.responseType = "arraybuffer";
		var do_progress = !!options.onprogress;
		var get_contentrange_length = function(headers) {
			if (!("content-range" in headers)) {
				return null;
			} else {
				// todo: improve
				var range = headers["content-range"].split("/");
				return parse_int(range[1]);
			}
		};
		var download_chunk = function(start, end, cb, progresscb) {
			//console_log("downloading", start, end, xhrobj.url);
			var ourobj = deepcopy(xhrobj);
			ourobj.method = "GET";
			var range_value = "bytes=" + start + "-";
			if (end)
				range_value += (end - 1);
			var id = start;
			headerobj_set(ourobj.headers, "Range", range_value);
			if (progresscb) {
				ourobj.onprogress = function(resp) {
					if (resp.loaded && resp.total) {
						var headers = headers_list_to_dict(parse_headers(resp.responseHeaders));
						var contentlength = get_contentrange_length(headers);
						return progresscb(id, resp.loaded, resp.total, contentlength);
					}
				};
				ourobj.onload = function(resp) {
					var length;
					if (end)
						length = end - start;
					if (resp.response)
						length = resp.response.byteLength; // probably the only one that's actually needed?
					if (!length) {
						var headers = headers_list_to_dict(parse_headers(resp.responseHeaders));
						if ("content-length" in headers) {
							length = parse_int(headers["content-length"]);
						}
					}
					progresscb(id, length, length);
					cb(resp);
				};
			} else {
				ourobj.onload = cb;
			}
			do_request(ourobj);
		};
		var ip = null, chunk_progress = null;
		if (do_progress) {
			ip = new ImpreciseProgress({
				cb: options.onprogress,
				elements_num: 1
			});
			chunk_progress = function(id, progress, total, full_total) {
				if (!ip.total_size && full_total)
					ip.total_size = full_total;
				ip.update(id, progress, total);
			};
		}
		var data = null;
		var mime = null;
		var final_cb = function(resp) {
			if (do_progress)
				ip.finish();
			options.onload({
				data: data,
				mime: mime
			}, resp);
		};
		var chunk_size = options.chunk_size;
		if (!chunk_size && chunk_size !== 0)
			chunk_size = 512 * 1024;
		// todo: GET, if Accept-Ranges is present, abort, save the current response, then go with chunked
		// more info: https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests
		// or maybe just check 200/206 instead
		download_chunk(0, chunk_size, function(resp) {
			var headers = headers_list_to_dict(parse_headers(resp.responseHeaders));
			var content_length = 0;
			if (resp.status === 200) {
				content_length = resp.response.byteLength;
			} else if (resp.status === 206) {
				content_length = get_contentrange_length(headers);
				if (content_length === null) {
					console_error("Unable to find length through content-range");
					return options.onload(null, resp);
				}
			} else {
				console_error("Bad status", resp.status, resp);
				return options.onload(null, resp);
			}
			data = new Uint8Array(content_length);
			data.set(new Uint8Array(resp.response), 0);
			if (resp.response.byteLength >= content_length) {
				return final_cb(resp);
			}
			if ("content-type" in headers) {
				mime = headers["content-type"];
			}
			if (do_progress)
				ip.total_size = content_length;
			//console_log(content_length);
			// todo: instead of this, maybe just keep running until 200/no more data?
			var queue = [];
			for (var start = resp.response.byteLength;; start += chunk_size) {
				var val = [start];
				var do_break = true;
				if (content_length - start > chunk_size) {
					val.push(start + chunk_size);
					do_break = false;
				}
				queue.push(val);
				if (do_break)
					break;
			}
			if (do_progress)
				ip.elements_num += queue.length;
			//data.set(new Uint8Array(resp.response), 0);
			var mqueue = multiqueue({
				concurrency: options.chunks || 5,
				queue: queue,
				runner: function(item, cb) {
					download_chunk(item[0], item[1], function(resp) {
						// todo: check errors
						//console_log(item[0], item[1], resp.response.byteLength, content_length);
						data.set(new Uint8Array(resp.response), item[0]);
						cb();
					}, chunk_progress);
				}
			}, function() {
				final_cb(resp);
			});
			mqueue.start();
		}, chunk_progress);
	};
	var native_clipboard_write = null;
	var browser_clipboard_write = null;
	var browser_clipboard_api_write = null;
	if (is_interactive) {
		browser_clipboard_write = function(data, cb) {
			if (_nir_debug_)
				console_log("clipboard_write execcommand", data);
			var input = document.createElement("textarea");
			// display: none and visibility: hidden prevent it from being copied in chrome
			input.style.height = "1px";
			input.style.width = "1px";
			input.style.resize = "none";
			input.style.appearance = "none";
			input.style.border = "0";
			input.style.margin = "0";
			input.style.padding = "0";
			input.style.display = "inline";
			input.style.cursor = "default";
			document.body.appendChild(input);
			input.innerText = data.text;
			input.focus();
			input.select();
			setTimeout(function() {
				document.body.removeChild(input);
			}, 100);
			cb(!!document.execCommand("copy"));
		};
		// firefox (83) doesn't yet support clipboard.write
		if (navigator.clipboard && (navigator.clipboard.write || navigator.clipboard.writeText)) {
			browser_clipboard_api_write = function(data, cb) {
				if (_nir_debug_)
					console_log("clipboard_write clipboard_api", data);
				var promise;
				var can_use_writetext = data.mime === "text/plain" && navigator.clipboard.writeText;
				// though writeText is a wrapper over write, it allows us to avoid creating a blob, which can be an issue on some websites
				// for some reason, chrome doesn't allow creating a ClipboardItem without a blob
				if (!can_use_writetext && navigator.clipboard.write && typeof ClipboardItem === "function") {
					var mimes = {};
					mimes[data.mime] = new native_blob([data.text], { type: data.mime });
					var item = new ClipboardItem(mimes);
					promise = navigator.clipboard.write([item]);
				} else if (can_use_writetext) {
					promise = navigator.clipboard.writeText(data.text);
				} else {
					return cb(false);
				}
				promise.then(function() { cb(true); }, function(e) {
					console.error(e);
					cb(false);
				});
			};
		}
	}
	if (is_userscript) {
		if (typeof GM_setClipboard === "function") {
			native_clipboard_write = function(data, cb) {
				// Violentmonkey doesn't support the info object that Tampermonkey supports, so just use mime by itself
				GM_setClipboard(data.text, data.mime);
				cb(true);
			};
		} else if (typeof GM === "object" && typeof GM.setClipboard === "function") {
			native_clipboard_write = function(data, cb) {
				GM.setClipboard(data.text);
				cb(true);
			};
		}
	}
	var clipboard_write = function(data, cb) {
		if (!cb)
			cb = nullfunc;
		if (typeof data === "string") {
			data = { text: data };
		}
		if (!data.mime)
			data.mime = "text/plain";
		var writers = [
			native_clipboard_write,
			browser_clipboard_api_write,
			browser_clipboard_write
		];
		var do_write = function() {
			var writer;
			for (var i = 0; i < writers.length; i++) {
				if (!writers[i]) {
					writers.shift();
					i--;
					continue;
				}
				writer = writers[i];
				break;
			}
			writer(data, function(success) {
				if (writers.length > 0 && !success) {
					writers.shift();
					return do_write();
				}
				cb(success);
			});
		};
		do_write();
	};
	// this might be different later
	var clipboard_write_link = clipboard_write;
	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);
			});
		};
	} else if (is_userscript) {
		// TODO: support GM_cookie
		get_cookies = function(url, cb, options) {
			if (settings.browser_cookies === false) {
				return cb(null);
			}
			if (!options) {
				options = {};
			}
			if (options.need_full) {
				return cb(null);
			}
			var host_domain = get_domain_from_url(window_location);
			var host_domain_nosub = get_domain_nosub(host_domain);
			var url_domain = get_domain_from_url(url);
			var url_domain_nosub = get_domain_nosub(url_domain);
			// this is ugly
			if (host_domain_nosub === url_domain_nosub) {
				cb(cookies_str_to_list(document.cookie));
			} else {
				cb(null);
			}
		};
	}
	var _localstorage_check_origin = function(url) {
		var url_domain = get_domain_from_url(url);
		var host_domain = get_domain_from_url(window_location);
		return url_domain.toLowerCase() === host_domain.toLowerCase();
	};
	// internal helper function to get items from localStorage
	var _localstorage_get_items = function(items, options) {
		if (!options)
			options = {};
		var result = {};
		var storage = localStorage;
		if (options.storage === "session")
			storage = sessionStorage;
		array_foreach(items, function(item) {
			result[item] = storage.getItem(item);
		});
		return result;
	};
	var get_localstorage = null;
	if (is_extension) {
		get_localstorage = function(url, keys, cb, options) {
			extension_send_message({
				type: "get_localstorage",
				data: {
					url: url,
					keys: keys,
					options: options
				}
			}, function(data) {
				if (!data)
					return cb(null);
				cb(data.data);
			});
		};
	} else if (is_userscript) {
		get_localstorage = function(url, keys, cb, options) {
			if (!_localstorage_check_origin(url))
				return cb(null);
			cb(_localstorage_get_items(keys, options));
		};
	}
	var cookies_str_to_list = function(cookiesstr) {
		var cookies = [];
		var splitted = cookiesstr.split(/;\s*/);
		array_foreach(splitted, function(kv) {
			var match = kv.match(/^\s*([^=\s]+)\s*=\s*(?:"([^"]+)"|([^"]\S*))\s*$/);
			if (!match) {
				console_warn("Unable to parse cookie", kv);
				return;
			}
			cookies.push({ name: match[1], value: match[2] || match[3] });
		});
		return cookies;
	};
	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(url) {
		return true;
	};
	var host_filter = function(url) {
		return true;
	};
	var host_html_filter = function(url) {
		return true;
	};
	if (is_interactive || is_extension_bg) {
		var blackwhitelist_filter_1 = function(url, regexes, option) {
			var result = true;
			for (var i = 0; i < regexes.length; i++) {
				if (regexes[i].test(url)) {
					result = false;
					break;
				}
			}
			if (option === "whitelist") {
				return !result;
			} else {
				return result;
			}
		};
		bigimage_filter = function(url) {
			return blackwhitelist_filter_1(url, blacklist_regexes, settings.bigimage_blacklist_mode);
		};
		host_filter = function(url) {
			var regexes = host_blacklist_regexes;
			if (settings.apply_blacklist_host)
				regexes = blacklist_regexes;
			return blackwhitelist_filter_1(url, regexes, settings.host_blacklist_mode);
		};
		host_html_filter = function(url) {
			console.log(host_html_blacklist_regexes);
			return blackwhitelist_filter_1(url, host_html_blacklist_regexes, settings.host_html_blacklist_mode);
		};
	}
	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,
		allow_thirdparty_code: false,
		process_format: {},
		filter: bigimage_filter,
		rule_specific: {
			deviantart_prefer_size: false,
			deviantart_support_download: true,
			ehentai_full_image: true,
			imgur_source: true,
			imgur_nsfw_headers: null,
			instagram_use_app_api: false,
			instagram_dont_use_web: false,
			instagram_prefer_video_quality: true,
			instagram_gallery_postlink: false,
			snapchat_orig_media: true,
			teddit_redirect_reddit: true,
			tiktok_no_watermarks: false,
			tiktok_thirdparty: null,
			tumblr_api_key: null,
			twitter_use_ext: false,
			linked_image: false,
		},
		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,
		can_multiple_request: true,
		head_ok_errors: [],
		head_wrong_contenttype: false,
		head_wrong_contentlength: false,
		need_blob: false,
		need_data_url: false,
		waiting: false,
		redirects: false,
		forces_download: false,
		is_private: false,
		is_pagelink: false,
		is_original: false,
		norecurse: false,
		forcerecurse: false,
		can_cache: true,
		bad: false,
		bad_if: [],
		fake: false,
		media_info: {
			type: "image", // "image" or "video"
			delivery: null, // "hls" or "dash"
			is_live: false
		},
		video: false, // deprecated
		album_info: null,
		headers: {},
		// host url to copy cookies from
		cookie_url: null,
		// whether credentials need to be sent. this is mainly added for rules to specify that credentials are not needed (e.g. when using cdns)
		need_credentials: true,
		// overrides the content type for websites that send the wrong one
		content_type: null,
		// maximum amount of chunks for downloading, 0 means unlimited
		max_chunks: 0,
		referer_ok: {
			same_domain: false,
			same_domain_nosub: false
		},
		extra: {
			page: null,
			caption: null,
			created_date: null,
			updated_date: null,
			author_username: null,
			id: null
		},
		filename: "",
		problems: {
			watermark: false,
			smaller: false,
			possibly_different: false,
			possibly_broken: false,
			possibly_upscaled: false,
			bruteforce: false
		}
	};
	function is_element(x) {
		if (!x || typeof x !== "object" || is_array(x))
			return false;
		if (("namespaceURI" in x) && ("nodeType" in x) && ("nodeName" in x) && ("childNodes" in x)) {
			return true;
		}
		// window
		if (typeof x.HTMLElement === "function" && typeof x.navigator === "object") {
			return true;
		}
		// very slow
		if (is_interactive) {
			var objects = [Node, Element, HTMLDocument, Window];
			for (var _i = 0, objects_1 = objects; _i < objects_1.length; _i++) {
				var obj = objects_1[_i];
				// some websites override Window
				try {
					if (x instanceof obj)
						return true;
				} catch (e) {
					console_error(e);
				}
			}
		}
		return false;
	}
	function is_iterable_object(x) {
		return typeof x === "object" && x !== null && !is_array(x) && !is_element(x);
	}
	var shallowcopy_obj = function(x) {
		var result = {};
		for (var key in x) {
			result[key] = x[key];
		}
		return result;
	};
	if ("assign" in Object) {
		// FIXME: should this be kept? it's faster, but it causes issues with object instances, like dom rects. it works fine with plain objects though
		// it's about as good as JSON.parse(JSON.stringify(x)), but shallow
		shallowcopy_obj = function(x) {
			return Object.assign({}, x);
		};
	}
	var shallowcopy_array = function(x) {
		var result = [];
		for (var i = 0; i < x.length; i++) {
			result.push(x[i]);
		}
		return result;
	};
	function shallowcopy(x) {
		if (is_iterable_object(x)) {
			if (is_array(x)) {
				return shallowcopy_array(x);
			} else if (typeof x === "object") {
				return shallowcopy_obj(x);
			}
		}
		return x;
	}
	function deepcopy(x, options) {
		if (!options)
			options = {};
		if (!options["history"])
			options["history"] = [];
		var result;
		if (typeof x === "string" || x === null || typeof x === "undefined") {
			return x;
		} else if (is_element(x) || x instanceof RegExp) {
			if (options["json"]) {
				return void 0;
			} else {
				return x;
			}
		} else if (typeof x === "function") {
			if (options["json"]) {
				return void 0;
			} else {
				return x;
			}
		} else if (typeof x === "object") {
			if (array_indexof(options["history"], x) >= 0)
				return;
			else
				options["history"].push(x);
			if (is_array(x)) {
				result = [];
				for (var i = 0; i < x.length; i++) {
					var item = x[i];
					result.push(deepcopy(item, options));
				}
			} else {
				result = {};
				for (var key in x) {
					try {
						result[key] = deepcopy(x[key], options);
					} catch (e) {
						if (options["json"])
							result[key] = void 0;
						else
							result[key] = x[key];
					}
				}
			}
			return result;
		} else {
			return x;
		}
	}
	var serialize_event = function(event) {
		return deepcopy(event, { json: true });
	};
	var get_nonsensitive_settings = function() {
		var new_settings = JSON_parse(JSON_stringify(settings));
		for (var i = 0; i < sensitive_settings.length; i++) {
			delete new_settings[sensitive_settings[i]];
		}
		return new_settings;
	};
	// Note: None of this information is automatically sent anywhere, it's only displayed to the user when something crashes.
	var get_crashlog_info = function() {
		var ua = "";
		try {
			ua = window.navigator.userAgent;
		} catch (e) { }
		var imu_version = "(!!!UNKNOWN, PLEASE FILL IN!!!)\n";
		try {
			imu_version = gm_info.script.version;
		} catch (e) { }
		var our_settings_text = "(unable to find)";
		try {
			our_settings_text = JSON_stringify(get_nonsensitive_settings());
		} catch (e) { }
		var keys = [
			"User agent: " + ua,
			"Is userscript: " + is_userscript,
			"Is addon: " + is_extension,
			"Image Max URL version: " + imu_version,
			"Settings: " + our_settings_text
		];
		if (is_userscript) {
			try {
				keys.push("Userscript manager: " + userscript_manager);
				keys.push("Userscript manager version: " + userscript_manager_version);
			} catch (e) { }
		}
		return keys.join("\n");
	};
	function overlay_object(base, obj) {
		if (typeof base === "function" || is_array(base))
			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",
		"es",
		"fr",
		"it",
		"ko",
		"pt-BR",
		"ru",
		"zh-CN"
	];
	var browser_language = "en";
	try {
		browser_language = get_language().toLowerCase();
		if (array_indexof(supported_languages, browser_language) < 0) {
			browser_language = browser_language.replace(/-.*/, "");
			if (array_indexof(supported_languages, browser_language) < 0)
				browser_language = "en";
		}
	} catch (e) {
		console_error(e);
		// just in case
		if (array_indexof(supported_languages, browser_language) < 0)
			browser_language = "en";
	}
	// This section is automatically generated using tools/update_from_po.js.
	// To modify translations, edit the respective .po file under the po subdirectory.
	// Refer to the Translations section in CONTRIBUTING.md for more information.
	var strings = {
		"options_header": {
			"en": "Options",
			"es": "Opciones",
			"it": "Opzioni",
			"ko": "\uC635\uC158",
			"pt-BR": "op\u00E7\u00F5es",
			"ru": "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B",
			"zh-CN": "\u9009\u9879"
		},
		"yes": {
			"en": "Yes",
			"es": "S\u00ED",
			"fr": "Oui",
			"it": "S\u00EC",
			"ko": "\uC608",
			"pt-BR": "sim",
			"ru": "\u0414\u0430",
			"zh-CN": "\u662F"
		},
		"no": {
			"en": "No",
			"es": "No",
			"fr": "Non",
			"it": "No",
			"ko": "\uC544\uB2C8\uC624",
			"pt-BR": "n\u00E3o",
			"ru": "\u041D\u0435\u0442",
			"zh-CN": "\u5426"
		},
		"Import": {
			"it": "Importa",
			"ko": "\uAC00\uC838\uC624\uAE30",
			"pt-BR": "Importar",
			"ru": "\u0418\u043C\u043F\u043E\u0440\u0442",
			"zh-CN": "\u5BFC\u5165"
		},
		"Export": {
			"it": "Esporta",
			"ko": "\uB0B4\uBCF4\uB0B4\uAE30",
			"pt-BR": "Exportar",
			"ru": "\u042D\u043A\u0441\u043F\u043E\u0440\u0442",
			"zh-CN": "\u5BFC\u51FA"
		},
		"Requires:": {
			"it": "Richiede",
			"ko": "\uC694\uAD6C\uC0AC\uD56D:",
			"pt-BR": "Requer:",
			"ru": "\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F:",
			"zh-CN": "\u9700\u8981:"
		},
		"Or:": {
			"pt-BR": "Ou:",
			"ru": "\u0418\u043B\u0438:",
			"zh-CN": "\u6216\u8005:"
		},
		"Redirection": {
			"es": "Redirecci\u00F3n",
			"ko": "\uB9AC\uB514\uB809\uC158",
			"pt-BR": "Redirecionamento",
			"ru": "\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435",
			"zh-CN": "\u91CD\u5B9A\u5411"
		},
		"subcategory_update": {
			"en": "Updates",
			"pt-BR": "atualiza\u00E7\u00E3o",
			"ru": "\u041E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435",
			"zh-CN": "\u66F4\u65B0"
		},
		"subcategory_libraries": {
			"en": "3rd-party libraries",
			"pt-BR": "bibliotecas",
			"ru": "\u0421\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u0435 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0438",
			"zh-CN": "\u7B2C\u4E09\u65B9\u5E93"
		},
		"subcategory_settings": {
			"en": "Settings",
			"es": "Ajustes",
			"pt-BR": "configura\u00E7\u00F5es",
			"ru": "\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438",
			"zh-CN": "\u8BBE\u7F6E"
		},
		"subcategory_ui": {
			"en": "UI",
			"es": "Interfaz",
			"pt-BR": "interface do usu\u00E1rio",
			"ru": "\u0418\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441",
			"zh-CN": "\u754C\u9762"
		},
		"subcategory_trigger": {
			"en": "Trigger",
			"es": "Acciones del popup",
			"fr": "D\u00E9clencheur",
			"ko": "\uD2B8\uB9AC\uAC70",
			"pt-BR": "gatilho",
			"ru": "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u89E6\u53D1\u5668"
		},
		"subcategory_popup_source": {
			"en": "Source",
			"pt-BR": "popup de origem",
			"ru": "\u0418\u0441\u0442\u043E\u0447\u043D\u0438\u043A \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u5F39\u7A97\u6E90\u5934"
		},
		"subcategory_open_behavior": {
			"en": "Open Behavior",
			"es": "Comportamiento al Abrir",
			"ko": "\uC5F4\uAE30 \uB3D9\uC791",
			"pt-BR": "comportamento de abertura",
			"ru": "\u041F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438",
			"zh-CN": "\u6253\u5F00\u65B9\u5F0F"
		},
		"subcategory_close_behavior": {
			"en": "Close Behavior",
			"es": "Comportamiento al Cerrar",
			"ko": "\uB2EB\uAE30 \uB3D9\uC791",
			"pt-BR": "comportamento de fechamento",
			"ru": "\u041F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u043F\u0440\u0438 \u0437\u0430\u043A\u0440\u044B\u0442\u0438\u0438",
			"zh-CN": "\u5173\u95ED\u65B9\u5F0F"
		},
		"subcategory_behavior": {
			"en": "Popup Behavior",
			"es": "Comportamiento del Popup",
			"pt-BR": "comportamento",
			"ru": "\u041F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u884C\u4E3A"
		},
		"subcategory_video": {
			"en": "Video/Audio",
			"ko": "\uC601\uC0C1/\uC624\uB514\uC624",
			"pt-BR": "v\u00EDdeo",
			"ru": "\u0412\u0438\u0434\u0435\u043E/\u0410\u0443\u0434\u0438\u043E",
			"zh-CN": "\u89C6\u9891/\u97F3\u9891"
		},
		"subcategory_gallery": {
			"en": "Gallery",
			"es": "Galeria",
			"pt-BR": "galeria",
			"ru": "\u0413\u0430\u043B\u0435\u0440\u0435\u044F",
			"zh-CN": "\u56FE\u5E93"
		},
		"subcategory_popup_other": {
			"en": "Other",
			"es": "Otro",
			"fr": "Autre",
			"pt-BR": "outros popups",
			"ru": "\u041F\u0440\u043E\u0447\u0435\u0435",
			"zh-CN": "\u5176\u4ED6"
		},
		"subcategory_cache": {
			"en": "Cache",
			"pt-BR": "cache",
			"ru": "\u041A\u044D\u0448",
			"zh-CN": "\u7F13\u5B58"
		},
		"Shortcuts": {
			"pt-BR": "Atalhos",
			"ru": "\u0413\u043E\u0440\u044F\u0447\u0438\u0435 \u043A\u043B\u0430\u0432\u0438\u0448\u0438",
			"zh-CN": "\u5FEB\u6377\u952E"
		},
		"subcategory_keybinds_popup_actions": {
			"en": "Popup actions",
			"pt-BR": "a\u00E7\u00F5es do pop-up de atalhos",
			"ru": "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u64CD\u4F5C\u5F39\u7A97"
		},
		"Mouse cursor": {
			"it": "Sposta cursore",
			"ko": "\uB9C8\uC6B0\uC2A4 \uCEE4\uC11C",
			"pt-BR": "Cursor do mouse",
			"ru": "\u041A\u0443\u0440\u0441\u043E\u0440 \u043C\u044B\u0448\u0438",
			"zh-CN": "\u9F20\u6807\u5149\u6807"
		},
		"Rules": {
			"fr": "R\u00E8gles",
			"ko": "\uADDC\uCE59",
			"pt-BR": "Regras",
			"ru": "\u041F\u0440\u0430\u0432\u0438\u043B\u0430",
			"zh-CN": "\u89C4\u5219"
		},
		"subcategory_rule_specific": {
			"en": "Rule-specific",
			"pt-BR": "espec\u00EDfico da regra",
			"ru": "\u0421\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430 \u043F\u0440\u0430\u0432\u0438\u043B",
			"zh-CN": "\u4E13\u7528\u89C4\u5219"
		},
		"Website": {
			"fr": "Site",
			"ko": "\uC6F9\uC0AC\uC774\uD2B8",
			"pt-BR": "Site",
			"ru": "\u0421\u0430\u0439\u0442",
			"zh-CN": "\u7F51\u7AD9"
		},
		"Saved! Refresh the target page for changes to take effect": {
			"fr": "Enregistr\u00E9! Actualiser la page que vous visitez pour que les changements prennent effet",
			"ko": "\uC800\uC7A5\uB429\uB2C8\uB2E4. \uBC88\uACBD\uC0AC\uD56D \uC801\uC6A9\uD558\uB824\uBA74 \uB300\uC0C1 \uC6F9\uD398\uC774\uC9C0 \uB2E4\uC2DC \uB85C\uB4DC\uD558\uC2ED\uC2DC\uC624",
			"pt-BR": "Salvo! Atualize a p\u00E1gina de destino para que as altera\u00E7\u00F5es tenham efeito",
			"ru": "\u0421\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u043E! \u041E\u0431\u043D\u043E\u0432\u0438\u0442\u0435 \u0446\u0435\u043B\u0435\u0432\u0443\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F.",
			"zh-CN": "\u5DF2\u4FDD\u5B58\uFF0C\u5237\u65B0\u76EE\u6807\u9875\u9762\u4F7F\u66F4\u6539\u751F\u6548"
		},
		"Saved!": {
			"fr": "Enregistr\u00E9!",
			"ko": "\uC800\uC7A5\uB429\uB2C8\uB2E4",
			"pt-BR": "Salvo!",
			"ru": "\u0421\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u043E!",
			"zh-CN": "\u5DF2\u4FDD\u5B58"
		},
		"save": {
			"en": "Save",
			"fr": "Enregistrer",
			"ko": "\uC800\uC7A5",
			"pt-BR": "salvar",
			"ru": "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C",
			"zh-CN": "\u4FDD\u5B58"
		},
		"Record": {
			"pt-BR": "Gravar",
			"ru": "\u041F\u0435\u0440\u0435\u043D\u0430\u0437\u043D\u0430\u0447\u0438\u0442\u044C",
			"zh-CN": "\u5F55\u5236"
		},
		"Cancel": {
			"fr": "Annuler",
			"ko": "\uCDE8\uC18C",
			"pt-BR": "Cancelar",
			"ru": "\u041E\u0442\u043C\u0435\u043D\u0430",
			"zh-CN": "\u53D6\u6D88"
		},
		"Mouseover popup (%%1) is needed to display the original version": {
			"fr": "Popup (%%1) est n\u00E9cessaire pour trouver la version originale",
			"it": "Il popup del mouse (%%1) serve a mostrare la versione originale",
			"ko": "\uC6D0\uBCF8 \uC774\uBBF8\uC9C0 \uBCF4\uB824\uBA74 \uD31D\uC5C5 (%%1) \uD544\uC694\uD569\uB2C8\uB2E4",
			"pt-BR": "O popup ao passar o mouse (%%1) \u00E9 necess\u00E1rio para exibir a vers\u00E3o original",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u0440\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0438 \u043C\u044B\u0448\u0438 (%%1) \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0434\u043B\u044F \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u043E\u0439 \u0432\u0435\u0440\u0441\u0438\u0438",
			"zh-CN": "\u9700\u8981\u9F20\u6807\u60AC\u505C\u5F39\u7A97\uFF08%%1\uFF09\u6765\u663E\u793A\u539F\u59CB\u7248\u672C"
		},
		"custom headers": {
			"fr": "en-t\u00EAtes sp\u00E9ciales",
			"ko": "\uD2B9\uC815 \uD5E4\uB354",
			"pt-BR": "cabe\u00E7alhos personalizados",
			"ru": "\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0435 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438",
			"zh-CN": "\u81EA\u5B9A\u4E49\u6807\u9898"
		},
		"forces download": {
			"en": "forces download",
			"pt-BR": "for\u00E7ar download",
			"ru": "\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u043F\u0440\u0438\u043D\u0443\u0434\u0438\u0442\u0435\u043B\u044C\u043D\u043E",
			"zh-CN": "\u5F3A\u5236\u4E0B\u8F7D"
		},
		"Close": {
			"fr": "Fermer",
			"it": "Chiudi",
			"ko": "\uB2EB\uAE30",
			"pt-BR": "Fechar",
			"ru": "\u0417\u0430\u043A\u0440\u044B\u0442\u044C",
			"zh-CN": "\u5173\u95ED"
		},
		"Previous": {
			"fr": "Image pr\u00E9c\u00E9dente",
			"it": "Precedente",
			"ko": "\uC774\uC804",
			"pt-BR": "Anterior",
			"ru": "\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0435",
			"zh-CN": "\u4E0A\u4E00\u4E2A"
		},
		"Next": {
			"fr": "Image suivante",
			"it": "Prossimo",
			"ko": "\uB2E4\uC74C",
			"pt-BR": "Pr\u00F3ximo",
			"ru": "\u0421\u043B\u0435\u0434\u0443\u0435\u0449\u0435\u0435",
			"zh-CN": "\u4E0B\u4E00\u4E2A"
		},
		"Left Arrow": {
			"fr": "Fl\u00E8che gauche",
			"it": "Freccia sinistra",
			"ko": "\uC67C\uCABD \uD654\uC0B4\uD45C",
			"pt-BR": "Seta para Esquerda",
			"ru": "\u0421\u0442\u0440\u0435\u043B\u043A\u0430 \u0432\u043B\u0435\u0432\u043E",
			"zh-CN": "\u5DE6\u7BAD\u5934"
		},
		"Right Arrow": {
			"fr": "Fl\u00E8che droite",
			"it": "Freccia destra",
			"ko": "\uC624\uB978\uCABD \uD654\uC0B4\uD45C",
			"pt-BR": "Seta para Direita",
			"ru": "\u0421\u0442\u0440\u0435\u043B\u043A\u0430 \u0432\u043F\u0440\u0430\u0432\u043E",
			"zh-CN": "\u53F3\u7BAD\u5934"
		},
		"subcategory_extension": {
			"en": "Extension",
			"pt-BR": "extens\u00E3o",
			"ru": "\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435",
			"zh-CN": "\u6269\u5C55"
		},
		"Rotate Left": {
			"pt-BR": "Girar para Esquerda",
			"ru": "\u041F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u043B\u0435\u0432\u043E",
			"zh-CN": "\u5411\u5DE6\u65CB\u8F6C"
		},
		"Rotate Right": {
			"pt-BR": "Girar para Direita",
			"ru": "\u041F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E",
			"zh-CN": "\u5411\u53F3\u65CB\u8F6C"
		},
		"Buttons": {
			"pt-BR": "Bot\u00F5es",
			"ru": "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E",
			"zh-CN": "\u5176\u4ED6"
		},
		"subcategory_replaceimages": {
			"en": "Replace Images",
			"pt-BR": "substituir imagens",
			"ru": "\u0417\u0430\u043C\u0435\u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439",
			"zh-CN": "\u66FF\u6362\u56FE\u50CF"
		},
		"subcategory_highlightimages": {
			"en": "Highlight Images",
			"pt-BR": "real\u00E7ar imagens",
			"ru": "\u0412\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439",
			"zh-CN": "\u9AD8\u4EAE\u56FE\u50CF"
		},
		"subcategory_customgallery": {
			"en": "Custom Gallery",
			"pt-BR": "galeria personalizada"
		},
		"General": {
			"es": "General",
			"ko": "\uC77C\uBC18",
			"pt-BR": "Geral",
			"ru": "\u041E\u0431\u0449\u0438\u0435",
			"zh-CN": "\u901A\u7528"
		},
		"Enable extension": {
			"it": "Abilita estensione",
			"pt-BR": "Ativar extens\u00E3o",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435",
			"zh-CN": "\u542F\u7528\u6269\u5C55"
		},
		"Globally enables or disables the extension": {
			"it": "Abilita o disabilita globalmente l'estensione",
			"pt-BR": "Ativa ou desativa a extens\u00E3o globalmente",
			"ru": "\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435 \u0433\u043B\u043E\u0431\u0430\u043B\u044C\u043D\u043E",
			"zh-CN": "\u5168\u5C40\u542F\u7528\u6216\u7981\u7528\u6269\u5C55"
		},
		"Language": {
			"es": "Lenguaje",
			"it": "Lingua",
			"ko": "\uC5B8\uC5B4",
			"pt-BR": "Idioma",
			"ru": "\u042F\u0437\u044B\u043A",
			"zh-CN": "\u8BED\u8A00"
		},
		"Language for this extension": {
			"it": "Lingua per questa estensione",
			"pt-BR": "Idioma para esta extens\u00E3o",
			"ru": "\u042F\u0437\u044B\u043A \u044D\u0442\u043E\u0433\u043E \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F",
			"zh-CN": "\u6B64\u6269\u5C55\u7A0B\u5E8F\u7684\u8BED\u8A00"
		},
		"English": {
			"pt-BR": "Ingl\u00EAs",
			"ru": "\u0410\u043D\u0433\u043B\u0438\u0439\u0441\u043A\u0438\u0439",
			"zh-CN": "\u82F1\u8BED"
		},
		"Espa\u00F1ol": {
			"pt-BR": "Espanhol",
			"ru": "\u0418\u0441\u043F\u0430\u043D\u0441\u043A\u0438\u0439",
			"zh-CN": "\u897F\u73ED\u7259\u8BED"
		},
		"Fran\u00E7ais": {
			"pt-BR": "Franc\u00EAs",
			"ru": "\u0424\u0440\u0430\u043D\u0446\u0443\u0437\u043A\u0438\u0439",
			"zh-CN": "\u6CD5\u8BED"
		},
		"Italiano": {
			"pt-BR": "Italiano",
			"ru": "\u0418\u0442\u0430\u043B\u044C\u044F\u043D\u0441\u043A\u0438\u0439",
			"zh-CN": "\u610F\u5927\u5229\u8BED"
		},
		"\uD55C\uAD6D\uC5B4": {
			"pt-BR": "Coreano",
			"ru": "\u041A\u043E\u0440\u0435\u0439\u0441\u043A\u0438\u0439",
			"zh-CN": "\u97E9\u8BED"
		},
		"\u0420\u0443\u0441\u0441\u043A\u0438\u0439": {
			"pt-BR": "Russo",
			"ru": "\u0420\u0443\u0441\u0441\u043A\u0438\u0439",
			"zh-CN": "\u4FC4\u8BED"
		},
		"\u7B80\u4F53\u4E2D\u6587": {
			"pt-BR": "Chin\u00EAs simplificado"
		},
		"Dark mode": {
			"it": "Modalit\u00E0 scura",
			"ko": "\uB2E4\uD06C \uBAA8\uB4DC",
			"pt-BR": "Modo escuro",
			"ru": "\u0422\u0451\u043C\u043D\u044B\u0439 \u0440\u0435\u0436\u0438\u043C",
			"zh-CN": "\u6DF1\u8272\u6A21\u5F0F"
		},
		"Changes the colors to have light text on a dark background": {
			"it": "Cambia i colori per avere testo chiaro su sfondo scuro",
			"ko": "\uC5B4\uB450\uC6B4 \uBC30\uACBD, \uBC1D\uC740 \uD14D\uC2A4\uD2B8\uAC00 \uD45C\uC2DC\uB418\uB3C4\uB85D \uBCC0\uACBD\uD569\uB2C8\uB2E4.",
			"pt-BR": "Altera as cores para ter texto claro em um fundo escuro",
			"ru": "\u0418\u0437\u043C\u0435\u043D\u044F\u0435\u0442 \u0446\u0432\u0435\u0442\u0430, \u0434\u0435\u043B\u0430\u044F \u0442\u0435\u043A\u0441\u0442 \u043D\u0430 \u0442\u0451\u043C\u043D\u043E\u043C \u0444\u043E\u043D\u0435, \u0441\u0432\u0435\u0442\u043B\u044B\u043C.",
			"zh-CN": "\u5C06\u989C\u8272\u66F4\u6539\u4E3A\u5728\u6DF1\u8272\u80CC\u666F\u4E0A\u663E\u793A\u6D45\u8272\u6587\u672C"
		},
		"Description below options": {
			"it": "Descrizione sotto le opzioni",
			"ko": "\uC635\uC158 \uC544\uB798\uC5D0 \uC124\uBA85 \uD45C\uC2DC",
			"pt-BR": "Descri\u00E7\u00E3o abaixo das op\u00E7\u00F5es",
			"ru": "\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u043F\u043E\u0434 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u043C\u0438",
			"zh-CN": "\u9009\u9879\u4E0B\u65B9\u663E\u793A\u63CF\u8FF0"
		},
		"Shows the description below the options (otherwise the description is only shown when you hover over the option's name)": {
			"it": "Mostra la descrizione sotto le opzioni (alternativamente, la descrizione viene mostrata solo quando il mouse si trova sopra il nome dell'opzione)",
			"ko": "\uC635\uC158 \uC544\uB798\uC5D0 \uC124\uBA85 \uD45C\uC2DC (\uBE44\uD65C\uC131\uD654 \uC2DC, \uC635\uC158 \uC774\uB984 \uC704\uC5D0 \uB9C8\uC6B0\uC2A4\uB97C \uC62C\uB824 \uB193\uC744 \uB54C\uB9CC \uC124\uBA85\uC774 \uD45C\uC2DC\uB428)",
			"pt-BR": "Mostra a descri\u00E7\u00E3o abaixo das op\u00E7\u00F5es (caso contr\u00E1rio, a descri\u00E7\u00E3o s\u00F3 \u00E9 exibida ao passar o mouse sobre o nome da op\u00E7\u00E3o)",
			"ru": "\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0435\u0442 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u043F\u043E\u0434 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u043C\u0438 (\u0432 \u043F\u0440\u043E\u0442\u0438\u0432\u043D\u043E\u043C \u0441\u043B\u0443\u0447\u0430\u0435 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u0440\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0438 \u043A\u0443\u0440\u0441\u043E\u0440\u0430 \u043C\u044B\u0448\u0438 \u043D\u0430 \u0438\u043C\u044F \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430)",
			"zh-CN": "\u9009\u9879\u4E0B\u65B9\u663E\u793A\u63CF\u8FF0\uFF08\u7981\u7528\u5219\u4EC5\u5F53\u9F20\u6807\u60AC\u505C\u5728\u9009\u9879\u7684\u540D\u79F0\u4E0A\u65F6\u663E\u793A\u8BF4\u660E\uFF09"
		},
		"Show disabled options": {
			"it": "Mostra opzioni inattive",
			"ko": "\uBE44\uD65C\uC131\uD654\uB41C \uC124\uC815 \uD45C\uC2DC",
			"pt-BR": "Exibir op\u00E7\u00F5es desativadas",
			"ru": "\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u044B\u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B",
			"zh-CN": "\u663E\u793A\u505C\u7528\u7684\u9009\u9879"
		},
		"If disabled, options that are disabled due to their requirements being unmet will not be displayed": {
			"it": "Se inattivo, le opzioni che sono inattive a causa dei loro requisiti necessari non raggiunti non verranno mostrate",
			"pt-BR": "Se desativado, as op\u00E7\u00F5es desativadas devido a seus requisitos n\u00E3o serem atendidos n\u00E3o ser\u00E3o exibidas",
			"ru": "\u0415\u0441\u043B\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043E, \u0442\u043E \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u044B \u0438\u0437-\u0437\u0430 \u043D\u0435\u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F \u0442\u0440\u0435\u0431\u043E\u0432\u0430\u043D\u0438\u0439 \u0431\u0443\u0434\u0443\u0442 \u0441\u043A\u0440\u044B\u0442\u044B",
			"zh-CN": "\u7981\u7528\u540E\u5C06\u4E0D\u663E\u793A\u56E0\u672A\u6EE1\u8DB3\u8981\u6C42\u800C\u88AB\u505C\u7528\u7684\u9009\u9879"
		},
		"Show disabled trigger profiles": {
			"pt-BR": "Exibir perfis de gatilho desativados",
			"ru": "\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u044B\u0435 \u0446\u0435\u043B\u0435\u0432\u044B\u0435 \u043F\u0440\u043E\u0444\u0438\u043B\u0438",
			"zh-CN": "\u663E\u793A\u505C\u7528\u7684\u89E6\u53D1\u5668\u914D\u7F6E"
		},
		"If disabled, options for alternate trigger profiles (options with `(#2)` after them) will not be shown if the relevant trigger isn't active": {
			"pt-BR": "Se desativado, as op\u00E7\u00F5es para perfis de gatilho alternativos (op\u00E7\u00F5es com `(#2)` ap\u00F3s elas) n\u00E3o ser\u00E3o exibidas se o gatilho relevante n\u00E3o estiver ativo",
			"ru": "\u0415\u0441\u043B\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043E, \u0442\u043E \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0430\u043B\u044C\u0442\u0435\u0440\u043D\u0430\u0442\u0438\u0432\u043D\u044B\u0445 \u0446\u0435\u043B\u0435\u0432\u044B\u0445 \u043F\u0440\u043E\u0444\u0438\u043B\u0435\u0439 (\u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0441 `(#2)` \u043F\u043E\u0441\u043B\u0435 \u043D\u0438\u0445) \u0431\u0443\u0434\u0443\u0442 \u0441\u043A\u0440\u044B\u0442\u044B, \u0435\u0441\u043B\u0438 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044E\u0449\u0430\u044F \u0446\u0435\u043B\u044C \u043D\u0435 \u0430\u043A\u0442\u0438\u0432\u043D\u0430",
			"zh-CN": "\u5982\u679C\u7981\u7528\uFF0C\u5C06\u4E0D\u663E\u793A\u76F8\u5173\u89E6\u53D1\u5668\u672A\u88AB\u6FC0\u6D3B\u7684\u5907\u7528\u89E6\u53D1\u5668\u7684\u914D\u7F6E\u9009\u9879\uFF08\u5E26\u6709 `(#2)` )"
		},
		"Requirements below disabled options": {
			"ko": "\uBE44\uD65C\uC131\uD654\uB41C \uC635\uC158 \uC544\uB798\uC758 \uC694\uAD6C \uC0AC\uD56D",
			"pt-BR": "Requisitos abaixo das op\u00E7\u00F5es desativadas",
			"ru": "\u0422\u0440\u0435\u0431\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u0434 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u044B\u043C\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u043C\u0438",
			"zh-CN": "\u505C\u7528\u9009\u9879\u4E0B\u65B9\u663E\u793A\u9700\u6C42"
		},
		"If an option is disabled, the requirements to enable the option will be displayed below it": {
			"ko": "\uC635\uC158\uC774 \uBE44\uD65C\uC131\uD654\uB418\uBA74 \uC635\uC158\uC744 \uD65C\uC131\uD654\uD558\uAE30 \uC704\uD55C \uC694\uAD6C \uC0AC\uD56D\uC774 \uC544\uB798\uC5D0 \uD45C\uC2DC\uB428",
			"pt-BR": "Se uma op\u00E7\u00E3o estiver desativada, os requisitos para ativ\u00E1-la ser\u00E3o exibidos abaixo dela",
			"ru": "\u0415\u0441\u043B\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043E, \u0442\u043E \u043F\u043E\u0434 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u043C\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u043C\u0438 \u0431\u0443\u0434\u0443\u0442 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0442\u044C\u0441\u044F \u0442\u0440\u0435\u0431\u043E\u0432\u0430\u043D\u0438\u044F \u0434\u043B\u044F \u0438\u0445 \u0432\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F",
			"zh-CN": "\u5728\u5DF2\u505C\u7528\u9009\u9879\u7684\u4E0B\u65B9\u663E\u793A\u542F\u7528\u8981\u6C42"
		},
		"Check for updates": {
			"ko": "\uC5C5\uB370\uC774\uD2B8 \uD655\uC778",
			"pt-BR": "Verificar atualiza\u00E7\u00F5es",
			"ru": "\u041F\u0440\u043E\u0432\u0435\u0440\u044F\u0442\u044C \u043D\u0430\u043B\u0438\u0447\u0438\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0439",
			"zh-CN": "\u68C0\u67E5\u66F4\u65B0"
		},
		"Periodically checks for updates. If a new update is available, it will be shown at the top of the options page": {
			"pt-BR": "Verifica periodicamente se h\u00E1 atualiza\u00E7\u00F5es. Se uma nova atualiza\u00E7\u00E3o estiver dispon\u00EDvel, ela ser\u00E1 exibida na parte superior da p\u00E1gina de op\u00E7\u00F5es",
			"ru": "\u041F\u0435\u0440\u0438\u043E\u0434\u0438\u0447\u0435\u0441\u043A\u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u044F\u0435\u0442 \u043D\u0430\u043B\u0438\u0447\u0438\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0439. \u041D\u043E\u0432\u043E\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043F\u043E\u043A\u0430\u0437\u0430\u043D\u043E \u0432 \u0432\u0435\u0440\u0445\u043D\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432.",
			"zh-CN": "\u5B9A\u671F\u68C0\u67E5\u66F4\u65B0\u3002\u6709\u53EF\u7528\u7684\u66F4\u65B0\u65F6\u5C06\u5728\u9009\u9879\u9875\u9762\u7684\u9876\u90E8\u663E\u793A"
		},
		"Update check interval": {
			"ko": "\uC5C5\uB370\uC774\uD2B8 \uD655\uC778 \uAC04\uACA9",
			"pt-BR": "Intervalo de verifica\u00E7\u00E3o de atualiza\u00E7\u00F5es",
			"ru": "\u0418\u043D\u0442\u0435\u0440\u0432\u0430\u043B \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F",
			"zh-CN": "\u66F4\u65B0\u68C0\u67E5\u95F4\u9694"
		},
		"How often to check for updates": {
			"ko": "\uC5C5\uB370\uC774\uD2B8 \uD655\uC778 \uBE48\uB3C4",
			"pt-BR": "Com que frequ\u00EAncia verificar se h\u00E1 atualiza\u00E7\u00F5es",
			"ru": "\u041A\u0430\u043A \u0447\u0430\u0441\u0442\u043E \u0431\u0443\u0434\u0435\u0442 \u043F\u0440\u043E\u0438\u0441\u0445\u043E\u0434\u0438\u0442\u044C \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0430 \u043D\u0430\u043B\u0438\u0447\u0438\u044F \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0439",
			"zh-CN": "\u591A\u4E45\u68C0\u67E5\u4E00\u6B21\u66F4\u65B0"
		},
		"hours": {
			"ko": "\uC2DC\uAC04",
			"pt-BR": "horas",
			"ru": "\u0447.",
			"zh-CN": "\u5C0F\u65F6"
		},
		"Notify when update is available": {
			"ko": "\uC5C5\uB370\uC774\uD2B8\uAC00 \uC788\uC744 \uB54C \uC54C\uB9BC",
			"pt-BR": "Notificar quando houver atualiza\u00E7\u00E3o",
			"ru": "\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u044F\u0442\u044C \u043E \u043F\u043E\u044F\u0432\u043B\u0435\u043D\u0438\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F",
			"zh-CN": "\u6709\u53EF\u7528\u66F4\u65B0\u65F6\u901A\u77E5"
		},
		"Creates a browser notification when an update is available": {
			"ko": "\uC5C5\uB370\uC774\uD2B8\uAC00 \uC788\uC744 \uB54C \uBE0C\uB77C\uC6B0\uC800 \uC54C\uB9BC\uC744 \uBC1B\uC2B5\uB2C8\uB2E4.",
			"pt-BR": "Cria uma notifica\u00E7\u00E3o do navegador quando uma atualiza\u00E7\u00E3o est\u00E1 dispon\u00EDvel",
			"ru": "\u0421\u043E\u0437\u0434\u0430\u0451\u0442 \u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0435 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u043A\u043E\u0433\u0434\u0430 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E.",
			"zh-CN": "\u6709\u53EF\u7528\u66F4\u65B0\u65F6\u5F39\u51FA\u6D4F\u89C8\u5668\u901A\u77E5"
		},
		"Show advanced settings": {
			"ko": "\uACE0\uAE09 \uC124\uC815 \uD45C\uC2DC",
			"pt-BR": "Exibir configura\u00E7\u00F5es avan\u00E7adas",
			"ru": "\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u044B\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438",
			"zh-CN": "\u663E\u793A\u9AD8\u7EA7\u8BBE\u7F6E"
		},
		"If disabled, settings that might be harder to understand will be hidden": {
			"ko": "\uBE44\uD65C\uC131\uD654 \uC2DC, \uC774\uD574\uD558\uAE30 \uC5B4\uB824\uC6B8 \uC218 \uC788\uB294 \uC124\uC815\uC774 \uC228\uACA8\uC9D0",
			"pt-BR": "Se desativado, as configura\u00E7\u00F5es que podem ser mais dif\u00EDceis de entender ser\u00E3o ocultadas",
			"ru": "\u0415\u0441\u043B\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043E, \u0442\u043E \u0431\u043E\u043B\u0435\u0435 \u0441\u043B\u043E\u0436\u043D\u044B\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438, \u0431\u0443\u0434\u0443\u0442 \u0441\u043A\u0440\u044B\u0442\u044B",
			"zh-CN": "\u7981\u7528\u540E\u5C06\u9690\u85CF\u6BD4\u8F83\u96BE\u4EE5\u7406\u89E3\u7684\u8BBE\u7F6E"
		},
		"Use tabs": {
			"ko": "\uD0ED \uC0AC\uC6A9",
			"pt-BR": "Usar abas",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432\u043A\u043B\u0430\u0434\u043A\u0438",
			"zh-CN": "\u6807\u7B7E\u5F0F\u8BBE\u7F6E"
		},
		"If disabled, all settings will be shown on a single page": {
			"ko": "\uBE44\uD65C\uC131\uD654 \uC2DC, \uBAA8\uB4E0 \uC124\uC815\uC774 \uD55C \uD398\uC774\uC9C0\uC5D0 \uD45C\uC2DC\uB429\uB2C8\uB2E4.",
			"pt-BR": "Se desativado, todas as configura\u00E7\u00F5es ser\u00E3o mostradas em uma \u00FAnica p\u00E1gina",
			"ru": "\u0415\u0441\u043B\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043E, \u0442\u043E \u0432\u0441\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0431\u0443\u0434\u0443\u0442 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0442\u044C\u0441\u044F \u043D\u0430 \u043E\u0434\u043D\u043E\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435",
			"zh-CN": "\u5982\u679C\u7981\u7528\uFF0C\u5C06\u5728\u540C\u4E00\u9875\u4E0A\u663E\u793A\u5168\u90E8\u8BBE\u7F6E"
		},
		"Alphabetical order": {
			"pt-BR": "Ordem alfab\u00E9tica",
			"ru": "\u0412 \u0430\u043B\u0444\u0430\u0432\u0438\u0442\u043D\u043E\u043C \u043F\u043E\u0440\u044F\u0434\u043A\u0435",
			"zh-CN": "\u6309\u5B57\u6BCD\u987A\u5E8F"
		},
		"Lists options in alphabetical order": {
			"pt-BR": "Lista as op\u00E7\u00F5es em ordem alfab\u00E9tica",
			"ru": "\u0421\u043F\u0438\u0441\u043E\u043A \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432 \u0431\u0443\u0434\u0435\u0442 \u043E\u0442\u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u043D \u0432 \u0430\u043B\u0444\u0430\u0432\u0438\u0442\u043D\u043E\u043C \u043F\u043E\u0440\u044F\u0434\u043A\u0435",
			"zh-CN": "\u4EE5\u5B57\u6BCD\u987A\u5E8F\u6392\u5217\u9009\u9879"
		},
		"Allow using browser XHR": {
			"pt-BR": "Permitir o uso do XHR do navegador",
			"ru": "\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C XHR",
			"zh-CN": "\u5141\u8BB8\u4F7F\u7528\u6D4F\u89C8\u5668 XHR"
		},
		"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)": {
			"pt-BR": "Isso permite que as solicita\u00E7\u00F5es XHR sejam executadas no contexto do navegador se falharem na extens\u00E3o (por exemplo, quando a Prote\u00E7\u00E3o contra Rastreamento est\u00E1 definida como Alta)",
			"ru": "\u042D\u0442\u043E \u043F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u0442\u044C \u0437\u0430\u043F\u0440\u043E\u0441\u044B XHR \u0432 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u0435\u0441\u043B\u0438 \u043E\u043D\u0438 \u043D\u0435 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0442 \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0438 (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u043A\u043E\u0433\u0434\u0430 \u0437\u0430\u0449\u0438\u0442\u0430 \u043E\u0442\u0441\u043B\u0435\u0436\u0438\u0432\u0430\u043D\u0438\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0430 \u043D\u0430 \u0412\u044B\u0441\u043E\u043A\u0438\u0439 \u0443\u0440\u043E\u0432\u0435\u043D\u044C)",
			"zh-CN": "\u5141\u8BB8\u6269\u5C55\u4E2D\u8FD0\u884C XHR \u8BF7\u6C42\u5931\u8D25\u65F6\u5728\u6D4F\u89C8\u5668\u4E0A\u4E0B\u6587\u4E2D\u8FD0\u884C XHR\u3002\u539F\u56E0\u4F8B\u5982\u201C\u8DDF\u8E2A\u4FDD\u62A4\u201D\u88AB\u8BBE\u5B9A\u4E3A\u9AD8\u3002"
		},
		"Retry requests with 503 errors": {
			"pt-BR": "Repetir solicita\u00E7\u00F5es com erros 503",
			"ru": "\u041F\u043E\u0432\u0442\u043E\u0440\u044F\u0442\u044C \u0437\u0430\u043F\u0440\u043E\u0441 \u0441 \u043E\u0448\u0438\u0431\u043A\u043E\u0439 503",
			"zh-CN": "\u91CD\u8BD5\u8FD4\u56DE 503 \u9519\u8BEF\u7684\u8BF7\u6C42"
		},
		"Amount of times to retry a request when 503 (service unavailable) is returned by the server": {
			"pt-BR": "N\u00FAmero de vezes para repetir uma solicita\u00E7\u00E3o quando 503 (servi\u00E7o indispon\u00EDvel) \u00E9 retornado pelo servidor",
			"ru": "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u044B\u0445 \u043F\u043E\u043F\u044B\u0442\u043E\u043A \u0437\u0430\u043F\u0440\u043E\u0441\u0430, \u043A\u043E\u0433\u0434\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 503 (\u0441\u043B\u0443\u0436\u0431\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430)",
			"zh-CN": "\u670D\u52A1\u5668\u8FD4\u56DE 503 \u9519\u8BEF\uFF08\u670D\u52A1\u4E0D\u53EF\u7528\uFF09\u65F6\uFF0C\u91CD\u8BD5\u8BF7\u6C42\u6B21\u6570"
		},
		"times": {
			"pt-BR": "vezes",
			"ru": "\u0440\u0430\u0437(\u0430)",
			"zh-CN": "\u6B21"
		},
		"Delay between 503 retries": {
			"pt-BR": "Atraso entre novas tentativas 503",
			"ru": "\u0417\u0430\u0434\u0435\u0440\u0436\u043A\u0430 \u043C\u0435\u0436\u0434\u0443 \u043F\u043E\u0432\u0442\u043E\u0440\u0430\u043C\u0438 503",
			"zh-CN": "503 \u91CD\u8BD5\u4E4B\u95F4\u5EF6\u8FDF"
		},
		"Time (in milliseconds) to delay between retrying requests that received 503": {
			"pt-BR": "Tempo (em milissegundos) de atraso entre novas tentativas de solicita\u00E7\u00F5es que receberam 503",
			"ru": "\u0412\u0440\u0435\u043C\u044F (\u0432 \u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430\u0445) \u0434\u043B\u044F \u0437\u0430\u0434\u0435\u0440\u0436\u043A\u0438 \u043C\u0435\u0436\u0434\u0443 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E\u0439 \u043F\u043E\u043F\u044B\u0442\u043A\u043E\u0439 \u0437\u0430\u043F\u0440\u043E\u0441\u043E\u0432 \u043F\u0440\u0438 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0438 503",
			"zh-CN": "\u6536\u5230 503 \u9519\u8BEF\u540E\u91CD\u8BD5\u8BF7\u6C42\u4E4B\u95F4\u5EF6\u8FDF\u591A\u4E45\uFF08\u6BEB\u79D2\uFF09"
		},
		"Use `Blob` over `ArrayBuffer`": {
			"pt-BR": "Usar `Blob` em vez de `ArrayBuffer`",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C `Blob` \u043F\u043E\u0432\u0435\u0440\u0445 `ArrayBuffer`",
			"zh-CN": "\u4F7F\u7528 Blob \u4EE3\u66FF ArrayBuffer"
		},
		"Uses `Blob`s for XHRs instead of `ArrayBuffer`s. Keep this enabled unless your userscript manager doesn't support blob requests": {
			"pt-BR": "Usa `Blob`s para XHRs em vez de `ArrayBuffer`s. Mantenha isso ativado, a menos que seu gerenciador de userscript n\u00E3o suporte solicita\u00E7\u00F5es blob",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 `Blob`\u044B \u0434\u043B\u044F XHR, \u0432\u043C\u0435\u0441\u0442\u043E `ArrayBuffer`\u043E\u0432. \u041D\u0435 \u043E\u0442\u043A\u043B\u044E\u0447\u0430\u0439\u0442\u0435, \u0435\u0441\u043B\u0438 \u0432\u0430\u0448 \u043C\u0435\u043D\u0435\u0434\u0436\u0435\u0440 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0445 \u0441\u043A\u0440\u0438\u043F\u0442\u043E\u0432 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u043F\u0440\u043E\u0441\u044B blob.",
			"zh-CN": "XHR \u4E2D\u4F7F\u7528 Blob \u4EE3\u66FF ArrayBuffer\u3002\u9664\u975E\u60A8\u7684\u7528\u6237\u811A\u672C\u7BA1\u7406\u5668\u4E0D\u652F\u6301 Blob \u8BF7\u6C42\uFF0C\u5426\u5219\u4FDD\u6301\u542F\u7528"
		},
		"Live settings reloading": {
			"pt-BR": "Recarregamento de configura\u00E7\u00F5es ao vivo",
			"ru": "\u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A \u0432 \u0440\u0435\u0430\u043B\u044C\u043D\u043E\u043C \u0432\u0440\u0435\u043C\u0435\u043D\u0438",
			"zh-CN": "\u8BBE\u7F6E\u5B9E\u65F6\u751F\u6548"
		},
		"Enables/disables live settings reloading. There shouldn't be a reason to disable this unless you're experiencing issues with this feature": {
			"pt-BR": "Ativa/desativa o recarregamento de configura\u00E7\u00F5es ao vivo. N\u00E3o deve haver motivo para desativar isso, a menos que voc\u00EA esteja tendo problemas com esse recurso",
			"ru": "\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432 \u0432 \u0440\u0435\u0430\u043B\u044C\u043D\u043E\u043C \u0432\u0440\u0435\u043C\u0435\u043D\u0438. \u041D\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043F\u0440\u0438\u0447\u0438\u043D \u0434\u043B\u044F \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F \u044D\u0442\u043E\u0439 \u0444\u0443\u043D\u043A\u0446\u0438\u0438. \u041E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u0435\u0441\u043B\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044C \u0441 \u043D\u0435\u0439 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u044B.",
			"zh-CN": "\u542F\u7528/\u7981\u7528\u8BBE\u7F6E\u5B9E\u65F6\u91CD\u65B0\u52A0\u8F7D\u3002\u9664\u975E\u9047\u5230\u6B64\u529F\u80FD\u76F8\u5173\u7684\u95EE\u9898\uFF0C\u5426\u5219\u5E94\u4FDD\u6301\u6B64\u529F\u80FD\u542F\u7528"
		},
		"Disable keybindings when editing text": {
			"pt-BR": "Desativar atalhos de teclado ao editar texto",
			"ru": "\u041E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0433\u043E\u0440\u044F\u0447\u0438\u0435 \u043A\u043B\u0430\u0432\u0438\u0448\u0438 \u043F\u0440\u0438 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0438 \u0442\u0435\u043A\u0441\u0442\u0430",
			"zh-CN": "\u7F16\u8F91\u6587\u672C\u6846\u65F6\u7981\u7528\u5FEB\u6377\u952E"
		},
		"Disables shortcuts when key events are sent to an input area on the page": {
			"pt-BR": "Desativa os atalhos quando eventos de teclas s\u00E3o enviados para uma \u00E1rea de entrada na p\u00E1gina",
			"ru": "\u041E\u0442\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0433\u043E\u0440\u044F\u0447\u0438\u0435 \u043A\u043B\u0430\u0432\u0438\u0448\u0438 \u043F\u0440\u0438 \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0435 \u0441\u043E\u0431\u044B\u0442\u0438\u0439 \u043A\u043B\u0430\u0432\u0438\u0448 \u0432 \u043E\u0431\u043B\u0430\u0441\u0442\u044C \u0432\u0432\u043E\u0434\u0430 \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435",
			"zh-CN": "\u5C06\u952E\u76D8\u4E8B\u4EF6\u53D1\u9001\u5230\u9875\u9762\u4E0A\u7684\u8F93\u5165\u533A\u57DF\u65F6\uFF0C\u505C\u7528\u5DF2\u8BBE\u7F6E\u7684\u5FEB\u6377\u952E"
		},
		"Use `GM_download` if available": {
			"pt-BR": "Usar `GM_download` se dispon\u00EDvel",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C `GM_download`, \u0435\u0441\u043B\u0438 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E",
			"zh-CN": "\u53EF\u7528\u65F6\u4F7F\u7528 GM_download"
		},
		"Prefers using `GM_download` over simple browser-based downloads, if the function is available. Some userscript managers download the entire file before displaying a save dialog, which can be undesirable for large video files": {
			"pt-BR": "Prefere usar `GM_download` em vez de downloads simples baseados em navegador, se a fun\u00E7\u00E3o estiver dispon\u00EDvel. Alguns gerenciadores de userscript baixam o arquivo inteiro antes de exibir uma caixa de di\u00E1logo de salvamento, o que pode ser indesej\u00E1vel para arquivos de v\u00EDdeo grandes",
			"ru": "\u041F\u0440\u0435\u0434\u043F\u043E\u0447\u0442\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 `GM_download` \u0432\u043C\u0435\u0441\u0442\u043E \u043F\u0440\u043E\u0441\u0442\u044B\u0445 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0439 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u0435\u0441\u043B\u0438 \u044D\u0442\u0430 \u0444\u0443\u043D\u043A\u0446\u0438\u044F \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430. \u041D\u0435\u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u043C\u0435\u043D\u0435\u0434\u0436\u0435\u0440\u044B \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0445 \u0441\u043A\u0440\u0438\u043F\u0442\u043E\u0432 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0435\u0441\u044C \u0444\u0430\u0439\u043B \u043F\u0435\u0440\u0435\u0434 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043C \u0434\u0438\u0430\u043B\u043E\u0433\u0430 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F, \u0447\u0442\u043E \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u043D\u0435\u0436\u0435\u043B\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0434\u043B\u044F \u0431\u043E\u043B\u044C\u0448\u0438\u0445 \u0432\u0438\u0434\u0435\u043E\u0444\u0430\u0439\u043B\u043E\u0432.",
			"zh-CN": "\u4F18\u5148\u4F7F\u7528 GM_download \u4EE3\u66FF\u6D4F\u89C8\u5668\u7684\u4E0B\u8F7D\u529F\u80FD\u3002\u90E8\u5206\u7528\u6237\u811A\u672C\u7BA1\u7406\u5668\u4F1A\u5728\u663E\u793A\u201C\u4FDD\u5B58\u201D\u5BF9\u8BDD\u6846\u524D\u4E0B\u8F7D\u6574\u4E2A\u6587\u4EF6\uFF0C\u8FD9\u4E0D\u5229\u4E8E\u4E0B\u8F7D\u5927\u4F53\u91CF\u7684\u89C6\u9891\u6587\u4EF6"
		},
		"Maximum size to `GM_download`": {
			"pt-BR": "Tamanho m\u00E1ximo para `GM_download`",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0434\u043B\u044F `GM_download`",
			"zh-CN": "GM_download \u5927\u5C0F\u4E0A\u9650"
		},
		"If a file is larger than this size, use a simple browser-based download instead. Set to `0` for unlimited.": {
			"pt-BR": "Se um arquivo for maior que este tamanho, use um download simples baseado em navegador. Defina como `0` para ilimitado.",
			"ru": "\u0415\u0441\u043B\u0438 \u0444\u0430\u0439\u043B \u0431\u043E\u043B\u044C\u0448\u0435 \u044D\u0442\u043E\u0433\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u0430, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F \u043F\u0440\u043E\u0441\u0442\u043E\u0435 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440. `0` - \u043D\u0435\u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u043D\u043E.",
			"zh-CN": "\u6587\u4EF6\u5927\u4E8E\u6B64\u5927\u5C0F\u65F6\u6539\u7528\u57FA\u4E8E\u6D4F\u89C8\u5668\u7684\u4E0B\u8F7D\u529F\u80FD\u3002\u8BBE\u4E3A 0 \u8868\u793A\u65E0\u9650\u5236\u3002"
		},
		"MB": {
			"pt-BR": "MB",
			"ru": "\u041C\u0411",
			"zh-CN": "MB"
		},
		"Force save dialog when downloading": {
			"pt-BR": "For\u00E7ar caixa de di\u00E1logo de salvamento ao baixar",
			"ru": "\u041F\u0440\u0438\u043D\u0443\u0434\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u0434\u0438\u0430\u043B\u043E\u0433\u043E\u0432\u043E\u0435 \u043E\u043A\u043D\u043E \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F \u043F\u0440\u0438 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0438",
			"zh-CN": "\u4E0B\u8F7D\u65F6\u5F3A\u5236\u6253\u5F00\u201C\u4FDD\u5B58\u201D\u5BF9\u8BDD\u6846"
		},
		"Tries to ensure the 'save as' dialog displays when downloading. This requires the 'downloads' permission to work, and will sometimes not work when custom headers are required.": {
			"pt-BR": "Tenta garantir que a caixa de di\u00E1logo 'salvar como' seja exibida ao baixar. Isso requer a permiss\u00E3o de 'downloads' para funcionar e, \u00E0s vezes, n\u00E3o funcionar\u00E1 quando cabe\u00E7alhos personalizados forem necess\u00E1rios.",
			"ru": "\u041F\u043E\u0441\u0442\u043E\u0440\u0430\u0435\u0442\u0441\u044F \u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0438\u0442\u044C \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0434\u0438\u0430\u043B\u043E\u0433\u043E\u0432\u043E\u0433\u043E \u043E\u043A\u043D\u0430 '\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u043A\u0430\u043A' \u043F\u0440\u0438 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0438. \u0414\u043B\u044F \u044D\u0442\u043E\u0433\u043E \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435 \u043D\u0430 '\u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0435', \u0438 \u0438\u043D\u043E\u0433\u0434\u0430 \u043D\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C, \u043A\u043E\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u044E\u0442\u0441\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0435 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438.",
			"zh-CN": "\u5C1D\u8BD5\u786E\u4FDD\u4E0B\u8F7D\u65F6\u6253\u5F00\u201C\u53E6\u5B58\u4E3A\u201D\u5BF9\u8BDD\u6846\u3002\u6B64\u529F\u80FD\u9700\u8981\u201C\u4E0B\u8F7D\u201D\u6743\u9650\uFF0C\u5E76\u4E14\u642D\u914D\u201C\u81EA\u5B9A\u4E49\u5934\u201D\u65F6\u53EF\u80FD\u65E0\u6548\u3002"
		},
		"Enable logging to console": {
			"pt-BR": "Ativar registro no console",
			"ru": "\u0417\u0430\u043F\u0438\u0441\u044C \u0436\u0443\u0440\u043D\u0430\u043B\u0430 \u0432 \u043A\u043E\u043D\u0441\u043E\u043B\u0438",
			"zh-CN": "\u542F\u7528\u63A7\u5236\u53F0\u65E5\u5FD7"
		},
		"Allows the script to log messages to the browser console.": {
			"pt-BR": "Permite que o script registre mensagens no console do navegador.",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0441\u043A\u0440\u0438\u043F\u0442\u0443 \u0437\u0430\u043F\u0438\u0441\u044B\u0432\u0430\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u0432 \u043A\u043E\u043D\u0441\u043E\u043B\u044C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.",
			"zh-CN": "\u5141\u8BB8\u8BB0\u5F55\u65E5\u5FD7\u6D88\u606F\u5230\u6D4F\u89C8\u5668\u7684\u63A7\u5236\u53F0\u3002"
		},
		"Enable writing to clipboard": {
			"pt-BR": "Ativar escrita na \u00E1rea de transfer\u00EAncia",
			"ru": "\u0417\u0430\u043F\u0438\u0441\u044C \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430",
			"zh-CN": "\u542F\u7528\u5199\u5165\u526A\u8D34\u677F"
		},
		"This option does nothing on its own, but enabling it allows other functionality that require writing to the clipboard to work": {
			"pt-BR": "Esta op\u00E7\u00E3o n\u00E3o faz nada por si s\u00F3, mas ativ\u00E1-la permite que outras funcionalidades que exigem escrita na \u00E1rea de transfer\u00EAncia funcionem",
			"ru": "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0441\u0430\u043C \u043F\u043E \u0441\u0435\u0431\u0435 \u043D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u0434\u0435\u043B\u0430\u0435\u0442, \u043D\u043E \u0435\u0433\u043E \u0432\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u043F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C \u0434\u0440\u0443\u0433\u0438\u043C \u0444\u0443\u043D\u043A\u0446\u0438\u044F\u043C, \u0442\u0440\u0435\u0431\u0443\u044E\u0449\u0438\u043C \u0437\u0430\u043F\u0438\u0441\u0438 \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430.",
			"zh-CN": "\u6B64\u9009\u9879\u672C\u8EAB\u65E0\u529F\u80FD\uFF0C\u4F46\u542F\u7528\u5B83\u624D\u80FD\u4F7F\u5176\u4ED6\u9700\u8981\u5199\u5165\u526A\u8D34\u677F\u7684\u529F\u80FD\u8FD0\u4F5C"
		},
		"Enable redirection": {
			"es": "Habilitar redirecci\u00F3n",
			"fr": "Activer la redirection",
			"ko": "\uB9AC\uB514\uB809\uC158 \uC0AC\uC6A9",
			"pt-BR": "Ativar redirecionamento",
			"ru": "\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435",
			"zh-CN": "\u542F\u7528\u91CD\u5B9A\u5411"
		},
		"Automatically redirect media opened in their own tab to their larger/original versions": {
			"pt-BR": "Redirecionar automaticamente m\u00EDdias abertas em sua pr\u00F3pria aba para suas vers\u00F5es maiores/originais",
			"ru": "\u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u0435\u0442 \u043E\u0442\u043A\u0440\u044B\u0442\u043E\u0435 \u043C\u0435\u0434\u0438\u0430 \u043D\u0430 \u043D\u043E\u0432\u0443\u044E \u0432\u043A\u043B\u0430\u0434\u043A\u0443 \u043A \u0438\u0445 \u0431\u043E\u043B\u0435\u0435 \u043A\u0440\u0443\u043F\u043D\u043E\u0439/\u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u043E\u0439 \u0432\u0435\u0440\u0441\u0438\u0438",
			"zh-CN": "\u5728\u6253\u5F00\u7684\u5A92\u4F53\u6587\u4EF6\u6807\u7B7E\u9875\u4E2D\u81EA\u52A8\u91CD\u5B9A\u5411\u5230\u5176\u66F4\u6E05\u6670\u7684\u7248\u672C"
		},
		"Allow video": {
			"pt-BR": "Permitir v\u00EDdeo",
			"ru": "\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u0432\u0438\u0434\u0435\u043E",
			"zh-CN": "\u5141\u8BB8\u89C6\u9891"
		},
		"Allows redirecting from/to video": {
			"pt-BR": "Permite redirecionar de/para v\u00EDdeo",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u0442\u044C \u0441/\u043D\u0430 \u0432\u0438\u0434\u0435\u043E",
			"zh-CN": "\u5141\u8BB8\u89C6\u9891\u88AB\u91CD\u5B9A\u5411"
		},
		"Allow audio": {
			"pt-BR": "Permitir \u00E1udio",
			"ru": "\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u0430\u0443\u0434\u0438\u043E",
			"zh-CN": "\u5141\u8BB8\u97F3\u9891"
		},
		"Allows redirecting from/to audio": {
			"pt-BR": "Permite redirecionar de/para \u00E1udio",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u0442\u044C \u0441/\u043D\u0430 \u0430\u0443\u0434\u0438\u043E",
			"zh-CN": "\u5141\u8BB8\u97F3\u9891\u88AB\u91CD\u5B9A\u5411"
		},
		"Add to history": {
			"es": "Agregar al historial",
			"fr": "Ajouter \u00E0 l'historique",
			"ko": "\uBE0C\uB77C\uC6B0\uC800 \uAE30\uB85D\uC5D0 \uCD94\uAC00",
			"pt-BR": "Adicionar ao hist\u00F3rico",
			"ru": "\u0414\u043E\u0431\u0430\u0432\u043B\u044F\u0442\u044C \u0432 \u0438\u0441\u0442\u043E\u0440\u0438\u044E",
			"zh-CN": "\u6DFB\u52A0\u5230\u5386\u53F2\u8BB0\u5F55"
		},
		"Redirection will add a new entry to the browser's history": {
			"ko": "\uB9AC\uB514\uB809\uC158 \uC2DC, \uBE0C\uB77C\uC6B0\uC800\uC758 \uAE30\uB85D\uC5D0 \uC0C8 \uD56D\uBAA9\uC774 \uCD94\uAC00\uB428",
			"pt-BR": "O redirecionamento adicionar\u00E1 uma nova entrada ao hist\u00F3rico do navegador",
			"ru": "\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u0442\u044C \u043D\u043E\u0432\u0443\u044E \u0437\u0430\u043F\u0438\u0441\u044C \u0432 \u0438\u0441\u0442\u043E\u0440\u0438\u044E \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430",
			"zh-CN": "\u91CD\u5B9A\u5411\u53D1\u751F\u65F6\u5728\u6D4F\u89C8\u5668\u7684\u5386\u53F2\u8BB0\u5F55\u4E2D\u52A0\u5165\u4E00\u6761\u8BB0\u5F55"
		},
		"Do redirection in extension": {
			"pt-BR": "Fazer redirecionamento na extens\u00E3o",
			"ru": "\u0412\u044B\u043F\u043E\u043B\u043D\u044F\u0442\u044C \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0438",
			"zh-CN": "\u5728\u6269\u5C55\u4E2D\u6267\u884C\u91CD\u5B9A\u5411"
		},
		"Performs the redirection in the extension instead of the content script. This is significantly faster and shouldn't cause issues in theory, but this option is kept in case of regressions": {
			"pt-BR": "Realiza o redirecionamento na extens\u00E3o em vez de no script de conte\u00FAdo. Isso \u00E9 significativamente mais r\u00E1pido e n\u00E3o deve causar problemas em teoria, mas esta op\u00E7\u00E3o \u00E9 mantida em caso de regress\u00F5es",
			"ru": "\u0412\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442 \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0432 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0438 \u0432\u043C\u0435\u0441\u0442\u043E \u0441\u043A\u0440\u0438\u043F\u0442\u0430. \u0422\u0435\u043E\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u044D\u0442\u043E \u0437\u043D\u0430\u0447\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u0431\u044B\u0441\u0442\u0440\u0435\u0435 \u0438 \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0432\u044B\u0437\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u043E\u0431\u043B\u0435\u043C, \u043D\u043E \u044D\u0442\u043E\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0441\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F \u0432 \u0441\u043B\u0443\u0447\u0430\u0435 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u0439.",
			"zh-CN": "\u5728\u6269\u5C55\u5185\u800C\u975E\u5185\u5BB9\u811A\u672C\u4E2D\u6267\u884C\u91CD\u5B9A\u5411\u3002\u8FD9\u6837\u5FEB\u5F97\u591A\u5E76\u4E14\u7406\u8BBA\u4E0A\u4E0D\u5E94\u8BE5\u5F15\u8D77\u95EE\u9898\uFF0C\u4F46\u8BE5\u9009\u9879\u88AB\u4FDD\u7559\u4EE5\u9632\u7279\u6B8A\u95EE\u9898"
		},
		"Use GET if HEAD is unsupported": {
			"es": "Utilizar GET si HEAD no es soportado",
			"fr": "Utiliser GET si HEAD n'est pas support\u00E9",
			"ko": "HEAD \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC73C\uBA74 GET \uC0AC\uC6A9",
			"pt-BR": "Usar GET se HEAD n\u00E3o for suportado",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C GET, \u0435\u0441\u043B\u0438 HEAD \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F",
			"zh-CN": "\u4E0D\u652F\u6301 HEAD \u65F6\u6539\u7528 GET"
		},
		"Use a GET request to check an image's availability, if the server does not support HEAD requests": {
			"pt-BR": "Usar uma solicita\u00E7\u00E3o GET para verificar a disponibilidade de uma imagem, se o servidor n\u00E3o suportar solicita\u00E7\u00F5es HEAD",
			"ru": "\u0411\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C\u0441\u044F GET-\u0437\u0430\u043F\u0440\u043E\u0441 \u0434\u043B\u044F \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u043E\u0441\u0442\u0438 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F, \u0435\u0441\u043B\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u043F\u0440\u043E\u0441\u044B HEAD.",
			"zh-CN": "\u670D\u52A1\u5668\u4E0D\u652F\u6301 HEAD \u8BF7\u6C42\u65F6\u6539\u7528\u4E00\u6761 GET \u8BF7\u6C42\u6765\u68C0\u67E5\u4E00\u4E2A\u56FE\u50CF\u7684\u53EF\u7528\u6027"
		},
		"Try finding extra information": {
			"pt-BR": "Tentar encontrar informa\u00E7\u00F5es extras",
			"ru": "\u041F\u044B\u0442\u0430\u0442\u044C\u0441\u044F \u043D\u0430\u0439\u0442\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u0443\u044E \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E",
			"zh-CN": "\u5C1D\u8BD5\u67E5\u627E\u989D\u5916\u4FE1\u606F"
		},
		"Enables methods that use API calls for finding extra information, such as the original page, caption, or album information. Note that this option does not affect finding the original media.": {
			"pt-BR": "Ativa m\u00E9todos que usam chamadas de API para encontrar informa\u00E7\u00F5es extras, como a p\u00E1gina original, legenda ou informa\u00E7\u00F5es do \u00E1lbum. Observe que esta op\u00E7\u00E3o n\u00E3o afeta a localiza\u00E7\u00E3o da m\u00EDdia original.",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043C\u0435\u0442\u043E\u0434\u044B, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u044E\u0449\u0438\u0435 \u0432\u044B\u0437\u043E\u0432\u044B API \u0434\u043B\u044F \u043F\u043E\u0438\u0441\u043A\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u043E\u0439 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u0438, \u0442\u0430\u043A\u043E\u0439 \u043A\u0430\u043A \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430, \u043F\u043E\u0434\u043F\u0438\u0441\u044C \u0438\u043B\u0438 \u0441\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u043E\u0431 \u0430\u043B\u044C\u0431\u043E\u043C\u0435. \u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043D\u0438\u043C\u0430\u043D\u0438\u0435, \u0447\u0442\u043E \u044D\u0442\u043E\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u043D\u0435 \u0432\u043B\u0438\u044F\u0435\u0442 \u043D\u0430 \u043F\u043E\u0438\u0441\u043A \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u043C\u0435\u0434\u0438\u0430.",
			"zh-CN": "\u542F\u7528\u901A\u8FC7 API \u8C03\u7528\u67E5\u627E\u989D\u5916\u4FE1\u606F\u7684\u65B9\u6CD5\uFF0C\u67E5\u627E\u5982\u539F\u59CB\u9875\u9762\u3001\u6807\u9898\u6216\u76F8\u518C\u4FE1\u606F\u3002\u6B64\u9009\u9879\u4E0D\u5F71\u54CD\u67E5\u627E\u539F\u59CB\u7248\u672C\u7684\u5A92\u4F53\u6587\u4EF6\u3002"
		},
		"SmugMug": {
			"pt-BR": "SmugMug",
			"ru": "SmugMug",
			"zh-CN": "SmugMug"
		},
		"Enable tooltip": {
			"pt-BR": "Ativar dica de ferramenta",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0430\u044F \u043F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0430",
			"zh-CN": "\u542F\u7528\u5DE5\u5177\u63D0\u793A"
		},
		"Enables the 'Mouseover popup is needed to display the original version' tooltip": {
			"pt-BR": "Ativa a dica de ferramenta '\u00C9 necess\u00E1rio passar o mouse sobre o popup para exibir a vers\u00E3o original'",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0443 \u00AB\u0414\u043B\u044F \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u0438\u0441\u0445\u043E\u0434\u043D\u043E\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u0440\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0438 \u043C\u044B\u0448\u0438\u00BB.",
			"zh-CN": "\u542F\u7528\u201C\u9700\u8981\u9F20\u6807\u60AC\u505C\u5F39\u7A97\u6765\u663E\u793A\u539F\u59CB\u7248\u672C\u201D\u7684\u5DE5\u5177\u63D0\u793A"
		},
		"Show image URL in tooltip": {
			"ko": "\uD234\uD301\uC5D0 \uC774\uBBF8\uC9C0 URL \uD45C\uC2DC",
			"pt-BR": "Mostrar URL da imagem na dica de ferramenta",
			"ru": "\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C URL \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u0432\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0439 \u043F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0435",
			"zh-CN": "\u5728\u5DE5\u5177\u63D0\u793A\u4E2D\u663E\u793A\u56FE\u50CF URL"
		},
		"If the popup is needed to display the larger version of an image, display the image link in the tooltip": {
			"ko": "\uB354 \uD070 \uBC84\uC804\uC758 \uC774\uBBF8\uC9C0\uB97C \uD45C\uC2DC\uD558\uAE30 \uC704\uD574 \uD31D\uC5C5\uC774 \uD544\uC694\uD55C \uACBD\uC6B0 \uC774\uBBF8\uC9C0 \uB9C1\uD06C\uB97C \uD234\uD301\uC5D0 \uD45C\uC2DC\uD568",
			"pt-BR": "Se o popup for necess\u00E1rio para exibir a vers\u00E3o maior de uma imagem, exiba o link da imagem na dica de ferramenta",
			"ru": "\u0415\u0441\u043B\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0434\u043B\u044F \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u043D\u043E\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F, \u043E\u0442\u043E\u0431\u0440\u0430\u0437\u0438\u0442\u0435 url \u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0432\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0439 \u043F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0435.",
			"zh-CN": "\u5982\u679C\u9700\u8981\u5F39\u7A97\u6765\u663E\u793A\u56FE\u50CF\u7684\u8F83\u5927\u7248\u672C\uFF0C\u5728\u5DE5\u5177\u63D0\u793A\u4E2D\u663E\u793A\u56FE\u50CF\u94FE\u63A5"
		},
		"Hide tooltip after": {
			"ko": "\uD234\uD301 \uC228\uAE30\uAE30",
			"pt-BR": "Ocultar dica de ferramenta ap\u00F3s",
			"ru": "\u0421\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0443\u044E \u043F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0443 \u0447\u0435\u0440\u0435\u0437",
			"zh-CN": "\u9690\u85CF\u5DE5\u5177\u63D0\u793A\u7684\u65F6\u95F4"
		},
		"Hides the tooltip after the specified number of seconds (or when the mouse clicks on it). Set to 0 to never hide automatically": {
			"ko": "\uC9C0\uC815\uB41C \uC2DC\uAC04(\uCD08) \uD6C4\uC5D0(\uB610\uB294 \uB9C8\uC6B0\uC2A4\uAC00 \uD234\uD301\uC744 \uD074\uB9AD\uD560 \uB54C) \uD234\uD301\uC744 \uC228\uAE34\uB2E4. \uC790\uB3D9\uC73C\uB85C \uC228\uAE30\uC9C0 \uC54A\uC73C\uB824\uBA74 0\uC73C\uB85C \uC124\uC815",
			"pt-BR": "Oculta a dica de ferramenta ap\u00F3s o n\u00FAmero especificado de segundos (ou quando o mouse clica nela). Defina como 0 para nunca ocultar automaticamente",
			"ru": "\u0421\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0443\u044E \u043F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0443 \u043F\u043E\u0441\u043B\u0435 \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u043E\u0433\u043E \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0435\u043A\u0443\u043D\u0434 (\u0438\u043B\u0438 \u043A\u043E\u0433\u0434\u0430 \u043C\u044B\u0448\u044C \u0449\u0451\u043B\u043A\u0430\u0435\u0442 \u043F\u043E \u043D\u0435\u0439). 0 - \u043D\u0435 \u0441\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438.",
			"zh-CN": "\u5728\u6307\u5B9A\u79D2\u6570\u540E\u9690\u85CF\u5DE5\u5177\u63D0\u793A\u3002\u9F20\u6807\u5355\u51FB\u540E\u4E5F\u4F1A\u9690\u85CF\u3002\u8BBE\u4E3A 0 \u5219\u7981\u7528\u81EA\u52A8\u9690\u85CF"
		},
		"Log info object to console": {
			"pt-BR": "Registrar objeto de informa\u00E7\u00F5es no console",
			"ru": "\u0412\u044B\u0432\u043E\u0434\u0438\u0442\u044C \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E \u043E\u0431 \u043E\u0431\u044A\u0435\u043A\u0442\u0435 \u0432 \u043A\u043E\u043D\u0441\u043E\u043B\u044C",
			"zh-CN": "\u8BB0\u5F55\u4FE1\u606F\u5BF9\u8C61\u5230\u63A7\u5236\u53F0"
		},
		"Prints the full info object to the console whenever a popup/redirect is found": {
			"pt-BR": "Imprime o objeto de informa\u00E7\u00F5es completo no console sempre que um popup/redirecionamento for encontrado",
			"ru": "\u0412\u044B\u0432\u043E\u0434\u0438\u0442 \u043F\u043E\u043B\u043D\u0443\u044E \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E \u043E\u0431\u044A\u0435\u043A\u0442\u0430 \u0432 \u043A\u043E\u043D\u0441\u043E\u043B\u044C \u0432\u0441\u044F\u043A\u0438\u0439 \u0440\u0430\u0437, \u043A\u043E\u0433\u0434\u0430 \u043E\u0431\u043D\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E/\u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435",
			"zh-CN": "\u6BCF\u5F53\u53D1\u73B0\u5F39\u51FA/\u91CD\u5B9A\u5411\u65F6\uFF0C\u8BB0\u5F55\u5B8C\u6574\u7684\u4FE1\u606F\u5BF9\u8C61\u5230\u63A7\u5236\u53F0"
		},
		"Disable when response headers need modifying": {
			"pt-BR": "Desativar quando os cabe\u00E7alhos de resposta precisarem ser modificados",
			"ru": "\u041E\u0442\u043A\u043B\u044E\u0447\u0430\u0442\u044C, \u043A\u043E\u0433\u0434\u0430 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 \u043E\u0442\u0432\u0435\u0442\u043E\u0432 \u043D\u0443\u0436\u0434\u0430\u044E\u0442\u0441\u044F \u0432 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0438",
			"zh-CN": "\u9700\u8981\u4FEE\u6539\u54CD\u5E94\u5934\u65F6\u7981\u7528"
		},
		"This option works around Chrome's migration to manifest v3, redirecting some images to being force-downloaded": {
			"pt-BR": "Esta op\u00E7\u00E3o contorna a migra\u00E7\u00E3o do Chrome para o manifesto v3, redirecionando algumas imagens para serem baixadas \u00E0 for\u00E7a",
			"ru": "\u042D\u0442\u043E\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u0432\u043E\u043A\u0440\u0443\u0433 \u043C\u0438\u0433\u0440\u0430\u0446\u0438\u0438 Chrome \u0432 manifest v3, \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u044F \u043D\u0435\u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043A \u043F\u0440\u0438\u043D\u0443\u0434\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u043C\u0443 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044E",
			"zh-CN": "\u6B64\u9009\u9879\u662F\u4E3A\u914D\u5408 Chrome \u7684\u8FC1\u79FB\u5230 manifest v3\uFF0C\u91CD\u5B9A\u5411\u4E00\u4E9B\u56FE\u50CF\u6765\u5F3A\u5236\u4E0B\u8F7D"
		},
		"Redirect to largest without issues": {
			"ko": "\uBB38\uC81C\uC5C6\uC774 \uCD5C\uB300\uB85C \uB9AC\uB514\uB809\uC158",
			"pt-BR": "Redirecionar para a maior sem problemas",
			"ru": "\u0411\u0435\u0437 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u043F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u0442\u044C \u043D\u0430 \u0441\u0430\u043C\u043E\u0435 \u0431\u043E\u043B\u044C\u0448\u043E\u0435",
			"zh-CN": "\u65E0\u9700\u6C42\u4E5F\u91CD\u5B9A\u5411\u5230\u6700\u5927\u7248\u672C"
		},
		"Redirects to the largest image found that doesn't require custom headers or forces download": {
			"ko": "\uC0AC\uC6A9\uC790 \uC9C0\uC815 \uD5E4\uB354\uB098 \uAC15\uC81C \uB2E4\uC6B4\uB85C\uB4DC\uAC00 \uD544\uC694 \uC5C6\uB294 \uAC00\uC7A5 \uD070 \uC774\uBBF8\uC9C0\uB85C \uB9AC\uB514\uB809\uC158",
			"pt-BR": "Redireciona para a maior imagem encontrada que n\u00E3o requer cabe\u00E7alhos personalizados ou for\u00E7a o download",
			"ru": "\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u0435\u0442 \u043D\u0430 \u0441\u0430\u043C\u043E\u0435 \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043D\u043E\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435, \u043A\u043E\u0442\u043E\u0440\u043E\u0435 \u043D\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0445 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u043E\u0432 \u0438\u043B\u0438 \u043F\u0440\u0438\u043D\u0443\u0434\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0433\u043E \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F.",
			"zh-CN": "\u91CD\u5B9A\u5411\u5230\u627E\u5230\u7684\u6700\u5927\u56FE\u50CF\u7248\u672C\uFF0C\u54EA\u6015\u4E0D\u9700\u8981\u81EA\u5B9A\u4E49\u5934\u6216\u5F3A\u5236\u4E0B\u8F7D"
		},
		"Redirect for HTML pages too": {
			"pt-BR": "Redirecionar p\u00E1ginas HTML tamb\u00E9m",
			"ru": "\u041F\u0435\u0440\u0435\u043D\u0430\u043F\u0440\u0430\u0432\u043B\u044F\u0442\u044C \u0434\u043B\u044F HTML-\u0441\u0442\u0440\u0430\u043D\u0438\u0446 \u0442\u043E\u0436\u0435",
			"zh-CN": "\u540C\u65F6\u91CD\u5B9A\u5411 HTML \u9875\u9762"
		},
		"Tries redirection even if the host page is HTML. This option might be useful for dead links. However, this will also result in many normal pages being redirected to images/video, so use with caution.": {
			"pt-BR": "Tenta redirecionar mesmo se a p\u00E1gina de origem for HTML. Esta op\u00E7\u00E3o pode ser \u00FAtil para links inativos. No entanto, isso tamb\u00E9m far\u00E1 com que muitas p\u00E1ginas normais sejam redirecionadas para imagens/v\u00EDdeo, portanto, use com cautela."
		},
		"This will result in many pages being redirected to images/videos.\nI'd recommend only either enabling this for the media you need it for then disabling it after, or using the black/whitelist feature below to only allow it to run for specified websites.": {
			"pt-BR": "Isso resultar\u00E1 no redirecionamento de v\u00E1rias p\u00E1ginas para imagens/v\u00EDdeos.\nRecomendo habilitar esta op\u00E7\u00E3o apenas para a m\u00EDdia que voc\u00EA precisa e desabilit\u00E1-la em seguida, ou usar o recurso de lista negra/branca abaixo para permitir que ela seja executada apenas em sites espec\u00EDficos."
		},
		"Enable mouseover popup": {
			"en": "Enable image popup",
			"es": "Activar popup de la imagen",
			"fr": "Activer le popup",
			"ko": "\uC774\uBBF8\uC9C0 \uD31D\uC5C5 \uC0AC\uC6A9",
			"pt-BR": "Ativar pop-up ao passar o mouse",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u0440\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0438 \u043C\u044B\u0448\u0438",
			"zh-CN": "\u542F\u7528\u9F20\u6807\u60AC\u505C\u5F39\u7A97"
		},
		"Show a popup with the larger image when you mouseover an image with the trigger key held (if applicable)": {
			"ko": "\uD2B8\uB9AC\uAC70 \uD0A4\uB97C \uB204\uB978 \uC0C1\uD0DC\uB85C \uC601\uC0C1\uC744 \uB9C8\uC6B0\uC2A4\uB85C \uAC00\uB9AC\uD0AC \uB54C \uB354 \uD070 \uC774\uBBF8\uC9C0\uB85C \uD31D\uC5C5 \uD45C\uC2DC (\uAC00\uB2A5\uD55C \uACBD\uC6B0)",
			"pt-BR": "Exibir um pop-up com a imagem ampliada ao passar o mouse sobre uma imagem com a tecla de gatilho pressionada (se aplic\u00E1vel)",
			"ru": "\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0441 \u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u043D\u044B\u043C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043C \u043F\u0440\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0438 \u043A\u0443\u0440\u0441\u043E\u0440\u0430 \u043C\u044B\u0448\u0438 \u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0441 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043C\u043E\u0439 \u0446\u0435\u043B\u0435\u0432\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0435\u0439 (\u0435\u0441\u043B\u0438 \u043F\u0440\u0438\u043C\u0435\u043D\u0438\u043C\u043E).",
			"zh-CN": "\u5F53\u9F20\u6807\u60AC\u505C\u5728\u4E00\u4E2A\u56FE\u50CF\u4E0A\u65F6\uFF0C\u7528\u89E6\u53D1\u952E\uFF08\u5982\u679C\u9002\u7528\uFF09\u663E\u793A\u4E00\u4E2A\u5F39\u7A97"
		},
		"Mouseover popup trigger": {
			"en": "Popup trigger",
			"es": "Acci\u00F3n del popup al mover el rat\u00F3n encima",
			"fr": "D\u00E9clencheur du popup",
			"ko": "\uD31D\uC5C5 \uD2B8\uB9AC\uAC70",
			"pt-BR": "Gatilho do pop-up ao passar o mouse",
			"ru": "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430 \u043F\u0440\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0438 \u043C\u044B\u0448\u0438",
			"zh-CN": "\u9F20\u6807\u60AC\u505C\u5F39\u7A97\u89E6\u53D1\u5668"
		},
		"How the popup will get triggered": {
			"ko": "\uD31D\uC5C5 \uC791\uB3D9 \uBC29\uBC95",
			"pt-BR": "Como o pop-up ser\u00E1 acionado",
			"ru": "\u041A\u0430\u043A \u0431\u0443\u0434\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E",
			"zh-CN": "\u5F39\u7A97\u89E6\u53D1\u65B9\u5F0F"
		},
		"Mouseover": {
			"es": "Mover rat\u00F3n encima",
			"ko": "\uB9C8\uC6B0\uC2A4",
			"pt-BR": "Ao passar o mouse",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u043A\u0443\u0440\u0441\u043E\u0440\u0430 \u043C\u044B\u0448\u0438",
			"zh-CN": "\u9F20\u6807\u60AC\u505C"
		},
		"Triggers when your mouse is over the image": {
			"pt-BR": "Aciona quando o mouse est\u00E1 sobre a imagem",
			"ru": "\u0421\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u0435\u0442 \u043F\u0440\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0438 \u043A\u0443\u0440\u0441\u043E\u0440\u0430 \u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0438",
			"zh-CN": "\u9F20\u6807\u5728\u56FE\u50CF\u4E0A\u60AC\u505C\u65F6\u89E6\u53D1"
		},
		"Key trigger": {
			"es": "Tecla de acci\u00F3n",
			"ko": "\uD0A4 \uBC14\uC778\uB529",
			"pt-BR": "Tecla de gatilho",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u043A\u043B\u0430\u0432\u0438\u0448\u0438",
			"zh-CN": "\u6309\u952E\u89E6\u53D1"
		},
		"Triggers when you press a key sequence when your mouse is over an image": {
			"pt-BR": "Aciona ao pressionar uma sequ\u00EAncia de teclas quando o mouse est\u00E1 sobre uma imagem",
			"ru": "\u0421\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u0435\u0442 \u043F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u043A\u043E\u043C\u0431\u0438\u043D\u0430\u0446\u0438\u0438 \u043A\u043B\u0430\u0432\u0438\u0448, \u043A\u043E\u0433\u0434\u0430 \u043A\u0443\u0440\u0441\u043E\u0440 \u043D\u0430\u0445\u043E\u0434\u0438\u0442\u0441\u044F \u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0438.",
			"zh-CN": "\u5F53\u9F20\u6807\u5728\u56FE\u50CF\u4E0A\u60AC\u505C\u65F6\u6309\u6307\u5B9A\u952E\u89E6\u53D1"
		},
		"Disables the popup from being triggered (useful if you only want to use the context menu item)": {
			"pt-BR": "Desativa o acionamento do pop-up (\u00FAtil se voc\u00EA deseja usar apenas o item do menu de contexto)",
			"ru": "\u041E\u0442\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u043D\u0438\u0435 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430 (\u043F\u043E\u043B\u0435\u0437\u043D\u043E, \u0435\u0441\u043B\u0438 \u0432\u044B \u0445\u043E\u0442\u0438\u0442\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u0443\u043D\u043A\u0442 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u043D\u043E\u0433\u043E \u043C\u0435\u043D\u044E)",
			"zh-CN": "\u7981\u6B62\u89E6\u53D1\u5F39\u7A97\uFF08\u5982\u679C\u60A8\u53EA\u60F3\u4F7F\u7528\u53F3\u952E\u83DC\u5355\u9879\uFF0C\u5219\u6B64\u9009\u9879\u5F88\u5B9E\u7528\uFF09"
		},
		"Popup trigger key": {
			"es": "Tecla de acci\u00F3n del popup",
			"ko": "\uD31D\uC5C5 \uD0A4 \uBC14\uC778\uB529",
			"pt-BR": "Tecla de gatilho do pop-up",
			"ru": "\u041A\u043E\u043C\u0431\u0438\u043D\u0430\u0446\u0438\u044F \u043A\u043B\u0430\u0432\u0438\u0448 \u0437\u0430\u043F\u0443\u0441\u043A\u0430 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u5F39\u7A97\u89E6\u53D1\u952E"
		},
		"Key sequence to trigger the popup": {
			"ko": "\uD31D\uC5C5\uC774 \uC791\uB3D9\uD558\uB294 \uD0A4",
			"pt-BR": "Sequ\u00EAncia de teclas para acionar o pop-up",
			"ru": "\u041A\u043E\u043C\u0431\u0438\u043D\u0430\u0446\u0438\u044F \u043A\u043B\u0430\u0432\u0438\u0448 \u043F\u0440\u0438 \u043A\u043E\u0442\u043E\u0440\u043E\u0439 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u0435\u0442\u0441\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E",
			"zh-CN": "\u89E6\u53D1\u5F39\u7A97\u7684\u6309\u952E\u5E8F\u5217"
		},
		"Popup trigger key (#2)": {
			"pt-BR": "Tecla de gatilho do pop-up (#2)",
			"ru": "\u041A\u043E\u043C\u0431\u0438\u043D\u0430\u0446\u0438\u044F \u043A\u043B\u0430\u0432\u0438\u0448 \u0437\u0430\u043F\u0443\u0441\u043A\u0430 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430 (#2)",
			"zh-CN": "\u5F39\u7A97\u89E6\u53D1\u952E (#2)"
		},
		"Key sequence to trigger the popup with alternate options. Search for `(#2)` to find the relevant options": {
			"pt-BR": "Sequ\u00EAncia de teclas para acionar o pop-up com op\u00E7\u00F5es alternativas. Procure por `(#2)` para encontrar as op\u00E7\u00F5es relevantes",
			"ru": "\u041A\u043E\u043C\u0431\u0438\u043D\u0430\u0446\u0438\u044F \u043A\u043B\u0430\u0432\u0438\u0448 \u043F\u0440\u0438 \u043A\u043E\u0442\u043E\u0440\u043E\u0439 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u0435\u0442\u0441\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0441 \u0430\u043B\u044C\u0442\u0435\u0440\u043D\u0430\u0442\u0438\u0432\u043D\u044B\u043C\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u043C\u0438. \u0418\u0449\u0438\u0442\u0435 `(#2)`, \u0447\u0442\u043E\u0431\u044B \u043D\u0430\u0439\u0442\u0438 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B.",
			"zh-CN": "\u89E6\u53D1\u5F39\u7A97\u7684\u6309\u952E\u5E8F\u5217\uFF0C\u642D\u914D\u5907\u7528\u9009\u9879\u3002\u641C\u7D22\u201C(#2)\u201D\u627E\u5230\u76F8\u5173\u7684\u9009\u9879"
		},
		"Popup trigger key (#3)": {
			"pt-BR": "Tecla de gatilho do pop-up (#3)",
			"ru": "\u041A\u043E\u043C\u0431\u0438\u043D\u0430\u0446\u0438\u044F \u043A\u043B\u0430\u0432\u0438\u0448 \u0437\u0430\u043F\u0443\u0441\u043A\u0430 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430 (#3)",
			"zh-CN": "\u5F39\u7A97\u89E6\u53D1\u952E (#3)"
		},
		"Key sequence to trigger the popup with alternate options. Search for `(#3)` to find the relevant options": {
			"pt-BR": "Sequ\u00EAncia de teclas para acionar o pop-up com op\u00E7\u00F5es alternativas. Procure por `(#3)` para encontrar as op\u00E7\u00F5es relevantes",
			"ru": "\u041A\u043E\u043C\u0431\u0438\u043D\u0430\u0446\u0438\u044F \u043A\u043B\u0430\u0432\u0438\u0448 \u043F\u0440\u0438 \u043A\u043E\u0442\u043E\u0440\u043E\u0439 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u0435\u0442\u0441\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0441 \u0430\u043B\u044C\u0442\u0435\u0440\u043D\u0430\u0442\u0438\u0432\u043D\u044B\u043C\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u043C\u0438. \u0418\u0449\u0438\u0442\u0435 `(#3)`, \u0447\u0442\u043E\u0431\u044B \u043D\u0430\u0439\u0442\u0438 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B.",
			"zh-CN": "\u89E6\u53D1\u5F39\u7A97\u7684\u6309\u952E\u5E8F\u5217\uFF0C\u642D\u914D\u5907\u7528\u9009\u9879\u3002\u641C\u7D22\u201C(#3)\u201D\u627E\u5230\u76F8\u5173\u7684\u9009\u9879"
		},
		"Popup trigger delay": {
			"es": "Retraso de acci\u00F3n del popup",
			"ko": "\uD31D\uC5C5 \uC791\uC5C5 \uC9C0\uC5F0 \uC2DC\uAC04",
			"pt-BR": "Atraso no acionamento do pop-up",
			"ru": "\u0417\u0430\u0434\u0435\u0440\u0436\u043A\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u043D\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u5F39\u7A97\u89E6\u53D1\u952E\u5EF6\u8FDF"
		},
		"Delay (in seconds) before the popup shows": {
			"ko": "\uD31D\uC5C5\uC774 \uD45C\uC2DC\uB420 \uB54C\uAE4C\uC9C0 \uC9C0\uC5F0 (\uCD08)",
			"pt-BR": "Atraso (em segundos) antes da exibi\u00E7\u00E3o do pop-up",
			"ru": "\u0417\u0430\u0434\u0435\u0440\u0436\u043A\u0430 (\u0432 \u0441\u0435\u043A\u0443\u043D\u0434\u0430\u0445) \u0434\u043E \u043F\u043E\u044F\u0432\u043B\u0435\u043D\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u5F39\u7A97\u663E\u793A\u524D\u5EF6\u8FDF\uFF08\u79D2\uFF09"
		},
		"Use mouseover event": {
			"pt-BR": "Usar evento mouseover",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0441\u043E\u0431\u044B\u0442\u0438\u0435 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u043A\u0443\u0440\u0441\u043E\u0440\u0430 \u043C\u044B\u0448\u0438",
			"zh-CN": "\u4F7F\u7528 mouseover \u4E8B\u4EF6"
		},
		"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": {
			"pt-BR": "Usa o evento 'mouseover' em vez de 'mousemove' para determinar onde acionar o pop-up. Isso se assemelha mais ao funcionamento de outros complementos de pop-up de imagem, em detrimento da configurabilidade",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u0441\u043E\u0431\u044B\u0442\u0438\u0435 '\u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u043A\u0443\u0440\u0441\u043E\u0440\u0430 \u043C\u044B\u0448\u0438' \u0432\u043C\u0435\u0441\u0442\u043E '\u0434\u0432\u0438\u0436\u0435\u043D\u0438\u044F \u043A\u0443\u0440\u0441\u043E\u0440\u0430 \u043C\u044B\u0448\u0438', \u0447\u0442\u043E\u0431\u044B \u0432\u044B\u044F\u0441\u043D\u0438\u0442\u044C, \u0433\u0434\u0435 \u0432\u044B\u0437\u0432\u0430\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E. \u042D\u0442\u043E \u0431\u043E\u043B\u0435\u0435 \u0442\u043E\u0447\u043D\u043E \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043E\u043C\u0443, \u043A\u0430\u043A \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F \u043A \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0438\u043C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u043C, \u0437\u0430 \u0441\u0447\u0451\u0442 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043C\u043E\u0441\u0442\u0438/",
			"zh-CN": "\u4F7F\u7528 mouseover \u4E8B\u4EF6\u800C\u4E0D\u662F mousemove \u6765\u786E\u5B9A\u5728\u54EA\u91CC\u89E6\u53D1\u5F39\u7A97\u3002\u8FD9\u66F4\u63A5\u8FD1\u4E8E\u5176\u4ED6\u56FE\u50CF\u5F39\u7A97\u6269\u5C55\u7684\u8FD0\u4F5C\u65B9\u5F0F\uFF0C\u4EE3\u4EF7\u662F\u53EF\u914D\u7F6E\u6027"
		},
		"Enable/disable toggle": {
			"pt-BR": "Altern\u00E2ncia de ativar/desativar",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C/\u0412\u044B\u043A\u043B\u044E\u0447\u0438\u0442\u044C",
			"zh-CN": "\u542F\u7528/\u7981\u7528\u5207\u6362\u5F00\u5173"
		},
		"Controls whether the 'Popup enable/disable key' will enable or disable the popup from opening": {
			"pt-BR": "Controla se a 'Tecla de ativar/desativar pop-up' ir\u00E1 ativar ou desativar a abertura do pop-up",
			"ru": "\u0423\u043F\u0440\u0430\u0432\u043B\u044F\u0435\u0442 \u0442\u0435\u043C, \u0431\u0443\u0434\u0435\u0442 \u043B\u0438 '\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u0432\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F/\u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430' \u0432\u043A\u043B\u044E\u0447\u0430\u0442\u044C \u0438\u043B\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0430\u0442\u044C \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0435 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430.",
			"zh-CN": "\u63A7\u5236\u201C\u5F39\u7A97\u542F\u7528/\u7981\u7528\u952E\u201D\u662F\u5426\u63A7\u5236\u5F39\u7A97\u7684\u6253\u5F00"
		},
		"Enable": {
			"pt-BR": "Ativar",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C",
			"zh-CN": "\u542F\u7528"
		},
		"Disable": {
			"pt-BR": "Desativar",
			"ru": "\u041E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C",
			"zh-CN": "\u7981\u7528"
		},
		"Popup enable/disable key": {
			"pt-BR": "Tecla de ativar/desativar pop-up",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u0432\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F/\u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u5F39\u7A97\u542F\u7528/\u7981\u7528\u952E"
		},
		"Holding down this key will enable or disable the popup from being opened, depending on the 'Enable/disable toggle' setting": {
			"pt-BR": "Manter esta tecla pressionada ativar\u00E1 ou desativar\u00E1 a abertura do pop-up, dependendo da configura\u00E7\u00E3o 'Altern\u00E2ncia de ativar/desativar'",
			"ru": "\u0423\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043D\u0438\u0435 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438 \u0432\u043A\u043B\u044E\u0447\u0438\u0442 \u0438\u043B\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0438\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E\u0441\u0442\u0438 \u043E\u0442 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 '\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C/\u0412\u044B\u043A\u043B\u044E\u0447\u0438\u0442\u044C'.",
			"zh-CN": "\u6309\u4F4F\u8FD9\u4E2A\u952E\u5C06\u542F\u7528/\u7981\u7528\u5F39\u7A97\u6253\u5F00\uFF0C\u5177\u4F53\u53D6\u51B3\u4E8E\u201C\u542F\u7528/\u7981\u7528\u5207\u6362\u5F00\u5173\u201D\u8BBE\u7F6E"
		},
		"Allow showing partially loaded": {
			"ko": "\uBD80\uBD84\uC801\uC73C\uB85C \uB85C\uB4DC\uB41C \uC0C1\uD0DC\uB85C \uD45C\uC2DC \uD5C8\uC6A9",
			"pt-BR": "Permitir exibi\u00E7\u00E3o de carregamento parcial",
			"ru": "\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u043F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u0447\u0430\u0441\u0442\u0438\u0447\u043D\u043E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0435",
			"zh-CN": "\u5141\u8BB8\u663E\u793A\u90E8\u5206\u52A0\u8F7D\u7684\u5185\u5BB9"
		},
		"This will allow the popup to open for partially loaded media.\nPartially loaded media will contain the source URL directly (where possible), whereas fully loaded media will use a blob or data URL.": {
			"pt-BR": "Isso permitir\u00E1 que o popup seja aberto para m\u00EDdia parcialmente carregada.\nM\u00EDdia parcialmente carregada conter\u00E1 a URL de origem diretamente (quando poss\u00EDvel), enquanto m\u00EDdia totalmente carregada usar\u00E1 um blob ou data URL.",
			"ru": "\u042D\u0442\u043E \u043F\u043E\u0437\u0432\u043E\u043B\u0438\u0442 \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0434\u043B\u044F \u0447\u0430\u0441\u0442\u0438\u0447\u043D\u043E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0445 \u043C\u0435\u0434\u0438\u0430.\n\u0427\u0430\u0441\u0442\u0438\u0447\u043D\u043E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0435 \u043C\u0435\u0434\u0438\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0439 URL \u043D\u0430\u043F\u0440\u044F\u043C\u0443\u044E (\u0433\u0434\u0435 \u044D\u0442\u043E \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E), \u0442\u043E\u0433\u0434\u0430 \u043A\u0430\u043A \u043F\u043E\u043B\u043D\u043E\u0441\u0442\u044C\u044E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0435 \u043C\u0435\u0434\u0438\u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C BLOB \u0438\u043B\u0438 URL-\u0430\u0434\u0440\u0435\u0441 \u0434\u0430\u043D\u043D\u044B\u0445.",
			"zh-CN": "\u8FD9\u5C06\u5141\u8BB8\u4E3A\u90E8\u5206\u52A0\u8F7D\u7684\u5A92\u4F53\u6253\u5F00\u5F39\u7A97\u3002\n\u90E8\u5206\u52A0\u8F7D\u7684\u5A92\u4F53\u5C06\u76F4\u63A5\u5305\u542B\u6E90 URL\uFF08\u5982\u679C\u53EF\u80FD\uFF09\uFF0C\u800C\u5B8C\u5168\u52A0\u8F7D\u7684\u5A92\u4F53\u4F7F\u7528 blob \u6216\u6570\u636E URL\u3002"
		},
		"This will allow the popup to open for partially loaded media, but this might break images that require custom headers to display properly.\nPartially loaded media will contain the source URL directly (where possible), whereas fully loaded media will use a blob or data URL.": {
			"pt-BR": "Isso permitir\u00E1 que o popup seja aberto para m\u00EDdia parcialmente carregada, mas pode quebrar imagens que exigem cabe\u00E7alhos personalizados para serem exibidas corretamente.\nM\u00EDdia parcialmente carregada conter\u00E1 a URL de origem diretamente (quando poss\u00EDvel), enquanto m\u00EDdia totalmente carregada usar\u00E1 um blob ou data URL.",
			"ru": "\u042D\u0442\u043E \u043F\u043E\u0437\u0432\u043E\u043B\u0438\u0442 \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0434\u043B\u044F \u0447\u0430\u0441\u0442\u0438\u0447\u043D\u043E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0445 \u043C\u0435\u0434\u0438\u0430, \u043D\u043E \u044D\u0442\u043E \u043C\u043E\u0436\u0435\u0442 \u043F\u043E\u043B\u043E\u043C\u0430\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F, \u0434\u043B\u044F \u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u043E\u0433\u043E \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043A\u043E\u0442\u043E\u0440\u044B\u0445 \u0442\u0440\u0435\u0431\u0443\u044E\u0442\u0441\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0435 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438.\n\u0427\u0430\u0441\u0442\u0438\u0447\u043D\u043E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0435 \u043C\u0435\u0434\u0438\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C \u0438\u0441\u0445\u043E\u0434\u043D\u044B\u0439 URL-\u0430\u0434\u0440\u0435\u0441 \u043D\u0430\u043F\u0440\u044F\u043C\u0443\u044E (\u0433\u0434\u0435 \u044D\u0442\u043E \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E), \u0442\u043E\u0433\u0434\u0430 \u043A\u0430\u043A \u043F\u043E\u043B\u043D\u043E\u0441\u0442\u044C\u044E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0435 \u043C\u0435\u0434\u0438\u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C BLOB \u0438\u043B\u0438 URL-\u0430\u0434\u0440\u0435\u0441 \u0434\u0430\u043D\u043D\u044B\u0445.",
			"zh-CN": "\u8FD9\u5C06\u5141\u8BB8\u4E3A\u90E8\u5206\u52A0\u8F7D\u7684\u5A92\u4F53\u6253\u5F00\u5F39\u7A97\uFF0C\u4F46\u8FD9\u53EF\u80FD\u5BFC\u81F4\u9700\u8981\u81EA\u5B9A\u4E49\u6807\u5934\u624D\u80FD\u6B63\u786E\u663E\u793A\u7684\u56FE\u50CF\u51FA\u9519\u3002\n\u90E8\u5206\u52A0\u8F7D\u7684\u5A92\u4F53\u5C06\u76F4\u63A5\u5305\u542B\u6E90 URL\uFF08\u5982\u679C\u53EF\u80FD\uFF09\uFF0C\u800C\u5B8C\u5168\u52A0\u8F7D\u7684\u5A92\u4F53\u4F7F\u7528 blob \u6216\u6570\u636E URL\u3002"
		},
		"Streams": {
			"pt-BR": "Transmiss\u00F5es",
			"ru": "\u041F\u043E\u0442\u043E\u043A\u0438",
			"zh-CN": "\u6570\u636E\u6D41"
		},
		"Audio and video": {
			"pt-BR": "\u00C1udio e v\u00EDdeo",
			"ru": "\u0410\u0443\u0434\u0438\u043E \u0438 \u0432\u0438\u0434\u0435\u043E",
			"zh-CN": "\u97F3\u9891\u548C\u89C6\u9891"
		},
		"Media": {
			"es": "Medios",
			"ko": "\uBBF8\uB514\uC5B4",
			"pt-BR": "M\u00EDdia",
			"ru": "\u041C\u0435\u0434\u0438\u0430",
			"zh-CN": "\u591A\u5A92\u4F53"
		},
		"Images, audio, and video": {
			"pt-BR": "Imagens, \u00E1udio e v\u00EDdeo",
			"ru": "\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F, \u0430\u0443\u0434\u0438\u043E \u0438 \u0432\u0438\u0434\u0435\u043E",
			"zh-CN": "\u56FE\u50CF\u3001\u97F3\u9891\u548C\u89C6\u9891"
		},
		"Avoid HEAD request for partially loaded media": {
			"pt-BR": "Evitar requisi\u00E7\u00E3o HEAD para m\u00EDdia parcialmente carregada",
			"ru": "\u0418\u0437\u0431\u0435\u0433\u0430\u0442\u044C \u0437\u0430\u043F\u0440\u043E\u0441\u044B HEAD \u0434\u043B\u044F \u0447\u0430\u0441\u0442\u0438\u0447\u043D\u043E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0445 \u043C\u0435\u0434\u0438\u0430",
			"zh-CN": "\u907F\u514D\u5BF9\u5DF2\u90E8\u5206\u52A0\u8F7D\u7684\u5A92\u4F53\u53D1\u51FA HEAD \u8BF7\u6C42"
		},
		"Avoids a possibly unnecessary HEAD request before displaying partially loaded images, which further decreases the delay before opening the popup. This can cause issues if the server returns an error, but still returns an image": {
			"pt-BR": "Evita uma requisi\u00E7\u00E3o HEAD possivelmente desnecess\u00E1ria antes de exibir imagens parcialmente carregadas, o que diminui ainda mais o atraso antes de abrir o pop-up. Isso pode causar problemas se o servidor retornar um erro, mas ainda assim retornar uma imagem",
			"ru": "\u0418\u0437\u0431\u0435\u0433\u0430\u0435\u0442 \u043D\u0435\u043D\u0443\u0436\u043D\u043E\u0433\u043E \u0437\u0430\u043F\u0440\u043E\u0441\u0430 HEAD \u043F\u0435\u0440\u0435\u0434 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435\u043C \u0447\u0430\u0441\u0442\u0438\u0447\u043D\u043E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0445 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439, \u0447\u0442\u043E \u0435\u0449\u0435 \u0431\u043E\u043B\u044C\u0448\u0435 \u0443\u043C\u0435\u043D\u044C\u0448\u0430\u0435\u0442 \u0437\u0430\u0434\u0435\u0440\u0436\u043A\u0443 \u043F\u0435\u0440\u0435\u0434 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0435\u043C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430. \u042D\u0442\u043E \u043C\u043E\u0436\u0435\u0442 \u0432\u044B\u0437\u0432\u0430\u0442\u044C \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u044B, \u0435\u0441\u043B\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0435\u0440\u043D\u0451\u0442 \u043E\u0448\u0438\u0431\u043A\u0443, \u043D\u043E \u0432\u0441\u0435 \u0440\u0430\u0432\u043D\u043E \u0432\u0435\u0440\u043D\u0435\u0442 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435.",
			"zh-CN": "\u663E\u793A\u5DF2\u90E8\u5206\u52A0\u8F7D\u7684\u5A92\u4F53\u65F6\u907F\u514D\u53EF\u80FD\u4E0D\u5FC5\u8981\u7684 HEAD \u8BF7\u6C42\uFF0C\u8FD9\u80FD\u8FDB\u4E00\u6B65\u51CF\u5C11\u6253\u5F00\u5F39\u7A97\u7684\u5EF6\u8FDF\u3002\u4F46\u5982\u679C\u670D\u52A1\u5668\u8FD4\u56DE\u4E00\u4E2A\u9519\u8BEF\u7684\u540C\u65F6\u4E5F\u8FD4\u56DE\u4E86\u4E00\u4E2A\u56FE\u50CF\uFF0C\u8FD9\u53EF\u80FD\u4F1A\u5BFC\u81F4\u95EE\u9898"
		},
		"Use `blob:` over `data:` URLs": {
			"pt-BR": "Use `blob:` em vez de URLs `data:`",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C `blob:` \u043F\u043E\u0432\u0435\u0440\u0445 `data:` URL",
			"zh-CN": "\u4F7F\u7528 blob: \u4EE3\u66FF data: URL"
		},
		"Blob URLs are more efficient, but aren't supported by earlier browsers. Some websites also block `blob:` URLs": {
			"pt-BR": "URLs Blob s\u00E3o mais eficientes, mas n\u00E3o s\u00E3o suportadas por navegadores mais antigos. Alguns sites tamb\u00E9m bloqueiam URLs `blob:`",
			"ru": "Blob URL \u0431\u043E\u043B\u0435\u0435 \u044D\u0444\u0444\u0435\u043A\u0442\u0438\u0432\u043D\u044B, \u043D\u043E \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044E\u0442\u0441\u044F \u0441\u0442\u0430\u0440\u044B\u043C\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u043C\u0438. \u041D\u0435\u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0441\u0430\u0439\u0442\u044B \u0442\u0430\u043A\u0436\u0435 \u0431\u043B\u043E\u043A\u0438\u0440\u0443\u044E\u0442 `blob:` URL.",
			"zh-CN": "Blob URL \u6548\u7387\u66F4\u4F73\uFF0C\u4F46\u65E9\u671F\u7248\u672C\u7684\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u3002\u4E00\u4E9B\u7F51\u7AD9\u4E5F\u5C4F\u853D\u4E86 Blob: URL"
		},
		"Load media anonymously": {
			"pt-BR": "Carregar m\u00EDdia anonimamente",
			"ru": "\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044C \u043C\u0435\u0434\u0438\u0430 \u0430\u043D\u043E\u043D\u0438\u043C\u043D\u043E",
			"zh-CN": "\u533F\u540D\u52A0\u8F7D\u5A92\u4F53"
		},
		"Loads the media without sending any cookies or other forms of credentials. This is required to screenshot videos from other sources": {
			"pt-BR": "Carrega a m\u00EDdia sem enviar cookies ou outras formas de credenciais. Isso \u00E9 necess\u00E1rio para capturar v\u00EDdeos de outras fontes",
			"ru": "\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043C\u0435\u0434\u0438\u0430 \u0431\u0435\u0437 \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0438 \u043A\u0443\u043A\u0438-\u0444\u0430\u0439\u043B\u043E\u0432 \u0438\u043B\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u043E\u0440\u043C \u0443\u0447\u0451\u0442\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445. \u042D\u0442\u043E \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0434\u043B\u044F \u0441\u043A\u0440\u0438\u043D\u0448\u043E\u0442\u043E\u0432 \u0432\u0438\u0434\u0435\u043E \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u0432.",
			"zh-CN": "\u52A0\u8F7D\u5A92\u4F53\u800C\u4E0D\u53D1\u9001\u4EFB\u4F55 Cookie \u6216\u5176\u4ED6\u5F62\u5F0F\u7684\u51ED\u636E\u3002\u8FD9\u9700\u8981\u6709\u5176\u4ED6\u6765\u6E90\u7684\u89C6\u9891\u622A\u56FE"
		},
		"Use `not-allowed` cursor when unsupported": {
			"ko": "\uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC744 \uB54C \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uCEE4\uC11C\uB97C \uC0AC\uC6A9",
			"pt-BR": "Usar cursor `not-allowed` quando n\u00E3o for suportado",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043A\u0443\u0440\u0441\u043E\u0440 `\u0437\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043E`, \u0435\u0441\u043B\u0438 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F",
			"zh-CN": "\u4E0D\u652F\u6301\u65F6\u7ED9\u51FA\u9F20\u6807\u6307\u9488\u201C\u7981\u6B62\u201D"
		},
		"If the image isn't supported, the mouse cursor will change to a `not-allowed` cursor for a brief duration": {
			"ko": "\uC774\uBBF8\uC9C0\uAC00 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC73C\uBA74 \uB9C8\uC6B0\uC2A4 \uCEE4\uC11C\uAC00 \uC7A0\uC2DC \uB3D9\uC548 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uCEE4\uC11C\uB85C \uBCC0\uACBD\uB428",
			"pt-BR": "Se a imagem n\u00E3o for suportada, o cursor do mouse mudar\u00E1 para um cursor `not-allowed` por um breve per\u00EDodo",
			"ru": "\u0415\u0441\u043B\u0438 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F, \u043A\u0443\u0440\u0441\u043E\u0440 \u043C\u044B\u0448\u0438 \u043D\u0430 \u043A\u043E\u0440\u043E\u0442\u043A\u043E\u0435 \u0432\u0440\u0435\u043C\u044F \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u0441\u044F \u043D\u0430 `\u0437\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043E`.",
			"zh-CN": "\u5982\u679C\u9047\u5230\u4E0D\u652F\u6301\u7684\u56FE\u50CF\uFF0C\u9F20\u6807\u6307\u9488\u5C06\u6682\u65F6\u53D8\u4E3A\u201C\u7981\u6B62\u201D\u56FE\u6848"
		},
		"Use `not-allowed` cursor when unable to load": {
			"pt-BR": "Usar cursor `not-allowed` quando n\u00E3o for poss\u00EDvel carregar",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043A\u0443\u0440\u0441\u043E\u0440 `\u0437\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043E`, \u0435\u0441\u043B\u0438 \u043D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C",
			"zh-CN": "\u65E0\u6CD5\u52A0\u8F7D\u65F6\u7ED9\u51FA\u9F20\u6807\u6307\u9488\u201C\u7981\u6B62\u201D"
		},
		"If the image fails to load, the mouse cursor will change to a `not-allowed` cursor for a brief duration": {
			"ko": "\uC774\uBBF8\uC9C0\uB97C \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC73C\uBA74 \uB9C8\uC6B0\uC2A4 \uCEE4\uC11C\uAC00 \uC7A0\uC2DC \uB3D9\uC548 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uCEE4\uC11C\uB85C \uBCC0\uACBD\uB428",
			"pt-BR": "Se a imagem n\u00E3o carregar, o cursor do mouse mudar\u00E1 para um cursor `not-allowed` por um breve per\u00EDodo",
			"ru": "\u0415\u0441\u043B\u0438 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044F, \u043A\u0443\u0440\u0441\u043E\u0440 \u043C\u044B\u0448\u0438 \u043D\u0430 \u043A\u043E\u0440\u043E\u0442\u043A\u043E\u0435 \u0432\u0440\u0435\u043C\u044F \u0438\u0437\u043C\u0435\u043D\u0438\u0442\u0441\u044F \u043D\u0430 `\u0437\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043E`.",
			"zh-CN": "\u5982\u679C\u56FE\u50CF\u4E0B\u8F7D\u5931\u8D25\uFF0C\u9F20\u6807\u6307\u9488\u5C06\u6682\u65F6\u53D8\u4E3A\u201C\u7981\u6B62\u201D\u56FE\u6848"
		},
		"`not-allowed` cursor duration": {
			"pt-BR": "Dura\u00E7\u00E3o do cursor `not-allowed`",
			"ru": "\u0414\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C \u043A\u0443\u0440\u0441\u043E\u0440\u0430 `\u0437\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043E`",
			"zh-CN": "\u201C\u7981\u6B62\u201D\u6307\u9488\u6301\u7EED\u65F6\u95F4"
		},
		"How long the `not-allowed` cursor should last": {
			"pt-BR": "Tempo de dura\u00E7\u00E3o do cursor `not-allowed`",
			"ru": "\u041A\u0430\u043A \u0434\u043E\u043B\u0433\u043E \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044F \u043A\u0443\u0440\u0441\u043E\u0440 `\u0437\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043E`",
			"zh-CN": "\u201C\u7981\u6B62\u201D\u6307\u9488\u7684\u663E\u793A\u6301\u7EED\u591A\u4E45"
		},
		"Exclude image tabs": {
			"ko": "\uC774\uBBF8\uC9C0 \uD0ED \uC81C\uC678",
			"pt-BR": "Excluir abas de imagens",
			"ru": "\u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0442\u044C \u0432\u043A\u043B\u0430\u0434\u043A\u0438 \u0441 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u043C\u0438",
			"zh-CN": "\u6392\u9664\u56FE\u50CF\u6807\u7B7E\u9875"
		},
		"Excludes images that are opened in their own tabs": {
			"ko": "\uC790\uC2E0\uC758 \uD0ED\uC5D0\uC11C \uC5F4\uB9B0 \uC774\uBBF8\uC9C0 \uC81C\uC678",
			"pt-BR": "Exclui imagens que s\u00E3o abertas em suas pr\u00F3prias abas",
			"ru": "\u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F, \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435 \u0432 \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0445 \u0432\u043A\u043B\u0430\u0434\u043A\u0430\u0445.",
			"zh-CN": "\u6392\u9664\u5728\u5355\u72EC\u7684\u6807\u7B7E\u9875\u4E2D\u6253\u5F00\u7684\u56FE\u50CF"
		},
		"Exclude if media URL is unchanged": {
			"pt-BR": "Excluir se a URL da m\u00EDdia n\u00E3o for alterada",
			"ru": "\u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0442\u044C, \u0435\u0441\u043B\u0438 \u0441\u0441\u044B\u043B\u043A\u0430 \u043C\u0435\u0434\u0438\u0430 \u043D\u0435 \u0438\u0437\u043C\u0435\u043D\u0438\u043B\u0430\u0441\u044C",
			"zh-CN": "\u6392\u9664\u65E0\u53D8\u5316\u7684\u5A92\u4F53 URL"
		},
		"Don't pop up if the new URL is the same as the source": {
			"pt-BR": "N\u00E3o exibir pop-up se a nova URL for igual \u00E0 fonte",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043D\u0435 \u043F\u043E\u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F, \u0435\u0441\u043B\u0438 \u0441\u0441\u044B\u043B\u043A\u0430 \u043A\u0430\u043A \u0443 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430.",
			"zh-CN": "\u5982\u679C\u65B0 URL \u4E0E\u6E90 URL \u76F8\u540C\u5219\u4E0D\u5F39\u51FA"
		},
		"Only popup for linked media": {
			"pt-BR": "Pop-up apenas para m\u00EDdia com link",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u043C\u0435\u0434\u0438\u0430 \u0441 \u0441\u0441\u044B\u043B\u043A\u043E\u0439",
			"zh-CN": "\u4EC5\u5F39\u51FA\u94FE\u63A5\u5F62\u5F0F\u7684\u5A92\u4F53"
		},
		"Don't pop up if the media isn't hyperlinked": {
			"pt-BR": "N\u00E3o exibir pop-up se a m\u00EDdia n\u00E3o tiver um hiperlink",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043D\u0435 \u043F\u043E\u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F, \u0435\u0441\u043B\u0438 \u043C\u0435\u0434\u0438\u0430 \u043D\u0435 \u0438\u043C\u0435\u0435\u0442 \u0433\u0438\u043F\u0435\u0440\u0441\u0441\u044B\u043B\u043A\u0438",
			"zh-CN": "\u4E0D\u5F39\u51FA\u975E\u8D85\u94FE\u63A5\u5F62\u5F0F\u7684\u5A92\u4F53"
		},
		"Popup link for linked media": {
			"pt-BR": "Link em pop-up para m\u00EDdia com link",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0441\u0441\u044B\u043B\u043A\u0438 \u0434\u043B\u044F \u043C\u0435\u0434\u0438\u0430 \u0441 \u0441\u0441\u044B\u043B\u043A\u0430\u043C\u0438",
			"zh-CN": "\u94FE\u63A5\u7684\u5A92\u4F53\u5F39\u7A97\u94FE\u63A5"
		},
		"If the linked media cannot be made larger, pop up for the link instead of the media": {
			"pt-BR": "Se a m\u00EDdia com link n\u00E3o puder ser ampliada, exibir o link em um pop-up em vez da m\u00EDdia",
			"ru": "\u0415\u0441\u043B\u0438 \u043C\u0435\u0434\u0438\u0430 \u0441 \u0441\u0441\u044B\u043B\u043A\u043E\u0439 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u043E, \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u0435\u0442 \u0441\u0441\u044B\u043B\u043A\u0430 \u0432\u043C\u0435\u0441\u0442\u043E \u043C\u0435\u0434\u0438\u0430.",
			"zh-CN": "\u5982\u679C\u94FE\u63A5\u7684\u5A92\u4F53\u4E0D\u80FD\u53D8\u5927\uFF0C\u5F39\u51FA\u8BE5\u94FE\u63A5\u800C\u975E\u5A92\u4F53"
		},
		"Exclude image maps": {
			"ko": "\uC774\uBBF8\uC9C0 \uB9F5 \uC81C\uC678",
			"pt-BR": "Excluir mapas de imagem",
			"ru": "\u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0442\u044C \u043A\u0430\u0440\u0442\u044B \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439",
			"zh-CN": "\u6392\u9664\u56FE\u50CF\u96C6"
		},
		"Don't pop up if the image is an image map (image with multiple clickable areas)": {
			"ko": "\uC774\uBBF8\uC9C0\uAC00 \uC774\uBBF8\uC9C0 \uB9F5(\uD074\uB9AD \uAC00\uB2A5\uD55C \uC601\uC5ED\uC774 \uC5EC\uB7EC \uAC1C\uB97C \uAC00\uC9C4 \uC774\uBBF8\uC9C0)\uC778 \uACBD\uC6B0 \uD31D\uC5C5 \uD45C\uC2DC \uC548 \uD568",
			"pt-BR": "N\u00E3o exibir pop-up se a imagem for um mapa de imagem (imagem com v\u00E1rias \u00E1reas clic\u00E1veis)",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043D\u0435 \u043F\u043E\u044F\u0432\u0438\u0442\u0441\u044F, \u0435\u0441\u043B\u0438 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u0442 \u0441\u043E\u0431\u043E\u0439 \u043A\u0430\u0440\u0442\u0443 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F (\u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0441 \u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u0438\u043C\u0438 \u043A\u043B\u0438\u043A\u0430\u043B\u044C\u043D\u044B\u043C\u0438 \u043E\u0431\u043B\u0430\u0441\u0442\u044F\u043C\u0438).",
			"zh-CN": "\u4E0D\u5F39\u51FA\u6709\u591A\u4E2A\u53EF\u70B9\u51FB\u533A\u57DF\u7684\u56FE\u50CF\u96C6\uFF08image map\uFF09"
		},
		"Autoplay": {
			"pt-BR": "Reprodu\u00E7\u00E3o autom\u00E1tica",
			"ru": "\u0410\u0432\u0442\u043E\u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u0435",
			"zh-CN": "\u81EA\u52A8\u64AD\u653E"
		},
		"Play automatically once the popup is opened": {
			"pt-BR": "Reproduzir automaticamente quando o pop-up for aberto",
			"ru": "\u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0441\u044F \u043F\u043E\u0441\u043B\u0435 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430.",
			"zh-CN": "\u5F39\u7A97\u6253\u5F00\u540E\u81EA\u52A8\u64AD\u653E"
		},
		"Show video controls": {
			"pt-BR": "Exibir controles de v\u00EDdeo",
			"ru": "\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u0432\u0438\u0434\u0435\u043E",
			"zh-CN": "\u663E\u793A\u89C6\u9891\u63A7\u4EF6"
		},
		"Shows native video controls. Note that this prevents dragging under Firefox": {
			"pt-BR": "Exibe os controles nativos de v\u00EDdeo. Observe que isso impede o arrastar no Firefox",
			"ru": "\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0435\u0442 \u0432\u0441\u0442\u0440\u043E\u0435\u043D\u043D\u044B\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u0432\u0438\u0434\u0435\u043E. \u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043D\u0438\u043C\u0430\u043D\u0438\u0435, \u0447\u0442\u043E \u044D\u0442\u043E \u043F\u0440\u0435\u0434\u043E\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\u0430\u043D\u0438\u0435 \u043F\u043E\u0434 Firefox.",
			"zh-CN": "\u663E\u793A\u539F\u751F\u89C6\u9891\u63A7\u4EF6\uFF08\u89C6\u9891\u63A7\u5236\u6309\u94AE\uFF09\u3002\u6CE8\u610F\uFF0C\u8FD9\u4F1A\u963B\u6B62\u5728 Firefox \u4E2D\u62D6\u62FD"
		},
		"Toggle video controls": {
			"pt-BR": "Alternar controles de v\u00EDdeo",
			"ru": "\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0430\u0442\u0435\u043B\u044C \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432 \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u0432\u0438\u0434\u0435\u043E",
			"zh-CN": "\u5207\u6362\u89C6\u9891\u63A7\u4EF6"
		},
		"Key to toggle whether the video controls are shown": {
			"pt-BR": "Tecla para alternar a exibi\u00E7\u00E3o dos controles de v\u00EDdeo",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u0434\u043B\u044F \u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432 \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u0432\u0438\u0434\u0435\u043E",
			"zh-CN": "\u5207\u6362\u662F\u5426\u663E\u793A\u89C6\u9891\u63A7\u4EF6\u7684\u6309\u952E"
		},
		"Loop": {
			"pt-BR": "Repetir",
			"ru": "\u0417\u0430\u0446\u0438\u043A\u043B\u0438\u0442\u044C",
			"zh-CN": "\u5FAA\u73AF"
		},
		"Allows the media to automatically restart to the beginning after finishing playing": {
			"pt-BR": "Permite que a m\u00EDdia seja reiniciada automaticamente ap\u00F3s o t\u00E9rmino da reprodu\u00E7\u00E3o",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u043C\u0435\u0434\u0438\u0430 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0443\u0441\u043A\u0430\u0442\u044C\u0441\u044F \u0432 \u043D\u0430\u0447\u0430\u043B\u043E \u043F\u043E\u0441\u043B\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0438\u044F \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u044F.",
			"zh-CN": "\u662F\u5426\u5141\u8BB8\u5A92\u4F53\u64AD\u653E\u5B8C\u6BD5\u540E\u81EA\u52A8\u91CD\u65B0\u5F00\u59CB\u64AD\u653E"
		},
		"Max duration for looping": {
			"pt-BR": "Dura\u00E7\u00E3o m\u00E1xima para repeti\u00E7\u00E3o",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C \u0437\u0430\u0446\u0438\u043A\u043B\u0438\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "\u5FAA\u73AF\u6700\u957F\u6301\u7EED\u65F6\u95F4"
		},
		"Media longer than the specified duration will not be automatically looped. Setting this to `0` will always enable looping, regardless of duration.": {
			"pt-BR": "M\u00EDdias com dura\u00E7\u00E3o maior que a especificada n\u00E3o ser\u00E3o repetidas automaticamente. Definir como `0` sempre habilitar\u00E1 a repeti\u00E7\u00E3o, independentemente da dura\u00E7\u00E3o.",
			"ru": "\u041C\u0435\u0434\u0438\u0430 \u0441 \u0434\u043E\u043B\u044C\u0448\u0435\u0439 \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u043E\u0439 \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C\u044E \u043D\u0435 \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u0437\u0430\u0446\u0438\u043A\u043B\u0435\u043D\u044B. \u0423\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430 \u044D\u0442\u043E\u0433\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u043D\u0430 `0` \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u043A\u043B\u044E\u0447\u0430\u0442\u044C \u0437\u0430\u0446\u0438\u043A\u043B\u0438\u0432\u0430\u043D\u0438\u0435, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u0438.",
			"zh-CN": "\u8D85\u8FC7\u6307\u5B9A\u65F6\u95F4\u540E\u5A92\u4F53\u4E0D\u518D\u81EA\u52A8\u5FAA\u73AF\u64AD\u653E\u3002\u8BBE\u4E3A 0 \u5219\u59CB\u7EC8\u5FAA\u73AF\uFF0C\u4E0D\u9650\u5236\u6301\u7EED\u65F6\u95F4\u3002"
		},
		"Play/pause key": {
			"pt-BR": "Tecla de reproduzir/pausar",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u044F/\u043F\u0440\u0438\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0438",
			"zh-CN": "\u64AD\u653E/\u6682\u505C\u952E"
		},
		"Key to toggle whether the media is playing or paused": {
			"pt-BR": "Tecla para alternar entre reproduzir e pausar a m\u00EDdia",
			"ru": "\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u044D\u0442\u043E\u0439 \u043A\u043D\u043E\u043F\u043A\u0438, \u0432\u044B \u0441\u043C\u043E\u0436\u0435\u0442\u0435 \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u044C \u0438\u043B\u0438 \u043F\u0440\u0438\u043E\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0442\u044C \u043C\u0435\u0434\u0438\u0430.",
			"zh-CN": "\u5207\u6362\u5A92\u4F53\u7684\u64AD\u653E/\u6682\u505C\u7684\u6309\u952E"
		},
		"Mute": {
			"pt-BR": "Silenciar",
			"ru": "\u041E\u0442\u043A\u043B\u044E\u0447\u0430\u0442\u044C \u0437\u0432\u0443\u043A",
			"zh-CN": "\u9759\u97F3"
		},
		"Mutes the media by default": {
			"pt-BR": "Silenciar a m\u00EDdia por padr\u00E3o",
			"ru": "\u041E\u0442\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0437\u0432\u0443\u043A \u043C\u0435\u0434\u0438\u0430 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E.",
			"zh-CN": "\u9ED8\u8BA4\u5C06\u5A92\u4F53\u9759\u97F3"
		},
		"Toggle mute key": {
			"pt-BR": "Tecla de alternar para mudo",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F \u0437\u0432\u0443\u043A\u0430",
			"zh-CN": "\u5207\u6362\u9759\u97F3\u952E"
		},
		"Key to toggle mute": {
			"pt-BR": "Tecla para alternar para mudo",
			"ru": "\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u044D\u0442\u043E\u0439 \u043A\u043D\u043E\u043F\u043A\u0438, \u0432\u044B \u0441\u043C\u043E\u0436\u0435\u0442\u0435 \u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0430\u0442\u044C \u0437\u0432\u0443\u043A.",
			"zh-CN": "\u5207\u6362\u9759\u97F3\u7684\u6309\u952E"
		},
		"Default volume": {
			"pt-BR": "Volume padr\u00E3o",
			"ru": "\u0413\u0440\u043E\u043C\u043A\u043E\u0441\u0442\u044C \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E",
			"zh-CN": "\u9ED8\u8BA4\u97F3\u91CF"
		},
		"Default volume for the media": {
			"pt-BR": "Volume padr\u00E3o para a m\u00EDdia",
			"ru": "\u0413\u0440\u043E\u043C\u043A\u043E\u0441\u0442\u044C \u0437\u0432\u0443\u043A\u0430 \u0434\u043B\u044F \u043C\u0435\u0434\u0438\u0430 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E.",
			"zh-CN": "\u5A92\u4F53\u7684\u9ED8\u8BA4\u97F3\u91CF"
		},
		"Volume up key": {
			"pt-BR": "Tecla de aumentar o volume",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u0438\u044F \u0433\u0440\u043E\u043C\u043A\u043E\u0441\u0442\u0438",
			"zh-CN": "\u97F3\u91CF\u8C03\u9AD8\u952E"
		},
		"Key to increase the volume": {
			"pt-BR": "Tecla para aumentar o volume",
			"ru": "\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u044D\u0442\u043E\u0439 \u043A\u043D\u043E\u043F\u043A\u0438, \u0432\u044B \u0441\u043C\u043E\u0436\u0435\u0442\u0435 \u0443\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C \u0433\u0440\u043E\u043C\u043A\u043E\u0441\u0442\u044C \u0437\u0432\u0443\u043A\u0430.",
			"zh-CN": "\u589E\u5927\u97F3\u91CF\u7684\u6309\u952E"
		},
		"Volume down key": {
			"pt-BR": "Tecla de diminuir o volume",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u0443\u043C\u0435\u043D\u044C\u0448\u0435\u043D\u0438\u044F \u0433\u0440\u043E\u043C\u043A\u043E\u0441\u0442\u0438",
			"zh-CN": "\u97F3\u91CF\u8C03\u4F4E\u952E"
		},
		"Key to decrease the volume": {
			"pt-BR": "Tecla para diminuir o volume",
			"ru": "\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u044D\u0442\u043E\u0439 \u043A\u043D\u043E\u043F\u043A\u0438, \u0432\u044B \u0441\u043C\u043E\u0436\u0435\u0442\u0435 \u0443\u043C\u0435\u043D\u044C\u0448\u0430\u0442\u044C \u0433\u0440\u043E\u043C\u043A\u043E\u0441\u0442\u044C \u0437\u0432\u0443\u043A\u0430.",
			"zh-CN": "\u51CF\u5C0F\u97F3\u91CF\u7684\u6309\u952E"
		},
		"Volume change amount": {
			"pt-BR": "Quantidade de altera\u00E7\u00E3o de volume",
			"ru": "\u0412\u0435\u043B\u0438\u0447\u0438\u043D\u0430 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0433\u0440\u043E\u043C\u043A\u043E\u0441\u0442\u0438",
			"zh-CN": "\u97F3\u91CF\u53D8\u5316\u767E\u5206\u6BD4"
		},
		"Percent for volume to increase/decrease when using the volume up/down keys": {
			"pt-BR": "Percentual para aumentar/diminuir o volume ao usar as teclas de aumentar/diminuir volume",
			"ru": "\u041F\u0440\u043E\u0446\u0435\u043D\u0442 \u0434\u043B\u044F \u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u0438\u044F/\u0443\u043C\u0435\u043D\u044C\u0448\u0435\u043D\u0438\u044F \u0433\u0440\u043E\u043C\u043A\u043E\u0441\u0442\u0438 \u043F\u0440\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0438 \u043A\u043D\u043E\u043F\u043E\u043A \u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u0438\u044F/\u0443\u043C\u0435\u043D\u044C\u0448\u0435\u043D\u0438\u044F \u0433\u0440\u043E\u043C\u043A\u043E\u0441\u0442\u0438.",
			"zh-CN": "\u4F7F\u7528\u97F3\u91CF\u8C03\u9AD8/\u8C03\u4F4E\u952E\u65F6\uFF0C\u97F3\u91CF\u589E\u51CF\u7684\u767E\u5206\u6BD4"
		},
		"Resume playback from source": {
			"pt-BR": "Retomar reprodu\u00E7\u00E3o do v\u00EDdeo original",
			"ru": "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0430\u0442\u044C \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u0438\u0437 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430",
			"zh-CN": "\u4ECE\u6E90\u5730\u5740\u7EE7\u7EED\u64AD\u653E"
		},
		"If enabled, playback will resume from where the source left off": {
			"pt-BR": "Se ativado, a reprodu\u00E7\u00E3o continuar\u00E1 de onde o v\u00EDdeo original parou",
			"ru": "\u0415\u0441\u043B\u0438 \u0432\u043A\u043B\u044E\u0447\u0435\u043D\u043E, \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043E\u0437\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0441 \u0442\u043E\u0433\u043E \u043C\u0435\u0441\u0442\u0430, \u043D\u0430 \u043A\u043E\u0442\u043E\u0440\u043E\u043C \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u043B\u0441\u044F \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A.",
			"zh-CN": "\u542F\u7528\u540E\uFF0C\u64AD\u653E\u5C06\u4ECE\u6E90\u5A92\u4F53\u4E2D\u505C\u6B62\u7684\u8FDB\u5EA6\u7EE7\u7EED"
		},
		"Resume if different length": {
			"pt-BR": "Retomar se a dura\u00E7\u00E3o for diferente",
			"ru": "\u0412\u043E\u0437\u043E\u0431\u043D\u043E\u0432\u043B\u044F\u0442\u044C, \u0435\u0441\u043B\u0438 \u0440\u0430\u0437\u043D\u0430\u044F \u0434\u043B\u0438\u043D\u0430",
			"zh-CN": "\u957F\u5EA6\u4E0D\u540C\u4E5F\u7EE7\u7EED\u64AD\u653E"
		},
		"If disabled, it will not resume if the source has a different length from the media in the popup (e.g. from a preview video to a full one)": {
			"pt-BR": "Se desativado, n\u00E3o retomar\u00E1 a reprodu\u00E7\u00E3o se o v\u00EDdeo original tiver uma dura\u00E7\u00E3o diferente da m\u00EDdia no pop-up (por exemplo, de um v\u00EDdeo de visualiza\u00E7\u00E3o para um v\u00EDdeo completo).",
			"ru": "\u0415\u0441\u043B\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043E, \u0442\u043E \u043D\u0435 \u0432\u043E\u0437\u043E\u0431\u043D\u043E\u0432\u043B\u044F\u0435\u0442, \u0435\u0441\u043B\u0438 \u0434\u043B\u0438\u043D\u0430 \u0438\u0437 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430 \u043E\u0442\u043B\u0438\u0447\u0430\u0435\u0442\u0441\u044F \u043E\u0442 \u0434\u043B\u0438\u043D\u044B \u043C\u0435\u0434\u0438\u0430 \u0432\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u043C \u043E\u043A\u043D\u0435 (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u0441 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u0432\u0438\u0434\u0435\u043E \u0434\u043E \u043F\u043E\u043B\u043D\u043E\u0433\u043E)",
			"zh-CN": "\u7981\u7528\u540E\uFF0C\u5982\u679C\u6E90\u5A92\u4F53\u4E0E\u5F39\u51FA\u7684\u5A92\u4F53\u7684\u65F6\u957F\u4E0D\u540C\uFF08\u4F8B\u5982\u9884\u89C8\u89C6\u9891\u4E0E\u5B8C\u6574\u89C6\u9891\u7684\u533A\u522B\uFF09\uFF0C\u5219\u4E0D\u7EE7\u7EED\u64AD\u653E"
		},
		"Pause source": {
			"pt-BR": "Pausar v\u00EDdeo original",
			"ru": "\u041F\u0440\u0438\u043E\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0442\u044C \u0438\u0437 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430",
			"zh-CN": "\u6682\u505C\u6E90\u5A92\u4F53"
		},
		"Pauses the source once the popup has opened": {
			"pt-BR": "Pausa o v\u00EDdeo original assim que o pop-up for aberto",
			"ru": "\u041F\u0440\u0438\u043E\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A \u043F\u043E\u0441\u043B\u0435 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u5F39\u7A97\u6253\u5F00\u540E\u6682\u505C\u6E90\u5A92\u4F53"
		},
		"Seek amount": {
			"pt-BR": "Quantidade de avan\u00E7o/retrocesso",
			"ru": "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0437\u0430\u043F\u0440\u043E\u0441\u043E\u0432",
			"zh-CN": "\u8FDB\u9000\u8DDD\u79BB"
		},
		"Amount of time to seek forward/back when using the seek keys": {
			"pt-BR": "Quantidade de tempo para avan\u00E7ar/retroceder ao usar as teclas de avan\u00E7o/retrocesso",
			"ru": "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u0434\u043B\u044F \u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0432\u043F\u0435\u0440\u0435\u0434/\u043D\u0430\u0437\u0430\u0434 \u043F\u0440\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0438 \u043A\u043D\u043E\u043F\u043E\u043A \u0437\u0430\u043F\u0440\u043E\u0441\u0430.",
			"zh-CN": "\u4F7F\u7528\u5FEB\u8FDB/\u5FEB\u9000\u6309\u952E\u65F6\u524D\u8FDB/\u540E\u9000\u7684\u65F6\u95F4\u91CF"
		},
		"Seek left key": {
			"pt-BR": "Tecla de retrocesso",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0432\u043B\u0435\u0432\u043E",
			"zh-CN": "\u5FEB\u9000\u952E"
		},
		"Key to seek backwards by the specified amount": {
			"pt-BR": "Tecla para retroceder a quantidade especificada",
			"ru": "\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u044D\u0442\u043E\u0439 \u043A\u043D\u043E\u043F\u043A\u0438, \u0432\u044B \u0441\u043C\u043E\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043B\u0430\u0442\u044C \u0437\u0430\u043F\u0440\u043E\u0441 \u043D\u0430\u0437\u0430\u0434 \u043E\u0442 \u0437\u0430\u0434\u0430\u043D\u043E\u0433\u043E \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430.",
			"zh-CN": "\u5411\u5DE6\u4FA7\uFF08\u4E4B\u524D\uFF09\u5FEB\u901F\u79FB\u52A8\u6307\u5B9A\u65F6\u957F\u7684\u6309\u952E"
		},
		"Seek right key": {
			"pt-BR": "Tecla de avan\u00E7o",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0432\u043F\u0440\u0430\u0432\u043E",
			"zh-CN": "\u5FEB\u8FDB\u952E"
		},
		"Key to seek forwards by the specified amount": {
			"pt-BR": "Tecla para avan\u00E7ar a quantidade especificada",
			"ru": "\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u044D\u0442\u043E\u0439 \u043A\u043D\u043E\u043F\u043A\u0438, \u0432\u044B \u0441\u043C\u043E\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043B\u0430\u0442\u044C \u0437\u0430\u043F\u0440\u043E\u0441 \u0432\u043F\u0435\u0440\u0451\u0434 \u043E\u0442 \u0437\u0430\u0434\u0430\u043D\u043E\u0433\u043E \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430.",
			"zh-CN": "\u5411\u53F3\u4FA7\uFF08\u4E4B\u540E\uFF09\u5FEB\u901F\u79FB\u52A8\u6307\u5B9A\u65F6\u957F\u7684\u6309\u952E"
		},
		"Previous frame key": {
			"pt-BR": "Tecla de voltar quadro",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0433\u043E \u043A\u0430\u0434\u0440\u0430",
			"zh-CN": "\u4E0A\u4E00\u5E27\u6309\u952E"
		},
		"Rewinds the video one \"frame\" backward. Due to current limitations, the frame size is static (but configurable), and might not match the video's framerate": {
			"pt-BR": "Retrocede o v\u00EDdeo um \"quadro\" para tr\u00E1s. Devido \u00E0s limita\u00E7\u00F5es atuais, o tamanho do quadro \u00E9 est\u00E1tico (mas configur\u00E1vel) e pode n\u00E3o corresponder \u00E0 taxa de quadros do v\u00EDdeo",
			"ru": "\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u044D\u0442\u043E\u0439 \u043A\u043D\u043E\u043F\u043A\u0438, \u0432\u044B \u0441\u043C\u043E\u0436\u0435\u0442\u0435 \u043F\u0435\u0440\u0435\u043C\u0430\u0442\u044B\u0432\u0430\u0442\u044C \u0432\u0438\u0434\u0435\u043E \u043D\u0430 \u043E\u0434\u0438\u043D \"\u043A\u0430\u0434\u0440\" \u043D\u0430\u0437\u0430\u0434. \u0412 \u0441\u0432\u044F\u0437\u0438 \u0441 \u0442\u0435\u043A\u0443\u0449\u0438\u043C\u0438 \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F\u043C\u0438, \u0440\u0430\u0437\u043C\u0435\u0440 \u043A\u0430\u0434\u0440\u0430 \u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0441\u0442\u0430\u0442\u0438\u0447\u043D\u044B\u043C (\u043D\u043E \u043D\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043C\u044B\u043C), \u0438 \u043C\u043E\u0436\u0435\u0442 \u043D\u0435 \u0441\u043E\u0432\u043F\u0430\u0434\u0430\u0442\u044C \u0441 \u0447\u0430\u0441\u0442\u043E\u0442\u043E\u0439 \u043A\u0430\u0434\u0440\u043E\u0432 \u0432\u0438\u0434\u0435\u043E.",
			"zh-CN": "\u5C06\u89C6\u9891\u5012\u56DE\u524D\u4E00\u5E27\u3002\u7531\u4E8E\u5F53\u524D\u7684\u9650\u5236\uFF0C\u5E27\u5927\u5C0F\u662F\u9759\u6001\u7684\uFF08\u4F46\u53EF\u914D\u7F6E\uFF09\uFF0C\u53EF\u80FD\u4E0E\u89C6\u9891\u7684\u5E27\u901F\u7387\u4E0D\u5339\u914D"
		},
		"Next frame key": {
			"pt-BR": "Tecla de avan\u00E7ar quadro",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E \u043A\u0430\u0434\u0440\u0430",
			"zh-CN": "\u4E0B\u4E00\u5E27\u6309\u952E"
		},
		"Advances the video one \"frame\" forward. Due to current limitations, the frame size is static (but configurable), and might not match the video's framerate": {
			"pt-BR": "Avan\u00E7a o v\u00EDdeo um \"quadro\" para frente. Devido \u00E0s limita\u00E7\u00F5es atuais, o tamanho do quadro \u00E9 est\u00E1tico (mas configur\u00E1vel) e pode n\u00E3o corresponder \u00E0 taxa de quadros do v\u00EDdeo",
			"ru": "\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u044D\u0442\u043E\u0439 \u043A\u043D\u043E\u043F\u043A\u0438, \u0432\u044B \u0441\u043C\u043E\u0436\u0435\u0442\u0435 \u043F\u0435\u0440\u0435\u043C\u0430\u0442\u044B\u0432\u0430\u0442\u044C \u0432\u0438\u0434\u0435\u043E \u043D\u0430 \u043E\u0434\u0438\u043D \"\u043A\u0430\u0434\u0440\" \u0432\u043F\u0435\u0440\u0451\u0434. \u0412 \u0441\u0432\u044F\u0437\u0438 \u0441 \u0442\u0435\u043A\u0443\u0449\u0438\u043C\u0438 \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F\u043C\u0438, \u0440\u0430\u0437\u043C\u0435\u0440 \u043A\u0430\u0434\u0440\u0430 \u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0441\u0442\u0430\u0442\u0438\u0447\u043D\u044B\u043C (\u043D\u043E \u043D\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043C\u044B\u043C), \u0438 \u043C\u043E\u0436\u0435\u0442 \u043D\u0435 \u0441\u043E\u0432\u043F\u0430\u0434\u0430\u0442\u044C \u0441 \u0447\u0430\u0441\u0442\u043E\u0442\u043E\u0439 \u043A\u0430\u0434\u0440\u043E\u0432 \u0432\u0438\u0434\u0435\u043E.",
			"zh-CN": "\u5C06\u89C6\u9891\u79FB\u5165\u4E0B\u4E00\u5E27\u3002\u7531\u4E8E\u5F53\u524D\u7684\u9650\u5236\uFF0C\u5E27\u5927\u5C0F\u662F\u9759\u6001\u7684\uFF08\u4F46\u53EF\u914D\u7F6E\uFF09\uFF0C\u53EF\u80FD\u4E0E\u89C6\u9891\u7684\u5E27\u901F\u7387\u4E0D\u5339\u914D"
		},
		"Frame rate": {
			"pt-BR": "Taxa de quadros",
			"ru": "\u0427\u0430\u0441\u0442\u043E\u0442\u0430 \u043A\u0430\u0434\u0440\u043E\u0432",
			"zh-CN": "\u5E27\u901F\u7387"
		},
		"Frame rate for videos to seek forward/back with the next/previous frame keys": {
			"pt-BR": "Taxa de quadros para v\u00EDdeos avan\u00E7arem/retrocederem com as teclas de pr\u00F3ximo/anterior quadro",
			"ru": "\u0427\u0430\u0441\u0442\u043E\u0442\u0430 \u043A\u0430\u0434\u0440\u043E\u0432 \u0432\u0438\u0434\u0435\u043E \u0434\u043B\u044F \u0437\u0430\u043F\u0440\u043E\u0441\u0430 \u0432\u043F\u0435\u0440\u0451\u0434/\u043D\u0430\u0437\u0430\u0434 \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u043A\u043D\u043E\u043F\u043E\u043A \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439/\u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u043A\u0430\u0434\u0440",
			"zh-CN": "\u5E27\u901F\u7387\u7528\u4E8E\u89C6\u9891\u7684\u5FEB\u8FDB/\u5FEB\u9000\u6309\u952E"
		},
		"FPS": {
			"pt-BR": "FPS (Quadros por Segundo)",
			"ru": "\u041A\u0430\u0434\u0440\u043E\u0432 \u0432 \u0441\u0435\u043A\u0443\u043D\u0434\u0443",
			"zh-CN": "\u6BCF\u79D2\u5E27\u6570\uFF08FPS\uFF09"
		},
		"Speed down key": {
			"pt-BR": "Tecla para diminuir a velocidade",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u0443\u043C\u0435\u043D\u044C\u0448\u0435\u043D\u0438\u044F \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u0438",
			"zh-CN": "\u51CF\u901F\u952E"
		},
		"Key to decrease playback rate by a specified amount": {
			"pt-BR": "Tecla para diminuir a taxa de reprodu\u00E7\u00E3o em uma quantidade especificada",
			"ru": "\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u044D\u0442\u043E\u0439 \u043A\u043D\u043E\u043F\u043A\u0438, \u0432\u044B \u0441\u043C\u043E\u0436\u0435\u0442\u0435 \u0443\u043C\u0435\u043D\u044C\u0448\u0438\u0442\u044C \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u044C \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u043D\u0430 \u0437\u0430\u0434\u0430\u043D\u043D\u0443\u044E \u0432\u0435\u043B\u0438\u0447\u0438\u043D\u0443.",
			"zh-CN": "\u6B64\u952E\u53EF\u4EE5\u5C06\u64AD\u653E\u901F\u7387\u964D\u4F4E\u6307\u5B9A\u7684\u989D\u5EA6"
		},
		"Speed up key": {
			"pt-BR": "Tecla para aumentar a velocidade",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u0438\u044F \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u0438",
			"zh-CN": "\u52A0\u901F\u952E"
		},
		"Key to increase playback rate by a specified amount": {
			"pt-BR": "Tecla para aumentar a taxa de reprodu\u00E7\u00E3o em uma quantidade especificada",
			"ru": "\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u044D\u0442\u043E\u0439 \u043A\u043D\u043E\u043F\u043A\u0438, \u0432\u044B \u0441\u043C\u043E\u0436\u0435\u0442\u0435 \u0443\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u044C \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u043D\u0430 \u0437\u0430\u0434\u0430\u043D\u043D\u0443\u044E \u0432\u0435\u043B\u0438\u0447\u0438\u043D\u0443.",
			"zh-CN": "\u6B64\u952E\u53EF\u4EE5\u5C06\u64AD\u653E\u901F\u7387\u63D0\u5347\u6307\u5B9A\u7684\u989D\u5EA6"
		},
		"Speed up/down amount": {
			"pt-BR": "Quantidade de aumento/diminui\u00E7\u00E3o de velocidade",
			"ru": "\u0412\u0435\u043B\u0438\u0447\u0438\u043D\u0430 \u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u0438\u044F/\u0443\u043C\u0435\u043D\u044C\u0448\u0435\u043D\u0438\u044F \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u0438",
			"zh-CN": "\u52A0\u901F/\u51CF\u901F\u91CF"
		},
		"How much to increase/decrease the playback rate": {
			"pt-BR": "Quanto aumentar/diminuir a taxa de reprodu\u00E7\u00E3o",
			"ru": "\u041D\u0430\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0443\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C/\u0443\u043C\u0435\u043D\u044C\u0448\u0438\u0442\u044C \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u044C \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u044F",
			"zh-CN": "\u589E\u52A0/\u51CF\u5C11\u7684\u64AD\u653E\u901F\u7387"
		},
		"Reset speed key": {
			"pt-BR": "Tecla para redefinir a velocidade",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u0441\u0431\u0440\u043E\u0441\u0430 \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u0438",
			"zh-CN": "\u91CD\u7F6E\u901F\u5EA6\u952E"
		},
		"Resets the playback rate to normal speed": {
			"pt-BR": "Redefine a taxa de reprodu\u00E7\u00E3o para a velocidade normal",
			"ru": "\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u044D\u0442\u043E\u0439 \u043A\u043D\u043E\u043F\u043A\u0438, \u0432\u044B \u0441\u043C\u043E\u0436\u0435\u0442\u0435 \u0441\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u044C \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0434\u043E \u043D\u043E\u0440\u043C\u0430\u043B\u044C\u043D\u043E\u0439 \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u0438",
			"zh-CN": "\u5C06\u64AD\u653E\u901F\u5EA6\u91CD\u7F6E\u4E3A\u6B63\u5E38\u901F\u5EA6"
		},
		"Screenshot key": {
			"pt-BR": "Tecla para captura de tela",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u0441\u043D\u0438\u043C\u043A\u0430 \u044D\u043A\u0440\u0430\u043D\u0430",
			"zh-CN": "\u5C4F\u5E55\u622A\u56FE\u952E"
		},
		"Screenshots the current frame in the video": {
			"pt-BR": "Captura o quadro atual do v\u00EDdeo",
			"ru": "\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u044D\u0442\u043E\u0439 \u043A\u043D\u043E\u043F\u043A\u0438, \u0432\u044B \u0441\u043C\u043E\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043B\u0430\u0442\u044C \u0441\u043D\u0438\u043C\u043E\u043A \u044D\u043A\u0440\u0430\u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u043A\u0430\u0434\u0440\u0430 \u043D\u0430 \u0432\u0438\u0434\u0435\u043E.",
			"zh-CN": "\u5BF9\u89C6\u9891\u4E2D\u7684\u5F53\u524D\u5E27\u622A\u56FE"
		},
		"Screenshot format": {
			"pt-BR": "Formato da captura de tela",
			"ru": "\u0424\u043E\u0440\u043C\u0430\u0442 \u0441\u043D\u0438\u043C\u043A\u0430 \u044D\u043A\u0440\u0430\u043D\u0430",
			"zh-CN": "\u622A\u56FE\u683C\u5F0F"
		},
		"File format to save the screenshot in": {
			"pt-BR": "Formato de arquivo para salvar a captura de tela",
			"ru": "\u0424\u043E\u0440\u043C\u0430\u0442 \u0444\u0430\u0439\u043B\u0430 \u0434\u043B\u044F \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F \u0441\u043D\u0438\u043C\u043A\u0430 \u044D\u043A\u0440\u0430\u043D\u0430",
			"zh-CN": "\u4FDD\u5B58\u622A\u56FE\u7684\u6587\u4EF6\u683C\u5F0F"
		},
		"PNG": {
			"pt-BR": "PNG",
			"ru": "PNG",
			"zh-CN": "PNG"
		},
		"JPG": {
			"pt-BR": "JPG",
			"ru": "JPG",
			"zh-CN": "JPG"
		},
		"Enable subtitles": {
			"pt-BR": "Ativar legendas"
		},
		"Enables subtitles to be overlayed on top of the video": {
			"pt-BR": "Permite que as legendas sejam sobrepostas ao v\u00EDdeo"
		},
		"Popup UI": {
			"es": "Interfaz del Popup",
			"ko": "\uD31D\uC5C5 UI",
			"pt-BR": "Interface de Pop-up",
			"ru": "\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u5F39\u7A97\u754C\u9762"
		},
		"Enables a UI on top of the popup": {
			"pt-BR": "Habilita uma interface na parte superior do pop-up",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432 \u0432\u0435\u0440\u0445\u043D\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430.",
			"zh-CN": "\u542F\u7528\u5F39\u7A97\u4E0A\u7684\u754C\u9762"
		},
		"UI Toggle key": {
			"pt-BR": "Tecla para alternar a interface",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u043E\u0433\u043E \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430",
			"zh-CN": "\u754C\u9762\u5207\u6362\u952E"
		},
		"Toggles the display of the UI": {
			"pt-BR": "Alterna a exibi\u00E7\u00E3o da interface",
			"ru": "\u0421 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u044D\u0442\u043E\u0439 \u043A\u043D\u043E\u043F\u0438, \u0432\u044B \u0441\u043C\u043E\u0436\u0435\u0442\u0435 \u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0430\u0442\u044C \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u043E\u0433\u043E \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.",
			"zh-CN": "\u5207\u6362\u754C\u9762\u7684\u663E\u793A\u65B9\u5F0F"
		},
		"Opacity": {
			"es": "Opacidad",
			"fr": "Opacit\u00E9",
			"ko": "\uBD88\uD22C\uBA85",
			"pt-BR": "Opacidade",
			"ru": "\u041D\u0435\u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0441\u0442\u044C",
			"zh-CN": "\u4E0D\u900F\u660E\u5EA6"
		},
		"Opacity of the UI on top of the popup": {
			"pt-BR": "Opacidade da interface sobre o pop-up",
			"ru": "\u041D\u0435\u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0441\u0442\u044C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u043E\u0433\u043E \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0432 \u0432\u0435\u0440\u0445\u043D\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430.",
			"zh-CN": "\u5F39\u7A97\u4E0A\u754C\u9762\u7684\u4E0D\u900F\u660E\u5EA6"
		},
		"Use safe glyphs": {
			"pt-BR": "Usar glifos seguros",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u044B\u0435 \u0433\u043B\u0438\u0444\u044B",
			"zh-CN": "\u4F7F\u7528\u5B89\u5168\u5B57\u5F62"
		},
		"Uses glyphs that are more likely to be available on all fonts. Enable this option if the following characters render as boxes: \uD83E\uDC47 \uD83E\uDC50 \uD83E\uDC52. The 'Noto Sans Symbols2' font contains these characters.": {
			"pt-BR": "Usa glifos que s\u00E3o mais propensos a estarem dispon\u00EDveis em todas as fontes. Habilite esta op\u00E7\u00E3o se os seguintes caracteres forem exibidos como caixas: \uD83E\uDC47 \uD83E\uDC50 \uD83E\uDC52. A fonte 'Noto Sans Symbols2' cont\u00E9m estes caracteres.",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u044E\u0442\u0441\u044F \u0433\u043B\u0438\u0444\u044B, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0441\u043A\u043E\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043E, \u0431\u0443\u0434\u0443\u0442 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B \u043D\u0430 \u0432\u0441\u0435\u0445 \u0448\u0440\u0438\u0444\u0442\u0430\u0445. \u0412\u043A\u043B\u044E\u0447\u0438\u0442\u0435 \u044D\u0442\u043E\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440, \u0435\u0441\u043B\u0438 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u044B \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u044E\u0442\u0441\u044F \u0432 \u0432\u0438\u0434\u0435 \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u043A\u043E\u0432: \uD83E\uDC47 \uD83E\uDC50 \uD83E\uDC52. \u0428\u0440\u0438\u0444\u0442 'Noto Sans Symbols2' \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u044D\u0442\u0438 \u0441\u0438\u043C\u0432\u043E\u043B\u044B.",
			"zh-CN": "\u4F7F\u7528\u66F4\u53EF\u80FD\u9002\u7528\u4E8E\u6240\u6709\u5B57\u4F53\u7684\u5B57\u5F62\u3002\u542F\u7528\u6B64\u9009\u9879\uFF0C\u5982\u679C\u4E0B\u5217\u5B57\u7B26\u5448\u73B0\u4E3A\u65B9\u6846\uFF1A\uD83E\uDC47 \uD83E\uDC50 \uD83E\uDC52\u3002\u201CNoto Sans symboss2\u201D\u5B57\u4F53\u5305\u542B\u8FD9\u4E9B\u5B57\u7B26\u3002"
		},
		"Media resolution": {
			"pt-BR": "Resolu\u00E7\u00E3o da m\u00EDdia",
			"ru": "\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435 \u043C\u0435\u0434\u0438\u0430",
			"zh-CN": "\u5A92\u4F53\u5206\u8FA8\u7387"
		},
		"Displays the original media dimensions on top of the UI.\nCSS ID: `#sizeinfo`": {
			"pt-BR": "Exibe as dimens\u00F5es originais da m\u00EDdia no topo da UI.\nID CSS: `#sizeinfo`",
			"ru": "\u041E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u044B\u0435 \u0440\u0430\u0437\u043C\u0435\u0440\u044B \u043C\u0435\u0434\u0438\u0430 \u0432 \u0432\u0435\u0440\u0445\u043D\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u043E\u0433\u043E \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.\nCSS ID: `#sizeinfo`",
			"zh-CN": "\u5728\u754C\u9762\u4E0A\u663E\u793A\u539F\u59CB\u5A92\u4F53\u5C3A\u5BF8\u3002\nCSS ID: `#sizeinfo`"
		},
		"Zoom percent": {
			"pt-BR": "Percentual de zoom",
			"ru": "\u041C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u0432 \u043F\u0440\u043E\u0446\u0435\u043D\u0442\u0430\u0445",
			"zh-CN": "\u7F29\u653E\u767E\u5206\u6BD4"
		},
		"Displays the current zoom level on top of the UI.\nCSS ID: `#sizeinfo`": {
			"pt-BR": "Exibe o n\u00EDvel de zoom atual no topo da UI.\nID CSS: `#sizeinfo`",
			"ru": "\u041E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0442\u0435\u043A\u0443\u0449\u0438\u0439 \u0443\u0440\u043E\u0432\u0435\u043D\u044C \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0432 \u0432\u0435\u0440\u0445\u043D\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.\nCSS ID: `#sizeinfo`",
			"zh-CN": "\u5728\u754C\u9762\u4E0A\u663E\u793A\u5F53\u524D\u7684\u7F29\u653E\u7EA7\u522B\u3002\nCSS ID: `#sizeinfo`"
		},
		"File size": {
			"pt-BR": "Tamanho do arquivo",
			"ru": "\u0420\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430",
			"zh-CN": "\u6587\u4EF6\u5927\u5C0F"
		},
		"Displays the media's file size on top of the UI. For the moment, this will not work with partially loaded media if 'Avoid HEAD request for partially loaded media' is enabled.\nCSS ID: `#sizeinfo`": {
			"pt-BR": "Exibe o tamanho do arquivo de m\u00EDdia no topo da UI. No momento, isso n\u00E3o funcionar\u00E1 com m\u00EDdia carregada parcialmente se 'Evitar solicita\u00E7\u00E3o HEAD para m\u00EDdia carregada parcialmente' estiver habilitado.\nID CSS: `#sizeinfo`",
			"ru": "\u041E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0440\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430 \u043C\u0435\u0434\u0438\u0430 \u0432 \u0432\u0435\u0440\u0445\u043D\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u041D\u0430 \u0434\u0430\u043D\u043D\u044B\u0439 \u043C\u043E\u043C\u0435\u043D\u0442 \u044D\u0442\u043E \u043D\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C \u0441 \u0447\u0430\u0441\u0442\u0438\u0447\u043D\u043E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u043C\u0438 \u043C\u0435\u0434\u0438\u0430, \u0435\u0441\u043B\u0438 \u0432\u043A\u043B\u044E\u0447\u0451\u043D \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 '\u0418\u0437\u0431\u0435\u0433\u0430\u0442\u044C \u0437\u0430\u043F\u0440\u043E\u0441\u0430 HEAD \u0434\u043B\u044F \u0447\u0430\u0441\u0442\u0438\u0447\u043D\u043E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0445 \u043C\u0435\u0434\u0438\u0430'.\nCSS ID: `#sizeinfo`",
			"zh-CN": "\u5728\u754C\u9762\u4E0A\u663E\u793A\u5A92\u4F53\u7684\u6587\u4EF6\u5927\u5C0F\u3002\u76EE\u524D\uFF0C\u5982\u679C\u542F\u7528\u4E86\u201C\u907F\u514D\u5BF9\u90E8\u5206\u52A0\u8F7D\u7684\u5A92\u4F53\u4F7F\u7528 HEAD \u8BF7\u6C42\u201D\uFF0C\u5219\u6B64\u9879\u65E0\u6548\u3002\nCSS ID: `#sizeinfo`"
		},
		"Gallery counter": {
			"es": "N\u00FAmero de im\u00E1genes a contar en la galer\u00EDa",
			"fr": "Nombre d'images dans la galerie",
			"ko": "\uAC24\uB7EC\uB9AC \uC774\uBBF8\uC9C0 \uC218",
			"pt-BR": "Contador da galeria",
			"ru": "\u0421\u0447\u0451\u0442\u0447\u0438\u043A \u0433\u0430\u043B\u0435\u0440\u0435\u0438",
			"zh-CN": "\u56FE\u5E93\u8BA1\u6570\u5668"
		},
		"Enables a gallery counter on top of the UI.\nCSS ID: `#gallerycounter`": {
			"pt-BR": "Habilita um contador da galeria no topo da UI.\nID CSS: `#gallerycounter`",
			"ru": "\u041E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0441\u0447\u0451\u0442\u0447\u0438\u043A \u0433\u0430\u043B\u0435\u0440\u0435\u0438 \u0432 \u0432\u0435\u0440\u0445\u043D\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u043E\u0433\u043E \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.\nCSS ID: `#gallerycounter`",
			"zh-CN": "\u542F\u7528\u754C\u9762\u4E0A\u7684\u56FE\u5E93\u8BA1\u6570\u5668\u3002\nCSS ID: `#gallerycounter`"
		},
		"Gallery counter max": {
			"es": "N\u00FAmero m\u00E1ximo de im\u00E1genes a contar para la galer\u00EDa",
			"fr": "Nombre max d'images a compter pour la galerie",
			"ko": "\uAC24\uB7EC\uB9AC \uC774\uBBF8\uC9C0 \uC218\uC758 \uCD5C\uB300\uAC12",
			"pt-BR": "M\u00E1ximo do contador da galeria",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0441\u0447\u0451\u0442\u0447\u0438\u043A \u0433\u0430\u043B\u0435\u0440\u0435\u0438",
			"zh-CN": "\u56FE\u5E93\u8BA1\u6570\u5668\u4E0A\u9650"
		},
		"Maximum amount of images to check in the counter (this can be slightly CPU-intensive)": {
			"pt-BR": "Quantidade m\u00E1xima de imagens a verificar no contador (isso pode exigir um pouco de CPU)",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439 \u0434\u043B\u044F \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u0432 \u0441\u0447\u0451\u0442\u0447\u0438\u043A\u0435 (\u044D\u0442\u043E \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0441\u043B\u0435\u0433\u043A\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043E\u0451\u043C\u043A\u0438\u043C \u0434\u043B\u044F \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u043E\u0440\u0430)",
			"zh-CN": "\u8BE5\u8BA1\u6570\u5668\u663E\u793A\u56FE\u50CF\u6570\u91CF\u4E0A\u9650\uFF08\u53EF\u80FD\u6D88\u8017\u8F83\u591A CPU \u8D44\u6E90\uFF09"
		},
		"Gallery buttons": {
			"pt-BR": "Bot\u00F5es da galeria",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0438 \u0433\u0430\u043B\u0435\u0440\u0435\u0438",
			"zh-CN": "\u56FE\u5E93\u6309\u94AE"
		},
		"Enables buttons to go left/right in the gallery.\nCSS IDs: `#galleryprevbtn`, `#gallerynextbtn`": {
			"pt-BR": "Habilita bot\u00F5es para ir \u00E0 esquerda/direita na galeria.\nIDs CSS: `#galleryprevbtn`, `#gallerynextbtn`",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043A\u043D\u043E\u043F\u043A\u0438 \u0432\u043B\u0435\u0432\u043E/\u0432\u043F\u0440\u0430\u0432\u043E \u0432 \u0433\u0430\u043B\u0435\u0440\u0435\u0435.\nCSS ID: `#galleryprevbtn`, `#gallerynextbtn`",
			"zh-CN": "\u542F\u7528\u5728\u56FE\u5E93\u4E2D\u5411\u5DE6/\u53F3\u79FB\u52A8\u7684\u6309\u94AE\u3002\nCSS IDs: `#galleryprevbtn`, `#gallerynextbtn`"
		},
		"Close Button": {
			"pt-BR": "Bot\u00E3o Fechar",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u0437\u0430\u043A\u0440\u044B\u0442\u0438\u044F",
			"zh-CN": "\u5173\u95ED\u6309\u94AE"
		},
		"Enables a button to close the popup.\nCSS ID: `#closebtn`": {
			"pt-BR": "Habilita um bot\u00E3o para fechar o popup.\nID CSS: `#closebtn`",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043A\u043D\u043E\u043F\u043A\u0443 \u0434\u043B\u044F \u0437\u0430\u043A\u0440\u044B\u0442\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430.\nCSS ID: `#closebtn`",
			"zh-CN": "\u542F\u7528\u5173\u95ED\u5F53\u524D\u5F39\u7A97\u7684\u6309\u94AE\u3002\nCSS ID: `#closebtn`"
		},
		"Options Button": {
			"es": "Bot\u00F3n de Opciones",
			"ko": "\uC124\uC815 \uB9C1\uD06C",
			"pt-BR": "Bot\u00E3o de Op\u00E7\u00F5es",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432",
			"zh-CN": "\u9009\u9879\u6309\u94AE"
		},
		"Enables a button to go to this page.\nCSS ID: `#optionsbtn`": {
			"pt-BR": "Habilita um bot\u00E3o para ir para esta p\u00E1gina.\nID CSS: `#optionsbtn`",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043A\u043D\u043E\u043F\u043A\u0443 \u0434\u043B\u044F \u043F\u0435\u0440\u0435\u0445\u043E\u0434\u0430 \u043D\u0430 \u044D\u0442\u0443 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443.\nCSS ID: `#optionsbtn`",
			"zh-CN": "\u542F\u7528\u8BBF\u95EE\u9009\u9879\u9875\u9762\uFF08\u672C\u9875\u9762\uFF09\u7684\u6309\u94AE\u3002\nCSS ID: `#optionsbtn`"
		},
		"Download Button": {
			"pt-BR": "Bot\u00E3o de Download",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "\u4E0B\u8F7D\u6309\u94AE"
		},
		"Enables a button to download the image.\nCSS ID: `#downloadbtn`": {
			"pt-BR": "Habilita um bot\u00E3o para baixar a imagem.\nID CSS: `#downloadbtn`",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043A\u043D\u043E\u043F\u043A\u0443 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F.\nCSS ID: `#downloadbtn`",
			"zh-CN": "\u542F\u7528\u4E0B\u8F7D\u8BE5\u56FE\u50CF\u7684\u6309\u94AE\u3002\nCSS ID: `#downloadbtn`"
		},
		"Rotation Buttons": {
			"pt-BR": "Bot\u00F5es de Rota\u00E7\u00E3o",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0438 \u0432\u0440\u0430\u0449\u0435\u043D\u0438\u044F",
			"zh-CN": "\u65CB\u8F6C\u6309\u94AE"
		},
		"Enables buttons on the UI to rotate the image by 90 degrees.\nCSS IDs: `#rotleftbtn`, `#rotrightbtn`": {
			"pt-BR": "Habilita bot\u00F5es na UI para girar a imagem em 90 graus.\nIDs CSS: `#rotleftbtn`, `#rotrightbtn`",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043A\u043D\u043E\u043F\u043A\u0438 \u043D\u0430 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u0434\u043B\u044F \u043F\u043E\u0432\u043E\u0440\u043E\u0442\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043D\u0430 90 \u0433\u0440\u0430\u0434\u0443\u0441\u043E\u0432.\nCSS ID: `#rotleftbtn`, `#rotrightbtn`",
			"zh-CN": "\u542F\u7528\u5728\u754C\u9762\u4E0A\u5C06\u56FE\u50CF\u65CB\u8F6C 90 \u5EA6\u7684\u6309\u94AE\u3002\nCSS IDs: `#rotleftbtn`, `#rotrightbtn`"
		},
		"Caption": {
			"pt-BR": "Legenda",
			"ru": "\u041F\u043E\u0434\u043F\u0438\u0441\u044C",
			"zh-CN": "\u6807\u9898"
		},
		"Shows the image's caption (if available) at the top.\nCSS ID: `#caption`": {
			"pt-BR": "Mostra a legenda da imagem (se dispon\u00EDvel) no topo.\nID CSS: `#caption`",
			"ru": "\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0435\u0442 \u0432\u0432\u0435\u0440\u0445\u0443 \u043F\u043E\u0434\u043F\u0438\u0441\u044C \u043A \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044E (\u0435\u0441\u043B\u0438 \u0435\u0441\u0442\u044C).\nCSS ID: `#caption`",
			"zh-CN": "\u5728\u9876\u7AEF\u663E\u793A\u56FE\u50CF\u7684\u6807\u9898\uFF08\u5982\u679C\u53EF\u7528\uFF09\u3002\nCSS ID: `#caption`"
		},
		"Wrap caption text": {
			"pt-BR": "Quebrar texto da legenda",
			"ru": "\u041E\u0431\u0435\u0440\u043D\u0443\u0442\u044C \u0442\u0435\u043A\u0441\u0442 \u043F\u043E\u0434\u043F\u0438\u0441\u0438",
			"zh-CN": "\u6807\u9898\u6587\u672C\u6362\u884C"
		},
		"Wraps the caption if it's too long": {
			"pt-BR": "Quebra a legenda se for muito longa",
			"ru": "\u0421\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0447\u0430\u0441\u0442\u044C \u043F\u043E\u0434\u043F\u0438\u0441\u0438, \u0435\u0441\u043B\u0438 \u043E\u043D\u0430 \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0434\u043B\u0438\u043D\u043D\u0430\u044F.",
			"zh-CN": "\u6807\u9898\u6587\u672C\u592A\u957F\u65F6\u81EA\u52A8\u6362\u884C"
		},
		"Link original page in caption": {
			"pt-BR": "Vincular p\u00E1gina original na legenda",
			"ru": "\u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u0443\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u0432 \u043F\u043E\u0434\u043F\u0438\u0441\u0438",
			"zh-CN": "\u6807\u9898\u94FE\u63A5\u539F\u59CB\u9875\u9762"
		},
		"Links the original page (if it exists) in the caption": {
			"pt-BR": "Vincula a p\u00E1gina original (se existir) na legenda",
			"ru": "\u0421\u0441\u044B\u043B\u043A\u0430 \u0432 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0435 \u043D\u0430 \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u0443\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 (\u0435\u0441\u043B\u0438 \u043E\u043D\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442).",
			"zh-CN": "\u5C06\u6807\u9898\u94FE\u63A5\u5230\u539F\u59CB\u9875\u9762\uFF08\u5982\u6709\uFF09"
		},
		"Underline links": {
			"pt-BR": "Sublinhar links",
			"ru": "\u041F\u043E\u0434\u0447\u0451\u0440\u043A\u0438\u0432\u0430\u043D\u0438\u0435 \u0441\u0441\u044B\u043B\u043E\u043A",
			"zh-CN": "\u94FE\u63A5\u4E0B\u5212\u7EBF"
		},
		"Adds an underline to links (such as the original page)": {
			"pt-BR": "Adiciona um sublinhado aos links (como o da p\u00E1gina original)",
			"ru": "\u0414\u043E\u0431\u0430\u0432\u043B\u044F\u0435\u0442 \u043F\u043E\u0434\u0447\u0435\u0440\u043A\u0438\u0432\u0430\u043D\u0438\u0435 \u043A \u0441\u0441\u044B\u043B\u043A\u0430\u043C (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430).",
			"zh-CN": "\u5411\u94FE\u63A5\uFF08\u5982\u539F\u59CB\u9875\u9762\uFF09\u6DFB\u52A0\u4E0B\u5212\u7EBF"
		},
		"Keep popup open until": {
			"es": "Mantener popup abierto hasta que",
			"ko": "\uD31D\uC5C5 \uB2EB\uC73C\uB824\uBA74",
			"pt-BR": "Manter pop-up aberto at\u00E9",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043E\u0442\u043A\u0440\u044B\u0442\u043E \u0434\u043E \u0442\u0435\u0445 \u043F\u043E\u0440, \u043F\u043E\u043A\u0430",
			"zh-CN": "\u4FDD\u6301\u5F39\u7A97\u5F00\u542F\u76F4\u5230"
		},
		"Closes the popup when the selected condition is met": {
			"ko": "\uC120\uD0DD\uD55C \uC870\uAC74\uC774 \uCDA9\uC871\uB418\uBA74 \uD31D\uC5C5 \uB2EB\uAE30",
			"pt-BR": "Fecha o pop-up quando a condi\u00E7\u00E3o selecionada for atendida",
			"ru": "\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u0440\u0438 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0438 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0443\u0441\u043B\u043E\u0432\u0438\u044F.",
			"zh-CN": "\u6EE1\u8DB3\u9009\u5B9A\u6761\u4EF6\u65F6\u5173\u95ED\u5F39\u7A97"
		},
		"Any trigger is released": {
			"es": "Cualquier acci\u00F3n se deja ir",
			"ko": "\uC5B4\uB5A4 \uB3D9\uC791\uC5D0\uB3C4 \uB2EB\uD798",
			"pt-BR": "Qualquer gatilho for liberado",
			"ru": "\u041B\u044E\u0431\u0430\u044F \u043A\u043D\u043E\u043F\u043A\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u043D\u0438\u044F \u043E\u0442\u043F\u0443\u0449\u0435\u043D\u0430",
			"zh-CN": "\u677E\u5F00\u4EFB\u4F55\u89E6\u53D1\u5668"
		},
		"All triggers are released": {
			"ko": "\uBAA8\uB4E0 \uB3D9\uC791\uC5D0\uC11C \uB2EB\uD798",
			"pt-BR": "Todos os gatilhos forem liberados",
			"ru": "\u0412\u0441\u0435 \u043A\u043D\u043E\u043F\u043A\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u043D\u0438\u044F \u043E\u0442\u043F\u0443\u0449\u0435\u043D\u044B",
			"zh-CN": "\u677E\u5F00\u5168\u90E8\u89E6\u53D1\u5668"
		},
		"ESC/Close is pressed": {
			"ko": "ESC/\uB2EB\uAE30 \uB204\uB974\uAE30",
			"pt-BR": "ESC/Fechar for pressionado",
			"ru": "\u041D\u0430\u0436\u0430\u0442\u043E ESC/\u0417\u0430\u043A\u0440\u044B\u0442\u044C",
			"zh-CN": "\u6309\u4E0B ESC/Close"
		},
		"Don't close until mouse leaves": {
			"ko": "\uB9C8\uC6B0\uC2A4\uAC00 \uB5A0\uB0A0 \uB54C\uAE4C\uC9C0 \uB2EB\uC9C0 \uB9C8\uC2ED\uC2DC\uC624.",
			"pt-BR": "N\u00E3o fechar at\u00E9 o mouse sair",
			"ru": "\u041D\u0435 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043F\u043E\u043A\u0430 \u043A\u0443\u0440\u0441\u043E\u0440 \u043C\u044B\u0448\u0438 \u043D\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443\u0431\u0440\u0430\u043D",
			"zh-CN": "\u9F20\u6807\u79FB\u5F00\u524D\u4E0D\u5173\u95ED"
		},
		"If true, this keeps the popup open even if all triggers are released if the mouse is still over the image": {
			"ko": "\uD65C\uC131\uD654 \uC2DC, \uB9C8\uC6B0\uC2A4\uAC00 \uC774\uBBF8\uC9C0 \uC704\uC5D0 \uC788\uB294 \uACBD\uC6B0 \uBAA8\uB4E0 \uB3D9\uC791\uC5D0\uC11C \uB2EB\uD798\uC744 \uC120\uD0DD\uD588\uB354\uB77C\uB3C4 \uD31D\uC5C5\uC774 \uACC4\uC18D \uC5F4\uB9B0 \uC0C1\uD0DC\uB85C \uC720\uC9C0\uB428",
			"pt-BR": "Se verdadeiro, mant\u00E9m o pop-up aberto mesmo que todos os gatilhos sejam liberados se o mouse ainda estiver sobre a imagem",
			"ru": "\u0415\u0441\u043B\u0438 true, \u0442\u043E\u0433\u0434\u0430 \u0435\u0441\u043B\u0438 \u043C\u044B\u0448\u044C \u0432\u0441\u0451 \u0435\u0449\u0435 \u043D\u0430\u0445\u043E\u0434\u0438\u0442\u0441\u044F \u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0438, \u0442\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C, \u0434\u0430\u0436\u0435 \u0435\u0441\u043B\u0438 \u0432\u0441\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u043D\u0438\u044F \u043E\u0442\u043F\u0443\u0449\u0435\u043D\u044B.",
			"zh-CN": "\u5982\u679C\u542F\u7528\uFF0C\u677E\u5F00\u6240\u6709\u89E6\u53D1\u5668\u540E\uFF0C\u5047\u5982\u9F20\u6807\u4ECD\u60AC\u505C\u5728\u56FE\u50CF\u4E0A\uFF0C\u5F39\u7A97\u4FDD\u6301\u5F00\u542F"
		},
		"Threshold to leave image": {
			"ko": "\uC774\uBBF8\uC9C0\uB97C \uB5A0\uB098\uAE30 \uC704\uD55C \uC784\uACC4\uAC12",
			"pt-BR": "Limite para sair da imagem",
			"ru": "\u041F\u043E\u0440\u043E\u0433 \u0434\u043B\u044F \u0432\u044B\u0445\u043E\u0434\u0430 \u0438\u0437 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F",
			"zh-CN": "\u79FB\u5F00\u56FE\u50CF\u7684\u95E8\u9650\u503C"
		},
		"How many pixels outside of the image before the cursor is considered to have left the image": {
			"ko": "\uCEE4\uC11C\uAC00 \uC774\uBBF8\uC9C0\uB97C \uB5A0\uB09C \uAC83\uC73C\uB85C \uD30C\uC545\uD560 \uC218 \uC788\uB294 \uC774\uBBF8\uC9C0 \uD53D\uC140 \uC218",
			"pt-BR": "Quantos pixels fora da imagem antes que o cursor seja considerado como tendo deixado a imagem",
			"ru": "\u0421\u043A\u043E\u043B\u044C\u043A\u043E \u043F\u0438\u043A\u0441\u0435\u043B\u0435\u0439 \u0437\u0430 \u043F\u0440\u0435\u0434\u0435\u043B\u0430\u043C\u0438 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043F\u0435\u0440\u0435\u0434 \u043A\u0443\u0440\u0441\u043E\u0440\u043E\u043C \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043F\u043E\u043A\u0438\u043D\u0443\u0432\u0448\u0438\u043C\u0438 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435.",
			"zh-CN": "\u9F20\u6807\u6307\u9488\u79BB\u5F00\u56FE\u50CF\u5916\u7F18\u591A\u5C11\u50CF\u7D20\u89C6\u4F5C\u79FB\u5F00\u56FE\u50CF"
		},
		"Leaving thumbnail cancels loading": {
			"ko": "\uBBF8\uB9AC\uBCF4\uAE30\uB97C \uB0A8\uAE30\uBA74 \uB85C\uB529\uC774 \uCDE8\uC18C\uB428",
			"pt-BR": "Sair da miniatura cancela o carregamento",
			"ru": "\u041E\u0442\u043C\u0435\u043D\u044F\u0442\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443, \u0435\u0441\u043B\u0438 \u043C\u0438\u043D\u0438\u0430\u0442\u044E\u0440\u0430 \u043F\u043E\u043A\u0438\u043D\u0443\u0442\u0430",
			"zh-CN": "\u79BB\u5F00\u7F29\u7565\u56FE\u5219\u53D6\u6D88\u52A0\u8F7D"
		},
		"Cancels the current popup loading when the cursor has left the thumbnail image": {
			"ko": "\uCEE4\uC11C\uAC00 \uCD95\uC18C \uC774\uBBF8\uC9C0\uC5D0\uC11C \uBC97\uC5B4\uB0A0 \uB54C \uD604\uC7AC \uD31D\uC5C5 \uB85C\uB529 \uCDE8\uC18C",
			"pt-BR": "Cancela o carregamento do pop-up atual quando o cursor sai da imagem em miniatura",
			"ru": "\u041E\u0442\u043C\u0435\u043D\u044F\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430, \u043A\u043E\u0433\u0434\u0430 \u043A\u0443\u0440\u0441\u043E\u0440 \u043F\u043E\u043A\u0438\u043D\u0443\u043B \u043C\u0438\u043D\u0438\u0430\u0442\u044E\u0440\u0443 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F.",
			"zh-CN": "\u9F20\u6807\u6307\u9488\u79BB\u5F00\u7F29\u7565\u56FE\u65F6\u53D6\u6D88\u5F53\u524D\u5F39\u7A97\u7684\u52A0\u8F7D"
		},
		"ESC cancels loading": {
			"ko": "ESC \uB85C\uB529 \uCDE8\uC18C",
			"pt-BR": "ESC cancela carregamento",
			"ru": "ESC \u043E\u0442\u043C\u0435\u043D\u044F\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443",
			"zh-CN": "ESC \u952E\u53D6\u6D88\u52A0\u8F7D"
		},
		"Cancels the current popup loading if ESC is pressed": {
			"ko": "ESC\uB97C \uB204\uB974\uBA74 \uD604\uC7AC \uD31D\uC5C5 \uB85C\uB529\uC774 \uCDE8\uC18C\uB428",
			"pt-BR": "Cancela o carregamento do pop-up atual se ESC for pressionado",
			"ru": "\u041E\u0442\u043C\u0435\u043D\u044F\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430 \u043F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u043A\u043D\u043E\u043A\u0438 ESC.",
			"zh-CN": "\u6309\u4E0B ESC \u952E\u65F6\u53D6\u6D88\u5F53\u524D\u5F39\u7A97\u7684\u52A0\u8F7D"
		},
		"Releasing triggers cancels loading": {
			"ko": "\uD2B8\uB9AC\uAC70\uB97C \uD574\uC81C\uD558\uBA74 \uB85C\uB529\uC774 \uCDE8\uC18C\uB428",
			"pt-BR": "Liberar gatilhos cancela carregamento",
			"ru": "\u041E\u0442\u043C\u0435\u043D\u044F\u0442\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443, \u0435\u0441\u043B\u0438 \u043A\u043D\u043E\u043F\u043A\u0438 \u0430\u043A\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u043E\u0442\u043F\u0443\u0449\u0435\u043D\u044B",
			"zh-CN": "\u677E\u5F00\u89E6\u53D1\u5668\u53D6\u6D88\u52A0\u8F7D"
		},
		"Cancels the current popup loading if all/any triggers are released (as set by the \"Keep popup open until\" setting)": {
			"ko": "\uC5B4\uB5A4/\uBAA8\uB4E0 \uB3D9\uC791\uC5D0 \uB2EB\uD798\uC744 \uC120\uD0DD\uD55C \uACBD\uC6B0 \uD604\uC7AC \uD31D\uC5C5 \uB85C\uB529 \uCDE8\uC18C (\"\uD31D\uC5C5\uC744 \uB2EB\uC73C\uB824\uBA74\" \uC124\uC815\uC5D0 \uC758\uC874\uD568)",
			"pt-BR": "Cancela o carregamento do popup atual se todos/quaisquer gatilhos forem liberados (conforme definido pela configura\u00E7\u00E3o \"Manter popup aberto at\u00E9\")",
			"ru": "\u041E\u0442\u043C\u0435\u043D\u044F\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430, \u0435\u0441\u043B\u0438 \u0432\u0441\u0435/\u043B\u044E\u0431\u044B\u0435 \u043A\u043D\u043E\u043F\u043A\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u043D\u0438\u044F \u043E\u0442\u043F\u0443\u0449\u0435\u043D\u044B (\u0432 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u043C\u0438 '\u041E\u0441\u0442\u0430\u0432\u043B\u044F\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C \u0434\u043E \u0442\u0435\u0445 \u043F\u043E\u0440, \u043F\u043E\u043A\u0430'",
			"zh-CN": "\u5982\u679C\u677E\u5F00\u4E86\u6240\u6709/\u4EFB\u4F55\u89E6\u53D1\u5668\uFF0C\u5E76\u4E14\u8BBE\u7F6E\u4E86\u201C\u4FDD\u6301\u5F39\u7A97\u5F00\u542F\u76F4\u5230\u201D\uFF0C\u53D6\u6D88\u5F53\u524D\u7684\u5F39\u7A97\u52A0\u8F7D"
		},
		"Automatically close after timeout": {
			"ko": "\uC2DC\uAC04 \uCD08\uACFC \uD6C4 \uC790\uB3D9\uC73C\uB85C \uB2EB\uAE30",
			"pt-BR": "Fechar automaticamente ap\u00F3s tempo limite",
			"ru": "\u0410\u0432\u0442\u043E\u0437\u0430\u043A\u0440\u044B\u0442\u0438\u0435 \u043F\u043E\u0441\u043B\u0435 \u0438\u0441\u0442\u0435\u0447\u0435\u043D\u0438\u044F \u0432\u0440\u0435\u043C\u0435\u043D\u0438",
			"zh-CN": "\u8D85\u65F6\u540E\u81EA\u52A8\u5173\u95ED"
		},
		"Closes the popup automatically after a specified period of time has elapsed": {
			"ko": "\uC9C0\uC815\uB41C \uC2DC\uAC04\uC774 \uACBD\uACFC\uD55C \uD6C4 \uD31D\uC5C5 \uC790\uB3D9 \uB2EB\uAE30",
			"pt-BR": "Fecha o pop-up automaticamente ap\u00F3s um per\u00EDodo de tempo especificado",
			"ru": "\u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u043E \u0438\u0441\u0442\u0435\u0447\u0435\u043D\u0438\u0438 \u0437\u0430\u0434\u0430\u043D\u043D\u043E\u0433\u043E \u043F\u0435\u0440\u0438\u043E\u0434\u0430 \u0432\u0440\u0435\u043C\u0435\u043D\u0438.",
			"zh-CN": "\u6307\u5B9A\u65F6\u95F4\u540E\u81EA\u52A8\u5173\u95ED\u5F39\u7A97"
		},
		"Timeout to close popup": {
			"ko": "\uD31D\uC5C5\uC744 \uB2EB\uAE30 \uC704\uD55C \uC2DC\uAC04 \uCD08\uACFC \uC2DC\uAC04(\uCD08)",
			"pt-BR": "Tempo limite para fechar o pop-up",
			"ru": "\u0412\u0440\u0435\u043C\u0435\u043D\u0438 \u0434\u043E \u0437\u0430\u043A\u0440\u044B\u0442\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u5173\u95ED\u5F39\u7A97\u7684\u8D85\u65F6"
		},
		"Amount of time to elapse before automatically closing the popup": {
			"ko": "\uD31D\uC5C5\uC744 \uC790\uB3D9\uC73C\uB85C \uB2EB\uAE30 \uC804 \uACBD\uACFC \uC2DC\uAC04",
			"pt-BR": "Tempo para fechar o pop-up automaticamente",
			"ru": "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0432\u0440\u0435\u043C\u0435\u043D\u0438, \u043A\u043E\u0442\u043E\u0440\u043E\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u043F\u0440\u043E\u0439\u0442\u0438 \u0434\u043E \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0433\u043E \u0437\u0430\u043A\u0440\u044B\u0442\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430.",
			"zh-CN": "\u591A\u4E45\u540E\u81EA\u52A8\u5173\u95ED\u5F39\u7A97"
		},
		"Hold key": {
			"ko": "\uACE0\uC815 \uD0A4",
			"pt-BR": "Tecla manter pressionado",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "\u4FDD\u6301\u952E"
		},
		"Hold key that, when pressed, will keep the popup open": {
			"ko": "\uACE0\uC815 \uD0A4\uB97C \uB204\uB974\uBA74 \uD31D\uC5C5\uC774 \uC5F4\uB9B0 \uC0C1\uD0DC\uB85C \uC720\uC9C0\uB428",
			"pt-BR": "Tecla que, quando pressionada, mant\u00E9m o pop-up aberto",
			"ru": "\u041A\u043D\u043E\u043F\u043A\u0430 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043D\u0438\u044F, \u043A\u043E\u0442\u043E\u0440\u0430\u044F \u043F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C.",
			"zh-CN": "\u6309\u4F4F\u6B64\u952E\u65F6\u5C06\u4FDD\u6301\u5F39\u7A97\u5F00\u542F"
		},
		"Center popup on hold": {
			"ko": "\uC911\uC559 \uD31D\uC5C5 \uACE0\uC815",
			"pt-BR": "Centralizar pop-up ao manter pressionado",
			"ru": "\u0426\u0435\u043D\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u0440\u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043D\u0438\u0438",
			"zh-CN": "\u4FDD\u6301\u65F6\u5F39\u7A97\u5C45\u4E2D"
		},
		"Centers the popup to the middle of the page when the popup is held": {
			"ko": "\uD31D\uC5C5\uC774 \uC5F4\uB9B4 \uB54C \uD31D\uC5C5\uC744 \uD398\uC774\uC9C0 \uC911\uC559\uC5D0 \uBC30\uCE58",
			"pt-BR": "Centraliza o pop-up no meio da p\u00E1gina quando ele for pressionado",
			"ru": "\u0426\u0435\u043D\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043D\u0430 \u0441\u0435\u0440\u0435\u0434\u0438\u043D\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B, \u043A\u043E\u0433\u0434\u0430 \u043E\u043D\u043E \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F.",
			"zh-CN": "\u5F39\u7A97\u4FDD\u6301\u5448\u73B0\u4E8E\u9875\u9762\u6B63\u4E2D\u5FC3"
		},
		"Override zoom on hold": {
			"pt-BR": "Substituir zoom ao pressionar",
			"ru": "\u041F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0442\u044C \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u043F\u0440\u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043D\u0438\u0438",
			"zh-CN": "\u4FDD\u6301\u65F6\u8986\u76D6\u7F29\u653E"
		},
		"Overrides the zoom when the popup is held": {
			"pt-BR": "Substitui o zoom quando o pop-up \u00E9 mantido pressionado",
			"ru": "\u041F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0435\u0442 \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u043F\u0440\u0438 \u0443\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u4FDD\u6301\u5F39\u7A97\u65F6\u8986\u76D6\u7F29\u653E\u7EA7\u522B"
		},
		"Close popup on unhold": {
			"ko": "\uACE0\uC815 \uD574\uC81C \uC2DC, \uD31D\uC5C5 \uB2EB\uAE30",
			"pt-BR": "Fechar pop-up ao liberar",
			"ru": "\u0417\u044B\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u043E\u0441\u043B\u0435 \u043E\u0442\u043F\u0443\u0441\u043A\u0430\u043D\u0438\u044F \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "\u53D6\u6D88\u4FDD\u6301\u65F6\u5173\u95ED\u5F39\u7A97"
		},
		"Closes the popup when the hold key is pressed again, after having previously held the popup": {
			"ko": "\uD31D\uC5C5\uC744 \uACE0\uC815\uD55C \uD6C4 \uACE0\uC815 \uD0A4\uB97C \uB2E4\uC2DC \uB204\uB974\uBA74 \uD31D\uC5C5\uC774 \uB2EB\uD798",
			"pt-BR": "Fecha o pop-up quando a tecla de manter pressionado \u00E9 usada novamente, ap\u00F3s ter precionado a tecla de pop-up anteriormente",
			"ru": "\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u0440\u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E\u043C \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u043A\u043B\u0430\u0432\u0438\u0448\u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u0441\u043B\u0435 \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0433\u043E \u0443\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430.",
			"zh-CN": "\u66FE\u7ECF\u4FDD\u6301\u5F39\u7A97\u540E\uFF0C\u518D\u6B21\u6309\u4E0B\u4FDD\u6301\u952E\u65F6\u5173\u95ED\u5F39\u7A97"
		},
		"Enable pointer events on hold": {
			"ko": "\uD3EC\uC778\uD130 \uC774\uBCA4\uD2B8 \uACE0\uC815 \uC0AC\uC6A9",
			"pt-BR": "Habilitar eventos do ponteiro ao sustentar",
			"ru": "\u0421\u043E\u0431\u044B\u0442\u0438\u044F \u0443\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044F \u043F\u0440\u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043D\u0438\u0438",
			"zh-CN": "\u4FDD\u6301\u671F\u95F4\u542F\u7528\u6307\u9488\u4E8B\u4EF6"
		},
		"Enables previously disabled pointer events when the popup is held": {
			"ko": "\uD31D\uC5C5\uC774 \uACE0\uC815\uB420 \uB54C \uC774\uC804\uC5D0 \uBE44\uD65C\uC131\uD654\uB41C \uD3EC\uC778\uD130 \uC774\uBCA4\uD2B8 \uD65C\uC131\uD654",
			"pt-BR": "Habilita eventos do ponteiro do mouse previamente desabilitados quando a tecla de pop-up \u00E9 pressionada",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0440\u0430\u043D\u0435\u0435 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u044B\u0435 \u0441\u043E\u0431\u044B\u0442\u0438\u044F \u0443\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044F \u043F\u0440\u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043D\u0438\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430.",
			"zh-CN": "\u5F39\u7A97\u4FDD\u6301\u671F\u95F4\u542F\u7528\u5148\u524D\u7981\u7528\u7684\u6307\u9488\u4E8B\u4EF6"
		},
		"Clicking outside the popup closes": {
			"ko": "\uD31D\uC5C5 \uBC14\uAE65\uCABD\uC744 \uD074\uB9AD\uD558\uBA74 \uB2EB\uD798",
			"pt-BR": "Clicar fora do pop-up fecha",
			"ru": "\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u0437\u0430 \u043F\u0440\u0435\u0434\u0435\u043B\u0430\u043C\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u70B9\u51FB\u5F39\u7A97\u5916\u5173\u95ED"
		},
		"Closes the popup when the mouse clicks outside of it": {
			"ko": "\uB9C8\uC6B0\uC2A4\uAC00 \uD31D\uC5C5 \uBC14\uAE65\uCABD\uC744 \uD074\uB9AD\uD560 \uB54C \uD31D\uC5C5 \uB2EB\uAE30",
			"pt-BR": "Fecha o pop-up quando o mouse clica fora dele",
			"ru": "\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u043C\u044B\u0448\u0438 \u0437\u0430 \u0435\u0433\u043E \u043F\u0440\u0435\u0434\u0435\u043B\u0430\u043C\u0438.",
			"zh-CN": "\u9F20\u6807\u5728\u5F39\u7A97\u5916\u5355\u51FB\u65F6\u5173\u95ED\u5F39\u7A97"
		},
		"Close when leaving": {
			"ko": "\uB5A0\uB0A0 \uB54C \uB2EB\uAE30",
			"pt-BR": "Fechar ao sair",
			"ru": "\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u0438 \u043F\u043E\u043A\u0438\u0434\u0430\u043D\u0438\u0438",
			"zh-CN": "\u79BB\u5F00\u65F6\u5173\u95ED"
		},
		"Closes the popup when the mouse leaves the thumbnail element, the popup, or both": {
			"pt-BR": "Fecha o pop-up quando o mouse sai do elemento da miniatura, do pop-up ou de ambos",
			"ru": "\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E, \u043A\u043E\u0433\u0434\u0430 \u043C\u044B\u0448\u044C \u043F\u043E\u043A\u0438\u0434\u0430\u0435\u0442 \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u043C\u0438\u043D\u0438\u0430\u0442\u044E\u0440\u044B, \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0438\u043B\u0438 \u0438 \u0442\u043E, \u0438 \u0434\u0440\u0443\u0433\u043E\u0435.",
			"zh-CN": "\u9F20\u6807\u79FB\u51FA\u7F29\u7565\u56FE\u5143\u7D20\u3001\u5F39\u7A97\u6216\u4E0A\u8FF0\u4E24\u8005\u65F6\u5173\u95ED\u5F39\u7A97"
		},
		"Thumbnail": {
			"ko": "\uBBF8\uB9AC\uBCF4\uAE30(\uC378\uB124\uC77C)",
			"pt-BR": "Miniatura",
			"ru": "\u041C\u0438\u043D\u0438\u0430\u0442\u044E\u0440\u044B",
			"zh-CN": "\u7F29\u7565\u56FE"
		},
		"Both": {
			"ko": "\uB458 \uB2E4",
			"pt-BR": "Ambos",
			"ru": "\u041E\u0431\u043E\u0438\u0445",
			"zh-CN": "\u4E0A\u8FF0\u4E24\u8005"
		},
		"Use invisible element when waiting": {
			"pt-BR": "Usar elemento invis\u00EDvel ao aguardar",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043D\u0435\u0432\u0438\u0434\u0438\u043C\u044B\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u043F\u0440\u0438 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0438",
			"zh-CN": "\u7B49\u5F85\u65F6\u4F7F\u7528\u9690\u5F62\u5143\u7D20"
		},
		"Creates an invisible element under the cursor when waiting for the popup instead of a style element (can improve performance on websites with many elements, but prevents the cursor from clicking anything while loading the popup)": {
			"pt-BR": "Cria um elemento invis\u00EDvel abaixo do cursor ao aguardar o pop-up em vez de um elemento de estilo (pode melhorar o desempenho em sites com muitos elementos, mas impede que o cursor clique em qualquer coisa durante o carregamento do pop-up)",
			"ru": "\u0421\u043E\u0437\u0434\u0430\u0451\u0442 \u043D\u0435\u0432\u0438\u0434\u0438\u043C\u044B\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u043F\u043E\u0434 \u043A\u0443\u0440\u0441\u043E\u0440\u043E\u043C \u043F\u0440\u0438 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430 \u0432\u043C\u0435\u0441\u0442\u043E \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430 \u0441\u0442\u0438\u043B\u044F (\u043C\u043E\u0436\u0435\u0442 \u0443\u043B\u0443\u0447\u0448\u0438\u0442\u044C \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C \u043D\u0430 \u0441\u0430\u0439\u0442\u0430\u0445 \u0441 \u0431\u043E\u043B\u044C\u0448\u0438\u043C \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E\u043C \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432, \u043D\u043E \u043D\u0435 \u043F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u043A\u0443\u0440\u0441\u043E\u0440\u0443 \u043D\u0430\u0436\u0438\u043C\u0430\u0442\u044C \u043D\u0430 \u0447\u0442\u043E-\u043B\u0438\u0431\u043E \u0432\u043E \u0432\u0440\u0435\u043C\u044F \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430).",
			"zh-CN": "\u5728\u7B49\u5F85\u5F39\u7A97\u65F6\u5728\u9F20\u6807\u6307\u9488\u4E0B\u65B9\u521B\u5EFA\u4E00\u4E2A\u9690\u5F62\u5143\u7D20\uFF08\u800C\u975E\u6837\u5F0F\u5143\u7D20\uFF09\uFF08\u53EF\u4EE5\u6539\u5584\u6709\u5927\u91CF\u5143\u7D20\u7684\u7F51\u7AD9\u6027\u80FD\uFF0C\u4F46\u8FD9\u4F1A\u963B\u6B62\u52A0\u8F7D\u671F\u95F4\u9F20\u6807\u70B9\u51FB\u4EFB\u4F55\u4E1C\u897F\uFF09"
		},
		"Add popup link to history": {
			"pt-BR": "Adicionar link do pop-up ao hist\u00F3rico",
			"ru": "\u0414\u043E\u0431\u0430\u0432\u043B\u044F\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0443\u044E \u0441\u0441\u044B\u043B\u043A\u0443 \u0432 \u0438\u0441\u0442\u043E\u0440\u0438\u044E",
			"zh-CN": "\u6DFB\u52A0\u5F39\u51FA\u7684\u94FE\u63A5\u5230\u5386\u53F2\u8BB0\u5F55"
		},
		"Adds the image/video link opened through the popup to the browser's history": {
			"pt-BR": "Adiciona o link da imagem/v\u00EDdeo aberto atrav\u00E9s do pop-up ao hist\u00F3rico do navegador",
			"ru": "\u0414\u043E\u0431\u0430\u0432\u043B\u044F\u0435\u0442 \u0441\u0441\u044B\u043B\u043A\u0443 \u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435/\u0432\u0438\u0434\u0435\u043E \u0432 \u0438\u0441\u0442\u043E\u0440\u0438\u044E \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435 \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E.",
			"zh-CN": "\u5C06\u901A\u8FC7\u5F39\u7A97\u6253\u5F00\u7684\u56FE\u50CF/\u89C6\u9891\u94FE\u63A5\u6DFB\u52A0\u5230\u6D4F\u89C8\u5668\u7684\u5386\u53F2\u8BB0\u5F55"
		},
		"Add thumbnail link to history": {
			"pt-BR": "Adicionar link da miniatura ao hist\u00F3rico"
		},
		"Adds the original media link opened through the popup to the browser's history": {
			"pt-BR": "Adiciona o link original da m\u00EDdia aberto atrav\u00E9s do pop-up ao hist\u00F3rico do navegador"
		},
		"Allow inter-frame communication": {
			"ko": "\uD504\uB808\uC784 \uAC04 \uD1B5\uC2E0 \uD5C8\uC6A9",
			"pt-BR": "Permitir comunica\u00E7\u00E3o entre frames",
			"ru": "\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u043C\u0435\u0436\u0444\u0440\u0435\u0439\u043C\u043E\u0432\u0443\u044E \u0441\u0432\u044F\u0437\u044C",
			"zh-CN": "\u5141\u8BB8\u6846\u67B6\u95F4\u901A\u4FE1"
		},
		"Allows communication between frames in windows, improving support for keybindings": {
			"ko": "\uCC3D\uC758 \uD504\uB808\uC784 \uAC04 \uD1B5\uC2E0\uC744 \uD5C8\uC6A9\uD558\uC5EC \uD0A4 \uBC14\uC778\uB529\uC5D0 \uB300\uD55C \uC9C0\uC6D0\uC744 \uAC1C\uC120\uD55C\uB2E4.",
			"pt-BR": "Permite a comunica\u00E7\u00E3o entre frames em janelas, melhorando o suporte para atalhos de teclado",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u043E\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043B\u044F\u0442\u044C \u0441\u0432\u044F\u0437\u044C \u043C\u0435\u0436\u0434\u0443 \u0444\u0440\u0435\u0439\u043C\u0430\u043C\u0438 \u0432 Windows, \u0443\u043B\u0443\u0447\u0448\u0430\u044F \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0443 \u043F\u0440\u0438\u0432\u044F\u0437\u043A\u0438 \u043A\u043B\u0430\u0432\u0438\u0448.",
			"zh-CN": "\u5141\u8BB8\u7A97\u53E3\u4E2D\u7684\u6846\u67B6\u95F4\u901A\u4FE1\uFF0C\u6539\u5584\u5BF9\u5FEB\u6377\u952E\u7ED1\u5B9A\u7684\u652F\u6301"
		},
		"Allows communication between frames in windows, improving support for keybindings. Can pose a fingerprinting risk when used through the userscript": {
			"ko": "\uCC3D\uC758 \uD504\uB808\uC784 \uAC04 \uD1B5\uC2E0\uC744 \uD5C8\uC6A9\uD558\uC5EC \uD0A4 \uBC14\uC778\uB529\uC5D0 \uB300\uD55C \uC9C0\uC6D0\uC744 \uAC1C\uC120\uD569\uB2C8\uB2E4. \uC720\uC800\uC2A4\uD06C\uB9BD\uD2B8\uB97C \uD1B5\uD574 \uC0AC\uC6A9 \uC2DC, \uBCF4\uC548\uC5D0 \uC704\uD611\uC774 \uC788\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4",
			"pt-BR": "Permite a comunica\u00E7\u00E3o entre frames em janelas, melhorando o suporte para atalhos de teclado. Pode representar um risco de fingerprinting quando usado atrav\u00E9s do userscript",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u043E\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043B\u044F\u0442\u044C \u0441\u0432\u044F\u0437\u044C \u043C\u0435\u0436\u0434\u0443 \u0444\u0440\u0435\u0439\u043C\u0430\u043C\u0438 \u0432 Windows, \u0443\u043B\u0443\u0447\u0448\u0430\u044F \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0443 \u043F\u0440\u0438\u0432\u044F\u0437\u043A\u0438 \u043A\u043B\u0430\u0432\u0438\u0448. \u041C\u043E\u0436\u0435\u0442 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u044F\u0442\u044C \u0440\u0438\u0441\u043A \u0441\u043D\u044F\u0442\u0438\u044F \u043E\u0442\u043F\u0435\u0447\u0430\u0442\u043A\u043E\u0432 \u043F\u0430\u043B\u044C\u0446\u0435\u0432 \u043F\u0440\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 \u0441\u043A\u0440\u0438\u043F\u0442.",
			"zh-CN": "\u5141\u8BB8\u7A97\u53E3\u4E2D\u7684\u6846\u67B6\u95F4\u901A\u4FE1\uFF0C\u6539\u5584\u5BF9\u5FEB\u6377\u952E\u7ED1\u5B9A\u7684\u652F\u6301\u3002\u901A\u8FC7\u7528\u6237\u811A\u672C\u4F7F\u7528\u65F6\uFF0C\u4E5F\u8BB8\u4F1A\u6784\u6210\u6307\u7EB9\u8BC6\u522B\u7684\u98CE\u9669"
		},
		"Pop out of frames": {
			"ko": "\uD504\uB808\uC784\uC5D0\uC11C \uD31D\uC5C5",
			"pt-BR": "Sair dos frames",
			"ru": "\u0412\u044B\u0441\u043A\u0430\u043A\u0438\u0432\u0430\u0442\u044C \u0437\u0430 \u0440\u0430\u043C\u043A\u0438",
			"zh-CN": "\u8DF3\u51FA\u6846\u67B6"
		},
		"Opens the popup on the top frame instead of within iframes. This option is still experimental.": {
			"pt-BR": "Abre o pop-up no frame superior em vez de dentro de iframes. Esta op\u00E7\u00E3o ainda \u00E9 experimental.",
			"ru": "\u041E\u0442\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u043E\u0432\u0435\u0440\u0445 \u0444\u0440\u0435\u0439\u043C\u0430, \u0430 \u043D\u0435 \u0432\u043D\u0443\u0442\u0440\u0438 iframes. \u042D\u0442\u043E\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0432\u0441\u0451 \u0435\u0449\u0451 \u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u044D\u043A\u0441\u043F\u0435\u0440\u0438\u043C\u0435\u043D\u0442\u0430\u043B\u044C\u043D\u044B\u043C.",
			"zh-CN": "\u5728\u6846\u67B6\u5916\u800C\u975E\u6846\u67B6\u5185\u6253\u5F00\u5F39\u7A97\u3002\u6B64\u9009\u9879\u4ECD\u5904\u4E8E\u8BD5\u9A8C\u9636\u6BB5\u3002"
		},
		"Popup default zoom": {
			"ko": "\uD655\uB300/\uCD95\uC18C \uAE30\uBCF8\uAC12",
			"pt-BR": "Zoom padr\u00E3o do pop-up",
			"ru": "\u041C\u0430\u0441\u0448\u0442\u0430\u0431 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u5F39\u7A97\u9ED8\u8BA4\u7F29\u653E\u7EA7\u522B"
		},
		"How the popup should be initially sized": {
			"ko": "\uD31D\uC5C5\uC758 \uCD08\uAE30 \uD06C\uAE30 \uC870\uC815 \uBC29\uBC95",
			"pt-BR": "Como deve ser o dimensionamento inicial do pop-up",
			"ru": "\u041A\u0430\u043A\u0438\u043C \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u043D\u0430\u0447\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430.",
			"zh-CN": "\u5F39\u7A97\u7684\u521D\u59CB\u5C3A\u5BF8"
		},
		"Fit to screen": {
			"fr": "Adapter a l'ecran",
			"ko": "\uD654\uBA74 \uD06C\uAE30\uC5D0 \uB9DE\uCDA4",
			"pt-BR": "Ajustar \u00E0 tela",
			"ru": "\u041F\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u0443 \u044D\u043A\u0440\u0430\u043D\u0430",
			"zh-CN": "\u9002\u5408\u5C4F\u5E55"
		},
		"Fill screen": {
			"ko": "\uD654\uBA74 \uCC44\uC6B0\uAE30",
			"pt-BR": "Preencher tela",
			"ru": "\u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u044D\u043A\u0440\u0430\u043D",
			"zh-CN": "\u586B\u6EE1\u5C4F\u5E55"
		},
		"Full size": {
			"fr": "Taille r\u00E9elle",
			"ko": "\uC804\uCCB4 \uD06C\uAE30",
			"pt-BR": "Tamanho original",
			"ru": "\u041F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440",
			"zh-CN": "\u5168\u5C3A\u5BF8"
		},
		"Custom size": {
			"ko": "\uB9DE\uCDA4 \uD06C\uAE30",
			"pt-BR": "Tamanho personalizado",
			"ru": "\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 \u0440\u0430\u0437\u043C\u0435\u0440",
			"zh-CN": "\u81EA\u5B9A\u4E49\u5C3A\u5BF8"
		},
		"Custom zoom percent": {
			"ko": "\uC0AC\uC6A9\uC790 \uC9C0\uC815 \uD655\uB300/\uCD95\uC18C \uBE44\uC728",
			"pt-BR": "Percentual de zoom personalizado",
			"ru": "\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 \u043F\u0440\u043E\u0446\u0435\u043D\u0442 \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "\u81EA\u5B9A\u4E49\u7F29\u653E\u767E\u5206\u6BD4"
		},
		"Custom percent to initially size the popup": {
			"ko": "\uD31D\uC5C5 \uC124\uC815 \uC2DC, \uCD08\uAE30 \uC0AC\uC6A9\uC790 \uC9C0\uC815 \uD655\uB300/\uCD95\uC18C \uBE44\uC728",
			"pt-BR": "Percentual personalizado para dimensionar o pop-up inicialmente",
			"ru": "\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 \u043F\u0440\u043E\u0446\u0435\u043D\u0442 \u0434\u043B\u044F \u043F\u0435\u0440\u0432\u043E\u043D\u0430\u0447\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u0430 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u04306",
			"zh-CN": "\u81EA\u5B9A\u4E49\u76F8\u5BF9\u4E8E\u521D\u59CB\u5F39\u7A97\u5927\u5C0F\u7684\u767E\u5206\u6BD4"
		},
		"%": {
			"pt-BR": "%",
			"ru": "%",
			"zh-CN": "%"
		},
		"Use last zoom": {
			"pt-BR": "Usar \u00FAltimo zoom",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0439 \u043C\u0430\u0441\u0448\u0442\u0430\u0431",
			"zh-CN": "\u4F7F\u7528\u6700\u540E\u7684\u7F29\u653E\u8BBE\u7F6E"
		},
		"Use the last popup's zoom. Note that this is per-page.": {
			"pt-BR": "Usar o zoom do \u00FAltimo pop-up. Observe que isso \u00E9 por p\u00E1gina.",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0433\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430. \u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043D\u0438\u043C\u0430\u043D\u0438\u0435, \u0447\u0442\u043E \u044D\u0442\u043E \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435.",
			"zh-CN": "\u4F7F\u7528\u6700\u540E\u4E00\u4E2A\u5F39\u7A97\u7684\u7F29\u653E\u7EA7\u522B\u3002\u6CE8\u610F\uFF0C\u6B64\u7EA7\u522B\u4E0D\u8DE8\u9875\u5171\u4EAB\u3002"
		},
		"Maximum width": {
			"ko": "\uCD5C\uB300 \uAC00\uB85C \uAE38\uC774",
			"pt-BR": "Largura m\u00E1xima",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0448\u0438\u0440\u0438\u043D\u0430",
			"zh-CN": "\u6700\u5927\u5BBD\u5EA6"
		},
		"Maximum width for the initial popup size. Set to `0` for unlimited.": {
			"ko": "\uCD08\uAE30 \uD31D\uC5C5 \uD06C\uAE30\uC758 \uCD5C\uB300 \uAC00\uB85C \uAE38\uC774. \uBB34\uC81C\uD55C\uC758 \uACBD\uC6B0 0\uC73C\uB85C \uC124\uC815\uD558\uC2ED\uC2DC\uC624.",
			"pt-BR": "Largura m\u00E1xima para o tamanho inicial do pop-up. Defina como `0` para ilimitado.",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0448\u0438\u0440\u0438\u043D\u0430 \u0434\u043B\u044F \u043D\u0430\u0447\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u0430 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430. `0` - \u043D\u0435\u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u043D\u0430\u044F \u0448\u0438\u0440\u0438\u043D\u0430.",
			"zh-CN": "\u521D\u59CB\u5F39\u7A97\u5C3A\u5BF8\u7684\u6700\u5927\u5BBD\u5EA6\u3002\u8BBE\u4E3A 0 \u5219\u65E0\u9650\u5236\u3002"
		},
		"Maximum height": {
			"ko": "\uCD5C\uB300 \uC138\uB85C \uAE38\uC774",
			"pt-BR": "Altura m\u00E1xima",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0432\u044B\u0441\u043E\u0442\u0430",
			"zh-CN": "\u6700\u5927\u9AD8\u5EA6"
		},
		"Maximum height for the initial popup size. Set to `0` for unlimited.": {
			"ko": "\uCD08\uAE30 \uD31D\uC5C5 \uD06C\uAE30\uC758 \uCD5C\uB300 \uC138\uB85C \uAE38\uC774. \uBB34\uC81C\uD55C\uC73C\uB85C '0'\uC73C\uB85C \uC124\uC815\uD55C\uB2E4.",
			"pt-BR": "Altura m\u00E1xima para o tamanho inicial do pop-up. Defina como `0` para ilimitado.",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0432\u044B\u0441\u043E\u0442\u0430 \u0434\u043B\u044F \u043D\u0430\u0447\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u0430 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430. `0` - \u043D\u0435\u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u043D\u0430\u044F \u0432\u044B\u0441\u043E\u0442\u0430.",
			"zh-CN": "\u521D\u59CB\u5F39\u7A97\u5C3A\u5BF8\u7684\u6700\u5927\u9AD8\u5EA6\u3002\u8BBE\u4E3A 0 \u5219\u65E0\u9650\u5236\u3002"
		},
		"Popup panning method": {
			"ko": "\uC774\uBBF8\uC9C0 \uC774\uB3D9\uD558\uB824\uBA74",
			"pt-BR": "M\u00E9todo de panor\u00E2mica do pop-up",
			"ru": "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u0430\u043D\u043E\u0440\u0430\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u5F39\u7A97\u5E73\u79FB\u65B9\u6CD5"
		},
		"How the popup should be panned when larger than the screen": {
			"pt-BR": "Como o pop-up deve ser deslocado quando maior que a tela",
			"ru": "\u041A\u0430\u043A \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043F\u0430\u043D\u043E\u0440\u0430\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u043E, \u043A\u043E\u0433\u0434\u0430 \u043E\u043D\u043E \u0431\u043E\u043B\u044C\u0448\u0435 \u044D\u043A\u0440\u0430\u043D\u0430.",
			"zh-CN": "\u5F39\u7A97\u6BD4\u5C4F\u5E55\u5927\u65F6\u5E94\u5982\u4F55\u5E73\u79FB"
		},
		"Movement": {
			"ko": "\uB9C8\uC6B0\uC2A4 \uC6C0\uC9C1\uC785\uB2C8\uB2E4",
			"pt-BR": "Movimento",
			"ru": "\u041F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u0435",
			"zh-CN": "\u79FB\u52A8"
		},
		"The popup pans as you move your mouse": {
			"pt-BR": "O pop-up se move conforme voc\u00EA move o mouse",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u0430\u043D\u043E\u0440\u0430\u043C\u0438\u0440\u0443\u0435\u0442\u0441\u044F \u043A\u043E\u0433\u0434\u0430 \u0432\u044B \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0430\u0435\u0442\u0435 \u043C\u044B\u0448\u044C.",
			"zh-CN": "\u79FB\u52A8\u9F20\u6807\u65F6\u5F39\u7A97\u5E73\u79FB"
		},
		"Drag": {
			"ko": "\uB055\uB2C8\uB2E4",
			"pt-BR": "Arrastar",
			"ru": "\u041F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\u0430\u043D\u0438\u0435",
			"zh-CN": "\u62D6\u62FD"
		},
		"Clicking and dragging pans the popup": {
			"pt-BR": "'Clicar e arrastar' move o pop-up",
			"ru": "\u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u043D\u0430\u0436\u0430\u0442\u044C \u0438 \u043F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\u0430\u0442\u044C \u043F\u0430\u043D\u0435\u043B\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430.",
			"zh-CN": "\u5355\u51FB\u5E76\u62D6\u62FD\u79FB\u52A8\u5F39\u7A97"
		},
		"Invert movement": {
			"pt-BR": "Inverter movimento",
			"ru": "\u0418\u043D\u0432\u0435\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u0435",
			"zh-CN": "\u53CD\u8F6C\u79FB\u52A8"
		},
		"Inverts the movement of the mouse. For example, if the mouse moves left, the popup moves right. If disabled, it feels more like the popup is being invisibly dragged.": {
			"pt-BR": "Inverte o movimento do mouse. Por exemplo, se o mouse se mover para a esquerda, o pop-up se move para a direita. Se desabilitado, parece que o pop-up est\u00E1 sendo arrastado de forma invis\u00EDvel.",
			"ru": "\u0418\u043D\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u043C\u044B\u0448\u044C\u044E. \u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u0435\u0441\u043B\u0438 \u043C\u044B\u0448\u044C \u0434\u0432\u0438\u0436\u0435\u0442\u0441\u044F \u0432\u043B\u0435\u0432\u043E, \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0430\u0435\u0442\u0441\u044F \u0432\u043F\u0440\u0430\u0432\u043E. \u0415\u0441\u043B\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043E, \u0442\u043E \u0431\u043E\u043B\u044C\u0448\u0435 \u043F\u043E\u0445\u043E\u0436\u0435 \u043D\u0430 \u0442\u043E, \u0447\u0442\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043D\u0435\u0432\u0438\u0434\u0438\u043C\u043E \u043F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\u0430\u0435\u0442\u0441\u044F.",
			"zh-CN": "\u53CD\u8F6C\u9F20\u6807\u7684\u79FB\u52A8\u3002\u4F8B\u5982\uFF0C\u5982\u679C\u9F20\u6807\u5411\u5DE6\u79FB\u52A8\uFF0C\u5F39\u7A97\u5411\u53F3\u79FB\u52A8\u3002\u5982\u679C\u7981\u7528\uFF0C\u611F\u89C9\u66F4\u50CF\u662F\u5F39\u51FA\u7A97\u53E3\u5728\u65E0\u5F62\u4E2D\u88AB\u62D6\u52A8\u3002"
		},
		"Minimum drag amount": {
			"pt-BR": "Quantidade m\u00EDnima a ser arrastada",
			"ru": "\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0434\u043B\u044F \u043F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "\u6700\u5C0F\u62D6\u62FD\u8D77\u59CB"
		},
		"How many pixels the mouse should move to start a drag": {
			"pt-BR": "Quantos pixels o mouse deve se mover para iniciar um arrasto",
			"ru": "\u041D\u0430 \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043F\u0438\u043A\u0441\u0435\u043B\u0435\u0439 \u043C\u044B\u0448\u044C \u0434\u043E\u043B\u0436\u043D\u0430 \u043F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C\u0441\u044F, \u0447\u0442\u043E\u0431\u044B \u043D\u0430\u0447\u0430\u0442\u044C \u043F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\u0430\u043D\u0438\u0435.",
			"zh-CN": "\u9F20\u6807\u79FB\u52A8\u591A\u5C11\u50CF\u7D20\u624D\u5F00\u59CB\u62D6\u62FD"
		},
		"Vertical scroll action": {
			"pt-BR": "A\u00E7\u00E3o de rolagem vertical",
			"ru": "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438",
			"zh-CN": "\u5782\u76F4\u6EDA\u52A8\u64CD\u4F5C"
		},
		"How the popup reacts to a vertical scroll/mouse wheel event": {
			"pt-BR": "Como o pop-up reage a um evento de rolagem vertical/roda do mouse",
			"ru": "\u041A\u0430\u043A \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043D\u0430 \u0441\u043E\u0431\u044B\u0442\u0438\u0435 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438/\u043A\u043E\u043B\u0435\u0441\u0430 \u043C\u044B\u0448\u0438.",
			"zh-CN": "\u5F39\u7A97\u5982\u4F55\u5BF9\u5782\u76F4\u6EDA\u52A8/\u9F20\u6807\u6EDA\u8F6E\u4E8B\u4EF6\u505A\u51FA\u53CD\u5E94"
		},
		"Vertical scroll action (hold)": {
			"pt-BR": "A\u00E7\u00E3o de rolagem vertical (pressionado)",
			"ru": "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043F\u0440\u0438 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0435 (\u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043D\u0438\u0435)",
			"zh-CN": "\u5782\u76F4\u6EDA\u52A8\u52A8\u4F5C(\u4FDD\u6301)"
		},
		"How the popup (when held) reacts to a vertical scroll/mouse wheel event": {
			"pt-BR": "Como o pop-up (quando pressionado) reage a um evento de rolagem vertical/roda do mouse",
			"ru": "\u041A\u0430\u043A \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E (\u043A\u043E\u0433\u0434\u0430 \u043E\u043D\u043E \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F) \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043D\u0430 \u0441\u043E\u0431\u044B\u0442\u0438\u0435 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438/\u043A\u043E\u043B\u0435\u0441\u0430 \u043C\u044B\u0448\u0438",
			"zh-CN": "\u201C\u4FDD\u6301\u201D\u663E\u793A\u7684\u5F39\u7A97\u5982\u4F55\u5BF9\u5782\u76F4\u6EDA\u52A8/\u9F20\u6807\u6EDA\u8F6E\u4E8B\u4EF6\u505A\u51FA\u53CD\u5E94"
		},
		"Zoom": {
			"ko": "\uC90C",
			"pt-BR": "Zoom",
			"ru": "\u041C\u0430\u0441\u0448\u0442\u0430\u0431",
			"zh-CN": "\u7F29\u653E"
		},
		"Horizontal scroll action": {
			"pt-BR": "A\u00E7\u00E3o de rolagem horizontal",
			"ru": "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438",
			"zh-CN": "\u6C34\u5E73\u6EDA\u52A8\u52A8\u4F5C"
		},
		"How the popup reacts to a horizontal scroll/mouse wheel event": {
			"pt-BR": "Como o pop-up reage a um evento de rolagem horizontal/roda do mouse",
			"ru": "\u041A\u0430\u043A \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043D\u0430 \u0441\u043E\u0431\u044B\u0442\u0438\u0435 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438/\u043A\u043E\u043B\u0435\u0441\u0430 \u043C\u044B\u0448\u0438.",
			"zh-CN": "\u5F39\u7A97\u5982\u4F55\u5BF9\u6C34\u5E73\u6EDA\u52A8/\u9F20\u6807\u6EDA\u8F6E\u4E8B\u4EF6\u505A\u51FA\u53CD\u5E94"
		},
		"Horizontal scroll action (hold)": {
			"pt-BR": "A\u00E7\u00E3o de rolagem horizontal (pressionado)",
			"ru": "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438 (\u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043D\u0438\u0435)",
			"zh-CN": "\u6C34\u5E73\u6EDA\u52A8\u52A8\u4F5C(\u4FDD\u6301)"
		},
		"How the popup (when held) reacts to a horizontal scroll/mouse wheel event": {
			"pt-BR": "Como o pop-up (quando pressionado) reage a um evento de rolagem horizontal/roda do mouse",
			"ru": "\u041A\u0430\u043A \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E (\u043A\u043E\u0433\u0434\u0430 \u043E\u043D\u043E \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F) \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043D\u0430 \u0441\u043E\u0431\u044B\u0442\u0438\u0435 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438/\u043A\u043E\u043B\u0435\u0441\u0430 \u043C\u044B\u0448\u0438",
			"zh-CN": "\u201C\u4FDD\u6301\u201D\u663E\u793A\u7684\u5F39\u7A97\u5982\u4F55\u5BF9\u6C34\u5E73\u6EDA\u52A8/\u9F20\u6807\u6EDA\u8F6E\u4E8B\u4EF6\u505A\u51FA\u53CD\u5E94"
		},
		"Pan": {
			"ko": "\uC774\uB3D9",
			"pt-BR": "Mover",
			"ru": "\u041F\u0430\u043D\u0435\u043B\u044C",
			"zh-CN": "\u5E73\u79FB"
		},
		"Gallery": {
			"pt-BR": "Galeria",
			"ru": "\u0413\u0430\u043B\u0435\u0440\u0435\u044F",
			"zh-CN": "\u56FE\u5E93"
		},
		"Vertical video scroll action": {
			"pt-BR": "A\u00E7\u00E3o de rolagem vertical do v\u00EDdeo",
			"ru": "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438 \u0432\u0438\u0434\u0435\u043E",
			"zh-CN": "\u5782\u76F4\u89C6\u9891\u6EDA\u52A8\u52A8\u4F5C"
		},
		"Overrides the vertical scroll action for videos. Set to `Default` to avoid overriding the behavior.": {
			"pt-BR": "Substitui a a\u00E7\u00E3o de rolagem vertical para v\u00EDdeos. Defina como `Padr\u00E3o` para evitar substituir o comportamento.",
			"ru": "\u041F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438 \u0434\u043B\u044F \u0432\u0438\u0434\u0435\u043E. \u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 `\u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E`, \u0447\u0442\u043E\u0431\u044B \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044C \u043F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u044F \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F.",
			"zh-CN": "\u8986\u76D6\u89C6\u9891\u7684\u5782\u76F4\u6EDA\u52A8\u52A8\u4F5C\u3002\u8BBE\u4E3A `\u9ED8\u8BA4` \u6765\u907F\u514D\u8986\u76D6\u8BE5\u884C\u4E3A\u3002"
		},
		"Invert vertical scroll seek": {
			"pt-BR": "Inverter busca de rolagem vertical",
			"ru": "\u0418\u043D\u0432\u0435\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0442\u0440\u0435\u043C\u043B\u0435\u043D\u0438\u0435 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438",
			"zh-CN": "\u53CD\u8F6C\u5782\u76F4\u6EDA\u52A8\u7684\u5FEB\u8FDB/\u5FEB\u9000"
		},
		"Inverts the seek direction when scrolling vertically: Scrolling up will seek right, scrolling down will seek left.": {
			"pt-BR": "Inverte a dire\u00E7\u00E3o da busca ao rolar verticalmente: Rolar para cima buscar\u00E1 para a direita, rolar para baixo buscar\u00E1 para a esquerda.",
			"ru": "\u0418\u043D\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0442\u0440\u0435\u043C\u043B\u0435\u043D\u0438\u044F \u043F\u0440\u0438 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0435: \u041F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0430 \u0432\u0432\u0435\u0440\u0445 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u0435\u043C\u0438\u0442\u044C\u0441\u044F \u0432\u043F\u0440\u0430\u0432\u043E, \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0430 \u0432\u043D\u0438\u0437 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u0435\u043C\u0438\u0442\u044C\u0441\u044F \u0432\u043B\u0435\u0432\u043E.",
			"zh-CN": "\u5728\u5782\u76F4\u6EDA\u52A8\u65F6\u53CD\u8F6C\u79FB\u52A8\u65B9\u5411\uFF1A\u5411\u4E0A\u6EDA\u52A8\u5C06\u5411\u53F3\u79FB\u52A8\uFF0C\u5411\u4E0B\u6EDA\u52A8\u5C06\u5411\u5DE6\u79FB\u52A8\u3002"
		},
		"Horizontal video scroll action": {
			"pt-BR": "A\u00E7\u00E3o de rolagem horizontal do v\u00EDdeo",
			"ru": "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438 \u0432\u0438\u0434\u0435\u043E",
			"zh-CN": "\u6C34\u5E73\u89C6\u9891\u6EDA\u52A8\u52A8\u4F5C"
		},
		"Overrides the horizontal scroll action for videos. Set to `Default` to avoid overriding the behavior.": {
			"pt-BR": "Substitui a a\u00E7\u00E3o de rolagem horizontal para v\u00EDdeos. Defina como `Padr\u00E3o` para evitar substituir o comportamento.",
			"ru": "\u041F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E\u0439 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438 \u0434\u043B\u044F \u0432\u0438\u0434\u0435\u043E. \u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 `\u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E`, \u0447\u0442\u043E\u0431\u044B \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044C \u043F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u044F \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F.",
			"zh-CN": "\u8986\u76D6\u89C6\u9891\u7684\u6C34\u5E73\u6EDA\u52A8\u52A8\u4F5C\u3002\u8BBE\u4E3A `\u9ED8\u8BA4` \u6765\u907F\u514D\u8986\u76D6\u8BE5\u884C\u4E3A\u3002"
		},
		"Default": {
			"pt-BR": "Padr\u00E3o",
			"ru": "\u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E",
			"zh-CN": "\u9ED8\u8BA4"
		},
		"Seek": {
			"pt-BR": "Buscar",
			"ru": "\u0421\u0442\u0440\u0435\u043C\u043B\u0435\u043D\u0438\u0435",
			"zh-CN": "\u5FEB\u8FDB/\u5FEB\u9000"
		},
		"None": {
			"ko": "\uC5C6\uB2E4",
			"pt-BR": "Nenhum",
			"ru": "\u041D\u0438\u0447\u0435\u0433\u043E",
			"zh-CN": "\u65E0"
		},
		"Override scroll outside of popup": {
			"pt-BR": "Substituir rolagem fora do pop-up",
			"ru": "\u041F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0438 \u0432\u043D\u0435 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u8986\u76D6\u5F39\u7A97\u5916\u7684\u6EDA\u52A8"
		},
		"Scrolling outside of the popup will also be overriden by the script": {
			"pt-BR": "A rolagem fora do pop-up tamb\u00E9m ser\u00E1 substitu\u00EDda pelo script",
			"ru": "\u041F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0430 \u0437\u0430 \u043F\u0440\u0435\u0434\u0435\u043B\u0430\u043C\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430 \u0442\u0430\u043A\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u043F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0430 \u0441\u043A\u0440\u0438\u043F\u0442\u043E\u043C.",
			"zh-CN": "\u540C\u65F6\u8986\u76D6\u5F39\u7A97\u5916\u7684\u6EDA\u52A8"
		},
		"Zoom origin": {
			"pt-BR": "Origem do zoom",
			"ru": "\u041D\u0430\u0447\u0430\u043B\u043E \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "\u7F29\u653E\u539F\u70B9"
		},
		"The point on the image it's zoomed in/out from": {
			"pt-BR": "O ponto da imagem a partir do qual \u00E9 ampliado/reduzido",
			"ru": "\u0422\u043E\u0447\u043A\u0430 \u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0438, \u043E\u0442 \u043A\u043E\u0442\u043E\u0440\u043E\u0439 \u043E\u043D\u043E \u0443\u0432\u0435\u043B\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044F/\u0443\u043C\u0435\u043D\u044C\u0448\u0430\u0435\u0442\u0441\u044F.",
			"zh-CN": "\u56FE\u50CF\u653E\u5927/\u7F29\u5C0F\u7684\u539F\u70B9"
		},
		"Cursor": {
			"ko": "\uCEE4\uC11C",
			"pt-BR": "Cursor",
			"ru": "\u041A\u0443\u0440\u0441\u043E\u0440",
			"zh-CN": "\u9F20\u6807\u6307\u9488"
		},
		"Center": {
			"pt-BR": "Centro",
			"ru": "\u0426\u0435\u043D\u0442\u0440",
			"zh-CN": "\u4E2D\u5FC3"
		},
		"Zoom out towards page middle": {
			"pt-BR": "Reduzir o zoom em dire\u00E7\u00E3o ao meio da p\u00E1gina",
			"ru": "\u0423\u043C\u0435\u043D\u044C\u0448\u0435\u043D\u0438\u0435 \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430 \u043A \u0441\u0435\u0440\u0435\u0434\u0438\u043D\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B",
			"zh-CN": "\u7F29\u5C0F\u5230\u9875\u9762\u4E2D\u95F4"
		},
		"Sets the origin when zooming out to the page middle, overriding the \"Zoom Origin\" option above.": {
			"pt-BR": "Define a origem ao diminuir o zoom para o meio da p\u00E1gina, substituindo a op\u00E7\u00E3o \"Origem do Zoom\" acima.",
			"ru": "\u0423\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442 \u043D\u0430\u0447\u0430\u043B\u043E \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442 \u043F\u0440\u0438 \u0443\u043C\u0435\u043D\u044C\u0448\u0435\u043D\u0438\u0438 \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430 \u0434\u043E \u0441\u0435\u0440\u0435\u0434\u0438\u043D\u044B \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B, \u043F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u044F \"\u041D\u0430\u0447\u0430\u043B\u043E \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F\" \u0432\u0430\u0440\u0438\u0430\u043D\u0442 \u0432\u044B\u0448\u0435.",
			"zh-CN": "\u8BBE\u7F6E\u7F29\u653E\u5230\u9875\u9762\u4E2D\u95F4\u65F6\u7684\u539F\u70B9\uFF0C\u91CD\u5199\u4E0A\u653E\u7684\u201C\u7F29\u653E\u539F\u70B9\u201D\u9009\u9879\u3002"
		},
		"Within viewport": {
			"pt-BR": "Dentro da \u00E1rea de visualiza\u00E7\u00E3o",
			"ru": "\u0412 \u043F\u0440\u0435\u0434\u0435\u043B\u0430\u0445 \u043E\u0431\u043B\u0430\u0441\u0442\u0438 \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430",
			"zh-CN": "\u5728\u89C6\u91CE\u5185"
		},
		"Zoom behavior": {
			"ko": "\uC90C \uB3D9\uC791",
			"pt-BR": "Comportamento do zoom",
			"ru": "\u041F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "\u7F29\u653E\u884C\u4E3A"
		},
		"How zooming should work": {
			"pt-BR": "Como o zoom deve funcionar",
			"ru": "\u041A\u0430\u043A \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435.",
			"zh-CN": "\u7F29\u653E\u5E94\u5982\u4F55\u5DE5\u4F5C"
		},
		"Fit/Full": {
			"ko": "\uD654\uBA74\uB9DE\uCDA4/\uC804\uCCB4",
			"pt-BR": "Ajustar/Original",
			"ru": "\u041F\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u0443/\u041F\u043E\u043B\u043D\u043E\u0435",
			"zh-CN": "\u9002\u5E94/\u5168\u5C3A\u5BF8"
		},
		"Toggles between the full size, and fit-to-screen": {
			"pt-BR": "Alterna entre o tamanho original e ajustar \u00E0 tela",
			"ru": "\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u043C\u0435\u0436\u0434\u0443 \u043F\u043E\u043B\u043D\u044B\u043C \u0440\u0430\u0437\u043C\u0435\u0440\u043E\u043C \u0438 \u043F\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u0443 \u044D\u043A\u0440\u0430\u043D\u0443.",
			"zh-CN": "\u5728\u5168\u5C3A\u5BF8\u548C\u9002\u5408\u5C4F\u5E55\u4E4B\u95F4\u5207\u6362"
		},
		"Incremental": {
			"fr": "Incr\u00E9mentale",
			"ko": "\uC99D\uBD84",
			"pt-BR": "Incremental",
			"ru": "\u041F\u043E\u0448\u0430\u0433\u043E\u0432\u043E\u0435",
			"zh-CN": "\u589E\u91CF"
		},
		"Incremental zoom multiplier": {
			"pt-BR": "Multiplicador de zoom incremental",
			"ru": "\u041C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u043F\u043E\u0448\u0430\u0433\u043E\u0432\u043E\u0433\u043E \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "\u589E\u91CF\u7F29\u653E\u7CFB\u6570"
		},
		"How much to zoom in/out by (for incremental zooming)": {
			"pt-BR": "Quanto aumentar/diminuir o zoom (para zoom incremental)",
			"ru": "\u041D\u0430 \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0443\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C/\u0443\u043C\u0435\u043D\u044C\u0448\u0438\u0442\u044C \u043C\u0430\u0441\u0448\u0442\u0430\u0431 (\u0434\u043B\u044F \u043F\u043E\u0448\u0430\u0433\u043E\u0432\u043E\u0433\u043E \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F).",
			"zh-CN": "\u589E\u91CF\u7F29\u653E\u65F6\u6BCF\u6B21\u653E\u5927/\u7F29\u5C0F\u591A\u5C11"
		},
		"x": {
			"pt-BR": "x",
			"ru": "x",
			"zh-CN": "\u500D"
		},
		"Move with cursor": {
			"pt-BR": "Mover com o cursor",
			"ru": "\u041F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u043A\u0443\u0440\u0441\u043E\u0440\u0430",
			"zh-CN": "\u968F\u9F20\u6807\u6307\u9488\u79FB\u52A8"
		},
		"Moves the popup as the cursor moves": {
			"pt-BR": "Move o pop-up conforme o movimento do cursor",
			"ru": "\u041F\u0435\u0440\u0435\u043C\u0435\u0449\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u043E \u043C\u0435\u0440\u0435 \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u044F \u043A\u0443\u0440\u0441\u043E\u0440\u0430.",
			"zh-CN": "\u9F20\u6807\u79FB\u52A8\u65F6\u79FB\u52A8\u5F39\u7A97"
		},
		"Move within page": {
			"pt-BR": "Mover dentro da p\u00E1gina",
			"ru": "\u041F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0432\u043D\u0443\u0442\u0440\u0438 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B",
			"zh-CN": "\u5728\u9875\u9762\u5185\u79FB\u52A8"
		},
		"Ensures the popup doesn't leave the page": {
			"pt-BR": "Garante que o pop-up n\u00E3o saia da p\u00E1gina",
			"ru": "\u0413\u0430\u0440\u0430\u043D\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043D\u0435 \u043F\u043E\u043A\u0438\u043D\u0435\u0442 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443.",
			"zh-CN": "\u786E\u4FDD\u5F39\u7A97\u4E0D\u4F1A\u79BB\u5F00\u9875\u9762"
		},
		"Zoom out fully to close": {
			"ko": "\uB2EB\uAE30 \uC704\uD574 \uC644\uC804\uD788 \uCD95\uC18C",
			"pt-BR": "Reduzir totalmente o zoom para fechar",
			"ru": "\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u0438 \u043F\u043E\u043B\u043D\u043E\u043C \u0443\u043C\u0435\u043D\u044C\u0448\u0435\u043D\u0438\u0438 \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430",
			"zh-CN": "\u5B8C\u5168\u7F29\u5C0F\u81F3\u5173\u95ED"
		},
		"Closes the popup if you zoom out past the minimum zoom": {
			"ko": "\uCD5C\uC18C \uD06C\uAE30\uB85C \uCD95\uC18C\uD560 \uACBD\uC6B0 \uD31D\uC5C5 \uB2EB\uAE30",
			"pt-BR": "Fecha o pop-up se voc\u00EA reduzir o zoom al\u00E9m do m\u00EDnimo",
			"ru": "\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E, \u0435\u0441\u043B\u0438 \u0432\u044B \u0443\u043C\u0435\u043D\u044C\u0448\u0430\u0435\u0442\u0435 \u043C\u0430\u0441\u0448\u0442\u0430\u0431, \u043F\u0440\u0435\u0432\u044B\u0448\u0430\u044E\u0449\u0438\u0439 \u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439.",
			"zh-CN": "\u7F29\u5C0F\u8D85\u8FC7\u6700\u5C0F\u7EA7\u522B\u65F6\u5173\u95ED\u5F39\u7A97"
		},
		"Scroll past gallery end to close": {
			"pt-BR": "Rolar al\u00E9m do final da galeria para fechar",
			"ru": "\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u0438 \u043F\u0440\u043E\u043A\u0440\u0443\u0447\u0438\u0432\u0430\u043D\u0438\u0438 \u0434\u043E \u043A\u043E\u043D\u0446\u0430 \u0433\u0430\u043B\u0435\u0440\u0435\u0438",
			"zh-CN": "\u6EDA\u52A8\u5230\u56FE\u5E93\u672B\u5C3E\u65F6\u5173\u95ED"
		},
		"Closes the popup if you scroll past the end of the gallery": {
			"pt-BR": "Fecha o pop-up se voc\u00EA rolar al\u00E9m do final da galeria",
			"ru": "\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E, \u0435\u0441\u043B\u0438 \u0432\u044B \u043F\u0440\u043E\u043A\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u0442\u0435 \u0435\u0433\u043E \u0434\u043E \u043A\u043E\u043D\u0446\u0430 \u0433\u0430\u043B\u0435\u0440\u0435\u0438.",
			"zh-CN": "\u6EDA\u52A8\u5230\u56FE\u5E93\u7684\u7ED3\u5C3E\u65F6\u5173\u95ED\u5F39\u7A97"
		},
		"Popup position": {
			"ko": "\uD31D\uC5C5 \uC704\uCE58",
			"pt-BR": "Posi\u00E7\u00E3o do pop-up",
			"ru": "\u041F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u5F39\u51FA\u4F4D\u7F6E"
		},
		"Where the popup will appear": {
			"ko": "\uD31D\uC5C5\uC774 \uD45C\uC2DC\uB418\uB294 \uC704\uCE58",
			"pt-BR": "Onde o pop-up aparecer\u00E1",
			"ru": "\u0413\u0434\u0435 \u043F\u043E\u044F\u0432\u0438\u0442\u0441\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E.",
			"zh-CN": "\u5F39\u7A97\u51FA\u73B0\u5728\u54EA\u91CC"
		},
		"Cursor middle": {
			"ko": "\uCEE4\uC11C \uC911\uAC04",
			"pt-BR": "Meio do cursor",
			"ru": "\u0421\u0435\u0440\u0435\u0434\u0438\u043D\u0430 \u043A\u0443\u0440\u0441\u043E\u0440\u0430",
			"zh-CN": "\u9F20\u6807\u6307\u9488\u4E3A\u4E2D\u5FC3"
		},
		"Underneath the mouse cursor": {
			"ko": "\uB9C8\uC6B0\uC2A4 \uCEE4\uC11C \uC544\uB798",
			"pt-BR": "Abaixo do cursor do mouse",
			"ru": "\u041F\u043E\u0434 \u043A\u0443\u0440\u0441\u043E\u0440\u043E\u043C",
			"zh-CN": "\u9F20\u6807\u6307\u9488\u4E0B\u65B9"
		},
		"Beside cursor": {
			"ko": "\uCEE4\uC11C \uC606",
			"pt-BR": "Ao lado do cursor",
			"ru": "\u0420\u044F\u0434\u043E\u043C \u0441 \u043A\u0443\u0440\u0441\u043E\u0440\u043E\u043C",
			"zh-CN": "\u9F20\u6807\u6307\u9488\u65C1"
		},
		"Page middle": {
			"ko": "\uD398\uC774\uC9C0 \uC911\uAC04",
			"pt-BR": "Meio da p\u00E1gina",
			"ru": "\u0421\u0435\u0440\u0435\u0434\u0438\u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B",
			"zh-CN": "\u9875\u9762\u4E2D\u95F4"
		},
		"Prevent cursor overlap": {
			"pt-BR": "Evitar sobreposi\u00E7\u00E3o do cursor",
			"ru": "\u041F\u0440\u0435\u0434\u043E\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044C \u043F\u0435\u0440\u0435\u043A\u0440\u044B\u0442\u0438\u0435 \u043A\u0443\u0440\u0441\u043E\u0440\u0430",
			"zh-CN": "\u907F\u514D\u6307\u9488\u91CD\u53E0"
		},
		"Prevents the image from overlapping with the cursor": {
			"pt-BR": "Impede que a imagem se sobreponha ao cursor",
			"ru": "\u041F\u0440\u0435\u0434\u043E\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043F\u0435\u0440\u0435\u043A\u0440\u044B\u0442\u0438\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0441 \u043A\u0443\u0440\u0441\u043E\u0440\u043E\u043C.",
			"zh-CN": "\u907F\u514D\u56FE\u50CF\u4E0E\u9F20\u6807\u6307\u9488\u91CD\u53E0"
		},
		"Center popup on overflow": {
			"pt-BR": "Centralizar pop-up em caso de transbordamento",
			"ru": "\u0426\u0435\u043D\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u0440\u0438 \u043F\u0435\u0440\u0435\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0438",
			"zh-CN": "\u6EA2\u51FA\u65F6\u5C06\u5F39\u7A97\u7F6E\u4E8E\u4E2D\u5FC3"
		},
		"Centers the popup if its initial size overflows": {
			"pt-BR": "Centraliza o pop-up se seu tamanho inicial transbordar",
			"ru": "\u0426\u0435\u043D\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E, \u0435\u0441\u043B\u0438 \u0435\u0433\u043E \u043D\u0430\u0447\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u043F\u0435\u0440\u0435\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F",
			"zh-CN": "\u5982\u679C\u521D\u59CB\u5927\u5C0F\u6EA2\u51FA\uFF0C\u5C06\u5F39\u7A97\u7F6E\u4E8E\u4E2D\u5FC3\u4F4D\u7F6E"
		},
		"Overflow origin": {
			"pt-BR": "Origem do transbordamento",
			"ru": "\u041D\u0430\u0447\u0430\u043B\u043E \u043F\u0435\u0440\u0435\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F",
			"zh-CN": "\u6EA2\u51FA\u539F\u70B9"
		},
		"Where the popup will appear in the page if its initial size overflows": {
			"pt-BR": "Onde o pop-up aparecer\u00E1 na p\u00E1gina se seu tamanho inicial transbordar",
			"ru": "\u0413\u0434\u0435 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u043E\u044F\u0432\u0438\u0442\u0441\u044F \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435, \u0435\u0441\u043B\u0438 \u0435\u0433\u043E \u043D\u0430\u0447\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u043F\u0435\u0440\u0435\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F",
			"zh-CN": "\u5982\u679C\u521D\u59CB\u5927\u5C0F\u6EA2\u51FA\uFF0C\u5F39\u7A97\u5C06\u51FA\u73B0\u5728\u9875\u9762\u7684\u54EA\u4E2A\u4F4D\u7F6E"
		},
		"Hide cursor over popup": {
			"pt-BR": "Ocultar cursor sobre o pop-up",
			"ru": "\u0421\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043A\u0443\u0440\u0441\u043E\u0440 \u043D\u0430 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u043C \u043E\u043A\u043D\u0435",
			"zh-CN": "\u5F39\u7A97\u4E0A\u9690\u85CF\u9F20\u6807\u6307\u9488"
		},
		"Hides the cursor when the mouse is over the popup": {
			"pt-BR": "Oculta o cursor quando o mouse est\u00E1 sobre o pop-up",
			"ru": "\u0421\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u043A\u0443\u0440\u0441\u043E\u0440, \u043A\u043E\u0433\u0434\u0430 \u043C\u044B\u0448\u044C \u043D\u0430\u0445\u043E\u0434\u0438\u0442\u0441\u044F \u043D\u0430 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u043C \u043E\u043A\u043D\u0435.",
			"zh-CN": "\u9F20\u6807\u5728\u5F39\u7A97\u4E0A\u60AC\u505C\u65F6\u9690\u85CF\u6307\u9488"
		},
		"Hide cursor after": {
			"pt-BR": "Ocultar cursor ap\u00F3s",
			"ru": "\u0421\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043A\u0443\u0440\u0441\u043E\u0440 \u043F\u043E\u0441\u043B\u0435",
			"zh-CN": "\u9690\u85CF\u6307\u9488\u5EF6\u8FDF"
		},
		"Hides the cursor over the popup after a specified period of time (in milliseconds), 0 always hides the cursor": {
			"pt-BR": "Oculta o cursor sobre o pop-up ap\u00F3s um per\u00EDodo de tempo especificado (em milissegundos), 0 sempre oculta o cursor",
			"ru": "\u0421\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u043A\u0443\u0440\u0441\u043E\u0440 \u0432\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u043C \u043E\u043A\u043D\u0435 \u043F\u043E\u0441\u043B\u0435 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u043E\u0433\u043E \u043F\u0435\u0440\u0438\u043E\u0434\u0430 \u0432\u0440\u0435\u043C\u0435\u043D\u0438 (\u0432 \u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430\u0445). `0` - \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043A\u0443\u0440\u0441\u043E\u0440.",
			"zh-CN": "\u9F20\u6807\u5728\u5F39\u7A97\u4E0A\u505C\u7559\u6307\u5B9A\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09\u540E\u9690\u85CF\u6307\u9488\uFF0C0 \u4E3A\u7ACB\u5373\u9690\u85CF"
		},
		"Mouse jitter threshold": {
			"pt-BR": "Limiar de oscila\u00E7\u00E3o do mouse",
			"ru": "\u041F\u043E\u0440\u043E\u0433 \u0434\u0440\u043E\u0436\u0430\u043D\u0438\u044F \u043C\u044B\u0448\u0438",
			"zh-CN": "\u9F20\u6807\u6296\u52A8\u9608\u503C"
		},
		"Threshold for mouse movement before the mouse cursor is shown again, 0 always shows the cursor after any movement": {
			"pt-BR": "Limiar para movimento do mouse antes que o cursor seja mostrado novamente, 0 sempre mostra o cursor ap\u00F3s qualquer movimento",
			"ru": "\u041F\u043E\u0440\u043E\u0433 \u0434\u043B\u044F \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u044F \u043C\u044B\u0448\u0438 \u0434\u043E \u0442\u043E\u0433\u043E, \u043A\u0430\u043A \u043A\u0443\u0440\u0441\u043E\u0440 \u043C\u044B\u0448\u0438 \u0431\u0443\u0434\u0435\u0442 \u043F\u043E\u043A\u0430\u0437\u0430\u043D \u0441\u043D\u043E\u0432\u0430. `0` - \u0432\u0441\u0435\u0433\u0434\u0430 \u043F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043A\u0443\u0440\u0441\u043E\u0440 \u043F\u043E\u0441\u043B\u0435 \u043B\u044E\u0431\u043E\u0433\u043E \u0434\u0432\u0438\u0436\u0435\u043D\u0438\u044F.",
			"zh-CN": "\u9F20\u6807\u6307\u9488\u518D\u6B21\u663E\u793A\u524D\u7684\u79FB\u52A8\u9608\u503C\uFF0C0 \u4E3A\u59CB\u7EC8\u663E\u793A\u79FB\u52A8\u540E\u7684\u6307\u9488"
		},
		"px": {
			"pt-BR": "px",
			"ru": "\u043F\u0438\u043A\u0441.",
			"zh-CN": "\u50CF\u7D20"
		},
		"Disable pointer events": {
			"pt-BR": "Desabilitar eventos do ponteiro",
			"ru": "\u041E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0441\u043E\u0431\u044B\u0442\u0438\u044F \u0443\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044F",
			"zh-CN": "\u7981\u7528\u6307\u9488\u4E8B\u4EF6"
		},
		"Enabling this option will allow you to click on links underneath the popup": {
			"pt-BR": "Habilitar esta op\u00E7\u00E3o permitir\u00E1 que voc\u00EA clique em links sob o pop-up",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u044D\u0442\u043E\u0433\u043E \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430 \u043F\u043E\u0437\u0432\u043E\u043B\u0438\u0442 \u0432\u0430\u043C \u043D\u0430\u0436\u0438\u043C\u0430\u0442\u044C \u043D\u0430 \u0441\u0441\u044B\u043B\u043A\u0438 \u043F\u043E\u0434 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0438\u043C \u043E\u043A\u043D\u043E\u043C.",
			"zh-CN": "\u542F\u7528\u6B64\u9009\u9879\u5C06\u5141\u8BB8\u60A8\u5355\u51FB\u5F39\u7A97\u4E0B\u65B9\u7684\u94FE\u63A5"
		},
		"Ignore clicks outside popup": {
			"pt-BR": "Ignorar cliques fora do pop-up",
			"ru": "\u0418\u0433\u043D\u043E\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u043B\u0438\u043A\u0438 \u0432\u043D\u0435 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u5FFD\u7565\u5F39\u7A97\u5916\u7684\u70B9\u51FB"
		},
		"Any mouse event outside the popup will be discarded with this option": {
			"pt-BR": "Qualquer evento de mouse fora do pop-up ser\u00E1 descartado com esta op\u00E7\u00E3o",
			"ru": "\u041B\u044E\u0431\u043E\u0435 \u0441\u043E\u0431\u044B\u0442\u0438\u0435 \u043C\u044B\u0448\u0438 \u0432\u043D\u0435 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430 \u0431\u0443\u0434\u0435\u0442 \u043E\u0442\u043C\u0435\u043D\u0435\u043D\u043E \u044D\u0442\u0438\u043C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u043C.",
			"zh-CN": "\u542F\u7528\u6B64\u9009\u9879\u540E\uFF0C\u4EFB\u4F55\u5F39\u7A97\u5916\u7684\u9F20\u6807\u4E8B\u4EF6\u90FD\u5C06\u4E22\u5F03"
		},
		"Enable downloading HLS/DASH streams": {
			"pt-BR": "Habilitar download de transmiss\u00F5es HLS/DASH",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0435 \u043F\u043E\u0442\u043E\u043A\u043E\u0432 HLS/DASH",
			"zh-CN": "\u542F\u7528 HLS/DASH \u6D41\u5A92\u4F53\u7684\u4E0B\u8F7D"
		},
		"Downloads and muxes the contents of the streams rather than the stream information file.\nThis currently does not work under modern browsers due to `SharedArrayBuffer` restrictions.": {
			"pt-BR": "Baixa e multiplexa o conte\u00FAdo dos streams em vez do arquivo de informa\u00E7\u00F5es do stream.\nAtualmente, isso n\u00E3o funciona em navegadores modernos devido a restri\u00E7\u00F5es do `SharedArrayBuffer`."
		},
		"Prefer MP4 over MKV": {
			"pt-BR": "Preferir MP4 em vez de MKV",
			"ru": "\u041F\u0440\u0435\u0434\u043F\u043E\u0447\u0438\u0442\u0430\u0442\u044C MP4, \u0430 \u043D\u0435 MKV",
			"zh-CN": "\u504F\u597D MP4 \u4EE3\u66FF MKV"
		},
		"Tries to mux the video into mp4 instead of mkv when required. This may slightly slow down muxing as it currently needs to try muxing both.": {
			"pt-BR": "Tenta multiplexar o v\u00EDdeo em mp4 em vez de mkv quando necess\u00E1rio. Isso pode diminuir um pouco a multiplexa\u00E7\u00E3o, pois atualmente precisa tentar multiplexar ambos.",
			"ru": "\u041F\u044B\u0442\u0430\u0435\u0442\u0441\u044F \u043C\u0443\u043B\u044C\u0442\u0438\u043F\u043B\u0435\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0438\u0434\u0435\u043E \u0432 mp4 \u0432\u043C\u0435\u0441\u0442\u043E mkv, \u043A\u043E\u0433\u0434\u0430 \u044D\u0442\u043E \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F. \u042D\u0442\u043E \u043C\u043E\u0436\u0435\u0442 \u0441\u043B\u0435\u0433\u043A\u0430 \u0437\u0430\u043C\u0435\u0434\u043B\u0438\u0442\u044C \u043F\u0440\u043E\u0446\u0435\u0441\u0441 \u043C\u0443\u043B\u044C\u0442\u0438\u043F\u043B\u0435\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F, \u0442\u0430\u043A \u043A\u0430\u043A \u0432 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0435 \u0432\u0440\u0435\u043C\u044F \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u043F\u043E\u043F\u0440\u043E\u0431\u043E\u0432\u0430\u0442\u044C \u043C\u0443\u043B\u044C\u0442\u0438\u043F\u043B\u0435\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0438 \u0442\u043E, \u0438 \u0434\u0440\u0443\u0433\u043E\u0435.",
			"zh-CN": "\u8BF7\u6C42\u65F6\u5C1D\u8BD5\u7528 mp4 \u4EE3\u66FF mkv\u3002\u8FD9\u53EF\u80FD\u7A0D\u5FAE\u964D\u4F4E\u7EC4\u5408\u5185\u5BB9\u7684\u901F\u5EA6\uFF0C\u56E0\u4E3A\u76EE\u524D\u9700\u8981\u5C1D\u8BD5\u4E24\u7EC4\u64CD\u4F5C\u3002"
		},
		"Link image": {
			"pt-BR": "Vincular imagem",
			"ru": "\u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F",
			"zh-CN": "\u94FE\u63A5\u56FE\u50CF"
		},
		"Adds a link to the image in the popup": {
			"pt-BR": "Adiciona um link para a imagem no pop-up",
			"ru": "\u0414\u043E\u0431\u0430\u0432\u043B\u044F\u0435\u0442 \u0441\u0441\u044B\u043B\u043A\u0443 \u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0432\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u043C \u043E\u043A\u043D\u0435.",
			"zh-CN": "\u5728\u5F39\u7A97\u7684\u56FE\u50CF\u4E2D\u6DFB\u52A0\u94FE\u63A5"
		},
		"Link video": {
			"pt-BR": "Vincular v\u00EDdeo",
			"ru": "\u0421\u0441\u044B\u043B\u043A\u0430 \u043D\u0430 \u0432\u0438\u0434\u0435\u043E",
			"zh-CN": "\u94FE\u63A5\u89C6\u9891"
		},
		"Adds a link to the video in the popup": {
			"pt-BR": "Adiciona um link para o v\u00EDdeo no pop-up",
			"ru": "\u0414\u043E\u0431\u0430\u0432\u043B\u044F\u0435\u0442 \u0441\u0441\u044B\u043B\u043A\u0443 \u043D\u0430 \u0432\u0438\u0434\u0435\u043E \u0432\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u043C \u043E\u043A\u043D\u0435.",
			"zh-CN": "\u5728\u5F39\u7A97\u7684\u89C6\u9891\u4E2D\u6DFB\u52A0\u94FE\u63A5"
		},
		"Clicking image closes": {
			"pt-BR": "Fecha a imagem ao clicar",
			"ru": "\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043F\u043E \u043D\u0430\u0436\u0430\u0442\u0438\u044E \u043D\u0430 \u043D\u0435\u0433\u043E",
			"zh-CN": "\u70B9\u51FB\u56FE\u7247\u5173\u95ED"
		},
		"Clicking the popup image closes the popup": {
			"pt-BR": "Fecha o pop-up ao clicar na imagem",
			"ru": "\u041D\u0430\u0436\u0430\u0442\u0438\u0435 \u043D\u0430 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E.",
			"zh-CN": "\u5355\u51FB\u5F39\u51FA\u56FE\u50CF\u5C06\u5173\u95ED\u5F39\u7A97"
		},
		"Clicking video closes": {
			"pt-BR": "Fecha o v\u00EDdeo ao clicar",
			"ru": "\u0417\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0432\u0438\u0434\u0435\u043E \u043F\u043E \u043D\u0430\u0436\u0430\u0442\u0438\u044E \u043D\u0430 \u043D\u0435\u0433\u043E",
			"zh-CN": "\u70B9\u51FB\u89C6\u9891\u5173\u95ED"
		},
		"Clicking the popup video closes the popup": {
			"pt-BR": "Fecha o pop-up ao clicar no v\u00EDdeo",
			"ru": "\u041D\u0430\u0436\u0430\u0442\u0438\u0435 \u043D\u0430 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u0432\u0438\u0434\u0435\u043E \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E.",
			"zh-CN": "\u70B9\u51FB\u5F39\u51FA\u7684\u89C6\u9891\u65F6\u5173\u95ED\u5F39\u7A97"
		},
		"Clicking link downloads": {
			"pt-BR": "Clicar no link faz o download",
			"ru": "\u041D\u0430\u0436\u0430\u0442\u0438\u0435 \u043D\u0430 \u0441\u0441\u044B\u043B\u043A\u0443 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "\u70B9\u51FB\u94FE\u63A5\u4E0B\u8F7D"
		},
		"Instead of opening the link in a new tab, it will download the image/video instead": {
			"pt-BR": "Em vez de abrir o link em uma nova guia, ele far\u00E1 o download da imagem/v\u00EDdeo",
			"ru": "\u0412\u043C\u0435\u0441\u0442\u043E \u0442\u043E\u0433\u043E \u0447\u0442\u043E\u0431\u044B \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443 \u0432 \u043D\u043E\u0432\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435, \u043E\u043D\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435/\u0432\u0438\u0434\u0435\u043E.",
			"zh-CN": "\u4E0B\u8F7D\u56FE\u50CF/\u89C6\u9891\uFF0C\u4EE3\u66FF\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00\u94FE\u63A5"
		},
		"Close key": {
			"pt-BR": "Tecla para fechar",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u0437\u0430\u043A\u0440\u044B\u0442\u0438\u044F",
			"zh-CN": "\u5173\u95ED\u952E"
		},
		"Closes the popup when this key is pressed. Currently, ESC will also close the popup regardless of the value of this setting.": {
			"pt-BR": "Fecha o pop-up quando esta tecla \u00E9 pressionada. Atualmente, ESC tamb\u00E9m fecha o pop-up independentemente do valor desta configura\u00E7\u00E3o.",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E. \u0412 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0435 \u0432\u0440\u0435\u043C\u044F ESC \u0442\u0430\u043A\u0436\u0435 \u0437\u0430\u043A\u0440\u043E\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u044D\u0442\u0438\u0445 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A.",
			"zh-CN": "\u6309\u4E0B\u6B64\u952E\u65F6\u5173\u95ED\u5F39\u7A97\u3002\u76EE\u524D\uFF0CESC \u4E5F\u5C06\u5173\u95ED\u5F39\u7A97\uFF0C\u5E76\u4E14\u65E0\u89C6\u6B64\u8BBE\u7F6E\u3002"
		},
		"Download key": {
			"pt-BR": "Tecla para download",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "\u4E0B\u8F7D\u952E"
		},
		"Downloads the image in the popup when this key is pressed": {
			"pt-BR": "Baixa a imagem no pop-up quando esta tecla \u00E9 pressionada",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u043D\u0430\u0447\u043D\u0451\u0442 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0432\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u043C \u043E\u043A\u043D\u0435.",
			"zh-CN": "\u6309\u4E0B\u6B64\u952E\u65F6\u4E0B\u8F7D\u5F39\u7A97\u4E2D\u7684\u56FE\u50CF"
		},
		"Open in new tab key": {
			"pt-BR": "Tecla para abrir em uma nova guia",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F \u0432 \u043D\u043E\u0432\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435",
			"zh-CN": "\u5728\u65B0\u5EFA\u6807\u7B7E\u9875\u4E2D\u6253\u5F00\u7684\u6309\u952E"
		},
		"Opens the image in the popup in a new tab when this key is pressed": {
			"pt-BR": "Abre a imagem no pop-up em uma nova guia quando esta tecla \u00E9 pressionada",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0432\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u043C \u043E\u043A\u043D\u0435 \u043D\u0430 \u043D\u043E\u0432\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435.",
			"zh-CN": "\u6309\u4E0B\u6B64\u952E\u65F6\u5728\u65B0\u5EFA\u7684\u6807\u7B7E\u9875\u4E2D\u5F39\u7A97\u4E2D\u7684\u56FE\u50CF"
		},
		"Open in background tab key": {
			"pt-BR": "Tecla para abrir em segundo plano",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F \u0432 \u0444\u043E\u043D\u043E\u0432\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435",
			"zh-CN": "\u5728\u540E\u53F0\u6807\u7B7E\u9875\u6253\u5F00\u7684\u6309\u952E"
		},
		"Opens the image in the popup in a new tab without switching to it when this key is pressed": {
			"pt-BR": "Abre a imagem no pop-up em uma nova guia sem alternar para ela quando esta tecla \u00E9 pressionada",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0432\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u043C \u043E\u043A\u043D\u0435 \u043D\u0430 \u043D\u043E\u0432\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435, \u043D\u0435 \u043F\u0435\u0440\u0435\u0445\u043E\u0434\u044F \u043D\u0430 \u043D\u0435\u0451.",
			"zh-CN": "\u6309\u4E0B\u6B64\u952E\u65F6\u5728\u65B0\u5EFA\u7684\u540E\u53F0\u6807\u7B7E\u9875\u4E2D\u5F39\u7A97\u4E2D\u7684\u56FE\u50CF"
		},
		"Copy link key": {
			"pt-BR": "Tecla para copiar link",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u0441\u0441\u044B\u043B\u043A\u0438",
			"zh-CN": "\u590D\u5236\u94FE\u63A5\u952E"
		},
		"Copies the link of the media to the clipboard when this key is pressed": {
			"pt-BR": "Copia o link da m\u00EDdia para a \u00E1rea de transfer\u00EAncia quando esta tecla \u00E9 pressionada",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u043A\u043E\u043F\u0438\u0440\u0443\u0435\u0442 \u0441\u0441\u044B\u043B\u043A\u0443 \u043C\u0435\u0434\u0438\u0430 \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430.",
			"zh-CN": "\u6309\u4E0B\u6B64\u952E\u65F6\uFF0C\u5C06\u5A92\u4F53\u94FE\u63A5\u590D\u5236\u5230\u526A\u8D34\u677F"
		},
		"Open options key": {
			"pt-BR": "Tecla para abrir as op\u00E7\u00F5es",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432",
			"zh-CN": "\u6253\u5F00\u9009\u9879\u952E"
		},
		"Opens this page in a new tab when this key is pressed": {
			"pt-BR": "Abre esta p\u00E1gina em uma nova guia quando esta tecla \u00E9 pressionada",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u043E\u0442\u043A\u0440\u043E\u0435\u0442 \u044D\u0442\u0443 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u0432 \u043D\u043E\u0432\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435.",
			"zh-CN": "\u6309\u4E0B\u6B64\u952E\u65F6\u5728\u6807\u7B7E\u9875\u4E2D\u6253\u5F00\u6B64\u9875\u9762"
		},
		"Open original page key": {
			"pt-BR": "Tecla para abrir a p\u00E1gina original",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u0430",
			"zh-CN": "\u6253\u5F00\u539F\u59CB\u9875\u9762\u952E"
		},
		"Opens the original page (if available) when this key is pressed": {
			"pt-BR": "Abre a p\u00E1gina original (se dispon\u00EDvel) quando esta tecla \u00E9 pressionada",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u0430 (\u0435\u0441\u043B\u0438 \u043E\u043D\u0430 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430).",
			"zh-CN": "\u6309\u4E0B\u6B64\u952E\u65F6\u6253\u5F00\u539F\u59CB\u9875\u9762\uFF08\u5982\u679C\u53EF\u7528\uFF09"
		},
		"Rotate left key": {
			"pt-BR": "Tecla para girar para a esquerda",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u043F\u043E\u0432\u043E\u0440\u043E\u0442\u0430 \u0432\u043B\u0435\u0432\u043E",
			"zh-CN": "\u5411\u5DE6\u65CB\u8F6C\u952E"
		},
		"Rotates the popup 90 degrees to the left": {
			"pt-BR": "Gira o pop-up 90 graus para a esquerda",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u043F\u043E\u0432\u043E\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043D\u0430 90 \u0433\u0440\u0430\u0434\u0443\u0441\u043E\u0432 \u0432\u043B\u0435\u0432\u043E.",
			"zh-CN": "\u5C06\u5F39\u7A97\u5411\u5DE6\u65CB\u8F6C90\u5EA6"
		},
		"Rotate right key": {
			"pt-BR": "Tecla para girar para a direita",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u043F\u043E\u0432\u043E\u0440\u043E\u0442\u0430 \u0432\u043F\u0440\u0430\u0432\u043E",
			"zh-CN": "\u5411\u53F3\u65CB\u8F6C\u952E"
		},
		"Rotates the popup 90 degrees to the right": {
			"pt-BR": "Gira o pop-up 90 graus para a direita",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u043F\u043E\u0432\u043E\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043D\u0430 90 \u0433\u0440\u0430\u0434\u0443\u0441\u043E\u0432 \u0432\u043F\u0440\u0430\u0432\u043E.",
			"zh-CN": "\u5C06\u5F39\u7A97\u5411\u53F3\u65CB\u8F6C90\u5EA6"
		},
		"Horizontal flip key": {
			"pt-BR": "Tecla para inverter horizontalmente",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u0434\u043B\u044F \u043E\u0442\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043F\u043E \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u0438",
			"zh-CN": "\u6C34\u5E73\u7FFB\u8F6C\u952E"
		},
		"Flips the image horizontally": {
			"pt-BR": "Inverte a imagem horizontalmente",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u0437\u0435\u0440\u043A\u0430\u043B\u044C\u043D\u043E \u043E\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043F\u043E \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u0438.",
			"zh-CN": "\u6C34\u5E73\u7FFB\u8F6C\u56FE\u50CF"
		},
		"Vertical flip key": {
			"pt-BR": "Tecla para inverter verticalmente",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u0434\u043B\u044F \u043E\u0442\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043F\u043E \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u0438",
			"zh-CN": "\u5782\u76F4\u7FFB\u8F6C\u952E"
		},
		"Flips the image vertically": {
			"pt-BR": "Inverte a imagem verticalmente",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u0437\u0435\u0440\u043A\u0430\u043B\u044C\u043D\u043E \u043E\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043F\u043E \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u0438.",
			"zh-CN": "\u5782\u76F4\u7FFB\u8F6C\u56FE\u50CF"
		},
		"Zoom in key": {
			"pt-BR": "Tecla para ampliar",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u0438\u044F \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430",
			"zh-CN": "\u653E\u5927\u952E"
		},
		"Incrementally zooms into the image": {
			"pt-BR": "Amplia a imagem incrementalmente",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u0443\u0432\u0435\u043B\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u043C\u0430\u0441\u0448\u0442\u0430\u0431 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F.",
			"zh-CN": "\u9010\u6B65\u653E\u5927\u56FE\u50CF"
		},
		"Zoom out key": {
			"pt-BR": "Tecla para reduzir",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u0443\u043C\u0435\u043D\u044C\u0448\u0435\u043D\u0438\u044F \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430",
			"zh-CN": "\u7F29\u5C0F\u952E"
		},
		"Incrementally zooms out of the image": {
			"pt-BR": "Reduz a imagem incrementalmente",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u0443\u043C\u0435\u043D\u044C\u0448\u0430\u0435\u0442 \u043C\u0430\u0441\u0448\u0442\u0430\u0431 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F.",
			"zh-CN": "\u9010\u6B65\u7F29\u5C0F\u56FE\u50CF"
		},
		"Full zoom key": {
			"pt-BR": "Tecla para zoom total",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u043F\u043E\u043B\u043D\u043E\u0433\u043E \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "\u5168\u5C3A\u5BF8\u7F29\u653E\u952E"
		},
		"Sets the image to be at a 100% zoom, even if it overflows the screen": {
			"pt-BR": "Define a imagem para ter um zoom de 100%, mesmo que transborde a tela",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u0443\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442 100%-\u043D\u043E\u0435 \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F, \u0434\u0430\u0436\u0435 \u0435\u0441\u043B\u0438 \u043E\u043D\u043E \u043F\u0435\u0440\u0435\u043F\u043E\u043B\u043D\u044F\u0435\u0442 \u044D\u043A\u0440\u0430\u043D.",
			"zh-CN": "\u5C06\u56FE\u50CF\u8BBE\u7F6E\u4E3A 100% \u7F29\u653E\uFF0C\u5373\u4F7F\u5C06\u6EA2\u51FA\u5C4F\u5E55"
		},
		"Fit screen key": {
			"pt-BR": "Tecla para ajustar \u00E0 tela",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u043F\u043E\u0434\u0433\u043E\u043D\u043A\u0438 \u043F\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u0443 \u044D\u043A\u0440\u0430\u043D\u0430",
			"zh-CN": "\u9002\u5408\u5C4F\u5E55\u952E"
		},
		"Sets the image to either be at a 100% zoom, or to fit the screen, whichever is smaller": {
			"pt-BR": "Define a imagem para ter um zoom de 100% ou para caber na tela, o que for menor",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u0443\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043B\u0438\u0431\u043E \u0441\u043E 100%-\u043D\u044B\u043C \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u043E\u043C, \u043B\u0438\u0431\u043E \u0432 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0440\u0430\u0437\u043C\u0435\u0440\u043E\u043C \u044D\u043A\u0440\u0430\u043D\u0430, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E\u0441\u0442\u0438 \u043E\u0442 \u0442\u043E\u0433\u043E, \u0447\u0442\u043E \u043C\u0435\u043D\u044C\u0448\u0435.",
			"zh-CN": "\u5C06\u56FE\u50CF\u8BBE\u7F6E\u4E3A 100% \u7F29\u653E\u6216\u9002\u5408\u5C4F\u5E55\uFF0C\u4EE5\u8F83\u5C0F\u8005\u4E3A\u51C6"
		},
		"Toggle fullscreen key": {
			"pt-BR": "Tecla para alternar tela cheia",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u044F \u043D\u0430 \u0432\u0435\u0441\u044C \u044D\u043A\u0440\u0430\u043D",
			"zh-CN": "\u5207\u6362\u5168\u5C4F\u952E"
		},
		"Toggles fullscreen mode for the image/video in the popup": {
			"pt-BR": "Alterna o modo de tela cheia para a imagem/v\u00EDdeo no popup",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E\u0439 \u043A\u043B\u0430\u0432\u0438\u0448\u0438, \u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u043E\u043B\u043D\u043E\u044D\u043A\u0440\u0430\u043D\u043D\u044B\u0439 \u0440\u0435\u0436\u0438\u043C \u0434\u043B\u044F \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F/\u0432\u0438\u0434\u0435\u043E \u0432\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u043C \u043E\u043A\u043D\u0435.",
			"zh-CN": "\u5207\u6362\u5F39\u7A97\u4E2D\u7684\u56FE\u50CF/\u89C6\u9891\u7684\u5168\u5C4F\u6A21\u5F0F"
		},
		"Popup for plain hyperlinks": {
			"ko": "\uC77C\uBC18\uC801\uC778 \uB9C1\uD06C\uC5D0\uB3C4 \uD31D\uC5C5",
			"pt-BR": "Popup para hyperlinks simples",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0434\u043B\u044F \u043F\u0440\u043E\u0441\u0442\u044B\u0445 \u0433\u0438\u043F\u0435\u0440\u0441\u0441\u044B\u043B\u043E\u043A",
			"zh-CN": "\u4E3A\u7EAF\u8D85\u94FE\u63A5\u5F39\u7A97"
		},
		"Whether or not the popup should also open for plain hyperlinks": {
			"ko": "\uC77C\uBC18 \uD558\uC774\uD37C\uB9C1\uD06C\uC758 \uD31D\uC5C5 \uC5F4\uAE30 \uC5EC\uBD80",
			"pt-BR": "Se o popup tamb\u00E9m deve abrir para hyperlinks simples",
			"ru": "\u0414\u043E\u043B\u0436\u043D\u043E \u043B\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0442\u0430\u043A\u0436\u0435 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C\u0441\u044F \u0434\u043B\u044F \u043F\u0440\u043E\u0441\u0442\u044B\u0445 \u0433\u0438\u043F\u0435\u0440\u0441\u0441\u044B\u043B\u043E\u043A.",
			"zh-CN": "\u662F\u5426\u4E3A\u7EAF\u7CB9\u7684\u8D85\u94FE\u63A5\u663E\u793A\u5F39\u7A97"
		},
		"Only for links that look valid": {
			"ko": "\uC720\uD6A8\uD574 \uBCF4\uC774\uB294 \uB9C1\uD06C\uC5D0\uB9CC \uD574\uB2F9",
			"pt-BR": "Somente para links que parecem v\u00E1lidos",
			"ru": "\u0422\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0441\u0441\u044B\u043B\u043E\u043A, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0432\u044B\u0433\u043B\u044F\u0434\u044F\u0442 \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u043E",
			"zh-CN": "\u53EA\u9488\u5BF9\u770B\u8D77\u6765\u6709\u6548\u7684\u94FE\u63A5"
		},
		"Enabling this option will only allow links to be popped up if they look valid (such as if they have a known image/video extension, or are explicitly supported)": {
			"ko": "\uC774 \uC635\uC158\uC744 \uD65C\uC131\uD654\uD558\uBA74 \uB9C1\uD06C\uAC00 \uC720\uD6A8\uD55C \uAC83\uC73C\uB85C \uBCF4\uC774\uB294 \uACBD\uC6B0\uC5D0\uB9CC(\uC608: \uC54C\uB824\uC9C4 \uC774\uBBF8\uC9C0/\uBE44\uB514\uC624 \uD655\uC7A5\uBA85\uC774 \uC788\uAC70\uB098 \uBA85\uC2DC\uC801\uC73C\uB85C \uC9C0\uC6D0\uB418\uB294 \uACBD\uC6B0) \uB9C1\uD06C\uAC00 \uD31D\uC5C5\uB420 \uC218 \uC788\uC74C",
			"pt-BR": "Ativar esta op\u00E7\u00E3o permitir\u00E1 que os links sejam exibidos em popup apenas se parecerem v\u00E1lidos (como se tiverem uma extens\u00E3o de imagem/v\u00EDdeo conhecida ou forem explicitamente suportados)",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u044D\u0442\u043E\u0433\u043E \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430 \u043F\u043E\u0437\u0432\u043E\u043B\u0438\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0430\u043C \u0442\u043E\u043B\u044C\u043A\u043E \u0432 \u0442\u043E\u043C \u0441\u043B\u0443\u0447\u0430\u0435, \u0435\u0441\u043B\u0438 \u043E\u043D\u0438 \u0432\u044B\u0433\u043B\u044F\u0434\u044F\u0442 \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u043C\u0438 (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u0435\u0441\u043B\u0438 \u043E\u043D\u0438 \u0438\u043C\u0435\u044E\u0442 \u0438\u0437\u0432\u0435\u0441\u0442\u043D\u043E\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F/\u0432\u0438\u0434\u0435\u043E, \u0438\u043B\u0438 \u0435\u0441\u043B\u0438 \u043E\u043D\u0438 \u044F\u0432\u043D\u043E \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044E\u0442\u0441\u044F).",
			"zh-CN": "\u542F\u7528\u6B64\u9009\u9879\u540E\uFF0C\u5C06\u53EA\u4E3A\u770B\u8D77\u6765\u6709\u6548\u7684\u94FE\u63A5\u663E\u793A\u5F39\u7A97\uFF08\u4F8B\u5982\u6709\u5DF2\u77E5\u7684\u56FE\u50CF/\u89C6\u9891\u6269\u5C55\u540D\uFF0C\u6216\u8005\u660E\u663E\u53D7\u652F\u6301\uFF09"
		},
		"Popup page URL": {
			"pt-BR": "URL da p\u00E1gina do popup",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0434\u043B\u044F URL \u0441\u0442\u0440\u0430\u043D\u0438\u0446",
			"zh-CN": "\u4E3A\u9875\u9762\u7F51\u5740\u5F39\u7A97"
		},
		"If no element can be found, try the page URL. Only relevant for pagelink rules, such as image and video hosting websites": {
			"pt-BR": "Se nenhum elemento for encontrado, tente a URL da p\u00E1gina. Relevante apenas para regras de pagelink, como sites de hospedagem de imagem e v\u00EDdeo",
			"ru": "\u0415\u0441\u043B\u0438 \u043D\u0438 \u043E\u0434\u0438\u043D \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C URL-\u0430\u0434\u0440\u0435\u0441 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B. F\u043A\u0442\u0443\u0430\u043B\u044C\u043D\u043E n\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u043F\u0440\u0430\u0432\u0438\u043B \u0441\u0441\u044B\u043B\u043A\u0438 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B, \u0442\u0430\u043A\u0438\u0445 \u043A\u0430\u043A \u0441\u0430\u0439\u0442\u044B \u0445\u043E\u0441\u0442\u0438\u043D\u0433\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439 \u0438 \u0432\u0438\u0434\u0435\u043E.",
			"zh-CN": "\u5982\u679C\u627E\u4E0D\u5230\u5143\u7D20\uFF0C\u5C1D\u8BD5\u9875\u9762\u7F51\u5740\u3002\u53EA\u4E0E pagelink \u89C4\u5219\u76F8\u5173\uFF0C\u5982\u56FE\u50CF\u6216\u89C6\u9891\u6258\u7BA1\u7F51\u7AD9"
		},
		"Popup for `<iframe>`": {
			"ko": "<iframe>\uC5D0 \uB300\uD55C \uD31D\uC5C5",
			"pt-BR": "Popup para `<iframe>`",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0434\u043B\u044F `<iframe>`",
			"zh-CN": "\u4E3A <iframe> \u5F39\u7A97"
		},
		"Allows `<iframe>` elements to be popped up as well. Storing images/videos in this way is rather uncommon, but it can allow embeds to be supported": {
			"ko": "<iframe>\uC758 \uC694\uC18C\uB4E4\uB3C4 \uD31D\uC5C5\uC774 \uC791\uB3D9\uD558\uB3C4\uB85D \uD5C8\uC6A9. \uC774\uB7F0 \uC2DD\uC73C\uB85C \uC774\uBBF8\uC9C0/\uBE44\uB514\uC624\uB97C \uC800\uC7A5\uD558\uB294 \uAC83\uC740 \uB2E4\uC18C \uB4DC\uBB38 \uC77C\uC774\uC9C0\uB9CC, embeds\uB97C \uC9C0\uC6D0\uD560 \uC218 \uC788\uC74C",
			"pt-BR": "Permite que elementos `<iframe>` tamb\u00E9m sejam abertos em popup. Armazenar imagens/v\u00EDdeos desta forma \u00E9 incomum, mas pode permitir suporte a embeds",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u0442\u044C \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u043C `<iframe>`. \u0425\u0440\u0430\u043D\u0435\u043D\u0438\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439/\u0432\u0438\u0434\u0435\u043E \u0442\u0430\u043A\u0438\u043C \u043E\u0431\u0440\u0430\u0437\u043E\u043C \u0434\u043E\u0432\u043E\u043B\u044C\u043D\u043E \u0440\u0435\u0434\u043A\u043E\u0435 \u044F\u0432\u043B\u0435\u043D\u0438\u0435, \u043D\u043E \u043E\u043D\u043E \u043C\u043E\u0436\u0435\u0442 \u043F\u043E\u0437\u0432\u043E\u043B\u0438\u0442\u044C \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044C \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043C\u044B\u0435 \u0444\u0430\u0439\u043B\u044B.",
			"zh-CN": "\u5141\u8BB8\u4E3A `<iframe>` \u5143\u7D20\u663E\u793A\u5F39\u7A97\u3002\u4EE5\u8FD9\u79CD\u65B9\u5F0F\u5B58\u50A8\u56FE\u50CF/\u89C6\u9891\u76F8\u5F53\u7F55\u89C1\uFF0C\u4F46\u603B\u4E4B\u53EF\u4EE5\u652F\u6301"
		},
		"Popup for `<canvas>`": {
			"ko": "<canvas>\uC5D0 \uB300\uD55C \uD31D\uC5C5",
			"pt-BR": "Popup para `<canvas>`",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0434\u043B\u044F `<canvas>`",
			"zh-CN": "\u4E3A <canvas> \u5F39\u7A97"
		},
		"Allows `<canvas>` elements to be popped up as well. This will likely cause popups with any kind of web-based games, so it's recommended to keep this disabled": {
			"ko": "<canvas>\uC758 \uC694\uC18C\uB4E4\uB3C4 \uD31D\uC5C5\uC774 \uC791\uB3D9\uD558\uB3C4\uB85D \uD5C8\uC6A9. \uC774\uAC83\uC740 \uC5B4\uB5A4 \uC885\uB958\uC758 \uC6F9 \uAE30\uBC18 \uAC8C\uC784\uC774\uB77C\uB3C4 \uD31D\uC5C5\uC744 \uC720\uBC1C\uD560 \uAC00\uB2A5\uC131\uC774 \uB192\uC73C\uBBC0\uB85C, \uC774 \uAE30\uB2A5\uC744 \uC0AC\uC6A9\uD558\uC9C0 \uC54A\uB3C4\uB85D \uC720\uC9C0\uD558\uB294 \uAC83\uC774 \uC88B\uC74C",
			"pt-BR": "Permite que elementos `<canvas>` tamb\u00E9m sejam abertos em popup. Isso provavelmente causar\u00E1 popups com qualquer tipo de jogo baseado na web, portanto, \u00E9 recomend\u00E1vel manter esta op\u00E7\u00E3o desativada",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u0442\u044C \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u043C `<canvas>`. \u042D\u0442\u043E, \u0441\u043A\u043E\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043E, \u0431\u0443\u0434\u0435\u0442 \u0432\u044B\u0437\u044B\u0432\u0430\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0438\u0435 \u043E\u043A\u043D\u0430 \u0441 \u043B\u044E\u0431\u044B\u043C\u0438 \u0432\u0435\u0431-\u0438\u0433\u0440\u0430\u043C\u0438, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0440\u0435\u043A\u043E\u043C\u0435\u043D\u0434\u0443\u0435\u0442\u0441\u044F \u043E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u044D\u0442\u0443 \u0444\u0443\u043D\u043A\u0446\u0438\u044E.",
			"zh-CN": "\u5141\u8BB8\u4E3A `<canvas>` \u5143\u7D20\u663E\u793A\u5F39\u7A97\u3002\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5728\u7F51\u9875\u6E38\u620F\u4E0A\u89E6\u53D1\u5F39\u7A97\uFF0C\u6240\u4EE5\u5EFA\u8BAE\u6B64\u9879\u4FDD\u6301\u7981\u7528"
		},
		"Popup for `<svg>`": {
			"ko": "<svg>\uC5D0 \uB300\uD55C \uD31D\uC5C5",
			"pt-BR": "Popup para `<svg>`",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0434\u043B\u044F `<svg>`",
			"zh-CN": "\u4E3A <svg> \u5F39\u7A97"
		},
		"Allows `<svg>` elements to be popped up as well. These are usually used for icons, and can occasionally cause problems for websites that overlay icons on top of images": {
			"ko": "<canvas>\uC758 \uC694\uC18C\uB4E4\uB3C4 \uD31D\uC5C5\uC774 \uC791\uB3D9\uD558\uB3C4\uB85D \uD5C8\uC6A9. \uC774\uAC83\uC740 \uBCF4\uD1B5 \uC544\uC774\uCF58\uC5D0 \uC0AC\uC6A9\uB418\uBA70, \uB54C\uB54C\uB85C \uC774\uBBF8\uC9C0 \uC704\uC5D0 \uC544\uC774\uCF58\uC744 \uC624\uBC84\uB808\uC774\uD558\uB294 \uC6F9 \uC0AC\uC774\uD2B8\uC5D0 \uBB38\uC81C\uB97C \uC77C\uC73C\uD0AC \uC218 \uC788\uC74C",
			"pt-BR": "Permite que elementos `<svg>` tamb\u00E9m sejam abertos em popup. Geralmente s\u00E3o usados para \u00EDcones e ocasionalmente podem causar problemas para sites que sobrep\u00F5em \u00EDcones em cima de imagens",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u0442\u044C \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u043C `<svg>`. \u041E\u0431\u044B\u0447\u043D\u043E \u043E\u043D\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u044E\u0442\u0441\u044F \u0434\u043B\u044F \u0438\u043A\u043E\u043D\u043E\u043A \u0438 \u0438\u043D\u043E\u0433\u0434\u0430 \u043C\u043E\u0433\u0443\u0442 \u0432\u044B\u0437\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u044B \u0434\u043B\u044F \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u043E\u0432, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u043D\u0430\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u044E\u0442 \u0438\u043A\u043E\u043D\u043A\u0438 \u043F\u043E\u0432\u0435\u0440\u0445 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439.",
			"zh-CN": "\u5141\u8BB8\u4E3A `<svg>` \u5143\u7D20\u663E\u793A\u5F39\u7A97\u3002\u8FD9\u901A\u5E38\u7528\u4E8E\u56FE\u6807\uFF0C\u5E76\u4E14\u5076\u5C14\u4F1A\u5728\u7F51\u7AD9\u4E8E\u56FE\u50CF\u4E0A\u53E0\u52A0\u56FE\u6807\u65F6\u51FA\u73B0\u95EE\u9898"
		},
		"Enable gallery": {
			"pt-BR": "Ativar galeria",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0433\u0430\u043B\u0435\u0440\u0435\u044E",
			"zh-CN": "\u542F\u7528\u56FE\u5E93"
		},
		"Toggles whether gallery detection support should be enabled": {
			"pt-BR": "Alterna se o suporte \u00E0 detec\u00E7\u00E3o de galeria deve ser ativado",
			"ru": "\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0430\u0435\u0442, \u0434\u043E\u043B\u0436\u043D\u0430 \u043B\u0438 \u0431\u044B\u0442\u044C \u0432\u043A\u043B\u044E\u0447\u0435\u043D\u0430 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u043A\u0430 \u043E\u0431\u043D\u0430\u0440\u0443\u0436\u0435\u043D\u0438\u044F \u0433\u0430\u043B\u0435\u0440\u0435\u0438.",
			"zh-CN": "\u5207\u6362\u662F\u5426\u542F\u7528\u56FE\u5E93\u68C0\u6D4B\u652F\u6301"
		},
		"Cycle gallery": {
			"pt-BR": "Ciclo da galeria",
			"ru": "\u0417\u0430\u0446\u0438\u043A\u043B\u0438\u0442\u044C \u0433\u0430\u043B\u0435\u0440\u0435\u044E",
			"zh-CN": "\u56FE\u5E93\u5FAA\u73AF"
		},
		"Going to the previous image for the first image will lead to the last image and vice-versa": {
			"pt-BR": "Ir para a imagem anterior na primeira imagem levar\u00E1 para a \u00FAltima imagem e vice-versa",
			"ru": "\u041F\u0435\u0440\u0435\u0445\u043E\u0434 \u043A \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u043C\u0443 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044E \u0441 \u043F\u0435\u0440\u0432\u043E\u0433\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043F\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043A \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u043C\u0443 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044E \u0438 \u043D\u0430\u043E\u0431\u043E\u0440\u043E\u0442.",
			"zh-CN": "\u7B2C\u4E00\u4E2A\u56FE\u50CF\u518D\u5411\u4E0A\u62B5\u8FBE\u6700\u540E\u4E00\u4E2A\u56FE\u50CF\uFF0C\u6700\u540E\u4E00\u4E2A\u56FE\u50CF\u5411\u4E0B\u62B5\u8FBE\u7B2C\u4E00\u4E2A\u56FE\u50CF"
		},
		"Previous gallery item": {
			"pt-BR": "Item anterior da galeria",
			"ru": "\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0433\u0430\u043B\u0435\u0440\u0435\u0438",
			"zh-CN": "\u524D\u4E00\u4E2A\u56FE\u5E93\u9879"
		},
		"Key to trigger the previous gallery item": {
			"pt-BR": "Tecla para acionar o item anterior da galeria",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u0434\u043B\u044F \u0437\u0430\u043F\u0443\u0441\u043A\u0430 \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0433\u043E \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430 \u0433\u0430\u043B\u0435\u0440\u0435\u0438.",
			"zh-CN": "\u89E6\u53D1\u4E0A\u4E00\u4E2A\u56FE\u5E93\u9879\u7684\u6309\u952E"
		},
		"Next gallery item": {
			"pt-BR": "Pr\u00F3ximo item da galeria",
			"ru": "\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u0433\u0430\u043B\u0435\u0440\u0435\u0438",
			"zh-CN": "\u4E0B\u4E00\u4E2A\u56FE\u5E93\u9879"
		},
		"Key to trigger the next gallery item": {
			"pt-BR": "Tecla para acionar o pr\u00F3ximo item da galeria",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u0434\u043B\u044F \u0437\u0430\u043F\u0443\u0441\u043A\u0430 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430 \u0433\u0430\u043B\u0435\u0440\u0435\u0438.",
			"zh-CN": "\u89E6\u53D1\u4E0B\u4E00\u4E2A\u56FE\u5E93\u9879\u7684\u6309\u952E"
		},
		"Gallery download key": {
			"pt-BR": "Tecla para baixar a galeria",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F \u0433\u0430\u043B\u0435\u0440\u0435\u0438",
			"zh-CN": "\u56FE\u5E93\u4E0B\u8F7D\u952E"
		},
		"Key to download the current gallery": {
			"pt-BR": "Tecla para baixar a galeria atual",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u0434\u043B\u044F \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F \u0442\u0435\u043A\u0443\u0449\u0435\u0439 \u0433\u0430\u043B\u0435\u0440\u0435\u0438.",
			"zh-CN": "\u4E0B\u8F7D\u5F53\u524D\u56FE\u5E93\u7684\u6309\u952E"
		},
		"Download method": {
			"pt-BR": "M\u00E9todo de download",
			"ru": "\u0421\u043F\u043E\u0441\u043E\u0431 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "\u4E0B\u8F7D\u65B9\u6CD5"
		},
		"How the gallery should be downloaded": {
			"pt-BR": "Como a galeria deve ser baixada",
			"ru": "\u041A\u0430\u043A \u043D\u0443\u0436\u043D\u043E \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u0442\u044C \u0433\u0430\u043B\u0435\u0440\u0435\u044E",
			"zh-CN": "\u5E94\u5982\u4F55\u4E0B\u8F7D\u56FE\u5E93"
		},
		"Zip file": {
			"pt-BR": "Arquivo Zip",
			"ru": "\u0410\u0440\u0445\u0438\u0432",
			"zh-CN": "Zip \u6587\u4EF6"
		},
		"JDownloader": {
			"pt-BR": "JDownloader",
			"ru": "JDownloader",
			"zh-CN": "JDownloader"
		},
		"Download unchanged media": {
			"pt-BR": "Baixar m\u00EDdia inalterada",
			"ru": "\u0421\u043A\u0430\u0447\u0438\u0432\u0430\u0442\u044C \u043C\u0435\u0434\u0438\u0430 \u0431\u0435\u0437 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439",
			"zh-CN": "\u4E0B\u8F7D\u672A\u66F4\u6539\u7684\u5A92\u4F53"
		},
		"Includes gallery items that have not been changed. Useful to potentially avoid downloading thumbnails": {
			"pt-BR": "Inclui itens da galeria que n\u00E3o foram alterados. \u00DAtil para evitar o download de miniaturas",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044F \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u0433\u0430\u043B\u0435\u0440\u0435\u0438, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u043D\u0435 \u0431\u044B\u043B\u0438 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u044B. \u041F\u043E\u043B\u0435\u0437\u043D\u043E, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0442\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u043E \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044C \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F \u043C\u0438\u043D\u0438\u0430\u0442\u044E\u0440.",
			"zh-CN": "\u5305\u542B\u672A\u66F4\u6539\u7684\u56FE\u5E93\u9879\u76EE\u3002\u6709\u52A9\u4E8E\u6F5C\u5728\u907F\u514D\u4E0B\u8F7D\u7F29\u7565\u56FE"
		},
		"Directory/zip filename format": {
			"pt-BR": "Formato do nome do diret\u00F3rio/arquivo zip",
			"ru": "\u0424\u043E\u0440\u043C\u0430\u0442 \u0438\u043C\u0435\u043D\u0438 \u0444\u0430\u0439\u043B\u0430 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0430/\u0430\u0440\u0445\u0438\u0432\u0430",
			"zh-CN": "\u76EE\u5F55/zip \u6587\u4EF6\u540D\u683C\u5F0F"
		},
		"Format string(s) for the directory (package name for JDownloader) and zip filename (if applicable).\nRefer to \"Filename format\" under the Rules section for documentation. The variables are set from the first loaded media.\nAn additional `items_amt` format variable is supported, which contains the number of items.\n`.zip` will be automatically suffixed for zip filenames.": {
			"pt-BR": "Cadeia(s) de formato para o diret\u00F3rio (nome do pacote para JDownloader) e nome do arquivo zip (se aplic\u00E1vel).\nConsulte \"Formato do nome do arquivo\" na se\u00E7\u00E3o Regras para obter documenta\u00E7\u00E3o. As vari\u00E1veis s\u00E3o definidas a partir da primeira m\u00EDdia carregada.\nUma vari\u00E1vel de formato adicional items_amt \u00E9 suportada, que cont\u00E9m o n\u00FAmero de itens.\n.zip ser\u00E1 automaticamente adicionado como sufixo para nomes de arquivos zip.",
			"ru": "\u0424\u043E\u0440\u043C\u0430\u0442 \u0441\u0442\u0440\u043E\u043A \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0430 (\u0438\u043C\u044F \u043F\u0430\u043A\u0435\u0442\u0430 \u0434\u043B\u044F JDownloader) \u0438 \u0438\u043C\u044F zip-\u0444\u0430\u0439\u043B\u0430 (\u0435\u0441\u043B\u0438 \u043F\u0440\u0438\u043C\u0435\u043D\u0438\u043C\u043E).\n\u0418\u0437\u0443\u0447\u0438\u0442\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u044E \"\u0424\u043E\u0440\u043C\u0430\u0442 \u0438\u043C\u0435\u043D\u0438 \u0444\u0430\u0439\u043B\u0430\" \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \"\u041F\u0440\u0430\u0432\u0438\u043B\u0430\". \u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435 \u0443\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u044E\u0442\u0441\u044F \u0441 \u043F\u0435\u0440\u0432\u043E\u0433\u043E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u043E\u0433\u043E \u043C\u0435\u0434\u0438\u0430.\n\u041F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0430\u044F \u0444\u043E\u0440\u043C\u0430\u0442\u0430 `items_amt`, \u043A\u043E\u0442\u043E\u0440\u0430\u044F \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432.\n\u0421\u0443\u0444\u0444\u0438\u043A\u0441 `.zip` \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u0442\u044C\u0441\u044F \u043A \u0438\u043C\u0435\u043D\u0430\u043C zip-\u0444\u0430\u0439\u043B\u043E\u0432.",
			"zh-CN": "\u76EE\u5F55\uFF08JDownloader \u7684\u5305\u540D\uFF09\u548C zip \u6587\u4EF6\u540D\uFF08\u5982\u679C\u9002\u7528\uFF09\u7684\u683C\u5F0F\u5316\u5B57\u7B26\u4E32\u3002\n\u6587\u6863\u53C2\u89C1\u201C\u89C4\u5219\u201D\u90E8\u5206\u4E2D\u7684\u201C\u6587\u4EF6\u540D\u683C\u5F0F\u201D\u3002\u8FD9\u4E9B\u53D8\u91CF\u6765\u81EA\u9996\u4E2A\u5DF2\u52A0\u8F7D\u7684\u5A92\u4F53\u3002\n\u652F\u6301\u4E00\u4E2A\u989D\u5916\u7684 `items_amt` \u683C\u5F0F\u53D8\u91CF\uFF0C\u5176\u4E2D\u5305\u542B\u9879\u76EE\u6570\u91CF\u3002\nzip \u7684\u6587\u4EF6\u540D\u81EA\u52A8\u8FFD\u52A0 `.zip` \u540E\u7F00\u3002"
		},
		"Zip: Store in subdirectory": {
			"pt-BR": "Zip: Armazenar em subdiret\u00F3rio",
			"ru": "Zip: \u0425\u0440\u0430\u043D\u0438\u0442\u044C \u0432 \u043F\u043E\u0434\u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0435",
			"zh-CN": "Zip: \u5B58\u50A8\u5728\u5B50\u76EE\u5F55\u4E2D"
		},
		"Stores the files in a subdirectory with the same name as the .zip file (without the .zip extension)": {
			"pt-BR": "Armazena os arquivos em um subdiret\u00F3rio com o mesmo nome do arquivo .zip (sem a extens\u00E3o .zip)",
			"ru": "\u0425\u0440\u0430\u043D\u0438\u0442 \u0444\u0430\u0439\u043B\u044B \u0432 \u043F\u043E\u0434\u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0435 \u0441 \u0442\u0435\u043C \u0436\u0435 \u0438\u043C\u0435\u043D\u0435\u043C, \u0447\u0442\u043E \u0438 zip-\u0444\u0430\u0439\u043B (\u0431\u0435\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F .zip).",
			"zh-CN": "\u5C06\u6587\u4EF6\u5B58\u50A8\u5728\u4E0E .zip \u6587\u4EF6\u540C\u540D\u7684\u5B50\u76EE\u5F55\u4E2D\uFF08\u76EE\u5F55\u4E0D\u5E26 .zip\uFF09"
		},
		"JD: Autostart": {
			"pt-BR": "JD: Iniciar automaticamente",
			"ru": "JD: \u0410\u0432\u0442\u043E\u0437\u0430\u043F\u0443\u0441\u043A",
			"zh-CN": "JD: \u81EA\u52A8\u542F\u52A8"
		},
		"Autostarts the download when added to JDownloader": {
			"pt-BR": "Inicia o download automaticamente quando adicionado ao JDownloader",
			"ru": "\u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u0435\u0442 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0435 \u043F\u0440\u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0438 \u0432 JDownloader",
			"zh-CN": "\u6DFB\u52A0\u5230 JDownloader \u65F6\u81EA\u52A8\u5F00\u59CB\u4E0B\u8F7D"
		},
		"JD: Referer policy": {
			"pt-BR": "JD: Pol\u00EDtica de Refer\u00EAncia",
			"ru": "JD: \u0420\u0435\u0444\u0435\u0440\u0430\u043B\u044C\u043D\u0430\u044F \u043F\u043E\u043B\u0438\u0442\u0438\u043A\u0430",
			"zh-CN": "JD: Referer \u7B56\u7565"
		},
		"Due to a current limitation in JDownloader's API, the `Referer` (sic) header can only be set on a per-package basis. This option allows working around it by submitting multiple packages with the same name using different Referer headers. This can result in JD spamming notifications due to the number of packages created.": {
			"pt-BR": "Devido a uma limita\u00E7\u00E3o atual na API do JDownloader, o cabe\u00E7alho `Referer` (sic) s\u00F3 pode ser definido por pacote. Esta op\u00E7\u00E3o permite contornar isso enviando v\u00E1rios pacotes com o mesmo nome usando diferentes cabe\u00E7alhos Referer. Isso pode resultar em spam de notifica\u00E7\u00F5es do JD devido ao n\u00FAmero de pacotes criados.",
			"ru": "\u0418\u0437-\u0437\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F \u0432 API JDownloader, \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A `Referer` (sic) \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u043A\u0430\u0436\u0434\u043E\u0433\u043E \u043F\u0430\u043A\u0435\u0442\u0430. \u042D\u0442\u043E\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u043F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u043E\u0431\u043E\u0439\u0442\u0438 \u044D\u0442\u043E, \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0432 \u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043F\u0430\u043A\u0435\u0442\u043E\u0432 \u0441 \u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u044B\u043C \u0438\u043C\u0435\u043D\u0435\u043C, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u044F \u0440\u0430\u0437\u043D\u044B\u0435 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 Referer. \u042D\u0442\u043E \u043C\u043E\u0436\u0435\u0442 \u043F\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043A \u0441\u043F\u0430\u043C-\u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F\u043C JD \u0438\u0437-\u0437\u0430 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u043D\u044B\u0445 \u043F\u0430\u043A\u0435\u0442\u043E\u0432.",
			"zh-CN": "\u7531\u4E8E\u76EE\u524D JDownloader API \u7684\u9650\u5236\uFF0C`Referer` (sic) \u5934\u53EA\u80FD\u5728\u6BCF\u4E2A\u5305\u7684\u57FA\u7840\u4E0A\u8BBE\u7F6E\u3002\u6B64\u9009\u9879\u901A\u8FC7\u63D0\u4EA4\u540C\u540D\u4F46\u4E0D\u540C Referer \u5934\u7684\u591A\u4E2A\u5305\u6765\u89C4\u907F\u8BE5\u95EE\u9898\u3002\u8FD9\u53EF\u80FD\u5BFC\u81F4 JD \u7531\u4E8E\u521B\u5EFA\u7684\u5305\u6570\u91CF\u8F83\u591A\u800C\u7ED9\u51FA\u5783\u573E\u6D88\u606F\u901A\u77E5\u3002"
		},
		"Per-domain": {
			"pt-BR": "Por dom\u00EDnio",
			"ru": "\u0414\u043B\u044F \u043A\u0430\u0436\u0434\u043E\u0433\u043E \u0434\u043E\u043C\u0435\u043D\u0430",
			"zh-CN": "\u6309\u57DF\u540D"
		},
		"Zip: Store info file": {
			"pt-BR": "Zip: Armazenar arquivo de informa\u00E7\u00F5es",
			"ru": "Zip: \u0425\u0440\u0430\u043D\u0438\u0442\u044C \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E \u0444\u0430\u0439\u043B\u0430",
			"zh-CN": "Zip: \u5B58\u50A8\u4FE1\u606F\u6587\u4EF6"
		},
		"Stores a `info.txt` file in the .zip containing information about the downloaded files and host page.": {
			"pt-BR": "Armazena um arquivo `info.txt` no .zip contendo informa\u00E7\u00F5es sobre os arquivos baixados e a p\u00E1gina de origem.",
			"ru": "\u0425\u0440\u0430\u043D\u0438\u0442 \u0444\u0430\u0439\u043B `info.txt` \u0432 .zip, \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044E \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E \u043E \u0441\u043A\u0430\u0447\u0430\u043D\u044B\u0445 \u0444\u0430\u0439\u043B\u0430\u0445 \u0438 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435 \u0445\u043E\u0441\u0442\u0430.",
			"zh-CN": "\u5728 .zip \u4E2D\u5B58\u50A8\u4E00\u4E2A\u5305\u542B\u4E0B\u8F7D\u7684\u6587\u4EF6\u548C\u7F51\u9875\u4FE1\u606F\u7684\u201Cinfo.txt\u201D\u6587\u4EF6\u3002"
		},
		"Move to next when video finishes": {
			"pt-BR": "Mover para o pr\u00F3ximo quando o v\u00EDdeo terminar",
			"ru": "\u041F\u043E\u0441\u043B\u0435 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u043D\u0438\u044F \u0432\u0438\u0434\u0435\u043E, \u043F\u0435\u0440\u0435\u0445\u043E\u0434\u0438\u0442\u044C \u043A \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C\u0443",
			"zh-CN": "\u89C6\u9891\u7ED3\u675F\u65F6\u8F6C\u5230\u4E0B\u4E00\u4E2A"
		},
		"Moves to the next gallery item when a video finishes playing": {
			"pt-BR": "Move para o pr\u00F3ximo item da galeria quando um v\u00EDdeo terminar de reproduzir",
			"ru": "\u041F\u0435\u0440\u0435\u0445\u043E\u0434 \u043A \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C\u0443 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0443 \u0433\u0430\u043B\u0435\u0440\u0435\u0438 \u043F\u043E\u0441\u043B\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0438\u044F \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0432\u0438\u0434\u0435\u043E.",
			"zh-CN": "\u89C6\u9891\u64AD\u653E\u7ED3\u675F\u65F6\u79FB\u52A8\u5230\u4E0B\u4E00\u4E2A\u56FE\u5E93\u9879\u76EE"
		},
		"Popup CSS style": {
			"ko": "\uD31D\uC5C5 CSS",
			"pt-BR": "Estilo CSS do popup",
			"ru": "\u0421\u0442\u0438\u043B\u044C CSS \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u5F39\u7A97 CSS \u6837\u5F0F"
		},
		"Custom CSS styles for the popup": {
			"pt-BR": "Estilos CSS personalizados para o popup",
			"ru": "\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0435 \u0441\u0442\u0438\u043B\u0438 CSS \u0434\u043B\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430.",
			"zh-CN": "\u81EA\u5B9A\u4E49\u5F39\u7A97\u7684 CSS \u6837\u5F0F"
		},
		"Most valid CSS is supported, with these differences:\n<ul><li>Multiline comments (<code>/* ... */</code>) are currently not supported</li>\n<li>Single comments (<code>// ...</code>) are supported, but only at the beginning of a line</li>\n<li><code>%thumburl%</code> is the URL of the thumbnail image. For example, you could use it like this: <code>background-image: url(%thumburl%)</code><br />\nThe URL is properly encoded, so quotes are not necessary (but not harmful either)</li>\n<li><code>%fullurl%</code> is the URL of the full image. If IMU fails to find a larger image, it will be the same as <code>%thumburl%</code></li>\n<li>Styles are <code>!important</code> by default</li></ul>\n<p>For Button CSS style, you can also customize the CSS for individual buttons through their IDs. For example:</p>\n<pre>\n#closebtn {\n  background-color: red;\n  // -imu-text allows you to set the text inside the button\n  -imu-text: \"Close\";\n  // -imu-title allows you to set the tooltip when hovering\n  -imu-title: \"Close the popup\";\n}\n#galleryprevbtn, #gallerynextbtn {\n  border-radius: 100px;\n}\n</pre>": {
			"pt-BR": "A maior parte do CSS v\u00E1lido \u00E9 suportada, com as seguintes diferen\u00E7as:\n<ul><li>Coment\u00E1rios multilinha (<code>/ ... */</code>) n\u00E3o s\u00E3o suportados no momento</li>\n<li>Coment\u00E1rios de linha \u00FAnica (<code>// ...</code>) s\u00E3o suportados, mas apenas no in\u00EDcio de uma linha</li>\n<li><code>%thumburl%</code> \u00E9 a URL da imagem em miniatura. Por exemplo, voc\u00EA pode us\u00E1-la assim: <code>background-image: url(%thumburl%)</code><br />\nA URL \u00E9 codificada corretamente, ent\u00E3o aspas n\u00E3o s\u00E3o necess\u00E1rias (mas tamb\u00E9m n\u00E3o s\u00E3o prejudiciais)</li>\n<li><code>%fullurl%</code> \u00E9 a URL da imagem completa. Se o IMU n\u00E3o conseguir encontrar uma imagem maior, ela ser\u00E1 a mesma que <code>%thumburl%</code></li>\n<li>Os estilos s\u00E3o <code>!important</code> por padr\u00E3o</li></ul>\n<p>Para o estilo CSS dos bot\u00F5es, voc\u00EA tamb\u00E9m pode personalizar o CSS para bot\u00F5es individuais atrav\u00E9s de seus IDs. Por exemplo:</p>\n<pre>\n#closebtn {\n  background-color: red;\n  // -imu-text permite definir o texto dentro do bot\u00E3o\n  -imu-text: \"Fechar\";\n  // -imu-title permite definir a dica de ferramenta ao passar o mouse\n  -imu-title: \"Fechar popup\";\n}\n#galleryprevbtn, #gallerynextbtn {\n  border-radius: 100px;\n}\n</pre>",
			"ru": "\u041F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0431\u043E\u043B\u044C\u0448\u0438\u043D\u0441\u0442\u0432\u043E \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u043E\u0433\u043E CSS, \u0441 \u044D\u0442\u0438\u043C\u0438 \u043E\u0442\u043B\u0438\u0447\u0438\u044F\u043C\u0438:\n<ul><li>\u041C\u043D\u043E\u0433\u043E\u0441\u0442\u0440\u043E\u0447\u043D\u044B\u0435 \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0438 (<code>/* ... */</code>) \u0432 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0435 \u0432\u0440\u0435\u043C\u044F \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044E\u0442\u0441\u044F</li>\n<li>\u041E\u0434\u0438\u043D\u043E\u0447\u043D\u044B\u0435 \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0438 (<code>// ...</code>) \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044E\u0442\u0441\u044F, \u043D\u043E \u0442\u043E\u043B\u044C\u043A\u043E \u0432 \u043D\u0430\u0447\u0430\u043B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438</li>\n<li><code>%thumburl%</code> - \u044D\u0442\u043E URL-\u0430\u0434\u0440\u0435\u0441 \u043C\u0438\u043D\u0438\u0430\u0442\u044E\u0440\u044B \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F. \u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0435\u0433\u043E \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u043C \u043E\u0431\u0440\u0430\u0437\u043E\u043C: <code>background-image: url(%thumburl%)</code><br />\nURL \u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u043E \u0437\u0430\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u043D, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043A\u0430\u0432\u044B\u0447\u043A\u0438 \u043D\u0435 \u043D\u0443\u0436\u043D\u044B (\u043D\u043E \u0438 \u043D\u0435 \u043D\u0430\u0432\u0440\u0435\u0434\u044F\u0442)</li>\n<li><code>%fullurl%</code> - \u044D\u0442\u043E URL-\u0430\u0434\u0440\u0435\u0441 \u043F\u043E\u043B\u043D\u043E\u0433\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F. \u0415\u0441\u043B\u0438 IMU \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u043D\u0430\u0439\u0442\u0438 \u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u043D\u043E\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435, \u043E\u043D\u043E \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043A\u0438\u043C \u0436\u0435, \u043A\u0430\u043A <code>%thumburl%</code></li>\n<li>\u0421\u0442\u0438\u043B\u0438 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E \u043A\u0430\u043A <code>!important</code></li></ul>\n<p>\u0414\u043B\u044F \u0441\u0442\u0438\u043B\u044F CSS \u043A\u043D\u043E\u043F\u043E\u043A, \u0432\u044B \u0442\u0430\u043A\u0436\u0435 \u043C\u043E\u0436\u0435\u0442\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0438\u0442\u044C CSS \u0434\u043B\u044F \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u044B\u0445 \u043A\u043D\u043E\u043F\u043E\u043A \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u0438\u0445 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u043E\u0432. \u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440:</p>\n<pre>\n#closebtn {\n  background-color: red;\n  // -imu-text \u043F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0442\u0435\u043A\u0441\u0442 \u0432\u043D\u0443\u0442\u0440\u0438 \u043A\u043D\u043E\u043F\u043A\u0438\n  -imu-text: \"\u0417\u0430\u043A\u0440\u044B\u0442\u044C\";\n  // -imu-title \u043F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0443\u044E \u043F\u043E\u0434\u0441\u043A\u0430\u0437\u043A\u0443 \u043F\u0440\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0438 \u043A\u0443\u0440\u0441\u043E\u0440\u0430\n  -imu-title: \"\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E\";\n}\n#galleryprevbtn, #gallerynextbtn {\n  border-radius: 100px;\n}\n</pre>",
			"zh-CN": "\u652F\u6301\u5927\u591A\u6570\u6709\u6548\u7684 CSS\uFF0C\u4F46\u6709\u4E0B\u5217\u5DEE\u5F02\uFF1A\n<ul><li>\u76EE\u524D\u4E0D\u652F\u6301\u591A\u884C\u6CE8\u91CA\uFF08<code>/* ... */</code>\uFF09</li>\n<li>\u652F\u6301\u5355\u884C\u6CE8\u91CA\uFF08<code>// ...</code>\uFF09\uFF0C\u4F46\u53EA\u80FD\u5728\u884C\u5F00\u5934</li>\n<li><code>%thumburl%</code> \u662F\u7F29\u7565\u56FE\u7684 URL\uFF0C\u4F8B\u5982\u53EF\u4EE5\u8FD9\u6837\u4F7F\u7528\u5B83\uFF1Abackground-image: url(%thumburl%)</code><br />\nURL \u88AB\u6B63\u786E\u7F16\u7801\uFF0C\u6240\u4EE5\u6CA1\u6709\u5FC5\u8981\u4F7F\u7528\u5F15\u53F7\uFF08\u4F46\u4F7F\u7528\u4E5F\u65E0\u5BB3\uFF09</li>\n<li><code>%fullurl%</code> \u662F\u5B8C\u6574\u56FE\u50CF\u7684 URL\u3002\u5982\u679C Image Max URL \u4E0D\u80FD\u627E\u5230\u4E00\u4E2A\u66F4\u5927\u7684\u56FE\u50CF\uFF0C\u5C06\u4E0E <code>%thumburl%</code> \u76F8\u540C</li>\n<li>\u6837\u5F0F\u9ED8\u8BA4 <code>!important</code></li></ul>\n<p>\u5BF9\u4E8E\u6309\u94AE CSS \u6837\u5F0F\uFF0C\u60A8\u4E5F\u53EF\u4EE5\u901A\u8FC7 id \u4E3A\u5355\u4E2A\u6309\u94AE\u5B9A\u5236 CSS\u3002\u4F8B\u5982\uFF1A</p>\n<pre>\n#closebtn {\n  background-color: red;\n  // -imu-text \u5141\u8BB8\u60A8\u8BBE\u7F6E\u6309\u94AE\u5185\u7684\u6587\u672C\n  -imu-text: \"Close\";\n  // -imu-title \u5141\u8BB8\u60A8\u8BBE\u7F6E\u60AC\u505C\u65F6\u7684\u5DE5\u5177\u63D0\u793A\n  -imu-title: \"Close the popup\";\n}\n#galleryprevbtn, #gallerynextbtn {\n  border-radius: 100px;\n}\n</pre>"
		},
		"Enable popup fade": {
			"pt-BR": "Habilitar efeito de fade no popup",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u044D\u0444\u0444\u0435\u043A\u0442 \u0437\u0430\u0442\u0443\u0445\u0430\u043D\u0438\u044F \u0434\u043B\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u542F\u7528\u5F39\u7A97\u8FC7\u6E21\u52A8\u753B"
		},
		"Enables a fade in/out effect when the popup is opened/closed": {
			"pt-BR": "Habilita um efeito de fade in/out quando o popup \u00E9 aberto/fechado",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u044D\u0444\u0444\u0435\u043A\u0442 \u0437\u0430\u0442\u0443\u0445\u0430\u043D\u0438\u044F/\u043F\u043E\u044F\u0432\u043B\u0435\u043D\u0438\u044F \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438/\u0437\u0430\u043A\u0440\u044B\u0442\u0438\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430.",
			"zh-CN": "\u542F\u7528\u5F39\u7A97\u6253\u5F00/\u5173\u95ED\u65F6\u7684\u6DE1\u5165/\u6DE1\u51FA\u6548\u679C"
		},
		"Enable zoom effect": {
			"pt-BR": "Habilitar efeito de zoom",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u044D\u0444\u0444\u0435\u043A\u0442 \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "\u542F\u7528\u7F29\u653E\u6548\u679C"
		},
		"Toggles whether the popup should 'zoom' when opened/closed": {
			"pt-BR": "Alterna se o popup deve aplicar 'zoom' ao abrir/fechar",
			"ru": "\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0430\u0435\u0442, \u0434\u043E\u043B\u0436\u043D\u043E \u043B\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E '\u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u044F' \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438/\u0437\u0430\u043A\u0440\u044B\u0442\u0438\u0438.",
			"zh-CN": "\u5207\u6362\u6253\u5F00/\u5173\u95ED\u5F39\u7A97\u65F6\u662F\u5426\u6709\u7F29\u653E\u6548\u679C"
		},
		"Move from thumbnail when zooming": {
			"pt-BR": "Mover da miniatura ao aplicar zoom",
			"ru": "\u041F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u043E\u0442 \u043C\u0438\u043D\u0438\u0430\u0442\u044E\u0440\u044B \u043F\u0440\u0438 \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0438",
			"zh-CN": "\u4ECE\u7F29\u7565\u56FE\u4E2D\u8DC3\u51FA\u7684\u7F29\u653E\u6548\u679C"
		},
		"Moves the popup from the thumbnail to the final location while zooming. The animation can be a little rough": {
			"pt-BR": "Move o popup da miniatura para o local final enquanto aplica o zoom. A anima\u00E7\u00E3o pode ser um pouco brusca",
			"ru": "\u041F\u0435\u0440\u0435\u043C\u0435\u0449\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043E\u0442 \u043C\u0438\u043D\u0438\u0430\u0442\u044E\u0440 \u0434\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0433\u043E \u043C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0432\u043E \u0432\u0440\u0435\u043C\u044F \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F. \u0410\u043D\u0438\u043C\u0430\u0446\u0438\u044F \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u043D\u0435\u043C\u043D\u043E\u0433\u043E \u0433\u0440\u0443\u0431\u043E\u0439.",
			"zh-CN": "\u4ECE\u7F29\u7565\u56FE\u53D8\u4E3A\u5F39\u7A97\u65F6\u7684\u7F29\u653E\u52A8\u753B\u6548\u679C\u3002\u52A8\u753B\u53EF\u80FD\u6709\u70B9\u7C97\u7CD9"
		},
		"Popup animation time": {
			"pt-BR": "Tempo de anima\u00E7\u00E3o do popup",
			"ru": "\u0412\u0440\u0435\u043C\u044F \u0430\u043D\u0438\u043C\u0430\u0446\u0438\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430",
			"zh-CN": "\u5F39\u7A97\u52A8\u753B\u65F6\u957F"
		},
		"Fade/zoom animation duration (in milliseconds) for the popup": {
			"pt-BR": "Dura\u00E7\u00E3o da anima\u00E7\u00E3o de fade/zoom (em milissegundos) para o popup",
			"ru": "\u0423\u043C\u0435\u043D\u044C\u0448\u0435\u043D\u0438\u0435/\u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u0438\u0435 \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u0438 \u0430\u043D\u0438\u043C\u0430\u0446\u0438\u0438 (\u0432 \u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430\u0445) \u0434\u043B\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430.",
			"zh-CN": "\u5F39\u7A97\u7684\u6DE1\u51FA/\u7F29\u653E\u52A8\u753B\u6301\u7EED\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09"
		},
		"Enable background CSS": {
			"pt-BR": "Habilitar CSS de fundo",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0444\u043E\u043D CSS",
			"zh-CN": "\u542F\u7528\u80CC\u666F CSS"
		},
		"Toggles whether CSS styles for the background when the popup is active is enabled": {
			"pt-BR": "Alterna se os estilos CSS para o fundo quando o popup est\u00E1 ativo est\u00E3o habilitados",
			"ru": "\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0430\u0435\u0442, \u0432\u043A\u043B\u044E\u0447\u0435\u043D\u044B \u043B\u0438 \u0441\u0442\u0438\u043B\u0438 CSS \u0434\u043B\u044F \u0444\u043E\u043D\u0430, \u043A\u043E\u0433\u0434\u0430 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0430\u043A\u0442\u0438\u0432\u043D\u043E.",
			"zh-CN": "\u5207\u6362\u5F53\u5F39\u51FA\u7A97\u53E3\u5904\u4E8E\u6D3B\u52A8\u72B6\u6001\u65F6\u662F\u5426\u542F\u7528\u80CC\u666F\u7684 CSS \u6837\u5F0F"
		},
		"On hold": {
			"pt-BR": "Em espera",
			"ru": "\u041F\u0440\u0438 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043D\u0438\u0438",
			"zh-CN": "\u4FDD\u6301\u73B0\u72B6"
		},
		"No": {
			"pt-BR": "N\u00E3o",
			"ru": "\u041D\u0435\u0442",
			"zh-CN": "\u4E0D\u542F\u7528"
		},
		"Background CSS style": {
			"pt-BR": "Estilo CSS do fundo",
			"ru": "\u0421\u0442\u0438\u043B\u044C CSS \u0434\u043B\u044F \u0444\u043E\u043D\u0430",
			"zh-CN": "\u80CC\u666F CSS \u6837\u5F0F"
		},
		"CSS style for the background when the popup is active. See the documentation for Popup CSS style for more information (the thumb/full URL variables aren't supported here)": {
			"pt-BR": "Estilo CSS para o fundo quando o popup est\u00E1 ativo. Consulte a documenta\u00E7\u00E3o do Estilo CSS do Popup para mais informa\u00E7\u00F5es (as vari\u00E1veis thumb/full URL n\u00E3o s\u00E3o suportadas aqui)",
			"ru": "\u0421\u0442\u0438\u043B\u044C CSS \u0434\u043B\u044F \u0444\u043E\u043D\u0430, \u043A\u043E\u0433\u0434\u0430 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0430\u043A\u0442\u0438\u0432\u043D\u043E. \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0441\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0441\u043C\u043E\u0442\u0440\u0438\u0442\u0435 \u0432 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u0438 '\u0421\u0442\u0438\u043B\u0438\u0437\u0430\u0446\u0438\u044F CSS \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430' (\u0437\u0434\u0435\u0441\u044C \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044E\u0442\u0441\u044F \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435 URL thumb/full).",
			"zh-CN": "\u5F39\u7A97\u5F00\u542F\u65F6\u7528\u4E8E\u80CC\u666F\u7684 CSS \u6837\u5F0F\u3002\u66F4\u591A\u4FE1\u606F\u8BE6\u89C1\u201C\u5F39\u7A97 CSS \u6837\u5F0F\u201D\u6587\u6863\uFF08\u6B64\u5904\u4E0D\u652F\u6301 thumb/full URL \u53D8\u91CF\uFF09"
		},
		"Background fade": {
			"pt-BR": "Fade (esmaecimento) do fundo",
			"ru": "\u0417\u0430\u0442\u0443\u0445\u0430\u043D\u0438\u0435 \u0444\u043E\u043D\u0430",
			"zh-CN": "\u80CC\u666F\u6DE1\u5165/\u6DE1\u51FA"
		},
		"Fade in/out time (in milliseconds) for the page background, set to 0 to disable": {
			"pt-BR": "Tempo de fade in/out (em milissegundos) para o fundo da p\u00E1gina, defina como 0 para desativar",
			"ru": "\u0412\u0440\u0435\u043C\u044F \u0437\u0430\u0442\u0443\u0445\u0430\u043D\u0438\u044F/\u043F\u043E\u044F\u0432\u043B\u0435\u043D\u0438\u044F (\u0432 \u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430\u0445) \u0434\u043B\u044F \u0444\u043E\u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B. 0 - \u043E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C",
			"zh-CN": "\u9875\u9762\u80CC\u666F\u7684\u6DE1\u5165/\u6DE1\u51FA\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09 \uFF0C\u8BBE\u4E3A 0 \u5219\u7981\u7528"
		},
		"ms": {
			"pt-BR": "ms",
			"ru": "\u043C\u0441",
			"zh-CN": "\u6BEB\u79D2"
		},
		"Button CSS style": {
			"pt-BR": "Estilo CSS dos bot\u00F5es",
			"ru": "\u0421\u0442\u0438\u043B\u044C CSS \u0434\u043B\u044F \u043A\u043D\u043E\u043F\u043E\u043A",
			"zh-CN": "\u6309\u94AE CSS \u6837\u5F0F"
		},
		"Custom CSS styles for the popup's UI buttons. See the documentation for Popup CSS style for more information (the thumb/full URL variables aren't supported here)": {
			"pt-BR": "Estilos CSS personalizados para os bot\u00F5es da interface do popup. Consulte a documenta\u00E7\u00E3o do Estilo CSS do Popup para obter mais informa\u00E7\u00F5es (as vari\u00E1veis thumb/full URL n\u00E3o s\u00E3o suportadas aqui)",
			"ru": "\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0435 \u0441\u0442\u0438\u043B\u0438 CSS \u0434\u043B\u044F \u043A\u043D\u043E\u043F\u043E\u043A \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u043E\u0433\u043E \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430. \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0441\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0441\u043C\u043E\u0442\u0440\u0438\u0442\u0435 \u0432 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u0438 '\u0421\u0442\u0438\u043B\u0438\u0437\u0430\u0446\u0438\u044F CSS \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430' (\u0437\u0434\u0435\u0441\u044C \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044E\u0442\u0441\u044F \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435 URL thumb/full).",
			"zh-CN": "\u4E3A\u5F39\u7A97\u4E2D\u754C\u9762\u7684\u6309\u94AE\u81EA\u5B9A\u4E49 CSS \u6837\u5F0F\u3002\u66F4\u591A\u4FE1\u606F\u8BE6\u89C1\u201C\u5F39\u7A97 CSS \u6837\u5F0F\u201D\u6587\u6863\uFF08\u6B64\u5904\u4E0D\u652F\u6301 thumb/full URL \u53D8\u91CF\uFF09"
		},
		"Don't popup blacklisted URLs": {
			"pt-BR": "N\u00E3o exibir URLs na lista negra em popup",
			"ru": "\u041D\u0435 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0447\u0451\u0440\u043D\u044B\u0435 \u0441\u043F\u0438\u0441\u043A\u0438 URL-\u0430\u0434\u0440\u0435\u0441\u043E\u0432 \u0432\u043E \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u043C \u043E\u043A\u043D\u0435",
			"zh-CN": "\u5DF2\u5217\u5165\u9ED1\u540D\u5355\u7684\u7F51\u5740\u4E0D\u8981\u5F39\u7A97"
		},
		"This option popping up for source media with blacklisted URLs. If this is disabled, the popup will open if the end URL isn't blacklisted, regardless of whether the source is blacklisted.": {
			"pt-BR": "Essa op\u00E7\u00E3o impede a exibi\u00E7\u00E3o em popup de m\u00EDdia de origem com URLs na lista negra. Se desativada, o popup abrir\u00E1 se a URL final n\u00E3o estiver na lista negra, independentemente da origem estar ou n\u00E3o.",
			"ru": "\u042D\u0442\u043E\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u0435\u0442 \u0434\u043B\u044F \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u043C\u0435\u0434\u0438\u0430 \u0441 URL-\u0430\u0434\u0440\u0435\u0441\u0430\u043C\u0438 \u0432 \u0447\u0451\u0440\u043D\u044B\u0439 \u0441\u043F\u0438\u0441\u043E\u043A. \u0415\u0441\u043B\u0438 \u044D\u0442\u043E\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D, \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043E\u0442\u043A\u0440\u043E\u0435\u0442\u0441\u044F, \u0435\u0441\u043B\u0438 \u043A\u043E\u043D\u0435\u0447\u043D\u044B\u0439 URL-\u0430\u0434\u0440\u0435\u0441 \u043D\u0435 \u0432\u043D\u0435\u0441\u0451\u043D \u0432 \u0447\u0451\u0440\u043D\u044B\u0439 \u0441\u043F\u0438\u0441\u043E\u043A, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u043E\u0433\u043E, \u0432\u043D\u0435\u0441\u0435\u043D \u043B\u0438 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A \u0432 \u0447\u0451\u0440\u043D\u044B\u0439 \u0441\u043F\u0438\u0441\u043E\u043A.",
			"zh-CN": "\u5982\u679C\u7981\u7528\u6B64\u9009\u9879\uFF0C\u5373\u4FBF\u6E90\u5730\u5740\u88AB\u5217\u5165\u9ED1\u540D\u5355\uFF0C\u53EA\u8981\u672B\u7AEF\u7F51\u5740\u6CA1\u6709\u5217\u5165\u9ED1\u540D\u5355\uFF0C\u5C31\u6253\u5F00\u5F39\u7A97\u3002"
		},
		"Use media blacklist for host websites": {
			"pt-BR": "Usar lista negra de m\u00EDdia para sites de hospedagem"
		},
		"Overrides the host blacklist to use the media blacklist (specified under Rules)": {
			"pt-BR": "Substitui a lista negra de hosts para usar a lista negra de m\u00EDdia (especificada em Regras)"
		},
		"Don't popup different media type": {
			"pt-BR": "N\u00E3o exibir tipo de m\u00EDdia diferente em popup",
			"ru": "\u041D\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0438\u0445 \u043E\u043A\u043E\u043D \u0434\u043B\u044F \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043F\u043E\u0432 \u043C\u0435\u0434\u0438\u0430",
			"zh-CN": "\u4E0D\u8981\u5F39\u51FA\u4E0D\u540C\u7684\u5A92\u4F53\u7C7B\u578B"
		},
		"This option prevents the popup from loading a video when the source was an image or vice-versa": {
			"pt-BR": "Esta op\u00E7\u00E3o impede que o popup carregue um v\u00EDdeo quando a fonte for uma imagem ou vice-versa",
			"ru": "\u042D\u0442\u043E\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0437\u0430\u043F\u0440\u0435\u0449\u0430\u0435\u0442 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u043C\u0443 \u043E\u043A\u043D\u0443 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044C \u0432\u0438\u0434\u0435\u043E, \u0435\u0441\u043B\u0438 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u043C \u0431\u044B\u043B\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435, \u0438\u043B\u0438 \u043D\u0430\u043E\u0431\u043E\u0440\u043E\u0442.",
			"zh-CN": "\u6B64\u9009\u9879\u53EF\u907F\u514D\u6E90\u662F\u56FE\u50CF\u65F6\u5F39\u7A97\u52A0\u8F7D\u89C6\u9891\uFF0C\u53CD\u4E4B\u4EA6\u7136"
		},
		"Allow popup when fullscreen": {
			"pt-BR": "Permitir popup em tela cheia",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0438\u0435 \u043E\u043A\u043D\u0430 \u0432 \u043F\u043E\u043B\u043D\u043E\u044D\u043A\u0440\u0430\u043D\u043D\u043E\u043C \u0440\u0435\u0436\u0438\u043C\u0435",
			"zh-CN": "\u5141\u8BB8\u5168\u5C4F\u65F6\u5F39\u7A97"
		},
		"Allows the popup to open if an element (such as a video player) is fullscreen.": {
			"pt-BR": "Permite que o popup seja aberto se um elemento (como um player de v\u00EDdeo) estiver em tela cheia.",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E, \u0435\u0441\u043B\u0438 \u044D\u043B\u0435\u043C\u0435\u043D\u0442 (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u0432\u0438\u0434\u0435\u043E\u043F\u043B\u0435\u0435\u0440) \u043D\u0430\u0445\u043E\u0434\u0438\u0442\u0441\u044F \u0432 \u043F\u043E\u043B\u043D\u043E\u044D\u043A\u0440\u0430\u043D\u043D\u043E\u043C \u0440\u0435\u0436\u0438\u043C\u0435.",
			"zh-CN": "\u5141\u8BB8\u5B58\u5728\u5168\u5C4F\u5143\u7D20\uFF08\u5982\u89C6\u9891\u64AD\u653E\u5668\uFF09\u65F6\u6253\u5F00\u5F39\u7A97\u3002"
		},
		"Element finding mode": {
			"pt-BR": "Modo de localiza\u00E7\u00E3o de elemento",
			"ru": "\u0420\u0435\u0436\u0438\u043C \u043F\u043E\u0438\u0441\u043A\u0430 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432",
			"zh-CN": "\u5143\u7D20\u67E5\u627E\u6A21\u5F0F"
		},
		"How IMU should find the media element on the page.": {
			"pt-BR": "Como o maxurl deve encontrar o elemento de m\u00EDdia na p\u00E1gina.",
			"ru": "\u041A\u0430\u043A IMU \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043A\u0430\u0442\u044C \u043C\u0435\u0434\u0438\u0430-\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435.",
			"zh-CN": "Image Max URL \u5E94\u5982\u4F55\u67E5\u627E\u9875\u9762\u4E0A\u7684\u5A92\u4F53\u5143\u7D20\u3002"
		},
		"This will result in a much higher CPU load for websites such as Facebook, and will occasionally return the wrong element.\nUse this option with caution.": {
			"pt-BR": "Isso resultar\u00E1 em uma carga de CPU muito maior para sites como o Facebook e ocasionalmente retornar\u00E1 o elemento errado.\nUse esta op\u00E7\u00E3o com cautela.",
			"ru": "\u042D\u0442\u043E \u043F\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043A \u0433\u043E\u0440\u0430\u0437\u0434\u043E \u0431\u043E\u043B\u0435\u0435 \u0432\u044B\u0441\u043E\u043A\u043E\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0435 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u043E\u0440\u0430 \u0434\u043B\u044F \u0442\u0430\u043A\u0438\u0445 \u0441\u0430\u0439\u0442\u043E\u0432, \u043A\u0430\u043A Facebook, \u0438 \u0438\u043D\u043E\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044C \u043D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u044B\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442.\n\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u044D\u0442\u043E\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0441 \u043E\u0441\u0442\u043E\u0440\u043E\u0436\u043D\u043E\u0441\u0442\u044C\u044E.",
			"zh-CN": "\u5BF9\u8BF8\u5982 Facebook \u7B49\u7F51\u7AD9\uFF0C\u8FD9\u5C06\u5BFC\u81F4\u5F88\u9AD8\u7684 CPU \u8D1F\u8F7D\uFF0C\u4E14\u5076\u5C14\u4F1A\u8FD4\u56DE\u9519\u8BEF\u7684\u5143\u7D20\u3002\n\u8C28\u614E\u4F7F\u7528\u6B64\u9009\u9879\u3002"
		},
		"Full": {
			"pt-BR": "Completo",
			"ru": "\u041F\u043E\u043B\u043D\u044B\u0439",
			"zh-CN": "\u5168\u9762"
		},
		"Manually looks through every element on the page to see if the cursor is above them. This will result in a higher CPU load for websites such as Facebook, and may return the wrong element": {
			"pt-BR": "Procura manualmente por cada elemento na p\u00E1gina para ver se o cursor est\u00E1 sobre eles. Isso resultar\u00E1 em uma maior carga de CPU para sites como o Facebook e pode retornar o elemento errado",
			"ru": "\u0412\u0440\u0443\u0447\u043D\u0443\u044E \u043F\u0440\u043E\u0441\u043C\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043A\u0430\u0436\u0434\u044B\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435, \u0447\u0442\u043E\u0431\u044B \u0443\u0432\u0438\u0434\u0435\u0442\u044C, \u043D\u0430\u0445\u043E\u0434\u0438\u0442\u0441\u044F \u043B\u0438 \u043A\u0443\u0440\u0441\u043E\u0440 \u043D\u0430\u0434 \u043D\u0438\u043C\u0438. \u042D\u0442\u043E \u043F\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043A \u0431\u043E\u043B\u0435\u0435 \u0432\u044B\u0441\u043E\u043A\u043E\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0435 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u043E\u0440\u0430 \u0434\u043B\u044F \u0442\u0430\u043A\u0438\u0445 \u0441\u0430\u0439\u0442\u043E\u0432, \u043A\u0430\u043A Facebook, \u0438 \u043C\u043E\u0436\u0435\u0442 \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u043D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u044B\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442.",
			"zh-CN": "\u9010\u4E00\u68C0\u67E5\u9875\u9762\u4E0A\u7684\u6BCF\u4E2A\u5143\u7D20\uFF0C\u770B\u9F20\u6807\u6307\u9488\u662F\u5426\u5728\u4E0A\u9762\u3002\u8FD9\u5C06\u5BFC\u81F4\u5F88\u9AD8\u7684 CPU \u8D1F\u8F7D\uFF0C\u4E14\u5076\u5C14\u4F1A\u8FD4\u56DE\u9519\u8BEF\u7684\u5143\u7D20"
		},
		"Hybrid": {
			"pt-BR": "H\u00EDbrido",
			"ru": "\u0413\u0438\u0431\u0440\u0438\u0434\u043D\u044B\u0439",
			"zh-CN": "\u6DF7\u5408"
		},
		"Looks manually through every child element of the last element found by `getElementsAtPoint`. Use this option if in doubt, it'll work on most sites": {
			"pt-BR": "Procura manualmente em cada elemento filho do \u00FAltimo elemento encontrado por `getElementsAtPoint`. Use esta op\u00E7\u00E3o em caso de d\u00FAvida, funcionar\u00E1 na maioria dos sites",
			"ru": "\u041F\u0440\u043E\u0441\u043C\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u0432\u0440\u0443\u0447\u043D\u0443\u044E \u043A\u0430\u0436\u0434\u044B\u0439 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0439 \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0433\u043E \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430, \u043D\u0430\u0439\u0434\u0435\u043D\u043D\u043E\u0433\u043E \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E `getElementsAtPoint`. \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u044D\u0442\u043E\u0442 \u0432\u0430\u0440\u0438\u0430\u043D\u0442, \u0435\u0441\u043B\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044C \u0441\u043E\u043C\u043D\u0435\u043D\u0438\u044F. \u041E\u043D \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C \u043D\u0430 \u0431\u043E\u043B\u044C\u0448\u0438\u043D\u0441\u0442\u0432\u0435 \u0441\u0430\u0439\u0442\u043E\u0432.",
			"zh-CN": "\u9010\u4E00\u68C0\u67E5\u7528 `getElementsAtPoint` \u627E\u5230\u7684\u6700\u540E\u4E00\u4E2A\u5143\u7D20\u7684\u6BCF\u4E2A\u5B50\u5143\u7D20\u3002\u5982\u679C\u4E0D\u4E86\u89E3\uFF0C\u4F7F\u7528\u6B64\u9009\u9879\uFF0C\u5B83\u9002\u7528\u4E8E\u7EDD\u5927\u591A\u6570\u7F51\u7AD9"
		},
		"Simple": {
			"pt-BR": "Simples",
			"ru": "\u041F\u0440\u043E\u0441\u0442\u043E\u0439",
			"zh-CN": "\u7B80\u6613"
		},
		"This is the fastest option, which uses the value of `getElementsAtPoint` without modification. Works for sites that don't use pointer-events:none and shadow DOM": {
			"pt-BR": "Esta \u00E9 a op\u00E7\u00E3o mais r\u00E1pida, que usa o valor de `getElementsAtPoint` sem modifica\u00E7\u00E3o. Funciona para sites que n\u00E3o usam pointer-events: none e shadow DOM",
			"ru": "\u042D\u0442\u043E \u0441\u0430\u043C\u044B\u0439 \u0431\u044B\u0441\u0442\u0440\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 `getElementsAtPoint` \u0431\u0435\u0437 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0439. \u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u0434\u043B\u044F \u0441\u0430\u0439\u0442\u043E\u0432, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u043D\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u044E\u0442 pointer-events:none \u0438 shadow DOM.",
			"zh-CN": "\u8FD9\u662F\u6700\u5FEB\u7684\u9009\u9879\uFF0C\u5B83\u4F7F\u7528 `getElementsAtPoint` \u7684\u503C\u800C\u4E0D\u505A\u4FEE\u6539\u3002\u9002\u7528\u4E8E\u4E0D\u4F7F\u7528 pointer-events:none \u548C shadow DOM \u7684\u7F51\u7AD9"
		},
		"Use cache": {
			"pt-BR": "Usar cache",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043A\u044D\u0448",
			"zh-CN": "\u4F7F\u7528\u7F13\u5B58"
		},
		"Allows use of a media cache for the popup. The cache is currently stored per-page and is not persistent across page reloads.": {
			"pt-BR": "Permite o uso de um cache de m\u00EDdia para o popup. O cache \u00E9 armazenado por p\u00E1gina e n\u00E3o \u00E9 persistente entre recarregamentos de p\u00E1gina.",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043C\u0435\u0434\u0438\u0430-\u043A\u0435\u0448 \u0434\u043B\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430. \u041A\u044D\u0448 \u0432 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0435 \u0432\u0440\u0435\u043C\u044F \u0445\u0440\u0430\u043D\u0438\u0442\u0441\u044F \u0434\u043B\u044F \u043A\u0430\u0436\u0434\u043E\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u0438 \u043D\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F \u043F\u0440\u0438 \u043F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B.",
			"zh-CN": "\u5141\u8BB8\u5F39\u7A97\u7F13\u5B58\u5A92\u4F53\u3002\u7F13\u5B58\u76EE\u524D\u4E0D\u8DE8\u9875\u5171\u4EAB\uFF0C\u5E76\u4E14\u4E0D\u4F1A\u6301\u4E45\u5316\uFF08\u91CD\u65B0\u52A0\u8F7D\u5373\u5931\u6548\uFF09\u3002"
		},
		"Cache duration": {
			"pt-BR": "Dura\u00E7\u00E3o do cache",
			"ru": "\u0414\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C \u043A\u044D\u0448\u0430",
			"zh-CN": "\u7F13\u5B58\u6301\u7EED\u65F6\u95F4"
		},
		"How long for media to remain cached. Set to `0` for unlimited.": {
			"pt-BR": "Por quanto tempo a m\u00EDdia permanecer\u00E1 em cache. Defina como `0` para ilimitado.",
			"ru": "\u041A\u0430\u043A \u0434\u043E\u043B\u0433\u043E \u043C\u0435\u0434\u0438\u0430 \u0431\u0443\u0434\u0443\u0442 \u043E\u0441\u0442\u0430\u0432\u0430\u0442\u044C\u0441\u044F \u0432 \u043A\u044D\u0448\u0435. `0` - \u0432\u0441\u0435\u0433\u0434\u0430.",
			"zh-CN": "\u5A92\u4F53\u88AB\u7F13\u5B58\u591A\u4E45\u3002\u8BBE\u4E3A 0 \u5219\u65E0\u9650\u5236\u3002"
		},
		"minutes": {
			"pt-BR": "minutos",
			"ru": "\u043C\u0438\u043D.",
			"zh-CN": "\u5206\u949F"
		},
		"Cache item limit": {
			"pt-BR": "Limite de itens no cache",
			"ru": "\u041E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u0435 \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432 \u043A\u044D\u0448\u0430",
			"zh-CN": "\u7F13\u5B58\u6570\u91CF\u9650\u5236"
		},
		"Maximum number of individual media to remain cached. Set to `0` for unlimited.": {
			"pt-BR": "N\u00FAmero m\u00E1ximo de m\u00EDdias individuais para permanecerem em cache. Defina como `0` para ilimitado.",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u044B\u0445 \u043C\u0435\u0434\u0438\u0430 \u0434\u043B\u044F \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F \u0432 \u043A\u044D\u0448\u0435. `0` - \u0431\u0435\u0437 \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F.",
			"zh-CN": "\u6700\u591A\u7F13\u5B58\u591A\u5C11\u4E2A\u5A92\u4F53\u3002\u8BBE\u4E3A 0 \u5219\u65E0\u9650\u5236\u3002"
		},
		"items": {
			"pt-BR": "itens",
			"ru": "\u044D\u043B.",
			"zh-CN": "\u9879"
		},
		"Resume videos": {
			"pt-BR": "Retomar v\u00EDdeos",
			"ru": "\u0412\u043E\u0437\u043E\u0431\u043D\u043E\u0432\u043B\u044F\u0442\u044C \u0432\u0438\u0434\u0435\u043E",
			"zh-CN": "\u7EE7\u7EED\u89C6\u9891"
		},
		"If a video popup was closed then reopened, the video will resume from where it left off": {
			"pt-BR": "Se um popup de v\u00EDdeo foi fechado e reaberto, o v\u00EDdeo ser\u00E1 retomado de onde parou",
			"ru": "\u0415\u0441\u043B\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0432\u0438\u0434\u0435\u043E \u0431\u044B\u043B\u043E \u0437\u0430\u043A\u0440\u044B\u0442\u043E, \u0430 \u0437\u0430\u0442\u0435\u043C \u0441\u043D\u043E\u0432\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u043E, \u0432\u0438\u0434\u0435\u043E \u0432\u043E\u0437\u043E\u0431\u043D\u043E\u0432\u0438\u0442\u0441\u044F \u0441 \u0442\u043E\u0433\u043E \u043C\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u043E\u043D\u043E \u0431\u044B\u043B\u043E \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u043E.",
			"zh-CN": "\u5982\u679C\u4E00\u4E2A\u89C6\u9891\u5F39\u7A97\u88AB\u5173\u95ED\u7136\u540E\u518D\u6B21\u6253\u5F00\uFF0C\u8BE5\u89C6\u9891\u5C06\u4ECE\u4E0A\u6B21\u79BB\u5F00\u7684\u8FDB\u5EA6\u7EE7\u7EED\u64AD\u653E"
		},
		"Use userscript": {
			"fr": "Utiliser ce userscript",
			"ko": "\uC720\uC800\uC2A4\uD06C\uB9BD\uD2B8 \uC0AC\uC6A9\uD558\uAE30",
			"pt-BR": "Usar script do usu\u00E1rio",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 \u0441\u043A\u0440\u0438\u043F\u0442",
			"zh-CN": "\u4F7F\u7528\u7528\u6237\u811A\u672C"
		},
		"Replaces the website's IMU instance with the userscript": {
			"pt-BR": "Substitui a inst\u00E2ncia do maxurl do site pelo script do usu\u00E1rio",
			"ru": "\u0417\u0430\u043C\u0435\u043D\u044F\u0435\u0442 \u0441\u0430\u0439\u0442 \u044D\u043A\u0437\u0435\u043C\u043F\u043B\u044F\u0440\u0430 IMU \u043D\u0430 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 \u0441\u043A\u0440\u0438\u043F\u0442.",
			"zh-CN": "\u4F7F\u7528\u7528\u6237\u811A\u672C\u66FF\u6362\u8BE5\u7F51\u7AD9\u7684 Image Max URL \u5B9E\u4F8B"
		},
		"Website image preview": {
			"ko": "\uB9C1\uD06C \uBD99\uC778 \uD6C4 \uC774\uBBF8\uC9C0 \uBBF8\uB9AC\uBCF4\uAE30",
			"pt-BR": "Pr\u00E9via da imagem no site",
			"ru": "\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u0441\u0430\u0439\u0442\u0430",
			"zh-CN": "\u7F51\u7AD9\u56FE\u7247\u9884\u89C8"
		},
		"Enables a preview of the image on the Image Max URL website": {
			"pt-BR": "Habilita a pr\u00E9via da imagem no site Image Max URL",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043D\u0430 \u0441\u0430\u0439\u0442\u0435 Image Max URL",
			"zh-CN": "\u5141\u8BB8\u5728 Image Max URL \u7F51\u7AD9\u4E0A\u9884\u89C8\u56FE\u7247"
		},
		"IMU entry in context menu": {
			"pt-BR": "Entrada do maxurl no menu de contexto",
			"ru": "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C IMU \u0432 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u043D\u043E\u0435 \u043C\u0435\u043D\u044E",
			"zh-CN": "\u53F3\u952E\u83DC\u5355\u4E2D\u7684 Image Max URL \u9879"
		},
		"Enables a custom entry for this extension in the right click/context menu": {
			"pt-BR": "Habilita uma entrada personalizada para esta extens\u00E3o no menu de contexto/clique com o bot\u00E3o direito",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0443\u044E \u0437\u0430\u043F\u0438\u0441\u044C \u0434\u043B\u044F \u044D\u0442\u043E\u0433\u043E \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F \u0432 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u043D\u043E\u043C \u043C\u0435\u043D\u044E (\u043D\u0430\u0436\u0430\u0442\u0438\u0435 \u043F\u0440\u0430\u0432\u043E\u0439 \u043A\u043D\u043E\u043F\u043A\u043E\u0439 \u043C\u044B\u0448\u0438).",
			"zh-CN": "\u53F3\u952E\u83DC\u5355/\u4E0A\u4E0B\u6587\u83DC\u5355\u4E2D\u542F\u7528\u672C\u6269\u5C55\u5B9A\u4E49\u7684\u83DC\u5355"
		},
		"Hot (re)load": {
			"pt-BR": "(Re)carregamento din\u00E2mico",
			"ru": "\u0413\u043E\u0440\u044F\u0447\u0430\u044F (\u043F\u0435\u0440\u0435)\u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0430",
			"zh-CN": "\u70ED\u91CD\u8F7D"
		},
		"(Re)loads the extension on all existing pages when installing or updating": {
			"pt-BR": "(Re)carrega a extens\u00E3o em todas as p\u00E1ginas existentes ao instalar ou atualizar",
			"ru": "(\u041F\u0435\u0440\u0435)\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435 \u043D\u0430 \u0432\u0441\u0435\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430\u0445 \u043F\u0440\u0438 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0435 \u0438\u043B\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0438.",
			"zh-CN": "\u5B89\u88C5\u6216\u66F4\u65B0\u540E\uFF0C\u70ED\u91CD\u8F7D\u73B0\u6709\u7684\u5168\u90E8\u9875\u9762\u4E0A\u7684\u672C\u6269\u5C55"
		},
		"Custom XHR for libraries": {
			"pt-BR": "XHR personalizado para bibliotecas",
			"ru": "\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0439 XHR \u0434\u043B\u044F \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A",
			"zh-CN": "\u81EA\u5B9A\u4E49\u7A0B\u5E8F\u5E93\u7684 XHR"
		},
		"Allows the use of more powerful XHR (network requests) for 3rd-party libraries. This allows for certain DASH streams to work.": {
			"pt-BR": "Permite o uso de XHR (solicita\u00E7\u00F5es de rede) mais poderosos para bibliotecas de terceiros. Isso permite que certos fluxos DASH funcionem.",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0431\u043E\u043B\u0435\u0435 \u043C\u043E\u0449\u043D\u044B\u0435 XHR (\u0441\u0435\u0442\u0435\u0432\u044B\u0435 \u0437\u0430\u043F\u0440\u043E\u0441\u044B) \u0434\u043B\u044F \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u0445 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A. \u042D\u0442\u043E \u043F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u043C \u043F\u043E\u0442\u043E\u043A\u0430\u043C DASH.",
			"zh-CN": "\u5141\u8BB8\u7B2C\u4E09\u65B9\u5E93\u4F7F\u7528\u66F4\u5F3A\u5927\u7684 XHR\uFF08\u7F51\u7EDC\u8BF7\u6C42\uFF09\u3002\u67D0\u4E9B DASH \u6D41\u5A92\u4F53\u9700\u8981\u8FD9\u4E2A\u3002"
		},
		"Allows the use of more powerful XHR  (network requests) for 3rd-party libraries. This allows for certain DASH streams to work. Using this with the userscript version currently poses a potential security risk.": {
			"pt-BR": "Permite o uso de XHR (solicita\u00E7\u00F5es de rede) mais poderosos para bibliotecas de terceiros. Isso permite que certos fluxos DASH funcionem. Usar isso com a vers\u00E3o do script do usu\u00E1rio atualmente representa um risco potencial \u00E0 seguran\u00E7a.",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0431\u043E\u043B\u0435\u0435 \u043C\u043E\u0449\u043D\u044B\u0435 XHR (\u0441\u0435\u0442\u0435\u0432\u044B\u0435 \u0437\u0430\u043F\u0440\u043E\u0441\u044B) \u0434\u043B\u044F \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u0445 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A. \u042D\u0442\u043E \u043F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u043C \u043F\u043E\u0442\u043E\u043A\u0430\u043C DASH. \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435 \u0435\u0433\u043E \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u043E\u0433\u043E \u0441\u043A\u0440\u0438\u043F\u0442\u0430 \u0432 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0435 \u0432\u0440\u0435\u043C\u044F \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u0442 \u0441\u043E\u0431\u043E\u0439 \u043F\u043E\u0442\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0438\u0441\u043A \u0434\u043B\u044F \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u043E\u0441\u0442\u0438.",
			"zh-CN": "\u5141\u8BB8\u7B2C\u4E09\u65B9\u5E93\u4F7F\u7528\u66F4\u5F3A\u5927\u7684 XHR\uFF08\u7F51\u7EDC\u8BF7\u6C42\uFF09\u3002\u67D0\u4E9B DASH \u6D41\u5A92\u4F53\u9700\u8981\u8FD9\u4E2A\u3002\u5728\u76EE\u524D\u7684\u7528\u6237\u811A\u672C\u7248\u672C\u4E2D\u4F7F\u7528\u8FD9\u79CD\u65B9\u6CD5\u6784\u6210\u6F5C\u5728\u7684\u5B89\u5168\u98CE\u9669\u3002"
		},
		"Kakao": {
			"pt-BR": "Kakao",
			"ru": "Kakao",
			"zh-CN": "Kakao"
		},
		"YouTube": {
			"pt-BR": "YouTube",
			"ru": "YouTube",
			"zh-CN": "YouTube"
		},
		"Instagram (downloading)": {
			"pt-BR": "Instagram (download)",
			"ru": "Instagram (\u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0435)",
			"zh-CN": "Instagram (\u4E0B\u8F7D)"
		},
		"Bypass CSP for libraries": {
			"pt-BR": "Ignorar CSP para bibliotecas"
		},
		"Tries loading the 3rd-party libraries using a `<script>` tag if a page's CSP prevents it from being loaded normally.\nThis option currently carries an increased security risk when combined with \"Custom XHR for libraries\", and should only be enabled if absolutely necessary.": {
			"pt-BR": "Tenta carregar as bibliotecas de terceiros usando uma tag <script> se o CSP de uma p\u00E1gina impedir que seja carregada normalmente.\nAtualmente, esta op\u00E7\u00E3o acarreta um risco de seguran\u00E7a aumentado quando combinada com \"XHR Personalizado para bibliotecas\" e s\u00F3 deve ser ativada se absolutamente necess\u00E1rio."
		},
		"This can potentially be extremely insecure if \"Custom XHR for libraries\" is also enabled.\nA malicious website could gain extension-level permissions and perform arbitrary requests (your online accounts could get hacked).\nIf you need to use this option, please disable it as soon as possible.": {
			"pt-BR": "Isso pode ser extremamente inseguro se \"XHR Personalizado para bibliotecas\" tamb\u00E9m estiver ativado.\nUm website malicioso pode obter permiss\u00F5es de n\u00EDvel de extens\u00E3o e realizar solicita\u00E7\u00F5es arbitr\u00E1rias (suas contas online podem ser invadidas).\nSe precisar usar esta op\u00E7\u00E3o, desative-a assim que poss\u00EDvel."
		},
		"Snapchat": {
			"pt-BR": "Snapchat"
		},
		"Use Web Archive for libraries": {
			"pt-BR": "Usar Web Archive para bibliotecas",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432\u0435\u0431-\u0430\u0440\u0445\u0438\u0432 \u0434\u043B\u044F \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A",
			"zh-CN": "\u4E3A\u7A0B\u5E8F\u5E93\u4F7F\u7528 Web Archive \u7248\u672C"
		},
		"Uses archive.org's web archive instead of github for libraries and other script internals (such as the options page).\nDon't enable this unless you need to.": {
			"pt-BR": "Usa o arquivo web do archive.org em vez do github para bibliotecas e outros componentes internos do script (como a p\u00E1gina de op\u00E7\u00F5es).\nN\u00E3o ative isso a menos que seja necess\u00E1rio.",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u0432\u0435\u0431-\u0430\u0440\u0445\u0438\u0432 archive.org \u0432\u043C\u0435\u0441\u0442\u043E github \u0434\u043B\u044F \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u0438\u0445 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u043E\u0432 \u0441\u043A\u0440\u0438\u043F\u0442\u0430 (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432).\n\u041D\u0435 \u0432\u043A\u043B\u044E\u0447\u0430\u0439\u0442\u0435 \u044D\u0442\u0443 \u0444\u0443\u043D\u043A\u0446\u0438\u044E, \u0435\u0441\u043B\u0438 \u0432 \u044D\u0442\u043E\u043C \u043D\u0435\u0442 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E\u0441\u0442\u0438.",
			"zh-CN": "\u4E3A\u7A0B\u5E8F\u5E93\u548C\u811A\u672C\u5185\u7F6E\u7684\u5176\u4ED6\u6587\u4EF6\uFF08\u5982\u8FD9\u4E2A\u9009\u9879\u9875\u9762\uFF09\u4F7F\u7528 archive.org \u7684\u5B58\u6863\u7248\u672C\u800C\u975E github \u7248\u672C\u3002\n\u9664\u975E\u786E\u5B9E\u9700\u8981\uFF0C\u5426\u5219\u65E0\u9700\u542F\u7528\u3002"
		},
		"Enable integrity checks": {
			"pt-BR": "Habilitar verifica\u00E7\u00F5es de integridade",
			"ru": "\u041F\u0440\u043E\u0432\u0435\u0440\u043A\u0430 \u0446\u0435\u043B\u043E\u0441\u0442\u043D\u043E\u0441\u0442\u0438",
			"zh-CN": "\u542F\u7528\u5B8C\u6574\u6027\u68C0\u67E5"
		},
		"Runs integrity checks before loading 3rd-party libraries": {
			"pt-BR": "Executa verifica\u00E7\u00F5es de integridade antes de carregar bibliotecas de terceiros",
			"ru": "\u0417\u0430\u043F\u0443\u0441\u043A\u0430\u0435\u0442 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443 \u0446\u0435\u043B\u043E\u0441\u0442\u043D\u043E\u0441\u0442\u0438 \u043F\u0435\u0440\u0435\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u0445 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A.",
			"zh-CN": "\u52A0\u8F7D\u7B2C\u4E09\u65B9\u5E93\u4E4B\u524D\u8FD0\u884C\u5B8C\u6574\u6027\u68C0\u67E5"
		},
		"HLS/DASH maximum quality": {
			"pt-BR": "Qualidade m\u00E1xima HLS/DASH",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E HLS/DASH",
			"zh-CN": "HLS/DASH \u6700\u9AD8\u8D28\u91CF"
		},
		"Uses the maximum quality for HLS/DASH streams": {
			"pt-BR": "Usa a qualidade m\u00E1xima para fluxos HLS/DASH",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u0434\u043B\u044F \u043F\u043E\u0442\u043E\u043A\u043E\u0432 HLS/DASH.",
			"zh-CN": "\u5BF9 HLS/DASH \u6D41\u5A92\u4F53\u4F7F\u7528\u6700\u9AD8\u8D28\u91CF"
		},
		"Maximum video quality": {
			"pt-BR": "Qualidade m\u00E1xima do v\u00EDdeo",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u0432\u0438\u0434\u0435\u043E",
			"zh-CN": "\u6700\u9AD8\u89C6\u9891\u8D28\u91CF"
		},
		"Maximum quality for videos": {
			"pt-BR": "Qualidade m\u00E1xima para v\u00EDdeos",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u0434\u043B\u044F \u0432\u0438\u0434\u0435\u043E.",
			"zh-CN": "\u89C6\u9891\u7684\u6700\u9AD8\u8D28\u91CF"
		},
		"(unlimited)": {
			"pt-BR": "(ilimitado)",
			"ru": "(\u043D\u0435\u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u043D\u043E\u0435)",
			"zh-CN": "\uFF08\u65E0\u9650\u5236\uFF09"
		},
		"4K": {
			"pt-BR": "4K",
			"ru": "4K",
			"zh-CN": "4K"
		},
		"1440p": {
			"pt-BR": "1440p",
			"ru": "1440p",
			"zh-CN": "1440p"
		},
		"1080p": {
			"pt-BR": "1080p",
			"ru": "1080p",
			"zh-CN": "1080p"
		},
		"720p": {
			"pt-BR": "720p",
			"ru": "720p",
			"zh-CN": "720p"
		},
		"480p": {
			"pt-BR": "480p",
			"ru": "480p",
			"zh-CN": "480p"
		},
		"Larger watermarked images": {
			"ko": "\uB354 \uD06C\uC9C0\uB9CC \uC6CC\uD130\uB9C8\uD06C \uC788\uB294 \uC774\uBBF8\uC9C0",
			"pt-BR": "Imagens maiores com marca d'\u00E1gua",
			"ru": "\u0411\u043E\u043B\u044C\u0448\u0438\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u0441 \u0432\u043E\u0434\u044F\u043D\u044B\u043C\u0438 \u0437\u043D\u0430\u043A\u0430\u043C\u0438",
			"zh-CN": "\u8F83\u5927\u7684\u5E26\u6C34\u5370\u56FE\u50CF"
		},
		"Enables rules that return larger images that include watermarks": {
			"pt-BR": "Habilita regras que retornam imagens maiores que incluem marcas d'\u00E1gua",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u0440\u0430\u0432\u0438\u043B\u0430, \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u044E\u0449\u0438\u0435 \u0431\u043E\u043B\u0435\u0435 \u043A\u0440\u0443\u043F\u043D\u044B\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u0441 \u0432\u043E\u0434\u044F\u043D\u044B\u043C\u0438 \u0437\u043D\u0430\u043A\u0430\u043C\u0438.",
			"zh-CN": "\u542F\u7528\u89C4\u5219\uFF1A\u8FD4\u56DE\u5305\u542B\u6C34\u5370\u7684\u8F83\u5927\u56FE\u50CF"
		},
		"Stock photo websites": {
			"pt-BR": "Sites de fotos de banco de imagens",
			"ru": "\u0421\u0430\u0439\u0442\u044B \u0441\u043E \u0441\u0442\u043E\u043A\u043E\u0432\u044B\u043C\u0438 \u0444\u043E\u0442\u043E",
			"zh-CN": "\u201C\u56FE\u5E93\u7167\u7247\u201D\u7F51\u7AD9"
		},
		"Smaller non-watermarked images": {
			"ko": "\uB354 \uC791\uC9C0\uB9CC \uC6CC\uD130\uB9C8\uD06C \uC5C6\uB294 \uC774\uBBF8\uC9C0",
			"pt-BR": "Imagens menores sem marca d'\u00E1gua",
			"ru": "\u041D\u0435\u0431\u043E\u043B\u044C\u0448\u0438\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u0431\u0435\u0437 \u0432\u043E\u0434\u044F\u043D\u044B\u0445 \u0437\u043D\u0430\u043A\u043E\u0432",
			"zh-CN": "\u8F83\u5C0F\u7684\u65E0\u6C34\u5370\u56FE\u50CF"
		},
		"Enables rules that return smaller images without watermarks": {
			"pt-BR": "Habilita regras que retornam imagens menores sem marcas d'\u00E1gua",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u0440\u0430\u0432\u0438\u043B\u0430, \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u044E\u0449\u0438\u0435 \u043C\u0435\u043D\u044C\u0448\u0438\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u0431\u0435\u0437 \u0432\u043E\u0434\u044F\u043D\u044B\u0445 \u0437\u043D\u0430\u043A\u043E\u0432.",
			"zh-CN": "\u542F\u7528\u89C4\u5219\uFF1A\u8FD4\u56DE\u65E0\u6C34\u5370\u7684\u8F83\u5C0F\u56FE\u50CF"
		},
		"Possibly different images": {
			"fr": "Images possiblement diff\u00E9rentes",
			"ko": "\uB2E4\uB97C \uC218 \uC788\uB294 \uC774\uBBF8\uC9C0",
			"pt-BR": "Imagens possivelmente diferentes",
			"ru": "\u0412\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u0440\u0430\u0437\u043D\u044B\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F",
			"zh-CN": "\u53EF\u80FD\u4E0D\u540C\u7684\u56FE\u50CF"
		},
		"Enables rules that return images that possibly differ, usually due to server-side caching": {
			"pt-BR": "Habilita regras que retornam imagens que podem ser diferentes, geralmente devido ao cache do lado do servidor",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u0440\u0430\u0432\u0438\u043B\u0430, \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u044E\u0449\u0438\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u043C\u043E\u0433\u0443\u0442 \u043E\u0442\u043B\u0438\u0447\u0430\u0442\u044C\u0441\u044F, \u043A\u0430\u043A \u043F\u0440\u0430\u0432\u0438\u043B\u043E, \u0438\u0437-\u0437\u0430 \u043A\u044D\u0448\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F \u043D\u0430 \u0441\u0442\u043E\u0440\u043E\u043D\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.",
			"zh-CN": "\u542F\u7528\u89C4\u5219\uFF1A\u8FD4\u56DE\u53EF\u80FD\u6709\u6240\u4E0D\u540C\u7684\u56FE\u50CF\uFF0C\u4E0D\u540C\u901A\u5E38\u7531\u4E8E\u670D\u52A1\u5668\u4FA7\u7F13\u5B58"
		},
		"Possibly broken images": {
			"fr": "Images possiblement bris\u00E9e",
			"ko": "\uC190\uC0C1\uB420 \uC218 \uC788\uB294 \uC774\uBBF8\uC9C0",
			"pt-BR": "Imagens possivelmente quebradas",
			"ru": "\u0412\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u0441\u043B\u043E\u043C\u0430\u043D\u043D\u044B\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F",
			"zh-CN": "\u53EF\u80FD\u7834\u635F\u7684\u56FE\u50CF"
		},
		"Enables rules that return images that are possibly broken": {
			"pt-BR": "Habilita regras que retornam imagens que podem estar quebradas",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u0440\u0430\u0432\u0438\u043B\u0430, \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u044E\u0449\u0438\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u043F\u043E\u043B\u043E\u043C\u0430\u043D\u044B.",
			"zh-CN": "\u542F\u7528\u89C4\u5219\uFF1A\u8FD4\u56DE\u53EF\u80FD\u5DF2\u635F\u574F\u7684\u56FE\u50CF"
		},
		"Possibly upscaled images": {
			"pt-BR": "Imagens possivelmente ampliadas",
			"ru": "\u0412\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u043D\u044B\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F",
			"zh-CN": "\u53EF\u80FD\u6269\u589E\u5C3A\u5BF8\u7684\u56FE\u50CF"
		},
		"Enables rules that return images that are possibly upscaled": {
			"pt-BR": "Habilita regras que retornam imagens que podem ter sido ampliadas",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u0440\u0430\u0432\u0438\u043B\u0430, \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u044E\u0449\u0438\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u044B.",
			"zh-CN": "\u542F\u7528\u89C4\u5219\uFF1A\u8FD4\u56DE\u53EF\u80FD\u5DF2\u6269\u589E\u5C3A\u5BF8\u7684\u56FE\u50CF"
		},
		"Uncropped images": {
			"pt-BR": "Imagens n\u00E3o cortadas"
		},
		"Enables rules that return possibly undesirable uncropped images": {
			"pt-BR": "Habilita regras que retornam imagens n\u00E3o cortadas possivelmente indesej\u00E1veis"
		},
		"Mobile wallpaper websites (returns the full version of the wallpaper image)": {
			"pt-BR": "Sites de pap\u00E9is de parede para celular (retorna a vers\u00E3o completa da imagem do papel de parede)"
		},
		"Rules using 3rd-party websites": {
			"fr": "R\u00E8gles utilisant des sites 3rd-party",
			"ko": "\uC11C\uB4DC\uD30C\uD2F0 \uC0AC\uC774\uD2B8\uB97C \uC0AC\uC6A9\uD558\uB294 \uADDC\uCE59",
			"pt-BR": "Regras que utilizam sites de terceiros",
			"ru": "\u041F\u0440\u0430\u0432\u0438\u043B\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u0445 \u0441\u0430\u0439\u0442\u043E\u0432",
			"zh-CN": "\u4F7F\u7528\u7B2C\u4E09\u65B9\u7F51\u7AD9\u7684\u89C4\u5219"
		},
		"Enables rules that use 3rd-party websites": {
			"pt-BR": "Habilita regras que utilizam sites de terceiros",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u0440\u0430\u0432\u0438\u043B\u0430, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u044E\u0442 \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u0435 \u0441\u0430\u0439\u0442\u044B.",
			"zh-CN": "\u542F\u7528\u57FA\u4E8E\u7B2C\u4E09\u65B9\u7F51\u7AD9\u7684\u89C4\u5219"
		},
		"Newsen": {
			"ko": "\uB274\uC2A4\uC5D4",
			"pt-BR": "Newsen",
			"ru": "Newsen",
			"zh-CN": "Newsen"
		},
		"Rules using API calls": {
			"pt-BR": "Regras que utilizam chamadas de API",
			"ru": "\u041F\u0440\u0430\u0432\u0438\u043B\u0430, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u044E\u0449\u0438\u0435 \u0432\u044B\u0437\u043E\u0432\u044B API",
			"zh-CN": "\u57FA\u4E8E API \u8C03\u7528\u7684\u89C4\u5219"
		},
		"Enables rules that use API calls. Strongly recommended to keep this enabled": {
			"pt-BR": "Habilita regras que utilizam chamadas de API. \u00C9 altamente recomend\u00E1vel manter esta op\u00E7\u00E3o ativada",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u0440\u0430\u0432\u0438\u043B\u0430, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u044E\u0449\u0438\u0435 \u0432\u044B\u0437\u043E\u0432\u044B API. \u041D\u0430\u0441\u0442\u043E\u044F\u0442\u0435\u043B\u044C\u043D\u043E \u0440\u0435\u043A\u043E\u043C\u0435\u043D\u0434\u0443\u0435\u0442\u0441\u044F \u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0442\u044C \u044D\u0442\u0443 \u0444\u0443\u043D\u043A\u0446\u0438\u044E \u0432\u043A\u043B\u044E\u0447\u0451\u043D\u043D\u043E\u0439.",
			"zh-CN": "\u542F\u7528\u57FA\u4E8E API \u8C03\u7528\u7684\u89C4\u5219\u3002\u5F3A\u70C8\u5EFA\u8BAE\u4FDD\u6301\u6B64\u9879\u542F\u7528"
		},
		"Instagram": {
			"pt-BR": "Instagram",
			"ru": "Instagram",
			"zh-CN": "Instagram"
		},
		"Flickr": {
			"pt-BR": "Flickr",
			"ru": "Flickr",
			"zh-CN": "Flickr"
		},
		"...": {
			"pt-BR": "...",
			"ru": "...",
			"zh-CN": "..."
		},
		"Allow 3rd-party libraries": {
			"pt-BR": "Permitir bibliotecas de terceiros",
			"ru": "\u0421\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u0435 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0438",
			"zh-CN": "\u5141\u8BB8\u7B2C\u4E09\u65B9\u5E93"
		},
		"Enables using 3rd-party libraries. This is both used in rules and as a prerequisite for certain functionality.": {
			"pt-BR": "Habilita o uso de bibliotecas de terceiros. Isso \u00E9 usado tanto em regras quanto como um pr\u00E9-requisito para certas funcionalidades.",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u0435 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0438. \u042D\u0442\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F \u043A\u0430\u043A \u0432 \u043F\u0440\u0430\u0432\u0438\u043B\u0430\u0445, \u0442\u0430\u043A \u0438 \u0432 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043F\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0433\u043E \u0443\u0441\u043B\u043E\u0432\u0438\u044F \u0434\u043B\u044F \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0451\u043D\u043D\u043E\u0439 \u0444\u0443\u043D\u043A\u0446\u0438\u043E\u043D\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438.",
			"zh-CN": "\u542F\u7528\u7B2C\u4E09\u65B9\u5E93\u7684\u8C03\u7528\u3002\u8FD9\u53EF\u80FD\u7528\u4E8E\u89C4\u5219\u548C\u67D0\u4E9B\u529F\u80FD\u7684\u5148\u51B3\u6761\u4EF6\u3002"
		},
		"Enables using 3rd-party libraries. This is both used in rules and as a prerequisite for certain functionality.\nThere is a possible (but unlikely) security risk for the userscript version.": {
			"pt-BR": "Habilita o uso de bibliotecas de terceiros. Isso \u00E9 usado tanto em regras quanto como pr\u00E9-requisito para certas funcionalidades.\nH\u00E1 um risco de seguran\u00E7a poss\u00EDvel (mas improv\u00E1vel) para a vers\u00E3o userscript.",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u0435 \u0431\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0438. \u042D\u0442\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F \u043A\u0430\u043A \u0432 \u043F\u0440\u0430\u0432\u0438\u043B\u0430\u0445, \u0442\u0430\u043A \u0438 \u0432 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043F\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0433\u043E \u0443\u0441\u043B\u043E\u0432\u0438\u044F \u0434\u043B\u044F \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0451\u043D\u043D\u043E\u0439 \u0444\u0443\u043D\u043A\u0446\u0438\u043E\u043D\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438.\n\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u044B\u0439 (\u043D\u043E \u043C\u0430\u043B\u043E\u0432\u0435\u0440\u043E\u044F\u0442\u043D\u044B\u0439) \u0440\u0438\u0441\u043A \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u043E\u0441\u0442\u0438 \u0434\u043B\u044F \u0432\u0435\u0440\u0441\u0438\u0438 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u043E\u0433\u043E \u0441\u043A\u0440\u0438\u043F\u0442\u0430.",
			"zh-CN": "\u542F\u7528\u7B2C\u4E09\u65B9\u5E93\u7684\u8C03\u7528\u3002\u8FD9\u53EF\u80FD\u7528\u4E8E\u89C4\u5219\u548C\u67D0\u4E9B\u529F\u80FD\u7684\u5148\u51B3\u6761\u4EF6\u3002\n\u8FD9\u5BF9\u4E8E\u7528\u6237\u811A\u672C\u7248\u6765\u8BF4\uFF0C\u6709\u8F83\u4F4E\u7684\u6F5C\u5728\u7684\u5B89\u5168\u98CE\u9669\u3002"
		},
		"Sites using testcookie (slowAES)": {
			"pt-BR": "Sites que usam testcookie (slowAES)",
			"ru": "\u0421\u0430\u0439\u0442\u044B, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u044E\u0449\u0438\u0435 testcookie (slowAES)",
			"zh-CN": "\u4F7F\u7528 testcokie \u7684\u7F51\u7AD9\uFF08\u6162AES\uFF09"
		},
		"Rules executing 3rd-party code": {
			"pt-BR": "Regras que executam c\u00F3digo de terceiros",
			"ru": "\u041F\u0440\u0430\u0432\u0438\u043B\u0430 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0435\u0433\u043E \u043A\u043E\u0434\u0430",
			"zh-CN": "\u6267\u884C\u7B2C\u4E09\u65B9\u4EE3\u7801\u7684\u89C4\u5219"
		},
		"Enables rules that execute arbitrary 3rd-party code stored on websites.": {
			"pt-BR": "Habilita regras que executam c\u00F3digo arbitr\u00E1rio de terceiros armazenado em sites.",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u0440\u0430\u0432\u0438\u043B\u0430, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u044E\u0442 \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u044B\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u0439 \u043A\u043E\u0434, \u0445\u0440\u0430\u043D\u044F\u0449\u0438\u0439\u0441\u044F \u043D\u0430 \u0441\u0430\u0439\u0442\u0430\u0445.",
			"zh-CN": "\u542F\u7528\u5C06\u6267\u884C\u5B58\u50A8\u5728\u7F51\u7AD9\u4E0A\u7684\u4EFB\u610F\u7B2C\u4E09\u65B9\u4EE3\u7801\u7684\u89C4\u5219\u3002"
		},
		"This could lead to security risks, please be careful when using this option!": {
			"pt-BR": "Isso pode levar a riscos de seguran\u00E7a, por favor, tenha cuidado ao usar esta op\u00E7\u00E3o!",
			"ru": "\u042D\u0442\u043E \u043C\u043E\u0436\u0435\u0442 \u043F\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043A \u0443\u0433\u0440\u043E\u0437\u0430\u043C \u0431\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u043E\u0441\u0442\u0438, \u0431\u0443\u0434\u044C\u0442\u0435 \u043E\u0441\u0442\u043E\u0440\u043E\u0436\u043D\u044B \u043F\u0440\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0438 \u044D\u0442\u043E\u0433\u043E \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430!",
			"zh-CN": "\u8FD9\u53EF\u80FD\u5BFC\u81F4\u5B89\u5168\u98CE\u9669\uFF0C\u614E\u91CD\u4F7F\u7528\u6B64\u9009\u9879\uFF01"
		},
		"Rules using brute-force": {
			"pt-BR": "Regras que usam for\u00E7a bruta",
			"ru": "\u041F\u0440\u0430\u0432\u0438\u043B\u0430, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u044E\u0449\u0438\u0435 \u0433\u0440\u0443\u0431\u0443\u044E \u0441\u0438\u043B\u0443",
			"zh-CN": "\u4F7F\u7528\u66B4\u529B\u7834\u89E3\u7684\u89C4\u5219"
		},
		"Enables rules that require using brute force (through binary search) to find the original image": {
			"pt-BR": "Habilita regras que exigem o uso de for\u00E7a bruta (atrav\u00E9s de busca bin\u00E1ria) para encontrar a imagem original",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043F\u0440\u0430\u0432\u0438\u043B\u0430, \u0442\u0440\u0435\u0431\u0443\u044E\u0449\u0438\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F \u0433\u0440\u0443\u0431\u043E\u0439 \u0441\u0438\u043B\u044B (\u0447\u0435\u0440\u0435\u0437 \u0431\u0438\u043D\u0430\u0440\u043D\u044B\u0439 \u043F\u043E\u0438\u0441\u043A) \u0434\u043B\u044F \u043F\u043E\u0438\u0441\u043A\u0430 \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F.",
			"zh-CN": "\u542F\u7528\u9700\u8981\u51ED\u501F\u86EE\u529B\uFF08\u4E8C\u8FDB\u5236\u641C\u7D22\uFF09\u627E\u5230\u539F\u59CB\u56FE\u50CF\u7684\u89C4\u5219"
		},
		"Deezer": {
			"pt-BR": "Deezer",
			"ru": "Deezer",
			"zh-CN": "Deezer"
		},
		"Web Archive support": {
			"pt-BR": "Suporte ao Web Archive"
		},
		"Allows rules to be run under archive.org's Wayback Machine.": {
			"pt-BR": "Permite que as regras sejam executadas na Wayback Machine do archive.org."
		},
		"Use browser cookies": {
			"pt-BR": "Usar cookies do navegador",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043A\u0443\u043A\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430",
			"zh-CN": "\u4F7F\u7528\u6D4F\u89C8\u5668 Cookie"
		},
		"Uses the browser's cookies for API calls in order to access otherwise private data": {
			"pt-BR": "Utiliza os cookies do navegador para chamadas de API a fim de acessar dados que, de outra forma, seriam privados",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u0444\u0430\u0439\u043B\u044B cookie \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0434\u043B\u044F \u0432\u044B\u0437\u043E\u0432\u043E\u0432 API, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0434\u043E\u0441\u0442\u0443\u043F \u043A \u043A\u043E\u043D\u0444\u0438\u0434\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u043C \u0434\u0430\u043D\u043D\u044B\u043C.",
			"zh-CN": "\u5141\u8BB8 API \u8C03\u7528\u4F7F\u7528\u6D4F\u89C8\u5668\u7684 Cookie \u6765\u8BBF\u95EE\u975E\u516C\u5F00\u6570\u636E"
		},
		"Private Flickr images": {
			"pt-BR": "Imagens privadas do Flickr",
			"ru": "\u041F\u0440\u0438\u0432\u0430\u0442\u043D\u044B\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F Flickr",
			"zh-CN": "\u79C1\u4EBA Flickr \u56FE\u50CF"
		},
		"DeviantART: Prefer size over original": {
			"pt-BR": "DeviantART: Preferir tamanho em vez de original",
			"ru": "DeviantART: \u041F\u0440\u0435\u0434\u043F\u043E\u0447\u0438\u0442\u0430\u0442\u044C \u0440\u0430\u0437\u043C\u0435\u0440 \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u0443",
			"zh-CN": "DeviantART: \u5C3A\u5BF8\u6BD4\u539F\u7248\u66F4\u91CD\u8981"
		},
		"Prefers a larger (but not upscaled) thumbnail image over a smaller original animated image": {
			"pt-BR": "Prefere uma imagem em miniatura maior (mas n\u00E3o ampliada) em vez de uma imagem animada original menor",
			"ru": "\u041F\u0440\u0435\u0434\u043F\u043E\u0447\u0438\u0442\u0430\u0435\u0442 \u0431\u043E\u043B\u044C\u0448\u0435 (\u043D\u043E \u043D\u0435 \u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u043D\u043E\u0435) \u043C\u0438\u043D\u0438\u0430\u0442\u044E\u0440\u043D\u043E\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043C\u0435\u043D\u044C\u0448\u0435\u043C\u0443 \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u043E\u043C\u0443 \u0430\u043D\u0438\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u043C\u0443 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044E.",
			"zh-CN": "\u504F\u597D\u5C3A\u5BF8\u8F83\u5927\uFF08\u4F46\u975E\u6269\u589E\uFF09\u4F46\u975E\u539F\u59CB\u5C3A\u5BF8\u7684\u7F29\u7565\u56FE\u56FE\u50CF\uFF0C\u800C\u4E0D\u662F\u539F\u59CB\u5C3A\u5BF8\u4F46\u5C3A\u5BF8\u8F83\u5C0F\u7684\u52A8\u753B\u56FE\u50CF"
		},
		"DeviantART: Use download links": {
			"pt-BR": "DeviantART: Usar links de download",
			"ru": "DeviantART: \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0438 \u0434\u043B\u044F \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F",
			"zh-CN": "DeviantART: \u4F7F\u7528\u4E0B\u8F7D\u94FE\u63A5"
		},
		"Prefers using the download link (if available) by default. Note that this only works if you're logged in to DeviantART": {
			"pt-BR": "Prefere usar o link de download (se dispon\u00EDvel) por padr\u00E3o. Observe que isso s\u00F3 funciona se voc\u00EA estiver conectado ao DeviantART",
			"ru": "\u041F\u0440\u0435\u0434\u043F\u043E\u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443 \u0434\u043B\u044F \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F (\u0435\u0441\u043B\u0438 \u043E\u043D\u0430 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u0430) \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E. \u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043D\u0438\u043C\u0430\u043D\u0438\u0435, \u0447\u0442\u043E \u044D\u0442\u043E \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442, \u0442\u043E\u043B\u044C\u043A\u043E \u0435\u0441\u043B\u0438 \u0432\u044B \u0432\u043E\u0448\u043B\u0438 \u0432 \u0441\u0432\u043E\u044E \u0443\u0447\u0451\u0442\u043D\u0443\u044E \u0437\u0430\u043F\u0438\u0441\u044C DeviantART.",
			"zh-CN": "\u504F\u597D\u9ED8\u8BA4\u4F7F\u7528\u4E0B\u8F7D\u94FE\u63A5\uFF08\u5982\u679C\u53EF\u7528\uFF09\u3002\u6CE8\u610F\uFF0C\u4EC5\u5728\u767B\u5F55 DeviantART \u540E\u6709\u6548"
		},
		"E-Hentai: Use full image": {
			"pt-BR": "E-Hentai: Usar imagem completa",
			"ru": "E-Hentai: \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043F\u043E\u043B\u043D\u043E\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435",
			"zh-CN": "E-Hentai: \u4F7F\u7528\u5B8C\u6574\u56FE\u50CF"
		},
		"Prefers using full/original images if available (logged in). This is more likely to get you rate limited": {
			"pt-BR": "Prefere usar imagens completas/originais, se dispon\u00EDveis (conectado). Isso tem mais chances de te deixar com limite de taxa",
			"ru": "\u041F\u0440\u0435\u0434\u043F\u043E\u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043F\u043E\u043B\u043D\u044B\u0435/\u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u044B\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F, \u0435\u0441\u043B\u0438 \u0442\u0430\u043A\u043E\u0432\u044B\u0435 \u0438\u043C\u0435\u044E\u0442\u0441\u044F. (\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F \u0432\u0445\u043E\u0434). \u0421\u043A\u043E\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043E, \u044D\u0442\u043E \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0438\u0442 \u0432\u0430\u0448\u0443 \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u044C.",
			"zh-CN": "\u504F\u597D\u4F7F\u7528\u5168\u5C3A\u5BF8\u539F\u7248\u56FE\u50CF\u3002\u9700\u8981\u5DF2\u767B\u5F55\u3002\u4F7F\u7528\u5B83\u5C06\u66F4\u5BB9\u6613\u906D\u9047\u901F\u7387\u9650\u5236"
		},
		"Imgur: Use original filename": {
			"pt-BR": "Imgur: Usar nome de arquivo original",
			"ru": "Imgur: \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u043E\u0435 \u0438\u043C\u044F \u0444\u0430\u0439\u043B\u0430",
			"zh-CN": "Imgur: \u4F7F\u7528\u539F\u59CB\u6587\u4EF6\u540D"
		},
		"If the original filename (the one used to upload the image) is found, use it instead of the image ID": {
			"pt-BR": "Se o nome de arquivo original (aquele usado para enviar a imagem) for encontrado, use-o em vez do ID da imagem",
			"ru": "\u0415\u0441\u043B\u0438 \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u043E\u0435 \u0438\u043C\u044F \u0444\u0430\u0439\u043B\u0430 (\u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u043C\u043E\u0435 \u0434\u043B\u044F \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F), \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u0435\u0433\u043E \u0432\u043C\u0435\u0441\u0442\u043E \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F.",
			"zh-CN": "\u5982\u679C\u627E\u5230\u539F\u59CB\u6587\u4EF6\u540D\uFF08\u4E0A\u4F20\u56FE\u50CF\u65F6\u7684\u6587\u4EF6\u540D\uFF09\uFF0C\u4F7F\u7528\u5B83\u4EE3\u66FF\u56FE\u50CF ID"
		},
		"Imgur: Use source image": {
			"pt-BR": "Imgur: Usar imagem de origem",
			"ru": "Imgur: \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430",
			"zh-CN": "Imgur: \u4F7F\u7528\u6E90\u56FE\u50CF"
		},
		"If a source image is found for Imgur, try using it instead. Only works for old-style Imgur webpages (set `postpagebeta=0; postpagebetalogged=0` as cookies)": {
			"pt-BR": "Se uma imagem de origem for encontrada para o Imgur, tente us\u00E1-la. Funciona apenas para p\u00E1ginas antigas do Imgur (defina `postpagebeta=0; postpagebetalogged=0` como cookies)",
			"ru": "\u0415\u0441\u043B\u0438 \u0434\u043B\u044F Imgur \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0435\u0433\u043E \u0432\u043C\u0435\u0441\u0442\u043E \u044D\u0442\u043E\u0433\u043E. \u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043D\u0438\u0446 Imgur \u0441\u0442\u0430\u0440\u043E\u0433\u043E \u0441\u0442\u0438\u043B\u044F (\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 `postpagebeta=0; postpagebetalogged=0` \u043A\u0430\u043A cookie).",
			"zh-CN": "\u5982\u679C\u627E\u5230 Imgur \u7684\u6E90\u56FE\u50CF\uFF0C\u5C1D\u8BD5\u4F7F\u7528\u5B83\u3002\u4EC5\u9002\u7528\u4E8E\u65E7\u7248 Imgur \u7F51\u9875\uFF08\u8BBE\u7F6E Cookie `postpagebeta=0; postpagebetalogged=0`\uFF09"
		},
		"Instagram: Use native API": {
			"pt-BR": "Instagram: Usar API nativa",
			"ru": "Instagram: \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0440\u043E\u0434\u043D\u043E\u0439 API",
			"zh-CN": "Instagram: \u4F7F\u7528\u539F\u751F API"
		},
		"Uses Instagram's native API if possible, requires you to be logged into Instagram. This usually allows for higher resolution images (1440x*) to be returned.": {
			"pt-BR": "Usa a API nativa do Instagram se poss\u00EDvel, requer que voc\u00EA esteja logado no Instagram. Geralmente permite que imagens de resolu\u00E7\u00E3o mais alta (1440x*) sejam retornadas.",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u0440\u043E\u0434\u043D\u043E\u0439 API Instagram, \u0435\u0441\u043B\u0438 \u044D\u0442\u043E \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u0442\u0440\u0435\u0431\u0443\u0435\u0442, \u0447\u0442\u043E\u0431\u044B \u0432\u044B \u0432\u043E\u0448\u043B\u0438 \u0432 Instagram. \u041E\u0431\u044B\u0447\u043D\u043E \u044D\u0442\u043E \u043F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u0441 \u0431\u043E\u043B\u0435\u0435 \u0432\u044B\u0441\u043E\u043A\u0438\u043C \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435\u043C (1440x*).",
			"zh-CN": "\u5C3D\u53EF\u80FD\u4F7F\u7528 Instagram \u7684\u539F\u751F API\uFF0C\u8FD9\u9700\u8981\u60A8\u5DF2\u767B\u5F55 Instagram\u3002\u901A\u5E38\u80FD\u8FD4\u56DE\u66F4\u9AD8\u5206\u8FA8\u7387\u7684\u56FE\u50CF\uFF081440x*\uFF09\u3002"
		},
		"Instagram: Don't use web API": {
			"pt-BR": "Instagram: N\u00E3o usar API web",
			"ru": "Instagram: \u0411\u0435\u0437 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F \u0432\u0435\u0431-API",
			"zh-CN": "Instagram: \u4E0D\u4F7F\u7528 Web API"
		},
		"Avoids using Instagram's web API if possible, which increases performance, but will occasionally sacrifice quality for videos": {
			"pt-BR": "Evita usar a API web do Instagram, se poss\u00EDvel, o que aumenta o desempenho, mas ocasionalmente sacrifica a qualidade dos v\u00EDdeos",
			"ru": "\u0418\u0437\u0431\u0435\u0433\u0430\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F \u0432\u0435\u0431-API Instagram, \u0435\u0441\u043B\u0438 \u044D\u0442\u043E \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u0447\u0442\u043E \u043F\u043E\u0432\u044B\u0448\u0430\u0435\u0442 \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C, \u043D\u043E \u0438\u043D\u043E\u0433\u0434\u0430 \u0436\u0435\u0440\u0442\u0432\u0443\u0435\u0442 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E\u043C \u0432\u0438\u0434\u0435\u043E.",
			"zh-CN": "\u5C3D\u53EF\u80FD\u4E0D\u4F7F\u7528 Instagram \u7684 Web API\uFF0C\u8FD9\u53EF\u4EE5\u63D0\u5347\u6027\u80FD\uFF0C\u4F46\u5076\u5C14\u4F1A\u727A\u7272\u89C6\u9891\u54C1\u8D28"
		},
		"Instagram: Prefer quality over resolution": {
			"pt-BR": "Instagram: Preferir qualidade \u00E0 resolu\u00E7\u00E3o",
			"ru": "Instagram: \u041F\u0440\u0435\u0434\u043F\u043E\u0447\u0438\u0442\u0430\u0442\u044C \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u044E",
			"zh-CN": "Instagram: \u504F\u597D\u9AD8\u8D28\u91CF\u800C\u4E0D\u662F\u5206\u8FA8\u7387"
		},
		"Prefers lower resolution videos that use a higher bitrate over higher resolution images. This adds a slight performance cost as it needs to fetch headers for multiple videos": {
			"pt-BR": "Prefere v\u00EDdeos de resolu\u00E7\u00E3o mais baixa que usam uma taxa de bits mais alta em vez de imagens de resolu\u00E7\u00E3o mais alta. Isso adiciona um pequeno custo de desempenho, pois precisa buscar cabe\u00E7alhos para v\u00E1rios v\u00EDdeos",
			"ru": "\u041F\u0440\u0435\u0434\u043F\u043E\u0447\u0438\u0442\u0430\u0435\u0442 \u0432\u0438\u0434\u0435\u043E \u0441 \u0431\u043E\u043B\u0435\u0435 \u043D\u0438\u0437\u043A\u0438\u043C \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435\u043C, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u044E\u0442 \u0431\u043E\u043B\u0435\u0435 \u0432\u044B\u0441\u043E\u043A\u0438\u0439 \u0431\u0438\u0442\u0440\u0435\u0439\u0442 \u043F\u043E \u0441\u0440\u0430\u0432\u043D\u0435\u043D\u0438\u044E \u0441 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u043C\u0438 \u0441 \u0431\u043E\u043B\u0435\u0435 \u0432\u044B\u0441\u043E\u043A\u0438\u043C \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435\u043C. \u042D\u0442\u043E \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u0435\u0442 \u043D\u0435\u0431\u043E\u043B\u044C\u0448\u0438\u0435 \u0437\u0430\u0442\u0440\u0430\u0442\u044B \u043D\u0430 \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C, \u0442\u0430\u043A \u043A\u0430\u043A \u044D\u0442\u043E \u043D\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044F \u0432 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0438 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u043E\u0432 \u0434\u043B\u044F \u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u0438\u0445 \u0432\u0438\u0434\u0435\u043E.",
			"zh-CN": "\u504F\u597D\u9AD8\u6BD4\u7279\u7387\u7684\u4F4E\u5206\u8FA8\u7387\u89C6\u9891\uFF0C\u800C\u4E0D\u662F\u9AD8\u5206\u8FA8\u7387\u56FE\u50CF\u3002\u8FD9\u8F7B\u5FAE\u8D44\u6E90\u6D88\u8017\uFF0C\u56E0\u4E3A\u9700\u8981\u83B7\u53D6\u591A\u4E2A\u89C6\u9891\u7684\u5934\u90E8"
		},
		"Instagram: Use albums for post thumbnails": {
			"pt-BR": "Instagram: Usar \u00E1lbuns para miniaturas de posts",
			"ru": "Instagram: \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0430\u043B\u044C\u0431\u043E\u043C\u044B \u0434\u043B\u044F \u043C\u0438\u043D\u0438\u0430\u0442\u044E\u0440 \u043F\u043E\u0441\u0442\u043E\u0432",
			"zh-CN": "Instagram: \u4E3A\u5E16\u5B50\u7F29\u7565\u56FE\u4F7F\u7528\u76F8\u518C"
		},
		"Queries Instagram for albums when using the popup on a post thumbnail": {
			"pt-BR": "Consulta o Instagram por \u00E1lbuns ao usar o popup em uma miniatura de post",
			"ru": "\u0417\u0430\u043F\u0440\u043E\u0441\u044B \u043A Instagram \u0434\u043B\u044F \u0430\u043B\u044C\u0431\u043E\u043C\u043E\u0432 \u043F\u0440\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0438 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430 \u043D\u0430 \u043C\u0438\u043D\u0438\u0430\u0442\u044E\u0440\u0435 \u043F\u043E\u0441\u0442\u0430.",
			"zh-CN": "\u4E3A\u5E16\u5B50\u7F29\u7565\u56FE\u4F7F\u7528\u5F39\u7A97\u65F6\u67E5\u8BE2 Instagram \u76F8\u518C"
		},
		"Snapchat: Use original media without captions": {
			"pt-BR": "Snapchat: Usar m\u00EDdia original sem legendas",
			"ru": "Snapchat: \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u044B\u0435 \u043C\u0435\u0434\u0438\u0430 \u0431\u0435\u0437 \u043F\u043E\u0434\u043F\u0438\u0441\u0435\u0439",
			"zh-CN": "Snapchat: \u4F7F\u7528\u6CA1\u6709\u6807\u9898\u7684\u539F\u59CB\u5A92\u4F53"
		},
		"Prefers using original media instead of media with captions and tags overlayed": {
			"pt-BR": "Prefere usar a m\u00EDdia original em vez de m\u00EDdia com legendas e tags sobrepostas",
			"ru": "\u041F\u0440\u0435\u0434\u043F\u043E\u0447\u0438\u0442\u0430\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u044B\u0435 \u043C\u0435\u0434\u0438\u0430 \u0432\u043C\u0435\u0441\u0442\u043E \u043C\u0435\u0434\u0438\u0430 \u0441 \u043D\u0430\u043B\u043E\u0436\u0435\u043D\u043D\u044B\u043C\u0438 \u043F\u043E\u0434\u043F\u0438\u0441\u044F\u043C\u0438 \u0438 \u0442\u0435\u0433\u0430\u043C\u0438.",
			"zh-CN": "\u503E\u5411\u4E8E\u4F7F\u7528\u539F\u59CB\u5A92\u4F53\uFF0C\u800C\u4E0D\u662F\u6709\u6807\u9898\u548C\u6807\u7B7E\u8986\u76D6\u7684\u5A92\u4F53"
		},
		"Teddit: Use Reddit for media": {
			"pt-BR": "Teddit: Usar Reddit para m\u00EDdia"
		},
		"Redirects media stored on Teddit to Reddit's servers. Disabling this may prevent finding original images because Teddit's image servers will only cache images fetched from posts, which are deleted after a few minutes.": {
			"pt-BR": "Redireciona m\u00EDdias armazenadas no Teddit para os servidores do Reddit. Desativar isso pode impedir a localiza\u00E7\u00E3o de imagens originais porque os servidores de imagem do Teddit armazenar\u00E3o em cache apenas imagens obtidas de posts, que s\u00E3o exclu\u00EDdas ap\u00F3s alguns minutos."
		},
		"TikTok: Use app API": {
			"pt-BR": "TikTok: Usar API do aplicativo"
		},
		"Uses TikTok's app API to find video information.": {
			"pt-BR": "Usa a API do aplicativo TikTok para encontrar informa\u00E7\u00F5es de v\u00EDdeo."
		},
		"TikTok: Don't use watermarked videos": {
			"pt-BR": "TikTok: N\u00E3o usar v\u00EDdeos com marca d'\u00E1gua",
			"ru": "TikTok: \u041D\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432\u0438\u0434\u0435\u043E \u0441 \u0432\u043E\u0434\u044F\u043D\u044B\u043C\u0438 \u0437\u043D\u0430\u043A\u0430\u043C\u0438",
			"zh-CN": "TikTok: \u4E0D\u4F7F\u7528\u5E26\u6C34\u5370\u7684\u89C6\u9891"
		},
		"Uses non-watermarked videos for TikTok if possible. This will introduce an extra delay when loading the video as two extra requests need to be performed. It will also fail for any videos uploaded after ~late July 2020": {
			"pt-BR": "Usa v\u00EDdeos sem marca d'\u00E1gua para o TikTok, se poss\u00EDvel. Isso introduzir\u00E1 um atraso extra ao carregar o v\u00EDdeo, pois duas solicita\u00E7\u00F5es extras precisam ser realizadas. Tamb\u00E9m falhar\u00E1 para qualquer v\u00EDdeo enviado ap\u00F3s o final de julho de 2020",
			"ru": "\u041F\u043E \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u0432\u0438\u0434\u0435\u043E \u0431\u0435\u0437 \u0432\u043E\u0434\u044F\u043D\u044B\u0445 \u0437\u043D\u0430\u043A\u043E\u0432 \u0434\u043B\u044F TikTok. \u042D\u0442\u043E \u043F\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043A \u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0439 \u0437\u0430\u0434\u0435\u0440\u0436\u043A\u0435 \u043F\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0435 \u0432\u0438\u0434\u0435\u043E, \u0442\u0430\u043A \u043A\u0430\u043A \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0434\u0432\u0430 \u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0445 \u0437\u0430\u043F\u0440\u043E\u0441\u0430. \u042D\u0442\u043E \u043D\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C \u0434\u043B\u044F \u043B\u044E\u0431\u044B\u0445 \u0432\u0438\u0434\u0435\u043E, \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0445 \u043F\u043E\u0441\u043B\u0435 ~\u043A\u043E\u043D\u0446\u0430 \u0438\u044E\u043B\u044F 2020 \u0433\u043E\u0434\u0430.",
			"zh-CN": "\u5982\u679C\u53EF\u80FD\uFF0C\u4E3A TikTok \u4F7F\u7528\u65E0\u6C34\u5370\u89C6\u9891\u3002\u52A0\u8F7D\u89C6\u9891\u65F6\u9700\u6267\u884C\u4E24\u4E2A\u989D\u5916\u7684\u8BF7\u6C42\uFF0C\u8FD9\u5C06\u589E\u52A0\u5EF6\u8FDF\u3002\u5BF92020\u5E747\u6708\u5DE6\u53F3\u4E4B\u540E\u4E0A\u4F20\u7684\u4EFB\u4F55\u89C6\u9891\u4E0D\u8D77\u4F5C\u7528"
		},
		"TikTok: 3rd-party watermark removal": {
			"pt-BR": "TikTok: Remo\u00E7\u00E3o de marca d'\u00E1gua por terceiros",
			"ru": "TikTok: \u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0432\u043E\u0434\u044F\u043D\u044B\u0445 \u0437\u043D\u0430\u043A\u043E\u0432 \u0442\u0440\u0435\u0442\u044C\u0435\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u043E\u0439",
			"zh-CN": "TikTok: \u7B2C\u4E09\u65B9\u6C34\u5370\u53BB\u9664"
		},
		"Uses a 3rd-party watermark removal site for TikTok.\nI do not endorse any of the sites supported. They may log your IP address and videos you submit. Use this option with caution.\n`LQ` = Low quality, `PL` = Public log": {
			"pt-BR": "Usa um site de terceiros para remo\u00E7\u00E3o de marca d'\u00E1gua do TikTok.\nN\u00E3o endosso nenhum dos sites suportados. Eles podem registrar seu endere\u00E7o IP e os v\u00EDdeos que voc\u00EA enviar. Use esta op\u00E7\u00E3o com cautela.\n`LQ` = Baixa qualidade, `PL` = Registro p\u00FAblico",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u0439 \u0441\u0430\u0439\u0442 \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F \u0432\u043E\u0434\u044F\u043D\u044B\u0445 \u0437\u043D\u0430\u043A\u043E\u0432 \u0434\u043B\u044F TikTok.\n\u042F \u043D\u0435 \u043E\u0434\u043E\u0431\u0440\u044F\u044E \u043D\u0438 \u043E\u0434\u0438\u043D \u0438\u0437 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043C\u044B\u0445 \u0441\u0430\u0439\u0442\u043E\u0432. \u041E\u043D\u0438 \u043C\u043E\u0433\u0443\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0430\u0448 IP-\u0430\u0434\u0440\u0435\u0441 \u0438 \u0432\u0438\u0434\u0435\u043E, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0432\u044B \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u044F\u0435\u0442\u0435. \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u044D\u0442\u043E\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0441 \u043E\u0441\u0442\u043E\u0440\u043E\u0436\u043D\u043E\u0441\u0442\u044C\u044E.\n`\u041D\u041A` = \u041D\u0438\u0437\u043A\u043E\u0435 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E, `\u041F\u041B` = \u041F\u0443\u0431\u043B\u0438\u0447\u043D\u044B\u0439 \u043B\u043E\u0433",
			"zh-CN": "\u4F7F\u7528\u4E00\u4E2A\u9002\u7528\u4E8E TikTok \u7684\u7B2C\u4E09\u65B9\u6C34\u5370\u53BB\u9664\u7F51\u7AD9\u3002\n\u8FD9\u4E0D\u4EE3\u8868\u5BF9\u8BE5\u7F51\u7AD9\u7684\u8BA4\u53EF\u3002\u8BE5\u7F51\u7AD9\u53EF\u80FD\u8BB0\u5F55\u60A8\u7684 IP \u5730\u5740\u548C\u63D0\u4EA4\u7684\u89C6\u9891\u3002\u8C28\u614E\u4F7F\u7528\u3002\n`LQ` = \u4F4E\u54C1\u8D28\uFF0C`PL` = \u516C\u4F17\u65E5\u5FD7"
		},
		"(none)": {
			"pt-BR": "(nenhum)",
			"ru": "(\u043D\u0438\u0447\u0435\u0433\u043E)",
			"zh-CN": "(\u65E0)"
		},
		"ttloader.com": {
			"pt-BR": "ttloader.com",
			"ru": "ttloader.com",
			"zh-CN": "ttloader.com"
		},
		"onlinetik.com": {
			"pt-BR": "onlinetik.com",
			"ru": "onlinetik.com",
			"zh-CN": "onlinetik.com"
		},
		"tikdowns.com": {
			"pt-BR": "tikdowns.com",
			"ru": "tikdowns.com",
			"zh-CN": "tikdowns.com"
		},
		"ssstiktok.net": {
			"pt-BR": "ssstiktok.net",
			"ru": "ssstiktok.net",
			"zh-CN": "ssstiktok.net"
		},
		"keeptiktok.com (LQ)": {
			"pt-BR": "keeptiktok.com (BQ)",
			"ru": "keeptiktok.com (\u041D\u041A)",
			"zh-CN": "keeptiktok.com (LQ)"
		},
		"ssstiktok.io (LQ)": {
			"pt-BR": "ssstiktok.io (BQ)",
			"ru": "ssstiktok.io (\u041D\u041A)",
			"zh-CN": "ssstiktok.io (LQ)"
		},
		"musicallydown.com (LQ/PL)": {
			"pt-BR": "musicallydown.com (BQ/PL)",
			"ru": "musicallydown.com (\u041D\u041A/\u041F\u0416)",
			"zh-CN": "musicallydown.com (LQ/PL)"
		},
		"snaptik.app (LQ)": {
			"pt-BR": "snaptik.app (BQ)",
			"ru": "snaptik.app (\u041D\u041A)",
			"zh-CN": "snaptik.app (LQ)"
		},
		"tikmate.online (LQ)": {
			"pt-BR": "tikmate.online (BQ)",
			"ru": "tikmate.online (\u041D\u041A)",
			"zh-CN": "tikmate.online (LQ)"
		},
		"Tumblr: API key": {
			"pt-BR": "Tumblr: Chave da API",
			"ru": "Tumblr: \u043A\u043B\u044E\u0447 API",
			"zh-CN": "Tumblr: API \u5BC6\u94A5"
		},
		"API key for finding larger images on Tumblr": {
			"pt-BR": "Chave da API para encontrar imagens maiores no Tumblr",
			"ru": "\u041A\u043B\u044E\u0447 API \u0434\u043B\u044F \u043F\u043E\u0438\u0441\u043A\u0430 \u0431\u043E\u043B\u044C\u0448\u0438\u0445 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439 \u043D\u0430 Tumblr",
			"zh-CN": "\u7528\u4E8E\u5728 Tumblr \u4E0A\u67E5\u627E\u66F4\u5927\u56FE\u7247\u7684 API \u5BC6\u94A5"
		},
		"Twitter: Use extension": {
			"pt-BR": "Twitter: Usar extens\u00E3o",
			"ru": "Twitter: \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435",
			"zh-CN": "Twitter: \u4F7F\u7528\u6269\u5C55\u540D"
		},
		"Prefers `.jpg?name=orig` over `?format=jpg&name=orig`. This will possibly incur extra requests before succeeding. Note that there is no difference in image quality.": {
			"pt-BR": "Prefere `.jpg?name=orig` em vez de `?format=jpg&name=orig`. Isso possivelmente incorrer\u00E1 em requisi\u00E7\u00F5es extras antes de obter sucesso. Note que n\u00E3o h\u00E1 diferen\u00E7a na qualidade da imagem.",
			"ru": "\u041F\u0440\u0435\u0434\u043F\u043E\u0447\u0438\u0442\u0430\u0442\u044C `.jpg?name=orig` \u043F\u043E\u0432\u0435\u0440\u0445 `?format=jpg&name=orig`. \u042D\u0442\u043E, \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043F\u043E\u0432\u043B\u0435\u0447\u0435\u0442 \u0437\u0430 \u0441\u043E\u0431\u043E\u0439 \u0434\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0437\u0430\u043F\u0440\u043E\u0441\u044B, \u043F\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043C \u0434\u043E\u0431\u0438\u0442\u044C\u0441\u044F \u0443\u0441\u043F\u0435\u0445\u0430. \u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043D\u0438\u043C\u0430\u043D\u0438\u0435, \u0447\u0442\u043E \u043D\u0435\u0442 \u043D\u0438\u043A\u0430\u043A\u043E\u0439 \u0440\u0430\u0437\u043D\u0438\u0446\u044B \u0432 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F.",
			"zh-CN": "\u9996\u9009 `.jpg?name=orig` \u800C\u4E0D\u662F `?format=jpg&name=orig`\u3002\u8FD9\u53EF\u80FD\u5728\u6210\u529F\u524D\u4EA7\u751F\u989D\u5916\u7684\u8BF7\u6C42\u3002\u6CE8\u610F\uFF0C\u56FE\u50CF\u8D28\u91CF\u4E0A\u6CA1\u6709\u5DEE\u5F02\u3002"
		},
		"YouTube: Enable faster speeds": {
			"pt-BR": "YouTube: Habilitar velocidades mais r\u00E1pidas"
		},
		"Increases the download bandwidth for YouTube videos by replacing the `n` parameter. Note that this may execute untrusted Javascript.": {
			"pt-BR": "Aumenta a largura de banda de download para v\u00EDdeos do YouTube, substituindo o par\u00E2metro `n`. Observe que isso pode executar Javascript n\u00E3o confi\u00E1vel."
		},
		"Media blacklist": {
			"pt-BR": "Lista negra de m\u00EDdia"
		},
		"A list of URLs (one per line) that are blacklisted from being processed": {
			"pt-BR": "Uma lista de URLs (uma por linha) que est\u00E3o na lista negra e n\u00E3o ser\u00E3o processadas",
			"ru": "\u0421\u043F\u0438\u0441\u043E\u043A URL-\u0430\u0434\u0440\u0435\u0441\u043E\u0432 (\u043F\u043E \u043E\u0434\u043D\u043E\u043C\u0443 \u043D\u0430 \u0441\u0442\u0440\u043E\u043A\u0443), \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0437\u0430\u043D\u0435\u0441\u0435\u043D\u044B \u0432 \u0447\u0451\u0440\u043D\u044B\u0439 \u0441\u043F\u0438\u0441\u043E\u043A \u0434\u043B\u044F \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438.",
			"zh-CN": "\u5904\u7406\u8FC7\u7A0B\u7684\u9ED1\u540D\u5355\u7F51\u5740\u5217\u8868\uFF08\u6BCF\u884C\u4E00\u6761\uFF09"
		},
		"Media blacklist mode": {
			"pt-BR": "Modo de lista negra de m\u00EDdia"
		},
		"Whether the media blacklist should act as a blacklist or a whitelist": {
			"pt-BR": "Se a lista negra de m\u00EDdia deve funcionar como uma lista negra ou uma lista branca"
		},
		"Blacklist engine": {
			"ko": "\uBE14\uB799\uB9AC\uC2A4\uD2B8 \uC5D4\uC9C4",
			"pt-BR": "Mecanismo de lista negra",
			"ru": "\u0414\u0432\u0438\u0436\u043E\u043A \u0447\u0451\u0440\u043D\u043E\u0433\u043E \u0441\u043F\u0438\u0441\u043A\u0430",
			"zh-CN": "\u9ED1\u540D\u5355\u5F15\u64CE"
		},
		"How blacklists should be processed": {
			"pt-BR": "Como as listas negras devem ser processadas"
		},
		"Simple (glob)": {
			"ko": "\uB2E8\uC21C (glob)",
			"pt-BR": "Simples (glob)",
			"ru": "\u041F\u0440\u043E\u0441\u0442\u043E\u0439 (glob)",
			"zh-CN": "\u7B80\u6613 (glob)"
		},
		"Regex": {
			"ko": "\uC815\uADDC\uC2DD",
			"pt-BR": "Regex",
			"ru": "\u0420\u0435\u0433\u0443\u043B\u044F\u0440\u043D\u043E\u0435 \u0432\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0435",
			"zh-CN": "\u6B63\u5219\u8868\u8FBE\u5F0F"
		},
		"Host blacklist": {
			"pt-BR": "Lista negra de hosts"
		},
		"A list of host URLs (one per line) that the popup is blacklisted from. For example, adding `twitter.com` to this blacklist would prevent any popup from opening on twitter.com.": {
			"pt-BR": "Uma lista de URLs de hosts (uma por linha) para as quais o popup est\u00E1 na lista negra. Por exemplo, adicionar `twitter.com` a esta lista negra impediria que qualquer popup fosse aberto em twitter.com."
		},
		"Host blacklist mode": {
			"pt-BR": "Modo de lista negra de hosts"
		},
		"Whether the host blacklist should act as a blacklist or a whitelist": {
			"pt-BR": "Se a lista negra de hosts deve funcionar como uma lista negra ou uma lista branca"
		},
		"HTML page blacklist": {
			"pt-BR": "Lista negra de p\u00E1ginas HTML"
		},
		"A list of URLs (one per line) that are blacklisted from being redirected.": {
			"pt-BR": "Uma lista de URLs (uma por linha) que est\u00E3o na lista negra e n\u00E3o ser\u00E3o redirecionadas."
		},
		"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 />\n<ul><br />\n<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>\n<li><code>abc.google.com</code> will block https://abc.google.com/, https://def.abc.google.com/, etc.</li>\n<li><code>*.google.com</code> will block https://www.google.com/, https://def.abc.google.com/, etc. but not https://google.com/</li>\n<li><code>google.*/</code> will block https://google.com/, https://www.google.co.uk, etc.</li>\n<li><code>http://google.com</code> will block http://google.com/, but not https://google.com/, http://www.google.com/, etc.</li>\n<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>\n<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>\n<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>\n<li><code>g??gle.com</code> will block https://google.com/, https://gaagle.com/, https://goagle.com/, etc.</li>\n<li><code>google.{com,co.uk}</code> will block https://google.com/ and https://google.co.uk/</li>\n<li><code>g[oau]ogle.com</code> will block https://google.com/, https://gaogle.com/, and http://www.guogle.com/</li>\n<li><code>g[0-9]ogle.com</code> will block https://g0ogle.com/, https://g1ogle.com/, etc. (up to https://g9ogle.com/)</li>\n</ul>": {
			"pt-BR": "Os exemplos abaixo foram escritos para o mecanismo simples (glob), n\u00E3o o mecanismo regex. O mecanismo glob \u00E9 geralmente baseado na sintaxe glob do UNIX.<br />\n<ul><br />\n<li><code>google.com</code> bloquear\u00E1 https://google.com/, https://www.google.com/, https://abcdef.google.com/, https://def.abc.google.com/, etc.</li>\n<li><code>abc.google.com</code> bloquear\u00E1 https://abc.google.com/, https://def.abc.google.com/, etc.</li>\n<li><code>*.google.com</code> bloquear\u00E1 https://www.google.com/, https://def.abc.google.com/, etc. mas n\u00E3o https://google.com/</li>\n<li><code>google.*/</code> bloquear\u00E1 https://google.com/, https://www.google.co.uk, etc.</li>\n<li><code>http://google.com</code> bloquear\u00E1 http://google.com/, mas n\u00E3o https://google.com/, http://www.google.com/, etc.</li>\n<li><code>google.com/test</code> bloquear\u00E1 https://google.com/test, https://www.google.com/test/abcdef, mas n\u00E3o https://google.com/, etc.</li>\n<li><code>google.com/*/test</code> bloquear\u00E1 https://google.com/abc/test, mas n\u00E3o https://google.com/test ou https://google.com/abc/def/test</li>\n<li><code>google.com/**/test</code> bloquear\u00E1 https://google.com/abc/test, https://google.com/abc/def/test, https://google.com/abc/def/ghi/test, etc. mas n\u00E3o https://google.com/test</li>\n<li><code>g??gle.com</code> bloquear\u00E1 https://google.com/, https://gaagle.com/, https://goagle.com/, etc.</li>\n<li><code>google.{com,co.uk}</code> bloquear\u00E1 https://google.com/ e https://google.co.uk/</li>\n<li><code>g[oau]ogle.com</code> bloquear\u00E1 https://google.com/, https://gaogle.com/, e http://www.guogle.com/</li>\n<li><code>g[0-9]ogle.com</code> bloquear\u00E1 https://g0ogle.com/, https://g1ogle.com/, etc. (at\u00E9 https://g9ogle.com/)</li>\n</ul>",
			"ru": "\u041F\u0440\u0438\u0432\u0435\u0434\u0435\u043D\u043D\u044B\u0435 \u043D\u0438\u0436\u0435 \u043F\u0440\u0438\u043C\u0435\u0440\u044B \u043D\u0430\u043F\u0438\u0441\u0430\u043D\u044B \u0434\u043B\u044F \u043F\u0440\u043E\u0441\u0442\u043E\u0433\u043E (glob) \u0434\u0432\u0438\u0436\u043A\u0430, \u0430 \u043D\u0435 \u0434\u043B\u044F \u0434\u0432\u0438\u0436\u043A\u0430 \u0440\u0435\u0433\u0443\u043B\u044F\u0440\u043D\u044B\u0445 \u0432\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0439. \u041C\u0435\u0445\u0430\u043D\u0438\u0437\u043C glob \u043E\u0431\u044B\u0447\u043D\u043E \u043E\u0441\u043D\u043E\u0432\u0430\u043D \u043D\u0430 \u0441\u0438\u043D\u0442\u0430\u043A\u0441\u0438\u0441\u0435 UNIX glob.<br />\n<ul><br />\n<li><code>google.com</code> \u0431\u0443\u0434\u0435\u0442 \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C https://google.com/, https://www.google.com/, https://abcdef.google.com/, https://def.abc.google.com/, \u0438 \u0442.\u0434.</li>\n<li><code>abc.google.com</code> \u0431\u0443\u0434\u0435\u0442 \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C https://abc.google.com/, https://def.abc.google.com/, \u0438 \u0442.\u0434.</li>\n<li><code>*.google.com</code> \u0431\u0443\u0434\u0435\u0442 \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C https://www.google.com/, https://def.abc.google.com/, \u0438 \u0442.\u0434., \u043D\u043E \u043D\u0435 https://google.com/</li>\n<li><code>google.*/</code> \u0431\u0443\u0434\u0435\u0442 \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C https://google.com/, https://www.google.co.uk, \u0438 \u0442.\u0434.</li>\n<li><code>http://google.com</code> \u0431\u0443\u0434\u0435\u0442 \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C http://google.com/, \u043D\u043E \u043D\u0435 https://google.com/, http://www.google.com/, \u0438 \u0442.\u0434.</li>\n<li><code>google.com/test</code> \u0431\u0443\u0434\u0435\u0442 \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C https://google.com/test, https://www.google.com/test/abcdef, \u043D\u043E \u043D\u0435 https://google.com/, \u0438 \u0442.\u0434.</li>\n<li><code>google.com/*/test</code> \u0431\u0443\u0434\u0435\u0442 \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C https://google.com/abc/test, \u043D\u043E \u043D\u0435 https://google.com/test \u0438\u043B\u0438 https://google.com/abc/def/test</li>\n<li><code>google.com/**/test</code> \u0431\u0443\u0434\u0435\u0442 \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C https://google.com/abc/test, https://google.com/abc/def/test, https://google.com/abc/def/ghi/test, \u0438 \u0442.\u0434., \u043D\u043E \u043D\u0435 https://google.com/test</li>\n<li><code>g??gle.com</code> \u0431\u0443\u0434\u0435\u0442 \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C https://google.com/, https://gaagle.com/, https://goagle.com/, \u0438 \u0442.\u0434.</li>\n<li><code>google.{com,co.uk}</code> \u0431\u0443\u0434\u0435\u0442 \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C https://google.com/ \u0438 https://google.co.uk/</li>\n<li><code>g[oau]ogle.com</code> \u0431\u0443\u0434\u0435\u0442 \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C https://google.com/, https://gaogle.com/, \u0438 http://www.guogle.com/</li>\n<li><code>g[0-9]ogle.com</code> \u0431\u0443\u0434\u0435\u0442 \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C https://g0ogle.com/, https://g1ogle.com/, \u0438 \u0442.\u0434. (\u0432\u043F\u043B\u043E\u0442\u044C \u0434\u043E https://g9ogle.com/)</li>\n</ul>",
			"zh-CN": "\u4E0B\u9762\u7684\u793A\u4F8B\u662F\u4E3A\u5EFA\u8BAE\uFF08glob\uFF09\u5F15\u64CE\u7F16\u5199\uFF0C\u800C\u975E\u6B63\u5219\u8868\u8FBE\u5F0F\u5F15\u64CE\u3002Glob \u5F15\u64CE\u901A\u5E38\u57FA\u4E8E UNIX glob \u8BED\u6CD5\u3002<br />\n<ul><br />\n<li><code>google.com</code> \u5C06\u5C4F\u853D https://google.com/, https://www.google.com/, https://abcdef.google.com/, https://def.abc.google.com/ \u7B49\u3002</li>\n<li><code>abc.google.com</code> \u5C06\u5C4F\u853D https://abc.google.com/, https://def.abc.google.com/ \u7B49\u3002</li>\n<li><code>*.google.com</code> \u5C06\u5C4F\u853D https://www.google.com/, https://def.abc.google.com/ \u7B49\u3002\u4F46\u4E0D\u542B https://google.com/</li>\n<li><code>google.*/</code> \u5C06\u5C4F\u853D https://google.com/, https://www.google.co.uk \u7B49\u3002</li>\n<li><code>http://google.com</code> \u5C06\u5C4F\u853D http://google.com/, but not https://google.com/, http://www.google.com/ \u7B49\u3002</li>\n<li><code>google.com/test</code> \u5C06\u5C4F\u853D https://google.com/test, https://www.google.com/test/abcdef, but not https://google.com/ \u7B49\u3002</li>\n<li><code>google.com/*/test</code> \u5C06\u5C4F\u853D https://google.com/abc/test\uFF0C\u4F46\u4E0D\u542B https://google.com/test \u6216 https://google.com/abc/def/test</li>\n<li><code>google.com/**/test</code> \u5C06\u5C4F\u853D https://google.com/abc/test, https://google.com/abc/def/test, https://google.com/abc/def/ghi/test \u7B49\u3002 but not https://google.com/test</li>\n<li><code>g??gle.com</code> \u5C06\u5C4F\u853D https://google.com/, https://gaagle.com/, https://goagle.com/ \u7B49\u3002</li>\n<li><code>google.{com,co.uk}</code> \u5C06\u5C4F\u853D https://google.com/ \u548Chttps://google.co.uk/</li>\n<li><code>g[oau]ogle.com</code> \u5C06\u5C4F\u853D https://google.com/, https://gaogle.com/, \u548Chttp://www.guogle.com/</li>\n<li><code>g[0-9]ogle.com</code> \u5C06\u5C4F\u853D https://g0ogle.com/, https://g1ogle.com/ \u7B49\u3002 (up to https://g9ogle.com/)</li>\n</ul>"
		},
		"HTML page blacklist mode": {
			"pt-BR": "Modo de lista negra de p\u00E1ginas HTML"
		},
		"Whether the HTML page blacklist should act as a blacklist or a whitelist": {
			"pt-BR": "Se a lista negra de p\u00E1ginas HTML deve funcionar como uma lista negra ou uma lista branca"
		},
		"Whitelist": {
			"pt-BR": "Lista branca"
		},
		"Blacklist": {
			"ko": "\uBE14\uB799\uB9AC\uC2A4\uD2B8",
			"pt-BR": "Lista negra",
			"ru": "\u0427\u0451\u0440\u043D\u044B\u0439 \u0441\u043F\u0438\u0441\u043E\u043A",
			"zh-CN": "\u9ED1\u540D\u5355"
		},
		"Filename format": {
			"pt-BR": "Formato do nome do arquivo",
			"ru": "\u0424\u043E\u0440\u043C\u0430\u0442 \u0438\u043C\u0435\u043D\u0438 \u0444\u0430\u0439\u043B\u0430",
			"zh-CN": "\u6587\u4EF6\u540D\u683C\u5F0F"
		},
		"Format string(s) for the filename": {
			"pt-BR": "String(s) de formata\u00E7\u00E3o para o nome do arquivo",
			"ru": "\u0424\u043E\u0440\u043C\u0430\u0442 \u0441\u0442\u0440\u043E\u043A(\u0438) \u0434\u043B\u044F \u0438\u043C\u0435\u043D\u0438 \u0444\u0430\u0439\u043B\u0430.",
			"zh-CN": "\u6587\u4EF6\u540D\u683C\u5F0F\u5316\u8981\u7528\u5230\u7684\u5B57\u7B26\u4E32"
		},
		"Documentation": {
			"pt-BR": "Documenta\u00E7\u00E3o",
			"ru": "\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u044F",
			"zh-CN": "\u6587\u6863"
		},
		"<p>Variables are specified between curly brackets (<code>{}</code>).</p>\n<p>Below is a list of valid variables:</p>\n<ul><br />\n<li><code>filename</code> - Original filename (with extension, if applicable)</li>\n<li><code>filename_noext</code> - Original filename (without extension, if applicable)</li>\n<li><code>ext</code> - Extension (with <code>.</code> prefixed)</li>\n<li><code>caption</code> - Popup caption</li>\n<li><code>author_username</code> - Author's username</li>\n<li><code>id</code> - Post ID</li>\n<li><code>host_title</code> - Title of the current tab/window</li>\n<li><code>host_url</code> - URL of the host webpage</li>\n<li><code>host_domain</code> - Domain of the host webpage</li>\n<li><code>host_domain_nosub</code> - Domain (without subdomains) of the host webpage</li>\n<li><code>url</code> - URL of the media</li>\n<li><code>domain</code> - Domain of the media</li>\n<li><code>domain_nosub</code> - Domain (without subdomains) of the media</li>\n<li><code>is_screenshot</code> - Blank, the line will only be processed when screenshotting a video</li>\n<li><code>prefix</code>, <code>suffix</code> - Blank by default, these variables will be automatically prefixed/suffixed to the filename if set using <code>:=</code></li>\n<li><code>created_...</code> - Created date (see note on Date objects below)</li>\n<li><code>updated_...</code> - Updated date, this will use the <code>Last-Modified</code> header if not otherwise specified by the rule (see note on Date objects below)</li>\n<li><code>download_...</code> - Download date (see note on Date objects below)</li>\n<li><code>date_...</code> - Created/updated date (see note on Date objects below)</li>\n</ul><br />\n<p>You can truncate the value of a variable by adding <code>:(number)</code> before the end bracket (<code>}</code>). For example:</p>\n<ul><br />\n<li><code>{caption:10}</code> - Truncates the caption to be at most 10 characters long</li>\n<li><code>{caption:10.}</code> - Same, but will add an ellipsis (\u2026) if the caption was truncated</li>\n</ul><br />\n<p>If a variable doesn't exist, by default it will ignore the current format string and use the one on the next line, unless <code>?</code> is added before the end bracket. For example:</p>\n<ul><br />\n<li><code>{ext?}</code> - Will be replaced with nothing if <code>ext</code> doesn't exist</li>\n<li><code>{caption?no caption}</code> - Will be replaced with <code>no caption</code> if <code>caption</code> doesn't exist</li>\n</ul><br />\n<p>You can check for equality and inequality with <code>==</code> and <code>!=</code> operators respectively. For example:</p>\n<ul><br />\n<li><code>{domain_nosub==cdninstagram.com}{author_username} {id}</code> - Will only run the current format (<code>{author_username} {id}</code> in this case) if the domain is cdninstagram.com</li>\n</ul><br />\n<p>You can check if a variable contains a string with <code>/=</code> (<code>!/=</code> for the opposite). It also supports two flags, <code>r</code> (regex) and <code>c</code> (case-sensitive), if added between <code>/</code> and <code>=</code>. For example:</p>\n<ul><br />\n<li><code>{domain/=instagram}{id}</code> - Will only run the current format (<code>{id}</code>) if the domain contains <code>instagram</code></li>\n<li><code>{domain!/=instagram}{id}</code> - Likewise, but only if the domain does not contain <code>instagram</code></li>\n<li><code>{domain/r=inst.*ram}{id}</code> - Likewise, but only if the domain matches the regex <code>inst.*ram</code></li>\n<li><code>{window_title/c=Instagram}{id}</code> - Likewise, but only if the window's title contains <code>Instagram</code> (case-sensitively)</li>\n<li><code>{window_title!/rc=Inst.*ram}{id}</code> - Likewise, but only if the window's title does not match the case-sensitive regex <code>Inst.*ram</code></li>\n</ul><br />\n<p>You can set a custom variable with <code>:=</code>. For example:</p>\n<ul><br />\n<li><code>{domain_nosub==cdninstagram.com}{foo:=bar}</code> - Sets the variable <code>foo</code> to <code>bar</code> if the domain is <code>cdninstagram.com</code>. The variable can then be accessed with e.g. <code>{foo}</code></li>\n</ul><br />\n<p>Date objects are accessible through a number of properties. Each property can be suffixed with <code>_utc</code> to get the UTC/GMT equivalent.</p>\n<ul><br />\n<li><code>..._iso</code> - Date in ISO format (e.g. <code>2019-12-31T23-30-56</code>). Note that <code>:</code> is replaced with <code>-</code> to avoid issues with paths under NTFS.</li>\n<li><code>..._ago</code> - Human-readable representation of the time elapsed since the date (e.g. <code>1 year and 10 months ago</code>, <code>5 months and 20 days ago</code>)</li>\n<li><code>..._unix</code> - Unix timestamp (e.g. <code>1577912345</code>)</li>\n<li><code>..._unix_ms</code> - Unix timestamp with millisecond accuracy (e.g. <code>1577912345678</code>)</li>\n<li><code>..._yyyymmdd</code> - Date in YYYYMMDD format (e.g. <code>20191230</code>)</li>\n<li><code>..._hhmmss</code> - Time in HHMMSS format (e.g. <code>233056</code>)</li>\n<li><code>..._year</code> - Full year (e.g. <code>2019</code>)</li>\n<li><code>..._month</code> - Zero-padded month (e.g. <code>12</code>)</li>\n<li><code>..._day</code> - Zero-padded day (e.g. <code>31</code>)</li>\n<li><code>..._hours</code> - Zero-padded hours in military/24-hour format (e.g. <code>23</code>)</li>\n<li><code>..._minutes</code> - Zero-padded minutes (e.g. <code>30</code>)</li>\n<li><code>..._seconds</code> - Zero-padded seconds (e.g. <code>56</code>)</li>\n</ul>": {
			"pt-BR": "As vari\u00E1veis s\u00E3o especificadas entre chaves (<code>{}</code>).</p>\n<p>Abaixo est\u00E1 uma lista de vari\u00E1veis v\u00E1lidas:</p>\n<ul><br />\n<li><code>filename</code> - Nome do arquivo original (com extens\u00E3o, se aplic\u00E1vel)</li>\n<li><code>filename_noext</code> - Nome do arquivo original (sem extens\u00E3o, se aplic\u00E1vel)</li>\n<li><code>ext</code> - Extens\u00E3o (prefixada com <code>.</code>)</li>\n<li><code>caption</code> - Legenda do popup</li>\n<li><code>author_username</code> - Nome de usu\u00E1rio do autor</li>\n<li><code>id</code> - ID do post</li>\n<li><code>host_title</code> - T\u00EDtulo da aba/janela atual</li>\n<li><code>host_url</code> - URL da p\u00E1gina de hospedagem</li>\n<li><code>host_domain</code> - Dom\u00EDnio da p\u00E1gina de hospedagem</li>\n<li><code>host_domain_nosub</code> - Dom\u00EDnio (sem subdom\u00EDnios) da p\u00E1gina de hospedagem</li>\n<li><code>url</code> - URL da m\u00EDdia</li>\n<li><code>domain</code> - Dom\u00EDnio da m\u00EDdia</li>\n<li><code>domain_nosub</code> - Dom\u00EDnio (sem subdom\u00EDnios) da m\u00EDdia</li>\n<li><code>is_screenshot</code> - Em branco, a linha s\u00F3 ser\u00E1 processada ao fazer uma captura de tela de um v\u00EDdeo</li>\n<li><code>prefix</code>, <code>suffix</code> - Em branco por padr\u00E3o, essas vari\u00E1veis ser\u00E3o automaticamente prefixadas/sufixadas ao nome do arquivo se definidas usando <code>:=</code></li>\n<li><code>created_...</code> - Data de cria\u00E7\u00E3o (veja a nota sobre objetos de data abaixo)</li>\n<li><code>updated_...</code> - Data de atualiza\u00E7\u00E3o, usar\u00E1 o cabe\u00E7alho <code>Last-Modified</code> se n\u00E3o especificado de outra forma pela regra (veja a nota sobre objetos de data abaixo)</li>\n<li><code>download_...</code> - Data de download (veja a nota sobre objetos de data abaixo)</li>\n<li><code>date_...</code> - Data de cria\u00E7\u00E3o/atualiza\u00E7\u00E3o (veja a nota sobre objetos de data abaixo)</li>\n</ul><br />\n<p>Voc\u00EA pode truncar o valor de uma vari\u00E1vel adicionando <code>:(n\u00FAmero)</code> antes da chave de fechamento (<code>}</code>). Por exemplo:</p>\n<ul><br />\n<li><code>{caption:10}</code> - Trunca a legenda para ter no m\u00E1ximo 10 caracteres</li>\n<li><code>{caption:10.}</code> - O mesmo, mas adicionar\u00E1 uma retic\u00EAncia (\u2026) se a legenda for truncada</li>\n</ul><br />\n<p>Se uma vari\u00E1vel n\u00E3o existir, por padr\u00E3o ignorar\u00E1 a string de formato atual e usar\u00E1 a pr\u00F3xima linha, a menos que <code>?</code> seja adicionado antes da chave de fechamento. Por exemplo:</p>\n<ul><br />\n<li><code>{ext?}</code> - Ser\u00E1 substitu\u00EDdo por nada se <code>ext</code> n\u00E3o existir</li>\n<li><code>{caption?sem legenda}</code> - Ser\u00E1 substitu\u00EDdo por <code>sem legenda</code> se <code>caption</code> n\u00E3o existir</li>\n</ul><br />\n<p>Voc\u00EA pode verificar igualdade e desigualdade com os operadores <code>==</code> e <code>!=</code> respectivamente. Por exemplo:</p>\n<ul><br />\n<li><code>{domain_nosub==cdninstagram.com}{author_username} {id}</code> - Executar\u00E1 o formato atual (<code>{author_username} {id}</code> neste caso) apenas se o dom\u00EDnio for cdninstagram.com</li>\n</ul><br />\n<p>Voc\u00EA pode verificar se uma vari\u00E1vel cont\u00E9m uma string com <code>/=</code> (<code>!/=</code> para o oposto). Tamb\u00E9m suporta duas flags, <code>r</code> (regex) e <code>c</code> (case-sensitive), se adicionadas entre <code>/</code> e <code>=</code>. Por exemplo:</p>\n<ul><br />\n<li><code>{domain/=instagram}{id}</code> - Executar\u00E1 o formato atual (<code>{id}</code>) apenas se o dom\u00EDnio contiver <code>instagram</code></li>\n<li><code>{domain!/=instagram}{id}</code> - Da mesma forma, mas apenas se o dom\u00EDnio n\u00E3o contiver <code>instagram</code></li>\n<li><code>{domain/r=inst.*ram}{id}</code> - Da mesma forma, mas apenas se o dom\u00EDnio corresponder ao regex <code>inst.*ram</code></li>\n<li><code>{window_title/c=Instagram}{id}</code> - Da mesma forma, mas apenas se o t\u00EDtulo da janela contiver <code>Instagram</code> (diferencia\u00E7\u00E3o de mai\u00FAsculas e min\u00FAsculas)</li>\n<li><code>{window_title!/rc=Inst.*ram}{id}</code> - Da mesma forma, mas apenas se o t\u00EDtulo da janela n\u00E3o corresponder ao regex case-sensitive <code>Inst.*ram</code></li>\n</ul><br />\n<p>Voc\u00EA pode definir uma vari\u00E1vel personalizada com <code>:=</code>. Por exemplo:</p>\n<ul><br />\n<li><code>{domain_nosub==cdninstagram.com}{foo:=bar}</code> - Define a vari\u00E1vel <code>foo</code> como <code>bar</code> se o dom\u00EDnio for <code>cdninstagram.com</code>. A vari\u00E1vel pode ent\u00E3o ser acessada com, por exemplo, <code>{foo}</code></li>\n</ul><br />\n<p>Objetos de data s\u00E3o acess\u00EDveis atrav\u00E9s de v\u00E1rias propriedades. Cada propriedade pode ser sufixada com <code>_utc</code> para obter o equivalente UTC/GMT.</p>\n<ul><br />\n<li><code>..._iso</code> - Data em formato ISO (ex.: <code>2019-12-31T23-30-56</code>). Observe que <code>:</code> \u00E9 substitu\u00EDdo por <code>-</code> para evitar problemas com caminhos no NTFS.</li>\n<li><code>..._ago</code> - Representa\u00E7\u00E3o leg\u00EDvel do tempo decorrido desde a data (ex.: <code>1 ano e 10 meses atr\u00E1s</code>, <code>5 meses e 20 dias atr\u00E1s</code>)</li>\n<li><code>..._unix</code> - Timestamp Unix (ex.: <code>1577912345</code>)</li>\n<li><code>..._unix_ms</code> - Timestamp Unix com precis\u00E3o de milissegundos (ex.: <code>1577912345678</code>)</li>\n<li><code>..._yyyymmdd</code> - Data em formato YYYYMMDD (ex.: <code>20191230</code>)</li>\n<li><code>..._hhmmss</code> - Hora em formato HHMMSS (ex.: <code>233056</code>)</li>\n<li><code>..._year</code> - Ano completo (ex.: <code>2019</code>)</li>\n<li><code>..._month</code> - M\u00EAs com zero \u00E0 esquerda (ex.: <code>12</code>)</li>\n<li><code>..._day</code> - Dia com zero \u00E0 esquerda (ex.: <code>31</code>)</li>\n<li><code>..._hours</code> - Horas com zero \u00E0 esquerda no formato militar/24 horas (ex.: <code>23</code>)</li>\n<li><code>..._minutes</code> - Minutos com zero \u00E0 esquerda (ex.: <code>30</code>)</li>\n<li><code>..._seconds</code> - Segundos com zero \u00E0 esquerda (ex.: <code>56</code>)</li>\n</ul>",
			"ru": "<p>\u041F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435 \u0443\u043A\u0430\u0437\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u043C\u0435\u0436\u0434\u0443 \u0444\u0438\u0433\u0443\u0440\u043D\u044B\u043C\u0438 \u0441\u043A\u043E\u0431\u043A\u0430\u043C\u0438 (<code>{}</code>).</p>\n<p>\u041D\u0438\u0436\u0435 \u043F\u0440\u0438\u0432\u0435\u0434\u0435\u043D \u0441\u043F\u0438\u0441\u043E\u043A \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0445 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0445:</p>\n<ul><br />\n<li><code>filename</code> - \u041E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u043E\u0435 \u0438\u043C\u044F \u0444\u0430\u0439\u043B\u0430 (\u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435\u043C, \u0435\u0441\u043B\u0438 \u043F\u0440\u0438\u043C\u0435\u043D\u0438\u043C\u043E)</li>\n<li><code>filename_noext</code> - \u041E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u043E\u0435 \u0438\u043C\u044F \u0444\u0430\u0439\u043B\u0430 (\u0431\u0435\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F, \u0435\u0441\u043B\u0438 \u043F\u0440\u0438\u043C\u0435\u043D\u0438\u043C\u043E)</li>\n<li><code>ext</code> - \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0435 (\u0441 \u043F\u0440\u0435\u0444\u0438\u043A\u0441\u043E\u043C <code>.</code>)</li>\n<li><code>caption</code> - \u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430</li>\n<li><code>author_username</code> - \u0418\u043C\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0430\u0432\u0442\u043E\u0440\u0430</li>\n<li><code>id</code> - ID \u0437\u0430\u043F\u0438\u0441\u0438</li>\n<li><code>host_title</code> - \u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0442\u0435\u043A\u0443\u0449\u0435\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0438/\u043E\u043A\u043D\u0430</li>\n<li><code>host_url</code> - URL-\u0430\u0434\u0440\u0435\u0441 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u0445\u043E\u0441\u0442\u0430</li>\n<li><code>host_domain</code> - \u0414\u043E\u043C\u0435\u043D \u0433\u043B\u0430\u0432\u043D\u043E\u0439 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B</li>\n<li><code>host_domain_nosub</code> - \u0414\u043E\u043C\u0435\u043D (\u0431\u0435\u0437 \u0441\u0443\u0431\u0434\u043E\u043C\u0435\u043D\u043E\u0432) \u0433\u043B\u0430\u0432\u043D\u043E\u0439 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B</li>\n<li><code>url</code> - URL-\u0430\u0434\u0440\u0435\u0441 \u043C\u0435\u0434\u0438\u0430</li>\n<li><code>domain</code> - \u0414\u043E\u043C\u0435\u043D \u043C\u0435\u0434\u0438\u0430</li>\n<li><code>domain_nosub</code> - \u0414\u043E\u043C\u0435\u043D (\u0431\u0435\u0437 \u0441\u0443\u0431\u0434\u043E\u043C\u0435\u043D\u043E\u0432) \u043C\u0435\u0434\u0438\u0430</li>\n<li><code>is_screenshot</code> - \u041F\u0443\u0441\u0442\u043E, \u0441\u0442\u0440\u043E\u043A\u0430 \u0431\u0443\u0434\u0435\u0442 \u043E\u0431\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u0442\u044C\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u0440\u0438 \u0441\u043A\u0440\u0438\u043D\u0448\u043E\u0442\u0435 \u0432\u0438\u0434\u0435\u043E.</li>\n<li><code>prefix</code>, <code>suffix</code> - \u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E \u043F\u0443\u0441\u0442\u044B\u0435, \u044D\u0442\u0438 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435 \u0431\u0443\u0434\u0443\u0442 \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u043F\u0440\u0438\u0441\u0442\u0430\u0432\u043B\u044F\u0442\u044C\u0441\u044F \u043A \u0438\u043C\u0435\u043D\u0438 \u0444\u0430\u0439\u043B\u0430, \u0435\u0441\u043B\u0438 \u043E\u043D\u0438 \u0437\u0430\u0434\u0430\u043D\u044B \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E <code>:=</code></li>\n<li><code>created_...</code> - \u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F (\u0441\u043C. \u043F\u0440\u0438\u043C\u0435\u0447\u0430\u043D\u0438\u0435 \u043A \u043E\u0431\u044A\u0435\u043A\u0442\u0430\u043C Date \u043D\u0438\u0436\u0435)</li>\n<li><code>updated_...</code> - \u0414\u0430\u0442\u0430 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F, \u043F\u0440\u0438 \u044D\u0442\u043E\u043C \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C\u0441\u044F \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A <code>Last-Modified,</code> \u0435\u0441\u043B\u0438 \u043F\u0440\u0430\u0432\u0438\u043B\u043E \u043D\u0435 \u0443\u043A\u0430\u0437\u0430\u043D\u043E \u0438\u043D\u044B\u043C \u043E\u0431\u0440\u0430\u0437\u043E\u043C (\u0441\u043C. \u043F\u0440\u0438\u043C\u0435\u0447\u0430\u043D\u0438\u0435 \u043A \u043E\u0431\u044A\u0435\u043A\u0442\u0430\u043C Date \u043D\u0438\u0436\u0435)</li>\n<li><code>download_...</code> - \u0414\u0430\u0442\u0430 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F (\u0441\u043C. \u043F\u0440\u0438\u043C\u0435\u0447\u0430\u043D\u0438\u0435 \u043E\u0431 \u043E\u0431\u044A\u0435\u043A\u0442\u0430\u0445 Date \u043D\u0438\u0436\u0435)</li>\n<li><code>date_...</code> - \u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F/\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F (\u0441\u043C. \u043F\u0440\u0438\u043C\u0435\u0447\u0430\u043D\u0438\u0435 \u043E\u0431 \u043E\u0431\u044A\u0435\u043A\u0442\u0430\u0445 Date \u043D\u0438\u0436\u0435)</li>\n</ul><br />\n<p>\u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0443\u0441\u0435\u0447\u044C \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439, \u0434\u043E\u0431\u0430\u0432\u0438\u0432 <code>:(number)</code> \u043F\u0435\u0440\u0435\u0434 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u044E\u0449\u0435\u0439 \u0441\u043A\u043E\u0431\u043A\u043E\u0439 (<code>}</code>). \u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440:</p>\n<ul><br />\n<li><code>{caption:10}</code> - \u041E\u0431\u0440\u0435\u0437\u0430\u0435\u0442 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0434\u043E 10 \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432</li>\n<li><code>{caption:10.}</code> - \u0422\u043E \u0436\u0435 \u0441\u0430\u043C\u043E\u0435, \u043D\u043E \u0441 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043C \u043C\u043D\u043E\u0433\u043E\u0442\u043E\u0447\u0438\u044F (\u2026), \u0435\u0441\u043B\u0438 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0431\u044B\u043B \u043E\u0431\u0440\u0435\u0437\u0430\u043D</li>\n</ul><br />\n<p>\u0415\u0441\u043B\u0438 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0430\u044F \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E \u043E\u043D\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0433\u043D\u043E\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0442\u0435\u043A\u0443\u0449\u0443\u044E \u0441\u0442\u0440\u043E\u043A\u0443 \u0444\u043E\u0440\u043C\u0430\u0442\u0430 \u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0442\u0443, \u043A\u043E\u0442\u043E\u0440\u0430\u044F \u043D\u0430\u0445\u043E\u0434\u0438\u0442\u0441\u044F \u0432 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0439 \u0441\u0442\u0440\u043E\u043A\u0435, \u0435\u0441\u043B\u0438 \u0442\u043E\u043B\u044C\u043A\u043E <code>?</code> \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0430 \u043F\u0435\u0440\u0435\u0434 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u044E\u0449\u0435\u0439 \u0441\u043A\u043E\u0431\u043A\u043E\u0439. \u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440:</p>\n<ul><br />\n<li><code>{ext?}</code> - \u0411\u0443\u0434\u0435\u0442 \u0437\u0430\u043C\u0435\u043D\u0435\u043D \u043D\u0438\u0447\u0435\u043C, \u0435\u0441\u043B\u0438 <code>ext</code> \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442</li>\n<li><code>{caption?no caption}</code> - \u0411\u0443\u0434\u0435\u0442 \u0437\u0430\u043C\u0435\u043D\u0435\u043D\u043E \u043D\u0430 <code>no caption</code>, \u0435\u0441\u043B\u0438 <code>caption</code> \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442</li>\n</ul><br />\n<p>\u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u0440\u0430\u0432\u0435\u043D\u0441\u0442\u0432\u043E \u0438 \u043D\u0435\u0440\u0430\u0432\u0435\u043D\u0441\u0442\u0432\u043E \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440\u043E\u0432 <code>==</code> \u0438 <code>!=</code> \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043D\u043D\u043E. \u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440:</p>\n<ul><br />\n<li><code>{domain_nosub==cdninstagram.com}{author_username} {id}</code> - \u0411\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u0432 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u0444\u043E\u0440\u043C\u0430\u0442\u0435 (\u0432 \u0434\u0430\u043D\u043D\u043E\u043C \u0441\u043B\u0443\u0447\u0430\u0435 <code>{author_username} {id}</code>), \u0435\u0441\u043B\u0438 \u0434\u043E\u043C\u0435\u043D cdninstagram.com</li>\n</ul><br />\n<p>\u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C, \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 \u043B\u0438 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0443 \u0441 <code>/=</code> (<code>!/=</code> \u0434\u043B\u044F \u043F\u0440\u043E\u0442\u0438\u0432\u043E\u043F\u043E\u043B\u043E\u0436\u043D\u043E\u0433\u043E). \u041E\u043D \u0442\u0430\u043A\u0436\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0434\u0432\u0430 \u0444\u043B\u0430\u0433\u0430, <code>r</code> (regex) \u0438 <code>c</code> (\u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u043A \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0443), \u0435\u0441\u043B\u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D \u043C\u0435\u0436\u0434\u0443 <code>/</code> \u0438 <code>=</code>. \u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440:</p>\n<ul><br />\n<li><code>{domain/=instagram}{id}</code> - \u0411\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u0432 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u0444\u043E\u0440\u043C\u0430\u0442\u0435 (<code>{id}),</code> \u0435\u0441\u043B\u0438 \u0434\u043E\u043C\u0435\u043D \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 <code>instagram</code></li>\n<li><code>{domain!/=instagram}{id}</code> - \u0410\u043D\u0430\u043B\u043E\u0433\u0438\u0447\u043D\u043E, \u043D\u043E \u0442\u043E\u043B\u044C\u043A\u043E \u0435\u0441\u043B\u0438 \u0434\u043E\u043C\u0435\u043D \u043D\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 <code>instagram</code></li>\n<li><code>{domain/r=inst.*ram}{id}</code> - \u0410\u043D\u0430\u043B\u043E\u0433\u0438\u0447\u043D\u043E, \u043D\u043E \u0442\u043E\u043B\u044C\u043A\u043E \u0432 \u0442\u043E\u043C \u0441\u043B\u0443\u0447\u0430\u0435, \u0435\u0441\u043B\u0438 \u0434\u043E\u043C\u0435\u043D \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 regex <code>inst.*ram</code></li>\n<li><code>{window_title/c=Instagram}{id}</code> - \u0410\u043D\u0430\u043B\u043E\u0433\u0438\u0447\u043D\u043E, \u043D\u043E \u0442\u043E\u043B\u044C\u043A\u043E \u0435\u0441\u043B\u0438 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u043E\u043A\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u0442 <code>Instagram</code> (\u0441 \u0443\u0447\u0451\u0442\u043E\u043C \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430)</li>\n<li><code>{window_title!/rc=Inst.*ram}{id}</code> - \u0410\u043D\u0430\u043B\u043E\u0433\u0438\u0447\u043D\u043E, \u043D\u043E \u0442\u043E\u043B\u044C\u043A\u043E \u0432 \u0442\u043E\u043C \u0441\u043B\u0443\u0447\u0430\u0435, \u0435\u0441\u043B\u0438 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u043E\u043A\u043D\u0430 \u043D\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 regex <code>Inst.*ram</code> \u0441 \u0443\u0447\u0451\u0442\u043E\u043C \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430</li>\n</ul><br />\n<p>\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0443\u044E \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0443\u044E \u043C\u043E\u0436\u043D\u043E \u0437\u0430\u0434\u0430\u0442\u044C \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E <code>:=</code>. \u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440:</p>\n<ul><br />\n<li><code>{domain_nosub==cdninstagram.com}{foo:=bar}</code> - \u0423\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442 \u0434\u043B\u044F \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439 <code>foo</code> \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 <code>bar</code>, \u0435\u0441\u043B\u0438 \u0434\u043E\u043C\u0435\u043D\u043E\u043C \u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F <code>cdninstagram.com</code>. \u0417\u0430\u0442\u0435\u043C \u043A \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439 \u043C\u043E\u0436\u043D\u043E \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u0434\u043E\u0441\u0442\u0443\u043F, \u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 <code>{foo}</code></li>\n</ul><br />\n<p>\u041E\u0431\u044A\u0435\u043A\u0442\u044B Date \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B \u0447\u0435\u0440\u0435\u0437 \u0440\u044F\u0434 \u0441\u0432\u043E\u0439\u0441\u0442\u0432. \u041A\u0430\u0436\u0434\u043E\u0435 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u043E \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0441\u0443\u0444\u0444\u0438\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0441 <code>_utc</code>, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C \u044D\u043A\u0432\u0438\u0432\u0430\u043B\u0435\u043D\u0442 UTC/GMT.</p>\n<ul><br />\n<li><code>..._iso</code> - \u0414\u0430\u0442\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 ISO (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, <code>2019-12-31T23-30-56</code>). \u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043D\u0438\u043C\u0430\u043D\u0438\u0435, \u0447\u0442\u043E <code>:</code> \u0437\u0430\u043C\u0435\u043D\u044F\u0435\u0442\u0441\u044F \u043D\u0430 <code>-</code> \u0432\u043E \u0438\u0437\u0431\u0435\u0436\u0430\u043D\u0438\u0435 \u043F\u0440\u043E\u0431\u043B\u0435\u043C \u0441 \u043F\u0443\u0442\u044F\u043C\u0438 \u043F\u043E\u0434 NTFS.</li>\n<li><code>..._ago</code> - \u0423\u0434\u043E\u0431\u043E\u0447\u0438\u0442\u0430\u0435\u043C\u043E\u0435 \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0432\u0440\u0435\u043C\u0435\u043D\u0438, \u043F\u0440\u043E\u0448\u0435\u0434\u0448\u0435\u0433\u043E \u0441 \u0434\u0430\u0442\u044B (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, <code>1 \u0433\u043E\u0434 \u0438 10 \u043C\u0435\u0441\u044F\u0446\u0435\u0432 \u043D\u0430\u0437\u0430\u0434</code>, <code>5 \u043C\u0435\u0441\u044F\u0446\u0435\u0432 \u0438 20 \u0434\u043D\u0435\u0439 \u043D\u0430\u0437\u0430\u0434</code>)</li>\n<li><code>..._unix</code> - \u041E\u0442\u043C\u0435\u0442\u043A\u0430 \u0432\u0440\u0435\u043C\u0435\u043D\u0438 Unix (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 <code>1577912345</code>)</li>\n<li><code>..._unix_ms</code> - \u041E\u0442\u043C\u0435\u0442\u043A\u0430 \u0432\u0440\u0435\u043C\u0435\u043D\u0438 Unix \u0441 \u0442\u043E\u0447\u043D\u043E\u0441\u0442\u044C\u044E \u0434\u043E \u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u044B (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 <code>1577912345678</code>)</li>\n<li><code>..._yyyymmdd</code> - \u0414\u0430\u0442\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 YYYYMMDD (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 <code>20191230</code>)</li>\n<li><code>..._hhmmss</code> - \u0412\u0440\u0435\u043C\u044F \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 HHMMSS (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 <code>233056</code>)</li>\n<li><code>..._year</code> - \u041F\u043E\u043B\u043D\u044B\u0439 \u0433\u043E\u0434 (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 <code>2019</code>)</li>\n<li><code>..._month</code> - \u041C\u0435\u0441\u044F\u0446 \u0441 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043C \u043D\u0443\u043B\u044F (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 <code>12</code>)</li>\n<li><code>..._day</code> - \u0414\u0435\u043D\u044C \u0441 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043D\u0443\u043B\u044F (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 <code>31</code>)</li>\n<li><code>..._hours</code> - \u0427\u0430\u0441\u044B \u0441 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043C \u043D\u0443\u043B\u044F \u0432 \u0432\u043E\u0435\u043D\u043D\u043E\u043C/24-\u0447\u0430\u0441\u043E\u0432\u043E\u043C \u0444\u043E\u0440\u043C\u0430\u0442\u0435 (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 <code>23</code>)</li>\n<li><code>..._minutes</code> - \u041C\u0438\u043D\u0443\u0442\u044B \u0441 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043C \u043D\u0443\u043B\u044F (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 <code>30</code>)</li>\n<li><code>..._seconds</code> - \u0421\u0435\u043A\u0443\u043D\u0434\u044B \u0441 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435\u043C \u043D\u0443\u043B\u044F (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440 <code>56</code>)</li>\n</ul>",
			"zh-CN": "<p>\u5927\u62EC\u53F7\u95F4\u53EF\u4F7F\u7528\u7684\u53D8\u91CF\uFF08<code>{}</code>\uFF09\u3002</p>\n<p>\u4E0B\u8FF0\u4E3A\u6709\u6548\u53D8\u91CF\u5217\u8868\uFF1A</p>\n<ul><br />\n<li><code>filename</code> - \u539F\u59CB\u6587\u4EF6\u540D\uFF08\u542B\u6269\u5C55\u540D\uFF0C\u5982\u9002\u7528\uFF09</li>\n<li><code>filename_noext</code> - \u539F\u59CB\u6587\u4EF6\u540D\uFF08\u65E0\u6269\u5C55\u540D\uFF0C\u5982\u9002\u7528\uFF09</li>\n<li><code>ext</code> - \u6269\u5C55\u540D\uFF08\u542B <code>.</code> \u524D\u7F00\uFF09</li>\n<li><code>caption</code> - \u5F39\u7A97\u7684\u6807\u9898</li>\n<li><code>author_username</code> - \u4F5C\u8005\u7684\u7528\u6237\u540D</li>\n<li><code>id</code> - \u5E16\u5B50 ID</li>\n<li><code>host_title</code> - \u5F53\u524D\u6807\u7B7E\u9875/\u7A97\u53E3\u7684\u6807\u9898</li>\n<li><code>host_url</code> - \u6258\u7BA1\u7F51\u9875\u7684\u7F51\u5740</li>\n<li><code>host_domain</code> - \u6258\u7BA1\u7F51\u9875\u7684\u57DF\u540D</li>\n<li><code>host_domain_nosub</code> - \u6258\u7BA1\u7F51\u9875\u7684\u57DF\u540D\uFF08\u4E0D\u542B\u5B50\u57DF\u540D\uFF09</li>\n<li><code>url</code> - \u5A92\u4F53\uFF08\u6587\u4EF6\uFF09\u7684\u7F51\u5740</li>\n<li><code>domain</code> - \u5A92\u4F53\uFF08\u6587\u4EF6\uFF09\u7684\u57DF\u540D</li>\n<li><code>domain_nosub</code> - \u5A92\u4F53\u7684\u57DF\u540D\uFF08\u4E0D\u542B\u5B50\u57DF\u540D\uFF09</li>\n<li><code>is_screenshot</code> - \u7A7A\u767D\uFF0C\u6B64\u884C\u4EC5\u5728\u5BF9\u89C6\u9891\u622A\u56FE\u65F6\u5904\u7406</li>\n<li><code>prefix</code>, <code>suffix</code> - \u9ED8\u8BA4\u7A7A\u767D\uFF0C\u8FD9\u4E9B\u53D8\u91CF\u5728\u4F7F\u7528 <code>:=</code> \u65F6\u81EA\u52A8\u4F5C\u4E3A\u6587\u4EF6\u540D\u7684\u524D\u7F00/\u540E\u7F00</li>\n<li><code>created_...</code> - \u521B\u5EFA\u65E5\u671F\uFF08\u8BE6\u89C1\u4E0B\u6587\u201C\u65E5\u671F\u201D\u5BF9\u8C61\uFF09</li>\n<li><code>updated_...</code> - \u66F4\u65B0\u65E5\u671F\uFF0C\u89C4\u5219\u672A\u53E6\u884C\u6307\u5B9A\u65F6\u5C06\u4F7F\u7528 <code>Last-Modified</code> \u5934\uFF08\u8BE6\u89C1\u4E0B\u6587\u201C\u65E5\u671F\u201D\u5BF9\u8C61\uFF09</li>\n<li><code>download_...</code> - \u4E0B\u8F7D\u65E5\u671F\uFF08\u8BE6\u89C1\u4E0B\u6587\u201C\u65E5\u671F\u201D\u5BF9\u8C61\uFF09</li>\n<li><code>date_...</code> - \u521B\u5EFA/\u66F4\u65B0\u65E5\u671F\uFF08\u8BE6\u89C1\u4E0B\u6587\u201C\u65E5\u671F\u201D\u5BF9\u8C61\uFF09</li>\n</ul><br />\n<p>\u60A8\u53EF\u4EE5\u5728\u53D8\u91CF\u7684\u53F3\u62EC\u53F7\uFF08<code>}</code>\uFF09\u524D\u6DFB\u52A0 <code>:(number)</code> \u6765\u622A\u65AD\u503C\u3002\u4F8B\u5982\uFF1A</p>\n<ul><br />\n<li><code>{caption:10}</code> - \u5C06\u6807\u9898\u622A\u65AD\u4E3A\u6700\u591A 10 \u4E2A\u5B57\u7B26</li>\n<li><code>{caption:10.}</code> - \u540C\u4E0A\uFF0C\u4F46\u5F53\u6807\u9898\u88AB\u622A\u65AD\u65F6\u8FFD\u52A0\u4E00\u4E2A\u7701\u7565\u53F7\uFF08\u2026\uFF09</li>\n</ul><br />\n<p>\u5982\u679C\u53D8\u91CF\u4E0D\u5B58\u5728\uFF0C\u9ED8\u8BA4\u5C06\u5FFD\u7565\u5F53\u524D\u7684\u683C\u5F0F\u5316\u5B57\u7B26\u4E32\uFF0C\u5E76\u4F7F\u7528\u4E0B\u4E00\u884C\uFF0C\u9664\u975E\u53F3\u62EC\u53F7\u524D\u6DFB\u52A0\u4E86 <code>?</code>\u3002\u4F8B\u5982\uFF1A</p>\n<ul><br />\n<li><code>{ext?}</code> - \u5728 <code>ext</code> \u4E0D\u5B58\u5728\u65F6\u53D8\u4E3A\u7A7A</li>\n<li><code>{caption?\u65E0\u6807\u9898}</code> - <code>caption</code> \u4E0D\u5B58\u5728\u65F6\u53D8\u4E3A <code>\u65E0\u6807\u9898</code></li>\n</ul><br />\n<p>\u53EF\u4EE5\u5206\u522B\u4F7F\u7528 <code>==</code> \u548C <code>!=</code> \u64CD\u4F5C\u7B26\u68C0\u67E5\u76F8\u7B49\u548C\u4E0D\u7B49\u5F0F\u3002\u4F8B\u5982\uFF1A</p>\n<ul><br />\n<li><code>{domain_nosub==cdninstagram.com}{author_username} {id}</code> - \u4EC5\u5728\u57DF\u540D\u4E3A cdninstagram.com \u65F6\u91C7\u7528\u8FD9\u6761\u683C\u5F0F\uFF08<code>{author_username} {id}</code>\uFF09</li>\n</ul><br />\n<p>\u53EF\u4EE5\u7528 <code>/=</code> \u68C0\u67E5\u53D8\u91CF\u662F\u5426\u5305\u542B\u6307\u5B9A\u5B57\u7B26\u4E32\uFF08<code>!/=</code> \u68C0\u67E5\u662F\u5426\u4E0D\u5305\u542B\uFF09\u3002\u5B83\u8FD8\u652F\u6301\u4E24\u4E2A\u6807\u5FD7\uFF0C<code>r</code>\uFF08\u6B63\u5219\u8868\u8FBE\u5F0F\uFF09\u548C <code>c</code>\uFF08\u533A\u5206\u5927\u5C0F\u5199\uFF09\uFF0C\u52A0\u5728 <code>/</code> \u4E0E <code>=</code> \u4E4B\u95F4\u3002\u4F8B\u5982\uFF1A</p>\n<ul><br />\n<li><code>{domain/=instagram}{id}</code> - \u4EC5\u5728\u57DF\u540D\u5305\u542B <code>instagram</code> \u65F6\u91C7\u7528\u683C\u5F0F\uFF08<code>{id}</code>\uFF09</li>\n<li><code>{domain!/=instagram}{id}</code> - \u4EC5\u5728\u57DF\u540D\u4E0D\u5305\u542B <code>instagram</code> \u65F6</li>\n<li><code>{domain/r=inst.*ram}{id}</code> - \u4EC5\u5728\u57DF\u540D\u5339\u914D\u6B63\u5219\u8868\u8FBE\u5F0F <code>inst.*ram</code> \u65F6</li>\n<li><code>{window_title/c=Instagram}{id}</code> - \u4EC5\u5728\u7A97\u53E3\u6807\u9898\u5305\u542B <code>Instagram</code> \u65F6\uFF08\u533A\u5206\u5927\u5C0F\u5199\uFF09</li>\n<li><code>{window_title!/rc=Inst.*ram}{id}</code> - \u4EC5\u5728\u7A97\u53E3\u6807\u9898\u4E0D\u5339\u914D\u533A\u5206\u5927\u5C0F\u5199\u7684\u6B63\u5219\u8868\u8FBE\u5F0F <code>Inst.*ram</code> \u65F6</li>\n</ul><br />\n<p>\u53EF\u4EE5\u7528 <code>:=</code> \u8BBE\u7F6E\u4E00\u4E2A\u81EA\u5B9A\u4E49\u53D8\u91CF\u3002\u4F8B\u5982\uFF1A</p>\n<ul><br />\n<li><code>{domain_nosub==cdninstagram.com}{foo:=bar}</code> - \u5982\u679C\u57DF\u540D\u662F <code>cdninstagram.com</code>\uFF0C\u8BBE\u7F6E\u53D8\u91CF <code>foo</code> \u4E3A <code>bar</code>\u3002\u53D8\u91CF\u7684\u8BBF\u95EE\u65B9\u5F0F\u5982 <code>{foo}</code></li>\n</ul><br />\n<p>\u65E5\u671F\u5BF9\u8C61\u53EF\u901A\u8FC7\u4F17\u591A\u5C5E\u6027\u8BBF\u95EE\u3002\u6BCF\u4E2A\u5C5E\u6027\u90FD\u53EF\u4EE5\u540E\u7F00 <code>_utc</code> \u6765\u83B7\u53D6\u7B49\u6548\u7684 UTC/GMT \u65F6\u95F4\u3002</p>\n<ul><br />\n<li><code>..._iso</code> - ISO \u683C\u5F0F\u7684\u65E5\u671F\uFF08\u4F8B\u5982 <code>2019-12-31T23-30-56</code>\uFF09\u3002\u6CE8\u610F\uFF0C<code>:</code> \u88AB\u66FF\u6362\u4E3A <code>-</code> \u4EE5\u907F\u514D\u8FDD\u53CD NTFS \u8DEF\u5F84\u7EA6\u675F\u3002</li>\n<li><code>..._ago</code> - \u6613\u4E8E\u9605\u8BFB\u7684\u5DF2\u7ECF\u8FC7\u65F6\u95F4\uFF08\u4F8B\u5982 <code>1 year and 10 months ago</code>\u3001<code>5 months and 20 days ago</code>\uFF09</li>\n<li><code>..._unix</code> - Unix \u65F6\u95F4\u6233\uFF08\u4F8B\u5982 <code>1577912345</code>\uFF09</li>\n<li><code>..._unix_ms</code> - Unix \u65F6\u95F4\u6233\uFF0C\u6BEB\u79D2\u7CBE\u5EA6\uFF08\u4F8B\u5982 <code>1577912345678</code>\uFF09</li>\n<li><code>..._yyyymmdd</code> - YYYYMMDD \u683C\u5F0F\u65E5\u671F\uFF08\u4F8B\u5982 <code>20191230</code>\uFF09</li>\n<li><code>..._hhmmss</code> - HHMMSS \u683C\u5F0F\u65F6\u95F4\uFF08\u4F8B\u5982 <code>233056</code>\uFF09</li>\n<li><code>..._year</code> - \u5B8C\u6574\u5E74\u4EFD\uFF08\u4F8B\u5982 <code>2019</code>\uFF09</li>\n<li><code>..._month</code> - \u8865\u96F6\u6708\u4EFD\uFF08\u4F8B\u5982 <code>12</code>\uFF09</li>\n<li><code>..._day</code> - \u8865\u96F6\u7684\u65E5\uFF08\u4F8B\u5982 <code>31</code>\uFF09</li>\n<li><code>..._hours</code> - \u8865\u96F6\u7684\u5C0F\u65F6\uFF0C24\u5C0F\u65F6\u5236\uFF08\u4F8B\u5982 <code>23</code>\uFF09</li>\n<li><code>..._minutes</code> - \u8865\u96F6\u7684\u5206\u949F\uFF08\u4F8B\u5982 <code>30</code>\uFF09</li>\n<li><code>..._seconds</code> - \u8865\u96F6\u7684\u79D2\uFF08\u4F8B\u5982 <code>56</code>\uFF09</li>\n</ul>"
		},
		"Replace special characters with underscores": {
			"pt-BR": "Substituir caracteres especiais por underlines",
			"ru": "\u0417\u0430\u043C\u0435\u043D\u0430 \u0441\u043F\u0435\u0446\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432 \u043F\u043E\u0434\u0447\u0451\u0440\u043A\u0438\u0432\u0430\u043D\u0438\u0435\u043C",
			"zh-CN": "\u7528\u4E0B\u5212\u7EBF\u66FF\u6362\u7279\u6B8A\u5B57\u7B26"
		},
		"Replaces characters such as `/` or `\"` with `_` when downloading. Note that browsers will usually do this automatically, this is just to ensure consistent behavior.": {
			"pt-BR": "Substitui caracteres como `/` ou `\"` por `_` ao baixar. Observe que os navegadores geralmente fazem isso automaticamente, isso \u00E9 apenas para garantir um comportamento consistente.",
			"ru": "\u0417\u0430\u043C\u0435\u043D\u044F\u0435\u0442 \u0442\u0430\u043A\u0438\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u044B, \u043A\u0430\u043A `/` \u0438\u043B\u0438 `\"` \u043D\u0430 `_` \u043F\u0440\u0438 \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0438. \u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043D\u0438\u043C\u0430\u043D\u0438\u0435, \u0447\u0442\u043E \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044B \u043E\u0431\u044B\u0447\u043D\u043E \u0434\u0435\u043B\u0430\u044E\u0442 \u044D\u0442\u043E \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438, \u044D\u0442\u043E \u043F\u0440\u043E\u0441\u0442\u043E \u0434\u043B\u044F \u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0435\u043D\u0438\u044F \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u044F.",
			"zh-CN": "\u4E0B\u8F7D\u65F6\u5C06\u8BF8\u5982 `/`\u3001`\"` \u7B49\u5B57\u7B26\u66FF\u6362\u4E3A `_` \u3002\u6D4F\u89C8\u5668\u901A\u5E38\u4F1A\u81EA\u52A8\u8FD9\u6837\u505A\uFF0C\u8FD9\u53EA\u662F\u4E3A\u4E86\u786E\u4FDD\u4E00\u81F4\u7684\u884C\u4E3A\u3002"
		},
		"Trigger keybinding that will run the Replace Images function": {
			"pt-BR": "Atalho de teclado que executar\u00E1 a fun\u00E7\u00E3o Substituir Imagens",
			"ru": "\u0412\u044B\u0437\u044B\u0432\u0430\u0435\u0442 \u043F\u0440\u0438\u0432\u044F\u0437\u043A\u0443 \u043A\u043B\u0430\u0432\u0438\u0448, \u043A\u043E\u0442\u043E\u0440\u0430\u044F \u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442 \u0444\u0443\u043D\u043A\u0446\u0438\u044E \u0437\u0430\u043C\u0435\u043D\u044B \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439.",
			"zh-CN": "\u8FD0\u884C\u201C\u66FF\u6362\u56FE\u50CF\u201D\u529F\u80FD\u7684\u89E6\u53D1\u952E"
		},
		"Automatically replace images": {
			"pt-BR": "Substituir imagens automaticamente",
			"ru": "\u0410\u0432\u0442\u043E\u0437\u0430\u043C\u0435\u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439",
			"zh-CN": "\u81EA\u52A8\u66FF\u6362\u56FE\u50CF"
		},
		"Automatically replace images to larger versions on pages you view": {
			"pt-BR": "Substituir automaticamente imagens por vers\u00F5es maiores nas p\u00E1ginas que voc\u00EA visualiza",
			"ru": "\u0410\u0432\u0442\u043E\u0437\u0430\u043C\u0435\u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439 \u043D\u0430 \u0431\u043E\u043B\u0435\u0435 \u043A\u0440\u0443\u043F\u043D\u044B\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043D\u0430 \u043F\u0440\u043E\u0441\u043C\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043C\u044B\u0445 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430\u0445.",
			"zh-CN": "\u5728\u60A8\u67E5\u770B\u7684\u9875\u9762\u4E0A\u81EA\u52A8\u5C06\u56FE\u50CF\u66FF\u6362\u4E3A\u8F83\u5927\u7248\u672C"
		},
		"This could lead to rate limiting or IP bans": {
			"pt-BR": "Isso pode levar a limita\u00E7\u00E3o de taxa ou banimento de IP",
			"ru": "\u042D\u0442\u043E \u043C\u043E\u0436\u0435\u0442 \u043F\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043A \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044E \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u0438 \u0438\u043B\u0438 \u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u043A\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430.",
			"zh-CN": "\u8FD9\u53EF\u80FD\u5BFC\u81F4\u901F\u7387\u9650\u5236\u548C\u5C01\u7981 IP"
		},
		"Use data URLs": {
			"pt-BR": "Usar URLs de dados",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C data URL",
			"zh-CN": "\u4F7F\u7528 data URL"
		},
		"Uses data:// URLs instead of image links. Disabling this may improve compatibility with some bulk image downloader extensions": {
			"pt-BR": "Utiliza URLs data:// em vez de links de imagem. Desabilitar isso pode melhorar a compatibilidade com algumas extens\u00F5es de download de imagens em massa",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 data:// URL \u0432\u043C\u0435\u0441\u0442\u043E \u0441\u0441\u044B\u043B\u043E\u043A \u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u044D\u0442\u043E\u0433\u043E \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430 \u043C\u043E\u0436\u0435\u0442 \u0443\u043B\u0443\u0447\u0448\u0438\u0442\u044C \u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C\u043E\u0441\u0442\u044C \u0441 \u043D\u0435\u043A\u043E\u0442\u043E\u0440\u044B\u043C\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u043C\u0438 \u043C\u0430\u0441\u0441\u043E\u0432\u043E\u0433\u043E \u0441\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u044F \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439.",
			"zh-CN": "\u4F7F\u7528 data:// URL \u4EE3\u66FF\u56FE\u50CF\u94FE\u63A5\u3002\u7981\u7528\u6B64\u529F\u80FD\u53EF\u80FD\u6539\u5584\u4E0E\u6279\u91CF\u4E0B\u8F7D\u56FE\u7247\u7684\u6269\u5C55\u7684\u517C\u5BB9\u6027"
		},
		"Wait until image is fully loaded": {
			"pt-BR": "Esperar at\u00E9 que a imagem seja totalmente carregada",
			"ru": "\u0416\u0434\u0430\u0442\u044C \u043F\u043E\u043B\u043D\u0443\u044E \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0443 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F",
			"zh-CN": "\u7B49\u5F85\u81F3\u56FE\u50CF\u5B8C\u5168\u52A0\u8F7D"
		},
		"Waits until the image being replaced is fully loaded before moving on to the next image": {
			"pt-BR": "Aguarda at\u00E9 que a imagem sendo substitu\u00EDda seja totalmente carregada antes de passar para a pr\u00F3xima imagem",
			"ru": "\u0416\u0434\u0451\u0442 \u043F\u043E\u043A\u0430 \u0437\u0430\u043C\u0435\u043D\u044F\u0435\u043C\u043E\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u0431\u0443\u0434\u0435\u0442 \u043F\u043E\u043B\u043D\u043E\u0441\u0442\u044C\u044E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043E \u043F\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043C \u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C\u0443 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044E.",
			"zh-CN": "\u79FB\u52A8\u5230\u4E0B\u4E00\u4E2A\u56FE\u50CF\u4E4B\u524D\uFF0C\u7B49\u5F85\u88AB\u66FF\u6362\u7684\u56FE\u50CF\u5B8C\u5168\u52A0\u8F7D"
		},
		"Max images to process at once": {
			"pt-BR": "M\u00E1ximo de imagens para processar de uma vez",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439 \u0434\u043B\u044F \u043E\u0434\u043D\u043E\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438",
			"zh-CN": "\u4E00\u6B21\u6700\u591A\u5904\u7406\u56FE\u50CF"
		},
		"The maximum amount of images to process at once": {
			"pt-BR": "A quantidade m\u00E1xima de imagens para processar de uma vez",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439 \u0434\u043B\u044F \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438 \u043E\u0434\u043D\u043E\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E.",
			"zh-CN": "\u4E00\u6B21\u6700\u591A\u5904\u7406\u591A\u5C11\u4E2A\u56FE\u50CF"
		},
		"Max images per domain at once": {
			"pt-BR": "M\u00E1ximo de imagens por dom\u00EDnio de uma vez",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439 \u043D\u0430 \u0434\u043E\u043C\u0435\u043D \u043E\u0434\u043D\u043E\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E",
			"zh-CN": "\u6BCF\u4E2A\u57DF\u4E00\u6B21\u6700\u591A\u56FE\u50CF"
		},
		"The maximum amount of images per domain to process at once": {
			"pt-BR": "A quantidade m\u00E1xima de imagens por dom\u00EDnio para processar de uma vez",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u043E\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439 \u043D\u0430 \u0434\u043E\u043C\u0435\u043D \u0434\u043B\u044F \u043E\u0434\u043D\u043E\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0438.",
			"zh-CN": "\u6BCF\u4E2A\u57DF\uFF08\u540D\uFF09\u4E00\u6B21\u6700\u591A\u5904\u7406\u591A\u5C11\u4E2A\u56FE\u50CF"
		},
		"images": {
			"es": "im\u00E1genes",
			"ko": "\uC774\uBBF8\uC9C0",
			"pt-BR": "imagens",
			"ru": "\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F",
			"zh-CN": "\u4E2A\u56FE\u50CF"
		},
		"Delay between same-domain images": {
			"pt-BR": "Atraso entre imagens do mesmo dom\u00EDnio",
			"ru": "\u0417\u0430\u0434\u0435\u0440\u0436\u043A\u0430 \u043C\u0435\u0436\u0434\u0443 \u043E\u0434\u043D\u043E\u0434\u043E\u043C\u0435\u043D\u043D\u044B\u043C\u0438 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u043C\u0438.",
			"zh-CN": "\u540C\u57DF\u56FE\u50CF\u4E4B\u95F4\u5EF6\u8FDF"
		},
		"New requests for images in the same domain will be delayed by this amount of seconds. Useful for avoiding rate limits.": {
			"pt-BR": "Novas requisi\u00E7\u00F5es para imagens no mesmo dom\u00EDnio ser\u00E3o atrasadas por esta quantidade de segundos. \u00DAtil para evitar limites de taxa.",
			"ru": "\u041D\u043E\u0432\u044B\u0435 \u0437\u0430\u043F\u0440\u043E\u0441\u044B \u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u0432 \u0442\u043E\u043C \u0436\u0435 \u0434\u043E\u043C\u0435\u043D\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 \u044D\u0442\u043E \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0441\u0435\u043A\u0443\u043D\u0434. \u041F\u043E\u043B\u0435\u0437\u043D\u043E \u0434\u043B\u044F \u0438\u0437\u0431\u0435\u0436\u0430\u043D\u0438\u044F \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u0439 \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u0438.",
			"zh-CN": "\u5BF9\u540C\u57DF\u56FE\u50CF\u7684\u65B0\u8BF7\u6C42\u5C06\u5EF6\u8FDF\u6B64\u79D2\u6570\u3002\u6709\u52A9\u907F\u514D\u89E6\u53D1\u9891\u7387\u9650\u5236\u3002"
		},
		"seconds": {
			"es": "segundos",
			"ko": "\uCD08",
			"pt-BR": "segundos",
			"ru": "\u0441\u0435\u043A.",
			"zh-CN": "\u79D2"
		},
		"Replace images": {
			"pt-BR": "Substituir imagens",
			"ru": "\u0417\u0430\u043C\u0435\u043D\u044F\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F",
			"zh-CN": "\u66FF\u6362\u56FE\u7247"
		},
		"Replaces images to their larger versions when the button is pressed": {
			"pt-BR": "Substitui as imagens por suas vers\u00F5es maiores quando o bot\u00E3o \u00E9 pressionado",
			"ru": "\u0417\u0430\u043C\u0435\u043D\u044F\u0435\u0442 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043D\u0430 \u0438\u0445 \u0431\u043E\u043B\u0435\u0435 \u043A\u0440\u0443\u043F\u043D\u044B\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u043A\u043D\u043E\u043F\u043A\u0438.",
			"zh-CN": "\u6309\u4E0B\u6309\u94AE\u65F6\uFF0C\u5C06\u56FE\u50CF\u66FF\u6362\u4E3A\u8F83\u5927\u7684\u7248\u672C"
		},
		"Add links": {
			"pt-BR": "Adicionar links",
			"ru": "\u0414\u043E\u0431\u0430\u0432\u043B\u044F\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0438",
			"zh-CN": "\u6DFB\u52A0\u94FE\u63A5"
		},
		"Adds links around replaced media if a link doesn't already exist": {
			"pt-BR": "Adiciona links ao redor da m\u00EDdia substitu\u00EDda se um link ainda n\u00E3o existir",
			"ru": "\u0414\u043E\u0431\u0430\u0432\u043B\u044F\u0435\u0442 \u0441\u0441\u044B\u043B\u043A\u0438 \u0432\u043E\u043A\u0440\u0443\u0433 \u0437\u0430\u043C\u0435\u043D\u0451\u043D\u043D\u044B\u0445 \u043C\u0435\u0434\u0438\u0430, \u0435\u0441\u043B\u0438 \u0441\u0441\u044B\u043B\u043A\u0438 \u0435\u0449\u0451 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.",
			"zh-CN": "\u5728\u5DF2\u66FF\u6362\u5A92\u4F53\u65C1\u6DFB\u52A0\u94FE\u63A5\uFF08\u5982\u679C\u5C1A\u65E0\uFF09"
		},
		"Replace links": {
			"pt-BR": "Substituir links",
			"ru": "\u0417\u0430\u043C\u0435\u043D\u044F\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0438",
			"zh-CN": "\u66FF\u6362\u94FE\u63A5"
		},
		"Replaces links if they already exist": {
			"pt-BR": "Substitui links se eles j\u00E1 existirem",
			"ru": "\u0417\u0430\u043C\u0435\u043D\u044F\u0435\u0442 \u0441\u0441\u044B\u043B\u043A\u0438, \u0435\u0441\u043B\u0438 \u043E\u043D\u0438 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0442.",
			"zh-CN": "\u66FF\u6362\u5DF2\u7ECF\u5B58\u5728\u7684\u94FE\u63A5"
		},
		"Plain hyperlinks": {
			"pt-BR": "Hiperlinks simples",
			"ru": "\u041F\u0440\u043E\u0441\u0442\u044B\u0435 \u0433\u0438\u043F\u0435\u0440\u0441\u0441\u044B\u043B\u043A\u0438",
			"zh-CN": "\u7EAF\u7CB9\u8D85\u94FE\u63A5"
		},
		"How to treat plain (non-media) hyperlinks that link to potential media": {
			"pt-BR": "Como tratar hiperlinks simples (n\u00E3o m\u00EDdia) que ligam para m\u00EDdias em potencial",
			"ru": "\u041A\u0430\u043A \u043E\u0431\u0440\u0430\u0449\u0430\u0442\u044C\u0441\u044F \u0441 \u043F\u0440\u043E\u0441\u0442\u044B\u043C\u0438 (\u043D\u0435\u043C\u0435\u0434\u0438\u0439\u043D\u044B\u043C\u0438) \u0433\u0438\u043F\u0435\u0440\u0441\u0441\u044B\u043B\u043A\u0430\u043C\u0438, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0441\u0441\u044B\u043B\u0430\u044E\u0442\u0441\u044F \u043D\u0430 \u043F\u043E\u0442\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0435 \u043C\u0435\u0434\u0438\u0430.",
			"zh-CN": "\u5982\u4F55\u5904\u7406\u94FE\u63A5\u5230\u6F5C\u5728\u5A92\u4F53\u7684\u7EAF\u7CB9\u8D85\u94FE\u63A5"
		},
		"Replace link+text": {
			"pt-BR": "Substituir link+texto",
			"ru": "\u0417\u0430\u043C\u0435\u043D\u044F\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443+\u0442\u0435\u043A\u0441\u0442",
			"zh-CN": "\u66FF\u6362\u94FE\u63A5\u548C\u6587\u672C"
		},
		"Replace media": {
			"pt-BR": "Substituir m\u00EDdia",
			"ru": "\u0417\u0430\u043C\u0435\u043D\u044F\u0442\u044C \u043C\u0435\u0434\u0438\u0430",
			"zh-CN": "\u66FF\u6362\u5A92\u4F53"
		},
		"Links open in new tab": {
			"pt-BR": "Links abrem em nova aba",
			"ru": "\u041E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0438 \u0432 \u043D\u043E\u0432\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435",
			"zh-CN": "\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00\u94FE\u63A5"
		},
		"Clicking on a replaced link will open the media in a new tab": {
			"pt-BR": "Clicar em um link substitu\u00EDdo abrir\u00E1 a m\u00EDdia em uma nova aba",
			"ru": "\u041D\u0430\u0436\u0430\u0442\u0438\u0435 \u043D\u0430 \u0437\u0430\u043C\u0435\u043D\u0451\u043D\u043D\u0443\u044E \u0441\u0441\u044B\u043B\u043A\u0443 \u043E\u0442\u043A\u0440\u043E\u0435\u0442 \u043C\u0435\u0434\u0438\u0430 \u0432 \u043D\u043E\u0432\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435.",
			"zh-CN": "\u5355\u51FB\u5DF2\u66FF\u6362\u7684\u94FE\u63A5\u5C06\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00\u5A92\u4F53"
		},
		"Size constraints": {
			"pt-BR": "Restri\u00E7\u00F5es de tamanho",
			"ru": "\u041E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F \u043F\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u0443",
			"zh-CN": "\u5927\u5C0F\u9650\u5236"
		},
		"Removes or enforces height/width specifiers for replaced media": {
			"pt-BR": "Remove ou aplica especificadores de altura/largura para m\u00EDdia substitu\u00EDda",
			"ru": "\u0423\u0434\u0430\u043B\u044F\u0435\u0442 \u0438\u043B\u0438 \u043F\u0440\u0438\u043C\u0435\u043D\u044F\u0435\u0442 \u0441\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B \u0432\u044B\u0441\u043E\u0442\u044B/\u0448\u0438\u0440\u0438\u043D\u044B \u0434\u043B\u044F \u0437\u0430\u043C\u0435\u043D\u0435\u043D\u043D\u044B\u0445 \u043C\u0435\u0434\u0438\u0430",
			"zh-CN": "\u79FB\u9664\u6216\u5F3A\u5236\u5E94\u7528\u88AB\u66FF\u6362\u5A92\u4F53\u7684\u9AD8\u5EA6/\u5BBD\u5EA6\u8BF4\u660E\u7B26"
		},
		"Ignore": {
			"pt-BR": "Ignorar",
			"ru": "\u0418\u0433\u043D\u043E\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C",
			"zh-CN": "\u5FFD\u7565"
		},
		"Remove": {
			"pt-BR": "Remover",
			"ru": "\u0423\u0434\u0430\u043B\u0438\u0442\u044C",
			"zh-CN": "\u79FB\u9664"
		},
		"Force": {
			"pt-BR": "For\u00E7ar",
			"ru": "\u041F\u0440\u0438\u043D\u0443\u0434\u0438\u0442\u0435\u043B\u044C\u043D\u043E",
			"zh-CN": "\u5F3A\u5236"
		},
		"Replacement CSS": {
			"pt-BR": "CSS de Substitui\u00E7\u00E3o",
			"ru": "\u0417\u0430\u043C\u0435\u043D\u0430 CSS",
			"zh-CN": "\u66FF\u6362 CSS"
		},
		"CSS styles to apply to replaced media. See the documentation for Popup CSS style for more information (the thumb/full URL variables aren't yet supported here)": {
			"pt-BR": "Estilos CSS para aplicar \u00E0 m\u00EDdia substitu\u00EDda. Consulte a documenta\u00E7\u00E3o para o estilo CSS de Popup para mais informa\u00E7\u00F5es (as vari\u00E1veis thumb/full URL ainda n\u00E3o s\u00E3o suportadas aqui)",
			"ru": "\u0421\u0442\u0438\u043B\u0438 CSS \u0434\u043B\u044F \u043F\u0440\u0438\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A \u0437\u0430\u043C\u0435\u043D\u044F\u0435\u043C\u044B\u043C \u043C\u0435\u0434\u0438\u0430. \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0441\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0441\u043C\u043E\u0442\u0440\u0438\u0442\u0435 \u0432 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u0438 '\u0421\u0442\u0438\u043B\u0438\u0437\u0430\u0446\u0438\u044F CSS \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430' (\u0437\u0434\u0435\u0441\u044C \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044E\u0442\u0441\u044F \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435 URL thumb/full).",
			"zh-CN": "\u5E94\u7528\u5230\u5DF2\u66FF\u6362\u5A92\u4F53\u7684 CSS \u6837\u5F0F\u3002\u66F4\u591A\u4FE1\u606F\u8BE6\u89C1\u201C\u5F39\u7A97 CSS \u6837\u5F0F\u201D\u6587\u6863\uFF08\u6B64\u5904\u4E0D\u652F\u6301 thumb/full URL \u53D8\u91CF\uFF09"
		},
		"Simple progress": {
			"pt-BR": "Progresso simples",
			"ru": "\u041F\u0440\u043E\u0441\u0442\u043E\u0439 \u043F\u0440\u043E\u0433\u0440\u0435\u0441\u0441",
			"zh-CN": "\u7B80\u5355\u8FDB\u5EA6\u6761"
		},
		"Uses a simpler progress bar that has a fixed size for all media. This is useful to see how many images are replaced, rather than the ETA": {
			"pt-BR": "Utiliza uma barra de progresso mais simples com tamanho fixo para todas as m\u00EDdias. Isso \u00E9 \u00FAtil para ver quantas imagens s\u00E3o substitu\u00EDdas, em vez do tempo estimado de conclus\u00E3o",
			"ru": "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u0431\u043E\u043B\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0443\u044E \u0448\u043A\u0430\u043B\u0443 \u043F\u0440\u043E\u0433\u0440\u0435\u0441\u0441\u0430, \u043A\u043E\u0442\u043E\u0440\u0430\u044F \u0438\u043C\u0435\u0435\u0442 \u0444\u0438\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0434\u043B\u044F \u0432\u0441\u0435\u0445 \u043C\u0435\u0434\u0438\u0430. \u042D\u0442\u043E \u043F\u043E\u043B\u0435\u0437\u043D\u043E \u0434\u043B\u044F \u0442\u043E\u0433\u043E, \u0447\u0442\u043E\u0431\u044B \u0443\u0432\u0438\u0434\u0435\u0442\u044C, \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439 \u0437\u0430\u043C\u0435\u043D\u0435\u043D\u043E, \u0430 \u043D\u0435 \u0436\u0434\u0430\u0442\u044C.",
			"zh-CN": "\u5BF9\u6240\u6709\u5A92\u4F53\u4F7F\u7528\u56FA\u5B9A\u5927\u5C0F\u7684\u7B80\u5355\u8FDB\u5EA6\u6761\u3002\u8FD9\u80FD\u770B\u5230\u6709\u591A\u5C11\u56FE\u50CF\u5DF2\u66FF\u6362\uFF0C\u800C\u4E0D\u662F\u53EA\u6709\u5269\u4F59\u65F6\u95F4"
		},
		"Trigger keybinding that will run the Highlight Images function": {
			"pt-BR": "Atalho de teclado que executar\u00E1 a fun\u00E7\u00E3o 'Destacar Imagens'",
			"ru": "\u041F\u0440\u0438\u0432\u044F\u0437\u043A\u0430 \u043A\u043B\u0430\u0432\u0438\u0448\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F, \u043A\u043E\u0442\u043E\u0440\u043E\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u0442\u044C \u0444\u0443\u043D\u043A\u0446\u0438\u044E \u043F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0438 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439.",
			"zh-CN": "\u7528\u6765\u8FD0\u884C\u201C\u9AD8\u4EAE\u56FE\u50CF\u201D\u529F\u80FD\u7684\u89E6\u53D1\u952E"
		},
		"Enables the 'Highlight Images' button": {
			"pt-BR": "Habilita o bot\u00E3o 'Destacar Imagens'",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u043A\u043D\u043E\u043F\u043A\u0443 '\u041F\u043E\u0434\u0441\u0432\u0435\u0442\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F'.",
			"zh-CN": "\u542F\u7528\u201C\u9AD8\u4EAE\u56FE\u50CF\u201D\u6309\u94AE"
		},
		"Automatically highlight images": {
			"pt-BR": "Destacar imagens automaticamente",
			"ru": "\u0410\u0432\u0442\u043E\u043F\u043E\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F",
			"zh-CN": "\u81EA\u52A8\u9AD8\u4EAE\u56FE\u7247"
		},
		"Automatically highlights images as you view pages": {
			"pt-BR": "Destaca automaticamente as imagens enquanto voc\u00EA visualiza as p\u00E1ginas",
			"ru": "\u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u043F\u043E\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043F\u0440\u0438 \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446.",
			"zh-CN": "\u67E5\u770B\u9875\u9762\u65F6\u81EA\u52A8\u7A81\u51FA\u56FE\u50CF"
		},
		"Always": {
			"pt-BR": "Sempre",
			"ru": "\u041F\u043E\u0441\u0442\u043E\u044F\u043D\u043D\u043E",
			"zh-CN": "\u603B\u662F"
		},
		"Hover": {
			"pt-BR": "Ao passar o mouse",
			"ru": "\u041D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0435",
			"zh-CN": "\u60AC\u505C"
		},
		"When hovering over an image": {
			"pt-BR": "Ao passar o mouse sobre uma imagem",
			"ru": "\u041F\u0440\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0438 \u043A\u0443\u0440\u0441\u043E\u0440\u0430 \u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435.",
			"zh-CN": "\u9F20\u6807\u5728\u56FE\u7247\u4E0A\u60AC\u505C\u65F6"
		},
		"Never": {
			"pt-BR": "Nunca",
			"ru": "\u041D\u0438\u043A\u043E\u0433\u0434\u0430",
			"zh-CN": "\u4ECE\u4E0D"
		},
		"Only explicitly supported images": {
			"pt-BR": "Apenas imagens explicitamente suportadas",
			"ru": "\u0422\u043E\u043B\u044C\u043A\u043E \u044F\u0432\u043D\u043E \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043C\u044B\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F",
			"zh-CN": "\u4EC5\u9650\u660E\u786E\u652F\u6301\u7684\u56FE\u50CF"
		},
		"Only highlights images that can be made larger or the original version can be found": {
			"pt-BR": "Destaca apenas imagens que podem ser ampliadas ou cuja vers\u00E3o original pode ser encontrada",
			"ru": "\u041F\u043E\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0442\u043E\u043B\u044C\u043A\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u0443\u0432\u0435\u043B\u0438\u0447\u0435\u043D\u044B \u0438\u043B\u0438 \u043C\u043E\u0436\u043D\u043E \u043D\u0430\u0439\u0442\u0438 \u0438\u0445 \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u044C\u043D\u0443\u044E \u0432\u0435\u0440\u0441\u0438\u044E.",
			"zh-CN": "\u4EC5\u7A81\u51FA\u53EF\u4EE5\u6362\u6210\u66F4\u5927\u5C3A\u5BF8\u7684\u56FE\u50CF"
		},
		"Highlight CSS": {
			"pt-BR": "CSS de Destaque",
			"ru": "CSS \u043F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0430",
			"zh-CN": "\u9AD8\u4EAE CSS"
		},
		"CSS style to apply for highlight. See the documentation for Popup CSS style for more information (the thumb/full URL variables aren't supported here)": {
			"pt-BR": "Estilo CSS para aplicar ao destaque. Consulte a documenta\u00E7\u00E3o para o estilo CSS de Popup para mais informa\u00E7\u00F5es (as vari\u00E1veis thumb/full URL n\u00E3o s\u00E3o suportadas aqui)",
			"ru": "\u0421\u0442\u0438\u043B\u0438\u0437\u0430\u0446\u0438\u044F CSS, \u0434\u043B\u044F \u043F\u0440\u0438\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043A \u043F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0435. \u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0441\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0441\u043C\u043E\u0442\u0440\u0438\u0442\u0435 \u0432 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u0438 '\u0421\u0442\u0438\u043B\u0438\u0437\u0430\u0446\u0438\u044F CSS \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430' (\u0437\u0434\u0435\u0441\u044C \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044E\u0442\u0441\u044F \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0435 URL thumb/full).",
			"zh-CN": "\u9AD8\u4EAE\u65F6\u4F7F\u7528\u7684 CSS \u6837\u5F0F\u3002\u66F4\u591A\u4FE1\u606F\u8BE6\u89C1\u201C\u5F39\u7A97 CSS \u6837\u5F0F\u201D\u6587\u6863\uFF08\u6B64\u5904\u4E0D\u652F\u6301 thumb/full URL \u53D8\u91CF\uFF09"
		},
		"Enable trigger key": {
			"pt-BR": "Habilitar tecla de disparo",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043A\u043B\u0430\u0432\u0438\u0448\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F",
			"zh-CN": "\u542F\u7528\u89E6\u53D1\u952E"
		},
		"Enables the use of the trigger key to run it without needing to use the menu": {
			"pt-BR": "Habilita o uso da tecla de disparo para executar a fun\u00E7\u00E3o sem precisar usar o menu",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043A\u043B\u0430\u0432\u0438\u0448\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0434\u043B\u044F \u0437\u0430\u043F\u0443\u0441\u043A\u0430 \u0431\u0435\u0437 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E\u0441\u0442\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F \u043C\u0435\u043D\u044E.",
			"zh-CN": "\u5141\u8BB8\u4F7F\u7528\u89E6\u53D1\u952E\u6765\u8FD0\u884C\uFF0C\u65E0\u9700\u4F7F\u7528\u83DC\u5355"
		},
		"Trigger key": {
			"pt-BR": "Tecla de disparo",
			"ru": "\u041A\u043B\u0430\u0432\u0438\u0448\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F",
			"zh-CN": "\u89E6\u53D1\u952E"
		},
		"Trigger keybinding that will run the Custom Gallery function": {
			"pt-BR": "Atalho de teclado que executar\u00E1 a fun\u00E7\u00E3o 'Galeria Personalizada'"
		},
		"Enable button": {
			"pt-BR": "Habilitar bot\u00E3o",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043A\u043D\u043E\u043F\u043A\u0443",
			"zh-CN": "\u542F\u7528\u6309\u94AE"
		},
		"Enables the 'Custom Gallery' button": {
			"pt-BR": "Habilita o bot\u00E3o 'Galeria Personalizada'"
		},
		"Apply key": {
			"pt-BR": "Tecla de aplica\u00E7\u00E3o"
		},
		"Triggers the gallery when pressed": {
			"pt-BR": "Aciona a galeria quando pressionada"
		},
		"Background CSS": {
			"pt-BR": "CSS de Fundo"
		},
		"CSS style to apply for the background": {
			"pt-BR": "Estilo CSS para aplicar ao fundo"
		},
		"Outline CSS": {
			"pt-BR": "CSS de Contorno"
		},
		"CSS style to apply for element outlines": {
			"pt-BR": "Estilo CSS para aplicar aos contornos dos elementos"
		},
		"Mouseover popup action": {
			"en": "Popup action",
			"es": "Acci\u00F3n del popup",
			"ko": "\uC774\uBBF8\uC9C0 \uD31D\uC5C5 \uC791\uC5C5",
			"pt-BR": "A\u00E7\u00E3o do popup ao passar o mouse",
			"ru": "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430 \u043F\u0440\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u043A\u0443\u0440\u0441\u043E\u0440\u0430",
			"zh-CN": "\u79FB\u52A8\u65F6\u5F39\u7A97\u7684\u52A8\u4F5C"
		},
		"Determines how the mouseover popup will open": {
			"ko": "\uB9C8\uC6B0\uC2A4\uC624\uBC84 \uD31D\uC5C5\uC774 \uC5F4\uB9AC\uB294 \uBC29\uC2DD",
			"pt-BR": "Determina como o popup ao passar o mouse ser\u00E1 aberto",
			"ru": "\u041E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0435\u0442, \u043A\u0430\u043A \u043E\u0442\u043A\u0440\u043E\u0451\u0442\u0441\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u043F\u0440\u0438 \u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0438 \u043A\u0443\u0440\u0441\u043E\u0440\u0430 \u043C\u044B\u0448\u0438.",
			"zh-CN": "\u51B3\u5B9A\u9F20\u6807\u60AC\u505C\u5F39\u7A97\u5C06\u6253\u5F00"
		},
		"Popup": {
			"ko": "\uD31D\uC5C5",
			"pt-BR": "Popup",
			"ru": "\u0412\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E",
			"zh-CN": "\u5F39\u7A97"
		},
		"New tab": {
			"es": "Nueva pesta\u00F1a",
			"fr": "Nouvel onglet",
			"ko": "\uC0C8 \uD0ED",
			"pt-BR": "Nova aba",
			"ru": "\u041D\u043E\u0432\u0430\u044F \u0432\u043A\u043B\u0430\u0434\u043A\u0430",
			"zh-CN": "\u65B0\u6807\u7B7E\u9875"
		},
		"New background tab": {
			"pt-BR": "Nova aba em segundo plano",
			"ru": "\u041D\u043E\u0432\u0430\u044F \u0444\u043E\u043D\u043E\u0432\u0430\u044F \u0432\u043A\u043B\u0430\u0434\u043A\u0430",
			"zh-CN": "\u65B0\u540E\u53F0\u6807\u7B7E\u9875"
		},
		"Download": {
			"pt-BR": "Baixar",
			"ru": "\u0421\u043A\u0430\u0447\u0430\u0442\u044C",
			"zh-CN": "\u4E0B\u8F7D"
		},
		"Copy link": {
			"pt-BR": "Copiar link",
			"ru": "\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0443",
			"zh-CN": "\u590D\u5236\u94FE\u63A5"
		},
		"Replace": {
			"pt-BR": "Substituir",
			"ru": "\u0417\u0430\u043C\u0435\u043D\u0438\u0442\u044C",
			"zh-CN": "\u66FF\u6362"
		},
		"Exclude page background": {
			"ko": "\uD398\uC774\uC9C0 \uBC30\uACBD \uC81C\uC678",
			"pt-BR": "Excluir plano de fundo da p\u00E1gina",
			"ru": "\u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0442\u044C \u0444\u043E\u043D \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B",
			"zh-CN": "\u6392\u9664\u9875\u9762\u80CC\u666F"
		},
		"Excludes the page background for the popup": {
			"ko": "\uD31D\uC5C5\uC5D0 \uB300\uD55C \uD398\uC774\uC9C0 \uBC30\uACBD \uC81C\uC678",
			"pt-BR": "Exclui o plano de fundo da p\u00E1gina para o popup",
			"ru": "\u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0444\u043E\u043D \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u0434\u043B\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430.",
			"zh-CN": "\u907F\u514D\u4E3A\u9875\u9762\u80CC\u666F\u663E\u793A\u5F39\u7A97"
		},
		"Minimum size": {
			"pt-BR": "Tamanho m\u00EDnimo",
			"ru": "\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440",
			"zh-CN": "\u6700\u5C0F\u5C3A\u5BF8"
		},
		"Smallest size acceptable for the popup to open (this option is ignored for background images). This refers to the size of the media to be popped up, which may differ from the source media.": {
			"pt-BR": "Menor tamanho aceit\u00E1vel para o popup abrir (esta op\u00E7\u00E3o \u00E9 ignorada para imagens de fundo). Refere-se ao tamanho da m\u00EDdia a ser exibida no popup, que pode ser diferente da m\u00EDdia de origem.",
			"ru": "\u041D\u0430\u0438\u043C\u0435\u043D\u044C\u0448\u0438\u0439 \u0440\u0430\u0437\u043C\u0435\u0440, \u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u044B\u0439 \u0434\u043B\u044F \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430 (\u044D\u0442\u043E\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0438\u0433\u043D\u043E\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044F \u0434\u043B\u044F \u0444\u043E\u043D\u043E\u0432\u044B\u0445 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439). \u042D\u0442\u043E \u043E\u0442\u043D\u043E\u0441\u0438\u0442\u0441\u044F \u043A \u0440\u0430\u0437\u043C\u0435\u0440\u0443 \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043C\u0435\u0434\u0438\u0430, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u043C\u043E\u0436\u0435\u0442 \u043E\u0442\u043B\u0438\u0447\u0430\u0442\u044C\u0441\u044F \u043E\u0442 \u043E\u0440\u0438\u0433\u0438\u043D\u0430\u043B\u0430.",
			"zh-CN": "\u5141\u8BB8\u591A\u5C0F\u7684\u56FE\u50CF\u663E\u793A\u5F39\u7A97\u3002\u80CC\u666F\u56FE\u50CF\u4E0D\u88AB\u6B64\u9009\u9879\u6DB5\u76D6\u3002\u8FD9\u6307\u5C06\u8981\u5F39\u7A97\u663E\u793A\u7684\u5A92\u4F53\u5927\u5C0F\uFF0C\u8FD9\u53EF\u80FD\u4E0E\u6E90\u5A92\u4F53\u4E0D\u540C\u3002"
		},
		"Maximum source size": {
			"pt-BR": "Tamanho m\u00E1ximo da origem",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430",
			"zh-CN": "\u6700\u5927\u6E90\u5C3A\u5BF8"
		},
		"Maximum size (width/height) for the source media to allow popping up (this option is ignored for background images). Set to `0` for any size.": {
			"pt-BR": "Tamanho m\u00E1ximo (largura/altura) para a m\u00EDdia de origem permitir a exibi\u00E7\u00E3o em popup (esta op\u00E7\u00E3o \u00E9 ignorada para imagens de fundo). Defina como `0` para qualquer tamanho.",
			"ru": "\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440 (\u0448\u0438\u0440\u0438\u043D\u0430/\u0432\u044B\u0441\u043E\u0442\u0430) \u0438\u0441\u0445\u043E\u0434\u043D\u043E\u0433\u043E \u043C\u0435\u0434\u0438\u0430\u0444\u0430\u0439\u043B\u0430 \u0434\u043B\u044F \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u044F \u0432\u0441\u043F\u043B\u044B\u0442\u0438\u044F (\u044D\u0442\u043E\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 \u0438\u0433\u043D\u043E\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044F \u0434\u043B\u044F \u0444\u043E\u043D\u043E\u0432\u044B\u0445 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439). `0` - \u043B\u044E\u0431\u043E\u0439 \u0440\u0430\u0437\u043C\u0435\u0440.",
			"zh-CN": "\u4EE5\u6E90\u5A92\u4F53\u663E\u793A\u5F39\u7A97\u7684\u6700\u5927\u5C3A\u5BF8\uFF08\u5BBD\u5EA6/\u9AD8\u5EA6\uFF09\uFF08\u5BF9\u80CC\u666F\u56FE\u50CF\u6765\u8BF4\u6B64\u9009\u9879\u65E0\u6548)\u3002\u8BBE\u4E3A 0 \u8868\u793A\u4EFB\u610F\u5927\u5C0F\u3002"
		},
		"pixels": {
			"pt-BR": "pixels",
			"ru": "\u043F\u0438\u043A\u0441.",
			"zh-CN": "\u50CF\u7D20"
		},
		"Exclude `background-image`s": {
			"ko": "\uBC30\uACBD \uC774\uBBF8\uC9C0 \uC81C\uC678",
			"pt-BR": "Excluir imagens de fundo",
			"ru": "\u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0442\u044C `background-image`",
			"zh-CN": "\u6392\u9664\u80CC\u666F\u56FE\u50CF"
		},
		"Excludes `background-image`s for the popup. Might prevent the popup from working on many images": {
			"ko": "\uD31D\uC5C5\uC758 \uBC30\uACBD \uC774\uBBF8\uC9C0 \uC81C\uC678. \uD31D\uC5C5\uC774 \uB9CE\uC740 \uC774\uBBF8\uC9C0\uC5D0\uC11C \uC791\uB3D9\uD558\uC9C0 \uC54A\uC744 \uC218 \uC788\uC74C",
			"pt-BR": "Exclui imagens de fundo (`background-image`) do popup. Pode impedir que o popup funcione em muitas imagens",
			"ru": "\u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0435\u0442 `background-image` \u0434\u043B\u044F \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430. \u042D\u0442\u043E \u043C\u043E\u0436\u0435\u0442 \u043F\u043E\u043C\u0435\u0448\u0430\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u043C\u0443 \u043E\u043A\u043D\u0443 \u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C \u0441\u043E \u043C\u043D\u043E\u0433\u0438\u043C\u0438 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\u043C\u0438.",
			"zh-CN": "\u4E0D\u4E3A\u80CC\u666F\u56FE\u50CF\u663E\u793A\u5F39\u7A97\u3002\u53EF\u80FD\u4F7F\u5F88\u591A\u56FE\u50CF\u4E0A\u4E0D\u663E\u793A\u5F39\u7A97"
		},
		"Enable videos": {
			"pt-BR": "Habilitar v\u00EDdeos",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0432\u0438\u0434\u0435\u043E",
			"zh-CN": "\u652F\u6301\u89C6\u9891"
		},
		"Allows videos to be popped up": {
			"pt-BR": "Permite que v\u00EDdeos sejam exibidos em popup",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435\u0435 \u043E\u043A\u043D\u043E \u0434\u043B\u044F \u0432\u0438\u0434\u0435\u043E",
			"zh-CN": "\u5141\u8BB8\u89C6\u9891\u5F39\u7A97"
		},
		"Enable audio": {
			"pt-BR": "Habilitar \u00E1udio",
			"ru": "\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0430\u0443\u0434\u0438\u043E",
			"zh-CN": "\u542F\u7528\u97F3\u9891"
		},
		"Allows audio to be popped up. Currently experimental.\nThis only applies to audio files. Videos that contains audio are supported regardless of this setting.": {
			"pt-BR": "Permite que \u00E1udio seja exibido em popup. Atualmente experimental.\nIsso se aplica apenas a arquivos de \u00E1udio. V\u00EDdeos que cont\u00EAm \u00E1udio s\u00E3o suportados independentemente desta configura\u00E7\u00E3o.",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u044E\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0434\u043B\u044F \u0430\u0443\u0434\u0438\u043E. \u0412 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0435 \u0432\u0440\u0435\u043C\u044F \u044D\u043A\u0441\u043F\u0435\u0440\u0438\u043C\u0435\u043D\u0442\u0430\u043B\u044C\u043D\u044B\u0439.\n\u042D\u0442\u043E \u043E\u0442\u043D\u043E\u0441\u0438\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043A \u0430\u0443\u0434\u0438\u043E\u0444\u0430\u0439\u043B\u0430\u043C. \u0412\u0438\u0434\u0435\u043E, \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0430\u0443\u0434\u0438\u043E, \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044E\u0442\u0441\u044F \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u044D\u0442\u043E\u0439 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438.",
			"zh-CN": "\u5141\u8BB8\u97F3\u9891\u5F39\u7A97\u3002\u76EE\u524D\u5904\u4E8E\u5B9E\u9A8C\u9636\u6BB5\u3002\n\u8FD9\u4EC5\u9002\u7528\u4E8E\u97F3\u9891\u6587\u4EF6\u3002\u5305\u542B\u97F3\u9891\u7684\u89C6\u9891\u65E0\u5173\u6B64\u8BBE\u7F6E\u3002"
		},
		"Allow HLS/DASH streams": {
			"pt-BR": "Permitir streams HLS/DASH",
			"ru": "\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u043F\u043E\u0442\u043E\u043A\u0438 HLS/DASH",
			"zh-CN": "\u5141\u8BB8 HLS/DASH \u6D41"
		},
		"Allows playback of HLS/DASH streams": {
			"pt-BR": "Permite a reprodu\u00E7\u00E3o de streams HLS/DASH",
			"ru": "\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0432\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u0438\u0442\u044C \u043F\u043E\u0442\u043E\u043A\u0438 HLS/DASH.",
			"zh-CN": "\u5141\u8BB8\u64AD\u653E HLS/DASH \u6D41"
		},
		"Dailymotion": {
			"pt-BR": "Dailymotion",
			"ru": "\u0415\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u043E\u0435\u0434\u0432\u0438\u0436\u0435\u043D\u0438\u0435",
			"zh-CN": "Dailymotion"
		},
		"Instagram (higher quality)": {
			"pt-BR": "Instagram (maior qualidade)",
			"ru": "Instagram (\u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u0432\u044B\u0448\u0435)",
			"zh-CN": "Instagram\uFF08\u66F4\u9AD8\u8D28\u91CF\uFF09"
		},
		"Reddit": {
			"pt-BR": "Reddit",
			"ru": "Reddit",
			"zh-CN": "Reddit"
		},
		"YouTube (higher quality)": {
			"pt-BR": "YouTube (maior qualidade)",
			"ru": "YouTube (\u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u0432\u044B\u0448\u0435)",
			"zh-CN": "YouTube\uFF08\u66F4\u9AD8\u8D28\u91CF\uFF09"
		}
	};
	var get_language_aliases = function(language) {
		var aliases = [language];
		var language_nosub = language.replace(/-.*/, "");
		if (language_nosub !== language)
			aliases.push(language_nosub);
		return aliases;
	};
	function _(str) {
		var args = [];
		for (var _i = 1; _i < arguments.length; _i++) {
			args[_i - 1] = arguments[_i];
		}
		if (typeof str !== "string") {
			return str;
		}
		var languages = get_language_aliases(settings.language);
		if (str in strings) {
			var found = false;
			for (var i = 0; i < languages.length; i++) {
				var language = languages[i];
				if (language in strings[str]) {
					str = strings[str][language];
					found = true;
					break;
				}
			}
			if (!found && language !== "en" && "en" in strings[str]) {
				str = strings[str]["en"];
			}
		}
		// most strings don't contain %
		if (string_indexof(str, "%") < 0) {
			return str;
		}
		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 = parse_int(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 old_settings_keys = [
		"mouseover_trigger",
		"mouseover_use_fully_loaded_video",
		"mouseover_use_fully_loaded_image",
		"mouseover_close_on_leave_el",
		"mouseover_scroll_behavior",
		"mouseover_mask_styles",
		"mouseover_video_seek_vertical_scroll",
		"mouseover_video_seek_horizontal_scroll",
		"mouseover_support_pointerevents_none",
		"mouseover_enable_mask_styles",
		"allow_video",
		"allow_audio",
		"replaceimgs_remove_size_constraints"
	];
	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,
		check_updates: true,
		check_update_interval: 24,
		check_update_notify: false,
		// thanks to forefix on firefox for the idea: https://github.com/qsniyg/maxurl/issues/189
		dark_mode: false,
		settings_tabs: true,
		// thanks to ambler on discord for the idea
		settings_alphabetical_order: false,
		settings_visible_description: true,
		settings_show_disabled: true,
		settings_show_disabled_profiles: false,
		settings_show_requirements: true,
		advanced_options: false,
		allow_browser_request: true,
		retry_503_times: 3,
		retry_503_ms: 2000,
		use_blob_over_arraybuffer: false,
		allow_live_settings_reload: true,
		allow_remote: true,
		disable_keybind_when_editing: true,
		enable_gm_download: true,
		gm_download_max: 15,
		// thanks to pax romana on discord for the idea: https://github.com/qsniyg/maxurl/issues/372
		// this must be false, because it requires a permission
		enable_webextension_download: false,
		// thanks to Michael82548 on github for the idea: https://github.com/qsniyg/maxurl/issues/848
		enable_console_logging: true,
		// this must be false for the extension because it requires a permission
		write_to_clipboard: false,
		redirect: true,
		redirect_video: true,
		redirect_audio: false,
		redirect_history: true,
		redirect_extension: true,
		canhead_get: true,
		redirect_force_page: false,
		// thanks to DevWannabe-dot on github for the idea: https://github.com/qsniyg/maxurl/issues/822
		redirect_enable_infobox: true,
		// thanks to fireattack on discord for the idea: https://github.com/qsniyg/maxurl/issues/324
		redirect_infobox_url: false,
		redirect_infobox_timeout: 7,
		print_imu_obj: false,
		redirect_disable_for_responseheader: false,
		redirect_to_no_infobox: false,
		// thanks to nijaz-lab on github for the idea: https://github.com/qsniyg/maxurl/issues/557
		redirect_host_html: false,
		host_html_blacklist: "",
		host_html_blacklist_mode: "blacklist",
		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_key_t2: [],
		mouseover_trigger_key_t3: [],
		mouseover_trigger_delay: 1,
		mouseover_trigger_mouseover: false,
		// thanks to lnp5131 on github for the idea: https://github.com/qsniyg/maxurl/issues/421
		mouseover_trigger_enabledisable_toggle: "disable",
		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 cosuwi on github for the idea: https://github.com/qsniyg/maxurl/issues/367
		mouseover_cancel_popup_when_release: true,
		// thanks to remlap on discord for the idea: https://github.com/qsniyg/maxurl/issues/250
		mouseover_auto_close_popup: false,
		mouseover_auto_close_popup_time: 5,
		// 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"],
		mouseover_hold_position_center: false,
		popup_hold_zoom: "none",
		mouseover_hold_close_unhold: false,
		mouseover_hold_unclickthrough: true,
		// 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 hosa dokha on greasyfork for the idea: https://greasyfork.org/en/forum/discussion/71894/this-script-is-a-dream-come-true-just-1-thing
		mouseover_close_click_outside: false,
		// thanks to decembre on github for the idea: https://github.com/qsniyg/maxurl/issues/126
		mouseover_allow_partial: is_extension ? "media" : "video",
		mouseover_partial_avoid_head: false,
		mouseover_use_blob_over_data: false,
		// https://github.com/qsniyg/maxurl/issues/667
		popup_use_anonymous_crossorigin: false,
		mouseover_enable_notallowed: true,
		// thanks to Rnksts on discord for the idea
		mouseover_enable_notallowed_cant_load: true,
		mouseover_notallowed_duration: 300,
		//mouseover_use_fully_loaded_image: is_extension ? false : true,
		//mouseover_use_fully_loaded_video: false,
		mouseover_minimum_size: 20,
		// thanks to Raitzu on discord for the idea
		popup_maximum_source_size: 0,
		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,
		mouseover_exclude_imagemaps: true,
		// thanks to Jin on discord for the idea
		mouseover_only_links: false,
		mouseover_linked_image: false,
		mouseover_exclude_sameimage: false,
		mouseover_exclude_imagetab: true,
		mouseover_allow_video: true,
		mouseover_allow_audio: false,
		mouseover_allow_hlsdash: true,
		enable_stream_download: false,
		stream_mux_mp4_over_mkv: false,
		hls_dash_use_max: true,
		max_video_quality: null,
		// thanks to Noodlers on discord for the idea: https://github.com/qsniyg/maxurl/issues/642
		mouseover_video_autoplay: true,
		mouseover_video_controls: false,
		mouseover_video_controls_key: ["c"],
		mouseover_video_loop: true,
		// thanks to Runakanta on discord for the idea: https://github.com/qsniyg/maxurl/issues/403
		mouseover_video_autoloop_max: 0,
		mouseover_video_playpause_key: ["space"],
		mouseover_video_muted: false,
		mouseover_video_mute_key: ["m"],
		mouseover_video_volume: 100,
		mouseover_video_volume_down_key: ["9"],
		mouseover_video_volume_up_key: ["0"],
		mouseover_video_volume_change_amt: 5,
		mouseover_video_resume_from_source: false,
		mouseover_video_resume_if_different: false,
		mouseover_video_pause_source: true,
		mouseover_video_seek_amount: 10,
		mouseover_video_seek_left_key: ["shift", "left"],
		mouseover_video_seek_right_key: ["shift", "right"],
		//mouseover_video_seek_vertical_scroll: false,
		//mouseover_video_seek_horizontal_scroll: false,
		mouseover_video_frame_prev_key: [","],
		mouseover_video_frame_next_key: ["."],
		mouseover_video_framerate: 25,
		mouseover_video_speed_down_key: ["["],
		mouseover_video_speed_up_key: ["]"],
		mouseover_video_speed_amount: 0.25,
		// thanks to Rnksts on discord for the idea
		mouseover_video_reset_speed_key: ["backspace"],
		mouseover_video_screenshot_key: ["shift", "s"],
		// thanks to remlap for the idea: https://github.com/qsniyg/maxurl/issues/666
		popup_video_screenshot_format: "png",
		popup_enable_subtitles: true,
		mouseover_ui: true,
		// thanks to Runakanta on discord for the idea
		mouseover_ui_toggle_key: ["u"],
		mouseover_ui_opacity: 80,
		mouseover_ui_use_safe_glyphs: false,
		mouseover_ui_imagesize: true,
		mouseover_ui_zoomlevel: true,
		mouseover_ui_filesize: false,
		mouseover_ui_gallerycounter: true,
		mouseover_ui_gallerymax: 50,
		// thanks to pacep94616 on github for the idea: https://github.com/qsniyg/maxurl/issues/225
		mouseover_ui_gallerybtns: true,
		mouseover_ui_closebtn: true,
		mouseover_ui_optionsbtn: is_userscript ? true : false,
		mouseover_ui_downloadbtn: false,
		mouseover_ui_rotationbtns: false,
		mouseover_ui_caption: true,
		mouseover_ui_wrap_caption: true,
		mouseover_ui_caption_link_page: true,
		mouseover_ui_link_underline: true,
		mouseover_use_remote: false,
		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,
		// thanks to Michael82548 on github for the idea: https://github.com/qsniyg/maxurl/issues/701
		mouseover_zoom_use_last: "gallery",
		mouseover_zoom_max_width: 0,
		mouseover_zoom_max_height: 0,
		mouseover_pan_behavior: "drag",
		mouseover_movement_inverted: true,
		mouseover_drag_min: 5,
		mouseover_scrolly_behavior: "zoom",
		// thanks to madman06 on greasyfork for the idea: https://greasyfork.org/en/scripts/36662-image-max-url/discussions/90341
		mouseover_scrolly_hold_behavior: "default",
		mouseover_scrollx_behavior: "gallery",
		mouseover_scrollx_hold_behavior: "default",
		// thanks to Runakanta on discord for the idea
		mouseover_scrolly_video_behavior: "default",
		mouseover_scrolly_video_invert: false,
		mouseover_scrollx_video_behavior: "default",
		// thanks to regis on discord for the idea
		scroll_override_page: false,
		// thanks to regis on discord for the idea
		scroll_zoom_origin: "cursor",
		// thanks to Noodlers on discord for the idea
		scroll_zoomout_pagemiddle: "never",
		scroll_zoom_behavior: "fitfull",
		// thanks to regis on discord for the idea
		scroll_incremental_mult: 1.25,
		mouseover_move_with_cursor: false,
		// thanks to regis on discord for the idea
		mouseover_move_within_page: true,
		zoom_out_to_close: false,
		// thanks to Runakanta on discord for the idea: https://github.com/qsniyg/maxurl/issues/471
		scroll_past_gallery_end_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_overflow_position_center: false,
		mouseover_overflow_origin: "a11",
		mouseover_add_link: true,
		mouseover_add_video_link: false,
		// thanks to bitst0rm on greasyfork for the idea: https://github.com/qsniyg/maxurl/issues/498
		mouseover_click_image_close: false,
		mouseover_click_video_close: false,
		mouseover_download: false,
		mouseover_hide_cursor: false,
		mouseover_hide_cursor_after: 0,
		mouseover_mouse_inactivity_jitter: 5,
		// thanks to thewhiterabbit- on reddit for the idea: https://github.com/qsniyg/maxurl/issues/331
		mouseover_clickthrough: false,
		mouseover_mask_ignore_clicks: false,
		// also thanks to 07416: https://github.com/qsniyg/maxurl/issues/25
		mouseover_links: true,
		// thanks to LoneFenris: https://github.com/qsniyg/maxurl/issues/25#issuecomment-482880122
		mouseover_only_valid_links: true,
		mouseover_allow_self_pagelink: false,
		mouseover_allow_iframe_el: false,
		mouseover_allow_canvas_el: false,
		mouseover_allow_svg_el: false,
		mouseover_enable_gallery: true,
		mouseover_gallery_cycle: false,
		mouseover_gallery_prev_key: ["left"],
		mouseover_gallery_next_key: ["right"],
		mouseover_gallery_move_after_video: false,
		// https://github.com/qsniyg/maxurl/issues/284
		// thanks to shivsah on github for the inspiration: https://github.com/qsniyg/maxurl/issues/95
		mouseover_gallery_download_key: ["shift", "d"],
		gallery_download_method: "zip",
		gallery_download_unchanged: true,
		gallery_zip_filename_format: "{host_domain_nosub}-{items_amt}-{download_unix}\n{items_amt}-{download_unix}",
		gallery_jd_autostart: false,
		gallery_jd_referer: "domain",
		gallery_zip_add_tld: true,
		gallery_zip_add_info_file: true,
		// thanks to acid-crash on github for the idea: https://github.com/qsniyg/maxurl/issues/20
		mouseover_styles: "",
		mouseover_enable_fade: true,
		mouseover_enable_zoom_effect: false,
		mouseover_zoom_effect_move: false,
		mouseover_fade_time: 100,
		mouseover_enable_mask_styles2: "never",
		mouseover_mask_styles2: "background-color: rgba(0, 0, 0, 0.5)",
		mouseover_mask_fade_time: 100,
		mouseover_ui_styles: "",
		// thanks to decembre on github for the idea: https://github.com/qsniyg/maxurl/issues/14#issuecomment-541065461
		mouseover_wait_use_el: false,
		mouseover_add_to_history: false,
		mouseover_add_thumbnail_to_history: false,
		mouseover_close_key: ["esc"],
		mouseover_download_key: [["s"], ["ctrl", "s"]],
		mouseover_open_new_tab_key: ["o"],
		mouseover_open_bg_tab_key: ["shift", "o"],
		mouseover_copy_link_key: ["shift", "c"],
		mouseover_open_options_key: ["p"],
		// thanks to Иван Хомяков on greasyfork for the idea: https://greasyfork.org/en/forum/discussion/comment/99404/#Comment_99404
		mouseover_open_orig_page_key: ["n"],
		mouseover_rotate_left_key: ["e"],
		mouseover_rotate_right_key: ["r"],
		mouseover_flip_horizontal_key: ["h"],
		mouseover_flip_vertical_key: ["v"],
		mouseover_zoom_in_key: [["+"], ["="], ["shift", "="]],
		mouseover_zoom_out_key: [["-"]],
		mouseover_zoom_full_key: ["1"],
		mouseover_zoom_fit_key: ["2"],
		mouseover_fullscreen_key: ["f"],
		mouseover_apply_blacklist: true,
		host_blacklist: "",
		host_blacklist_mode: "blacklist",
		apply_blacklist_host: false,
		mouseover_matching_media_types: false,
		// thanks to ComedicFox on discord for the idea: https://github.com/qsniyg/maxurl/issues/811
		mouseover_allow_popup_when_fullscreen: false,
		//mouseover_support_pointerevents_none: false,
		mouseover_find_els_mode: "hybrid",
		popup_allow_cache: true,
		popup_cache_duration: 30,
		popup_cache_itemlimit: 20,
		popup_cache_resume_video: true,
		website_inject_imu: true,
		website_image: true,
		extension_contextmenu: true,
		extension_hotreload: true,
		allow_watermark: false,
		allow_smaller: false,
		allow_possibly_different: false,
		allow_possibly_broken: false,
		allow_possibly_upscaled: false,
		allow_uncropped: true,
		allow_thirdparty: false,
		allow_apicalls: true,
		allow_thirdparty_libs: is_userscript ? false : true,
		custom_xhr_for_lib: is_extension ? true : false,
		bypass_csp_for_lib: false,
		use_webarchive_for_lib: false,
		lib_integrity_check: true,
		allow_thirdparty_code: false,
		allow_bruteforce: false,
		allow_webarchive: false,
		process_format: {},
		browser_cookies: true,
		deviantart_prefer_size: false,
		deviantart_support_download: true,
		ehentai_full_image: true,
		imgur_filename: false,
		imgur_source: false,
		instagram_use_app_api: false,
		instagram_dont_use_web: false,
		instagram_prefer_video_quality: true,
		instagram_gallery_postlink: false,
		snapchat_orig_media: true,
		teddit_redirect_reddit: true,
		tiktok_app_api: false,
		tiktok_no_watermarks: false,
		tiktok_thirdparty: null,
		// just a very small protection against github scraping bots :)
		tumblr_api_key: base64_decode("IHhyTXBMTThuMWVDZUwzb1JZU1pHN0NMQUx3NkVIaFlEZFU2V3E1ZUQxUGJNa2xkN1kx").substr(1),
		// thanks to modelfe on github for the idea: https://github.com/qsniyg/maxurl/issues/639
		twitter_use_ext: false,
		youtube_replace_n: false,
		// thanks to LukasThyWalls on github for the idea: https://github.com/qsniyg/maxurl/issues/75
		bigimage_blacklist: "",
		bigimage_blacklist_mode: "blacklist",
		bigimage_blacklist_engine: "glob",
		filename_format: "{author_username} {filename}",
		filename_replace_special_underscores: true,
		replaceimgs_enable_keybinding: false,
		replaceimgs_keybinding: ["shift", "alt", "r"],
		replaceimgs_auto: false,
		replaceimgs_replaceimgs: true,
		replaceimgs_addlinks: false,
		replaceimgs_replacelinks: false,
		// thanks to elvisef on github for the idea: https://github.com/qsniyg/maxurl/issues/617
		replaceimgs_plainlinks: "none",
		// thanks to nijaz-lab on github for the idea: https://github.com/qsniyg/maxurl/issues/550
		replaceimgs_links_newtab: false,
		// thanks to elvisef on github for the idea: https://github.com/qsniyg/maxurl/issues/593#issuecomment-754609502
		//replaceimgs_remove_size_constraints: false,
		// thanks to elvisef on github for the idea to remove size constraints: https://github.com/qsniyg/maxurl/issues/593#issuecomment-754609502
		// thanks to Raitzu on discord for the idea to enforce size constraints
		replaceimgs_size_constraints: "none",
		replaceimgs_usedata: is_userscript ? true : false,
		replaceimgs_wait_fullyloaded: true,
		replaceimgs_totallimit: 8,
		replaceimgs_domainlimit: 2,
		replaceimgs_delay: 0,
		replaceimgs_css: "",
		replaceimgs_simple_progress: true,
		highlightimgs_enable_keybinding: false,
		highlightimgs_keybinding: ["shift", "alt", "h"],
		highlightimgs_enable: false,
		highlightimgs_auto: "never",
		highlightimgs_onlysupported: true,
		highlightimgs_css: "outline: 4px solid yellow",
		customgallery_enable_keybinding: false,
		customgallery_keybinding: ["shift", "alt", "g"],
		customgallery_enable_button: false,
		customgallery_apply_key: ["enter"],
		customgallery_bg_css: "background-color: rgba(0, 0, 0, 0.25)",
		customgallery_outline_css: "background-color: rgba(255, 0, 0, 0.25)\nborder: 2px solid red",
		// cache entries (not settings, but this is the most convenient way to do it)
		last_update_check: 0,
		last_update_version: null,
		last_update_url: null
	};
	//var orig_settings = deepcopy(settings);
	var sensitive_settings = [
		"tumblr_api_key"
	];
	var user_defined_settings = {};
	var num_profiles = 2;
	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",
					name_gettext: false
				},
				es: {
					name: "Espa\u00F1ol",
					name_gettext: false
				},
				fr: {
					name: "Fran\u00E7ais",
					name_gettext: false
				},
				it: {
					name: "Italiano",
					name_gettext: false
				},
				ko: {
					name: "\uD55C\uAD6D\uC5B4",
					name_gettext: false
				},
				"pt-BR": {
					name: "Portugu\u00EAs (Brasil)",
					name_gettext: false
				},
				ru: {
					name: "\u0420\u0443\u0441\u0441\u043A\u0438\u0439",
					name_gettext: false
				},
				"zh-CN": {
					name: "\u7B80\u4F53\u4E2D\u6587",
					name_gettext: false
				}
			},
			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
		},
		settings_visible_description: {
			name: "Description below options",
			description: "Shows the description below the options (otherwise the description is only shown when you hover over the option's name)",
			category: "general",
			subcategory: "settings",
			onedit: function() {
				run_soon(do_options);
			},
			imu_enabled_exempt: true
		},
		settings_show_disabled: {
			name: "Show disabled options",
			description: "If disabled, options that are disabled due to their requirements being unmet will not be displayed",
			category: "general",
			subcategory: "settings",
			onedit: function() {
				run_soon(do_options);
			},
			imu_enabled_exempt: true
		},
		settings_show_disabled_profiles: {
			name: "Show disabled trigger profiles",
			description: "If disabled, options for alternate trigger profiles (options with `(#2)` after them) will not be shown if the relevant trigger isn't active",
			category: "general",
			subcategory: "settings",
			requires: {
				settings_show_disabled: true
			},
			onedit: function() {
				run_soon(do_options);
			},
			imu_enabled_exempt: true
		},
		settings_show_requirements: {
			name: "Requirements below disabled options",
			description: "If an option is disabled, the requirements to enable the option will be displayed below it",
			category: "general",
			subcategory: "settings",
			onedit: function() {
				run_soon(do_options);
			},
			requires: {
				settings_show_disabled: true
			},
			imu_enabled_exempt: true
		},
		check_updates: {
			name: "Check for updates",
			description: "Periodically checks for updates. If a new update is available, it will be shown at the top of the options page",
			category: "general",
			subcategory: "update"
		},
		check_update_interval: {
			name: "Update check interval",
			description: "How often to check for updates",
			category: "general",
			subcategory: "update",
			requires: {
				check_updates: true
			},
			type: "number",
			number_min: 1,
			number_int: true,
			number_unit: "hours"
		},
		check_update_notify: {
			name: "Notify when update is available",
			description: "Creates a browser notification when an update is available",
			category: "general",
			subcategory: "update",
			requires: {
				check_updates: true
			},
			required_permission: "notifications"
		},
		advanced_options: {
			name: "Show advanced settings",
			description: "If disabled, settings that might be harder to understand will be hidden",
			category: "general",
			subcategory: "settings",
			onedit: function() {
				run_soon(do_options);
			},
			imu_enabled_exempt: true
		},
		settings_tabs: {
			name: "Use tabs",
			description: "If disabled, all settings will be shown on a single page",
			category: "general",
			subcategory: "settings",
			onedit: function() {
				run_soon(do_options);
			},
			imu_enabled_exempt: true
		},
		settings_alphabetical_order: {
			name: "Alphabetical order",
			description: "Lists options in alphabetical order",
			category: "general",
			subcategory: "settings",
			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
		},
		retry_503_times: {
			name: "Retry requests with 503 errors",
			description: "Amount of times to retry a request when 503 (service unavailable) is returned by the server",
			category: "general",
			type: "number",
			number_min: 0,
			number_int: true,
			number_unit: "times",
			imu_enabled_exempt: true,
			advanced: true
		},
		retry_503_ms: {
			name: "Delay between 503 retries",
			description: "Time (in milliseconds) to delay between retrying requests that received 503",
			category: "general",
			type: "number",
			number_min: 0,
			number_int: true,
			number_unit: "ms",
			imu_enabled_exempt: true,
			advanced: true
		},
		use_blob_over_arraybuffer: {
			name: "Use `Blob` over `ArrayBuffer`",
			description: "Uses `Blob`s for XHRs instead of `ArrayBuffer`s. Keep this enabled unless your userscript manager doesn't support blob requests",
			category: "general",
			imu_enabled_exempt: true,
			advanced: true,
			hidden: true
		},
		allow_live_settings_reload: {
			name: "Live settings reloading",
			description: "Enables/disables live settings reloading. There shouldn't be a reason to disable this unless you're experiencing issues with this feature",
			category: "general",
			hidden: is_userscript && typeof GM_addValueChangeListener === "undefined",
			imu_enabled_exempt: true,
			advanced: true
		},
		disable_keybind_when_editing: {
			name: "Disable keybindings when editing text",
			description: "Disables shortcuts when key events are sent to an input area on the page",
			category: "keybinds",
			imu_enabled_exempt: true,
			advanced: true
		},
		enable_gm_download: {
			name: "Use `GM_download` if available",
			description: "Prefers using `GM_download` over simple browser-based downloads, if the function is available. Some userscript managers download the entire file before displaying a save dialog, which can be undesirable for large video files",
			category: "general",
			userscript_only: true,
			imu_enabled_exempt: true,
			advanced: true
		},
		gm_download_max: {
			name: "Maximum size to `GM_download`",
			description: "If a file is larger than this size, use a simple browser-based download instead. Set to `0` for unlimited.",
			category: "general",
			userscript_only: true,
			imu_enabled_exempt: true,
			requires: {
				enable_gm_download: true
			},
			type: "number",
			number_min: 0,
			number_unit: "MB",
			advanced: true
		},
		enable_webextension_download: {
			name: "Force save dialog when downloading",
			description: "Tries to ensure the 'save as' dialog displays when downloading. This requires the 'downloads' permission to work, and will sometimes not work when custom headers are required.",
			category: "general",
			extension_only: true,
			imu_enabled_exempt: true,
			required_permission: "downloads"
		},
		enable_console_logging: {
			name: "Enable logging to console",
			description: "Allows the script to log messages to the browser console.",
			category: "general",
			imu_enabled_exempt: true,
			advanced: true
		},
		write_to_clipboard: {
			name: "Enable writing to clipboard",
			description: "This option does nothing on its own, but enabling it allows other functionality that require writing to the clipboard to work",
			category: "general",
			imu_enabled_exempt: true,
			required_permission: "clipboardWrite"
		},
		redirect: {
			name: "Enable redirection",
			description: "Automatically redirect media opened in their own tab to their larger/original versions",
			category: "redirection"
		},
		redirect_video: {
			name: "Allow video",
			description: "Allows redirecting from/to video",
			requires: {
				redirect: true
			},
			category: "redirection"
		},
		redirect_audio: {
			name: "Allow audio",
			description: "Allows redirecting from/to audio",
			requires: {
				redirect: true
			},
			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"
		},
		redirect_extension: {
			name: "Do redirection in extension",
			description: "Performs the redirection in the extension instead of the content script. This is significantly faster and shouldn't cause issues in theory, but this option is kept in case of regressions",
			requires: {
				redirect: true
			},
			extension_only: true,
			advanced: 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 extra information",
			description: "Enables methods that use API calls for finding extra information, such as the original page, caption, or album information. Note that this option does not affect finding the original media.",
			example_websites: [
				"Flickr",
				"SmugMug",
				"..."
			],
			category: "rules"
		},
		redirect_enable_infobox: {
			name: "Enable tooltip",
			description: "Enables the 'Mouseover popup is needed to display the original version' tooltip",
			category: "redirection",
			requires: {
				redirect: true
			},
			userscript_only: true // tooltip isn't shown in the extension
		},
		redirect_infobox_url: {
			name: "Show image URL in tooltip",
			description: "If the popup is needed to display the larger version of an image, display the image link in the tooltip",
			category: "redirection",
			requires: {
				redirect: true
			},
			userscript_only: true // tooltip isn't shown in the extension
		},
		redirect_infobox_timeout: {
			name: "Hide tooltip after",
			description: "Hides the tooltip after the specified number of seconds (or when the mouse clicks on it). Set to 0 to never hide automatically",
			requires: {
				redirect: true
			},
			type: "number",
			number_min: 0,
			number_unit: "seconds",
			category: "redirection",
			userscript_only: true // tooltip isn't shown in the extension
		},
		print_imu_obj: {
			name: "Log info object to console",
			description: "Prints the full info object to the console whenever a popup/redirect is found",
			category: "rules",
			requires: {
				enable_console_logging: true
			},
			advanced: true
		},
		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
		},
		redirect_to_no_infobox: {
			name: "Redirect to largest without issues",
			description: "Redirects to the largest image found that doesn't require custom headers or forces download",
			userscript_only: true,
			category: "redirection"
		},
		redirect_host_html: {
			name: "Redirect for HTML pages too",
			description: "Tries redirection even if the host page is HTML. This option might be useful for dead links. However, this will also result in many normal pages being redirected to images/video, so use with caution.",
			warning: {
				"true": "This will result in many pages being redirected to images/videos.\nI'd recommend only either enabling this for the media you need it for then disabling it after, or using the black/whitelist feature below to only allow it to run for specified websites."
			},
			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 (if applicable)",
			category: "popup"
		},
		mouseover_open_behavior: {
			name: "Mouseover popup action",
			description: "Determines how the mouseover popup will open",
			profiled: true,
			// While it won't work for some images without the extension, let's not disable it outright either
			//extension_only: true,
			hidden: is_userscript && open_in_tab === common_functions["nullfunc"],
			options: {
				_type: "combo",
				popup: {
					name: "Popup"
				},
				newtab: {
					name: "New tab"
				},
				// thanks to Hlsgs on github for the idea: https://github.com/qsniyg/maxurl/issues/556
				newtab_bg: {
					name: "New background tab",
				},
				download: {
					name: "Download"
				},
				// thanks to lnp5131 on github for the idea: https://github.com/qsniyg/maxurl/issues/435
				copylink: {
					name: "Copy link"
				},
				// thanks to TurretBot on discord for the idea: https://github.com/qsniyg/maxurl/issues/668
				replace: {
					name: "Replace"
				}
			},
			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: {
				_group1: {
					mouse: {
						name: "Mouseover",
						description: "Triggers when your mouse is over the image"
					},
				},
				_group2: {
					keyboard: {
						name: "Key trigger",
						description: "Triggers when you press a key sequence when your mouse is over an image"
					},
				},
				_group3: {
					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_key_t2: {
			name: "Popup trigger key (#2)",
			description: "Key sequence to trigger the popup with alternate options. Search for `(#2)` to find the relevant options",
			type: "keysequence",
			keyseq_allow_none: true,
			requires: {
				mouseover: true,
				mouseover_trigger_behavior: "keyboard"
			},
			category: "popup",
			subcategory: "trigger"
		},
		mouseover_trigger_key_t3: {
			name: "Popup trigger key (#3)",
			description: "Key sequence to trigger the popup with alternate options. Search for `(#3)` to find the relevant options",
			type: "keysequence",
			keyseq_allow_none: true,
			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_enabledisable_toggle: {
			name: "Enable/disable toggle",
			description: "Controls whether the 'Popup enable/disable key' will enable or disable the popup from opening",
			options: {
				enable: {
					name: "Enable"
				},
				disable: {
					name: "Disable"
				}
			},
			requires: {
				mouseover_trigger_behavior: "mouse"
			},
			category: "popup",
			subcategory: "trigger"
		},
		mouseover_trigger_prevent_key: {
			name: "Popup enable/disable key",
			description: "Holding down this key will enable or disable the popup from being opened, depending on the 'Enable/disable toggle' setting",
			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.\nPartially loaded media will contain the source URL directly (where possible), whereas fully loaded media will use a blob or data URL.",
			description_userscript: "This will allow the popup to open for partially loaded media, but this might break images that require custom headers to display properly.\nPartially loaded media will contain the source URL directly (where possible), whereas fully loaded media will use a blob or data URL.",
			requires: "action:popup",
			options: {
				_type: "or",
				video: {
					name: "Streams",
					description: "Audio and video"
				},
				media: {
					name: "Media",
					description: "Images, audio, and video"
				},
				none: {
					name: "None"
				}
			},
			category: "popup",
			subcategory: "open_behavior"
		},
		mouseover_partial_avoid_head: {
			name: "Avoid HEAD request for partially loaded media",
			description: "Avoids a possibly unnecessary HEAD request before displaying partially loaded images, which further decreases the delay before opening the popup. This can cause issues if the server returns an error, but still returns an image",
			requires: [
				{ mouseover_allow_partial: "video" },
				{ mouseover_allow_partial: "media" }
			],
			category: "popup",
			subcategory: "open_behavior",
			advanced: true
		},
		mouseover_use_blob_over_data: {
			name: "Use `blob:` over `data:` URLs",
			description: "Blob URLs are more efficient, but aren't supported by earlier browsers. Some websites also block `blob:` URLs",
			requires: "action:popup",
			category: "popup",
			subcategory: "open_behavior",
			advanced: true
		},
		popup_use_anonymous_crossorigin: {
			name: "Load media anonymously",
			description: "Loads the media without sending any cookies or other forms of credentials. This is required to screenshot videos from other sources",
			requires: "action:popup",
			category: "popup",
			subcategory: "open_behavior",
			advanced: true
		},
		mouseover_use_fully_loaded_image: {
			name: "Wait until image is fully loaded",
			description: "Wait until the image has fully loaded before displaying it",
			requires: "action: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: "action:popup",
			category: "popup",
			subcategory: "open_behavior"
		},
		mouseover_enable_notallowed: {
			name: "Use `not-allowed` cursor when unsupported",
			description: "If the image isn't supported, the mouse cursor will change to a `not-allowed` cursor for a brief duration",
			requires: {
				mouseover_trigger_behavior: "keyboard"
			},
			category: "popup",
			subcategory: "open_behavior"
		},
		mouseover_enable_notallowed_cant_load: {
			name: "Use `not-allowed` cursor when unable to load",
			description: "If the image fails to load, the mouse cursor will change to a `not-allowed` cursor for a brief duration",
			category: "popup",
			subcategory: "open_behavior"
		},
		mouseover_notallowed_duration: {
			name: "`not-allowed` cursor duration",
			description: "How long the `not-allowed` cursor should last",
			requires: [
				{ mouseover_enable_notallowed: true },
				{ mouseover_enable_notallowed_cant_load: true }
			],
			type: "number",
			number_min: 0,
			number_int: true,
			number_unit: "ms",
			advanced: true,
			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
			},
			profiled: true,
			category: "popup",
			subcategory: "source"
		},
		mouseover_minimum_size: {
			name: "Minimum size",
			description: "Smallest size acceptable for the popup to open (this option is ignored for background images). This refers to the size of the media to be popped up, which may differ from the source media.",
			requires: {
				mouseover: true
			},
			profiled: true,
			type: "number",
			number_min: 0,
			number_unit: "pixels",
			category: "popup",
			subcategory: "source"
		},
		popup_maximum_source_size: {
			name: "Maximum source size",
			description: "Maximum size (width/height) for the source media to allow popping up (this option is ignored for background images). Set to `0` for any size.",
			requires: {
				mouseover: true
			},
			profiled: true,
			type: "number",
			number_min: 0,
			number_unit: "pixels",
			category: "popup",
			subcategory: "source"
		},
		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
			},
			profiled: true,
			disabled_if: {
				mouseover_trigger_mouseover: true
			},
			category: "popup",
			subcategory: "source"
		},
		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: "source"
		},
		mouseover_exclude_sameimage: {
			name: "Exclude if media URL is unchanged",
			description: "Don't pop up if the new URL is the same as the source",
			requires: {
				mouseover: true
			},
			category: "popup",
			subcategory: "source"
		},
		mouseover_only_links: {
			name: "Only popup for linked media",
			description: "Don't pop up if the media isn't hyperlinked",
			requires: {
				mouseover: true
			},
			category: "popup",
			subcategory: "source"
		},
		mouseover_linked_image: {
			name: "Popup link for linked media",
			description: "If the linked media cannot be made larger, pop up for the link instead of the media",
			requires: {
				mouseover: true
			},
			category: "popup",
			subcategory: "source"
		},
		mouseover_exclude_imagemaps: {
			name: "Exclude image maps",
			description: "Don't pop up if the image is an image map (image with multiple clickable areas)",
			requires: {
				mouseover: true
			},
			category: "popup",
			subcategory: "source"
		},
		mouseover_video_autoplay: {
			name: "Autoplay",
			description: "Play automatically once the popup is opened",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_controls: {
			name: "Show video controls",
			description: "Shows native video controls. Note that this prevents dragging under Firefox",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_controls_key: {
			name: "Toggle video controls",
			description: "Key to toggle whether the video controls are shown",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "video"
		},
		mouseover_video_loop: {
			name: "Loop",
			description: "Allows the media to automatically restart to the beginning after finishing playing",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			disabled_if: {
				mouseover_gallery_move_after_video: true
			},
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_autoloop_max: {
			name: "Max duration for looping",
			description: "Media longer than the specified duration will not be automatically looped. Setting this to `0` will always enable looping, regardless of duration.",
			requires: {
				mouseover_video_loop: true
			},
			type: "number",
			number_min: 0,
			number_unit: "seconds",
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_playpause_key: {
			name: "Play/pause key",
			description: "Key to toggle whether the media is playing or paused",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "video"
		},
		mouseover_video_muted: {
			name: "Mute",
			description: "Mutes the media by default",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_mute_key: {
			name: "Toggle mute key",
			description: "Key to toggle mute",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "video"
		},
		mouseover_video_volume: {
			name: "Default volume",
			description: "Default volume for the media",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "number",
			number_min: 0,
			number_max: 100,
			number_int: true,
			number_unit: "%",
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_volume_up_key: {
			name: "Volume up key",
			description: "Key to increase the volume",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "video"
		},
		mouseover_video_volume_down_key: {
			name: "Volume down key",
			description: "Key to decrease the volume",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "video"
		},
		mouseover_video_volume_change_amt: {
			name: "Volume change amount",
			description: "Percent for volume to increase/decrease when using the volume up/down keys",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "number",
			number_min: 0,
			number_max: 100,
			number_int: true,
			number_unit: "%",
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_resume_from_source: {
			name: "Resume playback from source",
			description: "If enabled, playback will resume from where the source left off",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_resume_if_different: {
			name: "Resume if different length",
			description: "If disabled, it will not resume if the source has a different length from the media in the popup (e.g. from a preview video to a full one)",
			requires: {
				mouseover_video_resume_from_source: true
			},
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_pause_source: {
			name: "Pause source",
			description: "Pauses the source once the popup has opened",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_seek_amount: {
			name: "Seek amount",
			description: "Amount of time to seek forward/back when using the seek keys",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "number",
			number_min: 0,
			number_unit: "seconds",
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_seek_left_key: {
			name: "Seek left key",
			description: "Key to seek backwards by the specified amount",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "video"
		},
		mouseover_video_seek_right_key: {
			name: "Seek right key",
			description: "Key to seek forwards by the specified amount",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "video"
		},
		mouseover_video_seek_vertical_scroll: {
			name: "Vertical scroll seeks",
			description: "Scrolling vertically will seek forward/backward",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_seek_horizontal_scroll: {
			name: "Horizontal scroll seeks",
			description: "Scrolling horizontally will seek forward/backward",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_frame_prev_key: {
			name: "Previous frame key",
			description: "Rewinds the video one \"frame\" backward. Due to current limitations, the frame size is static (but configurable), and might not match the video's framerate",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "video"
		},
		mouseover_video_frame_next_key: {
			name: "Next frame key",
			description: "Advances the video one \"frame\" forward. Due to current limitations, the frame size is static (but configurable), and might not match the video's framerate",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "video"
		},
		mouseover_video_framerate: {
			name: "Frame rate",
			description: "Frame rate for videos to seek forward/back with the next/previous frame keys",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "number",
			number_min: 0,
			number_unit: "FPS",
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_speed_down_key: {
			name: "Speed down key",
			description: "Key to decrease playback rate by a specified amount",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "video"
		},
		mouseover_video_speed_up_key: {
			name: "Speed up key",
			description: "Key to increase playback rate by a specified amount",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "video"
		},
		mouseover_video_speed_amount: {
			name: "Speed up/down amount",
			description: "How much to increase/decrease the playback rate",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "number",
			number_min: 0,
			number_unit: "x",
			category: "popup",
			subcategory: "video"
		},
		mouseover_video_reset_speed_key: {
			name: "Reset speed key",
			description: "Resets the playback rate to normal speed",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "video"
		},
		mouseover_video_screenshot_key: {
			name: "Screenshot key",
			description: "Screenshots the current frame in the video",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "video"
		},
		popup_video_screenshot_format: {
			name: "Screenshot format",
			description: "File format to save the screenshot in",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			options: {
				_type: "or",
				png: {
					name: "PNG"
				},
				jpg: {
					name: "JPG"
				}
			},
			category: "popup",
			subcategory: "video"
		},
		popup_enable_subtitles: {
			name: "Enable subtitles",
			description: "Enables subtitles to be overlayed on top of the video",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			category: "popup",
			subcategory: "video"
		},
		mouseover_ui: {
			name: "Popup UI",
			description: "Enables a UI on top of the popup",
			requires: "action:popup",
			category: "popup",
			subcategory: "ui"
		},
		mouseover_ui_toggle_key: {
			name: "UI Toggle key",
			description: "Toggles the display of the UI",
			type: "keysequence",
			requires: "action:popup",
			category: "keybinds",
			subcategory: "popup"
		},
		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_use_safe_glyphs: {
			name: "Use safe glyphs",
			description: "Uses glyphs that are more likely to be available on all fonts. Enable this option if the following characters render as boxes: \uD83E\uDC47 \ud83e\udc50 \ud83e\udc52. The 'Noto Sans Symbols2' font contains these characters.",
			requires: {
				mouseover_ui: true
			},
			category: "popup",
			subcategory: "ui"
		},
		mouseover_ui_imagesize: {
			name: "Media resolution",
			description: "Displays the original media dimensions on top of the UI.\nCSS ID: `#sizeinfo`",
			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.\nCSS ID: `#sizeinfo`",
			requires: {
				mouseover_ui: true
			},
			category: "popup",
			subcategory: "ui"
		},
		mouseover_ui_filesize: {
			name: "File size",
			description: "Displays the media's file size on top of the UI. For the moment, this will not work with partially loaded media if 'Avoid HEAD request for partially loaded media' is enabled.\nCSS ID: `#sizeinfo`",
			requires: {
				mouseover_ui: true
			},
			category: "popup",
			subcategory: "ui"
		},
		mouseover_ui_gallerycounter: {
			name: "Gallery counter",
			description: "Enables a gallery counter on top of the UI.\nCSS ID: `#gallerycounter`",
			requires: {
				mouseover_ui: true,
				mouseover_enable_gallery: 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,
				mouseover_enable_gallery: true
			},
			type: "number",
			number_min: 0,
			number_unit: "images",
			category: "popup",
			subcategory: "ui"
		},
		mouseover_ui_gallerybtns: {
			name: "Gallery buttons",
			description: "Enables buttons to go left/right in the gallery.\nCSS IDs: `#galleryprevbtn`, `#gallerynextbtn`",
			requires: {
				mouseover_ui: true,
				mouseover_enable_gallery: true
			},
			category: "popup",
			subcategory: "ui"
		},
		mouseover_ui_closebtn: {
			name: "Close Button",
			description: "Enables a button to close the popup.\nCSS ID: `#closebtn`",
			requires: {
				mouseover_ui: true
			},
			category: "popup",
			subcategory: "ui"
		},
		mouseover_ui_optionsbtn: {
			name: "Options Button",
			description: "Enables a button to go to this page.\nCSS ID: `#optionsbtn`",
			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_downloadbtn: {
			name: "Download Button",
			description: "Enables a button to download the image.\nCSS ID: `#downloadbtn`",
			requires: {
				mouseover_ui: true
			},
			category: "popup",
			subcategory: "ui"
		},
		mouseover_ui_rotationbtns: {
			name: "Rotation Buttons",
			description: "Enables buttons on the UI to rotate the image by 90 degrees.\nCSS IDs: `#rotleftbtn`, `#rotrightbtn`",
			requires: {
				mouseover_ui: true
			},
			category: "popup",
			subcategory: "ui"
		},
		mouseover_ui_caption: {
			name: "Caption",
			description: "Shows the image's caption (if available) at the top.\nCSS ID: `#caption`",
			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_ui_caption_link_page: {
			name: "Link original page in caption",
			description: "Links the original page (if it exists) in the caption",
			requires: {
				mouseover_ui_caption: true
			},
			category: "popup",
			subcategory: "ui"
		},
		mouseover_ui_link_underline: {
			name: "Underline links",
			description: "Adds an underline to links (such as the original page)",
			requires: {
				mouseover_ui: 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: {
				_condition: "action: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: [
				{
					_condition: "action:popup",
					mouseover_close_need_mouseout: true
				},
				{
					_condition: "action:popup",
					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_cancel_popup_when_release: {
			name: "Releasing triggers cancels loading",
			description: "Cancels the current popup loading if all/any triggers are released (as set by the \"Keep popup open until\" setting)",
			requires: [
				{ mouseover_close_behavior: "any" },
				{ mouseover_close_behavior: "all" }
			],
			category: "popup",
			subcategory: "close_behavior"
		},
		mouseover_auto_close_popup: {
			name: "Automatically close after timeout",
			description: "Closes the popup automatically after a specified period of time has elapsed",
			requires: "action:popup",
			category: "popup",
			subcategory: "close_behavior"
		},
		mouseover_auto_close_popup_time: {
			name: "Timeout to close popup",
			description: "Amount of time to elapse before automatically closing the popup",
			requires: {
				mouseover_auto_close_popup: true
			},
			type: "number",
			number_min: 0,
			number_unit: "seconds",
			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: [
				{
					_condition: "action:popup",
					mouseover_trigger_behavior: "mouse"
				},
				{
					_condition: "action:popup",
					mouseover_auto_close_popup: true
				},
				{
					_condition: "action:popup",
					mouseover_close_need_mouseout: true
				},
			],
			category: "popup",
			subcategory: "close_behavior"
		},
		mouseover_hold_key: {
			name: "Hold key",
			description: "Hold key that, when pressed, will keep the popup open",
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_hold_position_center: {
			name: "Center popup on hold",
			description: "Centers the popup to the middle of the page when the popup is held",
			requires: "action:popup",
			category: "popup",
			subcategory: "close_behavior"
		},
		popup_hold_zoom: {
			name: "Override zoom on hold",
			description: "Overrides the zoom when the popup is held",
			options: {
				_type: "combo",
				none: {
					name: "None"
				},
				fit: {
					name: "Fit to screen"
				},
				fill: {
					name: "Fill screen"
				},
				full: {
					name: "Full size"
				}
			},
			requires: "action:popup",
			category: "popup",
			subcategory: "close_behavior"
		},
		mouseover_hold_close_unhold: {
			name: "Close popup on unhold",
			description: "Closes the popup when the hold key is pressed again, after having previously held the popup",
			requires: "action:popup",
			category: "popup",
			subcategory: "close_behavior"
		},
		mouseover_hold_unclickthrough: {
			name: "Enable pointer events on hold",
			description: "Enables previously disabled pointer events when the popup is held",
			requires: {
				_condition: "action:popup",
				mouseover_clickthrough: true
			},
			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: {
				_condition: "action:popup",
				mouseover_trigger_behavior: "mouse",
				mouseover_position: "beside_cursor"
			},
			category: "popup",
			subcategory: "close_behavior"
		},
		mouseover_close_click_outside: {
			name: "Clicking outside the popup closes",
			description: "Closes the popup when the mouse clicks outside of it",
			requires: "action:popup",
			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 both",
			requires: [
				{
					_condition: "action:popup",
					mouseover_trigger_behavior: "mouse"
				},
				{
					_condition: "action:popup",
					mouseover_trigger_behavior: "keyboard",
					mouseover_close_need_mouseout: true
				}
			],
			options: {
				_type: "combo",
				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 (can improve performance on websites with many elements, but prevents the cursor from clicking anything while loading the popup)",
			requires: {
				mouseover: true
			},
			category: "popup",
			subcategory: "popup_other",
			advanced: true
		},
		mouseover_add_to_history: {
			name: "Add popup link to history",
			description: "Adds the image/video link opened through the popup to the browser's history",
			requires: {
				mouseover: true
			},
			category: "popup",
			subcategory: "popup_other",
			required_permission: "history",
			extension_only: true
		},
		mouseover_add_thumbnail_to_history: {
			name: "Add thumbnail link to history",
			description: "Adds the original media link opened through the popup to the browser's history",
			requires: {
				mouseover: true
			},
			category: "popup",
			subcategory: "popup_other",
			required_permission: "history",
			extension_only: true
		},
		allow_remote: {
			name: "Allow inter-frame communication",
			description: "Allows communication between frames in windows, improving support for keybindings",
			description_userscript: "Allows communication between frames in windows, improving support for keybindings. Can pose a fingerprinting risk when used through the userscript",
			requires: {
				mouseover: true
			},
			category: "general",
			advanced: !is_userscript // userscript users may want to disable it for privacy reasons
		},
		mouseover_use_remote: {
			name: "Pop out of frames",
			description: "Opens the popup on the top frame instead of within iframes. This option is still experimental.",
			requires: {
				_condition: "action:popup",
				allow_remote: true
			},
			category: "popup",
			subcategory: "open_behavior"
		},
		mouseover_zoom_behavior: {
			name: "Popup default zoom",
			description: "How the popup should be initially sized",
			options: {
				_type: "combo",
				fit: {
					name: "Fit to screen"
				},
				fill: {
					name: "Fill screen"
				},
				full: {
					name: "Full size"
				},
				custom: {
					name: "Custom size"
				}
			},
			requires: "action: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_zoom_use_last: {
			name: "Use last zoom",
			description: "Use the last popup's zoom. Note that this is per-page.",
			options: {
				_type: "combo",
				always: {
					name: "Always"
				},
				gallery: {
					name: "Gallery"
				},
				never: {
					name: "Never"
				}
			},
			requires: "action:popup",
			category: "popup",
			subcategory: "open_behavior"
		},
		mouseover_zoom_max_width: {
			name: "Maximum width",
			description: "Maximum width for the initial popup size. Set to `0` for unlimited.",
			type: "number",
			number_min: 0,
			number_unit: "px",
			requires: "action:popup",
			category: "popup",
			subcategory: "open_behavior"
		},
		mouseover_zoom_max_height: {
			name: "Maximum height",
			description: "Maximum height for the initial popup size. Set to `0` for unlimited.",
			type: "number",
			number_min: 0,
			number_unit: "px",
			requires: "action:popup",
			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: "action:popup",
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_movement_inverted: {
			name: "Invert movement",
			description: "Inverts the movement of the mouse. For example, if the mouse moves left, the popup moves right. If disabled, it feels more like the popup is being invisibly dragged.",
			requires: {
				mouseover_pan_behavior: "movement"
			},
			// It's doubtful many users will want this option enabled
			advanced: true,
			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_scrolly_behavior: {
			name: "Vertical scroll action",
			description: "How the popup reacts to a vertical scroll/mouse wheel event",
			options: {
				_type: "combo",
				zoom: {
					name: "Zoom"
				},
				pan: {
					name: "Pan"
				},
				gallery: {
					name: "Gallery",
					requires: [{
							mouseover_enable_gallery: true
						}]
				},
				nothing: {
					name: "None"
				}
			},
			requires: "action:popup",
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_scrolly_hold_behavior: {
			name: "Vertical scroll action (hold)",
			description: "How the popup (when held) reacts to a vertical scroll/mouse wheel event",
			options: {
				_type: "combo",
				default: {
					name: "Default"
				},
				zoom: {
					name: "Zoom"
				},
				pan: {
					name: "Pan"
				},
				gallery: {
					name: "Gallery",
					requires: [{
							mouseover_enable_gallery: true
						}]
				},
				nothing: {
					name: "None"
				}
			},
			requires: "action:popup",
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_scrollx_behavior: {
			name: "Horizontal scroll action",
			description: "How the popup reacts to a horizontal scroll/mouse wheel event",
			options: {
				_type: "combo",
				pan: {
					name: "Pan"
				},
				gallery: {
					name: "Gallery",
					requires: [{
							mouseover_enable_gallery: true
						}]
				},
				nothing: {
					name: "None"
				}
			},
			requires: "action:popup",
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_scrollx_hold_behavior: {
			name: "Horizontal scroll action (hold)",
			description: "How the popup (when held) reacts to a horizontal scroll/mouse wheel event",
			options: {
				_type: "combo",
				default: {
					name: "Default"
				},
				pan: {
					name: "Pan"
				},
				gallery: {
					name: "Gallery",
					requires: [{
							mouseover_enable_gallery: true
						}]
				},
				nothing: {
					name: "None"
				}
			},
			requires: "action:popup",
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_scrolly_video_behavior: {
			name: "Vertical video scroll action",
			description: "Overrides the vertical scroll action for videos. Set to `Default` to avoid overriding the behavior.",
			options: {
				_type: "combo",
				default: {
					name: "Default"
				},
				seek: {
					name: "Seek"
				},
				nothing: {
					name: "None"
				}
			},
			requires: "action:popup",
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_scrolly_video_invert: {
			name: "Invert vertical scroll seek",
			description: "Inverts the seek direction when scrolling vertically: Scrolling up will seek right, scrolling down will seek left.",
			requires: {
				mouseover_scrolly_video_behavior: "seek"
			},
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_scrollx_video_behavior: {
			name: "Horizontal video scroll action",
			description: "Overrides the horizontal scroll action for videos. Set to `Default` to avoid overriding the behavior.",
			options: {
				_type: "combo",
				default: {
					name: "Default"
				},
				seek: {
					name: "Seek"
				},
				nothing: {
					name: "None"
				}
			},
			requires: "action:popup",
			category: "popup",
			subcategory: "behavior"
		},
		scroll_override_page: {
			name: "Override scroll outside of popup",
			description: "Scrolling outside of the popup will also be overriden by the script",
			requires: "action:popup",
			category: "popup",
			subcategory: "behavior"
		},
		scroll_zoom_origin: {
			name: "Zoom origin",
			description: "The point on the image it's zoomed in/out from",
			options: {
				_type: "or",
				cursor: {
					name: "Cursor"
				},
				center: {
					name: "Center"
				}
			},
			requires: [
				{ mouseover_scrollx_behavior: "zoom" },
				{ mouseover_scrollx_hold_behavior: "zoom" },
				{ mouseover_scrolly_behavior: "zoom" },
				{ mouseover_scrolly_hold_behavior: "zoom" }
			],
			category: "popup",
			subcategory: "behavior"
		},
		scroll_zoomout_pagemiddle: {
			name: "Zoom out towards page middle",
			description: "Sets the origin when zooming out to the page middle, overriding the \"Zoom Origin\" option above.",
			options: {
				_type: "combo",
				always: {
					name: "Always"
				},
				viewport: {
					name: "Within viewport"
				},
				never: {
					name: "Never"
				}
			},
			requires: [
				{ mouseover_scrollx_behavior: "zoom" },
				{ mouseover_scrollx_hold_behavior: "zoom" },
				{ mouseover_scrolly_behavior: "zoom" },
				{ mouseover_scrolly_hold_behavior: "zoom" }
			],
			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_scrollx_behavior: "zoom" },
				{ mouseover_scrollx_hold_behavior: "zoom" },
				{ mouseover_scrolly_behavior: "zoom" },
				{ mouseover_scrolly_hold_behavior: "zoom" }
			],
			category: "popup",
			subcategory: "behavior"
		},
		scroll_incremental_mult: {
			name: "Incremental zoom multiplier",
			description: "How much to zoom in/out by (for incremental zooming)",
			type: "number",
			number_min: 1,
			number_unit: "x",
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_move_with_cursor: {
			name: "Move with cursor",
			description: "Moves the popup as the cursor moves",
			requires: "action:popup",
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_move_within_page: {
			name: "Move within page",
			description: "Ensures the popup doesn't leave the page",
			requires: {
				mouseover_move_with_cursor: true
			},
			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_scrollx_behavior: "zoom" },
				{ mouseover_scrollx_hold_behavior: "zoom" },
				{ mouseover_scrolly_behavior: "zoom" },
				{ mouseover_scrolly_hold_behavior: "zoom" }
			],
			category: "popup",
			subcategory: "close_behavior"
		},
		scroll_past_gallery_end_to_close: {
			name: "Scroll past gallery end to close",
			description: "Closes the popup if you scroll past the end of the gallery",
			requires: [
				{ mouseover_scrollx_behavior: "gallery" },
				{ mouseover_scrollx_hold_behavior: "gallery" },
				{ mouseover_scrolly_behavior: "gallery" },
				{ mouseover_scrolly_hold_behavior: "gallery" }
			],
			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: "action: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"
			},
			hidden: true, // no longer applicable with new beside_cursor implementation
			category: "popup",
			subcategory: "open_behavior"
		},
		mouseover_overflow_position_center: {
			name: "Center popup on overflow",
			description: "Centers the popup if its initial size overflows",
			requires: "action:popup",
			category: "popup",
			subcategory: "open_behavior"
		},
		mouseover_overflow_origin: {
			name: "Overflow origin",
			description: "Where the popup will appear in the page if its initial size overflows",
			requires: [
				{ mouseover_position: "center" },
				{ mouseover_overflow_position_center: true },
				{ mouseover_hold_position_center: true }
			],
			options: {
				_type: "or",
				// prefixed with a to ensure correct order
				_group1: {
					"a00": { name: "" },
					"a10": { name: "" },
					"a20": { name: "" }
				},
				_group2: {
					"a01": { name: "" },
					"a11": { name: "" },
					"a21": { name: "" }
				},
				_group3: {
					"a02": { name: "" },
					"a12": { name: "" },
					"a22": { name: "" }
				},
			},
			category: "popup",
			subcategory: "open_behavior"
		},
		mouseover_hide_cursor: {
			name: "Hide cursor over popup",
			description: "Hides the cursor when the mouse is over the popup",
			requires: "action:popup",
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_hide_cursor_after: {
			name: "Hide cursor after",
			description: "Hides the cursor over the popup after a specified period of time (in milliseconds), 0 always hides the cursor",
			requires: {
				mouseover_hide_cursor: true
			},
			type: "number",
			number_unit: "ms",
			number_int: true,
			number_min: 0,
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_mouse_inactivity_jitter: {
			name: "Mouse jitter threshold",
			description: "Threshold for mouse movement before the mouse cursor is shown again, 0 always shows the cursor after any movement",
			requires: {
				mouseover_hide_cursor: true
			},
			type: "number",
			number_unit: "px",
			number_int: true,
			number_min: 0,
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_clickthrough: {
			name: "Disable pointer events",
			description: "Enabling this option will allow you to click on links underneath the popup",
			requires: "action:popup",
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_mask_ignore_clicks: {
			name: "Ignore clicks outside popup",
			description: "Any mouse event outside the popup will be discarded with this option",
			requires: "action:popup",
			category: "popup",
			subcategory: "behavior"
		},
		enable_stream_download: {
			name: "Enable downloading HLS/DASH streams",
			description: "Downloads and muxes the contents of the streams rather than the stream information file.\nThis currently does not work under modern browsers due to `SharedArrayBuffer` restrictions.",
			requires: {
				_condition: "action:popup",
				mouseover_allow_hlsdash: true
			},
			hidden: !has_ffmpeg_lib,
			category: "popup",
			subcategory: "video"
		},
		stream_mux_mp4_over_mkv: {
			name: "Prefer MP4 over MKV",
			description: "Tries to mux the video into mp4 instead of mkv when required. This may slightly slow down muxing as it currently needs to try muxing both.",
			requires: {
				enable_stream_download: true
			},
			hidden: !has_ffmpeg_lib,
			category: "popup",
			subcategory: "video"
		},
		mouseover_add_link: {
			name: "Link image",
			description: "Adds a link to the image in the popup",
			requires: "action:popup",
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_add_video_link: {
			name: "Link video",
			description: "Adds a link to the video in the popup",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true
			},
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_click_image_close: {
			name: "Clicking image closes",
			description: "Clicking the popup image closes the popup",
			requires: "action:popup",
			disabled_if: [
				{ mouseover_add_link: true },
				{ mouseover_clickthrough: true }
			],
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_click_video_close: {
			name: "Clicking video closes",
			description: "Clicking the popup video closes the popup",
			requires: "action:popup",
			disabled_if: [
				{ mouseover_add_video_link: true },
				{ mouseover_clickthrough: true }
			],
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_download: {
			name: "Clicking link downloads",
			description: "Instead of opening the link in a new tab, it will download the image/video instead",
			requires: [
				{
					_condition: "action:popup",
					mouseover_add_link: true
				},
				{
					_condition: "action:popup",
					mouseover_add_video_link: true
				},
			],
			category: "popup",
			subcategory: "behavior"
		},
		mouseover_close_key: {
			name: "Close key",
			description: "Closes the popup when this key is pressed. Currently, ESC will also close the popup regardless of the value of this setting.",
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_download_key: {
			name: "Download key",
			description: "Downloads the image in the popup when this key is pressed",
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_open_new_tab_key: {
			name: "Open in new tab key",
			description: "Opens the image in the popup in a new tab when this key is pressed",
			hidden: is_userscript && open_in_tab === common_functions["nullfunc"],
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_open_bg_tab_key: {
			name: "Open in background tab key",
			description: "Opens the image in the popup in a new tab without switching to it when this key is pressed",
			hidden: is_userscript && open_in_tab === common_functions["nullfunc"],
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_copy_link_key: {
			name: "Copy link key",
			description: "Copies the link of the media to the clipboard when this key is pressed",
			requires: {
				_condition: "action:popup",
				write_to_clipboard: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_open_options_key: {
			name: "Open options key",
			description: "Opens this page in a new tab when this key is pressed",
			hidden: is_userscript && open_in_tab === common_functions["nullfunc"],
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_open_orig_page_key: {
			name: "Open original page key",
			description: "Opens the original page (if available) when this key is pressed",
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_rotate_left_key: {
			name: "Rotate left key",
			description: "Rotates the popup 90 degrees to the left",
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_rotate_right_key: {
			name: "Rotate right key",
			description: "Rotates the popup 90 degrees to the right",
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_flip_horizontal_key: {
			name: "Horizontal flip key",
			description: "Flips the image horizontally",
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_flip_vertical_key: {
			name: "Vertical flip key",
			description: "Flips the image vertically",
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_zoom_in_key: {
			name: "Zoom in key",
			description: "Incrementally zooms into the image",
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_zoom_out_key: {
			name: "Zoom out key",
			description: "Incrementally zooms out of the image",
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_zoom_full_key: {
			name: "Full zoom key",
			description: "Sets the image to be at a 100% zoom, even if it overflows the screen",
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_zoom_fit_key: {
			name: "Fit screen key",
			description: "Sets the image to either be at a 100% zoom, or to fit the screen, whichever is smaller",
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		mouseover_fullscreen_key: {
			name: "Toggle fullscreen key",
			description: "Toggles fullscreen mode for the image/video in the popup",
			requires: "action:popup",
			type: "keysequence",
			category: "keybinds",
			subcategory: "popup"
		},
		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: "source"
		},
		mouseover_only_valid_links: {
			name: "Only for links that look valid",
			description: "Enabling this option will only allow links to be popped up if they look valid (such as if they have a known image/video extension, or are explicitly supported)",
			requires: {
				mouseover_links: true
			},
			category: "popup",
			subcategory: "source"
		},
		mouseover_allow_video: {
			name: "Enable videos",
			description: "Allows videos to be popped up",
			profiled: true,
			category: "popup",
			subcategory: "video"
		},
		mouseover_allow_audio: {
			name: "Enable audio",
			description: "Allows audio to be popped up. Currently experimental.\nThis only applies to audio files. Videos that contains audio are supported regardless of this setting.",
			profiled: true,
			category: "popup",
			subcategory: "video"
		},
		mouseover_allow_hlsdash: {
			name: "Allow HLS/DASH streams",
			description: "Allows playback of HLS/DASH streams",
			example_websites: [
				"Dailymotion",
				"Instagram (higher quality)",
				"Reddit",
				"YouTube (higher quality)"
			],
			requires: [
				{
					mouseover_allow_audio: true,
					allow_thirdparty_libs: true
				},
				{
					mouseover_allow_video: true,
					allow_thirdparty_libs: true
				}
			],
			// thanks to fedesk on discord for the idea to make this profiled
			profiled: true,
			category: "popup",
			subcategory: "video"
		},
		mouseover_allow_self_pagelink: {
			name: "Popup page URL",
			description: "If no element can be found, try the page URL. Only relevant for pagelink rules, such as image and video hosting websites",
			requires: {
				mouseover: true,
				mouseover_trigger_behavior: "keyboard"
			},
			category: "popup",
			subcategory: "source"
		},
		mouseover_allow_iframe_el: {
			name: "Popup for `<iframe>`",
			description: "Allows `<iframe>` elements to be popped up as well. Storing images/videos in this way is rather uncommon, but it can allow embeds to be supported",
			requires: {
				mouseover_links: true
			},
			category: "popup",
			subcategory: "source"
		},
		mouseover_allow_canvas_el: {
			name: "Popup for `<canvas>`",
			description: "Allows `<canvas>` elements to be popped up as well. This will likely cause popups with any kind of web-based games, so it's recommended to keep this disabled",
			requires: {
				mouseover: true
			},
			category: "popup",
			subcategory: "source"
		},
		mouseover_allow_svg_el: {
			name: "Popup for `<svg>`",
			description: "Allows `<svg>` elements to be popped up as well. These are usually used for icons, and can occasionally cause problems for websites that overlay icons on top of images",
			requires: {
				mouseover: true
			},
			category: "popup",
			subcategory: "source"
		},
		mouseover_enable_gallery: {
			name: "Enable gallery",
			description: "Toggles whether gallery detection support should be enabled",
			requires: "action:popup",
			category: "popup",
			subcategory: "gallery"
		},
		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: {
				_condition: "action:popup",
				mouseover_enable_gallery: true
			},
			category: "popup",
			subcategory: "gallery"
		},
		mouseover_gallery_prev_key: {
			name: "Previous gallery item",
			description: "Key to trigger the previous gallery item",
			requires: {
				_condition: "action:popup",
				mouseover_enable_gallery: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "gallery"
		},
		mouseover_gallery_next_key: {
			name: "Next gallery item",
			description: "Key to trigger the next gallery item",
			requires: {
				_condition: "action:popup",
				mouseover_enable_gallery: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "gallery"
		},
		mouseover_gallery_download_key: {
			name: "Gallery download key",
			description: "Key to download the current gallery",
			requires: {
				_condition: "action:popup",
				mouseover_enable_gallery: true,
				allow_thirdparty_libs: true
			},
			type: "keysequence",
			category: "keybinds",
			subcategory: "gallery"
		},
		gallery_download_method: {
			name: "Download method",
			description: "How the gallery should be downloaded",
			requires: {
				_condition: "action:popup",
				mouseover_enable_gallery: true
			},
			options: {
				_type: "combo",
				"zip": {
					name: "Zip file"
				},
				"jdownloader": {
					// we should probably tell the user to temporarily disable "LinkCollector: Do Link Check" (Advanced Settings)
					// we already check for this, and jdownloader is much slower to check (one at a time)
					name: "JDownloader"
				}
			},
			category: "popup",
			subcategory: "gallery"
		},
		gallery_download_unchanged: {
			name: "Download unchanged media",
			description: "Includes gallery items that have not been changed. Useful to potentially avoid downloading thumbnails",
			requires: {
				_condition: "action:popup",
				mouseover_enable_gallery: true
			},
			category: "popup",
			subcategory: "gallery"
		},
		gallery_zip_filename_format: {
			name: "Directory/zip filename format",
			description: [
				"Format string(s) for the directory (package name for JDownloader) and zip filename (if applicable).",
				"Refer to \"Filename format\" under the Rules section for documentation. The variables are set from the first loaded media.",
				"An additional `items_amt` format variable is supported, which contains the number of items.",
				"`.zip` will be automatically suffixed for zip filenames."
			].join("\n"),
			requires: {
				_condition: "action:popup",
				mouseover_enable_gallery: true
			},
			type: "textarea",
			category: "popup",
			subcategory: "gallery"
		},
		gallery_zip_add_tld: {
			name: "Zip: Store in subdirectory",
			description: "Stores the files in a subdirectory with the same name as the .zip file (without the .zip extension)",
			requires: {
				_condition: "action:popup",
				mouseover_enable_gallery: true,
				gallery_download_method: "zip"
			},
			category: "popup",
			subcategory: "gallery"
		},
		gallery_jd_autostart: {
			name: "JD: Autostart",
			description: "Autostarts the download when added to JDownloader",
			requires: {
				gallery_download_method: "jdownloader"
			},
			category: "popup",
			subcategory: "gallery"
		},
		gallery_jd_referer: {
			name: "JD: Referer policy",
			description: "Due to a current limitation in JDownloader's API, the `Referer` (sic) header can only be set on a per-package basis. This option allows working around it by submitting multiple packages with the same name using different Referer headers. This can result in JD spamming notifications due to the number of packages created.",
			requires: {
				gallery_download_method: "jdownloader"
			},
			options: {
				_type: "combo",
				"never": {
					name: "Never"
				},
				"domain": {
					name: "Per-domain"
				},
				"always": {
					name: "Always"
				}
			},
			category: "popup",
			subcategory: "gallery"
		},
		gallery_zip_add_info_file: {
			name: "Zip: Store info file",
			description: "Stores a `info.txt` file in the .zip containing information about the downloaded files and host page.",
			requires: {
				_condition: "action:popup",
				mouseover_enable_gallery: true,
				gallery_download_method: "zip"
			},
			category: "popup",
			subcategory: "gallery"
		},
		mouseover_gallery_move_after_video: {
			name: "Move to next when video finishes",
			description: "Moves to the next gallery item when a video finishes playing",
			requires: {
				_condition: "action:popup",
				mouseover_allow_video: true,
				mouseover_enable_gallery: true
			},
			category: "popup",
			subcategory: "gallery"
		},
		mouseover_styles: {
			name: "Popup CSS style",
			description: "Custom CSS styles for the popup",
			documentation: {
				title: "Documentation",
				value: [
					"Most valid CSS is supported, with these differences:",
					"<ul><li>Multiline comments (<code>/* ... */</code>) are currently not supported</li>",
					"<li>Single comments (<code>// ...</code>) are supported, but only at the beginning of a line</li>",
					"<li><code>%thumburl%</code> is the URL of the thumbnail image. For example, you could use it like this: <code>background-image: url(%thumburl%)</code><br />",
					"The URL is properly encoded, so quotes are not necessary (but not harmful either)</li>",
					"<li><code>%fullurl%</code> is the URL of the full image. If IMU fails to find a larger image, it will be the same as <code>%thumburl%</code></li>",
					"<li>Styles are <code>!important</code> by default</li></ul>",
					"<p>For Button CSS style, you can also customize the CSS for individual buttons through their IDs. For example:</p>",
					"<pre>",
					"#closebtn {",
					"  background-color: red;",
					"  // -imu-text allows you to set the text inside the button",
					"  -imu-text: \"Close\";",
					"  // -imu-title allows you to set the tooltip when hovering",
					"  -imu-title: \"Close the popup\";",
					"}",
					"#galleryprevbtn, #gallerynextbtn {",
					"  border-radius: 100px;",
					"}",
					"</pre>"
				].join("\n")
			},
			type: "textarea",
			requires: "action:popup",
			category: "popup",
			subcategory: "popup_other"
		},
		mouseover_enable_fade: {
			name: "Enable popup fade",
			description: "Enables a fade in/out effect when the popup is opened/closed",
			requires: "action:popup",
			category: "popup",
			subcategory: "popup_other"
		},
		mouseover_enable_zoom_effect: {
			name: "Enable zoom effect",
			description: "Toggles whether the popup should 'zoom' when opened/closed",
			requires: "action:popup",
			category: "popup",
			subcategory: "popup_other"
		},
		mouseover_zoom_effect_move: {
			name: "Move from thumbnail when zooming",
			description: "Moves the popup from the thumbnail to the final location while zooming. The animation can be a little rough",
			requires: {
				mouseover_enable_zoom_effect: true
			},
			category: "popup",
			subcategory: "popup_other"
		},
		mouseover_fade_time: {
			name: "Popup animation time",
			description: "Fade/zoom animation duration (in milliseconds) for the popup",
			requires: [
				{ mouseover_enable_fade: true },
				{ mouseover_enable_zoom_effect: true }
			],
			type: "number",
			number_min: 0,
			number_unit: "ms",
			category: "popup",
			subcategory: "popup_other"
		},
		mouseover_enable_mask_styles2: {
			name: "Enable background CSS",
			description: "Toggles whether CSS styles for the background when the popup is active is enabled",
			requires: "action:popup",
			options: {
				"always": {
					name: "Always"
				},
				"hold": {
					name: "On hold"
				},
				"never": {
					name: "No"
				}
			},
			category: "popup",
			subcategory: "popup_other"
		},
		mouseover_mask_styles2: {
			name: "Background CSS style",
			description: "CSS style for the background when the popup is active. See the documentation for Popup CSS style for more information (the thumb/full URL variables aren't supported here)",
			requires: [
				{ mouseover_enable_mask_styles2: "always" },
				{ mouseover_enable_mask_styles2: "hold" }
			],
			type: "textarea",
			category: "popup",
			subcategory: "popup_other"
		},
		mouseover_mask_fade_time: {
			name: "Background fade",
			description: "Fade in/out time (in milliseconds) for the page background, set to 0 to disable",
			requires: [
				{ mouseover_enable_mask_styles2: "always" },
				{ mouseover_enable_mask_styles2: "hold" }
			],
			type: "number",
			number_min: 0,
			number_unit: "ms",
			category: "popup",
			subcategory: "popup_other"
		},
		mouseover_ui_styles: {
			name: "Button CSS style",
			description: "Custom CSS styles for the popup's UI buttons. See the documentation for Popup CSS style for more information (the thumb/full URL variables aren't supported here)",
			type: "textarea",
			requires: {
				_condition: "action:popup",
				mouseover_ui: true
			},
			category: "popup",
			subcategory: "ui"
		},
		mouseover_apply_blacklist: {
			name: "Don't popup blacklisted URLs",
			description: "This option popping up for source media with blacklisted URLs. If this is disabled, the popup will open if the end URL isn't blacklisted, regardless of whether the source is blacklisted.",
			requires: {
				mouseover: true
			},
			category: "popup",
			subcategory: "source"
		},
		apply_blacklist_host: {
			name: "Use media blacklist for host websites",
			description: "Overrides the host blacklist to use the media blacklist (specified under Rules)",
			category: "popup",
			subcategory: "source"
		},
		mouseover_matching_media_types: {
			name: "Don't popup different media type",
			description: "This option prevents the popup from loading a video when the source was an image or vice-versa",
			requires: {
				mouseover: true,
				mouseover_allow_video: true
			},
			category: "popup",
			subcategory: "source"
		},
		mouseover_allow_popup_when_fullscreen: {
			name: "Allow popup when fullscreen",
			description: "Allows the popup to open if an element (such as a video player) is fullscreen.",
			requires: {
				mouseover: true
			},
			category: "popup",
			subcategory: "source"
		},
		mouseover_support_pointerevents_none: {
			name: "Support `pointer-events:none`",
			description: "Manually looks through every element on the page to see if the cursor is beneath them. Supports more images, but also results in a higher CPU load for websites such as Facebook.",
			requires: {
				mouseover: true
			},
			//advanced: true, // Commenting this out because the option is important
			category: "popup",
			subcategory: "source"
		},
		mouseover_find_els_mode: {
			name: "Element finding mode",
			description: "How IMU should find the media element on the page.",
			requires: {
				mouseover: true
			},
			options: {
				full: {
					name: "Full",
					description: "Manually looks through every element on the page to see if the cursor is above them. This will result in a higher CPU load for websites such as Facebook, and may return the wrong element"
				},
				hybrid: {
					name: "Hybrid",
					description: "Looks manually through every child element of the last element found by `getElementsAtPoint`. Use this option if in doubt, it'll work on most sites"
				},
				simple: {
					name: "Simple",
					description: "This is the fastest option, which uses the value of `getElementsAtPoint` without modification. Works for sites that don't use pointer-events:none and shadow DOM"
				}
			},
			warning: {
				"full": "This will result in a much higher CPU load for websites such as Facebook, and will occasionally return the wrong element.\nUse this option with caution."
			},
			//advanced: true, // Commenting this out because the option is important
			category: "popup",
			subcategory: "source"
		},
		popup_allow_cache: {
			name: "Use cache",
			description: "Allows use of a media cache for the popup. The cache is currently stored per-page and is not persistent across page reloads.",
			requires: "action:popup",
			category: "popup",
			subcategory: "cache"
		},
		popup_cache_duration: {
			name: "Cache duration",
			description: "How long for media to remain cached. Set to `0` for unlimited.",
			requires: {
				popup_allow_cache: true
			},
			type: "number",
			number_min: 0,
			number_unit: "minutes",
			category: "popup",
			subcategory: "cache"
		},
		popup_cache_itemlimit: {
			name: "Cache item limit",
			description: "Maximum number of individual media to remain cached. Set to `0` for unlimited.",
			requires: {
				popup_allow_cache: true
			},
			type: "number",
			number_min: 0,
			number_unit: "items",
			category: "popup",
			subcategory: "cache"
		},
		popup_cache_resume_video: {
			name: "Resume videos",
			description: "If a video popup was closed then reopened, the video will resume from where it left off",
			requires: {
				popup_allow_cache: true
			},
			category: "popup",
			subcategory: "cache"
		},
		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: "general",
			subcategory: "extension",
			imu_enabled_exempt: true
		},
		extension_hotreload: {
			name: "Hot (re)load",
			description: "(Re)loads the extension on all existing pages when installing or updating",
			extension_only: true,
			category: "general",
			subcategory: "extension",
			imu_enabled_exempt: true
		},
		custom_xhr_for_lib: {
			name: "Custom XHR for libraries",
			description: "Allows the use of more powerful XHR (network requests) for 3rd-party libraries. This allows for certain DASH streams to work.",
			description_userscript: "Allows the use of more powerful XHR  (network requests) for 3rd-party libraries. This allows for certain DASH streams to work. Using this with the userscript version currently poses a potential security risk.",
			category: "general",
			subcategory: "libraries",
			example_websites: [
				"Kakao",
				"YouTube",
				"Instagram (downloading)"
			],
			requires: {
				allow_thirdparty_libs: true
			},
			needrefresh: true // todo: clear the library cache (or only for xhr ones)
		},
		bypass_csp_for_lib: {
			name: "Bypass CSP for libraries",
			description: "Tries loading the 3rd-party libraries using a `<script>` tag if a page's CSP prevents it from being loaded normally.\nThis option currently carries an increased security risk when combined with \"Custom XHR for libraries\", and should only be enabled if absolutely necessary.",
			category: "general",
			subcategory: "libraries",
			userscript_only: true,
			requires: {
				allow_thirdparty_libs: true
			},
			example_websites: [
				"Snapchat"
			],
			warning: {
				"true": "This can potentially be extremely insecure if \"Custom XHR for libraries\" is also enabled.\nA malicious website could gain extension-level permissions and perform arbitrary requests (your online accounts could get hacked).\nIf you need to use this option, please disable it as soon as possible."
			},
			needrefresh: true // todo: clear the library cache (or only for xhr ones)
		},
		use_webarchive_for_lib: {
			name: "Use Web Archive for libraries",
			description: "Uses archive.org's web archive instead of github for libraries and other script internals (such as the options page).\nDon't enable this unless you need to.",
			userscript_only: true,
			category: "general",
			subcategory: "libraries"
		},
		lib_integrity_check: {
			name: "Enable integrity checks",
			description: "Runs integrity checks before loading 3rd-party libraries",
			userscript_only: true,
			category: "general",
			subcategory: "libraries"
		},
		hls_dash_use_max: {
			name: "HLS/DASH maximum quality",
			description: "Uses the maximum quality for HLS/DASH streams",
			requires: {
				mouseover_allow_hlsdash: true
			},
			category: "popup",
			subcategory: "video"
		},
		max_video_quality: {
			name: "Maximum video quality",
			description: "Maximum quality for videos",
			requires: {
				mouseover_allow_hlsdash: true // FIXME
			},
			options: {
				_type: "combo",
				"unlimited": {
					name: "(unlimited)",
					is_null: true
				},
				// h prefix is important to keep the order
				"h2160": {
					name: "4K"
				},
				"h1440": {
					name: "1440p"
				},
				"h1080": {
					name: "1080p"
				},
				"h720": {
					name: "720p"
				},
				"h480": {
					name: "480p"
				}
			},
			category: "popup",
			subcategory: "video"
		},
		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, usually due to server-side caching",
			category: "rules",
			onupdate: update_rule_setting
		},
		allow_possibly_broken: {
			name: "Possibly broken images",
			description: "Enables rules that return images that are possibly broken",
			category: "rules",
			hidden: true, // not currently used
			onupdate: update_rule_setting
		},
		allow_possibly_upscaled: {
			name: "Possibly upscaled images",
			description: "Enables rules that return images that are possibly upscaled",
			category: "rules",
			onupdate: update_rule_setting
		},
		allow_uncropped: {
			name: "Uncropped images",
			description: "Enables rules that return possibly undesirable uncropped images",
			example_websites: [
				"Mobile wallpaper websites (returns the full version of the wallpaper image)"
			],
			category: "rules",
			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: "Allow 3rd-party libraries",
			description: "Enables using 3rd-party libraries. This is both used in rules and as a prerequisite for certain functionality.",
			description_userscript: "Enables using 3rd-party libraries. This is both used in rules and as a prerequisite for certain functionality.\nThere is a possible (but unlikely) security risk for the userscript version.",
			category: "general",
			subcategory: "libraries",
			example_websites: [
				"Sites using testcookie (slowAES)"
			],
			onupdate: function() {
				update_rule_setting();
				real_api_cache.clear();
			}
		},
		allow_thirdparty_code: {
			name: "Rules executing 3rd-party code",
			description: "Enables rules that execute arbitrary 3rd-party code stored on websites.",
			warning: {
				"true": "This could lead to security risks, please be careful when using this option!"
			},
			category: "rules",
			onupdate: function() {
				update_rule_setting();
				real_api_cache.clear();
			},
			hidden: true // not currently used
		},
		allow_bruteforce: {
			name: "Rules using brute-force",
			description: "Enables rules that require using brute force (through binary search) to find the original image",
			warning: {
				"true": "This could lead to rate limiting or IP bans"
			},
			category: "rules",
			example_websites: [
				"Deezer"
			],
			onupdate: update_rule_setting
		},
		allow_webarchive: {
			name: "Web Archive support",
			description: "Allows rules to be run under archive.org's Wayback Machine.",
			category: "rules"
		},
		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,
			hidden: true,
			onupdate: update_rule_setting
		},
		deviantart_prefer_size: {
			name: "DeviantART: Prefer size over original",
			description: "Prefers a larger (but not upscaled) thumbnail image over a smaller original animated image",
			category: "rules",
			subcategory: "rule_specific",
			onupdate: update_rule_setting
		},
		deviantart_support_download: {
			name: "DeviantART: Use download links",
			description: "Prefers using the download link (if available) by default. Note that this only works if you're logged in to DeviantART",
			category: "rules",
			subcategory: "rule_specific",
			onupdate: update_rule_setting
		},
		ehentai_full_image: {
			name: "E-Hentai: Use full image",
			description: "Prefers using full/original images if available (logged in). This is more likely to get you rate limited",
			category: "rules",
			subcategory: "rule_specific",
			onupdate: update_rule_setting
		},
		imgur_filename: {
			name: "Imgur: Use original filename",
			description: "If the original filename (the one used to upload the image) is found, use it instead of the image ID",
			category: "rules",
			subcategory: "rule_specific",
			onupdate: update_rule_setting
		},
		imgur_source: {
			name: "Imgur: Use source image",
			description: "If a source image is found for Imgur, try using it instead. Only works for old-style Imgur webpages (set `postpagebeta=0; postpagebetalogged=0` as cookies)",
			category: "rules",
			subcategory: "rule_specific",
			onupdate: update_rule_setting
		},
		instagram_use_app_api: {
			name: "Instagram: Use native API",
			description: "Uses Instagram's native API if possible, requires you to be logged into Instagram. This usually allows for higher resolution images (1440x*) to be returned.",
			category: "rules",
			subcategory: "rule_specific",
			warning: {
			// no longer currently relevant as this option currently uses the web api, not currently aware of any bans
			// according to a user, this appears to happen if there are more than ~250 requests within 8-12 hours
			//"true": "As of a recent (May 2021) Instagram update, this option may flag your account when requesting too often.\nPlease consider using a backup account if enabling this option."
			},
			onupdate: update_rule_setting
		},
		instagram_dont_use_web: {
			name: "Instagram: Don't use web API",
			description: "Avoids using Instagram's web API if possible, which increases performance, but will occasionally sacrifice quality for videos",
			requires: [{ instagram_use_app_api: true }],
			category: "rules",
			subcategory: "rule_specific",
			onupdate: update_rule_setting
		},
		instagram_prefer_video_quality: {
			name: "Instagram: Prefer quality over resolution",
			description: "Prefers lower resolution videos that use a higher bitrate over higher resolution images. This adds a slight performance cost as it needs to fetch headers for multiple videos",
			category: "rules",
			subcategory: "rule_specific",
			onupdate: update_rule_setting
		},
		instagram_gallery_postlink: {
			name: "Instagram: Use albums for post thumbnails",
			description: "Queries Instagram for albums when using the popup on a post thumbnail",
			category: "rules",
			subcategory: "rule_specific"
		},
		snapchat_orig_media: {
			name: "Snapchat: Use original media without captions",
			description: "Prefers using original media instead of media with captions and tags overlayed",
			category: "rules",
			subcategory: "rule_specific"
		},
		teddit_redirect_reddit: {
			name: "Teddit: Use Reddit for media",
			description: "Redirects media stored on Teddit to Reddit's servers. Disabling this may prevent finding original images because Teddit's image servers will only cache images fetched from posts, which are deleted after a few minutes.",
			category: "rules",
			subcategory: "rule_specific",
			onupdate: update_rule_setting
		},
		tiktok_app_api: {
			name: "TikTok: Use app API",
			description: "Uses TikTok's app API to find video information.",
			category: "rules",
			subcategory: "rule_specific",
			onupdate: update_rule_setting
		},
		tiktok_no_watermarks: {
			name: "TikTok: Don't use watermarked videos",
			description: "Uses non-watermarked videos for TikTok if possible. This will introduce an extra delay when loading the video as two extra requests need to be performed. It will also fail for any videos uploaded after ~late July 2020",
			hidden: true,
			category: "rules",
			subcategory: "rule_specific",
			onupdate: update_rule_setting
		},
		tiktok_thirdparty: {
			name: "TikTok: 3rd-party watermark removal",
			description: "Uses a 3rd-party watermark removal site for TikTok.\nI do not endorse any of the sites supported. They may log your IP address and videos you submit. Use this option with caution.\n`LQ` = Low quality, `PL` = Public log",
			requires: [{
					allow_thirdparty: true
				}],
			hidden: true,
			options: {
				_type: "combo",
				_randomize: true,
				"null": {
					name: "(none)",
					is_null: true
				},
				"ttloader.com:ttt": {
					name: "ttloader.com"
				},
				"onlinetik.com:ttt": {
					name: "onlinetik.com"
				},
				"tikdowns.com:ttt": {
					name: "tikdowns.com"
				},
				"ssstiktok.net:ttt": {
					name: "ssstiktok.net"
				},
				// dead
				/*"tiktokdownloader.in:ttt": {
					name: "tiktokdownloader.in"
				},*/
				// dead
				/*"savevideo.ninja:ttt": {
					name: "savevideo.ninja"
				},*/
				// removing watermark doesn't work
				"keeptiktok.com": {
					name: "keeptiktok.com (LQ)"
				},
				"ssstiktok.io:1": {
					name: "ssstiktok.io (LQ)"
				},
				"musicallydown.com:1": {
					name: "musicallydown.com (LQ/PL)"
				},
				"snaptik.app": {
					name: "snaptik.app (LQ)"
				},
				"tikmate.online": {
					name: "tikmate.online (LQ)"
				}
			},
			category: "rules",
			subcategory: "rule_specific",
			onupdate: update_rule_setting
		},
		tumblr_api_key: {
			name: "Tumblr: API key",
			description: "API key for finding larger images on Tumblr",
			category: "rules",
			subcategory: "rule_specific",
			type: "lineedit",
			onupdate: update_rule_setting
		},
		twitter_use_ext: {
			name: "Twitter: Use extension",
			description: "Prefers `.jpg?name=orig` over `?format=jpg&name=orig`. This will possibly incur extra requests before succeeding. Note that there is no difference in image quality.",
			category: "rules",
			subcategory: "rule_specific",
			onupdate: update_rule_setting
		},
		youtube_replace_n: {
			name: "YouTube: Enable faster speeds",
			description: "Increases the download bandwidth for YouTube videos by replacing the `n` parameter. Note that this may execute untrusted Javascript.",
			requires: {
				allow_thirdparty_libs: true
			},
			category: "rules",
			subcategory: "rule_specific",
			onupdate: update_rule_setting
		},
		bigimage_blacklist: {
			name: "Media blacklist",
			description: "A list of URLs (one per line) that are blacklisted from being processed",
			category: "rules",
			type: "textarea"
		},
		bigimage_blacklist_mode: {
			name: "Media blacklist mode",
			description: "Whether the media blacklist should act as a blacklist or a whitelist",
			category: "rules",
			options: {
				whitelist: {
					name: "Whitelist"
				},
				blacklist: {
					name: "Blacklist"
				}
			}
		},
		bigimage_blacklist_engine: {
			name: "Blacklist engine",
			description: "How blacklists should be processed",
			category: "general",
			options: {
				glob: {
					name: "Simple (glob)"
				},
				regex: {
					name: "Regex"
				}
			}
		},
		host_blacklist: {
			name: "Host blacklist",
			description: "A list of host URLs (one per line) that the popup is blacklisted from. For example, adding `twitter.com` to this blacklist would prevent any popup from opening on twitter.com.",
			type: "textarea",
			requires: {
				mouseover: true,
				apply_blacklist_host: false
			},
			category: "popup",
			subcategory: "source"
		},
		host_blacklist_mode: {
			name: "Host blacklist mode",
			description: "Whether the host blacklist should act as a blacklist or a whitelist",
			category: "popup",
			subcategory: "source",
			options: {
				whitelist: {
					name: "Whitelist"
				},
				blacklist: {
					name: "Blacklist"
				}
			}
		},
		host_html_blacklist: {
			name: "HTML page blacklist",
			description: "A list of URLs (one per line) that are blacklisted from being redirected.",
			requires: {
				redirect: true,
				redirect_host_html: true
			},
			category: "redirection",
			type: "textarea",
			advanced: true
		},
		host_html_blacklist_mode: {
			name: "HTML page blacklist mode",
			description: "Whether the HTML page blacklist should act as a blacklist or a whitelist",
			requires: {
				redirect: true,
				redirect_host_html: true
			},
			category: "redirection",
			options: {
				whitelist: {
					name: "Whitelist"
				},
				blacklist: {
					name: "Blacklist"
				}
			},
			advanced: true
		},
		filename_format: {
			name: "Filename format",
			description: "Format string(s) for the filename",
			type: "textarea",
			category: "rules",
			documentation: {
				title: "Documentation",
				value: [
					"<p>Variables are specified between curly brackets (<code>{}</code>).</p>",
					"<p>Below is a list of valid variables:</p>",
					"<ul><br />",
					"<li><code>filename</code> - Original filename (with extension, if applicable)</li>",
					"<li><code>filename_noext</code> - Original filename (without extension, if applicable)</li>",
					"<li><code>ext</code> - Extension (with <code>.</code> prefixed)</li>",
					"<li><code>caption</code> - Popup caption</li>",
					"<li><code>author_username</code> - Author's username</li>",
					"<li><code>id</code> - Post ID</li>",
					"<li><code>host_title</code> - Title of the current tab/window</li>",
					"<li><code>host_url</code> - URL of the host webpage</li>",
					"<li><code>host_domain</code> - Domain of the host webpage</li>",
					"<li><code>host_domain_nosub</code> - Domain (without subdomains) of the host webpage</li>",
					"<li><code>url</code> - URL of the media</li>",
					"<li><code>domain</code> - Domain of the media</li>",
					"<li><code>domain_nosub</code> - Domain (without subdomains) of the media</li>",
					"<li><code>is_screenshot</code> - Blank, the line will only be processed when screenshotting a video</li>",
					"<li><code>prefix</code>, <code>suffix</code> - Blank by default, these variables will be automatically prefixed/suffixed to the filename if set using <code>:=</code></li>",
					"<li><code>created_...</code> - Created date (see note on Date objects below)</li>",
					"<li><code>updated_...</code> - Updated date, this will use the <code>Last-Modified</code> header if not otherwise specified by the rule (see note on Date objects below)</li>",
					"<li><code>download_...</code> - Download date (see note on Date objects below)</li>",
					"<li><code>date_...</code> - Created/updated date (see note on Date objects below)</li>",
					"</ul><br />",
					"<p>You can truncate the value of a variable by adding <code>:(number)</code> before the end bracket (<code>}</code>). For example:</p>",
					"<ul><br />",
					"<li><code>{caption:10}</code> - Truncates the caption to be at most 10 characters long</li>",
					"<li><code>{caption:10.}</code> - Same, but will add an ellipsis (\u2026) if the caption was truncated</li>",
					"</ul><br />",
					"<p>If a variable doesn't exist, by default it will ignore the current format string and use the one on the next line, unless <code>?</code> is added before the end bracket. For example:</p>",
					"<ul><br />",
					"<li><code>{ext?}</code> - Will be replaced with nothing if <code>ext</code> doesn't exist</li>",
					"<li><code>{caption?no caption}</code> - Will be replaced with <code>no caption</code> if <code>caption</code> doesn't exist</li>",
					"</ul><br />",
					"<p>You can check for equality and inequality with <code>==</code> and <code>!=</code> operators respectively. For example:</p>",
					"<ul><br />",
					"<li><code>{domain_nosub==cdninstagram.com}{author_username} {id}</code> - Will only run the current format (<code>{author_username} {id}</code> in this case) if the domain is cdninstagram.com</li>",
					"</ul><br />",
					"<p>You can check if a variable contains a string with <code>/=</code> (<code>!/=</code> for the opposite). It also supports two flags, <code>r</code> (regex) and <code>c</code> (case-sensitive), if added between <code>/</code> and <code>=</code>. For example:</p>",
					"<ul><br />",
					"<li><code>{domain/=instagram}{id}</code> - Will only run the current format (<code>{id}</code>) if the domain contains <code>instagram</code></li>",
					"<li><code>{domain!/=instagram}{id}</code> - Likewise, but only if the domain does not contain <code>instagram</code></li>",
					"<li><code>{domain/r=inst.*ram}{id}</code> - Likewise, but only if the domain matches the regex <code>inst.*ram</code></li>",
					"<li><code>{window_title/c=Instagram}{id}</code> - Likewise, but only if the window's title contains <code>Instagram</code> (case-sensitively)</li>",
					"<li><code>{window_title!/rc=Inst.*ram}{id}</code> - Likewise, but only if the window's title does not match the case-sensitive regex <code>Inst.*ram</code></li>",
					"</ul><br />",
					"<p>You can set a custom variable with <code>:=</code>. For example:</p>",
					"<ul><br />",
					"<li><code>{domain_nosub==cdninstagram.com}{foo:=bar}</code> - Sets the variable <code>foo</code> to <code>bar</code> if the domain is <code>cdninstagram.com</code>. The variable can then be accessed with e.g. <code>{foo}</code></li>",
					"</ul><br />",
					"<p>Date objects are accessible through a number of properties. Each property can be suffixed with <code>_utc</code> to get the UTC/GMT equivalent.</p>",
					"<ul><br />",
					"<li><code>..._iso</code> - Date in ISO format (e.g. <code>2019-12-31T23-30-56</code>). Note that <code>:</code> is replaced with <code>-</code> to avoid issues with paths under NTFS.</li>",
					"<li><code>..._ago</code> - Human-readable representation of the time elapsed since the date (e.g. <code>1 year and 10 months ago</code>, <code>5 months and 20 days ago</code>)</li>",
					"<li><code>..._unix</code> - Unix timestamp (e.g. <code>1577912345</code>)</li>",
					"<li><code>..._unix_ms</code> - Unix timestamp with millisecond accuracy (e.g. <code>1577912345678</code>)</li>",
					"<li><code>..._yyyymmdd</code> - Date in YYYYMMDD format (e.g. <code>20191230</code>)</li>",
					"<li><code>..._hhmmss</code> - Time in HHMMSS format (e.g. <code>233056</code>)</li>",
					"<li><code>..._year</code> - Full year (e.g. <code>2019</code>)</li>",
					"<li><code>..._month</code> - Zero-padded month (e.g. <code>12</code>)</li>",
					"<li><code>..._day</code> - Zero-padded day (e.g. <code>31</code>)</li>",
					"<li><code>..._hours</code> - Zero-padded hours in military/24-hour format (e.g. <code>23</code>)</li>",
					"<li><code>..._minutes</code> - Zero-padded minutes (e.g. <code>30</code>)</li>",
					"<li><code>..._seconds</code> - Zero-padded seconds (e.g. <code>56</code>)</li>",
					"</ul>"
				].join("\n")
			}
		},
		filename_replace_special_underscores: {
			name: "Replace special characters with underscores",
			description: "Replaces characters such as `/` or `\"` with `_` when downloading. Note that browsers will usually do this automatically, this is just to ensure consistent behavior.",
			category: "rules"
		},
		replaceimgs_enable_keybinding: {
			name: "Enable trigger key",
			description: "Enables the use of the trigger key to run it without needing to use the menu",
			category: "extra",
			subcategory: "replaceimages",
		},
		replaceimgs_keybinding: {
			name: "Trigger key",
			description: "Trigger keybinding that will run the Replace Images function",
			requires: {
				replaceimgs_enable_keybinding: true
			},
			type: "keysequence",
			category: "extra",
			subcategory: "replaceimages"
		},
		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. Disabling this may improve compatibility with some bulk image downloader extensions",
			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_delay: {
			name: "Delay between same-domain images",
			description: "New requests for images in the same domain will be delayed by this amount of seconds. Useful for avoiding rate limits.",
			type: "number",
			number_min: 0,
			number_unit: "seconds",
			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 replaced media 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
		},
		replaceimgs_plainlinks: {
			name: "Plain hyperlinks",
			description: "How to treat plain (non-media) hyperlinks that link to potential media",
			category: "extra",
			subcategory: "replaceimages",
			options: {
				_type: "combo",
				none: {
					name: "Ignore"
				},
				// todo: replace_link?
				replace_link_text: {
					name: "Replace link+text"
				},
				replace_media: {
					name: "Replace media"
				}
				// the lack of replace_link_media is intentional, as replaceimgs_addlinks covers this already
			},
			requires: {
				// is this correct?
				replaceimgs_replaceimgs: true
			},
			imu_enabled_exempt: true
		},
		replaceimgs_links_newtab: {
			name: "Links open in new tab",
			description: "Clicking on a replaced link will open the media in a new tab",
			category: "extra",
			subcategory: "replaceimages",
			requires: {
				replaceimgs_addlinks: true
			},
			imu_enabled_exempt: true
		},
		replaceimgs_remove_size_constraints: {
			name: "Remove size constraints",
			description: "Removes height/width specifiers for replaced media",
			category: "extra",
			subcategory: "replaceimages",
			requires: {
				replaceimgs_replaceimgs: true
			},
			imu_enabled_exempt: true
		},
		replaceimgs_size_constraints: {
			name: "Size constraints",
			description: "Removes or enforces height/width specifiers for replaced media",
			category: "extra",
			subcategory: "replaceimages",
			requires: {
				replaceimgs_replaceimgs: true
			},
			options: {
				_type: "combo",
				none: {
					name: "Ignore"
				},
				remove: {
					name: "Remove"
				},
				force: {
					name: "Force"
				}
			},
			imu_enabled_exempt: true
		},
		replaceimgs_css: {
			name: "Replacement CSS",
			description: "CSS styles to apply to replaced media. See the documentation for Popup CSS style for more information (the thumb/full URL variables aren't yet supported here)",
			type: "textarea",
			category: "extra",
			subcategory: "replaceimages",
			requires: {
				replaceimgs_replaceimgs: true
			},
			imu_enabled_exempt: true
		},
		replaceimgs_simple_progress: {
			name: "Simple progress",
			description: "Uses a simpler progress bar that has a fixed size for all media. This is useful to see how many images are replaced, rather than the ETA",
			category: "extra",
			subcategory: "replaceimages",
			imu_enabled_exempt: true
		},
		highlightimgs_enable_keybinding: {
			name: "Enable trigger key",
			description: "Enables the use of the trigger key to run it without needing to use the menu",
			category: "extra",
			subcategory: "highlightimages",
		},
		highlightimgs_keybinding: {
			name: "Trigger key",
			description: "Trigger keybinding that will run the Highlight Images function",
			requires: {
				highlightimgs_enable_keybinding: true
			},
			type: "keysequence",
			category: "extra",
			subcategory: "highlightimages"
		},
		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. See the documentation for Popup CSS style for more information (the thumb/full URL variables aren't supported here)",
			type: "textarea",
			requires: [
				{ highlightimgs_enable: true },
				{ highlightimgs_auto: "always" },
				{ highlightimgs_auto: "hover" }
			],
			category: "extra",
			subcategory: "highlightimages",
			imu_enabled_exempt: true
		},
		customgallery_enable_keybinding: {
			name: "Enable trigger key",
			description: "Enables the use of the trigger key to run it without needing to use the menu",
			category: "extra",
			subcategory: "customgallery",
		},
		customgallery_keybinding: {
			name: "Trigger key",
			description: "Trigger keybinding that will run the Custom Gallery function",
			requires: {
				customgallery_enable_keybinding: true
			},
			type: "keysequence",
			category: "extra",
			subcategory: "customgallery"
		},
		customgallery_enable_button: {
			name: "Enable button",
			description: "Enables the 'Custom Gallery' button",
			category: "extra",
			subcategory: "customgallery",
			imu_enabled_exempt: true
		},
		customgallery_apply_key: {
			name: "Apply key",
			description: "Triggers the gallery when pressed",
			requires: [
				{ customgallery_enable_button: true },
				{ customgallery_enable_keybinding: true }
			],
			type: "keysequence",
			category: "extra",
			subcategory: "customgallery",
			imu_enabled_exempt: true
		},
		customgallery_bg_css: {
			name: "Background CSS",
			description: "CSS style to apply for the background",
			type: "textarea",
			requires: [
				{ customgallery_enable_button: true },
				{ customgallery_enable_keybinding: true }
			],
			category: "extra",
			subcategory: "customgallery",
			imu_enabled_exempt: true
		},
		customgallery_outline_css: {
			name: "Outline CSS",
			description: "CSS style to apply for element outlines",
			type: "textarea",
			requires: [
				{ customgallery_enable_button: true },
				{ customgallery_enable_keybinding: true }
			],
			category: "extra",
			subcategory: "customgallery",
			imu_enabled_exempt: true
		},
	};
	var option_to_problems = {
		allow_watermark: "watermark",
		allow_smaller: "smaller",
		allow_possibly_different: "possibly_different",
		allow_possibly_broken: "possibly_broken",
		allow_possibly_upscaled: "possibly_upscaled",
		allow_bruteforce: "bruteforce",
		allow_uncropped: "uncropped"
	};
	var categories = {
		"general": "General",
		"redirection": "Redirection",
		"popup": "Popup",
		"keybinds": "Shortcuts",
		"rules": "Rules",
		"website": "Website",
		"extra": "Buttons"
	};
	var subcategories = {
		"general": {
			"settings": "subcategory_settings",
			"update": "subcategory_update",
			"libraries": "subcategory_libraries",
			"extension": "subcategory_extension"
		},
		"popup": {
			"trigger": "subcategory_trigger",
			"source": "subcategory_popup_source",
			"open_behavior": "subcategory_open_behavior",
			"close_behavior": "subcategory_close_behavior",
			"behavior": "subcategory_behavior",
			"cache": "subcategory_cache",
			"gallery": "subcategory_gallery",
			"video": "subcategory_video",
			"ui": "subcategory_ui",
			"popup_other": "subcategory_popup_other"
		},
		"keybinds": {
			"popup": "subcategory_keybinds_popup_actions",
			"gallery": "subcategory_gallery",
			"video": "subcategory_video"
		},
		"rules": {
			"rule_specific": "subcategory_rule_specific"
		},
		"extra": {
			"replaceimages": "subcategory_replaceimages",
			"highlightimages": "subcategory_highlightimages",
			"customgallery": "subcategory_customgallery"
		}
	};
	var settings_conditions = {
		"action:popup": {
			"mouseover_open_behavior": "popup"
		}
	};
	// this is horrible, a better solution would be to just have a settings_list object and iterate over that instead
	var obj_insertafter = function(obj, oldkey, newkey, value) {
		var newobj = {};
		for (var key in obj) {
			newobj[key] = obj[key];
			if (key === oldkey) {
				newobj[newkey] = value;
			}
		}
		return newobj;
	};
	// populate profiled settings
	(function() {
		for (var setting in settings_meta) {
			var orig_meta = settings_meta[setting];
			if (!orig_meta.profiled)
				continue;
			var default_value = settings[setting];
			for (var i = 0; i < num_profiles; i++) {
				var trigger_id = i + 2;
				var profiled_setting_name = "t" + trigger_id + "_" + setting;
				var setting_before = setting;
				if (i > 0) {
					setting_before = "t" + (trigger_id - 1) + "_" + setting;
				}
				settings = obj_insertafter(settings, setting_before, profiled_setting_name, default_value);
				var profiled_meta = deepcopy(orig_meta);
				settings_meta[profiled_setting_name] = profiled_meta;
				if (is_interactive) {
					profiled_meta.name = _(profiled_meta.name) + " (#" + trigger_id + ")";
					profiled_meta.description = null;
					profiled_meta.example_websites = null;
				}
				if (profiled_meta.requires) {
					var requires = profiled_meta.requires;
					if (!is_array(requires))
						requires = [requires];
					array_foreach(requires, function(srequire) {
						srequire["mouseover_trigger_key_t" + trigger_id] = true;
					});
					profiled_meta.requires = requires;
				}
			}
		}
	})();
	var blacklist_settings = {
		bigimage_blacklist: {
			create_regexes: function() { return create_blacklist_regexes(); }
		},
		host_blacklist: {
			create_regexes: function() { return create_host_blacklist_regexes(); }
		},
		host_html_blacklist: {
			create_regexes: function() { return create_host_html_blacklist_regexes(); }
		}
	};
	var _loop_1 = function(bl) {
		settings_meta[bl].onupdate = function() {
			update_rule_setting();
			blacklist_settings[bl].create_regexes();
		};
		settings_meta[bl].onedit = function() {
			var errors = blacklist_settings[bl].create_regexes();
			var errordiv = null;
			try {
				errordiv = document.querySelector("#option_" + bl + " .error");
				errordiv.innerText = "";
				errordiv.classList.add("hidden");
			} catch (e) {
			}
			if (errors) {
				for (var i = 0; i < errors.length; i++) {
					if (errordiv) {
						errordiv.innerText += errors[i].message + "\n";
						errordiv.classList.remove("hidden");
					}
					console.error(errors[i]);
				}
			}
		};
		settings_meta[bl].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")
		};
	};
	for (var bl in blacklist_settings) {
		_loop_1(bl);
	}
	var orig_settings = deepcopy(settings);
	for (var option in option_to_problems) {
		var problem = option_to_problems[option];
		settings[option] = array_indexof(default_options.exclude_problems, problem) < 0;
	}
	var settings_history = {};
	var new_map = function() {
		var map;
		var can_use_native_map = false;
		try {
			if (("entries" in Map.prototype) &&
				("set" in Map.prototype) &&
				("values" in Map.prototype)) {
				map = new Map();
				can_use_native_map = true;
			}
		} catch (e) { }
		if (!can_use_native_map) {
			map = {
				imu_map: true,
				object: {},
				array: []
			};
		}
		return map;
	};
	var _map_is_key_primitive = function(key) {
		return typeof key === "string" || typeof key === "number";
	};
	var _map_indexof = function(map, key) {
		for (var i = 0; i < map.array.length; i++) {
			if (map.array[i].key === key) {
				return i;
			}
		}
		return -1;
	};
	var _map_is_emu = function(map) {
		return !!map.imu_map;
	};
	var _map_set_native = function(map, key, value) {
		map.set(key, value);
	};
	var _map_set_emu = function(map, key, value) {
		if (_map_is_key_primitive(key)) {
			map.object[key] = value;
		} else {
			var index = _map_indexof(map, key);
			if (index < 0) {
				map.array.push({ key: key, value: value });
			} else {
				map.array[index].value = value;
			}
		}
	};
	var map_set = function(map, key, value) {
		if (_nir_debug_) nir_debug("map", "map_set", deepcopy(key), deepcopy(value));
		if (!_map_is_emu(map)) {
			_map_set_native(map, key, value);
		} else {
			_map_set_emu(map, key, value);
		}
		return value;
	};
	var _map_get_native = function(map, key) {
		return map.get(key);
	};
	var _map_get_emu = function(map, key) {
		if (_map_is_key_primitive(key)) {
			return map.object[key];
		} else {
			var index = _map_indexof(map, key);
			if (index >= 0) {
				return map.array[index].value;
			} else {
				return void 0;
			}
		}
	};
	var map_get = function(map, key) {
		if (!_map_is_emu(map)) {
			return _map_get_native(map, key);
		} else {
			return _map_get_emu(map, key);
		}
	};
	var _map_has_native = function(map, key) {
		return map.has(key);
	};
	var _map_has_emu = function(map, key) {
		if (_map_is_key_primitive(key)) {
			return key in map.object;
		} else {
			return _map_indexof(map, key) >= 0;
		}
	};
	var map_has = function(map, key) {
		if (!_map_is_emu(map)) {
			return _map_has_native(map, key);
		} else {
			return _map_has_emu(map, key);
		}
	};
	var _map_remove_native = function(map, key) {
		map.delete(key);
	};
	var _map_remove_emu = function(map, key) {
		if (_map_is_key_primitive(key)) {
			delete map.object[key];
		} else {
			var index = _map_indexof(map, key);
			if (index >= 0) {
				map.array.splice(index, 1);
			}
		}
	};
	var map_remove = function(map, key) {
		if (!_map_is_emu(map)) {
			return _map_remove_native(map, key);
		} else {
			return _map_remove_emu(map, key);
		}
	};
	var _map_foreach_native = function(map, cb) {
		var keys = map.keys();
		while (true) {
			var key_it = keys.next();
			if (key_it.done)
				break;
			var key = key_it.value;
			cb(key, map.get(key));
		}
	};
	var _map_foreach_emu = function(map, cb) {
		for (var key in map.object) {
			cb(key, map.object[key]);
		}
		for (var i = 0; i < map.array.length; i++) {
			cb(map.array[i].key, map.array[i].value);
		}
	};
	var map_foreach = function(map, cb) {
		if (!_map_is_emu(map)) {
			return _map_foreach_native(map, cb);
		} else {
			return _map_foreach_emu(map, cb);
		}
	};
	var _map_size_native = function(map) {
		return map.size;
	};
	var _map_size_emu = function(map) {
		return Object.keys(map.object).length + map.array.length;
	};
	var map_size = function(map) {
		if (!_map_is_emu(map)) {
			return _map_size_native(map);
		} else {
			return _map_size_emu(map);
		}
	};
	var new_set = function() {
		return new_map();
	};
	var set_add = function(set, key) {
		return map_set(set, key, true);
	};
	var set_has = function(set, key) {
		return map_has(set, key);
	};
	var set_remove = function(set, key) {
		return map_remove(set, key);
	};
	var IMUCache = /** @class */ (function() {
		function IMUCache(options) {
			this.data = new_map();
			this.times = new_map();
			this.fetches = new_map();
			this.options = {};
			if (options)
				this.options = options;
		}
		IMUCache.prototype.set = function(key, value, time) {
			if (_nir_debug_) nir_debug("cache", "Cache.set key:", key, ", time=" + time + ", value:", deepcopy(value));
			this.remove(key);
			if (this.options.max_keys) {
				var current_size = map_size(this.data);
				if (current_size > this.options.max_keys) {
					var all_keys = [];
					map_foreach(this.times, function(key, value) {
						all_keys.push({ key: key, end_time: value.end_time, added_time: value.added_time });
					});
					// we prioritize removing the key closest to expiry before the oldest key
					all_keys.sort(function(a, b) {
						if (a.end_time) {
							if (!b.end_time)
								return -1;
							return a.end_time - b.end_time;
						} else {
							if (b.end_time)
								return 1;
							return a.added_time - b.added_time;
						}
					});
					var keys_to_remove = current_size - this.options.max_keys;
					var key_id = 0;
					while (key_id < all_keys.length && keys_to_remove > 0) {
						this.remove(all_keys[key_id++].key);
						keys_to_remove--;
					}
				}
			}
			map_set(this.data, key, value);
			var added_time = Date.now();
			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 && typeof timer !== "number" && "unref" in timer) {
					timer.unref();
				}
				map_set(this.times, key, {
					timer: timer,
					time: time,
					added_time: added_time,
					end_time: added_time + time
				});
			} else {
				map_set(this.times, key, {
					added_time: added_time
				});
			}
		};
		IMUCache.prototype.has = function(key) {
			var has_key = map_has(this.data, key);
			if (_nir_debug_) nir_debug("cache", "Cache.has key:", key, has_key);
			return has_key;
		};
		IMUCache.prototype.get = function(key) {
			// TODO: maybe renew timeout per-get?
			var value = map_get(this.data, key);
			if (_nir_debug_) nir_debug("cache", "Cache.get key:", key, deepcopy(value));
			return value;
		};
		IMUCache.prototype.fetch = function(key, done, fetcher) {
			var exists = map_has(this.data, key);
			if (_nir_debug_) nir_debug("cache", "Cache.fetch key:", key, ", exists=" + exists);
			if (!exists) {
				if (map_has(this.fetches, key)) {
					map_get(this.fetches, key).push(done);
				} else {
					map_set(this.fetches, key, []);
					var _this = this;
					fetcher(function(data, time) {
						if (time !== false)
							_this.set.bind(_this)(key, data, time);
						done(data);
						var our_fetches = map_get(_this.fetches, key);
						for (var i = 0; i < our_fetches.length; i++) {
							our_fetches[i](data);
						}
						map_remove(_this.fetches, key);
					});
				}
			} else {
				done(map_get(this.data, key));
			}
		};
		IMUCache.prototype.remove = function(key) {
			if (_nir_debug_) nir_debug("cache", "Cache.remove key:", key);
			if (map_has(this.times, key)) {
				var timeobj = map_get(this.times, key);
				if ("timer" in timeobj)
					clearTimeout(timeobj.timer);
			}
			if (this.options.destructor && map_has(this.data, key)) {
				this.options.destructor(key, map_get(this.data, key));
			}
			map_remove(this.times, key);
			map_remove(this.data, key);
		};
		IMUCache.prototype.clear = function() {
			if (_nir_debug_) nir_debug("cache", "Cache.clear");
			map_foreach(this.times, function(key, value) {
				if ("timer" in value) {
					clearTimeout(value.timer);
				}
			});
			if (this.options.destructor) {
				map_foreach(this.data, function(key, value) {
					this.options.destructor(key, value);
				});
			}
			this.times = new_map();
			this.data = new_map();
		};
		return IMUCache;
	}());
	;
	var url_cache = new IMUCache();
	var real_api_cache = new IMUCache();
	var lib_cache = new IMUCache();
	var cookie_cache = new IMUCache();
	var real_api_query = function(api_cache, do_request, key, request, cb, process) {
		api_cache.fetch(key, cb, function(done) {
			if (!("method" in request))
				request.method = "GET";
			request.onload = function(resp) {
				if (resp.status !== 200 && !request.non200_ok) {
					if (!request.silent)
						console_error(key, resp);
					return done(null, false);
				}
				try {
					var out_resp = resp;
					var resptext = resp.responseText;
					if (request.jsonp) {
						resptext = resptext.replace(/^[$_a-zA-Z][$_a-zA-Z0-9]+\(({[\s\S]*})\);?$/, "$1");
					}
					if (request.json || request.jsonp) {
						out_resp = JSON_parse(resptext);
					}
					return process(done, out_resp, key);
				} catch (e) {
					console_error(key, e, resp);
					return done(null, false);
				}
			};
			do_request(request);
		});
	};
	var compat_match = function(str, regex) {
		var real_regex = regex;
		if (regex.regex && regex.groups) {
			real_regex = regex.regex;
		}
		var matched = str.match(real_regex);
		if (!matched)
			return matched;
		if (real_regex !== regex) {
			if (!matched.groups)
				matched.groups = {};
			array_foreach(regex.groups, function(group, i) {
				matched.groups[group] = matched[i + 1];
			});
		}
		return matched;
	};
	var real_website_query = function(options) {
		if (!is_array(options.website_regex)) {
			options.website_regex = [options.website_regex];
		}
		var website_match = null;
		for (var i = 0; i < options.website_regex.length; i++) {
			website_match = compat_match(options.url, options.website_regex[i]);
			if (website_match)
				break;
		}
		if (!website_match)
			return null;
		var page_nullobj = {
			url: options.url,
			is_pagelink: true
		};
		if (!options.do_request || !options.cb) {
			return page_nullobj;
		}
		var domain = options.url.replace(/^[a-z]+:\/\/([^/]+)\/+.*$/, "$1");
		var domain_nosub = get_domain_nosub(domain);
		if (!options.cache_key) {
			options.cache_key = domain_nosub;
		}
		var cb = function(data) {
			if (!data) {
				return options.cb(page_nullobj);
			} else {
				if (!is_array(data)) {
					data = [data];
				}
				data.push(page_nullobj);
				return options.cb(data);
			}
		};
		if (!options.override_cb) {
			options.override_cb = function(cb, data) {
				cb(data);
			};
		}
		if (!options.run) {
			options.run = function(cb, website_match, options) {
				var id = website_match[1];
				if (website_match.groups && website_match.groups.id) {
					id = website_match.groups.id;
				}
				var fill_string_vars = function(str) {
					return str
						.replace(/\${id}/g, id)
						.replace(/\${([^/]+)}/g, function(_, x) {
						if (/^[0-9]+$/.test(x))
							return website_match[x];
						return website_match.groups[x];
					});
				};
				if (options.id) {
					id = fill_string_vars(options.id);
				}
				var query = options.query_for_id;
				if (typeof options.query_for_id === "string") {
					query = {
						url: query
					};
				}
				if (typeof query === "object" && query.url) {
					query.url = fill_string_vars(query.url);
				} else {
					query = query(id, website_match);
				}
				real_api_query(options.api_cache, options.do_request, options.cache_key + ":" + id, query, cb, function(done, resp, cache_key) {
					return options.process(done, resp, cache_key, website_match, options);
				});
			};
		}
		options.run(function(data) {
			options.override_cb(cb, data);
		}, website_match, options);
		return {
			waiting: true
		};
	};
	// temporary hack for Instagram returning urls with %00
	// thanks to fireattack on discord for reporting
	var is_invalid_url = function(url) {
		// yes, a null url is technically invalid, but this check is used to detect if it has invalid characters.
		// it's better to just return false here.
		// thanks to remlap on discord for noticing that this caused issues for regular instagram posts.
		if (!url)
			return false;
		for (var i = 0; i < url.length; i++) {
			if (url.charCodeAt(i) === 0) {
				return true;
			}
		}
		return false;
	};
	// https://stackoverflow.com/a/17323608
	function mod(n, m) {
		return ((n % m) + m) % m;
	}
	var string_to_int = function(str, alpha) {
		var base = 0;
		for (var i = 0; i < str.length; i++) {
			var index = string_indexof(alpha, str[i]);
			base *= alpha.length;
			base += index;
		}
		return base;
	};
	// unused, but likely useful
	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("/");
	}
	var is_valid_resource_url = function(url) {
		var match = url.match(/^([-a-z]+):/);
		if (match) {
			var valid_schemes = ["http", "https", "ftp", "data", "x-raw-image", "blob", "chrome", "file"];
			return array_indexof(valid_schemes, match[1].toLowerCase()) >= 0;
		}
		return true;
	};
	var norm_url = function(url) {
		return url
			// https://www.test.com?test -> https://www.test.com/?test
			.replace(/^([a-z]+:\/\/[^/]+)(\?.*)/, "$1/$2")
			// https://www.test.com./ -> https://www.test.com/
			.replace(/^([a-z]+:\/\/[^/]+\.[^/]+)\.([?#/].*)?$/, "$1$2");
	};
	function urljoin(a, b, browser) {
		if (b.length === 0)
			return a;
		if (b.match(/^[-a-z]*:\/\//) || b.match(/^(?:data|x-raw-image|blob|about|javascript):/))
			return b;
		var protocol_split = a.split("://");
		// FIXME? for URLs like about:blank
		if (protocol_split.length < 2) {
			return a;
		}
		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.replace(/\/*$/, "") + "/" + 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;
			if (b.length >= 2 && b.slice(0, 2) === "./")
				b = b.substring(2);
			// 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 === void 0 || x === null)
			return x;
		var a = document_createElement(a);
		a.href = x;
		return a.href;
	};
	var url_basename = function(url, options) {
		var basename = url.replace(/.*\//, "");
		if (!options)
			options = {};
		if (!("remove_queryhash" in options))
			options.remove_queryhash = true;
		if (!options.remove_queryhash)
			return basename;
		basename = basename.replace(/[?#].*$/, "");
		if (!options.split_ext)
			return basename;
		var match;
		if (options.known_ext) {
			// todo: factor out?
			match = basename.match(/(.*?)\.(mp4|mpe?g|jpe?g|jfif|png|tiff|og[agv]|m4[av]|web[pm]|mkv|avi|gif|mpd|m3u8|zip)$/i);
		} else {
			match = basename.match(/(.*)\.([^.]*)$/);
		}
		if (!match)
			return [basename];
		return [match[1], match[2]];
	};
	var basic_fillobj = function(obj) {
		var mobj = force_array((obj || {}));
		array_foreach(mobj, function(sobj, i) {
			if (typeof sobj === "string") {
				mobj[i] = { url: sobj };
			}
		});
		return mobj;
	};
	var fillobj = function(p_obj, p_baseobj) {
		//if (typeof p_obj === "undefined")
		var obj = basic_fillobj(p_obj);
		var baseobj = basic_fillobj(deepcopy(p_baseobj))[0];
		//var oldobj = deepcopy(obj);
		for (var i = 0; i < obj.length; i++) {
			if (typeof (obj[i]) === "undefined") {
				continue;
			}
			var item;
			// Only copy from baseobj if the urls are the same (or n/a)
			if (!obj[i].url || !baseobj.url || baseobj.url === obj[i].url) {
				for (item in baseobj) {
					if (!(item in obj[i])) {
						obj[i][item] = baseobj[item];
					}
				}
			}
			for (item in default_object) {
				if (!(item in obj[i])) {
					obj[i][item] = deepcopy(default_object[item]);
				}
			}
			// this is horrible
			if (obj[i].video && obj[i].media_info.type === "image") {
				if (obj[i].video === true) {
					obj[i].media_info = {
						type: "video"
					};
				} else if (typeof obj[i].video === "string") {
					obj[i].media_info = {
						type: "video",
						delivery: obj[i].video
					};
				} else {
					obj[i].media_info = deepcopy(obj[i].video);
					// what is this usecase?
					obj[i].media_info.delivery = obj[i].media_info.type;
					obj[i].media_info.type = "video";
				}
			}
		}
		//console_log("fillobj", deepcopy(oldobj), deepcopy(obj), deepcopy(baseobj));
		return obj;
	};
	var fillobj_urls = function(urls, obj, overwrite) {
		var newobj = [];
		for (var i = 0; i < urls.length; i++) {
			var currentobj = deepcopy(obj);
			if (typeof urls[i] === "string") {
				currentobj.url = urls[i];
			} else {
				for (var key in urls[i]) {
					if (!overwrite || !(key in currentobj))
						currentobj[key] = urls[i][key];
				}
			}
			newobj.push(currentobj);
		}
		return newobj;
	};
	var add_full_extensions = function(obj, extensions, prefer_order) {
		if (!extensions)
			extensions = [
				"jpg", "jpeg", "png", "gif", "webp", "avif",
				"JPG", "JPEG", "PNG", "GIF"
			];
		if (!is_array(obj)) {
			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];
			if (!prefer_order)
				result.push(currentobj);
			for (var i = 0; i < extensions.length; i++) {
				if (!prefer_order && 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);
				}
			}
			if (prefer_order && array_indexof(result, currentobj) < 0)
				result.push(currentobj);
		}
		return result;
	};
	var add_full_extensions2 = function(url, options) {
		if (!options) {
			options = {};
		}
		if (!("add_video" in options))
			options.add_video = true;
		var new_urls = add_full_extensions(url, options.extensions, options.prefer_order);
		if (options.add_video) {
			for (var i = 0; i < new_urls.length; i++) {
				if (/\.(?:mp4|webm)$/.test(new_urls[i])) {
					new_urls[i] = {
						url: new_urls[i],
						video: true
					};
				}
			}
		}
		return new_urls;
	};
	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_extensions_from_webp = function(url) {
		if (/\.webp(?:[?#].*)?$/.test(url)) {
			return add_extensions(url);
		} else {
			return url;
		}
	};
	var add_http = function(url) {
		if (!url.match(/^[a-z]+:\/\//))
			return "http://" + url;
		return url;
	};
	var force_https = function(url) {
		return url.replace(/^http:\/\//, "https://");
	};
	var decodeuri_ifneeded = function(url) {
		if (url.match(/^https?:\/\//))
			return url;
		if (url.match(/^https?%3[aA]/) || /^[^/]*%2[fF]/.test(url))
			return decodeURIComponent(url);
		if (url.match(/^https?%253[aA]/))
			return decodeURIComponent(decodeURIComponent(url));
		return url;
	};
	var encodeuri_ifneeded = function(url) {
		// TODO: improve
		if (string_indexof(url, "%") < 0) {
			return encodeURI(url);
		}
		return url;
	};
	var replace_sizes = function(src, sizes, keep_orig_if_empty) {
		var current_problems = null;
		var orig_obj = null;
		for (var i = 0; i < sizes.length; i++) {
			var url = sizes[i];
			if (typeof url === "object")
				url = url.url;
			if (url === src) {
				if (typeof sizes[i] === "object" && sizes[i].problems)
					current_problems = sizes[i].problems;
				orig_obj = sizes[i];
				sizes.splice(i, sizes.length);
				break;
			}
		}
		if (current_problems) {
			for (var i = 0; i < sizes.length; i++) {
				if (typeof sizes[i] !== "object")
					continue;
				if (sizes[i].problems) {
					for (var problem in sizes[i].problems) {
						if (sizes[i].problems[problem] === current_problems[problem]) {
							delete sizes[i].problems[problem];
						}
					}
				}
			}
		}
		if (keep_orig_if_empty && !sizes.length) {
			sizes.push(orig_obj);
		}
		return sizes;
	};
	// 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 common_functions["run_arrayd_string"](str, {
			cb: function(arr) {
				return arr.reverse();
			}
		});
	}
	function decode_entities(str) {
		var match = str.match(/^\s*<!\[CDATA\[([\s\S]+)\]\]>\s*$/);
		if (match)
			return match[1];
		return str
			.replace(/&nbsp;/g, " ")
			.replace(/&#([0-9]+);/g, function(full, num) { return string_fromcharcode(num); })
			.replace(/&quot;/g, '"')
			.replace(/&amp;/g, "&");
	}
	function encode_entities(str) {
		return str.replace(/&/g, "&amp;");
	}
	function encode_regex(str) {
		return str.replace(/([\^$])/g, "\\$1");
	}
	function get_queries(url, options) {
		// TODO: handle things like: ?a=b&c=b#&d=e
		var querystring = url
			.replace(/#.*/, "")
			.replace(/^.*?\?/, "");
		if (!querystring || querystring === url)
			return {};
		if (!options) {
			options = {};
		}
		var queries = {};
		var splitted = querystring.split("&");
		for (var i = 0; i < splitted.length; i++) {
			var name = splitted[i];
			var value = true;
			var match = splitted[i].match(/^(.*?)=(.*)/);
			if (match) {
				name = match[1];
				value = match[2];
			}
			if (name.length === 0)
				continue;
			if (options.decode && typeof value === "string") {
				value = decodeURIComponent(value);
			}
			queries[name] = value;
		}
		return queries;
	}
	function stringify_queries(queries, encode) {
		var queriesstr = [];
		for (var query in queries) {
			if (query.length === 0)
				continue;
			var current_query = query;
			var queryval = queries[query];
			if (encode)
				queryval = encodeURIComponent(queryval);
			if (queries[query] !== true) {
				current_query += "=" + queryval;
			}
			queriesstr.push(current_query);
		}
		return queriesstr.join("&");
	}
	function remove_queries(url, queries) {
		if (!is_array(queries)) {
			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 (array_indexof(queries, property) < 0) {
				newsplitted.push(splitted[i]);
			}
		}
		if (newsplitted.length === 0) {
			afterquery = "";
		} else {
			afterquery = "?" + newsplitted.join("&");
		}
		return beforequery + afterquery;
	}
	function keep_queries(url, queries, options) {
		if (!is_array(queries)) {
			queries = [queries];
		}
		if (!options) {
			options = {};
		}
		var url_queries = get_queries(url);
		var kept_queries = [];
		var has_queries = new_set();
		array_foreach(queries, function(query) {
			if (query in url_queries) {
				var querystr = query + "=";
				if (options.overwrite && query in options.overwrite) {
					querystr += options.overwrite[query];
				} else {
					querystr += url_queries[query];
				}
				kept_queries.push(querystr);
				set_add(has_queries, query);
			}
		});
		if (options.required) {
			if (options.required === true)
				options.required = queries;
			var required_total = 0;
			array_foreach(options.required, function(query) {
				if (set_has(has_queries, query)) {
					required_total++;
				} else {
					return false;
				}
			});
			if (required_total < options.required.length)
				return url;
		}
		if (options.overwrite) {
			for (var query in options.overwrite) {
				if (!set_has(has_queries, query)) {
					kept_queries.push(query + "=" + options.overwrite[query]);
				}
			}
		}
		var afterquery;
		if (kept_queries.length === 0)
			afterquery = "";
		else
			afterquery = "?" + kept_queries.join("&");
		return url.replace(/\?.*/, "") + afterquery;
	}
	function add_queries(url, queries) {
		var parsed_queries = get_queries(url);
		for (var query in queries) {
			parsed_queries[query] = queries[query];
		}
		var newquerystring = stringify_queries(parsed_queries);
		if (newquerystring) {
			return url.replace(/^([^#]*?)(?:\?.*)?$/, "$1?" + newquerystring);
		} else {
			return url;
		}
	}
	var raw_do_notify = null;
	if (is_userscript) {
		if (typeof GM_notification !== "undefined") {
			raw_do_notify = GM_notification;
		} else if (typeof GM !== "undefined" && GM.notification) {
			raw_do_notify = GM.notification;
		}
	} else if (is_extension) {
		raw_do_notify = function(details, ondone) {
			var jsoned_details = deepcopy(details, { json: true });
			if (details.onclick)
				jsoned_details.onclick = true;
			extension_send_message({
				type: "notification",
				data: jsoned_details
			}, function(response) {
				// if there's no onclick
				if (!response || !response.data)
					return;
				if (response.data.action === "clicked") {
					if (details.onclick) {
						details.onclick();
					}
				} else if (response.data.action === "closed") {
					ondone = details.ondone || ondone;
					if (ondone) {
						ondone();
					}
				}
			});
		};
	}
	var do_notify = function(details) {
		if (!raw_do_notify)
			return;
		if (!details.title) {
			details.title = _("Image Max URL");
		}
		if (!details.image) {
			details.image = imu_icon;
		}
		raw_do_notify(details, details.ondone || null);
	};
	function fuzzify_text(str) {
		return str
			.replace(/(?:[-=_!?$#"'’‘”“]|\[|])/g, " ")
			.replace(/\s+/g, " ")
			.replace(/^\s+|\s+$/g, "");
	}
	var check_updates_firefox = function(cb) {
		do_request({
			url: firefox_addon_page,
			method: "GET",
			onload: function(resp) {
				if (resp.readyState < 4)
					return;
				if (resp.status !== 200)
					return cb(null);
				var match = resp.responseText.match(/<script[^>]*id=["']redux-store-state["']\s*>\s*({.*?})\s*<\/script>/);
				if (!match) {
					return cb(null);
				}
				try {
					var json = JSON_parse(match[1]);
					var addoninfo = json.addons.byID["1003321"];
					var versionid = addoninfo.currentVersionId;
					var versioninfo = json.versions.byId[versionid];
					var version = versioninfo.version;
					var downloadurl = versioninfo.platformFiles.all.url.replace(/\?src=.*/, "?src=external-updatecheck");
					cb({
						version: version,
						downloadurl: downloadurl
					});
				} catch (e) {
					console_error("Unable to parse mozilla addon info", e);
					return cb(null);
				}
			}
		});
	};
	var check_updates_github = function(cb) {
		do_request({
			url: "https://api.github.com/repos/qsniyg/maxurl/tags",
			method: "GET",
			headers: {
				Referer: ""
			},
			onload: function(resp) {
				if (resp.readyState < 4)
					return;
				if (resp.status !== 200)
					return cb(null);
				try {
					var json = JSON_parse(resp.responseText);
					for (var i = 0; i < json.length; i++) {
						var version = json[i].name;
						if (!version.match(/^v[0-9.]+$/)) {
							continue;
						}
						return cb({
							version: version.replace(/^v([0-9])/, "$1")
						});
					}
				} catch (e) {
					console_error("Unable to parse github info", e);
				}
				return cb(null);
			}
		});
	};
	var check_updates = function(cb) {
		// Firefox blocks these requests
		if (false && is_firefox_webextension) {
			check_updates_firefox(function(data) {
				if (!data) {
					check_updates_github(cb);
				} else {
					cb(data);
				}
			});
		} else {
			check_updates_github(cb);
		}
	};
	var get_update_url = function() {
		var link = settings.last_update_url;
		if (!link) {
			if (is_firefox_webextension) {
				link = firefox_addon_page;
			} else if (is_userscript) {
				link = userscript_update_url;
			} else {
				link = null;
			}
		}
		return link;
	};
	var check_updates_if_needed = function() {
		// if last_update_check == 0, it means for some reason it's not able to store values
		if (!settings.imu_enabled || !settings.check_updates || !current_version || !settings.last_update_check) {
			return;
		}
		var update_check_delta = Date.now() - settings.last_update_check;
		if (update_check_delta > (settings.check_update_interval * 60 * 60 * 1000)) {
			check_updates(function(data) {
				update_setting("last_update_check", Date.now());
				if (!data || !data.version)
					return;
				if (!data.downloadurl) {
					update_setting("last_update_url", null);
				} else {
					update_setting("last_update_url", data.downloadurl);
				}
				update_setting("last_update_version", data.version);
				if (settings.check_update_notify && !is_in_iframe && version_compare(current_version, data.version) === 1) {
					var notify_obj = {
						text: _("Update available (%%1)", data.version)
					};
					var downloadurl = get_update_url();
					// FIXME? if !downloadurl, clicking won't close the popup. this might not be a problem though, as it's expected behavior?
					if (downloadurl) {
						notify_obj.onclick = function() {
							open_in_tab_imu({
								url: downloadurl
							});
						};
					}
					do_notify(notify_obj);
				}
			});
		}
	};
	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 && array_indexof(end, b) >= 0)
			return true;
		if (b === 1 && array_indexof(end, 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 = parse_int(a.substr(6, 2));
		var b_d = parse_int(b.substr(6, 2));
		if (!_fuzzy_compare_rollover(a_d, b_d, [28, 29, 30, 31]))
			return false;
		var a_m = parse_int(a.substr(4, 2));
		var b_m = parse_int(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 = parse_int(a.substr(0, 4));
		var b_y = parse_int(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, true);
		};
	}
	var blacklist_regexes = [];
	var host_blacklist_regexes = [];
	var host_html_blacklist_regexes = [];
	function update_rule_setting() {
		url_cache.clear();
	}
	var glob_to_regexstr = function(current) {
		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;
		return current;
	};
	var parse_blacklist_regexes = function(blacklist, engine) {
		var regexes = [];
		var lines = (blacklist || "").split("\n");
		for (var i = 0; i < lines.length; i++) {
			var current = lines[i].replace(/^\s+|\s+$/, "");
			//console_log(current);
			if (current.length === 0)
				continue;
			var regexstr = current;
			if (engine === "glob") {
				regexstr = glob_to_regexstr(current);
			}
			regexes.push(new RegExp(regexstr));
		}
		return regexes;
	};
	function create_blacklist_regexes() {
		blacklist_regexes = [];
		try {
			blacklist_regexes = parse_blacklist_regexes(settings.bigimage_blacklist, settings.bigimage_blacklist_engine);
		} catch (e) {
			return [e];
		}
		//console_log(blacklist_regexes);
	}
	function create_host_blacklist_regexes() {
		host_blacklist_regexes = [];
		try {
			host_blacklist_regexes = parse_blacklist_regexes(settings.host_blacklist, settings.bigimage_blacklist_engine);
		} catch (e) {
			return [e];
		}
	}
	function create_host_html_blacklist_regexes() {
		host_html_blacklist_regexes = [];
		try {
			host_html_blacklist_regexes = parse_blacklist_regexes(settings.host_html_blacklist, settings.bigimage_blacklist_engine);
		} catch (e) {
			return [e];
		}
	}
	var parse_headers = function(headerstr) {
		var headers = [];
		var splitstr = "\r\n";
		if (string_indexof(headerstr, "\r") < 0) {
			// tampermonkey beta, thanks to Broly on discord for reporting
			splitstr = "\n";
		}
		var splitted = headerstr.split(splitstr);
		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 headers_dict_to_list = function(headers) {
		var list = [];
		for (var header in headers) {
			list.push({ name: header, value: headers[header] });
		}
		return list;
	};
	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("; ");
	};
	var headerobj_get = function(headerobj, header) {
		for (var key in headerobj) {
			if (key.toLowerCase() === header.toLowerCase()) {
				return headerobj[key];
			}
		}
	};
	var headerobj_set = function(headerobj, header, value) {
		for (var key in headerobj) {
			if (key.toLowerCase() === header.toLowerCase()) {
				return headerobj[key] = value;
			}
		}
		return headerobj[header] = value;
	};
	var get_resp_finalurl = function(resp) {
		var parsed = parse_headers(resp.responseHeaders);
		if (!parsed)
			return resp.finalUrl;
		var dict = headers_list_to_dict(parsed);
		if (!dict || !dict["location"])
			return resp.finalUrl;
		return dict["location"];
	};
	var contenttype_map = {
		"image/jpeg": "jpg",
		"application/dash+xml": "mpd"
	};
	var get_ext_from_contenttype = function(contenttype) {
		contenttype = contenttype.replace(/^\s*\[?([^/]+)\/([^/]+?)\]?\s*$/, "$1/$2");
		if (contenttype in contenttype_map)
			return contenttype_map[contenttype];
		var split = contenttype.match(/^([^/]+)\/([^/]+)$/);
		if (!split)
			return null;
		if (split[1] !== "image" && split[1] !== "video")
			return null;
		return split[2];
	};
	// 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 custom_xhr = function(orig_xhr) {
		this._headers = {};
		this._response_headers = {};
		this._reqobj = null;
		this._last_readyState = null;
		this._realxhr = null;
		this.open = function(method, url, synchronous) {
			this._method = method;
			this._url = url;
		};
		this.setRequestHeader = function(headername, headervalue) {
			headerobj_set(this._headers, headername, headervalue);
		};
		this.getResponseHeader = function(headername) {
			if (this._realxhr)
				return this._realxhr.getResponseHeader(headername);
			return headerobj_get(this._response_headers, headername);
		};
		this.getAllResponseHeaders = function() {
			if (this._realxhr) {
				return this._realxhr.getAllResponseHeaders();
			}
			return this._response_headers_raw;
		};
		var _handle_event = function(_this, name, data) {
			if (data) {
				_this.status = data.status || 0;
				_this.statusText = data.statusText;
				_this.response = data.response;
				_this.readyState = data.readyState;
				_this.responseText = data.responseText;
				_this.responseType = data.responseType;
				_this.responseURL = data.finalUrl;
				this._response_headers_raw = data.responseHeaders;
				// todo: set loaded, total, lengthComputable
			}
			var event = {
				currentTarget: _this,
				target: _this,
				loaded: _this.loaded,
				lengthComputable: _this.lengthComputable,
				total: _this.total
			};
			if (data && data.responseHeaders) {
				this._response_headers = headers_list_to_dict(parse_headers(data.responseHeaders));
			} else if (data) {
				this._response_headers = null;
			}
			if (_this.readyState !== this._last_readyState) {
				if (_this.onreadystatechange)
					_this.onreadystatechange.bind(_this)(event);
				this._last_readyState = _this.readyState;
			}
			if (name === "load") {
				if (_this.onload)
					_this.onload.bind(_this)(event);
				if (_this.onloadend)
					_this.onloadend.bind(_this)(event);
			}
			if (name === "error") {
				if (_this.onerror)
					_this.onerror.bind(_this)(event);
				if (_this.onloadend)
					_this.onloadend.bind(_this)(event);
			}
			if (name === "abort") {
				if (_this.onabort)
					_this.onabort.bind(_this)(event);
				if (_this.onloadend)
					_this.onloadend.bind(_this)(event);
			}
			if (name === "progress") {
				if (_this.onprogress)
					_this.onprogress.bind(_this)(event);
			}
			if (name === "timeout") {
				if (_this.ontimeout)
					_this.ontimeout.bind(_this)(event);
			}
		};
		var _send_orig = function(_this, data) {
			var xhr = new orig_xhr();
			this._realxhr = xhr;
			xhr.open(this._method, this._url, true);
			xhr.responseType = _this.responseType;
			xhr.withCredentials = _this.withCredentials;
			xhr.timeout = _this.timeout;
			for (var headername in this._headers) {
				xhr.setRequestHeader(headername, this._headers[headername]);
			}
			var allevents = ["load", "loadend", "error", "abort", "progress", "timeout", "readystatechange"];
			for (var i = 0; i < allevents.length; i++) {
				var onevent = "on" + allevents[i];
				(function(onevent) {
					if (onevent in _this) {
						xhr[onevent] = function(e) {
							var copyprops = ["status", "statusText", "response", "readyState", "responseText", "responseType", "responseURL"];
							for (var i = 0; i < copyprops.length; i++) {
								var prop = copyprops[i];
								try {
									_this[prop] = xhr[prop];
								} catch (e) { } // this is expected for earlier props
							}
							_this[onevent].bind(_this)(e);
						};
					}
				})(onevent);
			}
			xhr.send(data);
		};
		this.send = function(_this, data, do_request) {
			if (this._url && orig_xhr && /^blob:/.test(this._url)) {
				return _send_orig.bind(this)(_this, data);
			}
			var reqobj = {
				method: this._method,
				url: this._url,
				data: data,
				timeout: _this.timeout || 0,
				withCredentials: _this.withCredentials || true,
				responseType: _this.responseType
			};
			if (Object.keys(this._headers).length > 0)
				reqobj.headers = this._headers;
			var add_listener = function(our_this, event) {
				reqobj["on" + event] = function(resp) {
					_handle_event.bind(our_this)(_this, event, resp);
				};
			};
			var allevents = ["load", "error", "abort", "progress", "timeout"];
			for (var i = 0; i < allevents.length; i++) {
				add_listener(this, allevents[i]);
			}
			this._reqobj = do_request(reqobj);
		};
		this.abort = function() {
			if (!this._reqobj)
				return;
			this._reqobj.abort();
		};
	};
	custom_xhr.do_request = do_request;
	var orig_XMLHttpRequest; // hack for typescript, custom_xhr_wrap is not executed in this scope
	var custom_xhr_wrap = function() {
		var real = new imu_xhr.custom_xhr(orig_XMLHttpRequest);
		var copy = ["open", "setRequestHeader", "getResponseHeader", "getAllResponseHeaders", "abort"];
		for (var i = 0; i < copy.length; i++) {
			var item = copy[i];
			(function(item) {
				var real_item = real[item];
				this[item] = function() {
					//console.log("calling", item, arguments);
					return real_item.apply(real, arguments);
				};
			}).bind(this)(item);
		}
		this.send = function(data) {
			//console.log("sending", data);
			return real.send(this, data, XMLHttpRequest.do_request);
		};
	};
	var add_scripttag_function = function(body) {
		// https://violentmonkey.github.io/posts/inject-scripts-with-blob-urls/
		if (false) {
			var script = document.createElement("script");
			script.textContent = body;
			document.documentElement.appendChild(script);
			document.documentElement.removeChild(script);
		} else {
			var script_1 = document.createElement("script");
			new_blob([body], function(blob) {
				var url = create_objecturl(blob);
				script_1.src = url;
				document.documentElement.appendChild(script_1);
				revoke_objecturl(url); // revoking before removing the script so that websites monitoring elements removed won't be able to inspect the script
				script_1.src = null;
				document.documentElement.removeChild(script_1);
			}, { type: 'text/javascript' });
		}
	};
	// FIXME: this is potentially insecure.
	// A website could theoretically monitor script tags added, read the blob URL, figure out the password, and run the data function to access sensitive information (namely, custom_xhr)
	// Since the data function can only be run once, this may render an attack harder.
	// This function is gated behind bypass_csp_for_lib, which is disabled by default (with a scary warning to deter users from enabling it).
	var new_scripttag_function = function(body, data, cb) {
		var win = get_window();
		var imu_export_varname = common_functions["gen_jquery_callback"](); // we want this to remain unobvious to deter detection
		var script_preamble = "(function(){window['" + imu_export_varname + "']=(function(){";
		var imu_cb_varname = common_functions["gen_jquery_callback"]();
		// TODO: wrap in try/catch
		var script_postfix = "})();" + imu_cb_varname + "();})();";
		// TODO: minify
		win[imu_cb_varname] = function() {
			delete win[imu_cb_varname];
			var exported = win[imu_export_varname];
			delete win[imu_export_varname];
			if (data) {
				delete win[imu_data_varname];
			}
			cb(exported);
		};
		var imu_data_varname = null;
		if (data) {
			imu_data_varname = common_functions["gen_jquery_callback"]();
			var imu_data_password_1 = get_random_text(50);
			(function() {
				var b = imu_data_password_1;
				var c = data.data;
				var d = false;
				// function is minified to reduce detection.
				//
				// unminified (pseudocode):
				//
				// function get_data_func(password:string) {
				//   if (password !== imu_data_password || ran) {
				//     return false;
				//   }
				//   ran = true;
				//   return data.data;
				// }
				var get_data_func = function(a) { if (a !== b || d)
					return; d = !0; return c; };
				win[imu_data_varname] = get_data_func;
			})();
			script_preamble += 'var ' + data.varname + '=' + imu_data_varname + "('" + imu_data_password_1 + "');";
		}
		var scriptbody = script_preamble + body + script_postfix;
		add_scripttag_function(scriptbody);
	};
	var new_function = function(scriptbody, data, cb) {
		try {
			if (!data) {
				var func = new Function(scriptbody)();
				cb(func);
			} else {
				var func = new Function(data.varname, scriptbody)(data.data);
				cb(func);
			}
		} catch (e) {
			// blocked by csp?
			if (is_userscript && settings.bypass_csp_for_lib) {
				console_warn(e);
				return new_scripttag_function(scriptbody, data, cb);
			} else {
				console_error(e);
				return cb(null);
			}
		}
	};
	var run_sandboxed_lib = function(fdata, xhr, cb) {
		if (true) {
			if (!xhr) {
				return new_function(fdata + ";return lib_export;", null, cb);
			} else {
				var overridden_xhr = true;
				if (!settings.custom_xhr_for_lib)
					overridden_xhr = false;
				var endshim = ";return {lib: lib_export, xhr: XMLHttpRequest, overridden_xhr: " + overridden_xhr + "};";
				if (overridden_xhr) {
					// inefficient, but it allows multiple overrides for do_request
					var startshim = "var orig_XMLHttpRequest=null;try{orig_XMLHttpRequest=window.XMLHttpRequest}catch (e){console.error(e);};var XMLHttpRequest=null;(function(imu_xhr){XMLHttpRequest=" + custom_xhr_wrap.toString() + ";XMLHttpRequest.do_request = imu_xhr.do_request;})(imu_xhr);imu_xhr = undefined;";
					return new_function(startshim + fdata + endshim, {
						varname: "imu_xhr",
						data: {
							custom_xhr: custom_xhr,
							do_request: do_request
						}
					}, cb);
				} else {
					return new_function(fdata + endshim, null, cb);
				}
			}
		} else {
			// doesn't work unfortunately
			var frame = document_createElement('iframe');
			frame.srcdoc = ""; //"javascript:0"
			document.body.appendChild(frame);
			var result = frame.contentWindow.Function(fdata + ";return lib_export;")();
			frame.parentElement.removeChild(frame);
			return result;
		}
	};
	var run_sandboxed_lib_safe = function(fdata, xhr, cb) {
		try {
			var result = run_sandboxed_lib(fdata, xhr, cb);
			return result;
		} catch (e) {
			console_error(e);
			return null;
		}
	};
	var lib_urls = {
		"testcookie_slowaes": {
			name: "testcookie_slowaes",
			url: "https://raw.githubusercontent.com/qsniyg/maxurl/e90366f4b6c998614509472717fd18ca8050c1fa/lib/testcookie_slowaes.js",
			archive_time: "20210403210438",
			size: 30462,
			crc32: 1012990654,
			crc32_size: 2369381957
		},
		"shaka": {
			name: "shaka.debug",
			url: "https://raw.githubusercontent.com/qsniyg/maxurl/a4ca480a6cc503792762b4343f2f855cdf9cf48a/lib/shaka.debug.js",
			archive_time: "20210215220612",
			size: 1270454,
			crc32: 2187951259,
			crc32_size: 3680154806,
			xhr: true
		},
		"cryptojs_aes": {
			name: "cryptojs_aes",
			url: "https://raw.githubusercontent.com/qsniyg/maxurl/22df70495741c2f90092f4cc0c504a1a2f6e6259/lib/cryptojs_aes.js",
			archive_time: "20210215220612",
			size: 13453,
			crc32: 4282597182,
			crc32_size: 3521118067
		},
		"stream_parser": {
			name: "stream_parser",
			url: "https://raw.githubusercontent.com/qsniyg/maxurl/0655c317844fb7a652c6ee9f88ab65514c53b482/lib/stream_parser.js",
			archive_time: "20210403204309",
			size: 115544,
			crc32: 270289712,
			crc32_size: 2967398805
		},
		"ffmpeg": {
			name: "ffmpeg",
			url: "https://raw.githubusercontent.com/qsniyg/maxurl/2178819a193656245ce1a2bd885ff12aaaa04ea9/lib/ffmpeg.js",
			archive_time: "20210403204304",
			size: 285642,
			crc32: 2587771391,
			crc32_size: 2632494853,
			xhr: true
		},
		"jszip": {
			name: "jszip",
			url: "https://raw.githubusercontent.com/qsniyg/maxurl/3d8d6b4415b8dd58cb405910647c940ea122b3a0/lib/jszip.js",
			archive_time: "20231116183309",
			size: 99559,
			crc32: 2407465226,
			crc32_size: 689840937
		},
		"BigInteger": {
			name: "BigInteger",
			url: "https://raw.githubusercontent.com/qsniyg/maxurl/b0a4ba6c28f0c0b7c665e76e3767bde59e900ab6/lib/BigInteger.js",
			archive_time: "20231116183440",
			size: 21482,
			crc32: 337445473,
			crc32_size: 2641711624
		},
		"JSInterpreter": {
			name: "acorn_interpreter",
			url: "https://raw.githubusercontent.com/qsniyg/maxurl/b4d3d715e391e2e3f50a699acc5711bc7bdb6f52/lib/acorn_interpreter.js",
			archive_time: "20240311233145",
			size: 79532,
			crc32: 270556316,
			crc32_size: 2713590225
		}
	};
	var get_library = function(name, options, do_request, cb) {
		if (!options.allow_thirdparty_libs) {
			console_warn("Refusing to request library " + name + " due to 3rd-party library support being disabled");
			return cb(null);
		}
		if (!(name in lib_urls)) {
			console_error("Invalid library", name);
			return cb(null);
		}
		var lib_obj = lib_urls[name];
		if (is_scripttag) {
			return cb(null);
		} else if (is_node) {
			try {
				var libname = "./lib/" + lib_obj.name + ".js";
				var lib = require(/* webpackIgnore: true */ libname);
				return cb(lib);
			} catch (e) {
				console.error(e);
				return cb(null);
			}
		}
		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: lib_obj.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);
						run_sandboxed_lib(response.data.text, lib_obj.xhr, function(exported) {
							done(exported, 0);
						});
					});
				} else {
					// 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 6-30ms to do both CRC32 checks, so performance isn't really an issue.
					// FIXME: Perhaps this is unnecessary? The commit hash should change if the commit changes
					var lib_url = lib_obj.url;
					if (!lib_url) {
						console_error("No URL for library", lib_obj);
						return done(null, 0);
					}
					if (options.use_webarchive_for_lib) {
						if (lib_obj.archive_url) {
							lib_url = lib_obj.archive_url;
						} else {
							var time = lib_obj.archive_time;
							if (!time) {
								// fixme: it'd be better to auto-store the script's date somewhere
								var date = new Date();
								time = "" + date.getFullYear();
								time += zpadnum(date.getMonth() + 1, 2);
								time += zpadnum(date.getDate(), 2);
								time += zpadnum(date.getHours(), 2);
								time += zpadnum(date.getMinutes(), 2);
								time += "00";
							}
							lib_url = "https://web.archive.org/web/" + time + "js_/" + lib_obj.url;
						}
					}
					do_request({
						method: "GET",
						url: lib_url,
						headers: {
							Referer: ""
						},
						onload: function(result) {
							if (result.readyState !== 4)
								return;
							if (result.status !== 200) {
								console_error(result);
								return done(null, false);
							}
							var libcontents = result.responseText;
							if (options.use_webarchive_for_lib) {
								//var oldlib = libcontents;
								libcontents = libcontents
									.replace(/^\s*var _____WB\$wombat\$assign\$function_____[\s\S]*_____WB\$wombat\$assign\$function_____[(].*[)];\n\n/, "")
									.replace(/\n\n}\n\/\*\s*FILE ARCHIVED ON[\s\S]*/, "")
									.replace(/(["'])https:\/\/web.archive.org\/web\/[0-9]+(?:[a-z]+_)?\/+(https?:\/\/)/g, "$1$2")
									.replace(/(["'])\/\/web.archive.org\/web\/[0-9]+(?:[a-z]+_)?\/+https?:(\/\/)/g, "$1$2");
								//console_log(name, {old: oldlib, new: libcontents});
							}
							if (settings.lib_integrity_check) {
								var is_dev = false;
								if (false) {
									// for development (library updates/performance monitoring)
									is_dev = true;
									var start_time = 0;
									if (is_dev) {
										console_log("Size:", libcontents.length);
										console_log("Crc32:", crc32(libcontents));
										console_log("Crc32_2:", crc32(libcontents + (libcontents.length + "")));
										start_time = Date.now();
									}
								}
								if (libcontents.length !== lib_obj.size) {
									console_error("Wrong response length for " + name + ": " + libcontents.length + " (expected " + lib_obj.size + ")");
									return done(null, false);
								}
								var crc = crc32(libcontents);
								if (crc !== lib_obj.crc32) {
									console_error("Wrong crc32 for " + name + ": " + crc + " (expected " + lib_obj.crc32 + ")");
									return done(null, false);
								}
								crc = crc32(libcontents + (lib_obj.size + ""));
								if (crc !== lib_obj.crc32_size) {
									console_error("Wrong crc32 #2 for " + name + ": " + crc + " (expected " + lib_obj.crc32_size + ")");
									return done(null, false);
								}
								if (is_dev)
									console_log("Check time:", Date.now() - start_time);
							}
							run_sandboxed_lib_safe(libcontents, lib_obj.xhr, function(exported) {
								done(exported, 0);
							});
							//done(run_sandboxed_lib_safe(libcontents, lib_obj.xhr), 0);
							//done(new Function(libcontents + ";return lib_export;")(), 0);
						}
					});
				}
			});
		} else {
			return cb(null);
		}
	};
	var normalize_whitespace = function(str) {
		// https://stackoverflow.com/a/11305926
		return str
			.replace(/[\u200B-\u200D\uFEFF]/g, '')
			.replace(/[\u2800]/g, ' ');
	};
	var strip_whitespace_simple = function(str) {
		if (!str || typeof str !== "string") {
			return str;
		}
		return str
			.replace(/^\s+/, "")
			.replace(/\s+$/, "");
	};
	var strip_whitespace = function(str) {
		if (!str || typeof str !== "string") {
			return str;
		}
		return strip_whitespace_simple(normalize_whitespace(str));
	};
	var get_image_size = function(url, cb) {
		var image = new Image();
		var timeout = null;
		var finalcb = function(e) {
			image.onload = null;
			image.onerror = null;
			clearTimeout(timeout);
			var x, y;
			if (!image.naturalHeight || !image.naturalWidth) {
				x = null;
				y = null;
			}
			x = parse_int(image.naturalWidth);
			y = parse_int(image.naturalHeight);
			image.src = ""; // stop loading
			cb(x, y);
		};
		image.onload = image.onerror = finalcb;
		timeout = setInterval(function() {
			if (image.naturalHeight && image.naturalWidth) {
				finalcb();
			}
		}, 10);
		image.src = url;
	};
	if (is_node || typeof "Image" === "undefined") {
		get_image_size = null;
	}
	var sort_by_key = function(array, key, indexer, options) {
		if (!options)
			options = {};
		return array.sort(function(a, b) {
			var a_key = a[key];
			var b_key = b[key];
			if (indexer) {
				a_key = indexer(a_key);
				b_key = indexer(b_key);
			} else {
				a_key = parseFloat(a_key) || 0;
				b_key = parseFloat(b_key) || 0;
			}
			if (options.reverse)
				return b_key - a_key;
			else
				return a_key - b_key;
		});
	};
	var sort_by_array = function(array_to_sort, sortkey_array, indexer) {
		array_to_sort.sort(function(a, b) {
			var a_value = a;
			var b_value = b;
			if (indexer) {
				a_value = indexer(a_value);
				b_value = indexer(b_value);
			}
			var a_index = array_indexof(sortkey_array, a_value);
			var b_index = array_indexof(sortkey_array, b_value);
			if (a_index < 0) {
				if (b_index >= 0)
					return 1;
				else if (typeof a_value === "string" && typeof b_value === "string")
					return a_value.localeCompare(b_value);
				else
					return 0;
			} else {
				if (b_index < 0)
					return -1;
				else
					return a_index - b_index;
			}
		});
		return array_to_sort;
	};
	var parse_tag_def = function(tag) {
		var match = tag.match(/^<([-a-zA-Z0-9]+)((?:\s+[-a-z0-9A-Z]+(?:=(?:"[^"]*"|'[^']*'|[-_a-zA-Z0-9]+))?)*)\s*(\/?)>/);
		if (!match) {
			return null;
		}
		var parsed = {
			tagname: match[1],
			selfclosing: !!match[3],
			args: {},
			args_array: []
		};
		var args_regex = /\s+([-a-z0-9A-Z]+)(?:=("[^"]+"|'[^']+'|[-_a-zA-Z0-9]+))?/;
		var args = match[2];
		match = args.match(new RegExp(args_regex, "g"));
		if (!match)
			return parsed;
		for (var i = 0; i < match.length; i++) {
			var submatch = match[i].match(args_regex);
			var argname = submatch[1].toLowerCase();
			var argvalue = submatch[2];
			if (!argvalue) {
				argvalue = "";
			} else {
				argvalue = decode_entities(argvalue.replace(/^["'](.*)["']$/, "$1"));
			}
			parsed.args[argname] = argvalue;
			parsed.args_array.push({ name: submatch[1], value: argvalue });
		}
		return parsed;
	};
	var get_meta = function(text, property) {
		var regex = new RegExp("<meta\\s+(?:(?:property|name|itemprop)=[\"']?" + property + "[\"']?\\s+(?:content|value|href)=[\"']([^'\"]+)[\"']|(?:content|value|href)=[\"']([^'\"]+)[\"']\\s+(?:property|name|itemprop)=[\"']?" + property + "[\"']?)\\s*\/?>");
		var match = text.match(regex);
		if (!match)
			return null;
		return decode_entities(match[1] || match[2]);
	};
	var fixup_js_obj = function(objtext) {
		return objtext
			.replace(/([{,])\s*([^[{,"'\s:]+)\s*:/g, "$1 \"$2\":")
			.replace(/(\"[^\s:"]+?\":)\s*'([^']*)'(\s*[,}])/g, "$1 \"$2\"$3")
			.replace(/,\s*}$/, "}");
	};
	// note: this is technically incorrect (too loose), as it'll allow things like:
	// {x: {} y: {}}
	// this is intentional, as otherwise it grows with exponential complexity ("kvcw*", "kvw?")
	var js_obj_token_types = {
		whitespace: /\s+/,
		jvarname: /[$_a-zA-Z][$_a-zA-Z0-9]*/,
		jpropname: /[$_a-zA-Z0-9]+/,
		number: /-?(?:[0-9]*\.[0-9]+|[0-9]+|[0-9]+\.)(?:e[0-9]+)?/,
		objstart: /{/,
		objend: /}/,
		object: ["objstart", "whitespace?", "kvcw*", "objend"],
		arrstart: /\[/,
		arrend: /]/,
		array: ["arrstart", "whitespace?", "valuecw*", "arrend"],
		true: /true/,
		false: /false/,
		null: /null/,
		value: [["array"], ["object"], ["sstring"], ["dstring"], ["number"], ["true"], ["false"], ["null"]],
		valuew: ["value", "whitespace?"],
		valuec: ["valuew", "comma?"],
		valuecw: ["valuec", "whitespace?"],
		comma: /,/,
		colon: /:/,
		squote: /'/,
		dquote: /"/,
		sstring: ["squote", "sliteral", "squote"],
		dstring: ["dquote", "dliteral", "dquote"],
		propname: [["jpropname"], ["sstring"], ["dstring"]],
		kv: ["propname", "whitespace?", "colon", "whitespace?", "value"],
		kvw: ["kv", "whitespace?"],
		kvc: ["kvw", "comma?"],
		kvcw: ["kvc", "whitespace?"],
		doc: [["object"], ["array"]]
	};
	var parse_js_obj = function(objtext, js_obj_token_types) {
		// for testing purposes
		/*var is_array = function(x) {
			return Array.isArray(x);
		};

		var array_extend = function(array, other) {
			[].push.apply(array, other);
		};*/
		js_obj_token_types = deepcopy(js_obj_token_types);
		for (var key in js_obj_token_types) {
			var value = js_obj_token_types[key];
			if (value instanceof RegExp) {
				js_obj_token_types[key] = {
					type: "regex",
					value: new RegExp("^" + value.source)
				};
			} else if (is_array(value)) {
				if (is_array(value[0])) {
					js_obj_token_types[key] = {
						type: "or",
						value: value
					};
				} else {
					js_obj_token_types[key] = {
						type: "and",
						value: value
					};
				}
			}
		}
		//console_log(js_obj_token_types);
		var times_ran = 0;
		var token_frequency = {};
		var stack_frequency = {};
		var find_token_regex = function(token_type, tt, i) {
			var text = objtext.substring(i);
			//console.log(text, tt, i);
			var match = text.match(tt);
			if (!match || match.index !== 0) {
				return null;
			} else {
				return [{
						name: token_type,
						i: i,
						ni: i + match[0].length,
						value: match[0],
						length: match[0].length
					}];
			}
		};
		var find_token_sliteral = function(token_type, i) {
			var quote = token_type === "dliteral" ? '"' : "'";
			var text = "";
			var escaping = false;
			var j;
			for (j = i; j < objtext.length; j++) {
				var ch = objtext[j];
				if (escaping) {
					escaping = false;
					if (ch === "x") {
						text += "\\u00" + objtext.substr(j + 1, 2);
						j += 2;
					} else if (ch !== '"' && ch !== "'") {
						text += "\\" + ch;
					} else {
						text += ch;
					}
					continue;
				}
				if (ch === quote) {
					break;
				} else if (ch === "\\") {
					escaping = true;
				} else {
					text += ch;
				}
			}
			return [{
					name: token_type,
					i: i,
					ni: j,
					value: text,
					length: j - i
				}];
		};
		var find_token = function(token_type, i, stack) {
			//console_log(token_type, i);
			times_ran++;
			if (!(token_type in token_frequency))
				token_frequency[token_type] = 0;
			token_frequency[token_type]++;
			if (!(stack in stack_frequency))
				stack_frequency[stack] = 0;
			stack_frequency[stack]++;
			if (token_type === "sliteral" || token_type === "dliteral") {
				return find_token_sliteral(token_type, i);
			}
			var tt = js_obj_token_types[token_type];
			//console.log(token_type, tt);
			if (tt.type === "and") {
				return find_token_array_and(tt, i, stack);
			} else if (tt.type === "or") {
				return find_token_array_or(tt, i, stack);
			} else {
				return find_token_regex(token_type, tt.value, i);
			}
		};
		var find_token_array = function(array, i, stack) {
			var tokens = [];
			for (var j = 0; j < array.length; j++) {
				var token_type = array[j];
				var lastchar = token_type[token_type.length - 1];
				var minuslast = token_type.substring(0, token_type.length - 1);
				if (lastchar === "?") {
					//console.log("[START ?]", token_type, i, stack);
					var token = find_token(minuslast, i, stack + 1);
					//console.log("[END ?]", token_type, i, stack, token);
					if (!token || token.length === 0)
						continue;
					array_extend(tokens, token);
					i = token[token.length - 1].ni;
				} else if (lastchar === "*") {
					while (true) {
						//console.log("[START *]", token_type, i, stack);
						var token = find_token(minuslast, i, stack + 1);
						//console.log("[END *]", token_type, i, stack, token);
						if (!token || token.length === 0)
							break;
						array_extend(tokens, token);
						i = token[token.length - 1].ni;
					}
				} else {
					var token = find_token(token_type, i, stack + 1);
					if (!token || token.length === 0) {
						if (tokens.length > 10 && false)
							console.log(tokens, token_type, i);
						return null;
					}
					array_extend(tokens, token);
					i = token[token.length - 1].ni;
				}
			}
			return tokens;
		};
		var find_token_array_and = function(tt, i, stack) {
			return find_token_array(tt.value, i, stack);
		};
		var find_token_array_or = function(tt, i, stack) {
			for (var j = 0; j < tt.value.length; j++) {
				var token = find_token_array(tt.value[j], i, stack);
				if (token && token.length) {
					return token;
				}
			}
			return null;
		};
		var outer_tokens = find_token("doc", 0, 0);
		return outer_tokens;
	};
	var fixup_js_obj_proper = function(objtext) {
		var parsed = parse_js_obj(objtext, js_obj_token_types);
		//console.log(parsed);
		if (!parsed)
			throw "unable to parse";
		var token_types = {
			whitespace: " ",
			jvarname: function(x) { return '"' + x + '"'; },
			jpropname: function(x) { return '"' + x + '"'; },
			squote: "\"",
			sliteral: function(x) { return x.replace(/"/g, "\\\""); },
			dliteral: function(x) { return x.replace(/"/g, "\\\""); },
			comma: function(x, next) {
				if (!next || next.name === "objend" || next.name === "arrend") {
					return "";
				} else {
					return x;
				}
			}
		};
		var stringified = "";
		for (var i = 0; i < parsed.length; i++) {
			var token = parsed[i];
			if (token.name in token_types) {
				var tt = token_types[token.name];
				if (typeof tt === "function") {
					var n = 1;
					var next_token = parsed[i + (n++)];
					while (next_token && next_token.name === "whitespace") {
						next_token = parsed[i + (n++)];
					}
					stringified += tt(token.value, next_token);
				} else {
					stringified += tt;
				}
			} else {
				stringified += token.value;
			}
		}
		return stringified;
	};
	common_functions["get_bigint"] = function(do_request, cb) {
		if (typeof BigInt !== "undefined") {
			var nativebigint = {
				create: function(num) {
					return BigInt(num);
				},
				add: function(num, num1) {
					return num + num1;
				},
				sub: function(num, num1) {
					return num - num1;
				},
				mul: function(num, num1) {
					return num * num1;
				},
				div: function(num, num1) {
					return num / num1;
				},
				mod: function(num, num1) {
					return num % num1;
				},
				stringify: function(num) {
					return num.toString();
				}
			};
			cb(nativebigint);
		} else {
			get_library("BigInteger", settings, do_request, function(lib) {
				if (!lib) {
					return cb(null);
				}
				var libbigint = {
					create: function(num) {
						return lib(num);
					},
					add: function(num, num1) {
						return num.add(num1);
					},
					sub: function(num, num1) {
						return num.subtract(num1);
					},
					mul: function(num, num1) {
						return num.multiply(num1);
					},
					div: function(num, num1) {
						return num.divide(num1);
					},
					mod: function(num, num1) {
						return num.mod(num1);
					},
					stringify: function(num) {
						return num.toString();
					}
				};
				cb(libbigint);
			});
		}
	};
	// cookie: postpagebeta=0; postpagebetalogged=0
	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_url = url.replace(/^http:/, "https:");
			var request_headers;
			if (apply_headers) {
				request_headers = headers;
			}
			do_request({
				url: request_url,
				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);
						if (resp.status === 404) {
							return done({
								bad: true
							}, false);
						}
						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) {
						retobj.found_match = false;
						var nsfwmatch = resp.responseText.match(/<a.*?btn-wall--yes.*?\.(?:signin|cookie)\(/);
						var msg = "Unable to find match for Imgur page";
						if (nsfwmatch) {
							msg += " (it's probably NSFW and you aren't logged in)";
							retobj.nsfw = true;
						}
						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 {
						retobj.found_match = true;
						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 = void 0;
						}
						done(retobj, 6 * 60 * 60);
					}
					;
				}
			});
		};
		api_cache.fetch(cache_key, cb, real_fetch);
	};
	common_functions["imgur_run_api"] = function(do_request, api_cache, endpoint, query, cb) {
		if (!query)
			query = {};
		query.client_id = base64_decode("IDU0NmMyNWE1OWM1OGFkNw==").slice(1);
		var url = endpoint + "?" + stringify_queries(query);
		real_api_query(api_cache, do_request, "imgur_api:" + url, {
			url: url,
			imu_mode: "xhr",
			headers: {
				Referer: "https://imgur.com/"
			},
			json: true
		}, cb, function(done, resp) {
			return done(resp, 60 * 60);
		});
	};
	common_functions["imgur_api_fetch_album_media"] = function(do_request, api_cache, type, id, cb) {
		// another option: https://api.imgur.com/3/image/id?client_id=...
		//                 https://api.imgur.com/3/album/id?client_id=...
		// works for logged in accounts, does it work for anonymous accounts too? is there a reason to use this instead?
		if (type === "album")
			type = "albums";
		else if (type === "image")
			type = "media";
		var endpoint = "https://api.imgur.com/post/v1/" + type + "/" + id;
		// FIXME: is adconfig,account required?
		var query = { include: "media,adconfig,account" };
		return common_functions["imgur_run_api"](do_request, api_cache, endpoint, query, cb);
	};
	common_functions["imgur_fetch_album_media"] = function(options, api_cache, type, id, cb) {
		if (type !== "album" && type !== "image") {
			console_error("Bug! Invalid type:", type);
			return cb(null);
		}
		var finalcb = function(data) {
			if (!data)
				return cb(data);
			var normalized = common_functions["imgur_normalize"](data);
			return cb(normalized);
		};
		if (("rule_specific" in options) && ("imgur_source" in options.rule_specific) && options.rule_specific.imgur_source) {
			var url = "https://imgur.com/";
			if (type === "album")
				url += "a/";
			url += id;
			common_functions["fetch_imgur_webpage"](options.do_request, api_cache, null, url, function(data) {
				// either new webpage or nsfw
				//console_log(data);
				if (!data || !data.found_match || !data.imageinfo) {
					return common_functions["imgur_api_fetch_album_media"](options.do_request, api_cache, type, id, finalcb);
				} else {
					return finalcb(data.imageinfo);
				}
			});
		} else {
			return common_functions["imgur_api_fetch_album_media"](options.do_request, api_cache, type, id, finalcb);
		}
	};
	common_functions["imgur_normalize"] = function(obj) {
		// v1
		if (!("media" in obj)) {
			if (obj.album_images) {
				// old web
				obj.media = obj.album_images.images;
			} else if (obj.images) {
				// v3
				obj.media = obj.images;
			}
		}
		// v1
		if (!("is_album" in obj)) {
			// old web
			if ("album_images" in obj)
				obj.is_album = true;
		}
		// v1
		if (!("url" in obj)) {
			if (obj.link) {
				// v3
				obj.url = obj.link;
			} else if (obj.hash) {
				// old web
				var prefix = "https://imgur.com/";
				if (obj.is_album) {
					prefix += "a/";
				}
				obj.url = prefix + obj.hash;
			}
		}
		return obj;
	};
	common_functions["imgur_image_to_obj"] = function(options, baseobj, json) {
		var retobj = [];
		try {
			//if (!json.is_album && json.media && json.media.length === 1)
			//	json = json.media[0];
			var metadata = json;
			// api
			if (json.metadata)
				metadata = json.metadata;
			if (metadata.description || metadata.title) {
				baseobj.extra.caption = metadata.description || metadata.title;
			}
			if (!json.hash) {
				// v1?
				if (json.id) {
					json.hash = json.id;
				}
			}
			if (!baseobj.headers)
				baseobj.headers = { Referer: null };
			if (!baseobj.referer_ok)
				baseobj.referer_ok = { same_domain_nosub: true };
			baseobj.extra.page = "https://imgur.com/" + json.hash;
			if (json.ext) {
				// v1?
				if (json.ext[0] !== ".")
					json.ext = "." + json.ext;
				if (json.ext.toLowerCase() === ".jpeg")
					json.ext = ".jpg";
			}
			var realfilename = null;
			if (json.hash && json.ext) {
				realfilename = json.hash + json.ext;
				var base1obj = deepcopy(baseobj);
				// v1
				if (("rule_specific" in options) && ("imgur_filename" in options.rule_specific) && options.rule_specific.imgur_filename) {
					if (json.name)
						base1obj.filename = json.name;
				}
				var obj = deepcopy(base1obj);
				obj.url = "https://i.imgur.com/" + realfilename;
				var mimetype = json.mimetype || json.mime_type;
				if (/^video\//.test(mimetype)) {
					obj.video = true;
					retobj.push(obj);
					var obj1 = deepcopy(base1obj);
					obj1.url = "https://i.imgur.com/" + json.hash + ".jpg";
					retobj.push(obj1);
				} else {
					// Prefer video if possible
					var animated = metadata.is_animated || json.animated;
					// fixme: prefer_video isn't in the api version
					if (animated && (json.prefer_video || true)) {
						var newobj = deepcopy(base1obj);
						newobj.url = "https://i.imgur.com/" + json.hash + ".mp4";
						newobj.video = true;
						retobj.push(newobj);
					}
					retobj.push(obj);
				}
			}
			// (old) webpage
			// doesn't work anymore
			if (false && json.source && /^https?:\/\//.test(json.source)) {
				if (!("rule_specific" in options) || !("imgur_source" in options.rule_specific) || options.rule_specific.imgur_source === true) {
					retobj.unshift({ url: json.source });
				}
			}
		} catch (e) {
			console_error(e);
			retobj = [];
		}
		return retobj;
	};
	common_functions["deviantart_url_from_id"] = function(do_request, api_cache, id, cb) {
		if (typeof id === "string" && /^[a-z0-9]+$/.test(id) && id.length === 7 && id[0] === "d") {
			// 28298170368.toString(36) = "d000000"
			var numerical_id = parseInt(id, 36) - 28298170368;
			//return cb("https://deviantart.com/a/art/" + numerical_id);
			return common_functions["deviantart_url_from_id"](do_request, api_cache, numerical_id, cb);
		} else {
			real_api_query(api_cache, do_request, "deviantart_url_from_id:" + id, {
				method: "HEAD",
				url: "http://fav.me/" + id, // https doesn't work
				cookie_url: "https://www.deviantart.com/" // workaround
			}, cb, function(done, resp, cache_key) {
				done(resp.finalUrl, 6 * 60 * 60);
			});
		}
	};
	common_functions["deviantart_page_from_id"] = function(do_request, api_cache, id, cb) {
		common_functions["deviantart_url_from_id"](do_request, api_cache, id, function(url) {
			if (!url)
				return cb(null);
			real_api_query(api_cache, do_request, "deviantart_page_from_id:" + id, {
				url: url
			}, cb, function(done, resp, cache_key) {
				done(resp, 60 * 60);
			});
		});
	};
	common_functions["wix_image_info"] = function(url) {
		var obj = {};
		// 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\/+)?([if])\/+[-0-9a-f]{20,}\/+[^/?]+([?#].*)?$/);
		if (match) {
			if (match[3] && match[3][0] === "?") {
				obj.has_token = true;
			}
			if (match[1] === "i") {
				obj.preview = true;
			} else {
				obj.original = true;
			}
			return obj;
		}
		var match = url.match(/^[a-z]+:\/\/[^/]+\/+(?:intermediary\/+)?[if]\/+[-0-9a-f]{20,}\/+[^/]+\/+v1\/+(?:fit|fill|crop)\/+([^/]+)\/+[^/]+(?:[?#].*)?$/);
		if (!match) {
			return null;
		}
		var infostr = match[1];
		var splitted = infostr.split(",");
		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, prefer_size) {
		if (_nir_debug_)
			console_log("wix_compare", url1, url2, prefer_size);
		if (!url2)
			return url1;
		var info1 = common_functions["wix_image_info"](url1);
		var info2 = common_functions["wix_image_info"](url2);
		if (_nir_debug_)
			console_log("wix_compare (info1:", info1, "info2:", info2, ")");
		if (!info1 || !info2)
			return null;
		// needed to avoid constant reloading between /intermediary/ and /f/.*?token
		// thanks to Wisedrow on discord for reporting
		// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/4ac770c0-c37b-43a0-866f-2a2707ea61c7/d854mkr-cf30cc53-6b99-4651-916d-1703c943255c.jpg
		if (info1.original && info2.original) {
			if (info2.has_token) {
				return url1;
			} else {
				return url2;
			}
		}
		if (info1.original && (!prefer_size || !info2.preview))
			return url1;
		if (info2.original && (!prefer_size || !info1.preview))
			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["_wix_bigimage_inner"] = function(src) {
		var newsrc = src.replace(/(:\/\/[^/]*\/)(f\/+[-0-9a-f]{36}\/+[0-9a-z]+-[-0-9a-f]{20,}(?:\.[^/.]*)?\/+v1\/+(?:fill|fit)\/+w_[0-9]+,h_[0-9]+)(?:,[^/]+)?(\/+.*[?&]token=.*)$/, "$1$2,q_100$3");
		if (newsrc !== src) {
			return newsrc;
		}
		// thanks to MrSeyker on greasyfork: https://greasyfork.org/en/scripts/36662-image-max-url/discussions/34976#comment-160842
		newsrc = src.replace(/(:\/\/[^/]*\/f\/+[-0-9a-f]{36}\/+[0-9a-z]+-[-0-9a-f]{20,}\.(?:png|PNG)\/+v1\/+(?:fill|fit)\/+[^/]+\/+[^/?#]+)\.[^/.?#]+(\?.*)?$/, "$1.png$2");
		if (newsrc !== src) {
			return newsrc;
		}
		// thanks to MrSeyker on github: https://github.com/qsniyg/maxurl/issues/616#issuecomment-762570739
		// https://www.deviantart.com/hugotendaz/art/Rosetta-The-Best-Buns-Cartoony-PinUp-Comm-729023803
		// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/a776a3e5-3e6f-4f61-89b7-1724ab9c2567/dc21id7-2610a389-46ea-4388-83ec-e144cfa0b73c.jpg?token=... -- 71kb
		// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/intermediary/f/a776a3e5-3e6f-4f61-89b7-1724ab9c2567/dc21id7-2610a389-46ea-4388-83ec-e144cfa0b73c.jpg -- 43kb, visible artifacting
		if (!/^[a-z]+:\/\/[^/]+\/+f\/+[-0-9a-f]{36}\/+[a-z0-9]{5,}-[-0-9a-f]{36}\.[^/.?#]+\?token=[^&]+(?:#.*)?$/.test(src)) {
			newsrc = src.replace(/(:\/\/[^/]*\/)(f\/+[-0-9a-f]{36}\/+.*?)[?&]token=.*$/, "$1intermediary/$2");
			if (newsrc !== src) {
				return newsrc;
			}
		}
		if (!src.match(/[?&]token=.{30,}/)) {
			newsrc = src
				.replace(/(\.[^/.]*)\/v1\/.*/, "$1")
				.replace(/(\/[^/.]*\.[^/.]*?)_[_0-9.a-z]*$/, "$1");
			if (newsrc !== src) {
				return newsrc;
			}
		}
		return null;
	};
	// FIXME: this is basically replicating bigimage_recursive
	common_functions["wix_bigimage"] = function(src) {
		var urls = [];
		while (src) {
			urls.unshift(src);
			src = common_functions["_wix_bigimage_inner"](src);
		}
		return urls;
	};
	common_functions["deviantart_fullimage"] = function(options, api_cache, src, id, cb) {
		// animated:
		// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/i/db0d85b1-b8b9-4790-bef0-121edb2dce7d/ddabn1h-5342115a-06a6-4f89-9c54-a2843719553a.jpg/v1/fit/w_150,h_150,q_70,strp/spaghetti_high_by_f1x_2_ddabn1h-150.jpg
		// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/i/db0d85b1-b8b9-4790-bef0-121edb2dce7d/ddabn1h-5342115a-06a6-4f89-9c54-a2843719553a.jpg -- 1920x1080, but original size says 1280x720 and is animated. however, it doesn't look upscaled either
		//   https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/db0d85b1-b8b9-4790-bef0-121edb2dce7d/ddabn1h-1d7ac558-1fa8-4943-a3b6-0ad8b06be106.gif
		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
				}
			};
			var urls = [];
			if (!src.match(/:\/\/[^/]*\/fake_image\//)) {
				array_extend(urls, common_functions["wix_bigimage"](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) {
				try {
					// for some reason DA escapes ', breaking JSON.parse
					initialstate = JSON_parse(JSON_parse(initialstate[1].replace(/\\'/g, "'")));
				} catch (e) {
					console.error(e, { initialstate: initialstate, result: result });
					throw e;
				}
				console_log(initialstate);
				try {
					var entities = initialstate["@@entities"];
					var deviation = entities.deviation[deviationid];
					var deviationExtended = null;
					if (entities.deviationExtended)
						deviationExtended = entities.deviationExtended[deviationid];
					if (_nir_debug_) {
						console_log("Deviation object", deviation);
						console_log("Extended deviation object", deviationExtended);
					}
					if (deviation.title)
						obj.extra.caption = deviation.title;
					var maxurl = obj.url;
					var files = deviation.files;
					if (is_array(files)) {
						for (var i = files.length - 1; i >= 0; i--) {
							var current = files[i];
							var newurl = common_functions["wix_compare"](current.src, maxurl, options.rule_specific.deviantart_prefer_size);
							if (newurl === current.src)
								maxurl = newurl;
						}
					} else if ("media" in deviation && is_array(deviation.media.types)) {
						if (deviation.media.prettyName)
							obj.filename = deviation.media.prettyName;
						var types = deviation.media.types;
						for (var i = types.length - 1; i >= 0; i--) {
							var link = null;
							var tokenid = 0;
							// https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/40458dca-4360-4b4b-8aca-ba831f8db36d/ddsdflz-9484b31e-187e-4761-9724-6853698242a7.png/v1/fill/w_712,h_1123,q_100/morning_sun_by_pegaite_ddsdflz-pre.png
							// https://www.deviantart.com/pegaite/art/Morning-Sun-833716295
							if ("r" in types[i] && types[i].r < deviation.media.token.length)
								tokenid = types[i].r;
							var tokenq = "?token=" + deviation.media.token[tokenid];
							if (types[i].c) {
								link = deviation.media.baseUri + "/" + types[i].c.replace("<prettyName>", deviation.media.prettyName).replace(/^\/+/, "") + tokenq;
							} else if (types[i].b) { // e.g. animated gifs
								link = types[i].b + tokenq;
							} else if (types[i].t === "fullview" && "r" in types[i]) {
								// TODO: improve check?
								link = deviation.media.baseUri + tokenq;
							}
							// Occasionally this exists for some images, where it instead has:
							// s: "https://st.deviantart.net/misc/noentrythumb-200.png" (for t: "social_preview")
							if (!link)
								continue;
							var newurl = common_functions["wix_compare"](link, maxurl, options.rule_specific.deviantart_prefer_size);
							if (newurl === link)
								maxurl = newurl;
						}
					}
					var suburls = [];
					var ourobj = {};
					suburls = common_functions["wix_bigimage"](maxurl);
					var image_info = common_functions["wix_image_info"](maxurl);
					if (false && image_info && image_info.original) {
						ourobj.is_original = true;
					}
					// basically: array_prepend(urls, suburls);
					array_extend(suburls, urls);
					urls = suburls;
					if (deviationExtended) {
						if (options.rule_specific.deviantart_support_download && deviationExtended.download && deviationExtended.download.url) {
							urls.unshift({
								url: deviationExtended.download.url,
								is_private: true
							});
						}
					}
				} catch (e) {
					console_error(e);
				}
			}
			if (false) {
				// remove duplicates (todo: factor this out?)
				var prevurls = new_set();
				for (var i = 0; i < urls.length; i++) {
					if (set_has(prevurls, urls[i].url)) {
						urls.splice(i, 1);
						i--;
					} else {
						set_add(prevurls, urls[i].url);
					}
				}
			}
			return cb(fillobj_urls(urls, obj));
		});
	};
	common_functions["getty_image_info"] = function(url) {
		if (!/^[a-z]+:\/\/media\.(?:gettyimages|istockphoto)\.com\//.test(url)) {
			return null;
		}
		var info = {};
		var match = url.match(/:\/\/[^/]+\/+id\/+([0-9]+)\/(?:[a-z]{2}\/+)?([^/.]+)\/+([^/.]+)\.([a-z]+)/);
		if (match) {
			info["id"] = match[1];
			info["category"] = match[2];
			info["filename"] = match[3];
			info["ext"] = match[4];
		} else {
			match = url.match(/\/([a-z]+?)s?\/+([^/.]*?)-id([0-9]+)(?:[?#].*)?$/);
			if (match) {
				info["id"] = match[3];
				info["category"] = match[1];
				info["filename"] = match[2];
				info["ext"] = "jpg";
			}
		}
		if (!info["id"])
			return null;
		var queries = get_queries(url);
		if (!queries) {
			queries = {};
		}
		if (!queries.s) {
			info["size"] = 1024;
			info["size2"] = 1024 * 1024;
		} else {
			var sizematch = (queries.s + "").match(/^([0-9]+)x([0-9]+)$/);
			if (sizematch) {
				var size1 = parse_int(sizematch[1]);
				var size2 = parse_int(sizematch[2]);
				info["size"] = Math_max(size1, size2);
				info["size2"] = size1 * size2;
			} else {
				info["size"] = 0;
				info["size2"] = 0;
			}
		}
		if (queries.w) {
			if (queries.w === "0")
				info["watermark"] = false;
			else
				info["watermark"] = queries.w;
		} else {
			if (info["size"] <= 170) {
				info["watermark"] = false;
			} else {
				info["watermark"] = "gi";
			}
		}
		return info;
	};
	common_functions["getty_transform_url"] = function(url) {
		return url
			.replace(/(\/id\/+[0-9]+\/+)(?:[a-z]{2}\/+)?foto\/+/, "$1photo/")
			.replace(/(\/id\/+[0-9]+\/+)(?:[a-z]{2}\/+)?(?:向量|%E5%90%91%E9%87%8F)\/+/, "$1vector/")
			.replace(/\/id\/+([0-9]+)\/+(?:[a-z]{2}\/+)?(photo|vector)\/+([^/.?#]+)(?:[?#.].*)?$/, "/$2s/$3-id$1");
	};
	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, options.do_request, 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) {
							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 parse_int(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["static_unpack_packer"] = function(format, base, in_table_length, in_table) {
		var encode_base62 = function(n) {
			var output = "";
			if (n >= base) {
				output = encode_base62(parse_int(n / base));
			}
			n = n % base;
			if (n > 35) {
				output += string_fromcharcode(n + 29);
			} else {
				output += n.toString(36);
			}
			return output;
		};
		var encode_base10 = function(n) {
			return n + "";
		};
		var encode_base36 = function(n) {
			return n.toString(base);
		};
		var encode;
		if (base === 10) {
			encode = encode_base10;
		} else if (base <= 36) {
			encode = encode_base36;
		} else { // base can be things like 14 too
			encode = encode_base62;
		}
		var table = {};
		for (var i = in_table_length; i >= 0; i--) {
			var encoded = encode(i);
			table[encoded] = in_table[i] || encoded;
		}
		return format.replace(/\b\w+\b/g, function(e) {
			return table[e];
		});
	};
	common_functions["unpack_packer"] = function(packed) {
		var regex = /eval\(function\(p,a,c,k,e,[rd]\){.*?return p}\('(.*?)',([0-9]+),([0-9]+),'(.*?)'\.split\('[|]'\)(?:,0,{})?\)\)/;
		var match = packed.match(regex);
		if (!match) {
			return null;
		}
		var format = match[1].replace(/([^\\])\\'/g, "$1'");
		var base = parseInt(match[2]);
		var table_length = parseInt(match[3]);
		var table = match[4].split("|");
		return common_functions["static_unpack_packer"](format, base, table_length, table);
	};
	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].user.username;
		}
	};
	common_functions["instagram_get_imageid"] = function(image_url) {
		if (!image_url)
			return image_url;
		if (typeof image_url === "number")
			return image_url; // e.g. img_i: 0, 1, 2
		// story id
		var newurl = image_url.replace(/.*\/stories\/+[^/]+\/+([0-9]+)\/*(?:[?#].*)?$/, "$1");
		if (newurl !== image_url)
			return newurl;
		// thanks to robindz on github for reporting: https://github.com/qsniyg/maxurl/issues/983
		// https://scontent-bru2-1.cdninstagram.com/v/t51.2885-15/e35/271760634_141729454899363_6673546970842196313_n.webp.jpg
		newurl = image_url.replace(/.*\/([^/.?#]*)\.[^/]*(?:[?#].*)?$/, "$1");
		if (newurl === image_url)
			return null;
		return newurl;
	};
	common_functions["instagram_norm_url"] = function(src) {
		// thanks to remlap on github: https://github.com/qsniyg/maxurl/issues/239
		// https://github.com/qsniyg/maxurl/issues/522
		// some info: https://sorsnce.com/2020/04/15/the-truth-about-social-media-content-delivery-networks/
		// _nc_cat is useless, but doesn't appear to change anything, so let's not remove it to avoid useless redirects
		// no idea if ig_cache_key does anything or not, but since we're changing the url, perhaps, from the name, this could lead to issues?
		// no idea what efg or _nc_rid do, haven't seen them change anything yet
		return remove_queries(src, ["se", "ig_cache_key"]);
		//return remove_queries(src, ["se", "_nc_cat", "_nc_rid", "efg", "ig_cache_key"]);
		// these remove_queries calls are separated in case the next one doesn't work.
		/*newsrc = remove_queries(src, ["se"]);
		if (newsrc !== src)
			return newsrc;

		newsrc = remove_queries(src, ["_nc_cat", "_nc_rid", "efg", "ig_cache_key"]);
		if (newsrc !== src)
			return newsrc;*/
	};
	common_functions["set_cdninstagram_obj"] = function(obj) {
		if (typeof obj === "string")
			obj = {
				url: obj
			};
		// https://github.com/qsniyg/maxurl/issues/719
		// if referer/origin is not present (or not set to instagram.com), "access-control-allow-origin: *" will not exist in the response headers
		// if one is set to something other than instagram.com, it will also fail
		if (!obj.headers)
			obj.headers = {};
		// referer = instagram.com is crucial to avoid throttling (thanks to remlap for reporting)
		headerobj_set(obj.headers, "Referer", "https://www.instagram.com/");
		// origin apparently seems to throttle? is this placebo?
		//headerobj_set(obj.headers, "Origin", "https://www.instagram.com"); // is this needed?
		// instagram seems to throttle without these?
		if (obj.video)
			headerobj_set(obj.headers, "Sec-Fetch-Dest", "video");
		else
			headerobj_set(obj.headers, "Sec-Fetch-Dest", "image");
		headerobj_set(obj.headers, "Sec-Fetch-Mode", "cors");
		headerobj_set(obj.headers, "Sec-Fetch-Site", "cross-site");
		// in order to allow the extension to override allow-access-control-origin
		obj.need_credentials = false;
		// is this needed to avoid throttling?
		//obj.max_chunks = 1;
		return obj;
	};
	var instagram_shortcode_table = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
	common_functions["instagram_shortcode_to_id"] = function(shortcode, cb) {
		common_functions["get_bigint"](do_request, function(bigint) {
			if (!bigint) {
				return cb(null);
			}
			shortcode = shortcode.substring(0, 11); // truncate for private ids
			var base = bigint.create(0);
			var sixtyfour = bigint.create(64);
			for (var i = 0; i < shortcode.length; i++) {
				var index = bigint.create(string_indexof(instagram_shortcode_table, shortcode[i]));
				base = bigint.mul(base, sixtyfour);
				base = bigint.add(base, index);
			}
			return cb(bigint.stringify(base));
		});
	};
	common_functions["instagram_parse_el_info"] = function(api_cache, do_request, use_app_api, dont_use_web, prefer_video_quality, info, host_url, cb) {
		var host_is_ig = /^[a-z]+:\/\/[^/]*\.instagram\.com\//.test(host_url);
		var shortcode_to_url = function(type, shortcode) {
			return "https://www.instagram.com/" + type + "/" + shortcode + "/";
		};
		var url_to_shortcode = function(url) {
			var match = url.match(/^[a-z]+:\/\/[^/]+\/+(?:[^/]+\/+)?(?:p|tv|reel)\/+([^/]+)/);
			if (match)
				return match[1];
			return null;
		};
		var id_to_shortcode, shortcode_to_id;
		var shortcode_table = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
		// TODO: don't use recursion
		// FIXME: use library instead of BigInt
		var _id_to_shortcode = function(id) {
			var sixtyfour = BigInt(64);
			if (id < sixtyfour) {
				return shortcode_table[parseInt(id)];
			} else {
				return id_to_shortcode(id / sixtyfour) + shortcode_table[id % sixtyfour];
			}
		};
		id_to_shortcode = function(id) {
			return _id_to_shortcode(BigInt(id));
		};
		shortcode_to_id = function(shortcode, cb) {
			common_functions["get_bigint"](do_request, function(bigint) {
				if (!bigint) {
					return cb(null);
				}
				shortcode = shortcode.substring(0, 11); // truncate for private ids
				var base = bigint.create(0);
				var sixtyfour = bigint.create(64);
				for (var i = 0; i < shortcode.length; i++) {
					var index = bigint.create(string_indexof(shortcode_table, shortcode[i]));
					base = bigint.mul(base, sixtyfour);
					base = bigint.add(base, index);
				}
				return cb(bigint.stringify(base));
			});
		};
		var get_sharedData_from_resptext = function(text) {
			try {
				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 (is_array(parsed.entry_data[key])) {
							if (parsed1.items && is_array(parsed1.items)) {
								parsed1 = parsed1.items[0];
							}
							parsed.entry_data[key][0] = overlay_object(parsed.entry_data[key][0], parsed1);
						}
					}
				}
				return parsed;
			} catch (e) {
				console_error(e);
			}
			return null;
		};
		var query_ig_page = function(url, cb) {
			if (!do_request)
				return cb(null);
			// 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_page_query:" + url;
			api_cache.fetch(cache_key, cb, function(done) {
				do_request({
					method: "GET",
					url: url,
					onload: function(result) {
						if (result.readyState !== 4)
							return;
						return done(result, 60 * 60);
					}
				});
			});
		};
		var query_ig = function(url, cb) {
			query_ig_page(url, function(result) {
				if (!result)
					return cb(null);
				var parsed = get_sharedData_from_resptext(result.responseText);
				if (!parsed) {
					console_log("instagram_sharedData", result);
					return cb(null);
				} else {
					return cb(parsed);
				}
			});
		};
		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].user.pk;
			}
		};
		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_page("https://www.instagram.com/" + username + "/", function(result) {
					if (!result || result.status !== 200) {
						console_error(cache_key, "Unable to query", result);
						return done(null, false);
					}
					var ids = {};
					var matches = match_all(result.responseText, /"props":{"id":"([0-9]+)",/);
					if (!matches || !matches.length) {
						console_error(cache_key, "Unable to find UID from user page", result);
						return done(null, false);
					}
					for (var _i = 0, matches_2 = matches; _i < matches_2.length; _i++) {
						var match = matches_2[_i];
						var id = match[1];
						if (!(id in ids))
							ids[id] = 0;
						ids[id]++;
					}
					// FIXME: is this needed?
					// find most popular ID. I've only observed 2 ids per page, both are the same
					var id_keys = Object.keys(ids);
					id_keys.sort(function(a, b) {
						return ids[b] - ids[a];
					});
					return done(id_keys[0], 5 * 60);
				});
			});
		};
		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)
						return done(null, false);
					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));
				}
				cb(null);
				// commenting out due to options not existing
				/*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) {
			return web_api_call(url, cb); // FIXME: for testing only
			if (!do_request) {
				return cb(null);
			}
			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)",
				// thanks to ambler on discord for reporting, earlier UAs don't receive stories anymore
				//"User-Agent": "Instagram 146.0.0.27.125 Android (23/6.0.1; 640dpi; 1440x2560; samsung; SM-G930F; herolte; samsungexynos8890; en_US)",
				//"User-Agent": "Instagram 146.0.0.27.125 Android (30/11; 420dpi; 2678x1080; samsung; SM-G988U1; z3q; qcom; en_US)", // made up
				// from instaloader:
				"User-Agent": "Instagram 146.0.0.27.125 (iPhone12,1; iOS 13_3; en_US; en-US; scale=2.00; 1656x3584; 190542906)",
				//"User-Agent": "Mozilla/5.0 (Linux; Android 10; SM-T860 Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/87.0.4280.101 Mobile Safari/537.36 Instagram 168.0.0.40.355 Android (29/10; 360dpi; 2560x1492; samsung; SM-T860; gts6lwifi; qcom; en_US; 261079769)",
				"X-IG-Capabilities": "36oD",
				"Accept": "*/*",
				"Accept-Language": "en-US,en;q=0.8",
				"Sec-CH-UA": "" // prevent the browser from leaking user-agent
			};
			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 web_api_call = function(url, cb) {
			if (!do_request) {
				return cb(null);
			}
			var run_request = function() {
				if (!wwwclaim) {
					console_warn("Unable to find value for x-ig-www-claim header");
				}
				// https://www.instagram.com/static/bundles/es6/ConsumerLibCommons.js/...
				var headers = {
					"Accept": "*/*",
					"X-ASBD-ID": "198387", // .ASBD_ID, todo: fetch! -- same as of june 28 2022
					// not always sent though?
					// id as of august 10 2023: 129477
					// TODO: x-csrftoken (csrftoken cookie)
					"X-IG-App-ID": "936619743392459", // instagramWebDesktopFBAppId
					"Origin": "https://www.instagram.com",
					"Referer": "https://www.instagram.com/",
					"Sec-Fetch-Site": "same-site",
					"Sec-Fetch-Mode": "cors",
					"Sec-Fetch-Dest": "empty"
				};
				if (wwwclaim) {
					headers["X-IG-WWW-Claim"] = wwwclaim;
				}
				do_request({
					method: "GET",
					url: url,
					headers: headers,
					onload: cb
				});
			};
			var wwwclaim = null;
			if (get_localstorage) {
				// https://www.instagram.com/static/bundles/es6/ConsumerLibCommons.js/...
				get_localstorage("https://www.instagram.com/", ["www-claim-v2"], function(data) {
					if (data && data["www-claim-v2"]) {
						wwwclaim = data["www-claim-v2"];
					}
					run_request();
				}, { storage: "session" });
			} else {
				run_request();
			}
		};
		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)
						return done(null, false);
					if (result.readyState !== 4)
						return;
					if (result.status === 200) {
						var parsed = null;
						try {
							parsed = JSON_parse(result.responseText);
						} catch (e) {
							console_log("instagram_mediainfo", result);
							console_error("instagram_mediainfo", e);
						}
						if (_nir_debug_) {
							console_log("instagram_mediainfo", parsed);
						}
						if (parsed) {
							return done(parsed, 60 * 60);
						}
					} else {
						console_error(cache_key, result);
					}
					done(null, false);
				});
			});
		};
		var get_all_stories_api = function(uid, cb) {
			return get_all_stories_webapi(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)
						return done(null, false);
					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 reels_webapi = function(id, cb) {
			if (!use_app_api)
				return cb(null);
			var reels_cache_key = "instagram_reels:" + id;
			api_cache.fetch(reels_cache_key, cb, function(done) {
				// id can be highlight:[highlight id]
				var url = "https://www.instagram.com/api/v1/feed/reels_media/?reel_ids=" + encodeURIComponent(id);
				web_api_call(url, function(result) {
					if (!result)
						return done(null, false);
					if (result.readyState !== 4)
						return;
					if (result.status !== 200) {
						console_log(reels_cache_key, result);
						return done(null, false);
					}
					try {
						var parsed = JSON_parse(result.responseText);
						if (!(id in parsed.reels)) {
							console_error(reels_cache_key, "Unable to find", id, "in", result);
							return done(null, false);
						}
						return done(parsed.reels[id], 10 * 60);
					} catch (e) {
						console_log(reels_cache_key, result);
						console_error(reels_cache_key, e);
					}
					return done(null, false);
				});
			});
		};
		var reels_api = function(id, picid, cb) {
			var cache_key = "instagram_reels:" + id;
			reels_webapi(id, function(result) {
				if (!result)
					return cb(null);
				try {
					var images = parse_story_items(result.items, picid);
					return cb(images);
				} catch (e) {
					console_error(cache_key, result);
					console_error(cache_key, e);
				}
			});
		};
		var get_all_stories_webapi = 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 + "/story/";
				web_api_call(url, function(result) {
					if (!result)
						return done(null, false);
					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.reel, 10 * 60);
					} catch (e) {
						console_log(story_cache_key, result);
						console_error(story_cache_key, e);
					}
					return done(null, false);
				});
			});
		};
		var parse_story_items = function(items, picid) {
			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);
				if (image.username && image.id)
					image.page = "https://www.instagram.com/stories/" + image.username + "/" + image.id + "/";
				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 (image.id) {
					api_cache.set("instagram_story_pic:" + image.id, image, 6 * 60 * 60);
				}
				if (picid && (item_picid === picid || item_vidid === picid || image.id === picid.replace(/_[0-9]+$/, ""))) {
					our_item = image;
				}
			}
			var album = [];
			array_foreach(all_images, function(image) {
				if (image.page) {
					album.push(image.page);
				}
				image.album_link = image.page;
				image.album = album;
			});
			if (picid) {
				if (our_item !== null)
					return our_item;
			} else {
				return all_images;
			}
			return null;
		};
		var story_api = function(picid, uid, cb) {
			var cache_key = "instagram_story_api:" + uid;
			var get_stories = function(cb) {
				get_all_stories_webapi(uid, function(result) {
					if (!result) {
						return cb(null);
					}
					try {
						var images = parse_story_items(result.items, picid);
						return cb(images);
					} catch (e) {
						console_log(cache_key, result);
						console_error(cache_key, e);
						return cb(null);
					}
				});
			};
			if (picid) {
				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 {
				// Try using the app's API
				return profile.hd_profile_pic_url_info.url;
			} catch (e) {
				// Try using the normal browser json
				try {
					return profile.profile_pic_url;
				} catch (e) {
					console_error(e, profile);
					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);
					var url = profile_to_url(profile);
					var obj = {
						url: common_functions["instagram_norm_url"](url),
						extra: {
							author_username: profile.username,
							page: "https://www.instagram.com/" + profile.username
						}
					};
					return cb(common_functions["set_cdninstagram_obj"](obj));
				});
			});
			return {
				waiting: true
			};
		};
		var parse_caption = function(caption) {
			if (typeof caption === "string")
				return caption;
			if (caption.text)
				return caption.text;
			if (caption.edges && caption.edges.length > 0)
				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 void 0;
		};
		var get_shortcode = function(item) {
			// thanks to robindz on github: https://github.com/qsniyg/maxurl/issues/983
			// shortcode was used for ajax, but new version seems to use code
			var shortcode = item.shortcode || item.code;
			return shortcode || null;
		};
		var get_page = function(item) {
			var shortcode = get_shortcode(item);
			if (!shortcode)
				return null;
			if (item.product_type === "igtv") {
				return shortcode_to_url("tv", shortcode);
			} else if (item.product_type === "clips") {
				return shortcode_to_url("reel", shortcode);
			} else {
				return shortcode_to_url("p", shortcode);
			}
		};
		var get_username = function(item) {
			// user = app, owner = graphql
			var user_obj = item.user || item.owner;
			if (user_obj && user_obj.username) {
				return user_obj.username;
			}
			return null;
		};
		var get_created_date = function(item) {
			if (item.date)
				return item.date * 1000; // *1000?
			if (item.taken_at_timestamp)
				return item.taken_at_timestamp * 1000; // *1000?
			if (item.created_time)
				return item.created_time * 1000; // *1000?
			if (item.taken_at)
				return item.taken_at * 1000; // story app api
			return null;
		};
		var get_id = function(item) {
			// app api & story graphql api (https://i.instagram.com/api/v1/feed/reels_media/?reel_ids=...)
			if (item.id && typeof item.id === "string")
				return item.id.replace(/_[0-9]+$/, "");
			if (item.pk)
				return item.pk.toString(); // this is inaccurate due to floating point issues
			return null;
		};
		var imageid_in_objarr = function(imageid, objarr) {
			for (var i = 0; i < objarr.length; i++) {
				if (imageid === "first")
					return objarr[i];
				if (typeof imageid === "number") {
					if (imageid === objarr[i].i)
						return objarr[i];
					continue;
				}
				if (string_indexof(objarr[i].src, imageid) > 0)
					return objarr[i];
				// stories
				if (objarr[i].id === imageid)
					return objarr[i];
			}
			return null;
		};
		var image_in_objarr = function(image, objarr, objarr1) {
			var imageid = image;
			if (typeof imageid === "string" && imageid !== "first")
				imageid = common_functions["instagram_get_imageid"](image);
			var largest = imageid_in_objarr(imageid, objarr);
			if (!largest)
				return null;
			var smallest = null;
			if (objarr1) {
				smallest = imageid_in_objarr(imageid, objarr1);
			}
			var retobj = {
				largest: largest
			};
			if (smallest && smallest !== largest) {
				retobj.smallest = smallest;
			}
			return retobj;
		};
		// known parts:
		//   v -- beginning of url
		//   t51.2885-15
		//   e35
		//   c118.0.688.688a -- crops the image
		var instagram_get_url_parts = function(src) {
			var parts = src.replace(/^[a-z]+:\/\/[^/]+\/+/, "").replace(/\/[^/]+(?:[?#].*)?$/, "");
			parts = parts.split(/\/+/g);
			var newparts = [];
			array_foreach(parts, function(part) {
				if (part === "v")
					return;
				if (/^e[0-9]+$/.test(part))
					return;
				if (/^t[0-9]+\./.test(part))
					return;
				newparts.push(part);
			});
			// thanks to remlap for reporting
			var queries = get_queries(src);
			if (queries && queries.stp) {
				// c0.177.1440.1440a_dst-jpg_e35_s150x150
				var transforms = queries.stp.split("_");
				array_foreach(transforms, function(part) {
					if (/^e[0-9]+$/.test(part))
						return;
					if (/^dst-/.test(part))
						return;
					array_upush(newparts, part);
				});
			}
			return newparts;
		};
		var get_maxsize_app = function(item) {
			var images = [];
			var total_images = 1;
			var get_corrected_height = function(img, candidate) {
				var corrected_height = candidate.height;
				if (!corrected_height) {
					corrected_height = (img.original_height / img.original_width) * candidate.width;
				}
				return corrected_height;
			};
			var candidates_sorter = function(a, b) {
				// thanks to robindz on github: https://github.com/qsniyg/maxurl/issues/1000
				// https://www.instagram.com/p/B7AXLsplw6Y/
				// https://www.instagram.com/p/B8BFW14Ffwz/
				if (!a.is_unprocessed || !b.is_unprocessed) {
					if (a.is_unprocessed)
						return -1;
					if (b.is_unprocessed)
						return 1;
				}
				return b.size - a.size;
			};
			var parse_image = function(img_i, img) {
				var candidates = img.image_versions2.candidates;
				var maxsize = 0;
				var maxobj = null;
				var candidate_ids = {};
				for (var i = 0; i < candidates.length; i++) {
					candidates[i].corrected_height = get_corrected_height(img, candidates[i]);
					candidates[i].is_unprocessed = instagram_get_url_parts(candidates[i].url).length === 0;
					candidates[i].image_id = common_functions["instagram_get_imageid"](candidates[i].url);
					candidates[i].size = candidates[i].width * candidates[i].corrected_height;
					if (!(candidates[i].image_id in candidate_ids))
						candidate_ids[candidates[i].image_id] = [];
					candidate_ids[candidates[i].image_id].push(candidates[i]);
				}
				var bestcandidates = [];
				for (var id in candidate_ids) {
					candidate_ids[id].sort(candidates_sorter);
					bestcandidates.push(candidate_ids[id][0]);
				}
				bestcandidates.sort(candidates_sorter);
				maxobj = bestcandidates[0];
				var image = null;
				if (maxobj !== null) {
					image = {
						src: maxobj.url,
						caption: get_caption(item),
						shortcode: get_shortcode(item),
						page: get_page(item),
						username: get_username(item),
						created: get_created_date(item),
						id: get_id(item),
						width: maxobj.width,
						height: maxobj.height,
						i: img_i + 1,
						total_images: total_images
					};
				}
				if (image && img.video_versions) {
					maxsize = 0;
					maxobj = null;
					var videos = img.video_versions;
					for (var i = 0; i < videos.length; i++) {
						videos[i].corrected_height = get_corrected_height(img, videos[i]);
						var size = videos[i].width * videos[i].corrected_height;
						// >= because for some reason, in stories, type 102==103, but higher quality than 101 (all same dimensions)
						// thanks to remlap on discord for reporting
						if (size >= maxsize) {
							maxsize = size;
							maxobj = videos[i];
						}
					}
					if (maxobj !== null) {
						image.video = maxobj.url;
						image.video_width = maxobj.width;
						image.video_height = maxobj.corrected_height;
					}
					if (img.video_dash_manifest) {
						image.video_dash = img.video_dash_manifest;
					}
				}
				if (image !== null) {
					images.push(image);
				}
			};
			if ("carousel_media" in item) {
				total_images = item.carousel_media.length;
				for (var i = 0; i < item.carousel_media.length; i++) {
					parse_image(i, item.carousel_media[i]);
				}
			} else {
				total_images = 1;
				parse_image(0, item);
			}
			return images;
		};
		var get_maxsize_graphql = function(media) {
			var images = [];
			var total_images = 1;
			var parse_image = function(img_i, node) {
				var image = node.display_src;
				if (!image)
					image = node.display_url;
				var width = 0, height = 0;
				var vwidth = 0, vheight = 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.largest.width * found_image.largest.height;
					var our_size = width * height;
					// fixme: why is this check even here? it breaks width=0, height=0 videos
					if (our_size <= found_size || true)
						return;
				}
				if (node.video_url) {
					// width/height corresponds to the image, not the video
					// apparently not anymore?
					// https://www.instagram.com/p/CAIJRpshE0z/ (thanks to fireattack on discord)
					// https://www.instagram.com/p/CAatETTofMK/ graphql returns 640x640 but states it to be 750x750. app api returns 720x720, but is of a lower quality than 640x640 (thanks to remlap and Regis on discord)
					//width = 0;
					//height = 0;
					// This is a terrible hack, but it works
					if (width > 640) {
						var ratio = 640. / width;
						vwidth = width * ratio;
						vheight = height * ratio;
					}
				}
				// hack to work around an issue in instagram's servers where they have null characters in their urls
				// thanks to fireattack on discord for reporting
				if (is_invalid_url(node.video_url) || is_invalid_url(image)) {
					width = 0;
					height = 0;
				}
				if (!vwidth && !vheight) {
					vwidth = width;
					vheight = height;
				}
				var vdash = null;
				if (node.dash_info && node.dash_info.video_dash_manifest)
					vdash = node.dash_info.video_dash_manifest;
				images.push({
					src: image,
					video: node.video_url,
					caption: get_caption(media),
					shortcode: get_shortcode(media),
					page: get_page(media),
					username: get_username(media),
					created: get_created_date(media),
					width: width,
					height: height,
					video_width: vwidth,
					video_height: vheight,
					video_dash: vdash,
					i: img_i + 1,
					total_images: total_images
				});
			};
			if (media.edge_sidecar_to_children) {
				var edges = media.edge_sidecar_to_children.edges;
				total_images = edges.length; // is this correct?
				for (var i = 0; i < edges.length; i++) {
					var edge = edges[i];
					if (edge.node)
						edge = edge.node;
					parse_image(i, edge);
				}
			}
			parse_image(0, media);
			return images;
		};
		var raw_image_to_obj = function(image, obj, preobj) {
			var extra = {};
			var album_info = null;
			if (image.caption)
				extra.caption = image.caption;
			if (image.page)
				extra.page = image.page;
			if (image.username)
				extra.author_username = image.username;
			if (image.created)
				extra.created_date = image.created;
			if (image.shortcode)
				extra.id = image.shortcode;
			if (image.album) {
				var links = [];
				album_info = { "type": "links", "links": links };
				for (var i = 0; i < image.album.length; i++) {
					links.push({
						url: image.album[i],
						is_current: image.album_link === image.album[i]
					});
				}
			} else if (image.total_images && "i" in image && !isNaN(image.i) && image.page) {
				var links = [];
				album_info = { "type": "links", "links": links };
				// stupid hack, but 1 because !0 == !image_id == null
				for (var i = 1; i < image.total_images + 1; i++) {
					links.push({
						url: image.page + "#imu-i=" + i,
						is_current: i === image.i
					});
				}
			}
			if (image.video_dash) {
				var dashurl = "data:application/dash+xml," + encodeURIComponent(image.video_dash);
				preobj.push(common_functions["set_cdninstagram_obj"]({
					url: dashurl,
					video: "dash",
					extra: deepcopy(extra),
					album_info: deepcopy(album_info)
				}));
			}
			if (image.video) {
				obj.push({
					url: common_functions["instagram_norm_url"](image.video),
					video: true,
					extra: deepcopy(extra),
					album_info: deepcopy(album_info)
				});
			}
			obj.push({
				url: common_functions["instagram_norm_url"](image.src),
				extra: deepcopy(extra),
				album_info: deepcopy(album_info)
			});
			// set true to overwrite, as the cdninstagram headers are critical
			return fillobj_urls(obj, common_functions["set_cdninstagram_obj"]({}), true);
		};
		var image_meld_largest = function(image) {
			if (!image.smallest)
				return image;
			//console_log(image.largest, image.smallest);
			image = deepcopy(image);
			var largest = image.largest;
			var smallest = image.smallest;
			var largest_vb = largest.video_width * largest.video_height;
			var smallest_vb = smallest.video_width * smallest.video_height;
			if (smallest_vb > largest_vb) {
				var largest_url = largest.video;
				largest.video = smallest.video;
				smallest.video = largest_url;
				var largest_vw = largest.video_width, largest_vh = largest.video_height;
				largest.video_width = smallest.video_width;
				largest.video_height = smallest.video_height;
				smallest.video_width = largest_vw;
				smallest.video_height = largest_vh;
			}
			//console_log(largest, smallest);
			return {
				largest: largest,
				smallest: smallest
			};
		};
		var image_to_obj = function(image) {
			if (!image)
				return null;
			var obj = [];
			var preobj = [];
			image = image_meld_largest(image);
			// obj= is needed because of fillobj_urls in raw_image_to_obj
			obj = raw_image_to_obj(image.largest, obj, preobj);
			if (image.smallest)
				obj = raw_image_to_obj(image.smallest, obj, preobj);
			array_extend(preobj, obj);
			// TODO: maybe put videos before images?
			return preobj;
		};
		var cache_graphql_post = function(edge) {
			// disable cache for now
			// the PostPage result differs quite significantly from the ProfilePage result
			return;
			var shortcode = get_shortcode(edge);
			if (shortcode) {
				api_cache.set("graphql_ig_post:" + shortcode, edge);
			}
		};
		var fill_graphql_cache_with_postpage = function(postpage_text) {
			if (!host_is_ig || true) // June 30 2022: This doesn't work due to _sharedData not existing
				return;
			var shareddata = get_sharedData_from_resptext(postpage_text);
			if (!shareddata)
				return;
			try {
				var entry_data = shareddata.entry_data;
				if ("ProfilePage" in entry_data) {
					var edges = entry_data.ProfilePage[0].graphql.user.edge_owner_to_timeline_media.edges;
					// todo: also cache edge_felix_video_timeline to avoid requesting videos
					for (var i = 0; i < edges.length; i++) {
						var edge = edges[i].node;
						cache_graphql_post(edge);
					}
				} else if ("PostPage" in entry_data) {
					var shortcode_media = entry_data.PostPage[0];
					cache_graphql_post(shortcode_media);
				}
			} catch (e) {
				console_error(e, shareddata);
			}
		};
		var request_query_ig_post = function(url, cb) {
			query_ig(url, function(json) {
				if (!json) {
					return cb(null);
				}
				try {
					var media = json.entry_data.PostPage[0];
					return cb(media);
				} catch (e) {
					console_error(e);
				}
				return cb(null);
			});
		};
		var request_ig_post = function(url, code, cb) {
			if (!code)
				return cb(null);
			var cache_key = "graphql_ig_post:" + code;
			api_cache.fetch(cache_key, function(data) {
				if (!data)
					return cb(null);
				var needs_ig_query = false;
				if (data.__typename === "GraphVideo" && !data.video_url) {
					needs_ig_query = true;
				} else if (data.__typename === "GraphSidecar") {
					if (data.edge_sidecar_to_children && data.edge_sidecar_to_children.edges && data.edge_sidecar_to_children.edges.length > 0) {
						var edges = data.edge_sidecar_to_children.edges;
						for (var i = 0; i < edges.length; i++) {
							if (!edges[i] || !edges[i].node) {
								needs_ig_query = true;
								break;
							}
							if (edges[i].node.__typename === "GraphVideo" && !edges[i].node.video_url) {
								needs_ig_query = true;
								break;
							}
						}
					} else {
						needs_ig_query = true;
					}
				}
				if (needs_ig_query && do_request) {
					request_query_ig_post(url, function(newdata) {
						if (newdata) {
							api_cache.set(cache_key, newdata);
							data = newdata;
						}
						cb(data);
					});
				} else {
					cb(data);
				}
			}, function(done) {
				request_query_ig_post(url, function(data) {
					if (data) {
						return done(data, 60 * 60);
					} else {
						return done(null, false);
					}
				});
			});
		};
		var get_shortcode_to_id = function(post_url, shortcode, cb) {
			api_cache.fetch("ig_shortcode_to_id:" + shortcode, cb, function(done) {
				shortcode_to_id(shortcode, function(id) {
					if (id) {
						return done(id, 24 * 60 * 60);
					} else {
						request_ig_post(post_url, shortcode, function(media) {
							if (!media || !media.id) {
								return done(null, false);
							}
							return done(media.id, 24 * 60 * 60);
						});
					}
				});
			});
		};
		var request_post_inner = function(post_url, image_url, cb) {
			var shortcode = url_to_shortcode(post_url);
			get_shortcode_to_id(post_url, shortcode, function(media_id) {
				if (!media_id) {
					return cb(null);
				}
				try {
					//media.id + "_" + media.owner.id
					mediainfo_api(media_id, function(app_response) {
						var images = [];
						var images_small = [];
						var images_app = [];
						var images_graphql = [];
						var need_graphql = false; //!dont_use_web; // June 30 2022: Currently needed to avoid _sharedData queries
						if (app_response !== null) {
							images_app = get_maxsize_app(app_response.items[0]);
						} else {
							if (use_app_api) {
								console_warn("Unable to use API to find Instagram image, you may need to login to Instagram");
							}
							need_graphql = true;
						}
						var final = function() {
							if (_nir_debug_) {
								console_log("images_app", images_app);
								console_log("images_graphql", images_graphql);
							}
							if (!images_app || !images_app.length)
								images_app = null;
							if (!images_graphql || !images_graphql.length)
								images_graphql = null;
							if (!images_app && !images_graphql) {
								return cb(null);
							}
							var final2 = function() {
								if (_nir_debug_) {
									console_log("images_small", deepcopy(images_small));
									console_log("images", deepcopy(images), image_url);
								}
								if (image_url) {
									var image = image_in_objarr(image_url, images, images_small);
									if (image) {
										return cb(image_to_obj(image));
									} else {
										console_error("Unable to find", image_url, "in", deepcopy(images), deepcopy(images_small));
									}
								} else {
									return cb(images);
								}
								cb(null);
							};
							if (images_app && images_graphql && images_app.length === images_graphql.length) {
								var processed = 0;
								var total = 0;
								for (var i = 0; i < images_app.length; i++) {
									var app_size = images_app[i].width * images_app[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];
										images_small[i] = images_app[i];
									} else {
										images[i] = images_app[i];
										images_small[i] = images_graphql[i];
									}
									// sometimes videos have higher quality for graphql, even though it's smaller (640 vs 720)
									// relevant issue: https://github.com/qsniyg/maxurl/issues/547
									(function(i) {
										if (!prefer_video_quality || !images_app[i].video)
											return;
										total++;
										common_functions["find_actual_largest_image"](images[i].video, [
											images[i].video,
											images_small[i].video
										], function(url) {
											processed++;
											// awful hack
											if (url === images[i].video) {
												images[i].video_width = 10000;
												images[i].video_height = 10000;
											} else if (url === images_small[i].video) {
												images_small[i].video_width = 10000;
												images_small[i].video_height = 10000;
											}
											if (processed >= total) {
												// run_soon, because find_actual_largest_image might use cached values, therefore running final2 before images/images_small has been filled
												// thanks to Speedy on discord for reporting
												run_soon(final2);
											}
										}, {
											check_length: true,
											api_cache: api_cache,
											do_request: do_request
										});
									})(i);
								}
								if (total) {
									return;
								}
							} else {
								if (images_app) {
									images = images_app;
									images_small = images_graphql;
								} else {
									images = images_graphql;
									images_small = images_app;
								}
							}
							final2();
						};
						if (need_graphql) {
							request_ig_post(post_url, shortcode, function(media) {
								if (media) {
									//images_graphql = get_maxsize_graphql(media);
									images_graphql = get_maxsize_app(media);
								}
								final();
							});
						} else {
							final();
						}
					});
				} catch (e) {
					console_error(e);
					cb(null);
				}
			});
			return {
				waiting: true
			};
		};
		var request_post = function(post_url, image_url, cb) {
			if (typeof document !== "undefined")
				fill_graphql_cache_with_postpage(document.documentElement.innerHTML);
			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;
			var result_cb = function(uid) {
				var image_id = common_functions["instagram_get_imageid"](image_url);
				var story_id = null;
				if (url) {
					var _storyid = url.replace(/.*\/stories\/+[^/]+\/+([0-9]+)\/*(?:[?#].*)?$/, "$1");
					if (_storyid !== url)
						story_id = _storyid;
				}
				var story_result_cb = function(result) {
					if (!result) {
						return cb(null);
					}
					var images = result;
					if (!is_array(images))
						images = [images];
					if (image_id && image_url) {
						var image = image_in_objarr(image_url, images);
						if (!image) {
							console_warn("Unable to find", image_url, "in", deepcopy(images));
							return cb(null);
						}
						var obj = image_to_obj(image);
						return cb(obj);
					} else {
						return cb(images);
					}
				};
				if (uid === "highlight") {
					if (story_id)
						reels_api("highlight:" + story_id, image_id, story_result_cb);
					else
						console_error("Unable to find story_id");
				} else {
					if (!image_id && story_id)
						image_id = story_id;
					story_api(image_id, uid, story_result_cb);
				}
			};
			if (username === "highlights") {
				result_cb("highlight");
			} else {
				username_to_uid(username, function(uid) {
					if (!uid) {
						return cb(null);
					}
					result_cb(uid);
				});
			}
			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_get_el_for_imageid"] = function(element) {
		var newel = element;
		if (newel.tagName === "SOURCE") {
			newel = newel.parentElement;
		}
		if (newel.tagName === "VIDEO" && newel.parentElement) {
			try {
				newel = newel.parentElement.querySelectorAll("img[srcset]");
				if (!newel || newel.length === 0)
					newel = element;
				else
					newel = newel[0];
			} catch (e) {
				console_error(e);
				newel = element;
			}
		} else {
			newel = element;
		}
		return newel;
	};
	common_functions["instagram_get_image_src_from_el"] = function(el) {
		// try image id from gallery helper
		if (el.hasAttribute("data-imu-data")) {
			try {
				var json = JSON_parse(el.getAttribute("data-imu-data"));
				if (json.src)
					return json.src;
			} catch (e) {
				console_error(e);
			}
		}
		if (el.tagName === "VIDEO") {
			// use the poster instead as the larger video urls differ
			return el.poster || el.currentSrc || el.src;
		} else if (el.tagName === "IMG") {
			return el.src;
		} else if (el.tagName === "DIV") {
			return el.style.backgroundImage.replace(/^url\(["'](.*)["']\)$/, "$1");
		} else if (el.tagName === "SOURCE") {
			if (el.parentElement) {
				var newsrc = common_functions["instagram_get_image_src_from_el"](el.parentElement);
				if (newsrc)
					return newsrc;
			}
			return el.src;
		}
		console_error("Unable to find source for", el);
		return;
	};
	common_functions["instagram_find_el_info"] = function(document, element, host_url) {
		var possible_infos = [];
		var element_src = common_functions["instagram_get_image_src_from_el"](element);
		if (element.hasAttribute("data-imu-info")) {
			try {
				var json = JSON_parse(element.getAttribute("data-imu-info"));
				for (var i = 0; i < json.length; i++) {
					json[i].element = element;
					if (!json[i].image)
						json[i].image = element_src;
					delete json[i].all;
				}
				return json;
			} catch (e) {
				console_error("Unable to parse data-imu-info for", element);
			}
		}
		// check for links first
		var current = element;
		while ((current = current.parentElement)) {
			if (current.tagName !== "A")
				continue;
			if (current.href.match(/:\/\/[^/]+\/+(?:[^/]+\/+)?(?:p|tv|reel)\//)) {
				// 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
				// Jun 29 2022: Disabling because _sharedData no longer exists
				if (false) {
					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\//)) {
					var username;
					if (element.parentElement.tagName === "SPAN" && element.parentElement.getAttribute("role") === "link") {
						var as = current.getElementsByTagName("a");
						for (var i = 0; i < as.length; i++) {
							var a = as[i];
							var amatch = a.href.match(/^[a-z]+:\/\/[^/]+\/+([^/]+)\/*(?:[?#].*)?$/);
							if (amatch) {
								if (strip_whitespace(a.innerText).toLowerCase() === amatch[1].toLowerCase()) {
									username = strip_whitespace(a.innerText).toLowerCase();
									break;
								}
							}
						}
					}
					if (!username) {
						try {
							var h2 = current.querySelector("h2 > a");
							if (strip_whitespace(h2.innerText) === strip_whitespace(h2.title)) {
								username = h2.innerText;
							}
						} catch (e) { }
					}
					if (!username) {
						try {
							// There are 2 h1's, the first should be the username (the second is the person's "name")
							username = current.querySelector("section h1").innerText;
						} catch (e) {
							console_error(e);
						}
					}
					if (username) {
						url = "https://www.instagram.com/" + strip_whitespace(username); //common_functions["instagram_username_from_sharedData"](sharedData);
					} else {
						url = null;
					}
				}
				if (url) {
					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|tv|reel)\//))) {
				possible_infos.push({
					type: "post",
					subtype: current.tagName === "BODY" ? "page" : "popup",
					url: host_url,
					image: element_src,
					element: current
				});
			}
			// home
			if (current.tagName === "ARTICLE" && host_url.match(/:\/\/[^/]+\/+(?:[?#].*)?$/)) {
				var timeel = current.querySelector("a > time");
				if (!timeel)
					timeel = current.querySelector("a > div > time");
				if (timeel) {
					var linkel = timeel.parentElement;
					if (linkel.tagName !== "A")
						linkel = linkel.parentElement;
					var href = linkel.href;
					if (/:\/\/[^/]*\/+(?:[^/]+\/+)?p\//.test(href)) {
						possible_infos.push({
							type: "post",
							subtype: "home",
							url: href,
							image: element_src,
							element: current
						});
					}
				}
			}
			// stories
			// https://www.instagram.com/stories/hollyearl__/2271839116690161119/
			if (current.tagName === "BODY" && host_url.match(/:\/\/[^/]*\/+stories\/+([^/]*)(?:\/+[0-9]+)?\/*(?:[?#].*)?$/)) {
				// try to find image instead of video because video ids change for app stories
				var newel = common_functions["instagram_get_el_for_imageid"](element);
				possible_infos.push({
					type: "story",
					url: host_url,
					image: common_functions["instagram_get_image_src_from_el"](newel),
					element: current
				});
			}
		}
		return possible_infos;
	};
	common_functions["twitter_normalize_status_link"] = function(link) {
		var match = link.match(/\/status\/+([0-9]+)(?:\/+(?:retweets|likes|photo|video)(?:\/+.*)?|\/*)(?:[?#].*)?$/);
		if (match) {
			return link.replace(/(\/status\/+[0-9]+)\/*.*(?:[?#].*)?$/, "$1");
		}
		return null;
	};
	common_functions["get_twitter_tweet_link"] = function(el) {
		var currentel = el;
		while ((currentel = currentel.parentElement)) {
			if (currentel.tagName === "A") {
				var norm = common_functions["twitter_normalize_status_link"](currentel.href);
				if (norm)
					return norm;
			}
			if (currentel.tagName === "ARTICLE") {
				var our_as = currentel.querySelectorAll("a[role='link']");
				for (var i = 0; i < our_as.length; i++) {
					var our_href = our_as[i].href;
					if (!our_href)
						continue;
					var norm = common_functions["twitter_normalize_status_link"](our_href);
					if (norm)
						return norm;
				}
				break;
			}
		}
		return null;
	};
	common_functions["get_twitter_caption"] = function(el) {
		var currentel = el;
		while ((currentel = currentel.parentElement)) {
			if (currentel.tagName === "ARTICLE") {
				var captiondiv = currentel.querySelectorAll("div[lang]");
				if (captiondiv && captiondiv.length === 1) {
					return captiondiv[0].innerText;
				}
				break;
			}
		}
		return null;
	};
	common_functions["get_twitter_video_tweet"] = function(el, window) {
		if (el.tagName !== "VIDEO" || !el.src.match(/^blob:/))
			return null;
		var poster = el.poster;
		if (!poster)
			return null;
		// note that the numbers here corresponds to the media id, not the tweet id, so it can't be used
		if (!/\/ext_tw_video_thumb\/+[0-9]+\/+pu\/+img\//.test(poster))
			return null;
		var href = window.location.href;
		// embedded video
		var match = href.match(/\/i\/+videos\/+tweet\/+([0-9]+)(?:[?#].*)?$/);
		if (match) {
			return {
				id: match[1]
			};
		}
		var currentel = el;
		while ((currentel = currentel.parentElement)) {
			if (currentel.tagName === "ARTICLE") {
				var our_as = currentel.querySelectorAll("a[role='link']");
				for (var i = 0; i < our_as.length; i++) {
					var our_href = our_as[i].href;
					if (!our_href)
						continue;
					var match = our_href.match(/\/status\/+([0-9]+)(?:\/+(?:retweets|likes)|\/*)(?:[?#].*)?$/);
					if (match) {
						return {
							id: match[1]
						};
					}
				}
				break;
			}
		}
		return null;
	};
	common_functions["get_snapchat_story"] = function(api_cache, do_request, username, cb) {
		var cache_key = "snapchat_story:" + username;
		api_cache.fetch(cache_key, cb, function(done) {
			do_request({
				method: "GET",
				url: "https://search.snapchat.com/lookupStory?id=" + username,
				headers: {
					"sec-fetch-dest": "empty",
					"sec-fetch-mode": "cors",
					"sec-fetch-site": "same-site",
					"Origin": "https://www.snapchat.com",
					"Referer": "https://www.snapchat.com/add/" + username // maybe use real url instead?
				},
				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);
						return done(json, 60); // story can change, so 60 seconds? or less?
					} catch (e) {
						console_error(e, resp);
						return done(null, false);
					}
				}
			});
		});
	};
	common_functions["get_snapchat_storysharing"] = function(api_cache, do_request, username, cb) {
		var cache_key = "snapchat_storysharing:" + username;
		api_cache.fetch(cache_key, cb, function(done) {
			do_request({
				method: "GET",
				url: "https://storysharing.snapchat.com/v1/fetch/" + username + "?request_origin=ORIGIN_WEB_PLAYER",
				headers: {
					"sec-fetch-dest": "empty",
					"sec-fetch-mode": "cors",
					"sec-fetch-site": "same-site",
					"Origin": "https://www.snapchat.com",
					"Referer": "https://www.snapchat.com/add/" + username // maybe use real url instead?
				},
				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 story = json.story;
						return done(story, 60); // story can change, so 60 seconds? or less?
					} catch (e) {
						console_error(e, resp);
						return done(null, false);
					}
				}
			});
		});
	};
	common_functions["snap_norm_obj"] = function(obj) {
		// ids are not very human-readable, maybe add an option?
		var match = obj.url.match(/:\/\/[^/]+\/+[0-9a-f]{2}\/+([^/]{10,})\//);
		if (match) {
			// = causes issues with ffmpeg (thanks to remlap on discord for reporting), - can cause issues with command-line args
			obj.filename = match[1].replace(/[-=]/g, "");
		}
		return obj;
	};
	common_functions["snap_to_obj"] = function(snap) {
		var caption = null;
		// Apparently this isn't related to the caption?
		if (false) {
			caption = snap.snapTitle + snap.snapSubtitles;
			caption = caption.replace(/^\s*([\s\S]*)\s*$/, "$1");
		}
		var obj = {
			url: snap.media.mediaUrl, //snap.snapUrls.mediaUrl,
			extra: {
				caption: caption || null
			},
			need_blob: true
		};
		common_functions["snap_norm_obj"](obj);
		return obj;
	};
	common_functions["get_snapchat_info_from_el"] = function(el) {
		if (el.getAttribute("data-imu")) {
			return {
				username: el.getAttribute("data-username"),
				pos: parse_int(el.getAttribute("data-pos")),
				url: el.getAttribute("data-url")
			};
		}
		if (el.tagName !== "VIDEO" && el.tagName !== "IMG") {
			// <div class="css-crr1df" style="background-image: url(&quot;blob:https://www.snapchat.com/...&quot;);"></div>
			if (el.tagName !== "DIV" || !el.style.backgroundImage || el.style.backgroundImage.indexOf("blob:") < 0) {
				return null;
			}
		}
		var current = el;
		while ((current = current.parentElement)) {
			// new layout
			if (current.tagName === "DIV" && current.getAttribute("data-test") === "storyWebPlayer") {
				// check, because otherwise it could be profile pic or an svg
				if (!/:\/\/s\.sc-cdn\.net\//.test(el.src))
					continue;
				var username_a = current.querySelector('a[data-test="userName"]');
				if (!username_a) {
					console_error("Unable to find username element");
					continue;
				}
				return {
					username: strip_whitespace(username_a.innerText),
					pos: 0 // fixme?
				};
			}
			// old layout
			if (current.tagName === "DIV" && current.getAttribute("role") === "presentation") {
				var username = "";
				var as = current.getElementsByTagName("a");
				for (var i = 0; i < as.length; i++) {
					var match = as[i].href.match(/^[a-z]+:\/\/story\.snapchat\.com\/+s\/+([^/?#]+)(?:[?#].*)?$/);
					if (match) {
						username = match[1];
						break;
					}
				}
				var pos = 0;
				var prevbutton = current.querySelector("#PrevButton");
				if (prevbutton) {
					pos = 1;
				}
				var nextbutton = current.querySelector("#NextButton");
				if (!nextbutton) {
					pos = -1;
				}
				return {
					username: username,
					pos: pos
				};
			}
		}
		return null;
	};
	common_functions["get_obj_from_snap_info"] = function(api_cache, do_request, info, cb) {
		if (!info) {
			return cb(null);
		}
		common_functions["get_snapchat_storysharing"](api_cache, do_request, info.username, function(data) {
			if (!data) {
				return cb(null);
			}
			if (info.pos === -1) {
				info.pos = data.snaps.length - 1; //data.snapList.length - 1;
			}
			return cb(common_functions["snap_to_obj"](data. /*snapList*/snaps[info.pos]));
		});
	};
	common_functions["get_md5"] = function(options, text, cb) {
		get_library("cryptojs_aes", options, options.do_request, function(CryptoJS) {
			if (!CryptoJS) {
				console_error("Unable to fetch CryptoJS");
				return cb(null);
			}
			try {
				return cb(CryptoJS.MD5(text).toString());
			} catch (e) {
				console_error(e);
				return cb(null);
			}
		});
	};
	common_functions["get_tiktok_urlvidid"] = function(url) {
		var match = url.match(/^[a-z]+:\/\/[^/]+\/+(?:[0-9a-f]{32}\/+[0-9a-f]{8}\/+)?video\/+(?:[^/]+\/+)?[^/]+\/+[^/]+\/+([0-9a-f]{32})\/*\?/);
		if (match)
			return match[1];
		return null;
	};
	common_functions["set_tiktok_vid_filename"] = function(obj) {
		var vidid = common_functions["get_tiktok_urlvidid"](obj.url);
		if (vidid) {
			obj.filename = vidid + ".mp4"; // hack, but needed because firefox etc. doesn't automatically set the extension, because content-type isn't set
			return true;
		}
		return false;
	};
	common_functions["get_tiktok_weburl_parts"] = function(url) {
		var match = url.match(/^[a-z]+:\/\/[^/]+\/+@([^/]*)\/+video\/+([0-9]+)(?:[?#].*)?$/);
		if (!match) {
			return null;
		}
		return {
			username: match[1],
			web_vid: match[2]
		};
	};
	common_functions["get_tiktok_from_ttloader"] = function(site, api_cache, do_request, url, cb) {
		// https://codecanyon.net/item/tiktok-video-downloader-wordpress-plugin/26370715
		// returns hd (720p)
		// ttloader.com, onlinetik.com, demo.wppress.net, tiktokdownloader.in, savevideo.ninja
		// uses older versions (watermarked):
		// tiktoktoolstation.com (video.src)
		var cache_key = site + ":" + url;
		site = site.replace(/:.*/, "");
		real_api_query(api_cache, do_request, cache_key, {
			url: "https://" + site + "/wp-json/wppress/tiktok-downloader/videos?search=" + encodeURIComponent(url) + "&type=video_url&max=0",
			headers: {
				Referer: "https://" + site + "/?tiktok-search=" + encodeURIComponent(url),
				"X-Requested-With": "XMLHttpRequest",
				"Sec-Fetch-Dest": "empty",
				"Sec-Fetch-Mode": "cors",
				"Sec-Fetch-Site": "same-origin",
				"Accept": "application/json, text/javascript, */*; q=0.01"
			},
			json: true
		}, cb, function(done, resp, cache_key) {
			var nowm = resp.items[0].video.noWatermark;
			if (!nowm) {
				console_error(cache_key, "Unable to find noWatermark from", resp);
				return done(null, false);
			}
			return done(nowm, 60 * 60);
		});
	};
	common_functions["get_tiktok_from_ttloader_token"] = function(site, api_cache, do_request, url, cb, options) {
		url = url.replace(/\?.*/, "");
		var cache_key = site + ":" + url;
		site = site.replace(/:.*/, "");
		var referer = "https://" + site + "/?tiktok-search=" + encodeURIComponent(url);
		if (site === "savevideo.ninja")
			referer = "https://" + site + "/tiktok-no-watermark-video-downloader/?tiktok-search=" + encodeURIComponent(url);
		var get_raw_token = function(cb) {
			real_api_query(api_cache, do_request, site + ":token", {
				method: "POST",
				url: "https://" + site + "/wp-json/wppress/tiktok-downloader/token",
				imu_mode: "xhr",
				data: "",
				headers: {
					Origin: "https://" + site,
					Referer: referer,
					"x-requested-with": "XMLHttpRequest"
				},
				json: true
			}, cb, function(done, resp, cache_key) {
				if (resp.token)
					return done(resp.token, 60 * 60);
				console_error(cache_key, "Unable to find token from", resp);
				return done(null, false);
			});
		};
		var parse_raw_token = function(raw_token, url, requesttype, useragent, cb) {
			var urladd = "";
			if (requesttype === "videos")
				urladd = "0";
			var catted = raw_token + ":" + url + urladd + ":" + useragent;
			var encoded = unescape(encodeURIComponent(catted));
			//console_log(encoded);
			common_functions.get_md5(options, encoded, cb);
		};
		var get_video_api = function(token, url, cb) {
			real_api_query(api_cache, do_request, cache_key, {
				method: "POST",
				url: "https://" + site + "/wp-json/wppress/tiktok-downloader/videos",
				data: "search=" + encodeURIComponent(url) + "&type=video_url&max=0&token=" + token,
				imu_mode: "xhr",
				headers: {
					Referer: referer,
					"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
					"x-requested-with": "XMLHttpRequest"
				},
				json: true
			}, cb, function(done, resp, cache_key) {
				var nowm = resp.items[0].video.noWatermark;
				if (!nowm) {
					console_warn(cache_key, "Unable to find noWatermark from", resp);
					if (false) {
						nowm = resp.items[0].video.playAddr;
						if (!nowm) {
							console_error(cache_key, "Unable to find downloadAddr from", resp);
							return done(null, false);
						}
					} else {
						return done(null, false);
					}
				}
				return done(nowm, 60 * 60);
			});
		};
		var get_nowatermark_videourl = function(token, url) {
			var url = "https://" + site + "/wp-admin/admin-ajax.php?action=wppress_tt_download&url=" + encodeURIComponent(url) + "&key=no-watermark&token=" + token;
			return {
				url: url,
				headers: {
					Referer: "https://" + site + "/?tiktok-search=" + encodeURIComponent(url),
					Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
					"Sec-Fetch-Dest": "document",
					"Sec-Fetch-Mode": "navigate",
					"Sec-Fetch-Site": "same-origin",
					"Sec-Fetch-User": "?1"
				},
				cookie_url: "https://" + site + "/",
				// linked to user-agent
				is_private: true
			};
		};
		get_raw_token(function(raw_token) {
			if (!raw_token)
				return cb(null);
			if (false) {
				parse_raw_token(raw_token, url, "videos", navigator.userAgent, function(token) {
					if (!token)
						return cb(null);
					//console_log(token);
					get_video_api(token, url, cb);
				});
			} else {
				parse_raw_token(raw_token, url, "nowatermark", navigator.userAgent, function(token) {
					if (!token)
						return cb(null);
					return cb(get_nowatermark_videourl(token, url));
				});
			}
		});
	};
	common_functions["get_tiktok_from_socialvideodownloader"] = function(site, api_cache, do_request, url, cb) {
		// https://codecanyon.net/item/social-video-downloader-wordpress-plugin/26563734?s_rank=3
		// https://demo.wppress.net/social-video-downloader/
		// hd:
		// savevideo.ninja (thanks to remlap on discord)
		var cache_key = site + ":" + url;
		site = site.replace(/:.*/, "");
		real_api_query(api_cache, do_request, cache_key, {
			url: "https://" + site + "/wp-json/wppress/video-downloader/videos?url=" + encodeURIComponent(url),
			headers: {
				Referer: "https://" + site + "/",
				"Sec-Fetch-Dest": "empty",
				"Sec-Fetch-Mode": "cors",
				"Sec-Fetch-Site": "same-origin",
				"Accept": "application/json, text/javascript, */*"
			},
			json: true
		}, cb, function(done, resp, cache_key) {
			var urls = resp[0].urls;
			var ids = {};
			for (var i = 0; i < urls.length; i++) {
				ids[urls[i].id] = urls[i];
			}
			if (!("vid-no-watermark" in ids)) {
				console_error(cache_key, "Unable to find vid-no-watermark in", { ids: ids, resp: resp });
				return done(null, false);
			}
			return done(ids["vid-no-watermark"]["src"], 60 * 60);
		});
	};
	common_functions["get_tiktok_from_keeptiktok"] = function(site, api_cache, do_request, url, cb) {
		var urlparts = common_functions["get_tiktok_weburl_parts"](url);
		if (!urlparts) {
			console_error("Invalid url", url);
			return cb(null);
		}
		var cache_key = site + ":" + url;
		real_api_query(api_cache, do_request, cache_key, {
			url: "https://" + site + "/" + urlparts.username.replace(/\..*/, "") + "/" + urlparts.web_vid
		}, cb, function(done, resp, cache_key) {
			var match = resp.responseText.match(/<video[^>]+>\s*<source src="(https?:\/\/[^/]*(?:tiktok|bytei)cdn\.[^"]+)"/);
			if (!match) {
				console_error(cache_key, "Unable to find match for", resp);
				return done(null, false);
			}
			return done(decode_entities(match[1]), 60 * 60);
		});
	};
	common_functions["get_tiktok_from_snaptik"] = function(site, api_cache, do_request, url, cb) {
		var urlparts = common_functions["get_tiktok_weburl_parts"](url);
		if (!urlparts) {
			console_error("Invalid url", url);
			return cb(null);
		}
		var query_snaptik_1 = function(url) {
			url = url.replace(/[?#].*/, "");
			var cache_key = site + ":" + url;
			api_cache.fetch(cache_key, cb, function(done) {
				// first query is to populate the cookies
				do_request({
					url: "https://snaptik.app/", //pre_download.php?aweme_id=" + urlparts.web_vid,
					imu_mode: "document",
					method: "GET",
					onload: function(resp) {
						if (resp.status !== 200) {
							console_error(cache_key, resp);
							return done(null, false);
						}
						// this query is needed for the third to work
						do_request({
							method: "POST",
							url: "https://snaptik.app/check_user.php",
							imu_mode: "xhr",
							headers: {
								Referer: "https://" + site + "/"
							},
							imu_multipart: {},
							onload: function(resp) {
								if (resp.status !== 200) {
									console_error(cache_key, resp);
									return done(null, false);
								}
								do_request({
									method: "POST",
									url: "https://" + site + "/action-v9.php",
									imu_mode: "xhr",
									imu_multipart: {
										url: url
									},
									headers: {
										Referer: "https://snaptik.app/", //pre_download.php?aweme_id=" + urlparts.web_vid,
									},
									onload: function(resp) {
										if (resp.status !== 200) {
											console_error(cache_key, resp);
											return done(null, false);
										}
										var match = resp.responseText.match(/<a[^>]*\s+href=["']https?:\/\/sv[0-9]*\.snaptik.app\/+dl\.php\?token=([^&]+)/);
										if (!match) {
											console_error(cache_key, "Unable to find match for", resp);
											return done(null, false);
										}
										return done(base64_decode(decodeURIComponent(decode_entities(match[1]))), 60 * 60);
									}
								});
							}
						});
					}
				});
			});
		};
		var query_snaptik_2 = function(url) {
			url = url.replace(/[?#].*/, "");
			var cache_key = site + ":" + url;
			api_cache.fetch(cache_key, cb, function(done) {
				// first query is to populate the cookies
				do_request({
					url: "https://snaptik.app/",
					imu_mode: "document",
					method: "GET",
					onload: function(resp) {
						if (resp.status !== 200) {
							console_error(cache_key, resp);
							return done(null, false);
						}
						do_request({
							method: "POST",
							url: "https://" + site + "/action.php",
							imu_mode: "xhr",
							imu_multipart: {
								url: url
							},
							headers: {
								Origin: "https://snaptik.app",
								Referer: "https://snaptik.app/"
							},
							onload: function(resp) {
								if (resp.status !== 200) {
									console_error(cache_key, resp);
									return done(null, false);
								}
								var match = resp.responseText.match(/<a[^>]*\s+href=["'](?:https?:\/\/(?:(?:sv|cdn)[0-9]*\.)?(?:snaptik\.app|snapsave\.info))?\/+dl\.php\?token=([^&'"]+)/);
								if (!match) {
									console_error(cache_key, "Unable to find match for", resp);
									return done(null, false);
								}
								var x = decodeURIComponent(decode_entities(match[1])).replace(/^s|s$/g, "");
								var splitted = x.split("/");
								array_foreach(splitted, function(x, i) {
									splitted[i] = base64_decode(x);
								});
								var newsrc = splitted.join("?");
								done({
									url: newsrc,
									cookie_url: "https://" + site + "/"
								}, 60 * 60);
							}
						});
					}
				});
			});
		};
		//query_snaptik_1(url);
		query_snaptik_2(url);
	};
	common_functions["get_tiktok_from_musicallydown"] = function(site, api_cache, do_request, url, cb) {
		var get_token_data = function(cb) {
			// using real_api_query even if we don't cache because it's just less code than do_request
			real_api_query(api_cache, do_request, "musicallydown:vtoken", {
				url: "https://musicallydown.com"
			}, cb, function(done, resp, cache_key) {
				var match = resp.responseText.match(/<input name="(_[a-zA-Z0-9]+)" type="hidden" value="([0-9a-f]{5,})"\s*\/>/);
				if (!match) {
					console_error(cache_key, "Unable to find token from", resp);
					return done(null, false);
				}
				var obj = {
					token_name: match[1],
					token_value: match[2]
				};
				match = resp.responseText.match(/<input name="(_?[a-zA-Z0-9]+)" type="text"[^/>]+id="link_url"/);
				if (!match) {
					console_error(cache_key, "Unable to find link name from", resp);
					return done(null, false);
				}
				obj.link_name = match[1];
				return done(obj, false);
			});
		};
		var query_musicallydown = function(url, token, cb) {
			var cache_key = site + ":" + url;
			real_api_query(api_cache, do_request, cache_key, {
				url: "https://musicallydown.com/download",
				method: "POST",
				imu_mode: "document",
				headers: {
					"Content-Type": "application/x-www-form-urlencoded",
					"Origin": "https://musicallydown.com",
					"Referer": "https://musicallydown.com/",
				},
				data: token.link_name + "=" + encodeURIComponent(url) + "&" + token.token_name + "=" + token.token_value + "&verify=1"
			}, cb, function(done, resp, cache_key) {
				var match = resp.responseText.match(/<a\s+(?:style="[^"]+"\s+)?target="_blank" rel="noreferrer" href="(https?:\/\/[^/]*tiktokcdn\.com\/[^"]+)"[^>]*>\s*<i[^>]*>[^<]*<\/i>\s*Download MP4/);
				if (!match) {
					console_error(cache_key, "Unable to find match from", resp);
					return done(null, false);
				}
				return done(decode_entities(match[1]), 60 * 60);
			});
		};
		get_token_data(function(token) {
			if (!token)
				return cb(null);
			query_musicallydown(url, token, cb);
		});
	};
	common_functions["get_tiktok_from_ssstiktok"] = function(site, api_cache, do_request, url, cb) {
		var get_token = function(cb) {
			real_api_query(api_cache, do_request, "ssstiktok:token", {
				url: "https://ssstik.io"
			}, cb, function(done, resp, cache_key) {
				var match = resp.responseText.match(/<form.*?data-hx-post=".*?>/);
				if (!match) {
					console_error(cache_key, "Unable to find match from", resp);
					return done(null, false);
				}
				var parsed = parse_tag_def(match[0]);
				var url = urljoin("https://ssstik.io/", parsed.args["data-hx-post"], true);
				try {
					var include_vals = JSON_parse(fixup_js_obj("{" + parsed.args["include-vals"] + "}"));
				} catch (e) {
					console_error(cache_key, e);
					return done(null, false);
				}
				match = resp.responseText.match(/<input id="locale".*?>/);
				if (!match) {
					console_error(cache_key, "Unable to find locale", resp);
					return done(null, false);
				}
				parsed = parse_tag_def(match[0]);
				include_vals.locale = parsed.args.value;
				return done({
					url: url,
					queries: include_vals
				}, false);
			});
		};
		var query_ssstiktok = function(url, token, cb) {
			var cache_key = site + ":" + url;
			token.queries.id = encodeURIComponent(url);
			real_api_query(api_cache, do_request, cache_key, {
				url: token.url,
				method: "POST",
				imu_mode: "xhr",
				headers: {
					"HX-Active-Element": "submit",
					"HX-Current-URL": "https://ssstik.io/",
					"HX-Request": "true",
					"HX-Target": "target",
					"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
				},
				data: stringify_queries(token.queries)
			}, cb, function(done, resp, cache_key) {
				var match = resp.responseText.match(/<a href="(https?:\/\/[^/]*tiktokcdn\.com\/[^"]+)"[^>]*>Without watermark/);
				if (!match) {
					console_error(cache_key, "Unable to find match for", resp);
					return done(null, false);
				}
				return done(decode_entities(match[1]), 60 * 60);
			});
		};
		get_token(function(token) {
			if (!token)
				return cb(null);
			query_ssstiktok(url, token, cb);
		});
	};
	common_functions["get_tiktok_from_tikmate"] = function(site, api_cache, do_request, url, cb) {
		var urlparts = common_functions["get_tiktok_weburl_parts"](url);
		if (!urlparts) {
			console_error("Invalid url", url);
			return cb(null);
		}
		var referer_url = "https://" + site + "/" + urlparts.username.replace(/_/g, "-") + "/" + urlparts.web_vid;
		var fill_cookies = function(cb) {
			real_api_query(api_cache, do_request, site + ":cookie:" + urlparts.username + "/" + urlparts.web_vid, {
				url: referer_url
			}, cb, function(done, resp, cache_key) {
				done(null, 6 * 60 * 60);
			});
		};
		var get_dl_url = function() {
			return {
				url: "https://" + site + "/dl.php",
				headers: {
					"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
					"Accept-Language": "en-US,en;q=0.9",
					"Cache-Control": "no-cache",
					"Pragma": "no-cache",
					Referer: referer_url,
					"Sec-Fetch-Dest": "document",
					"Sec-Fetch-Mode": "navigate",
					"Sec-Fetch-Site": "same-origin",
					"Sec-Fetch-User": "?1"
				},
				cookie_url: "https://" + site + "/", // otherwise it'll get overridden
				can_head: false,
				//content_type: "video/mp4", // otherwise it downloads as 'text/html; charset=UTF-8', which cannot be played. fixme: is this really needed?
				video: true
			};
		};
		fill_cookies(function() {
			cb(get_dl_url());
		});
	};
	// This is a terrible duct-tape solution, but required until I can find a proper way to fix get_best_tiktok_url
	// Note that this will NOT be called unless "Rules using 3rd-party websites" is enabled (it's disabled by default)
	common_functions["get_tiktok_from_3rdparty"] = function(site, api_cache, options, url, cb) {
		var sites = {
			// hd
			"ttloader.com:ttt": common_functions["get_tiktok_from_ttloader_token"],
			"onlinetik.com:ttt": common_functions["get_tiktok_from_ttloader_token"],
			"demo.wppress.net:tt": common_functions["get_tiktok_from_ttloader"],
			"tiktokdownloader.in:ttt": common_functions["get_tiktok_from_ttloader_token"],
			"savevideo.ninja:ttt": common_functions["get_tiktok_from_ttloader_token"],
			"tikdowns.com:ttt": common_functions["get_tiktok_from_ttloader_token"],
			"ssstiktok.net:ttt": common_functions["get_tiktok_from_ttloader_token"],
			"demo.wppress.net:svd": common_functions["get_tiktok_from_socialvideodownloader"],
			"savevideo.ninja:svd": common_functions["get_tiktok_from_socialvideodownloader"],
			// not hd
			"keeptiktok.com": common_functions["get_tiktok_from_keeptiktok"],
			"ssstiktok.io:1": common_functions["get_tiktok_from_ssstiktok"],
			"musicallydown.com:1": common_functions["get_tiktok_from_musicallydown"],
			"snaptik.app": common_functions["get_tiktok_from_snaptik"],
			"tikmate.online": common_functions["get_tiktok_from_tikmate"]
		};
		if (!(site in sites)) {
			console_error("Invalid site", site, sites);
			return cb(null);
		}
		sites[site](site, api_cache, options.do_request, url, cb, options);
	};
	common_functions["get_best_tiktok_url"] = function(api_cache, do_request, src, cb) {
		var get_tiktok_vidid_key = function(url) {
			var urlvidid = common_functions["get_tiktok_urlvidid"](url);
			if (!urlvidid) {
				console_warn("Unknown video URL:", url);
				return null;
			}
			return "tiktok_vidid:" + urlvidid;
		};
		var query_tiktok_vidid = function(url, cb) {
			var cache_key = get_tiktok_vidid_key(url);
			if (!cache_key)
				return cb(null);
			api_cache.fetch(cache_key, cb, function(done) {
				var request_handle;
				var request_aborted = false;
				var progress_cb = function(resp) {
					if (request_aborted)
						return;
					if (!resp.responseText) {
						if (resp.readyState !== 4)
							return;
						// Tampermonkey has a bug with onprogress: https://github.com/Tampermonkey/tampermonkey/issues/906
						if (resp.loaded && resp.total && resp.status === 200)
							return;
						request_handle.abort();
						request_aborted = true;
						console_error(resp);
						return done(null, false);
					}
					var match = resp.responseText.match(/mdtacomment[\s\S]{10,400}vid:([0-9a-z]{32})/);
					// after that, it stores 0, 0, 0, 37, with 37 being the length of vid:..., is this related?
					if (!match) {
						if (false) {
							var is_orig = /mdta[\s\S]{10,400}mdtacom\.apple\.quicktime\.description/.test(resp.responseText);
							if (is_orig) {
								request_handle.abort();
								request_aborted = true;
								console_log("Probably original video, skipping remainder of download", url);
								return done(null, 60 * 60);
							}
						}
						if (resp.readyState !== 4) {
							return;
						}
						if (resp.readyState === 4) {
							request_handle.abort();
							request_aborted = true;
							console_warn("Unable to find video ID for", url);
							if (resp.status !== 200) {
								done(null, false);
							} else {
								done(null, 60);
							}
						}
					} else {
						request_handle.abort();
						request_aborted = true;
						done(match[1], 24 * 60 * 60);
					}
				};
				request_handle = do_request({
					url: url,
					method: "GET",
					headers: {
						Referer: "https://www.tiktok.com/"
					},
					onprogress: progress_cb,
					onload: progress_cb
				});
			});
		};
		var get_nowatermark_for_vidid = function(vidid, cb) {
			var cache_key = "tiktok_watermarkfree:" + vidid;
			api_cache.fetch(cache_key, cb, function(done) {
				//var request_url = "https://api.tiktokv.com/aweme/v1/playwm/?video_id=" + vidid + "&ratio=default&improve_bitrate=1";
				var request_url = "https://api2-16-h2.musical.ly/aweme/v1/play/?video_id=" + vidid + "&ratio=default&improve_bitrate=1";
				var request_video = function(times) {
					do_request({
						// &ratio=1080p actually lowers the resolution to 480x* (instead of 576x*):
						// &ratio=default returns the original version (thanks to remlap on discord)
						// https://www.tiktok.com/@mariamenounos/video/6830547359403937030
						url: request_url,
						headers: {
							Referer: "https://www.tiktok.com/",
							//Accept: "text/html",
							Accept: "*/*",
							"Sec-Fetch-Dest": "video",
							"Sec-Fetch-Mode": "no-cors",
							"Sec-Fetch-Site": "cross-site"
						},
						method: "HEAD",
						onload: function(resp) {
							if (resp.readyState !== 4)
								return;
							// https://www.tiktok.com/@auliicravalho/video/6813323310521224454 - returns 302
							// sometimes it can return 503 (service unavailable), but still return a video url (thanks to JoshuaCalvert on discord for reporting)
							//   the video url still doesn't work though, so let's not check for that?
							if (resp.status === 503) {
								if (times < 5) {
									return setTimeout(function() {
										request_video(times + 1);
									}, 500);
								}
							}
							if (resp.status !== 200 && resp.status !== 302 /*&& string_indexof(resp.finalUrl, "/video/") <= 0*/) {
								console_error(resp);
								return done(null, false);
							}
							var finalurl = force_https(get_resp_finalurl(resp));
							// probably the application/json, content-length: 0 bug
							if (finalurl === request_url) {
								if (times < 5) {
									return setTimeout(function() {
										request_video(times + 1);
									}, 500);
								}
							}
							var finalurl_urlvidid = common_functions["get_tiktok_urlvidid"](finalurl);
							if (finalurl_urlvidid) {
								var finalurl_cache_key = "tiktok_vidid:" + finalurl_urlvidid;
								if (!api_cache.has(finalurl_cache_key)) {
									api_cache.set(finalurl_cache_key, vidid, 60 * 60);
								}
							}
							return done(finalurl, 60 * 60);
						}
					});
				};
				request_video(0);
			});
		};
		var get_newurl_if_changed = function(newsrc, src) {
			var old_urlvidid = common_functions["get_tiktok_urlvidid"](src);
			if (!newsrc)
				newsrc = src;
			var new_urlvidid = common_functions["get_tiktok_urlvidid"](newsrc);
			// to avoid infinite redirects
			if (new_urlvidid === old_urlvidid) {
				newsrc = src;
			}
			return newsrc;
		};
		query_tiktok_vidid(src, function(vidid) {
			if (!vidid) {
				return cb(null);
			}
			get_nowatermark_for_vidid(vidid, function(newsrc) {
				cb(get_newurl_if_changed(newsrc, src));
			});
		});
	};
	common_functions["tiktok_remove_watermark"] = function(api_cache, options, url, weburl, cb) {
		// Disabling this for now, it doesn't work anymore and serves no purpose with the latest tiktok rule updates
		if (!options.rule_specific || true) {
			return cb(null);
		}
		var funcs = [];
		if (options.rule_specific.tiktok_no_watermarks) {
			funcs.push("[local]");
		}
		if (options.rule_specific.tiktok_thirdparty && weburl) {
			var thirdparty = options.rule_specific.tiktok_thirdparty;
			// fixme (once/if multiple third party sites are supported)
			if (is_array(thirdparty))
				thirdparty = thirdparty[0];
			funcs.push(thirdparty);
		}
		var process_func = function(newurl) {
			if (newurl) {
				return cb(newurl);
			}
			if (funcs.length === 0) {
				return cb(null);
			}
			var func = funcs[0];
			funcs.shift();
			if (func === "[local]") {
				common_functions["get_best_tiktok_url"](api_cache, options.do_request, url, process_func);
			} else {
				common_functions.get_tiktok_from_3rdparty(func, api_cache, options, weburl, process_func);
			}
		};
		process_func();
	};
	common_functions["youtube_fetch_watchpage_raw"] = function(api_cache, options, id, cb) {
		var url = "https://www.youtube.com/watch?v=" + id;
		if (/^embed:/.test(id)) {
			url = "https://www.youtube.com/embed/" + id.replace(/^embed:/, "") + "/";
		}
		real_api_query(api_cache, options.do_request, "youtube_watchpage_raw:" + id, {
			url: url
		}, cb, function(done, resp, cache_key) {
			return done(resp.responseText, 60 * 60);
		});
	};
	common_functions["youtube_fetch_watchpage_config"] = function(api_cache, options, id, context, cb) {
		var cache_key = "youtube_watchpage_config:" + id + ":" + context;
		api_cache.fetch(cache_key, cb, function(done) {
			common_functions["youtube_fetch_watchpage_raw"](api_cache, options, id, function(data) {
				if (!data)
					return done(null, false);
				var contexts = [context];
				if (context !== "config")
					contexts.push("config");
				var match;
				array_foreach(contexts, function(context) {
					var regex = new RegExp("ytplayer\\." + context + "\\s*=\\s*({.*?});");
					match = data.match(regex);
					if (match) {
						return false;
					}
				});
				if (!match) {
					console_warn(cache_key, "Unable to find ytplayer." + context + " for", { data: data });
					return done(null, false);
				}
				var add_args = false;
				if (/:ytInitialPlayerResponse|:(?:window\.)?ytplayer\.bootstrapPlayerResponse/.test(match[1])) {
					// both window[...] and var ... variants exist
					match = data.match(/(?:window\["ytInitialPlayerResponse"\]|var ytInitialPlayerResponse)\s*=\s*({.*?});/);
					if (!match) {
						console_warn(cache_key, "Unable to find ytInitialPlayerResponse for", { data: data });
						return done(null, false);
					}
					add_args = true;
				}
				try {
					var json = JSON_parse(match[1]);
					if (add_args)
						json.imu_need_args = false;
					return done(json, 5 * 60 * 60);
				} catch (e) {
					console_error(cache_key, e, { json: match[1] });
				}
				return done(null, false);
			});
		});
	};
	common_functions["youtube_fetch_watchpage"] = function(api_cache, options, id, cb) {
		return common_functions["youtube_fetch_watchpage_config"](api_cache, options, id, "config", function(json) {
			if (!json)
				return cb(null);
			try {
				if (json.imu_need_args === false) {
					return cb(json);
				}
				var player_response = json.args.player_response;
				var player_response_json = JSON_parse(player_response);
				return cb(player_response_json);
			} catch (e) {
				console_error(e, json);
			}
			return cb(null);
		});
	};
	common_functions["youtube_fetch_ytcfg"] = function(api_cache, options, id, cb) {
		var cache_key = "youtube_ytcfg:" + id;
		api_cache.fetch(cache_key, cb, function(done) {
			common_functions["youtube_fetch_watchpage_raw"](api_cache, options, id, function(data) {
				if (!data)
					return done(null, false);
				var match = data.match(/;\s+ytcfg\.set\(({.*})\);/);
				if (!match) {
					console_log(cache_key, "Unable to find ytcfg match for", { data: data });
					return done(null, false);
				}
				var jsonstr = match[1];
				var json = null;
				try {
					json = JSON_parse(jsonstr);
				} catch (e) {
					console_error(cache_key, e, { data: data, jsonstr: jsonstr });
					return done(null, false);
				}
				return done(json, 5 * 60 * 60);
			});
		});
	};
	common_functions["youtube_fetch_asset"] = function(api_cache, options, id, asset, cb) {
		var cache_key = "youtube_asset:" + asset;
		api_cache.fetch(cache_key, cb, function(done) {
			common_functions["youtube_fetch_ytcfg"](api_cache, options, id, function(json) {
				if (!json)
					return done(null, false);
				var asseturl = null;
				try {
					var context_config = json.WEB_PLAYER_CONTEXT_CONFIGS.WEB_PLAYER_CONTEXT_CONFIG_ID_KEVLAR_WATCH;
					if ((asset + "Url") in context_config)
						asseturl = context_config[asset + "Url"];
				} catch (e) {
					console_error(cache_key, e, json);
					return done(null, false);
				}
				if (!asseturl) {
					console_warn("Unable to find asset", asset, "in", json);
					return done(null, false);
				}
				var asset_url = urljoin("https://www.youtube.com/", asseturl, true);
				options.do_request({
					url: asset_url,
					method: "GET",
					headers: {
						Referer: "https://www.youtube.com/"
					},
					onload: function(resp) {
						if (resp.status !== 200) {
							console_error(cache_key, resp);
							return done(null, false);
						}
						return done(resp.responseText, 60 * 60);
					}
				});
			});
		});
	};
	common_functions["youtube_fetch_embed"] = function(api_cache, options, id, cb) {
		var cache_key = "youtube_embed_info:" + id;
		api_cache.fetch(cache_key, cb, function(done) {
			common_functions["youtube_fetch_ytcfg"](api_cache, options, "embed:" + id, function(json) {
				if (!json)
					return done(null, false);
				try {
					var player_response = json.PLAYER_VARS.embedded_player_response;
					var player_response_json = JSON_parse(player_response);
					return done(player_response_json, 5 * 60 * 60); // video URLs expire in 6 hours
				} catch (e) {
					console_error(cache_key, e, json);
					return done(null, false);
				}
			});
		});
	};
	// doesn't work anymore
	/*common_functions["youtube_fetch_embed"] = function(api_cache, options, id, cb) {
		var cache_key = "youtube_embed_info:" + id;
		api_cache.fetch(cache_key, cb, function(done) {
			options.do_request({
				url: "https://www.youtube.com/get_video_info?video_id=" + id,
				method: "GET",
				onload: function(resp) {
					if (resp.readyState !== 4)
						return;

					if (resp.status !== 200) {
						console_error(resp);
						return done(null, false);
					}

					// todo: use get_queries instead
					var splitted = resp.responseText.split("&");
					var found_player_response = false;
					for (var i = 0; i < splitted.length; i++) {
						if (/^player_response=/.test(splitted[i])) {
							found_player_response = true;
							var data = decodeURIComponent(splitted[i].replace(/^[^=]+=/, "").replace(/\+/g, "%20"));

							try {
								var json = JSON_parse(data);

								// sometimes fails with: playabilityStatus { status: UNPLAYABLE, reason: Video+unavailable }
								// also fails when video is about to premiere
								//var formats = json.streamingData.formats; // just to make sure it exists
								return done(json, 5*60*60); // video URLs expire in 6 hours
							} catch (e) {
								console_error(e, resp, splitted[i], data);
							}

							break;
						}
					}

					if (!found_player_response) {
						console_error("Unable to find player_response in", splitted[i]);
					}

					done(null, false);
				}
			});
		});
	};*/
	common_functions["parse_flixv2"] = function(resp, cache_key) {
		var regex = /<item>\s*<res>([^<]+)<\/res>\s*<videoLink>(?:<!\[CDATA\[)?(.*?)(?:\]\]>)?<\/videoLink>/;
		var global_regex = new RegExp(regex, "g"); // RegExp allows regexes, but TS doesn't like it
		var match = resp.responseText.match(global_regex);
		if (!match) {
			console_error(cache_key, "Unable to find items in", resp);
			return null;
		}
		var urls = [];
		for (var i = 0; i < match.length; i++) {
			var smatch = match[i].match(regex);
			var quality = smatch[1];
			var url = decode_entities(smatch[2]);
			urls.push({
				url: url,
				quality: parse_int(quality.replace(/^([0-9]+)p$/, "$1")),
				video: true
			});
		}
		urls.sort(function(a, b) {
			return b.quality - a.quality;
		});
		for (var i = 0; i < urls.length; i++) {
			delete urls[i].quality;
		}
		return urls;
	};
	common_functions["parse_mediadefinition"] = function(src, data, cache_key) {
		if (!data) {
			return null;
		}
		try {
			var maxdef = 0;
			var maxobj = null;
			for (var i = 0; i < data.mediaDefinition.length; i++) {
				var def = data.mediaDefinition[i];
				// e.g. 2160/1440p videos for non-logged in members
				if (!def.videoUrl)
					continue;
				def.quality = parse_int(def.quality);
				if (def.quality > maxdef) {
					maxdef = def.quality;
					maxobj = def;
				}
			}
			// the queries constantly change, so to avoid constantly refreshing, let's make sure the base URL is different
			// the domain can also change (cv/ev) so remove that as well
			var newsrc = maxobj.videoUrl;
			var noq = src.replace(/[?#].*$/, "").replace(/^[a-z]+:\/\/[^/]+\/+/, "");
			var newnoq = newsrc.replace(/[?#].*$/, "").replace(/^[a-z]+:\/\/[^/]+\/+/, "");
			if (noq === newnoq)
				newsrc = src;
			return {
				url: newsrc,
				extra: {
					page: data.link_url,
					caption: data.video_title
				},
				headers: {
					Referer: data.link_url
				},
				video: true,
				is_private: true // linked to IP
			};
		} catch (e) {
			console_error(cache_key, e);
		}
		return null;
	};
	common_functions["get_parent_el_matching"] = function(el, match) {
		var current = el;
		while (current) {
			if (match(current)) {
				return current;
			}
			current = current.parentElement;
		}
		return null;
	};
	var _get_match_func = function(match) {
		var func = match;
		if (typeof func === "object" && func instanceof RegExp) {
			var regex = func;
			func = function(x) {
				return regex.test(x.href);
			};
		}
		return func;
	};
	common_functions["get_link_el_matching"] = function(el, match) {
		var func = _get_match_func(match);
		return common_functions["get_parent_el_matching"](el, function(x) {
			return x.tagName === "A" && func(x);
		});
	};
	common_functions["get_pagelink_el_matching"] = function(el, match) {
		var link_el = common_functions["get_link_el_matching"](el, match);
		if (!link_el)
			return null;
		return {
			url: link_el.href,
			is_pagelink: true
		};
	};
	common_functions["get_host_el_matching"] = function(el, host_url, el_match) {
		el = common_functions["get_parent_el_matching"](el, el_match);
		if (!el)
			return null;
		return {
			url: host_url,
			is_pagelink: true
		};
	};
	common_functions["get_pagelink_host_el_matching"] = function(options, our_options) {
		var newsrc = common_functions["get_pagelink_el_matching"](options.element, our_options.url_match);
		if (newsrc)
			return newsrc;
		if (!our_options.url_match.test(options.host_url))
			return null;
		newsrc = common_functions["get_host_el_matching"](options.element, options.host_url, our_options.el_match);
		if (newsrc)
			return newsrc;
	};
	common_functions["is_pinterest_domain"] = function(domain) {
		var domain_nosub = get_domain_nosub(domain);
		return !!(/^pinterest\./.test(domain_nosub));
	};
	common_functions["get_jsonformatter_for_cryptojs"] = function(CryptoJS) {
		var JsonFormatter = {
			stringify: function(cipherParams) {
				var jsonObj = { ct: cipherParams.ciphertext.toString(CryptoJS.enc.Base64) };
				if (cipherParams.iv) {
					jsonObj.iv = cipherParams.iv.toString();
				}
				if (cipherParams.salt) {
					jsonObj.s = cipherParams.salt.toString();
				}
				return JSON_stringify(jsonObj);
			},
			parse: function(jsonStr) {
				var jsonObj = JSON_parse(jsonStr);
				var cipherParams = CryptoJS.lib.CipherParams.create({
					ciphertext: CryptoJS.enc.Base64.parse(jsonObj.ct)
				});
				if (jsonObj.iv) {
					cipherParams.iv = CryptoJS.enc.Hex.parse(jsonObj.iv);
				}
				if (jsonObj.s) {
					cipherParams.salt = CryptoJS.enc.Hex.parse(jsonObj.s);
				}
				return cipherParams;
			}
		};
		return JsonFormatter;
	};
	common_functions["create_dash_stream"] = function(data) {
		var header = "<?xml version=\"1.0\"?>\n";
		header += "<MPD xmlns=\"urn:mpeg:dash:schema:mpd:2011\" type=\"static\"";
		header += " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";
		header += " xsi:schemaLocation=\"urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd\"";
		var get_attrib = function(attrib, value) {
			if (value === void 0)
				return "";
			return " " + attrib + "=\"" + encode_entities(value + "") + "\"";
		};
		if (data.duration) {
			var hours = (data.duration / 60 / 60) | 0;
			var minutes = ((data.duration / 60) | 0) % 60;
			var seconds = data.duration % 60;
			header += get_attrib("mediaPresentationDuration", "PT" + hours + "H" + minutes + "M" + seconds + "S");
		}
		if (data.min_buffer_time) {
			header += get_attrib("minBufferTime", data.min_buffer_time);
		}
		header += " profiles=\"urn:mpeg:dash:profile:isoff-main:2011\"";
		//header += " profiles=\"urn:mpeg:dash:profile:isoff-on-demand:2011\"";
		header += ">\n<Period>\n";
		var get_range_str = function(range) {
			if (typeof range === "string")
				return range;
			return range.start + "-" + range.end;
		};
		var create_representation = function(representation) {
			var rep = "  <Representation";
			rep += get_attrib("mimeType", representation.mime);
			rep += get_attrib("codecs", representation.codecs);
			rep += get_attrib("bandwidth", representation.bandwidth);
			rep += get_attrib("width", representation.width);
			rep += get_attrib("height", representation.height);
			rep += get_attrib("id", representation.id);
			if ("frame_rate" in representation)
				rep += get_attrib("frameRate", representation.frame_rate);
			if ("start_with_sap" in representation)
				rep += get_attrib("startWithSap", representation.start_with_sap);
			if ("sar" in representation)
				rep += get_attrib("sar", representation.sar);
			rep += ">\n";
			rep += "    <BaseURL>" + encode_entities(representation.url) + "</BaseURL>\n";
			if (representation.index_range || representation.init_range) {
				rep += "    <SegmentBase";
				if (representation.index_range)
					rep += get_attrib("indexRange", get_range_str(representation.index_range));
				rep += ">\n";
				if (representation.init_range) {
					rep += "      <Initialization";
					rep += get_attrib("range", get_range_str(representation.init_range));
					rep += " />\n";
				}
				rep += "    </SegmentBase>\n";
			}
			rep += "  </Representation>";
			return rep;
		};
		var create_adaptationset = function(mime, items) {
			var as = "  <AdaptationSet mimeType=\"" + mime + "\"";
			as += ">\n";
			array_foreach(items, function(item) {
				as += create_representation(item).replace(/^/mg, "  ") + "\n";
			});
			as += "  </AdaptationSet>";
			return as;
		};
		if (!data.mimes) {
			data.mimes = {};
			var add_video_audio = function(audiovideo) {
				var array = audiovideo === "audio" ? data.audios : data.videos;
				array_foreach(array, function(item) {
					if (!item.mime) {
						// todo: create common_function for getting the extension
						var ext = item.url.replace(/^[^?#]+\.([^/.?#]+)(?:[?#].*)?$/, "$1");
						if (ext !== item.url) {
							if (!item.codecs) {
								// https://cconcolato.github.io/media-mime-support/
								if (ext === "mp4") {
									//item.codecs = "avc1.640028";
									item.codecs = "avc1.4d401f";
								} else if (ext === "mp3") {
									item.codecs = "mp3";
									//item.codecs = "mp4a.40.2";
								}
							}
							if (ext === "mp3")
								ext = "mp4";
							item.mime = audiovideo + "/" + ext;
						} else {
							console_warn("Unable to get mime for", item);
							return;
						}
					}
					if (!(item.mime in data.mimes))
						data.mimes[item.mime] = [];
					data.mimes[item.mime].push(item);
				});
			};
			add_video_audio("video");
			add_video_audio("audio");
		}
		for (var mime in data.mimes) {
			header += create_adaptationset(mime, data.mimes[mime]) + "\n";
		}
		header += "</Period>\n</MPD>\n";
		return header;
	};
	var _sources_or_null = function(sources) {
		if (!sources.video.length) {
			if (!sources.image.length) {
				console_warn("Unable to find video sources");
				return null;
			}
		}
		return sources;
	};
	common_functions["get_videotag_sources"] = function(text) {
		var videomatch = text.match(/<video[\s\S]+?<\/video>/i);
		if (!videomatch) {
			console_error("Unable to find video tag from", { text: text });
			return null;
		}
		var video_parsed = parse_tag_def(videomatch[0]);
		if (!video_parsed) {
			console_error("Unable to parse <video> tag", videomatch[0]);
			return null;
		}
		var add_source = function(parsed) {
			parsed.name = parsed.args.title || null;
			parsed.url = parsed.args.src;
			sources.video.push(parsed);
		};
		var sources = {
			video: [],
			image: [],
			subtitles: []
		};
		if (video_parsed.args["src"])
			add_source(video_parsed);
		if (video_parsed.args["poster"]) {
			sources.image.push(video_parsed.args["poster"]);
		}
		var sources_match = videomatch[0].match(/<source.*?\/?>\s*(?:<\/source>)?/g);
		if (!sources_match) {
			return _sources_or_null(sources);
		}
		array_foreach(sources_match, function(source) {
			var parsed = parse_tag_def(source);
			if (!parsed) {
				console_warn("Unable to parse <source> tag", source);
				return;
			}
			if (parsed.args["src"])
				add_source(parsed);
		});
		var captions_match = videomatch[0].match(/<track[^>]+?>/g);
		if (captions_match) {
			for (var _i = 0, captions_match_1 = captions_match; _i < captions_match_1.length; _i++) {
				var caption = captions_match_1[_i];
				var parsed = parse_tag_def(caption);
				if (!parsed) {
					console_warn("Unable to parse <track> tag", caption);
					continue;
				}
				if (parsed.args["kind"] !== "captions" && parsed.args["kind"] !== "subtitles")
					continue;
				if (!parsed.args["src"])
					continue;
				var capt_obj = {
					url: parsed.args["src"],
					title: null
				};
				if (parsed.args["label"])
					capt_obj.title = parsed.args["label"];
				sources.subtitles.push(capt_obj);
			}
		}
		sources.video.sort(function(a, b) {
			if (!a.name || !b.name)
				return 0;
			var amatch = a.name.match(/^([0-9]+)p$/);
			var bmatch = b.name.match(/^([0-9]+)p$/);
			if (!amatch || !bmatch)
				return 0;
			return parse_int(bmatch[1]) - parse_int(amatch[1]);
		});
		return _sources_or_null(sources);
	};
	common_functions["get_holaplayer_sources"] = function(objtext) {
		if (objtext[0] !== "{") {
			var match = objtext.match(/window\.hola_player\(({.*?}),\s*function/);
			if (match) {
				objtext = match[1];
			} else {
				console_error("Unable to find hola_player match from", { text: objtext });
				return null;
			}
		}
		match = objtext.match(/sources["']?:\s*(\[{.*?}\]),/);
		if (!match) {
			console_error("Unable to find sources match for", { text: objtext });
			return null;
		}
		var video_sources = JSON_parse(fixup_js_obj(match[1]));
		var poster = null;
		match = objtext.match(/poster["']?:\s*["'](https?:\/\/[^"']+)["'],/);
		if (!match) {
			console_warn("Unable to find poster match for", { text: objtext });
		} else {
			poster = match[1];
		}
		var sources = {
			video: [],
			image: []
		};
		if (poster) {
			sources.image.push(poster);
		}
		array_foreach(video_sources, function(source) {
			sources.video.push({
				src: source.src,
				type: source.type,
				url: source.src
			});
		});
		return _sources_or_null(sources);
	};
	common_functions["get_obj_from_videosources"] = function(page, sources) {
		var urls = [];
		array_foreach(sources.video, function(source) {
			var video = true;
			if (source.type === "application/x-mpegURL" || string_indexof(source.url, ".m3u8") >= 0) {
				video = "hls";
			}
			// TODO: DASH
			urls.push({
				url: urljoin(page, source.url, true),
				video: video
			});
		});
		array_foreach(sources.image, function(image) {
			urls.push(urljoin(page, image, true));
		});
		return urls;
	};
	common_functions["get_videotag_obj"] = function(resp, options) {
		if (!options)
			options = {};
		if (!("ogimage" in options))
			options.ogimage = true;
		if (!("videotag" in options))
			options.videotag = true;
		var sources = { video: [], image: [], subtitles: [] };
		if (options.videotag) {
			sources = common_functions["get_videotag_sources"](resp.responseText);
			if (!sources)
				return null;
		}
		var page = get_meta(resp.responseText, "og:url");
		if (page)
			page = urljoin(resp.finalUrl, page, true);
		else
			page = resp.finalUrl;
		var obj = {
			headers: {
				Referer: page
			},
			extra: {
				page: page
			}
		};
		var caption = get_meta(resp.responseText, "og:title");
		if (caption)
			obj.extra.caption = caption;
		// todo: should this be in get_videotag_sources instead?
		sources.video.sort(function(a, b) {
			if (a.args.res && b.args.res) {
				return b.args.res - a.args.res;
			}
			return 0;
		});
		var video_urls = [];
		array_foreach(sources.video, function(source) {
			video_urls.push(urljoin(page, source.url, true));
		});
		var subs = null;
		if (sources.subtitles && sources.subtitles.length) {
			subs = [];
			for (var _i = 0, _a = sources.subtitles; _i < _a.length; _i++) {
				var subtitle = _a[_i];
				var baseobj = deepcopy(subtitle);
				baseobj.url = urljoin(page, subtitle.url, true);
				subs.push(baseobj);
			}
		}
		if (options.ogvideo) {
			var ogvideo = get_meta(resp.responseText, "og:video");
			if (ogvideo) {
				array_upush(video_urls, urljoin(page, ogvideo, true));
			}
		}
		var image_urls = [];
		array_foreach(sources.image, function(image) {
			image_urls.push(urljoin(page, image, true));
		});
		if (options.ogimage) {
			var ogimage = get_meta(resp.responseText, "og:image");
			if (ogimage) {
				array_upush(image_urls, urljoin(page, ogimage, true));
			}
		}
		var urls = [];
		array_foreach(video_urls, function(url) {
			var obj = {
				url: url,
				video: true
			};
			if (subs) {
				obj.subtitles = deepcopy(subs);
			}
			urls.push(obj);
		});
		array_extend(urls, image_urls);
		if (!urls.length)
			return null;
		return fillobj_urls(urls, obj);
	};
	common_functions["update_album_info_links"] = function(obj, cmp) {
		var links = obj.album_info.links;
		var found = false;
		array_foreach(links, function(link, i) {
			if (!found && cmp(link.x_id || link.url)) {
				links[i].is_current = true;
				obj.url = links[i].real_url || links[i].url;
				found = true;
			} else {
				links[i].is_current = false;
			}
		});
		if (!found && links.length > 0) {
			links[0].is_current = true;
		}
		return obj;
	};
	common_functions["run_msml_op"] = function(state, process_data, cb) {
		var matches = state.matches;
		var op = process_data.op;
		var waiting = false;
		//console_log(process_data);
		if (op === "obj_set") {
			var value;
			if (process_data.value) {
				value = process_data.value;
			} else if (process_data.match) {
				value = matches[process_data.match];
			}
			if (process_data.subkey) {
				value = value[process_data.subkey];
			}
			var outfolder = matches;
			var outvar = process_data.out;
			if (process_data.out_subkey) {
				outfolder = matches[process_data.out];
				outvar = process_data.out_subkey;
			}
			outfolder[outvar] = value;
		} else if (op === "run") {
			var args = [];
			array_foreach(process_data.args, function(arg) {
				var value;
				if (typeof arg !== "object")
					arg = { value: arg };
				if (arg.value) {
					value = arg.value;
				} else if (arg.match) {
					value = matches[arg.match];
				} else if (arg.self) {
					value = state.ms_data[arg.self];
				}
				if (arg.subkey) {
					value = value[arg.subkey];
				}
				if (arg.regex)
					value = encode_regex(value);
				if (arg.cb) {
					value = function(data) {
						if (process_data.out) {
							matches[process_data.out] = data;
						}
						if ("bad" in process_data && data === process_data.bad) {
							cb(false);
						} else {
							cb(true);
						}
					};
					waiting = true;
				}
				args.push(value);
			});
			var obj = common_functions;
			if (process_data.match) {
				obj = matches[process_data.match];
			}
			var result = obj[process_data.key].apply(this, args);
			if ("bad" in process_data && result === process_data.bad) {
				console_error("Error running", process_data);
				return false;
			}
			if (process_data.out) {
				matches[process_data.out] = result;
			}
		} else if (op === "regex") {
			var flags = deepcopy(state.ms_data[process_data.flags]);
			obj_foreach(flags, function(key, data) {
				if (typeof data === "object") {
					if (data.replace_match) {
						delete flags[key];
						obj_foreach(data.replace_match, function(key1, value1) {
							key = string_replaceall(key, "%" + key1 + "%", encode_regex(matches[value1]));
						});
						flags[key] = data.source;
					}
				}
			});
			var regex_str = common_functions[process_data.key](common_functions[process_data.base], flags, state.ms_dadta);
			var in_match = process_data.in || "in";
			var match = matches[in_match].match(new RegExp(regex_str));
			if (!match) {
				console_error("Unable to find match from", {
					str: matches[in_match],
					regex: regex_str
				});
				return false;
			}
			matches[process_data.out] = match[process_data.save];
		} else if (op === "parse_queries") {
			var url = matches[process_data.match];
			if (!/^(?:https?:)?\//.test(url))
				url = "?" + url;
			var queries = get_queries(url, { decode: true });
			if (is_array(process_data.out)) {
				var keys = Object.keys(queries).sort();
				array_foreach(keys, function(key, i) {
					if (i in process_data.out) {
						matches[process_data.out[i]] = queries[key];
					} else {
						return false;
					}
				});
			} else {
				obj_foreach(process_data.out, function(key, value) {
					if (key in queries)
						matches[value] = queries[key];
				});
			}
		} else if (op === "add_queries") {
			url = matches[process_data.match];
			var queries = {};
			array_foreach(process_data.queries, function(query_obj) {
				var query = query_obj.query;
				var value = query_obj.value;
				if (typeof query === "object")
					query = matches[query.match];
				if (typeof value === "object")
					value = matches[value.match];
				queries[query] = value;
			});
			matches[process_data.out] = add_queries(url, queries);
		} else if (op === "parse_match") {
			var out = [];
			array_foreach(matches[process_data.match], function(sdata) {
				var subarr = [];
				obj_foreach(sdata, function(key, value) {
					if (typeof value === "string") {
						subarr.push(matches[process_data.subkey][value]);
					} else if (is_array(value)) {
						subarr.push(value[value.length - 1]);
					} else {
						subarr.push(value);
					}
				});
				out.push(deepcopy(subarr));
			});
			matches[process_data.out] = out;
		} else if (op === "final") {
			state.ok = true;
		} else {
			console_error("Unknown operation", process_data);
		}
		if (waiting)
			return "waiting";
	};
	common_functions["run_msml_oplist"] = function(state, oplist, cb) {
		state.ok = false;
		var waiting = false;
		try {
			array_foreach(oplist, function(op, i) {
				var result = common_functions["run_msml_op"](state, op, function(success) {
					if (!success) {
						state.ok = false;
						return cb(state.ok);
					} else {
						common_functions["run_msml_oplist"](state, oplist.slice(i + 1), cb);
					}
				});
				if (!result)
					return result;
				if (result === "waiting") {
					waiting = true;
					return false;
				}
			});
		} catch (e) {
			console_error("Error running oplist", state.matches);
			throw e;
		}
		if (!waiting)
			cb(state.ok);
	};
	common_functions["run_msml"] = function(ms_data, in_data, cb) {
		if (!ms_data || !in_data) {
			return cb(null);
		}
		var state = {
			matches: {},
			ms_data: ms_data
		};
		var our_run = function(data, cb) {
			var our_state = {
				matches: deepcopy(state.matches),
				ms_data: ms_data
			};
			our_state.matches["in"] = data;
			common_functions["run_msml_oplist"](our_state, our_state.ms_data.run, function(ok) {
				if (!ok) {
					return cb(null);
				}
				cb(our_state.matches.out);
			});
		};
		if (state.ms_data.bootstrap) {
			state.matches["in"] = in_data;
			common_functions["run_msml_oplist"](state, state.ms_data.bootstrap, function(ok) {
				if (!ok) {
					return cb(null);
				}
				cb(our_run);
			});
		} else {
			cb(our_run);
		}
	};
	common_functions["process_formats"] = function(api_cache, options, formats, cb) {
		var total = 0;
		var processed = 0;
		var msmls = {};
		var do_cb = function() {
			//console_log(processed, total);
			if (processed >= total) {
				cb(formats);
				processed = -1; // don't run final twice
			}
		};
		//console_log(deepcopy(formats));
		array_foreach(formats, function(format) {
			obj_foreach(format, function(key) {
				if (!format[key] || !options.process_format || !(key in options.process_format)) {
					return;
				}
				total++;
				if (!(key in msmls)) {
					msmls[key] = [];
				}
				msmls[key].push(format);
			});
		});
		obj_foreach(msmls, function(key) {
			msmls[key][0].imu_msml_options = options;
			msmls[key][0].imu_msml_api_cache = api_cache;
			common_functions["run_msml"](options.process_format[key], msmls[key][0], function(msml) {
				if (!msml) {
					processed++;
					do_cb();
					return;
				}
				array_foreach(msmls[key], function(format) {
					msml(format, function() {
						processed++;
						do_cb();
					});
				});
			});
		});
		do_cb();
	};
	common_functions["normalize_function"] = function(func, vars) {
		var body = func.toString()
			.replace(/\/\/.*/g, "") // fixme: this would break "//"
			.replace(/(return|var)\s+/g, "$1##") // awful hack
			.replace(/\s*/g, "")
			.replace(/(return|var)##/g, "$1 ")
			.replace(/^(?:function\([^)]*\))?{(.*?);*}$/, "{$1}");
		if (vars) {
			for (var out_var in vars) {
				var values = vars[out_var];
				if (!is_array(values))
					values = [values];
				array_foreach(values, function(our_var) {
					if (typeof our_var === "string") {
						our_var = { source: our_var };
					}
					if (our_var.regex) {
						body = body.replace(new RegExp(our_var.source, "g"), out_var);
					} else {
						body = string_replaceall(body, our_var.source, out_var);
					}
				});
			}
		}
		return body;
	};
	common_functions["get_mappings_for_objstr"] = function(funcs, objstr, vars) {
		var debug_info = {
			funcs: funcs,
			objstr: objstr,
			vars: vars
		};
		var funcmapping_regex = new RegExp("(" + js_obj_token_types.jvarname.source + ")[\"']?\\s*:\\s*function\\s*[(][^)]*[)]\\s*({.*?})(?:,|};?$)");
		var matches = match_all(objstr, funcmapping_regex);
		if (!matches) {
			console_error("Unable to find mappings", debug_info);
			return null;
		}
		var mappings = {};
		var mappings_ok = true;
		var func_norm = [];
		array_foreach(funcs, function(func) {
			func_norm.push(common_functions["normalize_function"](func, vars));
		});
		array_foreach(matches, function(match) {
			var func_name = match[1];
			var func_body = common_functions["normalize_function"](match[2]);
			array_foreach(func_norm, function(our_body, i) {
				if (our_body === func_body) {
					mappings[func_name] = i;
					return false;
				}
			});
			if (!mappings[func_name]) {
				debug_info.matches = matches;
				debug_info.match = match;
				console_error("Unable to find mapping", debug_info);
				mappings_ok = false;
				return false;
			}
		});
		if (!mappings_ok) {
			return null;
		} else {
			return mappings;
		}
	};
	common_functions["parse_js_calls"] = function(namespace, code) {
		var regex = "";
		if (namespace) {
			regex = namespace + "\\.";
		} else {
			regex = "[^$_a-zA-Z0-9]";
		}
		regex += "(" + js_obj_token_types.jvarname.source + ")[(]([^)]*)[)][;\\s}]";
		var matches = match_all(code, new RegExp(regex));
		if (!matches) {
			return null;
		}
		var calls = [];
		array_foreach(matches, function(match) {
			var call = {
				name: match[1],
				args: []
			};
			var arg_matches = match_all(match[2], /([$_a-zA-Z0-9.]+)\s*(?:,|$)/);
			if (!arg_matches) {
				return;
			}
			array_foreach(arg_matches, function(argmatch) {
				var argval = argmatch[1];
				if (js_obj_token_types.number.test(argval)) {
					argval = parseFloat(argval);
				}
				call.args.push(argval);
			});
			calls.push(call);
		});
		return calls;
	};
	common_functions["find_actual_largest_image"] = function(current, images, cb, options) {
		if (images.length < 2) {
			return cb(images[0]);
		}
		if (!options)
			options = {};
		if (!options.cache)
			options.cache = {};
		var cache = options.cache;
		var query_contentlength = function(url, cb) {
			real_api_query(options.api_cache, options.do_request, "contentlength:" + url, {
				url: url,
				headers: {
					Referer: ""
				},
				method: "HEAD",
				silent: true
			}, cb, function(done, resp, cache_key) {
				var headers = headers_list_to_dict(parse_headers(resp.responseHeaders));
				if (!("content-length" in headers)) {
					if (resp.status === 404) {
						return done(null, 60 * 60);
					} else {
						return done(null, false);
					}
				}
				return done(parse_int(headers["content-length"]), 60 * 60);
			});
		};
		var our_get_image_size = function(src, cb) {
			if (src in cache) {
				return cb(cache[src][0], cache[src][1]);
			}
			if (!options.check_length) {
				get_image_size(src, function(x, y) {
					if (!x || !y) {
						return cb(x, y);
					}
					cache[src] = [x, y];
					cb(x, y);
				});
			} else {
				query_contentlength(src, function(contentlength) {
					cb(contentlength, contentlength);
				});
			}
		};
		var do_imageurl = function(imageurl, i) {
			our_get_image_size(imageurl, function(x, y) {
				if (cancel)
					return;
				if (!x || !y) {
					if (imageurl === current) {
						cancel = true;
						return cb(null);
					}
				} else {
					processed_urls[imageurl] = [x, y, i];
				}
				processed++;
				if (processed < total)
					return;
				var min = -1;
				var min_url = null;
				// to avoid redirects to identically sized images
				if (current in processed_urls) {
					min_url = current;
					min = processed_urls[current][0] * processed_urls[current][1];
				}
				obj_foreach(processed_urls, function(key, value) {
					var ours = value[0] * value[1];
					if (ours > min) {
						min = ours;
						min_url = key;
					}
				});
				if (total < images.length) {
					images.splice(0, total);
					images.unshift(min_url);
					common_functions["find_actual_largest_image"](current, images, cb, options);
				} else {
					cb(min_url);
				}
			});
		};
		var processed = 0;
		var processed_urls = {};
		var cancel = false;
		var total = images.length;
		if (total > 2 && options.respect_order) {
			total = 2;
		}
		for (var i = 0; i < total; i++) {
			do_imageurl(images[i], i);
		}
	};
	common_functions["gen_jquery_callback"] = function() {
		return "jQuery" + get_random_text(20) + "_" + Date.now();
	};
	common_functions["get_largest_twimg"] = function(url, options) {
		var fill_obj_filename = function(obj, url) {
			var format = get_queries(url).format;
			if (format) {
				var basename = url.match(/\/([^/.?#]+)(?:\.[^/.]+)?(?:[?#].*)?$/);
				obj.filename = basename[1] + "." + format;
			}
		};
		var use_ext = false;
		if (options && options.rule_specific && options.rule_specific.twitter_use_ext) {
			use_ext = true;
		}
		var obj = {
			url: url,
			can_head: false // 503 sometimes
		};
		var newsrc, match;
		if (string_indexof(obj.url, "/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
			// thanks to Liz on discord:
			// https://pbs.twimg.com/profile_images/1120032409045602304/id2Moo0W_x96.png
			//   https://pbs.twimg.com/profile_images/1120032409045602304/id2Moo0W.png
			//return src.replace(/_[a-zA-Z0-9]+\.([^/_]*)$/, "\.$1");
			newsrc = obj.url
				.replace(/[?#].*$/, "")
				.replace(/_(?:bigger|normal|mini|reasonably_small|[0-9]*x[0-9]+)(\.[^/_]*)$/, "$1");
			if (newsrc !== obj.url) {
				obj.url = newsrc;
				return obj;
			} else {
				return;
			}
		}
		if (string_indexof(obj.url, "/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
			newsrc = obj.url.replace(/\/[0-9]+x[0-9]+(?:[?#].*)?$/, "");
			if (newsrc !== obj.url) {
				obj.url = newsrc;
				return obj;
			} else {
				return;
			}
		}
		fill_obj_filename(obj, obj.url);
		// replace :orig to name=orig, should always work?
		newsrc = obj.url
			.replace(/:([^/?]+)(.*)?$/, "$2?name=$1")
			.replace(/(\?.*)\?name=/, "$1&name=");
		if (newsrc !== obj.url) {
			obj.url = newsrc;
		}
		if (false && !(/\/(?:card|ad|semantic_core)_img\//.test(obj.url))) {
			// replace format=jpg to .jpg, doesn't work for /card_img/
			// doesn't work for some tweet images too (thanks to llacb47 on github for reporting: https://github.com/qsniyg/maxurl/issues/545)
			// https://pbs.twimg.com/media/EnlTOuPVkAEVFcG?format=jpg&name=medium
			//   https://pbs.twimg.com/media/EnlTOuPVkAEVFcG?format=jpg&name=orig
			if (false) {
				newsrc = obj.url
					.replace(/(\/[^/.?]+)\?(.*?&)?format=([^&]*)(.*?$)?/, "$1.$3?$2$4")
					.replace(/\?&/, "?")
					.replace(/[?&]+$/, "");
			}
		}
		if (/:\/\/[^/]+\/+media\//.test(obj.url)) {
			match = obj.url.match(/^([^?#]+\/[^/.?#]+)\.([^/.?#]+)([?#].*)?$/);
			if (match) {
				// todo: check if format already exists and don't overwrite?
				newsrc = add_queries(match[1] + (match[3] || ""), { format: match[2] });
			}
			newsrc = newsrc.replace(/([?&]format=)webp(&.*)?$/, "$1jpg$2");
			// should always work?
			if (newsrc !== obj.url) {
				fill_obj_filename(obj, newsrc);
				obj.url = newsrc;
			}
		}
		// http://pbs.twimg.com/tweet_video_thumb/EmCgOz9U4AA0bib.jpg
		//   https://pbs.twimg.com/tweet_video/EmCgOz9U4AA0bib.mp4
		match = obj.url.match(/\/tweet_video_thumb\/+([^/.?#]+)\./);
		if (match) {
			return {
				url: obj.url.replace(/\/tweet_video_thumb\/+[^/]+\.[^/.]+(?:[?#].*)?$/, "/tweet_video/" + match[1] + ".mp4"),
				video: true
			};
		}
		// 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
		// thanks to fireattack on discord for reporting:
		// https://pbs.twimg.com/media/F7L8Rmyb0AAxAro?format=jpg&name=small
		//   https://pbs.twimg.com/media/F7L8Rmyb0AAxAro?format=jpg&name=medium -- 404
		var names = ["orig", "4096x4096", "large", "medium"];
		var baseobj = obj;
		var mobj = [];
		var name_match = baseobj.url.match(/[?&]name=([^&]+)/);
		var name = name_match ? name_match[1] : null;
		// don't downscale
		var end = array_indexof(names, name);
		if (end < 0)
			end = names.length;
		var obj_add = function(x) {
			var newobj = deepcopy(baseobj);
			newobj.url = x;
			fill_obj_filename(newobj, newobj.url);
			mobj.push(newobj);
		};
		var format_to_ext = function(src, format) {
			src = keep_queries(src, ["name"]);
			src = src.replace(/(\/[^/?&#.]+)(?:\.[^/?&#.]+)?(\?.*)?$/, "$1." + format + "$2");
			return src;
		};
		for (var i = 0; i < end; i++) {
			newsrc = baseobj.url
				.replace(/(\.[a-z]+)\?(?:(.*)&)?format=[^&]+/, "$1?$2&")
				.replace(/&$/, "");
			newsrc = add_queries(newsrc, { name: names[i] });
			//var newsrc_colon = newsrc.replace(/\?name=([^&]+)$/, ":$1");
			// don't do this, this doesn't work for .jpg?format=jpg&name=...
			// commenting out because src doesn't exist
			/*if (false) {
				newsrc = src.replace(/([?&]name=)[^&]+(&.*)?$/, "$1" + names[i] + "$2");
				if (newsrc === src)
					newsrc = src
						.replace(/(\?.*)?$/, "$1?name=" + names[i])
						.replace(/(\?.*)\?name=/, "$1&name=");
			}*/
			var queries = get_queries(newsrc);
			if (queries.format === "png" || queries.format === "jpg") {
				if (use_ext)
					obj_add(format_to_ext(newsrc, "png"));
				obj_add(add_queries(newsrc, { format: "png" }));
				if (use_ext)
					obj_add(format_to_ext(newsrc, "jpg"));
				obj_add(add_queries(newsrc, { format: "jpg" }));
			} else {
				if (use_ext && queries.format)
					obj_add(format_to_ext(newsrc, queries.format));
				obj_add(newsrc);
			}
		}
		obj_add(baseobj.url);
		if (mobj.length > 1)
			return mobj;
	};
	common_functions["parse_imu_hash"] = function(url) {
		var match = url.match(/#(.*)/);
		if (!match)
			return null;
		var queries = {};
		obj_foreach(get_queries("?" + match[1]), function(key, value) {
			var keymatch = key.match(/^imu-(.*)/);
			if (!keymatch)
				return;
			queries[keymatch[1]] = value;
		});
		return queries;
	};
	common_functions["multidomain__nitter"] = function(domain, domain_nowww) {
		return domain_nowww === "nitter.net" ||
			// https://github.com/zedeus/nitter/wiki/Instances
			// sorting same as instance list in case we need to add new ones from it
			domain === "nitter.lacontrevoie.fr" ||
			domain === "nitter.nixnet.services" ||
			domain === "nitter.fdn.fr" ||
			domain === "nitter.1d4.us" ||
			domain === "nitter.kavin.rocks" ||
			domain === "nitter.unixfox.eu" ||
			domain === "nitter.domain.glass" ||
			domain === "birdsite.xanny.family" ||
			domain === "nitter.moomoo.me" ||
			domain === "bird.trom.tf" ||
			domain === "nitter.it" ||
			domain === "nitter.weiler.rocks" ||
			domain === "nitter.sethforprivacy.com" ||
			domain === "nitter.nl" ||
			domain === "nitter.mint.lgbt" ||
			domain === "nitter.esmailelbob.xyz" ||
			domain === "tw.artemislena.eu" ||
			domain === "nitter.tiekoetter.com" ||
			domain === "nitter.privacy.com.de" ||
			domain === "nitter.bird.froth.zone" ||
			domain === "nitter.cz" ||
			domain === "nitter.privacydev.net" ||
			domain === "tweet.lambda.dance" ||
			domain === "nitter.kylrth.com" ||
			domain === "unofficialbird.com" ||
			domain === "nitter.projectsegfau.lt" ||
			domain === "nitter.eu.projectsegfau.lt" ||
			domain === "nitter.in.projectsegfau.lt" ||
			domain === "singapore.unofficialbird.com" ||
			domain === "canada.unofficialbird.com" ||
			domain === "india.unofficialbird.com" ||
			domain === "nederland.unofficialbird.com" ||
			domain === "uk.unofficialbird.com" ||
			domain === "nitter.soopy.moe" ||
			domain === "nitter.qwik.space" ||
			domain === "read.whatever.social" ||
			domain === "nitter.rawbit.ninja" ||
			domain === "nt.vern.cc" ||
			domain === "n.sneed.network" ||
			domain === "nitter.smnz.de" ||
			domain === "nitter.twei.space" ||
			domain === "nitter.inpt.fr" ||
			domain === "nitter.d420.de" ||
			domain === "nitter.caioalonso.com" ||
			domain === "nitter.at" ||
			domain === "nitter.nicfab.eu" ||
			domain === "bird.habedieeh.re" ||
			domain === "nitter.hostux.net" ||
			domain === "nitter.adminforge.de" ||
			domain === "nitter.platypush.tech" ||
			domain === "nitter.us.projectsegfau.lt" ||
			domain === "t.com.sb" ||
			domain === "nitter.kling.gg" ||
			domain === "nitter.riverside.rocks" ||
			domain === "nitter.lunar.icu" ||
			domain === "twitter.moe.ngo" ||
			domain === "nitter.freedit.eu" ||
			domain === "n.opnxng.com" ||
			domain === "nitter.tux.pizza" ||
			domain === "nitter.altgr.xyz" ||
			domain === "jote.lile.cl" ||
			domain === "nitter.one" ||
			domain === "nitter.io.lol" ||
			domain === "nitter.no-logs.com" ||
			domain === "tweet.whateveritworks.org" ||
			domain === "nitter.fediflix.org" ||
			domain === "nitter.nohost.network" ||
			domain === "nitter.simpleprivacy.fr" ||
			domain === "nitter.onthescent.xyz" ||
			domain === "nitter.x86-64-unknown-linux-gnu.zip" ||
			domain === "nitter.private.coffee" ||
			domain === "nitter.oksocial.net" ||
			domain === "nitter.services.woodland.cafe" ||
			domain === "nitter.dafriser.be" ||
			domain === "nitter.catsarch.com" ||
			//domain === "nitter.13ad.de" ||
			//domain === "tw.openalgeria.org" ||
			domain === "nitter.42l.fr" ||
			domain === "nitter.pussthecat.org" ||
			//domain === "nitter.mastodont.cat" ||
			domain === "nitter.tedomum.net" ||
			domain === "nitter-home.kavin.rocks" ||
			domain === "nitter.cc" ||
			domain === "nitter.vxempire.xyz" ||
			domain === "nitter.eu" ||
			domain === "nitter.ethibox.fr" ||
			domain === "nitter.namazso.eu" ||
			domain === "nitter.mailstation.de" ||
			domain === "nitter.actionsack.com" ||
			domain === "nitter.cattube.org" ||
			domain === "nitter.40two.app" ||
			domain === "nitter.skrep.in" ||
			domain === "nitter.hu" ||
			domain === "nitter.database.red" ||
			domain === "nitter.exonip.de" ||
			domain === "twitr.gq" ||
			domain === "nitter.koyu.space" ||
			domain === "nitter.dark.fail" ||
			//domain === "t.maisputain.ovh" ||
			//domain === "nitter.weaponizedhumiliation.com" ||
			domain === "nitter.snopyta.org";
	};
	common_functions["multidomain__teddit"] = function(domain, domain_nowww) {
		return domain_nowww === "teddit.net" ||
			domain === "teddit.froth.zone" ||
			domain === "teddit.zaggy.nl" ||
			domain === "teddit.pussthecat.org" ||
			domain === "teddit.sethforprivacy.com" ||
			domain === "teddit.totaldarkness.net" ||
			domain === "teddit.adminforge.de" ||
			domain === "teddit.bus-hit.me" ||
			domain === "rdt.trom.tf" ||
			domain === "i.opnxng.com" ||
			domain === "teddit.garudalinux.org" ||
			domain === "tedd.it" ||
			domain === "teddit.privacytools.io" ||
			domain === "td.vern.cc" ||
			domain === "teddit.rawbit.ninja" ||
			domain === "teddit.artemislena.eu" ||
			domain === "teddit.manasiwibi.com" ||
			domain === "teddit.hostux.net" ||
			domain === "reddit.lurkmore.com";
	};
	common_functions["multidomain__xhamster"] = function(domain_nosub) {
		// trustURLs in initials object
		return domain_nosub === "xhamster.com" || // 1-45?, 500
			domain_nosub === "xhamster.one" ||
			domain_nosub === "xhamster.desi" || // 1-5, 7
			//domain_nosub === "xhamsterpremium.com" ||
			domain_nosub === "openxh.com" ||
			domain_nosub === "openxh1.com" ||
			domain_nosub === "openxh2.com" ||
			domain_nosub === "xhopen.com" ||
			domain_nosub === "xhlocal.com" ||
			domain_nosub === "unlockxh.com" || // 1-5
			domain_nosub === "fullxh.com" ||
			domain_nosub === "xhtotal.com" ||
			domain_nosub === "localxh.com" || // 1-5
			// 1-4
			domain_nosub === "xhofficial.com";
	};
	// this requires removing everything before the thumbor url with /
	common_functions["get_thumbor_url"] = function(src) {
		// /S4Fr7rEpLL-QZnU3bsNT5ORJzYQ=/364x130/https%3A%2F%2Fblueprint-api-production.s3.amazonaws.com%2Fuploads%2Fstory%2Fthumbnail%2F73835%2Fd72a8d3f-baf0-4132-b6f9-358d27d1c0c9.JPG
		//   https%3A%2F%2Fblueprint-api-production.s3.amazonaws.com%2Fuploads%2Fstory%2Fthumbnail%2F73835%2Fd72a8d3f-baf0-4132-b6f9-358d27d1c0c9.JPG
		// /tREpzmUU7LJX1cbkAN-unm7wL0Y=/fit-in/800x600/top/filters:fill(black)/arc-anglerfish-arc2-prod-tronc.s3.amazonaws.com/public/XC6HBG2I4VHTJGGCOYVPLBGVSM.jpg
		//   arc-anglerfish-arc2-prod-tronc.s3.amazonaws.com/public/XC6HBG2I4VHTJGGCOYVPLBGVSM.jpg
		// /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
		//   2015/03/30/647/n/1922564/ccc1eafd_edit_img_cover_file_864129_1397566805/i/Emma-Watson-Best-Red-Carpet-Looks.png
		// /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
		//   2020/01/16/687/n/1922564/4606d55d5e20819816a430.09594567_/i/selena-gomez-style-for-new-album-release-2020.jpg
		// https://images.macrumors.com/t/H0ZN9uTQCAlcNAvgJLkUkfNyHDI=/112x112/smart/article-new/2021/05/Top-Stories-59-Feature.jpg
		//   article-new/2021/05/Top-Stories-59-Feature.jpg
		// https://images.vs-static.com/yfr09nm8pH3P694LHLLivqhMRDg=/0x314:2999x2001/1900x0/Getty_Images_1330811041_046fcd0f40/Getty_Images_1330811041_046fcd0f40.jpg
		src = src
			.replace(/^\/*/, "/")
			.replace(/^\/[-_0-9a-zA-Z]{20,}=?\/+/, "/")
			.replace(/^\/(?:[0-9]+|orig)x(?:[0-9]+|orig)(?::[0-9]+x[0-9]+)?\/+/, "/")
			.replace(/^\/fit-in\/+(?:[0-9]+|orig)x(?:[0-9]+|orig)\/+(?:top\/+)?/, "/")
			.replace(/^\/filters:[^/]+\/+/, "/")
			.replace(/^\/smart\/+/, "/")
			.replace(/^\/(?:[0-9]+|orig)x(?:[0-9]+|orig)(?::[0-9]+x[0-9]+)?\/+/, "/")
			.replace(/^\/*/, "");
		return src;
	};
	// currently type is ignored as only ReleaseAllImages has been discovered
	common_functions["query_discogs_images_api"] = function(options, type, discogsid, cb) {
		var vars = encodeURIComponent("{\"discogsId\":" + discogsid + ",\"count\":500}");
		// magic
		var extensions = "%7B%22persistedQuery%22%3A%7B%22version%22%3A1%2C%22sha256Hash%22%3A%2213e41f41a02b02d0a7e855a71e1a02478fd2fb0a2d104b54931d649e1d7c6ecd%22%7D%7D";
		real_api_query(options.api_cache, options.do_request, "discogs_images:" + discogsid, {
			url: " https://release-page.discogs.com/api/graphql?operationName=ReleaseAllImages&variables=" + vars + "&extensions=" + extensions,
			imu_mode: "xhr",
			headers: {
				origin: "https://www.discogs.com",
				referer: "https://www.discogs.com/",
				"content-type": "application/json",
				accept: "*/*"
			},
			json: true
		}, cb, function(done, resp, cache_key) {
			var images = resp.data.release.images.edges;
			var out_images = [];
			array_foreach(images, function(image) {
				var node = image.node;
				// webpUrl seems to be better quality than sourceUrl?
				// https://img.discogs.com/Amgne6j0gBvX12BXuwyyx1U6afU=/fit-in/600x600/filters:strip_icc():format(webp):mode_rgb():quality(90)/discogs-images/R-6114127-1413723322-8982.jpeg.jpg
				// https://img.discogs.com/_4HU0V6fRalpgDVx08VPdQl7ZMk=/fit-in/600x600/filters:strip_icc():format(jpeg):mode_rgb():quality(90)/discogs-images/R-6114127-1413723322-8982.jpeg.jpg
				out_images.push(node.fullsize.webpUrl);
			});
			done(out_images, 6 * 60 * 60);
		});
	};
	common_functions["query_discogs_images_web"] = function(options, type, discogsid, cb) {
		real_api_query(options.api_cache, options.do_request, "discogs_images:" + type + ":" + discogsid, {
			url: "https://www.discogs.com/" + type + "/" + discogsid + "/images",
			imu_mode: "document"
		}, cb, function(done, resp, cache_key) {
			var matches = match_all(resp.responseText, /<span class="thumbnail_link">.*?<img src="(https?:\/\/img\.discogs\.com\/[^"]+)"/);
			if (!matches || !matches.length) {
				console_error(cache_key, "Unable to find matches from", resp);
				return done(null, false);
			}
			var images = [];
			array_foreach(matches, function(match) {
				images.push(decode_entities(match[1]));
			});
			done(images, 6 * 60 * 60);
		});
	};
	common_functions["query_discogs_images"] = function(options, type, discogsid, cb) {
		if (type === "release") {
			return common_functions["query_discogs_images_api"](options, type, discogsid, cb);
		} else {
			return common_functions["query_discogs_images_web"](options, type, discogsid, cb);
		}
	};
	common_functions["do_flickr_request"] = function(options, url, cb) {
		var headers = {
			"Origin": "https://www.flickr.com",
			"Referer": "https://www.flickr.com/",
			"Sec-Fetch-Site": "same-site",
			// why?
			"Cookie": ""
		};
		return options.do_request({
			url: url,
			method: "GET",
			headers: headers,
			onload: cb
		});
	};
	common_functions["flickr_find_api_info"] = function(options, api_cache, cb) {
		api_cache.fetch("flickr_api_info", cb, function(done) {
			common_functions["do_flickr_request"](options, "https://www.flickr.com/", function(resp) {
				var regex = /root\.YUI_config\.flickr\.api\.site_key\s*=\s*['"]([0-9a-f]+)['"]\s*;/;
				var matchobj = resp.responseText.match(regex);
				if (!matchobj) {
					console_error("Unable to find Flickr API key");
					return done(null, false);
				}
				var key = matchobj[1];
				if (!key || typeof key !== "string") {
					console_error("Unable to find Flickr API key");
					return done(null, false);
				}
				regex = /root\.auth\s*=\s*({.*?});/;
				matchobj = resp.responseText.match(regex);
				var auth = {};
				if (!matchobj) {
					console_error("Unable to find Flickr auth info");
				} else {
					try {
						auth = JSON_parse(matchobj[1]);
					} catch (e) {
						auth = {};
						console_error("Unable to find Flickr auth info");
					}
				}
				var reqid = "";
				matchobj = resp.responseText.match(/root\.reqId\s*=\s*["']([0-9a-f]+)["']\s*;/);
				if (matchobj) {
					reqid = matchobj[1];
				}
				if ("user" in auth && "nsid" in auth.user) {
					auth.nsid = auth.user.nsid;
				}
				var info = {
					key: key,
					nsid: auth.nsid,
					csrf: auth.csrf,
					reqId: reqid
				};
				done(info, 60 * 60);
			});
		});
	};
	common_functions["flickr_api_request"] = function(options, info, params, cb) {
		var url = "https://api.flickr.com/services/rest?csrf=";
		if (info.csrf) {
			url += info.csrf;
		}
		url += "&api_key=" + info.key + "&format=json&hermes=1&hermesClient=1";
		if (info.nsid) {
			url += "&viewerNSID=" + info.nsid;
		} else {
			url += "&viewerNSID=";
		}
		if (info.reqId) {
			url += "&reqId=" + info.reqId;
		}
		url += "&format=json&nojsoncallback=1&" + params;
		common_functions["do_flickr_request"](options, url, function(resp) {
			try {
				var json = JSON_parse(resp.responseText);
				if (json.stat === "fail") {
					console_error(json.message);
					return cb(null);
				}
			} catch (e) {
				console_error(e);
				return cb(null);
			}
			cb(json);
		});
	};
	common_functions["flickr_info_to_obj"] = function(info) {
		var getstr = function(prop) {
			if (!prop || typeof prop === "string")
				return prop;
			return prop._content;
		};
		var extra = {
			caption: getstr(info.title) || getstr(info.description)
		};
		var obj = {
			extra: extra
		};
		var pathalias;
		if (info.owner) {
			pathalias = getstr(info.owner.nsid);
		} else {
			pathalias = getstr(info.pathalias);
		}
		var photo_id = getstr(info.id);
		if (pathalias && photo_id)
			extra.page = "https://www.flickr.com/photos/" + pathalias + "/" + photo_id;
		var largest = 0;
		var largest_url = null;
		for (var widthkey in info) {
			var match = widthkey.match(/^width_([0-9a-z]+)$/);
			if (!match)
				continue;
			var key = match[1];
			var urlkey = "url_" + key;
			var heightkey = "height_" + key;
			if (!(urlkey in info) || !(heightkey in info))
				continue;
			var our_size = info[widthkey] * info[heightkey];
			if (our_size > largest) {
				largest = our_size;
				largest_url = info[urlkey];
			}
		}
		if (largest_url)
			obj.url = largest_url;
		return obj;
	};
	common_functions["get_redirect_url"] = function(api_cache, options, url, cb) {
		var reqobj = url;
		if (typeof url === "string") {
			reqobj = {
				url: url
			};
		}
		url = reqobj.url;
		real_api_query(api_cache, options.do_request, "redirect:" + url, reqobj, cb, function(done, resp, cache_key) {
			if (!resp.finalUrl)
				return done(null, false);
			return done(resp.finalUrl, 60 * 60);
		});
	};
	var match_single_file_signature = function(data, signature) {
		if (typeof signature === "string") {
			var newsig = [];
			for (var i = 0; i < signature.length; i++) {
				newsig.push(signature.charCodeAt(i));
			}
			signature = newsig;
		}
		if (data.length < signature.length)
			return false;
		for (var i = 0; i < signature.length; i++) {
			if (signature[i] === null)
				continue;
			if (data[i] !== signature[i]) {
				return false;
			}
		}
		return true;
	};
	var match_file_signature = function(data) {
		// https://en.wikipedia.org/wiki/List_of_file_signatures
		var signatures = {
			mp4: [
				[null, null, null, null, 0x66, 0x74, 0x79, 0x70, 0x69, 0x73, 0x6F, 0x6D],
				[null, null, null, null, 0x66, 0x74, 0x79, 0x70, 0x4D, 0x53, 0x4E, 0x56]
			],
			jpg: [
				[0xFF, 0xD8, 0xFF]
				/*[ 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01 ],
				[ 0xFF, 0xD8, 0xFF, 0xEE ],
				[ 0xFF, 0xD8, 0xFF, 0xE1, null, null, 0x45, 0x78, 0x69, 0x66, 0x00, 0x00 ],
				[ 0xFF, 0xD8, 0xFF, 0xE0 ]*/
			],
			gif: ["GIF87a", "GIF89a"],
			png: [
				[0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A]
			],
			webm: [
				[0x1A, 0x45, 0xDF, 0xA3]
			],
			webp: [
				[0x52, 0x49, 0x46, 0x46, null, null, null, null, 0x57, 0x45, 0x42, 0x50]
			]
		};
		for (var key in signatures) {
			for (var _i = 0, _a = signatures[key]; _i < _a.length; _i++) {
				var sig = _a[_i];
				if (match_single_file_signature(data, sig))
					return key;
			}
		}
		return null;
	};
	common_functions["get_file_signature"] = function(api_cache, options, url, cb) {
		var reqobj = url;
		if (typeof url === "string") {
			reqobj = {
				url: url
			};
		}
		url = reqobj.url;
		var cache_key = "file_signature:" + url;
		api_cache.fetch(cache_key, cb, function(done) {
			var handled = false;
			var onload_cb = function(resp) {
				if (handled || !resp.response)
					return;
				handled = true;
				req.abort();
				var signature;
				try {
					var view = new Uint8Array(resp.response);
					signature = match_file_signature(view);
				} catch (e) {
					console_error(cache_key, e);
					return done(null, false);
				}
				done(signature, 60 * 60);
			};
			reqobj.responseType = "arraybuffer";
			reqobj.onload = onload_cb;
			reqobj.onabort = onload_cb;
			reqobj.onprogress = function(resp) {
				if (resp.lengthComputable && resp.responseHeaders && resp.readyState >= 2 && resp.loaded >= 10) {
					onload_cb(resp);
				}
			};
			var req = options.do_request(reqobj);
		});
	};
	var get_domain_from_url = function(url) {
		return url.replace(/^[a-z]+:\/\/([^/]*)(?:\/+.*)?$/, "$1");
	};
	var get_origin_from_url = get_domain_from_url;
	var get_domain_nosub = function(domain) {
		var domain_nosub = domain.replace(/^.*\.([^.]*\.[^.]*)$/, "$1");
		// stream.ne.jp
		// *.edu.tr
		if (/^(?:(?:com?|org|net|edu)\.[a-z]{2}|(?:ne|or)\.jp)$/.test(domain_nosub)) {
			domain_nosub = domain.replace(/^.*\.([^.]*\.[^.]*\.[^.]*)$/, "$1");
		}
		return domain_nosub;
	};
	var looks_like_valid_link = function(src, el) {
		if (/\.(?:jpe?g|png|web[mp]|gif|mp4|mkv|og[gv]|svg)(?:[?#].*)?$/i.test(src))
			return true;
		if (el && check_highlightimgs_supported_image(el))
			return true;
		return false;
	};
	function bigimage(src, options) {
		// for element_ok with elements without sources (src == null)
		// function too large for analysis
		// @ts-expect-error
		if (!src) {
			src = "data:";
			//return src;
		}
		if (!src.match(/^(?:https?|x-raw-image):\/\//) && !src.match(/^(?:data|blob):/))
			return src;
		var origsrc = src;
		src = norm_url(src);
		var protocol;
		var domain;
		var port;
		if (!src.match(/^(?:data|x-raw-image|blob):/)) {
			// 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 (string_indexof(domain, ".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 (string_indexof(domain, ".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 digitalocean_container = null;
		if (domain_nosub === "digitaloceanspaces.com") {
			// https://sfo2.digitaloceanspaces.com/btrtoday/uploads/20190611114017/ft.Cyberpunk2077.jpg
			// https://btrtoday.sfo2.digitaloceanspaces.com/uploads/20190611114017/ft.Cyberpunk2077.jpg
			// https://movieassetsdigital.sgp1.cdn.digitaloceanspaces.com/thumb/ca584e585152f32d7eeb9fb1837732ea5566d431
			if (/^[a-z]{3}[0-9]+\.(?:cdn\.)?digitaloceanspaces\./.test(domain)) {
				digitalocean_container = src.replace(/^[a-z]*:\/\/[^/]*\/+([^/]*)\/.*/, "$1");
			} else {
				digitalocean_container = domain.replace(/^([^/.]+)\..*/, "$1");
			}
		}
		var host_domain = "";
		var host_domain_nowww = "";
		var host_domain_nosub = "";
		if (options.host_url) {
			host_domain = options.host_url.replace(/^[a-z]+:\/\/([^/]*?)(?::[0-9]+)?(?:\/.*)?$/, "$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");
			}
		}
		try {
			if (options.document)
				document = options.document;
			if (options.window)
				window = options.window;
		} catch (e) {
			//console_warn("Failed to set document/window", e);
		}
		var problem_excluded = function(problem) {
			if (!options.exclude_problems)
				return false;
			if (typeof options.exclude_problems === "string" && options.exclude_problems === problem)
				return true;
			if (!is_array(options.exclude_problems))
				return false;
			return array_indexof(options.exclude_problems, problem) >= 0;
		};
		var api_cache = real_api_cache;
		if (options.use_api_cache === false) {
			api_cache = new IMUCache();
		}
		if (!options.api_cache) {
			options.api_cache = api_cache;
		}
		var api_query = function(key, request, cb, process) {
			return real_api_query(api_cache, options.do_request, key, request, cb, process);
		};
		var website_query = function(_options) {
			_options.do_request = options.do_request;
			_options.api_cache = api_cache;
			if (!_options.cb)
				_options.cb = options.cb;
			if (!_options.url)
				_options.url = src;
			return real_website_query(_options);
		};
		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 (string_indexof(src, "/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 && string_indexof(str, "://") < 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 && string_indexof(urlparts, "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 ((host_domain_nowww === "google.com" ||
			domain_nowww === "google.com") && /^[a-z]+:\/\/[^/]+\/+recaptcha\//.test(options.host_url)) {
			return {
				url: origsrc,
				bad: "mask"
			};
		}
		if (host_domain === "assets.hcaptcha.com" || domain === "assets.hcaptcha.com" || domain === "imgs.hcaptcha.com") {
			return {
				url: origsrc,
				bad: "mask"
			};
		}
		if (domain === "img.hankyung.com" ||
			domain === "img.tenasia.hankyung.com") {
			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 (string_indexof(domain, "gfmarket.") >= 0) {
				return src;
			}
			if (/\/img\.tvcast\/+pc\/+img\/+/.test(src) ||
				/\/static\/+m\/+vlive\/+pc\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}profile_noimg_[a-z]+\./.test(src) ||
				/\/static\.post\/+image\/+im\/+/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			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(/"$/, '');
			}
			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;
			}
			newsrc = src
				.replace(/postfiles[^/.]*\./, "blogfiles.")
				.replace(/m?blogthumb[^./]*/, "blogfiles")
				.replace(/blogfiles[^/.]*\./, "blogfiles.")
				.replace(/postfiles[^/.]*\./, "blogfiles.")
				.replace(/cafeptthumb[^./]*/, "cafefiles")
				.replace(/cafeskthumb[^./]*/, "cafefiles")
				.replace(/m?cafethumb[^./]*/, "cafefiles")
				.replace(/cafefiles[^/.]*\./, "cafefiles.")
				.replace(/mimgnews[^./]*/, "imgnews")
				.replace(/v\.phinf\./, "v-phinf.")
				.replace(/musicmeta\.phinf\./, "musicmeta-phinf.")
				.replace(/shopping\.phinf\./, "shopping-phinf.")
				.replace(/blogpfthumb\.phinf\./, "blogpfthumb-phinf.")
				.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
				},
				head_wrong_contenttype: true // no content-type
			};
		}
		if ((domain_nosub === "daumcdn.net" ||
			domain_nosub === "kakaocdn.net") &&
			string_indexof(src, "/thumb/") >= 0) {
			return decodeURIComponent(src.replace(/.*fname=([^&]*).*/, "$1"));
		}
		if (domain_nosub === "daumcdn.net" && /^(?:t|img)[0-9]*\./.test(domain)) {
			if (/\/cafe_image\/+fancafe\/+[0-9]+\/+fancafe-cheer-color-bg\./.test(src) ||
				/\/tistory_admin\/+lib\/+lightbox\//.test(src) ||
				/\/kakaotv\/+[0-9]+\/+(?:pw|player\/+web)\/+(?:(?:new|pc)\/+)?(?:slider_mask|bg_box|img_back(?:logo|cover))/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if ((domain_nosub === "tistory.com" ||
			domain_nosub === "daum.net") &&
			(domain.match(/\.uf\.[a-z]+\.[a-z]+$/) ||
				domain.match(/^cfs[0-9]*\./))) {
			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/)) {
			return src.replace(/(\/cfile\/(?:tistory\/)?[0-9A-F]+)(?:\\?.*)$/, "$1?original");
		}
		if (domain_nosub === "daumcdn.net" &&
			domain.match(/^i[0-9]*\.media\./)) {
			return src.replace(/\/uf\/image\//, "/uf/original/");
		}
		if (domain_nosub === "daumcdn.net" &&
			domain.match(/^[mi][0-9]*\.daumcdn\.net/)) {
			return src.replace(/:\/\/[^/]*\/(cfile[0-9]+)\//, "://$1.uf.daum.net/");
		}
		if (domain_nosub === "daumcdn.net" && /^i[0-9]*\.tvpot\./.test(domain)) {
			return src.replace(/(\/thumb\.[a-z0-9]+)\.mini(?:[?#].*)?$/, "$1");
		}
		if (domain === "image.news1.kr" ||
			domain === "i2n.news1.kr") {
			newsrc = src.replace(/\/+dims\/.*/, "");
			if (newsrc !== src)
				return newsrc;
			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
					},
					can_head: false // hangs, thanks to f2005 on discord for reporting
				};
			}
			return newsrc;
		}
		if (string_indexof(domain, ".joins.com") >= 0) {
			newsrc = src.replace(/\.tn_[0-9]*\..*/, "");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "ir.joins.com" ||
			domain === "loki.zhibotie.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/.*?[?&]u=([^&]*).*$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nosub === "koreadaily.com" &&
			domain.match(/^thumb[0-9]*\./)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/tn\.dll.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain === "uhd.img.topstarnews.net") {
			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" ||
			domain === "cds.topstarnews.net") {
			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") {
			newsrc = src.replace(/\/+dims\/.*/, "");
			if (newsrc !== src)
				return newsrc;
			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;
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+star_realdisp\.php\?(?:.*&)?ImageID=([0-9]+_[0-9]+\.[a-z]+)(?:[&#].*)?$/,
				run: function(cb, match) {
					var url = match[1];
					var urlmatch = url.match(/^([0-9]{4})([0-9]{2})/);
					cb("https://thumb.mtstarnews.com/06/" + urlmatch[1] + "/" + urlmatch[2] + "/" + url);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "menu.mt.co.kr" ||
			domain === "img.koreatimes.co.kr" ||
			domain_nosub === "myskcdn.com") {
			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);
				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 === "tkfile.yes24.com") return src.replace(/(\/upload2\/.*?)\/dims\/+.*/, "$1");
		if (domain === "cdn.music-flo.com") return src.replace(/(\/image\/.*?)(?:[?#].*)?$/, "$1");
		if (domain === "static.discovery-expedition.com") return src.replace(/(\/images\/.*)\/dims\/.*/, "$1");
		if (domain === "image.genie.co.kr") {
			return src.replace(/(\/image\/.*)\/dims\/.*/i, "$1");
		}
		if (domain === "img.enews24.cjenm.skcdn.com") {
			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" ||
			domain_nosub === "liveen.co.kr" ||
			domain_nosub === "ilyoseoul.co.kr" ||
			domain_nosub === "sportsq.co.kr" ||
			domain_nosub === "zenithnews.com" ||
			domain_nowww === "munhwanews.com" ||
			domain_nowww === "mhns.co.kr" ||
			domain_nowww === "ccdailynews.com" ||
			domain === "ph.kyeonggi.com" ||
			domain_nowww === "jemin.com" ||
			domain_nowww === "domin.co.kr" ||
			domain === "cdn.jejudomin.co.kr" ||
			domain === "ph.incheonilbo.com" ||
			domain_nowww === "hidomin.com" ||
			domain_nowww === "newsfreezone.co.kr" ||
			domain === "cdn.newsfreezone.co.kr" ||
			domain_nowww === "newsinside.kr" ||
			domain === "cdn.newsinside.kr" ||
			domain_nowww === "greenpostkorea.co.kr" ||
			domain_nowww === "egn.kr" ||
			domain_nowww === "whitepaper.co.kr" ||
			domain_nowww === "outdoornews.co.kr" ||
			domain_nowww === "shinailbo.co.kr" ||
			domain_nowww === "ngtv.tv" ||
			domain_nowww === "rnx.kr" ||
			domain_nowww === "intronews.net" ||
			domain_nowww === "hg-times.com" ||
			domain_nowww === "iemn.kr" ||
			domain_nosub === "newscj.com" ||
			domain_nowww === "ggilbo.com" ||
			domain_nowww === "bstoday.kr" ||
			domain === "interfootball.heraldcorp.com" ||
			domain_nowww === "ilyosisa.co.kr" ||
			domain_nowww === "ynnews.kr" ||
			domain_nowww === "starilbo.com" ||
			domain_nowww === "autoherald.co.kr" ||
			domain_nowww === "00news.co.kr" ||
			domain_nowww === "kstarfashion.com" ||
			domain_nowww === "inewspeople.co.kr" ||
			domain_nowww === "wonnews.co.kr" ||
			domain_nosub === "gukjenews.com" ||
			domain_nowww === "lunarglobalstar.com" ||
			domain_nowww === "sundayjournal.kr" ||
			domain_nowww === "stnsports.co.kr" ||
			domain_nowww === "thekpm.com" ||
			domain === "chunchu.yonsei.ac.kr" ||
			domain_nowww === "e2news.com" ||
			domain === "ph.spotvnews.co.kr" ||
			domain_nowww === "sisunnews.co.kr" ||
			domain_nowww === "kpinews.co.kr" ||
			domain_nowww === "4th.kr" ||
			domain === "cds.topdaily.kr" ||
			domain_nowww === "kntimes.co.kr" ||
			domain_nowww === "senmedia.kr" ||
			domain_nowww === "siminilbo.co.kr" ||
			domain_nowww === "sisafocus.co.kr" ||
			domain_nowww === "futurekorea.co.kr" ||
			domain_nowww === "dailygrid.net" ||
			domain_nowww === "datanet.co.kr" ||
			domain_nowww === "slist.kr" ||
			domain_nowww === "secondmirror.co.kr" ||
			domain_nowww === "ntoday.co.kr" ||
			domain_nowww === "seoulilbo.com" ||
			domain_nowww === "lecturernews.com" ||
			domain_nowww === "youthdaily.co.kr" ||
			domain_nowww === "mdaily.net" ||
			domain_nowww === "cctoday.co.kr" ||
			domain_nowww === "gnmaeil.com" ||
			domain_nosub === "mhnew.com" ||
			domain_nowww === "mediadale.com" ||
			domain === "viewers.heraldcorp.com" ||
			domain_nowww === "biztribune.co.kr" ||
			domain_nowww === "obsnews.co.kr" ||
			domain_nowww === "kyeonggi.com" ||
			domain_nowww === "iloveorganic.co.kr" ||
			domain_nowww === "newslock.co.kr" ||
			domain_nowww === "news33.net" ||
			domain_nowww === "mainnews.kr" ||
			domain_nowww === "ilemonde.com" ||
			domain_nowww === "canews.kr" ||
			domain_nowww === "newsflix.co.kr" ||
			domain_nowww === "gokorea.kr" ||
			domain_nowww === "womaneconomy.kr" ||
			domain_nowww === "apsk.co.kr" ||
			domain_nowww === "sporbiz.co.kr" ||
			domain_nowww === "lovesbeauty.co.kr" ||
			domain_nowww === "ikoreadaily.co.kr" ||
			domain_nowww === "interview365.com" ||
			domain_nowww === "newsa.co.kr" ||
			domain_nowww === "newstown.co.kr" ||
			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);
		}
		if (domain === "shop.newsen.com") 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") {
			newsrc = src.replace(/_ts\.[^/._]*$/, ".jpg").replace("/mphoto/", "/news_photo/");
			if (newsrc !== src)
				return newsrc;
			if (string_indexof(src, "/main_photo/") >= 0) {
				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;
			}
			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];
			}
			obj = {
				url: src,
				headers: {
					Referer: "http://www.newsen.com/"
				},
				referer_ok: {
					same_domain_nosub: true
				},
				extra: extra
			};
			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) {
									console_warn("Newsen title not found", result);
									return done(null, false);
								}
								var title = strip_whitespace(match[1]);
								console_log("Title: ", title);
								match = result.responseText.match(/<img\s+id=["']artImg["']\s+src=["'](?:https?:)?\/\/[a-z]+\.newsen\.com\/.*?["']/g);
								if (!match) {
									console_warn("Newsen images not found", result);
									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);
								}
								var entry_regex = /<a\s+class=["']info_item["']\s+href=["']((?:https?:)\/\/v\.media\.daum\.net\/+.*?)["'][^>]*?>\s*<strong\s+class=["']tit-g[^'"]*["']\s*>\s*([\s\S]*?)\s*<\/strong>/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 for", 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")),
										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;
					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") return src.replace(/\/([0-9]*_)(?:scr_)?([^._/]*)(?:_t)?(\.[^/.]*)$/, "/$1$2$3");
		if (domain_nosub === "chosun.com" ||
			domain_nowww === "the-star.co.kr" ||
			domain === "digitalchosun.dizzo.com" ||
			domain_nosub === "chosunonline.com") {
			newsrc = src
				.replace("/simg_thumb/", "/simg_org/")
				.replace(/\/thumb_dir\/(.*)_thumb(\.[^/.]*)$/, "/img_dir/$1$2")
				.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")
					}
				};
			}
		}
		if (domain === "photo.hankooki.com") {
			newsrc = src.replace("/arch/photo/", "/arch/original/")
				.replace("/arch/thumbs/", "/arch/original/")
				.replace(/(\/newsphoto\/[^/]*\/)thumbs\//, "$1");
			if (newsrc !== src) {
				return newsrc.replace(/(.*\/)t_?([^/]*)$/, "$1$2");
			} else {
				return src;
			}
		}
		if (domain === "thumb.hankooki.com") return src.replace(/:\/\/[^/]*\/+(.*\/+)[0-9]+x[0-9]+x[^/]*@([^/]*)(?:[?#].*)?$/, "://photo.hankooki.com/$1$2");
		if (domain_nosub === "ettoday.net") {
			return {
				url: src
					.replace(/\/[a-z]+([0-9]*\.[^/]*)(?:[?#].*)?$/, "/$1")
					.replace(/:\/\/cdn[0-9]*\./, "://static."),
				head_wrong_contenttype: true
			};
		}
		if (domain === "img.mbn.co.kr") return src.replace(/_s[0-9]+x[0-9]+(\.[^/]*)$/, "$1");
		if (domain === "imgmmw.mbn.co.kr") 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") 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)) ||
			(domain_nosub === "iwinv.net" && /^inews24\.(?:ext[0-9]+\.)?cache\./.test(domain))) {
			return src
				.replace(/(:\/\/[^/]+\/)(?:face\/+)?(?:[0-9]+dpi\/+){0,}(?:[0-9]*x[0-9]*\/+){0,}image_joy\//, "$1image_joy/")
				.replace(/\/image_joy\/+thumbnail\//, "/image_joy/");
		}
		if (domain_nosub === "wowkorea.jp" &&
			(string_indexof(src, ".wowkorea.jp/img") >= 0 ||
				string_indexof(src, ".wowkorea.jp/upload") >= 0)) {
			newsrc = src.replace(/(\/upload\/+photoSpecial\/+[0-9]+\/+)re_([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			if (string_indexof(src, "/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/)) {
			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;
		}
		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" ||
			domain_nowww === "stephenking.com" ||
			domain === "forums.audioholics.com" ||
			domain_nowww === "ambercutie.com" ||
			domain_nowww === "overlandbound.com" ||
			string_indexof(domain, "forum.purseblog.com") >= 0) &&
			string_indexof(src, "/proxy.php?") >= 0) {
			newsrc = src.replace(/.*image=([^&]*).*/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "images.askmen.com") {
			return {
				url: src,
				head_wrong_contentlength: true
			};
		}
		if ((domain_nosub === "127.net" && string_indexof(domain, "nosdn.127.net") >= 0) ||
			(domain_nosub === "lf127.net" && /^imglf[0-9]+\./.test(domain)) ||
			domain === "pic-bucket.ws.126.net") { //lofter
			return src.replace(/\?.*$/, "");
		}
		if (domain === "board.makeshop.co.kr") return src.replace(/\/[a-z]*::/, "/");
		if (domain_nosub === "naver.jp" &&
			domain.match(/^rr\.img[0-9]*\.naver\./)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/mig.*?[?&]src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain === "imgcc.naver.jp") {
			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") {
			return src
				.replace(/\/[ca]\/(?:[0-9]+\/){4}/, "/")
				.replace(/\/i\/[0-9]+\/[0-9]+\/[0-9]+\//, "/");
		}
		if (domain === "imgpark.donga.com" && string_indexof(src, "/fileUpload/") >= 0) {
			return {
				url: src,
				headers: {
					Referer: "http://mlbpark.donga.com/"
				}
			};
		}
		if ((domain_nosub === "marishe.com" &&
			domain.match(/s[0-9]\.marishe\.com/)) ||
			(domain_nowww === "klik.gr" && string_indexof(src, "/uploads_image/") >= 0) ||
			(domain_nowww === "ug-ts.ru" && /\/content\/+pics\//.test(src)) ||
			(domain_nowww === "eroticasearch.net" && string_indexof(src, "/content/pics/") >= 0) ||
			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
			};
		}
		if (domain === "cdn.hk01.com") {
			newsrc = src.replace(/\?.*/, "");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/media\/+images\/+[0-9]+\/+)[^/]+\//, "$1org/");
		}
		if (domain_nosub === "sinaimg.cn") {
			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\./)) {
				newsrc = src.replace(/(\/ent\/+[0-9]+_)img(\/+upload\/)/, "$1ori$2");
				if (newsrc !== src)
					return newsrc;
			}
			newsrc = src.replace(/(\/autoimg\/+serial\/+[0-9]{2}\/+[0-9]{2}\/+[0-9]+)_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1_src$2");
			if (newsrc !== src)
				return newsrc;
			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/)) {
			return src.replace(/:\/\/static([0-9]*)\.photo\.sina\.com\.cn\//, "://ss$1.sinaimg.cn/");
		}
		if (domain === "sinaimg.acgsoso.com") return src.replace(/:\/\/[^/]+\/+/, "://wx4.sinaimg.cn/");
		if (domain === "thumbnail.egloos.net" ||
			domain === "thumb.egloos.net") {
			return src.replace(/^[a-z]+:\/\/thumb(?:nail)?\.egloos\.net\/[^/]*\/*/, "");
		}
		if (domain === "k.kakaocdn.net") return src.replace(/\/img_[a-z]*\.([^./]*)$/, "/img.$1");
		if (domain === "images.sportskhan.net" ||
			domain === "images.khan.co.kr" ||
			domain === "img.khan.co.kr") {
			newsrc = src
				.replace(/\/r\/[0-9]+x[0-9]+\//, "/")
				.replace(/\/[a-z]*_([0-9]+\.[a-z0-9A-Z]*)$/, "/$1")
				.replace(/\/c\/[0-9]*x[0-9]*\//, "/")
				.replace(/(\/news\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/[0-9]{8}\.[0-9]+\.[0-9]+)[A-Z](\.[^/.]*)$/, "$1L$2")
				.replace(/(\/news-p\.v[0-9]+\.[0-9]{8}\.[0-9a-f]{20,})_[A-Z][0-9]+(\.[^/.]*)$/, "$1$2")
				.replace(/\/photodb\//, "/PhotoDB/");
			return {
				url: newsrc,
				head_wrong_contentlength: true
			};
		}
		if (domain_nosub === "sbs.co.kr" &&
			domain.match(/^img[0-9]*\.sbs\.co\.kr/)) {
			newsrc = src.replace(/(\/[0-9]+)_[0-9v]+\.([a-z0-9A-Z]*)$/, "$1.$2");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/[^_]*)_[^/.]*(\.[^/.]*)$/, "$1_ori$2");
		}
		if (domain === "image.board.sbs.co.kr") return src.replace(/-[0-9]+(\.[^/.]*)$/, "$1");
		if (domain === "photocloud.sbs.co.kr") return src.replace(/(:\/\/[^/]+\/+)([^/]+\/+)thumb\/+([0-9a-f]{10,})-(?:[0-9]+|c[0-9]+x[0-9]+)\./, "$1origin/edit/$2$3-p.");
		if (domain === "board.sbs.co.kr") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+popup\/+pc\/+imageView\?(?:.*&)?imageUrl=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nosub === "edaily.co.kr" &&
			string_indexof(domain, "image.edaily.co.kr") >= 0 ||
			string_indexof(domain, "img.edaily.co.kr") >= 0) {
			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");
		}
		if (domain === "media.glamour.com" ||
			domain === "assets.teenvogue.com" ||
			domain === "assets.vogue.com" ||
			domain === "media.vanityfair.com" ||
			domain === "media.gq.com" ||
			domain === "media.wmagazine.com" ||
			domain === "media.self.com" ||
			domain === "media.pitchfork.com" ||
			domain === "media.wired.com" ||
			domain === "media.golfdigest.com" ||
			domain === "media.architecturaldigest.com" ||
			domain === "media.cntraveler.com" ||
			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" ||
			domain === "images.playmates.com" ||
			domain === "images.playboy.com" ||
			(domain_nosub === "engoo.com" && domain.match(/^transcode[0-9]*\.app\./)) ||
			domain === "images.thehollywoodgossip.com" ||
			domain === "cdn.apartmenttherapy.info" ||
			domain === "image.thestartmagazine.com" ||
			domain === "cdn.substack.com" ||
			domain === "c.bellesa.co" ||
			domain === "images.haarets.co.il" ||
			domain === "assets.mocha.global" ||
			domain === "tbn.bidorbuy.co.za" ||
			domain === "resources.sonyliv.com" ||
			domain === "cdn.allbirds.com" ||
			(domain_nosub === "minutemediacdn.com" && /^images[0-9]*\./.test(domain)) ||
			domain === "imagecache.365scores.com" ||
			domain === "images.taboola.com" ||
			domain === "c.neevacdn.net" ||
			domain === "substackcdn.com" ||
			/\/image\/+fetch\/+.*?\/+https?(?::|%3A)(?:\/\/|%2F%2F)/.test(src)) {
			if (src.search(/:\/\/[^/]*\/(?:[^/]*\/+)?(?:image\/+)?fetch\//) >= 0) {
				newsrc = src.replace(/(.*?:\/\/[^/]*\/(?:[^/]*\/)?(?:image\/+)?fetch\/+)(?:.*?\/)?(https?(?::|%3A)(?:\/|%2F).*)/, "$1c_limit/$2");
				if (newsrc !== src)
					return {
						url: newsrc,
						head_wrong_contenttype: true
					};
				newsrc = src.replace(/.*?:\/\/[^/]*\/(?:[^/]*\/)?(?:image\/+)?fetch\/(?:.*?(?:\/|%2F))?([^/%]*(?::|%3A)(?:\/|%2F).*)/, "$1");
				newsrc = newsrc.replace(/\?savepath=[^&#?]+$/, "");
				if (/^[^/:]*%3A/.test(newsrc) ||
					(string_indexof(newsrc, "?") < 0 && string_indexof(newsrc, "%3F") >= 0))
					newsrc = decodeURIComponent(newsrc);
				return newsrc;
			}
			newsrc = src.replace(/(\/iu\/[^/]*)\/.*?(\/v[0-9]*\/)/, "$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "jpimedia.uk" && domain.match(/^images(?:-[a-z])?\./)) {
			return src.replace(/^[a-z]+:\/\/[^/]*\/+imagefetch\/+.*?\/(https?:\/\/)/, "$1");
		}
		if ((domain_nosub === "cloudinary.com" && /res(?:-[0-9]+)?\./.test(domain)) ||
			domain === "i.kinja-img.com") {
			newsrc = src
				.replace(/\/image\/+upload\/+/, "/image/upload/")
				.replace(/\/image\/upload\/s\-\-[^/]*\-\-\//, "/image/upload/")
				.replace(/\/iu\/s\-\-[^/]*\-\-\//, "/iu/")
				.replace(/\/image\/upload\/[^/]*_[^/]*\//, "/image/upload/")
				.replace(/\/image\/upload\/v[0-9]+\//, "/image/upload/")
				.replace(/(\/private_images\/+)(?:c_limit\/+)?[chwxyfq]_[^/]*\//, "$1c_limit/")
				.replace(/(\/image\/private\/)[^s][^-][^/]*\//, "$1c_limit/")
				.replace(/(:\/\/[^/]*\/)[^/]*\/(ch\/images\/[0-9]+\/[^/]*$)/, "$1$2");
			if (newsrc !== src) {
				return {
					url: newsrc,
					head_wrong_contentlength: true
				};
			}
		}
		if (domain === "fiverr-res.cloudinary.com" ||
			domain === "assets.lybrate.com") {
			return src.replace(/(:\/\/[^/]*\/+(?:images\/+)?)[a-z]_[^/]*\//, "$1");
		}
		if (domain === "images.complex.com") return src.replace(/\/(images|image\/upload)\/[^/]*_[^/]*\//, "/$1/");
		if (domain === "images.spot.im" ||
			domain_nowww === "fashionista.com" ||
			domain === "images.pigeonsandplanes.com" ||
			domain === "images.sftcdn.net" ||
			domain === "cdn.primedia.co.za" ||
			domain_nowww === "maxim.com" ||
			domain === "img.thedailybeast.com" ||
			domain === "alibaba.kumpar.com" ||
			domain === "5b0988e595225.cdn.sohucs.com" ||
			domain === "images-cdn.moviepilot.com" ||
			domain === "img.playbuzz.com" ||
			domain === "images.discerningassets.com" ||
			domain === "images.radio-canada.ca" ||
			domain === "img.wcdn.co.il" ||
			domain === "images.haarets.co.il" ||
			domain === "images.cdn.yle.fi" ||
			(domain_nowww === "sol.no" && string_indexof(src, "/img/") >= 0) ||
			(domain === "prof.prepics-cdn.com" && string_indexof(src, "/image/upload/") >= 0) ||
			domain === "images.ezvid.com" ||
			domain === "img.peerspace.com" ||
			domain === "dhgywazgeek0d.cloudfront.net" ||
			domain === "assets.nuuvem.com" ||
			domain === "images.lanouvellerepublique.fr" ||
			domain === "images.fastcompany.net" ||
			domain === "dwgyu36up6iuz.cloudfront.net" ||
			(domain_nosub === "minutemediacdn.com" && domain.match(/^images[0-9]*\./)) ||
			(domain_nosub === "cloudinary.com" && string_indexof(domain, "res.cloudinary.com") >= 0 && string_indexof(src, "/images/") >= 0) ||
			domain === "media.stubhubstatic.com" ||
			domain === "img.promipool.de" ||
			domain === "blue.kumparan.com" ||
			(domain_nosub === "answcdn.com" && domain.match(/^file[0-9]*\./)) ||
			domain === "res.fashionsnap.com" ||
			domain === "user-images.strikinglycdn.com" ||
			domain === "custom-images.strikinglycdn.com" ||
			domain === "novel-img.prepics-cdn.com" ||
			domain === "cdn.apartmenttherapy.info" ||
			domain === "cdn.domestika.org" ||
			(domain === "assets.charmboard.com" && string_indexof(src, "/images/") >= 0) ||
			domain === "image.spreadshirtmedia.com" ||
			domain === "c.bellesa.co" ||
			domain === "img.ssensemedia.com" ||
			domain === "images.jpost.com" ||
			domain === "img.hellofresh.com" ||
			domain === "assets.petco.com" ||
			domain === "img.redbull.com" ||
			domain === "images.tou.tv" ||
			domain === "assets.nintendo.com" ||
			domain === "assets.myntassets.com" ||
			domain === "static.nike.com" ||
			domain === "assets.myntassets.com" ||
			domain === "img.sndimg.com" ||
			domain === "assets.adidas.com" ||
			domain === "images.moviepilot.com" ||
			domain === "media.bleacherreport.com" ||
			domain === "img.olympicchannel.com" ||
			domain === "resource.logitech.com" ||
			domain == "media-cldnry.s-nbcnews.com" ||
			domain === "derivates.kicker.de" ||
			domain === "media.istra24.hr" ||
			(domain_nosub === "itc.cn" && /^p[0-9]*\./.test(domain) && /\/images[0-9]+\//.test(src)) ||
			domain === "assets.simpleviewinc.com" ||
			domain === "img.guess.com" ||
			domain === "media.niftygateway.com" ||
			(domain_nosub === "hotstarext.com" && /^img[0-9]*\./.test(domain)) ||
			domain === "res.garmin.com" ||
			domain === "media-cdn.grubhub.com" ||
			domain === "media.bauerradio.com" ||
			(domain_nowww === "wine.com" && /\/product\/+images\//.test(src)) ||
			domain === "puls-img.chanel.com" ||
			domain === "resources.finalsite.net" ||
			domain === "c.static-nike.com" ||
			domain === "resources.mynewsdesk.com" ||
			domain === "brand.assets.adidas.com" ||
			domain === "images.tennis.com" ||
			domain === "resource.logitechg.com") {
			newsrc = src
				.replace(/%2C/g, ",")
				.replace(/\/[a-z]+_[^/_,]+(?:,[^/]*)?\//, "/")
				.replace(/\/fl_any_format\.[^/]*\//, "/")
				.replace(/\/fl_keep_iptc[^/]*\//, "/")
				.replace("/t_mp_quality/", "/")
				.replace(/\/t_PDP_[0-9]+_v1\//, "/") // static.nike.com, number seems to be the width
				.replace(/\/t_image_size_[^/]+\//, "/") // resources.finalsite.net
				.replace(/\/private\/+t_[-0-9_]+\//, "/private/f_png/") // img.olympicchannel.com
				.replace(/\/v[0-9]{10}\//, "/")
				.replace(/\/image\/+upload\/+t_[^/]*\//, "/image/upload/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src
				.replace(/\/v[0-9]+\//, "/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\.webp(?:[?#].*)?$/, ".png");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "image.kkday.com") return src.replace(/\/image\/+get\/+[^/]*(?:%2C|,)[^/]*\//, "/image/get/");
		if (domain === "cdn.skim.gs") {
			return src
				.replace(/\/image\/upload\/[^/]*_[^/]*\//, "/image/upload/")
				.replace(/\/images\/[^/]*_[^/]*\//, "/images/");
		}
		if (domain === "www-konga-com-res.cloudinary.com") return src.replace(/(:\/\/[^/]+\/+).*?\/+media\//, "$1media/");
		if (((domain_nosub === "biography.com" ||
			domain_nowww === "guitarworld.com" ||
			domain_nowww === "guitaraficionado.com" ||
			domain_nowww === "psneurope.com") &&
			string_indexof(src, "/.image/") >= 0) ||
			src.match(/:\/\/[^/]*\/\.image\/[^/]*_[^/]*\/[A-Za-z-0-9]{24}\/[^/]*$/)) {
			newsrc = src.replace(/(\/.image)\/[^/]*(\/[^/]*\/[^/]*)$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "resources.mynewsdesk.com") return src.replace(/(\/image\/+upload\/+)t_[^/]+\/+/, "$1");
		if (domain_nosub === "bridestory.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+images\/+.*?\/+assets\/+([^/]+)\/+[^/]+(?:[?#].*)?$/, "https://images.bridestory.com/image/upload/assets/$1.jpg");
		if (domain_nowww === "chanel.com" ||
			domain === "img.olympics.com") {
			return src.replace(/(\/images\/+(?:image\/+private\/+)?)(?:(?:q|fl?|dpr|w|h|t)_[^/]+\/+)+/, "$1c_limit/");
		}
		if (domain === "cloudinary-cdn.ffm.to") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+.*?\/+(https?.*)$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nosub === "popsugar-assets.com" ||
			domain_nosub === "onsugar.com") {
			if (string_indexof(src, "/thumbor/") >= 0) {
				newsrc = src.replace(/\/thumbor\/.*/, "/" + common_functions["get_thumbor_url"](src.replace(/.*?\/thumbor\//, "/")));
				if (newsrc !== src)
					return newsrc;
			}
			newsrc = src.replace(/\.(?:preview_)?(?:[a-z]*|_original)(?:_(?:[0-9x]+|wm))?(\/i\/[^/]*)$/, "$1");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\.(?:preview|x*large)(?:_(?:[0-9x]+|wm))?(\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "ceros.com" && domain.match(/^media[-.]/)) {
			newsrc = src.replace(/\?.*/, "");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "elleuk.cdnds.net") {
			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(/\/[0-9]*x[0-9]*-[^/]*$/)) {
			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") return src.replace(/__[a-z]+(\.[^/.]*)$/, "$1");
		if (domain === "img.usmagazine.com") return src.replace(/(.*?[^:])\/[0-9]*-[^/]*\//, "$1/");
		if (domain_nosub === "gannett-cdn.com" &&
			string_indexof(src, "/-mm-/") >= 0) {
			newsrc = src.replace(/.*?\/-mm-\/[0-9a-f]*\/[^/]*\/(http[^/]*)\/(.*)$/, "$1://$2");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\/-mm-\/.*?\/-\//, "/");
		}
		if (domain_nowww === "usatoday.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+gcdn\/+/, "https://www.gannett-cdn.com/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "aolcdn.com") {
			var regex1 = /.*image_uri=([^&]*).*/;
			if (src.match(regex1)) {
				newsrc = decodeURIComponent(src.replace(/.*image_uri=([^&]*).*/, "$1"));
			} else if (src.match(/.*o\.aolcdn\.com\/images\//)) {
				newsrc = decodeURIComponent(src).replace(/.*o\.aolcdn\.com\/images\/[^:]*\/([^:/]*:.*)/, "$1");
			} else if (src.match(/^[a-z]+:\/\/[^/]*\/hss\/storage\/midas\//)) {
				return src.replace(/\/[0-9]+_([^/]*)$/, "/$1");
			}
			if (newsrc && newsrc !== src)
				return newsrc;
		}
		if (domain === "imagesvc.timeincapp.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/v3\/+[a-z]+\/+image\/?.*?[?&]url=(http[^&]*).*/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "g.foolcdn.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+image\/+\?(?:.*&)?url=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain_nosub === "photoshelter.com") {
			if (/\/img\/+photoshelter_unavailable\./.test(src)) {
				return {
					url: src,
					bad: true
				};
			}
			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 === "marcusgetta.photography" ||
			domain_nowww === "schreyer-photo.com" ||
			domain_nowww === "stellapictures.co.uk" ||
			domain_nowww === "mgpstockphotos.com") {
			return src.replace(/^[a-z]+:\/\/[^/]+\/+(img-get2\/)/, "https://ssl.c.photoshelter.com/$1");
		}
		if (domain_nowww === "celebzz.com" &&
			string_indexof(src, "/wp-content/uploads/") >= 0) {
			newsrc = src.replace(/_thumbnail(\.[^/.]*)$/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "images-amazon.com" ||
			domain_nosub === "ssl-images-amazon.com" ||
			domain_nosub === "media-amazon.com" ||
			domain_nosub === "media-imdb.com" ||
			domain === "in.in3w.info" ||
			domain_nowww === "amazon.co.jp" ||
			domain === "i.gr-assets.com") {
			if (/^[a-z]+:\/\/[^/]+\/+images\/+[A-Z]\/+[0-9]+\/+apparel\/+rcxgs\/+tile\.(?:[^/?#]+\.)?gif(?:[?#].*)?$/.test(src))
				return {
					url: src,
					bad: "mask"
				};
			var parse_directives = function(url) {
				var match = url.match(/((?:\.+_*(?:0_)?(?:[A-Z][A-Z0-9]|V_)[^/.]*)+)\.+[^/.]+(?:[?#].*)?$/);
				if (!match)
					return null;
				var raw_directives = match[1].replace(/\./g, "_").replace(/_+/g, "_").split("_");
				var directives = [];
				for (var _i = 0, raw_directives_1 = raw_directives; _i < raw_directives_1.length; _i++) {
					var directive = raw_directives_1[_i];
					if (!directive || !directive.length)
						continue;
					var dmatch = directive.match(/^([A-Z][A-Z0-9]|V|0)(.*)?$/);
					if (!dmatch) {
						console_warn("Invalid directive", directive, "for URL", url);
						return null;
					}
					directives.push({ key: dmatch[1], value: dmatch[2] || null });
				}
				return directives;
			};
			var stringify_directives = function(url, directives) {
				var stringified_arr = [];
				for (var _i = 0, directives_1 = directives; _i < directives_1.length; _i++) {
					var directive = directives_1[_i];
					var str_1 = [directive.key];
					if (directive.value)
						str_1.push(directive.value);
					stringified_arr.push(str_1.join(""));
				}
				var stringified = "._" + stringified_arr.join("_") + "_";
				if (!stringified_arr.length)
					stringified = "";
				var urlmatch = url.match(/^(.*\/[^/]+?)(?:\.+_*(?:0_)?(?:[A-Z][A-Z0-9]|V_)[^/.]*)*\.*(\.[^/.]+(?:[?#].*)?)$/);
				if (!urlmatch) {
					console_warn("Unable to find URL match for", url);
					return url;
				}
				return urlmatch[1] + stringified + urlmatch[2];
			};
			var parsed_directives = parse_directives(src);
			if (parsed_directives) {
				var new_directives = [];
				for (var _i = 0, parsed_directives_1 = parsed_directives; _i < parsed_directives_1.length; _i++) {
					var directive = parsed_directives_1[_i];
					if (directive.key === "V1" ||
						directive.key === "UX" ||
						directive.key === "UY" ||
						directive.key === "US" ||
						directive.key === "CR" ||
						directive.key === "AC" ||
						directive.key === "AL" ||
						directive.key === "AA" ||
						directive.key === "SL" ||
						directive.key === "SS" ||
						directive.key === "SR" ||
						directive.key === "SX" ||
						directive.key === "SY" ||
						directive.key === "V" ||
						directive.key === "BG" || // background color
						directive.key === "0" ||
						directive.key === "CB") {
						continue;
					}
					new_directives.push(directive);
				}
				newsrc = stringify_directives(src, new_directives);
				if (newsrc !== src) {
					return {
						url: newsrc,
						can_head: false
					};
				}
			}
			if (/\/images\/+P\//.test(src)) {
				return {
					url: src.replace(/(\/P\/+[A-Z0-9]+)(?:\.[0-9]+)?(?:\.[^/]+)?(\.[^/.?#]+)(?:[?#].*)?$/, "$1.01._SCRM_$2"),
					can_head: false
				};
			}
			return {
				url: src
					.replace(/(\.[^/.]*)(?:\.[^/.]*_){1,}\1(?:[?#].*)?$/, "$1") // is this needed?
					.replace(/(?:\.+_*[A-Z][A-Z0-9][^/.]*)+\.([^./]*(?:[?#].*)?)$/, ".$1"), // for now this seems to work for all images
				is_original: true,
				can_head: false
			};
		}
		if (domain_nosub === "otapol.jp") {
			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") return src.replace(/^[a-z]+:\/\/[^/]*\/[a-z]+\/+(.)([a-zA-Z0-9]+(?:@+)?)(?:\.[^/]*)?\/[^/]*(\.[^/.]*)$/, "https://ia.media-imdb.com/images/$1/$1$2$3");
		if (domain === "cdn.cafehulu.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+(.)([a-zA-Z0-9]{40,}(?:@+)?)(\.[^/?#]+)(?:[?#].*)?$/, "https://ia.media-imdb.com/images/$1/$1$2$3");
		if (domain_nowww === "imdb.com") {
			newsrc = website_query({
				website_regex: /\/video(?:player)?\/+(?:embed\/+)?vi([0-9]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://www.imdb.com/video/vi${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<script id="__NEXT_DATA__" type="application\/json">({.*?})<\/script>/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var json = JSON.parse(match[1]);
					var video = json.props.pageProps.videoPlaybackData.video;
					var baseobj = {
						extra: {
							caption: video.name.value || video.description.value
						}
					};
					var urls = [];
					for (var i = 0; i < video.playbackURLs.length; i++) {
						var our_obj = video.playbackURLs[i];
						var our_url = {
							url: our_obj.url
						};
						if (our_obj.mimeType === "video/mp4") {
							our_url.video = true;
						} else if (our_obj.mimeType === "application/x-mpegurl") {
							our_url.video = "hls";
						} else {
							console_warn("Unsupported mime type", our_obj.mimeType);
							continue;
						}
						urls.push(our_url);
					}
					urls.push(video.thumbnail.url); // TODO: remove ._???_.
					return done(fillobj_urls(urls, baseobj), 6 * 60 * 60); // urls expire in 23 hours
				}
			});
			if (newsrc)
				return newsrc;
		}

		if (domain_nowww === "cinema.de") {
			return src
				.replace(/.*\/files\/+sync\/([^/]+\.cinema\.de\/)/, "http://$1")
				.replace(/\/styles\/+.*?\/+(?:public|private)\/(.*\.jpeg)\.jpg(?:[?#].*)?$/, "/$1");
		}
		if (domain_nowww === "gamersnexus.net") {
			newsrc = src.replace(/(\/styles\/+[^/]+\/+public\/+[^/]+\/+[^/]+\.[a-z]+)\.webp(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\/styles\/+card_teaser(\/+public\/+[^/]+\/+[^/]+)(?:[?#].*)?$/, "/styles/large_responsive_no_watermark_$1");
		}
		if (domain === "cdn-img.instyle.com" ||
			domain === "static.independent.co.uk" ||
			domain === "static.standard.co.uk" ||
			/*domain.indexOf("www.billboard.com") >= 0 ||
			  string_indexof(domain, "www.harpersbazaararabia.com") >= 0 ||
			  string_indexof(domain, "www.etonline.com") >= 0 ||*/
			domain === "o.oystermag.com" ||
			/*domain.indexOf("www.metro.us") >= 0 ||
			  string_indexof(domain, "www.mtv.co.uk") >= 0 ||
			  string_indexof(domain, "www.grammy.com") >= 0 ||*/
			(domain_nosub === "thr.com" && domain.match(/cdn[0-9]*\.thr\.com/)) ||
			domain.match(/s[0-9]*\.ibtimes\.com/) ||
			src.match(/\/s3fs-public\/styles\/[^/]*\/public\//) ||
			domain === "media.pri.org" ||
			domain_nowww === "wwe.com" ||
			domain === "akm-img-a-in.tosshub.com" ||
			domain === "cdn.9razia.de" ||
			domain_nowww === "bravo.de" ||
			domain === "static.reservationvacances.com" ||
			domain === "cdn.okmag.de" ||
			domain_nowww === "soganhaber.com" ||
			domain_nowww === "favera.ru" ||
			domain === "cdn.businessinsider.es" ||
			(domain_nowww === "ru-24.ru" && string_indexof(src, "/_files/") >= 0) ||
			(domain_nowww === "selenagomez.com" && string_indexof(src, "/sites/") >= 0) ||
			(domain_nowww === "zizki.com" && string_indexof(src, "/styles/") >= 0) ||
			(domain_nowww === "rcf.fr" && string_indexof(src, "/sites/") >= 0) ||
			domain === "images.pagina12.com.ar" ||
			domain_nowww === "wasliestdu.de" ||
			(domain === "projects.balmain.com" && string_indexof(src, "/assets/") >= 0) ||
			domain_nosub === "sportkp.ru" ||
			domain === "cdn-live.foreignaffairs.com" ||
			domain_nowww === "negrusty.pro" ||
			src.match(/\/sites\/[^/]*\/files2?\/styles\/[^/]*/) ||
			src.match(/\/sites\/[^/]*\/files2?\/[^/]*\/styles\/[^/]*/) ||
			src.match(/(?:(?:\/sites\/+[^/]*)?\/files\/+|\/sites\/+[^/]*\/+)imagecache\/+[^/]*|\/sites\/+[^/]*\/+public\/+styles\/+/) ||
			src.search(/\/files\/styles\/[^/]*\/(?:public|private)\//) >= 0 ||
			src.search(/\/files\/[^/]*\/styles\/[^/]*\/(?:public|private)\//) >= 0) {
			newsrc = src
				.replace(/\/styles\/+.*?\/+(?:public|private)\//, "/")
				.replace(/\/imagecache\/+[^/]*\/+(?:files\/)?/, "/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\.jpe?g)\.webp([?#].*)?$/i, "$1$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\.webp([?#].*)?$/, ".jpg$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\?.*$/, "");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "cdn-img.instyle.com") {
			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" && /\/sites\/+default\/+files\//.test(src)) {
			return {
				url: src.replace(/\?.*/, ""),
				head_wrong_contentlength: true
			};
		}
		if (domain === "cdn.okmag.de" ||
			domain === "cdn.9razia.de") {
			return src.replace(/(:\/\/[^/]*\/)s\/[^/]*\/public\/(media\/)/, "$1$2");
		}
		if (domain === "img.elcomercio.pe" ||
			domain === "img.peru21.pe" ||
			domain_nowww === "elpais.com.co") {
			return src.replace(/\/files\/[^/]*\/uploads\//, "/uploads/");
		}
		if (domain === "media.voltron.voanews.com") return src.replace(/\/styles\/+[^/]*\/+s3\/+/, "/");
		if (domain_nowww === "schweizer-illustrierte.ch") return src.replace(/\/fp\/+(?:[0-9]+\/+){4}(sites\/+)/, "/$1");
		if (domain_nowww === "trbimg.com") return src.replace(/(\/img-[0-9a-f]+\/+[^/]+\/+[^/]+\/+)[0-9]+(?:\/+[0-9]+x[0-9]+\/*)?(?:[?#],*)?$/, "$1");
		if (domain_nosub === "ggpht.com" && /^geo[0-9]*\./.test(domain) && /:\/\/[^/]+\/+(?:cbk|maps\/+photothumb\/+fd\/+v1)\?/.test(src)) {
			queries = get_queries(src);
			if (queries.panoid || queries.bpb) {
				var w = parse_int(queries.w) || 0;
				var h = parse_int(queries.h) || 0;
				if (!w && !h) {
					w = 2000;
					h = 1200;
				}
				var largest = Math_max(w, h);
				var smallest = Math_min(w, h);
				var ratio;
				if (!smallest || !largest) {
					ratio = 1;
				} else {
					ratio = largest / smallest;
				}
				var mostlarge = 9999;
				if (!queries.panoid && queries.bpb)
					mostlarge = 2048;
				if (largest < mostlarge) {
					largest = mostlarge;
					smallest = parse_int(largest / ratio);
					if (w > h) {
						queries.w = largest;
						queries.h = smallest;
					} else {
						queries.h = largest;
						queries.w = smallest;
					}
					return add_queries(src, queries);
				}
			}
		}
		if ((/^google\./.test(domain_nosub) || domain_nosub === "googleapis.com") &&
			(/:\/\/[^/]+\/+maps\/+vt\//.test(src) || (/^mts[0-9]*\./.test(domain) && /:\/\/[^/]+\/+vt\//.test(src)))) {
			var queries = get_queries(src.replace(/^[a-z]+:\/\/[^/]+\/+(?:maps\/+)?vt\/+/, "?").replace(/(\?.*)\?/, "$1&"));
			if (queries.data) {
				queries.w = 1024;
				queries.h = 1024;
				newsrc = src.replace(/^([a-z]+:\/\/[^/]+\/+(?:maps\/+)?vt\/+).*/, "$1") + stringify_queries(queries);
				return newsrc;
			}
		}
		if ((domain_nosub === "blogspot.com" && string_indexof(domain, ".bp.blogspot.com") >= 0) ||
			((domain_nosub === "googleusercontent.com" ||
				domain_nosub.match(/^google\./)) &&
				(/^(?:yt|ci|lh|gp)[0-9](?:-[a-z]{2})?\./.test(domain) ||
					/^play-lh\./.test(domain))) ||
			domain === "d2yal1mtmg1ts6.cloudfront.net" ||
			domain === "blogger.googleusercontent.com" ||
			domain === "d2jcw5q7j4vmo4.cloudfront.net" ||
			(domain_nosub === "blogger.com" && domain.match(/^bp[0-9]*\.blogger\.com/)) ||
			domain === "drive.fife.usercontent.google.com" ||
			domain_nosub === "ggpht.com") {
			newsrc = src;
			if (!(/^[a-z]+:\/\/[^/]+\/+[^/?#=]{30,}=x[0-9]+-y[0-9]+-z[0-9]+-t[^-/?#]{23,}(?:[?#].*)?$/.test(src))) {
				newsrc = src
					.replace(/#.*$/, "")
					.replace(/\?.*$/, "")
					.replace(/\/[swh][0-9]*(-[^/]*]*)?\/([^/]*)$/, "/s0/$2")
					.replace(/(=[^/]*)?$/, "=s0?imgmax=0");
			}
			return {
				url: newsrc,
				can_head: false // 404
			};
		}
		if (domain === "ssl.gstatic.com") {
			if (/\/docs\/+common\/+[^/]+\.svg(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (/^google\./.test(domain_nosub) && /^books\./.test(domain)) {
			if (/\/books\/+(?:publisher\/+)?content\?/.test(src)) {
				var urls_1 = [];
				newsrc = remove_queries(add_queries(src, { w: "99999" }), ["h", "imgtk", "edge"]);
				if (newsrc !== src) {
					urls_1.push({
						url: newsrc,
						problems: {
							possibly_upscaled: true
						}
					});
				}
				if (!/[?&]sig=/.test(src)) {
					urls_1.unshift(remove_queries(add_queries(src, { img: "0", zoom: "0" }), ["w", "h", "imgtk", "edge"]));
				}
				if (urls_1.length)
					return urls_1;
			}
		}
		if (host_domain === "docs.google.com" && options.element) {
			if (options.element.tagName.toUpperCase() === "SVG" && options.element.classList.contains("kix-embeddedobject-image")) {
				var images = options.element.getElementsByTagName("image");
				if (images.length === 1) {
					newsrc = images[0].getAttribute("xlink:href");
					if (newsrc && newsrc !== src)
						return newsrc;
				}
			}
		}
		if (domain === "gimg.quizlet.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+((?:a-|-[-A-Za-z0-9]+)\/.*)/, "https://lh3.googleusercontent.com/$1");
		if (domain_nowww === "star-tool.ru") return src.replace(/^[a-z]+:\/\/[^/]+\/+([^/]+\/+[^/]+\/+[^/]+\/+[^/]+\/+[swh][0-9]*(?:-[^/]*]*)?\/+)/, "https://lh3.googleusercontent.com/$1");
		if (domain_nowww === "thehackernews.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+images\/+((?:[^/]+\/+){4}[^/]+\/+[^/]+)(?:[?#].*)?$/, "https://1.bp.blogspot.com/$1");
		if (domain_nosub === "googleusercontent.com" &&
			string_indexof(domain, "opensocial.googleusercontent.com") >= 0) {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/gadgets\/proxy.*?[?&]url=([^&]*).*?$/, "$1"));
		}
		if (domain === "cdn.narcity.com" ||
			domain_nowww === "narcity.com") {
			return src.replace(/(\/[^/.]*\.[^/._]+)_(?:facebook|[0-9]+x[0-9]+)\.[^/.]*(?:[?#].*)?$/, "$1");
		}
		if (domain === "images.vanityfair.it" ||
			domain === "images.glamour.it") {
			return src.replace(/(\/gallery\/[0-9]*\/)[^/]*\//, "$1Original/");
		}
		if (domain_nosub === "r29static.com" ||
			(domain_nosub === "refinery29.com" && domain.match(/^static[0-9]*\./))) {
			return src.replace(/(\/bin\/(?:entry|public|author)\/[^/]*)\/(?:[0-9]+,[0-9]+,[0-9]+,[0-9]+\/)?[^/]*(?:,[^/]*)?\/([^,]*)$/, "$1/x,100/$2");
		}
		if (domain === "img.huffingtonpost.com") {
			return src
				.replace(/\/asset\/[^/]*\/([^/.]*\.[^/.]*)$/, "/asset/$1")
				.replace(/\?[^/]*$/, "");
		}
		if (domain === "images.huffingtonpost.com" ||
			(domain_nowww === "kisax.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "nicepik.com" && domain.match(/^i[0-9]*\./) && string_indexof(src, "/files/") >= 0) ||
			(domain_nosub === "uihere.com" && domain.match(/^c[0-9]*\./) && string_indexof(src, "/files/") >= 0) ||
			(domain_nowww === "babylonbee.com" && /\/img\/+articles\//.test(src)) ||
			(domain_nowww === "womansdiary.gr" && src.match(/\/articles\/[0-9]+\/[-0-9a-f]+-thumb/))) {
			return src.replace(/-thumb(\.[^/.]*)$/, "$1");
		}
		if (domain === "i.huffpost.com" ||
			domain === "s-i.huffpost.com") {
			return src
				.replace(/(\/gadgets\/slideshows\/[0-9]*\/slide_[^/]*_)[a-z]*(\.[^/.]*)$/, "$1original$2")
				.replace(/(\/gen\/[0-9]*\/).*(\.[^/.?]*)(?:\?[^/]*)?$/, "$1original$2");
		}
		if (domain_nosub === "washingtonpost.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+pbox\.php\?(?:.*&)?url=([^&]+).*$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+wp-apps\/+imrs\.php\?(?:.*&)?src=([^&]+).*/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+resizer\/+[^/]+=\/+(?:.*\/)?(arc-anglerfish-washpost-prod-washpost)\/+/, "https://$1.s3.amazonaws.com/");
			if (newsrc !== src)
				return newsrc;
		}
		if (amazon_container === "arc-anglerfish-washpost-prod-washpost") {
			return src.replace(/_size-normalized(\.[^/.]+)(?:[?#].*)?$/, "$1");
		}
		if ((domain_nosub === "washingtonpost.com" ||
			domain_nowww === "statesman.com" ||
			domain_nowww === "myajc.com" ||
			domain_nowww === "ajc.com" ||
			domain_nowww === "lastampa.it" ||
			domain_nowww === "whio.com" ||
			domain_nowww === "daytondailynews.com" ||
			domain_nowww === "livemint.com" ||
			domain === "c.o0bg.com" ||
			domain_nosub === "bostonglobe.com" ||
			domain_nosub === "hindustantimes.com") &&
			string_indexof(src, "/rf/") >= 0 ||
			src.match(/^[a-z]+:\/\/[^/]*\/rf\/+image_[^/]*\/+(?:[0-9]{4}-[0-9]{4}\/+)?(?:Pub|Wires|HT)\/+(?:[wp][0-9]+|Online|Web)\/+/)) {
			newsrc = src
				.replace(/(.*?:\/\/[^/]*\/)rf\/[^/]*\/(.*)$/, "$1rw/$2")
				.replace(/[?&].*$/, "")
				.replace(/\.r(\.[^/.]*)$/, "$1");
			if (newsrc !== src) {
				return newsrc;
			}
		}
		if (domain_nosub === "foxnews.com" &&
			domain.match(/^a[0-9]*\.foxnews\.com/)) {
			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" ||
			domain_nosub === "cliqueimg.com") {
			return src
				.replace(/(\/[^/]*)\.[0-9]*x[0-9]*[^/.]*\.([^./]*)$/, "$1.$2")
				.replace(/\/cache\/posts\//, "/posts/");
		}
		if (domain_nosub === "hubstatic.com") {
			newsrc = src.replace(/(\/[0-9]+)_f[0-9]+(\.[^/.]*)$/, "$1$2");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (domain === "cdn.cms-twdigitalassets.com") return src.replace(/(\.[a-z]+)\.twimg\.[0-9]+\.[a-z]+(?:[?#].*)?$/, "$1");
		if (domain === "pbs.twimg.com" ||
			(domain === "ton.twitter.com" && string_indexof(src, "/ton/data/dm/") >= 0)) {
			newsrc = common_functions["get_largest_twimg"](src, options);
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "twitter.com" ||
			domain_nowww === "x.com") {
			var _query_twitter_webapi = function(url, cookies, cb) {
				if (!cookies || !cookies.ct0) {
					console_warn("Cookies are needed for Twitter API calls", cookies);
					return cb(null);
				}
				var headers = {
					Accept: "*/*",
					Authorization: base64_decode("YWJjZEJlYXJlciBBQUFBQUFBQUFBQUFBQUFBQUFBQUFOUklMZ0FBQUFBQW5Od0l6VWVqUkNPdUg1RTZJOHhuWno0cHVUcyUzRDFadjd0dGZrOExGODFJVXExNmNIamhMVHZKdTRGQTMzQUdXV2pDcFRuQQ==").substr(4),
					Referer: "https://twitter.com/",
					"sec-fetch-dest": "empty",
					"sec-fetch-mode": "cors",
					"sec-fetch-site": "same-origin",
					"x-csrf-token": cookies.ct0,
					"x-twitter-client-language": cookies.lang || "en",
					"x-twitter-active-user": "yes"
				};
				if (cookies.twid) { // don't use auth_token, it doesn't exist on non-httponly-side
					headers["x-twitter-auth-type"] = "OAuth2Session";
				} else {
					if (cookies.gt) {
						headers["x-guest-token"] = cookies.gt;
					} else {
						console_warn("Guest token not found");
						return cb(null);
					}
				}
				api_query("twitter_api:" + url, {
					url: url,
					method: "GET",
					imu_mode: "xhr",
					headers: headers,
					json: true
				}, cb, function(done, resp, cache_key) {
					done(resp, 60 * 60);
				});
			};
			var query_twitter_webapi = function(url, cb) {
				if (options.get_cookies) {
					options.get_cookies("https://www.x.com/", function(cookies) {
						if (cookies)
							cookies = headers_list_to_dict(cookies);
						_query_twitter_webapi(url, cookies, cb);
					});
				} else {
					_query_twitter_webapi(url, null, cb);
				}
			};
			var query_tweet = function(tweet_id, cb) {
				var url = "https://twitter.com/i/api/2/timeline/conversation/" + tweet_id + ".json";
				var queries = {
					include_profile_interstitial_type: "1",
					include_blocking: "1", // u
					include_blocked_by: "1", // u
					include_followed_by: "1", // u
					include_want_retweets: "1", // u
					include_mute_edge: "1", // u
					include_can_dm: "1", // u
					include_can_media_tag: "1", // u
					skip_status: "1",
					cards_platform: "Web-12",
					include_cards: "1",
					include_ext_alt_text: "true",
					include_quote_count: "true", // u
					include_reply_count: "1", // u
					tweet_mode: "extended",
					include_entities: "true",
					include_user_entities: "true",
					include_ext_media_color: "true",
					include_ext_media_availability: "true",
					send_error_codes: "true",
					simple_quoted_tweet: "true",
					count: "20", // u
					include_ext_has_birdwatch_notes: "false",
					ext: "mediaStats%2ChighlightedLabel"
				};
				url = add_queries(url, queries);
				query_twitter_webapi(url, function(data) {
					if (!data)
						return cb(null);
					try {
						var tweet_data = data.globalObjects.tweets[tweet_id];
						data.globalObjects.tweet = tweet_data;
						cb(data.globalObjects);
					} catch (e) {
						console_error(e, data);
						cb(null);
					}
				});
			};
			var get_baseobj_from_tweet = function(tweet, users) {
				var obj = {
					can_head: false, // returns 503 sometimes
					extra: {}
				};
				if (tweet.created_at) {
					obj.extra.created_date = new Date(tweet.created_at).getTime();
				}
				if (users && tweet.id_str && tweet.user_id_str) {
					var username = users[tweet.user_id_str].screen_name;
					obj.extra.author_username = username;
					obj.extra.page = "https://x.com/" + username + "/status/" + tweet.id_str;
				}
				if (tweet.full_text) {
					obj.extra.caption = tweet.full_text;
				}
				return obj;
			};
			var get_single_media_obj = function(media) {
				var urls = [];
				if (array_indexof(["photo", "animated_gif", "video"], media.type) < 0) {
					console_warn("Unknown media type", media);
					return null;
				}
				if (media.video_info && media.video_info.variants) {
					var added_mimes = new_set();
					media.video_info.variants.sort(function(a, b) {
						if (a.content_type === "application/x-mpegURL")
							return -1;
						if (b.content_type === "application/x-mpegURL")
							return 1;
						if (a.bitrate && b.bitrate)
							return b.bitrate - a.bitrate;
						return 0;
					});
					array_foreach(media.video_info.variants, function(variant) {
						if (set_has(added_mimes, variant.content_type))
							return;
						set_add(added_mimes, variant.content_type);
						var unshift = false;
						var video = true;
						if (variant.content_type === "video/mp4") {
							video = true;
						} else if (variant.content_type === "application/x-mpegURL") {
							video = "hls";
							unshift = true;
						} else {
							console_warn("Unknown content type", variant, media);
							return;
						}
						var obj = {
							url: variant.url,
							video: video
						};
						urls.push(obj);
					});
				}
				var media_url = media.media_url_https;
				if (false && media.type === "photo") {
					var largest_size = null;
					var largest_size_br = 0;
					obj_foreach(media.sizes, function(key, size) {
						var our_br = size.w * size.h;
						if (our_br > largest_size_br) {
							largest_size = key;
							largest_size_br = our_br;
						}
					});
					if (largest_size) {
						media_url += "?name=" + largest_size;
					}
					if (largest_size !== "orig") {
						urls.push(media_url.replace(/\?.*$/, "?name=orig"));
					}
				}
				var larger_media = common_functions["get_largest_twimg"](media_url, options);
				if (larger_media) {
					array_extend(urls, larger_media);
				} else {
					urls.push(media_url);
				}
				return urls;
			};
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+[^/]+\/+status\/+([0-9]+)(?:\/.*)?(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+i\/+web\/+status\/+([0-9]+)(?:[?#].*)?$/
				],
				run: function(cb, match) {
					var id = match[1];
					query_tweet(id, function(data) {
						if (!data) {
							return cb(null);
						}
						var tweet = data.tweet;
						var obj = get_baseobj_from_tweet(tweet, data.users);
						var media_id = 0;
						var media_id_match = src.match(/#imu-media-id=([0-9]+)$/);
						if (media_id_match)
							media_id = media_id_match[1];
						var imu_url_id = null;
						var imu_url_match = src.match(/#imu-url=(.*)$/);
						if (imu_url_match) {
							var imu_url = imu_url_match[1];
							imu_url_match = imu_url.match(/.*\/([^/.?#]+)(?:\.[^/]+)?(?:[?#].*)?$/);
							if (imu_url_match) {
								imu_url_id = imu_url_match[1];
							}
						}
						var medias = [];
						var currenturls = [];
						var album_links = [];
						if (tweet.extended_entities && tweet.extended_entities.media) {
							array_foreach(tweet.extended_entities.media, function(media, i) {
								var singleobj = get_single_media_obj(media);
								if (!singleobj)
									return;
								var is_current = i == media_id;
								if (imu_url_id) {
									array_foreach(singleobj, function(ourobj) {
										var url = ourobj.url || ourobj;
										var our_id = url.match(/.*\/([^/.?#]+)(?:\.[^/]+)?(?:[?#].*)?$/)[1];
										is_current = our_id === imu_url_id;
										if (is_current)
											return;
									});
								}
								album_links.push({
									url: obj.extra.page + "#imu-media-id=" + i,
									is_current: is_current
								});
								medias[i] = singleobj;
								if (is_current)
									currenturls = singleobj;
							});
							if (album_links.length > 1) {
								obj.album_info = {
									type: "links",
									links: album_links
								};
							}
						}
						if (tweet.card && !currenturls.length) {
							var card = tweet.card;
							var card_url = card.url;
							var card_image = null;
							if (card.binding_values) {
								if (card.binding_values.player_url) {
									card_url = card.binding_values.player_url.string_value;
								}
								if (card.binding_values.player_image) {
									card_image = card.binding_values.player_image.image_value.url;
								}
							}
							currenturls.push({
								url: card_url,
								is_pagelink: true
							});
							if (card_image)
								currenturls.push(card_image);
						}
						if (tweet.quoted_status_permalink && !currenturls.length) {
							return cb({
								url: tweet.quoted_status_permalink.expanded,
								is_pagelink: true
							});
						}
						return cb(fillobj_urls(currenturls, obj));
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if ((host_domain_nowww === "twitter.com" || host_domain_nowww === "x.com") && options.element) {
			var tweet_link = common_functions["get_twitter_tweet_link"](options.element);
			page_nullobj = null;
			if (tweet_link) {
				page_nullobj = {
					url: tweet_link,
					is_pagelink: true
				};
				if (src) {
					page_nullobj.url += "#imu-url=" + src;
				} else {
					return page_nullobj;
				}
			}
			var caption = common_functions["get_twitter_caption"](options.element);
			if (caption) {
				var newobj = {
					url: src,
					extra: {
						caption: caption
					}
				};
				if (page_nullobj) {
					return [page_nullobj, newobj];
				} else {
					return newobj;
				}
			} else if (page_nullobj) {
				return page_nullobj;
			}
		}
		if ((domain_nowww === "nitter.net" ||
			// https://github.com/zedeus/nitter/wiki/Instances
			// sorting same as instance list in case we need to add new ones from it
			domain === "nitter.lacontrevoie.fr" ||
			domain === "nitter.nixnet.services" ||
			domain === "nitter.fdn.fr" ||
			domain === "nitter.1d4.us" ||
			domain === "nitter.kavin.rocks" ||
			domain === "nitter.unixfox.eu" ||
			domain === "nitter.domain.glass" ||
			domain === "birdsite.xanny.family" ||
			domain === "nitter.moomoo.me" ||
			domain === "bird.trom.tf" ||
			domain === "nitter.it" ||
			domain === "nitter.weiler.rocks" ||
			domain === "nitter.sethforprivacy.com" ||
			domain === "nitter.nl" ||
			domain === "nitter.mint.lgbt" ||
			domain === "nitter.esmailelbob.xyz" ||
			domain === "tw.artemislena.eu" ||
			domain === "nitter.tiekoetter.com" ||
			domain === "nitter.privacy.com.de" ||
			domain === "nitter.bird.froth.zone" ||
			domain === "nitter.cz" ||
			domain === "nitter.privacydev.net" ||
			domain === "tweet.lambda.dance" ||
			domain === "nitter.kylrth.com" ||
			domain === "unofficialbird.com" ||
			domain === "nitter.projectsegfau.lt" ||
			domain === "nitter.eu.projectsegfau.lt" ||
			domain === "nitter.in.projectsegfau.lt" ||
			domain === "singapore.unofficialbird.com" ||
			domain === "canada.unofficialbird.com" ||
			domain === "india.unofficialbird.com" ||
			domain === "nederland.unofficialbird.com" ||
			domain === "uk.unofficialbird.com" ||
			domain === "nitter.soopy.moe" ||
			domain === "nitter.qwik.space" ||
			domain === "read.whatever.social" ||
			domain === "nitter.rawbit.ninja" ||
			domain === "nt.vern.cc" ||
			domain === "n.sneed.network" ||
			domain === "nitter.smnz.de" ||
			domain === "nitter.twei.space" ||
			domain === "nitter.inpt.fr" ||
			domain === "nitter.d420.de" ||
			domain === "nitter.caioalonso.com" ||
			domain === "nitter.at" ||
			domain === "nitter.nicfab.eu" ||
			domain === "bird.habedieeh.re" ||
			domain === "nitter.hostux.net" ||
			domain === "nitter.adminforge.de" ||
			domain === "nitter.platypush.tech" ||
			domain === "nitter.us.projectsegfau.lt" ||
			domain === "t.com.sb" ||
			domain === "nitter.kling.gg" ||
			domain === "nitter.riverside.rocks" ||
			domain === "nitter.lunar.icu" ||
			domain === "twitter.moe.ngo" ||
			domain === "nitter.freedit.eu" ||
			domain === "n.opnxng.com" ||
			domain === "nitter.tux.pizza" ||
			domain === "nitter.altgr.xyz" ||
			domain === "jote.lile.cl" ||
			domain === "nitter.one" ||
			domain === "nitter.io.lol" ||
			domain === "nitter.no-logs.com" ||
			domain === "tweet.whateveritworks.org" ||
			domain === "nitter.fediflix.org" ||
			domain === "nitter.nohost.network" ||
			domain === "nitter.simpleprivacy.fr" ||
			domain === "nitter.onthescent.xyz" ||
			domain === "nitter.x86-64-unknown-linux-gnu.zip" ||
			domain === "nitter.private.coffee" ||
			domain === "nitter.oksocial.net" ||
			domain === "nitter.services.woodland.cafe" ||
			domain === "nitter.dafriser.be" ||
			domain === "nitter.catsarch.com" ||
			//domain === "nitter.13ad.de" ||
			//domain === "tw.openalgeria.org" ||
			domain === "nitter.42l.fr" ||
			domain === "nitter.pussthecat.org" ||
			//domain === "nitter.mastodont.cat" ||
			domain === "nitter.tedomum.net" ||
			domain === "nitter-home.kavin.rocks" ||
			domain === "nitter.cc" ||
			domain === "nitter.vxempire.xyz" ||
			domain === "nitter.eu" ||
			domain === "nitter.ethibox.fr" ||
			domain === "nitter.namazso.eu" ||
			domain === "nitter.mailstation.de" ||
			domain === "nitter.actionsack.com" ||
			domain === "nitter.cattube.org" ||
			domain === "nitter.40two.app" ||
			domain === "nitter.skrep.in" ||
			domain === "nitter.hu" ||
			domain === "nitter.database.red" ||
			domain === "nitter.exonip.de" ||
			domain === "twitr.gq" ||
			domain === "nitter.koyu.space" ||
			domain === "nitter.dark.fail" ||
			//domain === "t.maisputain.ovh" ||
			//domain === "nitter.weaponizedhumiliation.com" ||
			domain === "nitter.snopyta.org")
			&& string_indexof(src, "/pic/") >= 0) {
			match = src.match(/\/pic\/+enc\/(bWVka[^/?#.]+)(?:[?#].*)?$/);
			if (match) {
				try {
					newsrc = base64_decode(match[1]);
					return "https://pbs.twimg.com/" + newsrc;
				} catch (e) {
					console_error(e);
				}
			}
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+pic\/+(.*)$/, "$1");
			if (newsrc !== src) {
				newsrc = decodeURIComponent(newsrc);
				if (string_indexof(newsrc, "video.twimg.com") === 0) {
				} else {
					var urls = common_functions["get_largest_twimg"](urljoin("https://pbs.twimg.com/", "/" + decodeURIComponent(newsrc), true));
					if (urls) {
						if (!is_array(urls))
							urls = [urls];
						array_foreach(urls, function(url) {
							var queries = get_queries(url.url);
							if (!url.filename) {
								url.filename = url_basename(url.url);
							}
							url.url = encodeURIComponent(url.url.replace(/^[a-z]+:\/\/[^/]+\/+/, ""));
							url.url = "https://" + domain + "/pic/" + url.url;
							if (queries.format && /\/(?:profile_images|media)/.test(url.url)) {
								url.url = url.url.replace(/(.*%2F[^.%]+)(?:\..*)?(%.*)?$/, "$1." + queries.format + "$2");
							}
						});
						return urls;
					} else {
						return {
							url: src,
							filename: url_basename(newsrc)
						};
					}
				}
			}
		}
		if (options.element &&
			(host_domain_nowww === "nitter.net" ||
			// https://github.com/zedeus/nitter/wiki/Instances
			// sorting same as instance list in case we need to add new ones from it
			host_domain === "nitter.lacontrevoie.fr" ||
			host_domain === "nitter.nixnet.services" ||
			host_domain === "nitter.fdn.fr" ||
			host_domain === "nitter.1d4.us" ||
			host_domain === "nitter.kavin.rocks" ||
			host_domain === "nitter.unixfox.eu" ||
			host_domain === "nitter.domain.glass" ||
			host_domain === "birdsite.xanny.family" ||
			host_domain === "nitter.moomoo.me" ||
			host_domain === "bird.trom.tf" ||
			host_domain === "nitter.it" ||
			host_domain === "nitter.weiler.rocks" ||
			host_domain === "nitter.sethforprivacy.com" ||
			host_domain === "nitter.nl" ||
			host_domain === "nitter.mint.lgbt" ||
			host_domain === "nitter.esmailelbob.xyz" ||
			host_domain === "tw.artemislena.eu" ||
			host_domain === "nitter.tiekoetter.com" ||
			host_domain === "nitter.privacy.com.de" ||
			host_domain === "nitter.bird.froth.zone" ||
			host_domain === "nitter.cz" ||
			host_domain === "nitter.privacydev.net" ||
			host_domain === "tweet.lambda.dance" ||
			host_domain === "nitter.kylrth.com" ||
			host_domain === "unofficialbird.com" ||
			host_domain === "nitter.projectsegfau.lt" ||
			host_domain === "nitter.eu.projectsegfau.lt" ||
			host_domain === "nitter.in.projectsegfau.lt" ||
			host_domain === "singapore.unofficialbird.com" ||
			host_domain === "canada.unofficialbird.com" ||
			host_domain === "india.unofficialbird.com" ||
			host_domain === "nederland.unofficialbird.com" ||
			host_domain === "uk.unofficialbird.com" ||
			host_domain === "nitter.soopy.moe" ||
			host_domain === "nitter.qwik.space" ||
			host_domain === "read.whatever.social" ||
			host_domain === "nitter.rawbit.ninja" ||
			host_domain === "nt.vern.cc" ||
			host_domain === "n.sneed.network" ||
			host_domain === "nitter.smnz.de" ||
			host_domain === "nitter.twei.space" ||
			host_domain === "nitter.inpt.fr" ||
			host_domain === "nitter.d420.de" ||
			host_domain === "nitter.caioalonso.com" ||
			host_domain === "nitter.at" ||
			host_domain === "nitter.nicfab.eu" ||
			host_domain === "bird.habedieeh.re" ||
			host_domain === "nitter.hostux.net" ||
			host_domain === "nitter.adminforge.de" ||
			host_domain === "nitter.platypush.tech" ||
			host_domain === "nitter.us.projectsegfau.lt" ||
			host_domain === "t.com.sb" ||
			host_domain === "nitter.kling.gg" ||
			host_domain === "nitter.riverside.rocks" ||
			host_domain === "nitter.lunar.icu" ||
			host_domain === "twitter.moe.ngo" ||
			host_domain === "nitter.freedit.eu" ||
			host_domain === "n.opnxng.com" ||
			host_domain === "nitter.tux.pizza" ||
			host_domain === "nitter.altgr.xyz" ||
			host_domain === "jote.lile.cl" ||
			host_domain === "nitter.one" ||
			host_domain === "nitter.io.lol" ||
			host_domain === "nitter.no-logs.com" ||
			host_domain === "tweet.whateveritworks.org" ||
			host_domain === "nitter.fediflix.org" ||
			host_domain === "nitter.nohost.network" ||
			host_domain === "nitter.simpleprivacy.fr" ||
			host_domain === "nitter.onthescent.xyz" ||
			host_domain === "nitter.x86-64-unknown-linux-gnu.zip" ||
			host_domain === "nitter.private.coffee" ||
			host_domain === "nitter.oksocial.net" ||
			host_domain === "nitter.services.woodland.cafe" ||
			host_domain === "nitter.dafriser.be" ||
			host_domain === "nitter.catsarch.com" ||
			//host_domain === "nitter.13ad.de" ||
			//host_domain === "tw.openalgeria.org" ||
			host_domain === "nitter.42l.fr" ||
			host_domain === "nitter.pussthecat.org" ||
			//host_domain === "nitter.mastodont.cat" ||
			host_domain === "nitter.tedomum.net" ||
			host_domain === "nitter-home.kavin.rocks" ||
			host_domain === "nitter.cc" ||
			host_domain === "nitter.vxempire.xyz" ||
			host_domain === "nitter.eu" ||
			host_domain === "nitter.ethibox.fr" ||
			host_domain === "nitter.namazso.eu" ||
			host_domain === "nitter.mailstation.de" ||
			host_domain === "nitter.actionsack.com" ||
			host_domain === "nitter.cattube.org" ||
			host_domain === "nitter.40two.app" ||
			host_domain === "nitter.skrep.in" ||
			host_domain === "nitter.hu" ||
			host_domain === "nitter.database.red" ||
			host_domain === "nitter.exonip.de" ||
			host_domain === "twitr.gq" ||
			host_domain === "nitter.koyu.space" ||
			host_domain === "nitter.dark.fail" ||
			//host_domain === "t.maisputain.ovh" ||
			//host_domain === "nitter.weaponizedhumiliation.com" ||
			host_domain === "nitter.snopyta.org")) {
			if (options.element.tagName === "VIDEO" && !src) {
				newsrc = options.element.getAttribute("data-url");
				if (newsrc) {
					return {
						url: urljoin(options.host_url, newsrc, true),
						media_info: {
							type: "video",
							delivery: "hls",
							need_custom_xhr: true // in order to override head requests
						},
						can_head: false // 404
					};
				}
			}
		}
		if (host_domain_nosub === "youtube.com" && options.element) {
			if (options.element.tagName.toLowerCase() === "svg") {
				var parent_tagname = options.element.parentElement.tagName.toLowerCase();
				if (parent_tagname === "yt-icon" || parent_tagname === "button")
					return {
						url: origsrc,
						bad: "mask"
					};
			}
			if (options.element.tagName === "DIV" && options.element.classList.contains("ytp-gradient-bottom")) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
			if (!src) {
				newsrc = common_functions["get_host_el_matching"](options.element, options.host_url, function(x) {
					return x.tagName === "VIDEO" && x.classList.contains("html5-main-video");
				});
				if (newsrc)
					return newsrc;
			}
		}
		if (domain_nosub === "youtube.com" || domain === "m.youtube.com" || domain_nowww === "youtu.be") {
			match = src.match(/^[a-z]+:\/\/(?:(?:www|m(?:usic)?)\.)?youtube\.com\/+watch\?(?:.*&)?v=([^&#]*)/);
			if (!match) {
				match = src.match(/^[a-z]+:\/\/(?:www\.)?youtu\.be\/+([^?&#]*)/);
			}
			if (!match) {
				match = src.match(/^[a-z]+:\/\/(?:(?:www|m)\.)?youtube\.com\/+(?:embed|shorts)\/+([^?#/]+)\/*(?:[?#].*)?$/);
			}
			if (match) {
				return "https://i.ytimg.com/vi/" + match[1] + "/mqdefault.jpg";
			}
		}
		if (domain === "ytimg.googleusercontent.com" ||
			(domain_nosub === "ytimg.com" && domain.match(/^i[0-9]*\./)) ||
			domain === "img.youtube.com") {
			obj = {
				problems: {
					possibly_different: false
				}
			};
			match = src.match(/\/(?:vi|an)(?:_webp)?\/+([^/]+)\/+[^/]+\.[^/.]+(?:[?#].*)?$/);
			id = null;
			if (match) {
				obj.extra = { page: "https://www.youtube.com/watch?v=" + match[1] };
				id = match[1];
			}
			newsrc = src.replace(/^([a-z]+:\/\/)i[0-9]+(\.ytimg\.com\/vi(?:_webp)?\/+[^/]+\/+[a-z]+\.)/, "$1i$2");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			regex = /^(.+\/+(?:vi|an)(?:_webp)?\/+[^/]*\/+)[a-z]*(default|[0-9]+)(?:_(?:live|[0-9]+s))?(\.[^/.?#]*)(?:[?#].*)?$/;
			if (regex.test(src) /*&& !problem_excluded("possibly_different")*/) {
				var sizes = [
					"maxres",
					"sd",
					"hq",
					"mq"
				];
				src = src.replace(/\/an(_webp)?\/+/, "/vi$1/");
				var urls = [];
				array_foreach(sizes, function(size) {
					var match = src.match(regex);
					var number = match[2];
					if (number.length > 1 || number === "0") {
						number = "default";
					}
					var newsrc = match[1] + size + number + match[3];
					if (newsrc !== src) {
						urls.push(newsrc);
					} else {
						return false;
					}
				});
				if (urls.length > 0)
					return fillobj_urls(urls, obj);
			}
			if (id && options && options.do_request && options.cb) {
				var parse_player_response = function(player_response) {
					if (!player_response) {
						return options.cb(null);
					}
					console_log(player_response);
					obj.url = src;
					obj.problems.possibly_different = false;
					var videoid = null;
					if (player_response.videoDetails && player_response.videoDetails.title && player_response.videoDetails.videoId) {
						videoid = player_response.videoDetails.videoId;
						obj.extra = {
							page: "https://www.youtube.com/watch?v=" + videoid,
							caption: player_response.videoDetails.title,
							id: videoid
						};
					}
					var maxbitrate = 0;
					var maxobj = null;
					var duration = 0;
					var available_formats = [];
					var has_sig = false;
					var add_formats = function(formats, is_adaptive) {
						for (var i = 0; i < formats.length; i++) {
							var our_format = formats[i];
							available_formats.push(our_format);
							our_format.imu_video_id = videoid;
							if (is_adaptive) {
								our_format.imu_is_adaptive = true;
							}
							if (our_format.approxDurationMs) {
								var ms = parseFloat(our_format.approxDurationMs);
								ms /= 1000;
								if (ms > duration)
									duration = ms;
							}
							our_format.imu_has_sig = our_format.cipher || our_format.signatureCipher;
							if (our_format.imu_has_sig) {
								has_sig = true;
							}
						}
					};
					var get_n_replacer = function(cb) {
						if (!options.rule_specific.youtube_replace_n) {
							console_warn("Youtube n replacing is disabled, expect slow speeds.");
							return cb(null);
						}
						api_cache.fetch("youtube:n_replacer", cb, function(done) {
							common_functions["youtube_fetch_asset"](api_cache, options, videoid, "js", function(asset) {
								var match = asset.match(/b=([a-zA-Z0-9]{3})\[0\]\(b\),a\.set\("n",b\)/);
								if (!match) {
									console_error("Unable to find n match in", { asset: asset });
									return done(null, 6 * 60 * 60);
								}
								var match2 = asset.match(new RegExp("var " + match[1] + "=\\[([a-zA-Z0-9]{3})\\]"));
								if (!match2) {
									console_error("Unable to find n sub-match in", { asset: asset, match: match });
									return done(null, 6 * 60 * 60);
								}
								var match3 = asset.match(new RegExp("\n" + match2[1] + "=function\\(a\\){([\\s\\S]*?join\\(\"\"\\);?)};\n"));
								if (!match3) {
									console_error("Unable to find n function match in", { asset: asset, match: match, match2: match2 });
									return done(null, 6 * 60 * 60);
								}
								var sanitized = match3[1];
								var sanitize = function(code) {
									return code
										.replace(/new Date\("([^"]+)"\)/, function(_, x) {
										return new Date(x).getTime();
									})
										.replace(/Math.pow\(([0-9]+),([0-9]+)\)/, function(_, x, y) {
										return Math_pow(x, y);
									});
								};
								while (true) {
									var new_sanitized = sanitize(sanitized);
									if (new_sanitized === sanitized)
										break;
									sanitized = new_sanitized;
								}
								get_library("JSInterpreter", options, options.do_request, function(JSInterpreter) {
									if (!JSInterpreter) {
										console_error(cache_key, "Unable to fetch JSInterpreter");
										return done(null, false);
									}
									var source = "var replacer = function(a) {" + sanitized + "}; replacer(a);";
									var cache = {};
									var replacer_wrap = function(n) {
										if (n in cache)
											return cache[n];
										var source = "var a = \"" + n + "\";var replacer = function(a) {" + sanitized + "}; replacer(a);";
										var interp = new JSInterpreter(source);
										var globalObject = interp.getGlobalScope().object;
										interp.run();
										cache[n] = interp.value;
										return interp.value;
									};
									return done(replacer_wrap, 60 * 60);
								});
							});
						});
					};
					var replace_n = function(n, cb) {
						api_cache.fetch("youtube_n:" + n, cb, function(done) {
							get_n_replacer(function(replacer) {
								if (!replacer)
									return done(n, false);
								done(replacer(n), 60 * 60);
							});
						});
					};
					if (player_response.streamingData) {
						if (player_response.streamingData.formats) {
							add_formats(player_response.streamingData.formats, false);
						}
						if (player_response.streamingData.adaptiveFormats) {
							add_formats(player_response.streamingData.adaptiveFormats, true);
						}
					}
					if (player_response.streamingData && player_response.streamingData.formats) {
						var formats = player_response.streamingData.formats;
						for (var j = 0; j < formats.length; j++) {
							var our_format = formats[j];
							if (our_format.bitrate > maxbitrate) {
								maxbitrate = our_format.bitrate;
								maxobj = our_format;
							}
						}
					}
					var subtitles = [];
					if (player_response.captions && player_response.captions.playerCaptionsTracklistRenderer &&
						player_response.captions.playerCaptionsTracklistRenderer.captionTracks) {
						var captionTracks = player_response.captions.playerCaptionsTracklistRenderer.captionTracks;
						for (var _i = 0, captionTracks_1 = captionTracks; _i < captionTracks_1.length; _i++) {
							var track = captionTracks_1[_i];
							var subtitle = {};
							subtitle.language_code = track.languageCode;
							if (track.name)
								subtitle.title = track.name.simpleText;
							subtitle.url = track.baseUrl + "&fmt=vtt";
							subtitle.mime = "text/vtt";
							subtitles.push(subtitle);
						}
					}
					var final = function() {
						if (available_formats.length === 0) {
							console_error("Unable to find any formats", player_response);
							return options.cb(obj);
						}
						var dashdata = {
							mimes: {}
						};
						var has_adaptive = false;
						var maxbitrate = 0;
						var maxobj = null;
						var baseobj = deepcopy(obj);
						baseobj.is_private = true;
						baseobj.headers = {
							Origin: "https://www.youtube.com",
							Referer: "https://www.youtube.com/"
						};
						for (var i = 0; i < available_formats.length; i++) {
							var our_format = available_formats[i];
							if (!our_format.url) {
								continue;
							}
							if (our_format.imu_is_adaptive) {
								var formatdash = {
									url: our_format.url,
									width: our_format.width,
									height: our_format.height,
									bandwidth: our_format.bitrate,
									id: our_format.itag,
									init_range: our_format.initRange,
									index_range: our_format.indexRange
								};
								var mime_match = our_format.mimeType.match(/^((?:video|audio)\/[^ /;]+);\s*codecs="([^"]+)"$/);
								if (!mime_match) {
									console_error("Unable to parse mime type", our_format.mimeType);
									continue;
								}
								formatdash.mime = mime_match[1];
								formatdash.codecs = mime_match[2];
								if (!formatdash.init_range) {
									continue;
								}
								if (/^av[0-9]+\./.test(formatdash.codecs))
									continue;
								if (!(formatdash.mime in dashdata.mimes))
									dashdata.mimes[formatdash.mime] = [];
								dashdata.mimes[formatdash.mime].push(formatdash);
							} else {
								if (our_format.bitrate > maxbitrate) {
									maxbitrate = our_format.bitrate;
									maxobj = our_format;
								}
							}
						}
						var urls = [];
						if (Object.keys(dashdata.mimes).length > 0) {
							dashdata.duration = duration;
							var dash = common_functions["create_dash_stream"](dashdata);
							var dashurl = "data:application/dash+xml," + encodeURIComponent(dash);
							urls.push({
								url: dashurl,
								video: {
									type: "dash",
									need_custom_xhr: true
								}
							});
						}
						if (maxobj && maxobj.url) {
							urls.push({
								url: maxobj.url,
								video: true
							});
						}
						if (subtitles.length) {
							for (var _i = 0, urls_2 = urls; _i < urls_2.length; _i++) {
								var url_1 = urls_2[_i];
								url_1.subtitles = subtitles;
							}
						}
						if (urls.length === 0) {
							if (has_sig) {
								console_warn("Encrypted/ciphered videos aren't supported");
							} else {
								console_error("Unknown streamingData object", maxobj);
							}
							return options.cb(obj);
						}
						return options.cb(fillobj_urls(urls, baseobj));
					};
					if (!maxobj) {
						console_error("Unable to find any formats", player_response);
						return options.cb(obj);
					}
					if (!videoid || !available_formats.length) {
						return final( /*maxobj*/);
					}
					common_functions["process_formats"](api_cache, options, available_formats, function() {
						get_n_replacer(function(replacer) {
							if (replacer) {
								for (var _i = 0, available_formats_1 = available_formats; _i < available_formats_1.length; _i++) {
									var format = available_formats_1[_i];
									if (!format.url)
										continue;
									if (/[?&]n=/.test(format.url)) {
										format.url = format.url.replace(/([?&]n=)([^&#]+)/, function(_, pre, n) {
											return pre + replacer(n);
										});
									}
								}
							}
							return final(maxobj);
						});
					});
				};
				common_functions["youtube_fetch_embed"](api_cache, options, id, function(data) {
					if (!data || !data.playabilityStatus || data.playabilityStatus.status === "UNPLAYABLE") {
						common_functions["youtube_fetch_watchpage"](api_cache, options, id, parse_player_response);
					} else {
						parse_player_response(data);
					}
				});
				return {
					waiting: true
				};
			}
		}
		if (domain === "images.attvideo.com") {
			match = src.match(/^[a-z]+:\/\/[^/]*\/+image\/+([^/]+)\/+[^/]*(?:[?#].*)?$/);
			if (match) {
				return "https://i.ytimg.com/vi/" + match[1] + "/mqdefault.jpg";
			}
		}
		if (domain_nowww === "phim24h.vn") {
			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" ||
			domain_nowww === "you2php.me") {
			if (/^[a-z]+:\/\/[^/]*\/+thumbnail\.php\?/.test(src)) {
				var queries = get_queries(src);
				var type = queries.type || "mqdefault";
				return "https://i.ytimg.com/vi/" + queries.vid + "/" + type + ".jpg";
			}
		}
		if (domain_nowww === "wapinda.in") return src.replace(/.*\/vimg\.php\?(?:.*?&)?v=([^&]*).*?$/, "https://i.ytimg.com/vi/$1/mqdefault.jpg");
		if (domain_nowww === "invidio.us" ||
			domain === "dev.invidio.us" ||
			domain === "yewtu.be" ||
			domain === "vid.puffyan.us" ||
			domain === "yt.artemislena.eu" ||
			domain === "invidious.flokinet.to" ||
			domain === "invidious.projectsegfau.lt" ||
			domain === "invidious.slipfox.xyz" ||
			domain === "invidious.privacydev.net" ||
			domain === "iv.melmac.space" ||
			domain === "iv.ggtyler.dev" ||
			domain === "invidious.lunar.icu" ||
			domain === "inv.nadeko.net" ||
			domain === "inv.tux.pizza" ||
			domain === "invidious.protokolla.fi" ||
			domain === "iv.nboeck.de" ||
			domain === "invidious.private.coffee" ||
			domain === "yt.drgnz.club" ||
			domain === "iv.datura.network" ||
			domain === "invidious.fdn.fr" ||
			domain === "invidious.perennialte.ch" ||
			domain === "yt.cdaut.de" ||
			domain === "invidious.drgns.space" ||
			domain === "inv.us.projectsegfau.lt" ||
			domain === "invidious.einfachzocken.eu" ||
			domain === "invidious.nerdvpn.de" ||
			domain === "inv.n8pjl.ca" ||
			domain === "youtube.owacon.moe" ||
			domain === "invidious.jing.rocks" ||
			domain === "vid.lilay.dev" ||
			domain === "inv.oikei.net" ||
			domain === "invidious.privacyredirect.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+(vi\/+.*?)(?:[?#].*)?$/, "https://i.ytimg.com/$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+ggpht\/+(.*?)(?:[?#].*)?$/, "https://lh4.ggpht.com/$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+watch\?(?:.*&)?v=([^&]+)(?:[&#].*)?$/,
				query_for_id: "https://" + domain + "/watch?v=${id}",
				process: function(done, resp, cache_key) {
					var obj = common_functions["get_videotag_obj"](resp);
					if (!obj)
						return done(null, false);
					return done(fillobj_urls(obj, {
						headers: {
							Referer: resp.finalUrl
						}
					}), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "image.bugsm.co.kr") {
			return src.replace(/\/images\/[0-9]*\//, "/images/original/").replace(/\?.*$/, "");
		}
		if (domain_nosub === "wp.com" &&
			domain.match(/i[0-9]\.wp\.com/)) {
			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 (domain_nosub === "pmdstatic.net") {
			var base = src.replace(/^[a-z]+:\/\/[^/]+\/+(?:fit|scale)\/+(https?\.3A[^/]+)\/.*/, "$1");
			if (base !== src) {
				base = base.replace(/\./g, "%");
				base = decodeURIComponent(base);
				return base;
			}
			match = src.match(/^[a-z]+:\/\/[^/]+\/+[a-z]+\/+~1~(voi)~([0-9]{4})~([0-9]{2})~([0-9]{2})~([-0-9a-f]+\.[a-z]+)\//);
			if (match) {
				return "https://i.pmdstatic.net/" + match[1] + "/" + match[2] + "/" + match[3] + "/" + match[4] + "/" + match[5];
			}
		}
		if (domain_nosub === "pmdstatic.net" && domain.match(/img\..*?pmdstatic\.net$/)) {
			newsrc = src.replace(/.*?\.pmdstatic\.net\/fit\/([^/]*).*/, "$1").replace(/\./g, "%");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain_nowww === "gala.fr") return src.replace(/^[a-z]+:\/\/[^/]+\/+imgre\//, "https://gal.img.pmdstatic.net/");
		if (domain_nowww === "programme.tv") {
			match = src.match(/\/imgre\/+(?:fit|scale)\/+~1~(tls|tel|gal)~([0-9]{4})~([0-9]{2})~([0-9]{2})~([-0-9a-f]{10,}\.[a-z]+)\//);
			if (match) {
				return "https://i.pmdstatic.net/" + match[1] + "/" + match[2] + "/" + match[3] + "/" + match[4] + "/" + match[5];
			}
			match = src.match(/\/imgre\/+(?:fit|scale)\/+(https?\.3A\.2F\.2F[^/]+)\//);
			if (match) {
				return src.replace(/^[a-z]+:\/\/[^/]+\/+imgre\/+/, "https://img.voi.pmdstatic.net/");
			}
		}
		if (domain === "dynaimage.cdn.cnn.com") {
			return decodeURIComponent(src.replace(/.*\/cnn\/[^/]*\//, ""));
		}
		if (domain === "wcmimages.ottawasun.com" ||
			domain === "wcmimages.torontosun.com" ||
			domain === "wcmimages.winnipegsun.com" ||
			domain === "wcmimages.edmontonjournal.com" ||
			src.match(/^[a-z]+:\/\/wcmimages\.[^/]*\/images\?url=http/)) {
			newsrc = decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/images.*?[?&]url=([^&]*).*/, "$1"));
			if (newsrc !== src)
				return newsrc;
		}
		if (host_domain_nosub === "yahoo.com" && string_indexof(host_domain, "search.") >= 0 && options.element) {
			if (options.element.parentElement && options.element.parentElement.tagName === "A") {
				match = options.element.parentElement.href.match(/^[a-z]+:\/\/[^/]*images\.search\.[^/]+\/+(?:search\/+images|images\/+view)(?:;.*?)\?(?:.*&)?imgurl=([^&]+)/);
				if (match) {
					newsrc = add_http(decodeURIComponent(match[1]));
					if (newsrc !== src)
						return newsrc;
				}
			}
		}
		if ((domain_nosub === "yimg.com" && domain.match(/^(?:[sl]|ct)[0-9]*\.yimg\.com/)) ||
			domain_nosub === "yahoo.com.tw") {
			newsrc = src
				.replace(/.*\/+..\/+api\/+res\/+1\.2\/+[^/]*\/[^/]*\/(https?:)\/{1,2}(.*?)(?:\.cf\.(?:jpg|webp))?$/, "$1//$2")
				.replace(/^http:\/\/l\.yimg\.com\//, "https://l.yimg.com/")
				.replace(/^([a-z]*:\/)([^/])/, "$1/$2")
				.replace(/(:\/\/[^/]*\/)x\/+r\/+[wh][0-9]+\/+i\/+/, "$1i/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "image.iol.co.za" ||
			domain === "image.tfgmedia.co.za") {
			newsrc = src.replace(/.*\/process\/.*\?.*source=([^&]*).*/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "image-prod.iol.co.za") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+(?:[0-9]+x[0-9]+|resize)\/+[0-9]+(?:x[0-9]+)?(?:\/+[^/]*)?\?(?:.*&)?source=([^&]+).*?$/, "$1");
			if (newsrc !== src) {
				newsrc = decodeuri_ifneeded(newsrc);
				if (!/:\/\/xlibris\.[^/]+\.infomaker\.io:/.test(newsrc)) {
					return newsrc;
				}
			}
		}
		if (domain_nosub === "squarespace.com" &&
			domain.match(/^static[0-9]*\.squarespace\.com/)) {
			newsrc = src.replace(/(?:\?.*)?$/, "?format=original");
			if (newsrc !== src)
				return {
					url: newsrc,
					head_wrong_contentlength: true
				};
		}
		if (domain === "images.squarespace-cdn.com") {
			var contenttype = get_queries(src)["content-type"];
			var queries_1 = {};
			if (contenttype)
				queries_1["content-type"] = contenttype;
			newsrc = src
				.replace(/\?.*/, "")
				.replace(/\/+[0-9]+w$/, "");
			var urls = [];
			queries_1.format = "original";
			urls.push(add_queries(newsrc, queries_1));
			queries_1.format = "2500w";
			urls.push(add_queries(newsrc, queries_1));
			delete queries_1.format;
			urls.push(add_queries(newsrc, queries_1));
			return urls;
		}
		if (domain_nosub === "sqspcdn.com") {
			if (/\/static\/+p\/+[0-9]+\/+[0-9]+\/+[0-9]+\//.test(src)) {
				return keep_queries(src, ["token"]);
			}
		}
		if (domain === "static.onecms.io") {
			newsrc = src.replace(/(\/wp-content\/+uploads\/+sites\/+[0-9]+\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[^/]+)-2000(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "watchdust.com") {
			if (/\/wp-content\/+uploads\/+[0-9]{4}\/+[0-9]{2}\/+EXPLORE-FEATURED-CONTENT_v2\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if ((domain_nosub === "wordpress.com" && string_indexof(domain, ".files.wordpress.com") >= 0) ||
			((domain_nosub === "imgix.net" ||
				domain === "imgix.bustle.com" ||
				domain === "imgix.ovp.tv2.dk" ||
				domain === "imgix.elitedaily.com" ||
				domain === "imgix.thezoereport.com" ||
				domain === "cdn-imgix-open.headout.com" ||
				domain === "images.assettype.com" ||
				domain === "media.assettype.com" ||
				domain === "images.seoghoer.dk" ||
				(domain === "static.camp-fire.jp" && string_indexof(src, "/uploads/") >= 0) ||
				domain === "media.popculture.com" ||
				(domain === "img.urbania.ca" && string_indexof(src, "/media/") >= 0) ||
				(domain === "images.thefacecdn.com" && string_indexof(src, "/images/") >= 0) ||
				(domain_nosub === "thenewslens.com" && /^image[0-9]*\./.test(domain)) ||
				domain === "imgix.kotaku.com.au" ||
				domain === "imgix.billedbladet.dk" ||
				domain === "imgix.elle.dk" ||
				domain === "imgix.romper.com") &&
				!src.match(/[?&]s=[^/]*$/)) ||
			domain === "stream-cloud-uploads.imgix.net" ||
			amazon_container === "hmg-prod" ||
			domain === "blogs-images.forbes.com" ||
			domain === "images-production.global.ssl.fastly.net" ||
			domain === "images-production.freetls.fastly.net" ||
			(domain_nowww === "fastly.com" && string_indexof(src, "/cimages/") >= 0) ||
			domain_nosub === "cdnds.net" ||
			/*domain.indexOf("hbz.h-cdn.co") >= 0 ||
			  string_indexof(domain, "cos.h-cdn.co") >= 0 ||*/
			domain_nosub === "h-cdn.co" ||
			domain === "cdn.newsapi.com.au" ||
			domain === "images.indianexpress.com" ||
			domain === "images.contentful.com" ||
			domain === "d.ibtimes.co.uk" ||
			domain === "akns-images.eonline.com" ||
			/*domain.indexOf("www.telegraph.co.uk") >= 0 ||
			domain === "subscriber.telegraph.co.uk" ||
			string_indexof(domain, "aws.telegraph.co.uk") >= 0 ||*/
			(domain_nosub === "telegraph.co.uk" && /\/(?:content\/+dam|multimedia\/+archive)\//.test(src)) ||
			domain === "img.buzzfeed.com" ||
			(domain_nosub === "126.net" && domain.match(/^p[0-9]*\.music\.126\.net/)) ||
			domain === "stat.profile.ameba.jp" ||
			domain === "stat.blogskin.ameba.jp" ||
			domain === "stat.ameba.jp" ||
			domain === "image.uczzd.cn" ||
			domain === "img.danawa.com" ||
			domain === "img-www.tf-cdn.com" ||
			domain_nosub === "viki.io" ||
			(domain_nosub === "githubusercontent.com" && domain.match(/^avatars[0-9]*\./)) ||
			(domain_nosub === "townnews.com" && domain.match(/bloximages\..*vip\.townnews\.com/)) ||
			domain === "steamuserimages-a.akamaihd.net" ||
			(domain_nosub === "pressassociation.io" && domain.match(/\.assets\.pressassociation\.io$/)) ||
			domain === "media.immediate.co.uk" ||
			domain === "images.immediate.co.uk" ||
			domain === "media.npr.org" ||
			domain === "assets.teamrock.com" ||
			(domain_nosub === "woopic.com" && domain.match(/^media[0-9]\.woopic\.com/)) ||
			(domain_nosub === "libe.com" && domain.match(/^md[0-9]\.libe\.com/)) ||
			domain === "medias.liberation.fr" ||
			domain === "regmedia.co.uk" ||
			domain === "imageservice.nordjyske.dk" ||
			(domain === "cms.algoafm.co.za" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "gosoutheast.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "nikkeibp.co.jp" && src.toLowerCase().match(/\.(?:jpg|png)/)) ||
			(domain_nosub === "best.gg" && domain.match(/s-a[0-9]*\.best\.gg/)) ||
			(domain_nosub === "walmartimages.com" && domain.match(/i[0-9]*\.walmartimages\.com/)) ||
			domain === "nails.newsela.com" ||
			domain === "ojsfile.ohmynews.com" ||
			domain === "lumiere-a.akamaihd.net" ||
			domain === "img.lum.dolimg.com" ||
			domain_nowww === "xxlmag.com" ||
			domain === "image.insider.com" ||
			domain === "i.insider.com" ||
			domain === "image.businessinsider.com" ||
			(domain_nosub === "vice.com" && domain.match(/images\.vice\.com$/)) ||
			((domain === "i.imgur.com" || domain === "i.imgur.io") && !src.match(/\?[0-9]+$/)) ||
			domain === "images.discordapp.net" ||
			domain === "images.theconversation.com" ||
			(domain_nowww === "rspb.org.uk" && string_indexof(src, "/globalassets/") >= 0) ||
			(domain === "media.beliefnet.com" && (/\/media\//i).test(src)) ||
			(domain_nowww === "ramblers.org.uk" && (/\/media\//i).test(src)) ||
			(domain === "warnerbrosuk.azureedge.net" && (/\/media\//i).test(src)) ||
			(domain_nowww === "warnerbros.co.uk" && (/\/media\//i).test(src)) ||
			(domain_nosub === "vietnamnet.vn" && /^(?:[^/]*\.)?img(?:\.cdn[0-9]*|s)\./.test(domain)) ||
			domain === "i.gadgets360cdn.com" ||
			domain_nosub === "ndtvimg.com" ||
			domain === "d3lp4xedbqa8a5.cloudfront.net" ||
			(domain_nowww === "brnow.org" && string_indexof(src, "/getattachment/") >= 0) ||
			(domain_nosub === "btime.com" && domain.match(/p[0-9]*\.(?:ssl\.)?cdn\.btime\.com/)) ||
			domain === "images.twistmagazine.com" ||
			domain === "sites.google.com" ||
			domain === "images.pexels.com" ||
			domain === "images.unsplash.com" ||
			domain_nosub === "r10s.com" ||
			domain_nosub === "r10s.jp" ||
			domain === "static.netlife.vn" ||
			domain === "rs.phunuonline.com.vn" ||
			domain === "images.nbcolympics.com" ||
			(domain === "dist.joshinweb.jp" && string_indexof(src, "/img/") >= 0) ||
			domain === "live-production.wcms.abc-cdn.net.au" ||
			domain === "compote.slate.com" ||
			domain_nosub === "gannett-cdn.com" ||
			(domain_nowww === "rdfm-radio.fr" && string_indexof(src, "/medias/") >= 0) ||
			(domain === "salleobscure.e-monsite.com" && string_indexof(src, "/medias/") >= 0) ||
			domain === "image-api.nrj.fr" ||
			domain === "api.hdwallpapers5k.com" ||
			(domain_nosub === "koreaportal.com" && domain.match(/images\.[^.]*\.koreaportal\.com/)) ||
			(domain_nowww === "officialcharts.com" && string_indexof(src, "/media/") >= 0) ||
			(domain_nowww === "citywonders.com" && string_indexof(src, "/media/") >= 0) ||
			(domain_nowww === "fee.org" && string_indexof(src, "/media/") >= 0) ||
			(domain_nosub === "agoda.net" && domain.match(/pix[0-9]*\.agoda\.net/)) ||
			domain === "images.pottermore.com" ||
			(domain_nowww === "google.com" && src.match(/\/photos\/public\/[^/]*$/)) ||
			domain === "images.streamable.com" ||
			domain === "cdn.amebaowndme.com" ||
			(domain_nowww === "kaixian.tv" && string_indexof(src, "/file/") >= 0) ||
			(domain === "sumo.cdn.tv2.no" && string_indexof(src, "/imageapi/") >= 0) ||
			(domain_nowww === "bzqzsj.com" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "media.missguided.com" ||
			domain === "photo.venus.com" ||
			domain === "cdn-images.prettylittlething.com" ||
			(domain_nowww === "sephora.com" && string_indexof(src, "/productimages/") >= 0) ||
			(domain_nowww === "popcrush.com" && string_indexof(src, "/files/") >= 0) ||
			(domain_nowww === "screencrush.com" && string_indexof(src, "/files/") >= 0) ||
			(domain_nosub === "nineentertainment.com.au" && domain.match(/assets\.[^.]*\.nineentertainment\.com\.au/)) ||
			(domain_nowww === "thenational.ae" && string_indexof(src, "/image/") >= 0) ||
			(domain_nowww === "dagsavisen.no" && string_indexof(src, "/image/") >= 0) ||
			(domain_nosub === "kh1.co" && domain.match(/s[0-9]*\.kh1\.co/)) ||
			domain === "uploads.disquscdn.com" ||
			(domain_nowww === "voidu.com" && string_indexof(src, "/gallery/") >= 0) ||
			(domain === "store.playstation.com" && string_indexof(src, "/image?") >= 0) ||
			(domain_nosub === "playstation.com" && /^blog\./.test(domain)) ||
			(domain_nowww === "snopes.com" && string_indexof(src, "/tachyon/") >= 0) ||
			domain === "images.interactives.dk" ||
			domain === "toyo-arhxo0vh6d1oh9i0c.stackpathdns.com" ||
			(domain_nowww === "zmonline.com" && string_indexof(src, "/media/") >= 0) ||
			domain === "cdn.instructables.com" ||
			domain === "images.performgroup.com" ||
			domain === "media.playmobil.com" ||
			domain === "img.crocdn.co.uk" ||
			(domain_nowww === "calgaryherald.com" && string_indexof(src, "/cms/") >= 0) ||
			(domain_nowww === "montrealgazette.com" && string_indexof(src, "/cms/") >= 0) ||
			(domain_nosub === "ikea.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "colorwallpaper.net" && string_indexof(src, "/img/") >= 0) ||
			domain === "img.cache.vevo.com" ||
			(domain === "drop.ndtv.com" && string_indexof(src, "/albums/") >= 0) ||
			(domain_nosub === "christiandaily.com" && string_indexof(domain, "images.christianitydaily.com") >= 0) ||
			domain === "cdn.christianitydaily.com" ||
			(domain_nosub === "christiandaily.co.kr" && string_indexof(domain, "images.christiandaily.co.kr") >= 0) ||
			domain === "images.christiantoday.co.kr" ||
			domain === "blogimg.goo.ne.jp" ||
			domain === "cdn.clien.net" ||
			(domain_nosub === "imgs.cc" && domain.match(/s[0-9]*\.imgs\.cc/)) ||
			(domain_nosub === "amebame.com" && string_indexof(domain, "stat.amebame.com") >= 0) ||
			domain === "cdn-hit.scadigital.io" ||
			(domain_nosub === "picsart.com" && domain.match(/cdn[0-9]*\.picsart\.com/)) ||
			domain === "cdn.ndtv.com" ||
			(domain_nosub === "kompasiana.com" && domain.match(/assets(?:-[a-z][0-9])?\.kompasiana\.com/)) ||
			domain === "images.popbuzz.com" ||
			(domain_nosub === "adis.ws" && domain.match(/i[0-9]*\.adis\.ws/)) ||
			(domain_nosub === "9c9media.com" && domain.match(/^images[0-9]*\.9c9media\.com/)) ||
			(domain_nosub === "newser.com" && domain.match(/img[0-9]*(?:-[a-z]+)?\.newser\.com/)) ||
			domain === "images.m-magazine.com" ||
			(domain_nowww === "zoom.co.uk" && src.match(/\/assets\/+images\/+/)) ||
			domain === "ctd-thechristianpost.netdna-ssl.com" ||
			domain === "img.vidible.tv" ||
			(domain_nosub === "j-14.com" && domain.match(/images\.(?:[a-z]+\.)?j-14\.com/)) ||
			domain === "cdn.abcotvs.com" ||
			(domain_nowww === "tasteofcountry.com" && string_indexof(src, "/files/") >= 0) ||
			domain === "images.thewest.com.au" ||
			(domain_nosub === "ntv.com.tr" && domain.match(/cdn[0-9]*\.ntv\.com\.tr/)) ||
			(domain_nosub === "hotnessrater.com" && domain.match(/img[0-9]*\.hotnessrater\.com/)) ||
			domain_nowww === "starcrush.com" ||
			(domain_nowww === "chrichri.dk" && string_indexof(src, "/media/") >= 0) ||
			(domain_nowww === "rightstufanime.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "teeshirtpalace.com" && /^images[0-9]*\./.test(domain)) ||
			domain === "assets.bigcartel.com" ||
			domain === "binaryapi.ap.org" ||
			domain === "images.8tracks.com" ||
			domain === "d2ykdu8745rm9t.cloudfront.net" ||
			(domain_nosub === "spoilercat.com" && domain.match(/cdn[0-9]*\.spoilercat\.com/)) ||
			(domain_nowww === "mumbailive.com" && string_indexof(src, "/images/") >= 0) ||
			domain === "static.juksy.com" ||
			domain === "img.reblog.hu" ||
			(domain_nowww === "thefw.com" && string_indexof(src, "/files/") >= 0) ||
			domain === "img.csfd.cz" ||
			(domain_nosub === "timesnownews.com" && /^img/.test(domain)) ||
			domain === "img.siksinhot.com" ||
			domain === "mp-seoul-image-production-s3.mangoplate.com" ||
			domain === "api.theweek.com" ||
			domain === "i.smalljoys.me" ||
			(domain_nosub === "huanqiu.cn" && domain.match(/t[0-9]*\.huanqiu.cn/)) ||
			(domain_nowww === "hypebeast.com" && string_indexof(src, "/image/") >= 0) ||
			(domain_nowww === "dramaguru.net" && string_indexof(src, "/images/") >= 0) ||
			domain === "sos.vfan.vlive.tv" ||
			(domain_nosub === "journalmedia.ie" && domain.match(/^img[0-9]*\./)) ||
			(domain_nosub === "thejournal.ie" && domain.match(/^img[0-9]*\./)) ||
			(domain === "external.polskieradio.pl" && string_indexof(src, "/files/") >= 0) ||
			domain === "thumb.netz.id" ||
			(domain_nosub === "tchyn.io" && string_indexof(src, "/snopes-production/uploads/") >= 0) ||
			domain === "img.diply.com" ||
			domain === "cdn-assets.ziniopro.com" ||
			domain === "netherlands-grlk5lagedl.stackpathdns.com" ||
			(domain_nosub === "stackpathdns.com" && string_indexof(domain, "-grlk5lagedl.stackpathdns.com") >= 0) ||
			(domain_nowww === "beautycrew.com.au" && string_indexof(src, "/media/") >= 0) ||
			(domain === "dsx.weather.com" && string_indexof(src, "/util/image/") >= 0) ||
			domain === "img.r7.com" ||
			domain === "cdn-images.rtp.pt" ||
			domain === "media.ouest-france.fr" ||
			domain === "images.pluto.tv" ||
			(domain_nowww === "rbsdirect.com.br" && string_indexof(src, "/imagesrc/") >= 0) ||
			((domain_nowww === "newfoundlandlabrador.com" ||
				domain_nowww === "mccormick.com" ||
				domain === "d1e3z2jco40k3v.cloudfront.net") && string_indexof(src, "/-/media/") >= 0) ||
			domain === "images.businessoffashion.com" ||
			(domain_nosub === "pg0.cn" && domain.match(/cmsfile\.pg0\.cn/)) ||
			domain === "api.ning.com" ||
			(domain_nosub === "mpinteractiv.ro" && domain.match(/^storage[0-9]*\./) && string_indexof(src, "/media/") >= 0) ||
			(domain_nosub === "muscache.com" && src.match(/\/im\/pictures\/[-0-9a-f]+\./)) ||
			(domain_nowww === "wedd.today" && string_indexof(src, "/wallpaper/") >= 0) ||
			(domain_nowww === "looklive.at" && src.match(/\/media\/[0-9]+\//)) ||
			domain === "t.tudocdn.net" ||
			(domain === "me.phununet.com" && string_indexof(src, "/resources/img/") >= 0) ||
			(domain === "cdn.diario26.com.ar" && string_indexof(src, "/media/image/") >= 0) ||
			(domain_nowww === "discovermagazine.com" && string_indexof(src, "/media/Images/") >= 0) ||
			domain === "steamusercontent-a.akamaihd.net" ||
			(domain_nowww === "qfeast.com" && string_indexof(src, "/imret/") >= 0) ||
			(domain === "statis.gamen.vn" && string_indexof(src, "/images/upload/") >= 0) ||
			domain === "img.anikore.jp" ||
			(domain_nosub === "newsplex.pt" && domain.match(/^cdn[0-9]*\./)) ||
			(domain === "static.origos.hu" && string_indexof(src, "/img/") >= 0) ||
			(domain === "cdn.nwmgroups.hu" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "robertocavada.com" && string_indexof(src, "/Images/") >= 0) ||
			domain === "images.mncdn.pl" ||
			(domain_nowww === "imgsearches.com" && string_indexof(src, "/i/") >= 0) ||
			(domain_nowww === "thetimesnews.com" && (string_indexof(src, "/storyimage/") >= 0 ||
				string_indexof(src, "/galleryimage/") >= 0)) ||
			domain === "static.fthis.gr" ||
			(domain === "img.pixelz.com" && string_indexof(src, "/blog/") >= 0) ||
			(domain_nosub === "hellomagazine.com" && (string_indexof(src, "/imagenes/") >= 0 || string_indexof(src, "/images/") >= 0)) ||
			domain === "images.hellomagazine.com" ||
			(domain_nosub === "1616.ro" && domain.match(/^i[0-9]*\./)) ||
			domain === "images.lifeandstylemag.com" ||
			(domain_nosub === "fonwall.ru" && domain.match(/^img[0-9]*\./)) ||
			(domain_nowww === "wonderwall.com" && string_indexof(src, "/photos/") >= 0) ||
			(domain_nowww === "thestar.com.my" && string_indexof(src, "/~/media/online/") >= 0) ||
			(domain_nowww === "vancouversun.com" && string_indexof(src, "/cms/") >= 0) ||
			(domain === "image.lag.vn" && string_indexof(src, "/upload/") >= 0) ||
			(domain_nowww === "booktrust.org.uk" && string_indexof(src, "/globalassets/images/") >= 0) ||
			(domain_nosub === "ccio.co" && domain.match(/^ind[0-9]*\./)) ||
			(domain_nosub === "cpcache.com" && domain.match(/^i[0-9]*\./)) ||
			domain === "i.rocdn.com" ||
			(domain === "resource.globenewswire.com" && string_indexof(src, "/Resource/Download/") >= 0) ||
			(domain_nowww === "townsquare.media" && src.match(/\/+site\/+[0-9]+\/+files\/+/)) ||
			domain === "images.reference.com" ||
			domain === "assets.pcmag.com" ||
			domain === "images.jg-cdn.com" ||
			(domain_nosub === "qingstor.com" && string_indexof(src, "/images/articles/") >= 0) ||
			domain === "img.ibxk.com.br" ||
			(domain === "image.biccamera.com" && string_indexof(src, "/img/") >= 0) ||
			(domain_nosub === "mu-mo.net" && string_indexof(src, "/image/") >= 0) ||
			(domain_nowww === "g-mark.org" && string_indexof(src, "/media/") >= 0) ||
			((domain === "kubrick.htvapps.com" || amazon_container === "htv-prod-media") && string_indexof(src, "/images/") >= 0) ||
			domain === "images.france.fr" ||
			(domain === "az877327.vo.msecnd.net" && string_indexof(src, "/media/images/") >= 0) ||
			(domain_nosub === "hoteljardinlebrea.com" && string_indexof(src, "/usermedia/") >= 0) ||
			(domain_nosub === "veltra.com" && domain.match(/^cdn[0-9]*\./)) ||
			(domain === "img.letgo.com" && string_indexof(src, "/images/") >= 0) ||
			(domain === "images.musement.com" && string_indexof(src, "/cover/") >= 0) ||
			domain === "i.playground.ru" ||
			(domain_nowww === "treeoftheyear.org" && string_indexof(src, "/getmedia/") >= 0) ||
			(domain_nowww === "dukeupress.edu" && string_indexof(src, "/getmedia/") >= 0) ||
			(domain_nowww === "canadashistory.ca" && string_indexof(src, "/getmedia/") >= 0) ||
			(domain === "cdn.indicium.nu" && string_indexof(src, "/source/grazia/") >= 0) ||
			domain === "news-img.51y5.net" ||
			(domain === "st.automobilemag.com" && string_indexof(src, "/uploads/sites/") >= 0) ||
			(domain === "styles.redditmedia.com" && string_indexof(src, "/styles/") >= 0) ||
			domain === "img.webmd.com" ||
			domain === "embedwistia-a.akamaihd.net" ||
			amazon_container === "ame-prod-redonline-assets" ||
			(domain_nowww === "noted.co.nz" && string_indexof(src, "/media/") >= 0) ||
			domain === "image.cnbcfm.com" ||
			domain === "images.newrepublic.com" ||
			(domain_nowww === "madametussauds.com" && string_indexof(src, "/media/") >= 0) ||
			(domain_nowww === "tirolerin.at" && string_indexof(src, "/media/") >= 0) ||
			(domain === "media.deseretdigital.com" && string_indexof(src, "/file/") >= 0) ||
			domain === "assets.audiomack.com" ||
			domain === "pic.rutube.ru" ||
			(domain === "cdn.marketplaceimages.windowsphone.com" && string_indexof(src, "/images/") >= 0) ||
			((domain === "dsocdn.akamaized.net" ||
				domain === "nbocdn.akamaized.net" ||
				domain === "avecdn.akamaized.net" ||
				domain === "static.hbvl.be" ||
				domain === "static.standaard.be" ||
				domain === "limnlcdn.akamaized.net") && /\/Assets\/+Images_Upload\//i.test(src)) ||
			(domain === "netstorage-nur.akamaized.net" && string_indexof(src, "/images/") >= 0) ||
			domain === "images.moviebuff.com" ||
			domain === "static-ugc-media.hk01.com" ||
			(domain_nowww === "warwick.film" && string_indexof(src, "/image/") >= 0) ||
			(domain_nowww === "quizizz.com" && src.match(/\/media\/+resource\/+/)) ||
			(domain_nowww === "eroce.com" && string_indexof(src, "/img/") >= 0) ||
			(domain === "img-cdn.hipertextual.com" && string_indexof(src, "/files/") >= 0) ||
			(domain === "img.ponparemall.net" && string_indexof(src, "/imgmgr/") >= 0) ||
			(domain === "smart.usen.com" && string_indexof(src, "/data/") >= 0) ||
			domain === "img.digitaldjpool.com" ||
			(domain_nosub === "szn.cz" && domain.match(/\.sdn\./) && string_indexof(src, "_img_") >= 0) ||
			(domain_nowww === "banana1015.com" && string_indexof(src, "/files/") >= 0) ||
			(domain_nowww === "mix106radio.com" && string_indexof(src, "/files/") >= 0) ||
			(domain === "static-cdn.sr.se" && string_indexof(src, "/images/") >= 0) ||
			(domain === "cdn.kaumo.jp" && string_indexof(src, "/element/") >= 0) ||
			(domain === "d12swbtw719y4s.cloudfront.net" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "saplinghr.com" && string_indexof(src, "/hubfs/") >= 0) ||
			(domain === "telefe-static2.akamaized.net" && string_indexof(src, "/media/") >= 0) ||
			domain_nowww === "10daily.com.au" ||
			(domain === "spark.adobe.com" && string_indexof(src, "/page/") >= 0) ||
			(domain === "blog.adobe.com" && /:\/\/[^/]+\/+(?:[a-z]+_)?[0-9a-f]{20,}\./.test(src)) ||
			(domain === "s.w-x.co" && string_indexof(src, "/image/") >= 0) ||
			domain === "img.monocle.com" ||
			(domain === "bildix.mmcloud.se" && /\/bildix\/+api\/+images\/+/.test(src)) ||
			(domain === "media.cinedb.com.tr" && /\/Upload\//i.test(src)) ||
			(domain_nowww === "newidea.com.au" && string_indexof(src, "/media/") >= 0) ||
			(domain_nowww === "essexstudent.com" && /\/asset\//i.test(src)) ||
			(domain === "d.newsweek.com" && string_indexof(src, "/full/") >= 0) ||
			(domain === "images.techtimes.com" && /\/data\/+images\/+/.test(src)) ||
			domain === "oyster.ignimgs.com" ||
			(domain_nowww === "marieclaire.com.au" && string_indexof(src, "/media/") >= 0) ||
			(domain_nowww === "stylist.co.uk" && /\/images\/+app\/+uploads\/+/.test(src)) ||
			(domain_nowww === "britishfashioncouncil.co.uk" && string_indexof(src, "/uploads/") >= 0) ||
			(domain === "static.fptplay.net" && string_indexof(src, "/img/") >= 0) ||
			domain === "images-mega.mdstrm.com" ||
			(domain_nowww === "girlfriend.com.au" && string_indexof(src, "/media/") >= 0) ||
			domain === "imgs.ngaotruyen.com" ||
			(domain === "d1ywb8dvwodsnl.cloudfront.net" && /\/files\.fuzoku\.jp\/+img\//.test(src)) ||
			(domain_nowww === "menshealth.com.au" && string_indexof(src, "/media/") >= 0) ||
			(domain === "2sao.vietnamnetjsc.vn" && string_indexof(src, "/images/") >= 0) ||
			(domain === "images.jkn.co.kr" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "instylemag.com.au" && string_indexof(src, "/media/") >= 0) ||
			(domain_nowww === "who.com.au" && /\/media\/+[0-9]+\//.test(src)) ||
			domain === "i.eurosport.com" ||
			(domain === "blog.wirelessanalytics.com" && string_indexof(src, "/hubfs/") >= 0) ||
			(domain_nosub === "zmtcdn.com" && string_indexof(src, "/data/") >= 0) ||
			(domain === "images.mubi.com" && string_indexof(src, "/images/") >= 0) ||
			domain === "i.obozrevatel.com" ||
			(domain_nosub === "paytm.com" && /^assetscdn[0-9]*\./.test(domain)) ||
			domain === "images.perthnow.com.au" ||
			(domain === "netstorage-yen.akamaized.net" && string_indexof(src, "/images/") >= 0) ||
			domain === "static.nexilia.it" ||
			(domain_nosub === "eldia.com" && /^cdn[0-9]*\./.test(domain)) ||
			(domain_nowww === "esquire.com.gr" && /\/Content\/+ImagesDatabase\//i.test(src)) ||
			domain === "akmedia.hollywoodlife.com" ||
			(domain_nowww === "refinery29.com" && string_indexof(src, "/images/") >= 0) ||
			(domain === "images.radio.com" && string_indexof(src, "/aiu-media/") >= 0) ||
			(domain_nowww === "casseycds.net" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "youmekorea.com" && /[?&]thumb=/.test(src)) ||
			(domain_nosub === "tower.jp" && /\/~\/+media\//.test(src)) ||
			domain === "images.boosty.to" ||
			domain === "media.nbcnewyork.com" ||
			domain_nosub === "sdn.cz" ||
			(domain_nosub === "unrealengine.com" && /^cdn[0-9]*\./.test(domain)) ||
			(domain === "cdn.repub.ch" && string_indexof(src, "/republik-assets/") >= 0) ||
			(domain_nowww === "smarthomebeginner.com" && string_indexof(src, "/images/") >= 0) ||
			domain === "images.ask.com" ||
			(domain === "i.vimeocdn.com" && /\/(?:video|custom_asset)\//.test(src)) ||
			domain === "artwork.jaxsta.com" ||
			(domain_nowww === "tisamipo.co.il" && string_indexof(src, "/CMSGALLERY/") >= 0) ||
			(domain === "images.shakespearesglobe.com" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "cdn.hashnode.com" ||
			domain === "d31wcbk3iidrjq.cloudfront.net" ||
			domain === "marketplace-screenshots.githubusercontent.com" ||
			domain === "stmedia.stimg.co" ||
			(domain_nosub === "coppel.com" && /^cdn[0-9]*\./.test(domain) && /\/images\//.test(src)) ||
			(domain === "dynamicmedia.livenationinternational.com" && /:\/\/[^/]+\/+media\//i.test(src)) ||
			(domain === "cdn.sanity.io" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "e-outdoor.co.uk" && string_indexof(src, "/pi/") >= 0) ||
			(domain_nosub === "disco-api.com" && /images\./.test(domain)) ||
			(domain_nowww === "devold.com" && /\/globalassets\/+catalog-images\//.test(src)) ||
			domain === "contents.mediadecathlon.com" ||
			domain === "ubiservices.cdn.ubi.com" ||
			domain === "feeds.abplive.com" ||
			domain === "images.thequint.com" ||
			domain === "images.prismic.io" ||
			(domain === "files.vierlive.io" && string_indexof(src, "/images/") >= 0) ||
			domain === "assets.isu.pub" ||
			(domain === "img.nbc.com" && /\/files\/+images\//.test(src)) ||
			(domain === "kake.images.worldnow.com" && string_indexof(src, "/images/") >= 0) ||
			domain_nowww === "datocms-assets.com" ||
			domain === "cdn.amomama.com" ||
			domain === "images.ardmediathek.de" ||
			(domain === "api.ardmediathek.de" && /\/image-service\/+images\//.test(src)) ||
			domain === "i.weltbild.de" ||
			domain === "images-static.nykaa.com" ||
			((domain_nowww === "familyvideo.com" ||
				domain_nosub === "coca-cola.com" ||
				(domain_nosub === "asus.com" && /store\./.test(domain)) ||
				domain === "doa.robinson.co.th")
				&& /\/media\/+catalog\//.test(src)) ||
			domain === "media.littlewoodsireland.ie" ||
			domain === "media.littlewoods.com" ||
			domain === "media.very.co.uk" ||
			(domain_nowww === "prodirectrunning.com" && string_indexof(src, "/ProductImages/") >= 0) ||
			(domain_nowww === "studywalker.jp" && string_indexof(src, "/images/") >= 0) ||
			(domain === "repo.packix.com" && /\/api\/+Packages\/+[0-9a-f]{10,}\/+icon\//.test(src)) ||
			domain === "new.static.tv.nu" ||
			domain === "cdn.royalcanin-weshare-online.io" ||
			domain === "images.stockx.com" ||
			(domain === "img.paravi.jp" && string_indexof(src, "/files/") >= 0) ||
			domain === "runningbare-cdn.global.ssl.fastly.net" ||
			domain_nosub === "ostkcdn.com" ||
			domain === "media.dior.com" ||
			(domain === "netstorage-legit.akamaized.net" && string_indexof(src, "/images/") >= 0) ||
			domain === "images.dn.no" ||
			(domain === "cash-images-f.squarecdn.com" && /\/apps\/+imgs\//.test(src)) ||
			(domain === "blog.hubspot.com" && /\/hubfs\//.test(src)) ||
			domain === "cdn.waplog.com" ||
			(domain === "wiki.lycanitesmobs.com" && /\/_media\//.test(src)) ||
			domain === "image.pbs.org" ||
			domain === "fyre.cdn.sewest.net" ||
			domain === "image.uniqlo.com" ||
			domain === "imgc.nxtv.jp" ||
			domain === "vcdn.polarismedia.no" ||
			domain === "thumbnails.cbc.ca" ||
			domain === "media.nbcchicago.com" ||
			(domain === "cdn.mopo.de" && /\/uploads\//.test(src)) ||
			domain === "images.nordbayern.de" ||
			(domain_nowww === "sportsbusinessjournal.com" && /\/-\/+media\/+Images\//i.test(src)) ||
			(domain_nowww === "newschainonline.com" && /\/bsp-static\//.test(src)) ||
			domain === "images.berliner-kurier.de" ||
			(domain === "cdn.nba.com" && /\/manage\//.test(src)) ||
			domain_nowww === "sportal365images.com" ||
			(domain === "cdn.unitycms.io" && /\/images\//.test(src)) ||
			domain === "img.nzz.ch" ||
			domain === "media.necn.com" ||
			(domain_nowww === "nzxt.com" && /\/assets\/+cms\//.test(src)) ||
			(domain_nowww === "eposaudio.com" && /\/globalassets\/+__pim\//.test(src)) ||
			domain === "static.okko.tv" ||
			(domain === "news.leicester.gov.uk" && /\/media\//.test(src)) ||
			domain === "chorus.stimg.co" ||
			(domain_nowww === "fssochi.ru" && /\/content\/+cms\/+files\//.test(src)) ||
			(domain === "i.gremicdn.pl" && /\/image\/+free\//.test(src)) ||
			domain === "images.getbento.com" ||
			(domain_nowww === "christies.com" && string_indexof(src, "/img/") >= 0) ||
			domain === "bmg-images.forward-publishing.io" ||
			(domain === "image-via.katsomo.fi" && /\/api\/+v2\/+img\//.test(src)) ||
			(domain === "img.plasmic.app" && /\/img-optimizer\/+v1\//.test(src)) ||
			domain === "d2kq0urxkarztv.cloudfront.net" ||
			(domain_nowww === "peacocktv.com" && /\/dam\/+[^/]+\/+assets\//.test(src)) ||
			(domain === "m.hng.io" && /\/catalog\/+product\//.test(src)) ||
			domain === "uploads.dailydot.com" ||
			domain === "images.audacy2-prod.ext.audacy.com" ||
			domain === "phinf.wevpstatic.net" ||
			domain === "prod-images.tcm.com" ||
			domain === "media.redbullmusicacademy.com" ||
			(domain === "s3media.247sports.com" && string_indexof(src, "/Uploads/") >= 0) ||
			(domain_nowww === "eva.ru" && string_indexof(src, "/imgix/") >= 0) ||
			domain === "assets.goal.com" ||
			(domain === "imgs.casasbahia.com.br" && /:\/\/[^/]+\/+[0-9]+\/+[0-9]+[a-z]+\./.test(src)) ||
			domain === "imgr.starmag.com" ||
			(domain === "cdn.thewirecutter.com" && /\/wp-content\/+media\//.test(src)) ||
			(domain === "files.ekmcdn.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "highsnobiety.com" && string_indexof(src, "/static-assets/") >= 0) ||
			(domain === "cdn.kodansha.us" && string_indexof(src, "/statics/") >= 0) ||
			domain === "assetsio.reedpopcdn.com" ||
			(domain_nowww === "sony.com" && /\/image\/+[0-9a-f]{5,}\?/.test(src)) ||
			domain === "ugc.production.linktr.ee" ||
			(domain === "s13emagst.akamaized.net" && /\/products\/+[0-9]+\/+[0-9]+\/+images\//.test(src)) ||
			(domain === "content.api.news" && /\/v3\/+images\/+bin\/+[0-9a-f]{10,}/.test(src)) ||
			(domain_nowww === "panasonic.com" && /\/content\/+dam\//.test(src)) ||
			domain === "images.komi.io" ||
			(domain_nosub === "mi-img.com" && /\.api\./.test(domain)) ||
			(domain === "groundnews.b-cdn.net" && /\/assets\/+web\/+images\//.test(src)) ||
			domain === "images.pangobooks.com" ||
			domain === "assets.mmsrg.com" ||
			domain === "images.moviesanywhere.com" ||
			(domain === "d1kq2dqeox7x40.cloudfront.net" && /\/images\//.test(src)) ||
			domain_nowww === "nouwcdn.com" ||
			domain === "eh96lnrmau.user-space.cdn.idcfcloud.net" ||
			(domain_nowww === "lego.com" && /\/cdn\/+.*\/assets\//.test(src)) ||
			(domain === "images.delfi.ee" && /\/media-api-image-cropper\//.test(src)) ||
			domain === "img.br.de" ||
			domain === "images.prod.hjholdings.tv" ||
			domain === "img.haarets.co.il" ||
			(domain_nowww === "wnoz.de" && /\/imgs\//.test(src)) ||
			domain === "assets.steadyhq.com" ||
			((domain === "eu-images.contentstack.com" ||
				domain === "images.blz-contentstack.com")
				&& /\/v3\/+assets\//.test(src)) ||
			domain === "img.projektn.sk" ||
			(domain === "images.daznservices.com" && /\/di\/+library\//.test(src)) ||
			domain_nowww === "thetv.jp" ||
			(domain === "metac.nxtv.jp" && /\/img\//.test(src)) ||
			(domain === "media.victorinox.com" && string_indexof(src, "/transform/") >= 0) ||
			domain === "image.heavenly.tv" ||
			domain === "images.footballfanatics.com" ||
			domain === "stat.dokusho-ojikan.jp" ||
			(domain_nowww === "savannahnow.com" && string_indexof(src, "/gcdn/") >= 0) ||
			(domain === "cdn.leonardo.ai" && /\/generations\//.test(src)) ||
			(domain_nosub === "sozcucdn.com" && /^sozcu[0-9]*\./.test(domain) && /\/uploads\/+images\//.test(src)) ||
			domain === "prcdn.freetls.fastly.net" ||
			(domain_nowww === "filmfest-muenchen.de" && string_indexof(src, "/Pictures/") >= 0) ||
			domain === "cdn.hobbyconsolas.com" ||
			(domain_nowww === "nottingham.ac.uk" && /\/images\//i.test(src)) ||
			(domain_nowww === "catholicnewsagency.com" && /\/storage\/+image\//.test(src)) ||
			(domain === "cdn.ferrari.com" && /\/media\/+img\//.test(src)) ||
			(domain_nowww === "otempo.com.br" && /\/dynamicmedia\/+deliver\//.test(src)) ||
			domain === "assetsio.gnwcdn.com" ||
			(domain_nowww === "azcentral.com" && /\/gcdn\//.test(src)) ||
			domain === "images.kerrangcdn.com" ||
			(domain_nowww === "cso.org" && /\/media\//.test(src)) ||
			src.match(/\/demandware\.static\//) ||
			src.match(/\?i10c=[^/]*$/) ||
			/^[a-z]+:\/\/[^?]*\/wp(?:-content\/+(?:uploads|blogs.dir)|\/+uploads)\//.test(src)
		/*src.indexOf("/wp-content/blogs.dir/") >= 0 ||
		string_indexof(src, "/wp-content/uploads/") >= 0 ||
		string_indexof(src, "/wp/uploads/") >= 0*/ ) {
			src = src.replace(/\?.*$/, "");
		}
		if (domain === "cdn.odigo.net" ||
			domain === "wangsuimg.fanshuapp.com" ||
			domain === "img.aiji66.com" ||
			domain === "imgs.aixifan.com" ||
			domain === "imgcdn.thecover.cn" ||
			domain === "img.shelive.net" ||
			domain === "img.qdaily.com" ||
			domain === "qimage.owhat.cn" ||
			domain === "cdn.ruguoapp.com" ||
			(domain === "user-assets.sxlcdn.com" && string_indexof(src, "/images/") >= 0) ||
			domain === "img.ksl.com" ||
			(domain_nosub === "tapimg.com" && domain.match(/^img[0-9]*\./)) ||
			domain === "7xka0y.com1.z0.glb.clouddn.com" ||
			(domain_nosub === "mafengwo.net" && domain.match(/^[a-z][0-9]*(?:-[a-z])?\./)) ||
			(domain_nosub === "myqcloud.com" && domain.match(/image\.myqcloud\.com/)) ||
			domain === "ci.xiaohongshu.com" ||
			domain === "pic.qianye88.com" ||
			(domain_nosub === "yohobuy.com" && domain.match(/^img[a-z]*[0-9]*\.yohobuy\.com$/)) ||
			(domain_nosub === "715083.com" && domain.match(/^i-[0-9]*-yxdown\./)) ||
			(domain_nosub === "yxdown.com" && domain.match(/^i-[0-9]*\./)) ||
			(domain === "jkcdn.pajk.com.cn" && string_indexof(src, "/image/") >= 0) ||
			(domain_nosub === "hola.com" && string_indexof(src, "/imagenes/") >= 0) ||
			(domain === "static.leiphone.com" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "static-movie.a.88cdn.com" ||
			(domain === "image.qianye88.com" && string_indexof(src, "/pic/") >= 0) ||
			domain === "pc.wangpan.xycdn.n0808.com" ||
			domain === "resource.meihua.info" ||
			domain === "i.ezbuy.sg" ||
			domain === "i.guancha.cn" ||
			domain === "pic.xcarimg.com" ||
			domain === "upload-images.jianshu.io" ||
			domain === "mz.eastday.com" ||
			domain === "s.isanook.com" ||
			domain_nosub === "fengimg.com") {
			src = src.replace(/\?.*$/, "");
		}
		if ((domain_nosub === "tradesy.com" && domain.match(/^item[0-9]*\.tradesy/) && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "birminghamworld.uk" && /\/jpim-static\/+image\//.test(src)) ||
			(domain_nowww === "nationalworld.com" && /\/jpim-static\/+image\//.test(src)) ||
			(domain === "digitalcontent.api.tesco.com" && /\/v2\/+media\//.test(src)) ||
			(domain === "gitlab.winehq.org" && /\/uploads\/+/.test(src)) ||
			domain === "cdn.hfashionmall.com" ||
			(domain === "steamcommunity-a.akamaihd.net" && string_indexof(src, "/image/") >= 0) ||
			domain === "media-assets.grailed.com" ||
			(domain_nosub === "ztat.net" && /^img[0-9]*\./.test(domain))) {
			return {
				url: src.replace(/\?.*$/, ""),
				can_head: false
			};
		}
		if (domain === "img-static.tradesy.com") return src.replace(/:\/\/[^/]+\/+item\/+([0-9]+)\/+([^/]+)(-[0-9]+-[0-9]+)-[0-9]+-[0-9]+(\.[^/.?]+)(?:[?#].*)?$/, "://item4.tradesy.com/images/$2-$1$3$4");
		if (domain === "store-images.microsoft.com" ||
			domain === "store-images.s-microsoft.com") {
			return {
				url: src.replace(/\?.*$/, ""),
				head_wrong_contenttype: true
			};
		}
		if (domain_nowww === "dailyherald.com") {
			newsrc = src.replace(/[?&].*$/, "");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "billboard.com" && /static\./.test(domain)) {
			newsrc = src
				.replace(/(\/img\/+[0-9]{4}\/+[0-9]{2}\/+[^/]+-)240x240\./, "$1480x480.")
				.replace(/(\/img\/+[0-9]{4}\/+[0-9]{2}\/+[^/]+-)155x155\./, "$1240x240.");
			if (newsrc !== src)
				return newsrc;
		}
		if ((domain_nowww === "elindependiente.com" ||
			domain_nowww === "stadtlandmama.de" ||
			domain_nowww === "5min.at" ||
			domain_nowww === "fantasytopics.com") && /\/wp-content\/+uploads\//.test(src) ||
			(domain_nowww === "mmerevise.co.uk" && /\/app\/+uploads\//.test(src))) {
			return src
				.replace(/(\.[a-z]+)\.webp([?#].*)?$/, "$1$2")
				.replace(/-[0-9]+x[0-9]+(\.[^/.]+(?:[?#].*)?)$/, "$1");
		}
		if (domain_nowww === "collectivegen.com" && /\/wp-content\/+uploads\//.test(src)) {
			return src.replace(/-[0-9]+x[0-9]+(?:@[0-9]+x)?(\.[^/.]+(?:[?#].*)?)$/, "$1");
		}
		if (domain_nosub === "imimg.com" ||
			domain === "blogs-images.forbes.com" ||
			domain === "static.thesuperficial.com" ||
			domain === "static.celebuzz.com" ||
			domain === "img.vogue.co.kr" ||
			domain === "static.spin.com" ||
			domain_nowww === "zrockr.com" ||
			domain_nowww === "electricegg.co.uk" ||
			(domain_nowww === "iphone7wallpapers.co" && /\/media\/+uploads\//.test(src)) ||
			(domain_nowww === "androidhdwallpapers.com" && /\/media\/+uploads\//.test(src)) ||
			(domain_nosub === "hw-static.com" && domain.match(/www\.media[0-9]*\.hw-static\.com/)) ||
			(domain_nosub === "turner.com" && /^i[0-9]*\.cdn\./.test(domain)) ||
			domain_nowww === "k99.com" ||
			domain_nowww === "97rockonline.com" ||
			domain_nowww === "wfgr.com" ||
			domain_nowww === "wblk.com" ||
			domain_nowww === "fun107.com" ||
			domain_nowww === "965viki.com" ||
			domain_nowww === "1079ishot.com" ||
			domain === "edge.alluremedia.com.au" ||
			(amazon_container === "blogs-prod-media" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "d36tnp772eyphs.cloudfront.net" ||
			domain === "img.allurekorea.com" ||
			domain_nowww === "psu.com" ||
			domain === "media.popculture.com" ||
			domain_nowww === "rap-up.com" ||
			(domain_nowww === "funweek.it" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nosub === "hankyung.com" && domain.match(/img\..*?\.hankyung\.com$/)) ||
			domain_nowww === "traveltipy.com" ||
			domain_nowww === "coveteur.com" ||
			amazon_container === "gaffa-prod" ||
			(domain_nosub === "ehow.com" && string_indexof(domain, ".blog.ehow.com") >= 0) ||
			(domain_nosub === "theheartysoul.com" && domain.match(/cdn[0-9]*\.theheartysoul\.com/)) ||
			domain_nowww === "bandt.com.au" ||
			(domain_nosub === "theepochtimes.com" && src.match(/\/assets\/+uploads\/+/)) ||
			(domain_nosub === "gamme.com.tw" && /^images[0-9]*\./.test(domain)) ||
			domain === "images.gamme.com.cn" ||
			domain === "cdn.hoahoctro.vn" ||
			domain === "vnn-imgs-f.vgcloud.vn" ||
			domain === "static.vibe.com" ||
			(domain_nowww === "rightsinfo.org" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "spotted.tv" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "tokyopopline.com" && string_indexof(src, "/images/") >= 0) ||
			domain === "px1img.getnews.jp" ||
			domain === "media.thetab.com" ||
			domain === "assets.rockpapershotgun.com" ||
			(domain_nosub === "vietnamnet.vn" && /^(?:[^/]*\.)?img(?:\.cdn[0-9]*|s)\./.test(domain)) ||
			domain === "sloanreview.mit.edu" ||
			(domain_nosub === "inquirer.net" && string_indexof(src, "/files/") >= 0) ||
			domain === "static.thefrisky.com" ||
			domain === "hobby.dengeki.com" ||
			domain === "cdn-blog.adafruit.com" ||
			(domain_nosub === "uuhy.com" && domain.match(/s?img\.uuhy\.com/)) ||
			domain === "img.butongshe.com" ||
			(domain_nowww === "myreco.asia" && string_indexof(src, "/uploads/") >= 0) ||
			(domain === "d3p157427w54jq.cloudfront.net" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "cdn.harpersbazaar.com.sg" ||
			domain === "media.harpersbazaar.com.sg" ||
			domain_nosub === "myconfinedspace.com" ||
			amazon_container === "hiphopdx-production" ||
			domain === "assets.wonderlandmagazine.com" ||
			(domain_nosub === "akamaized.net" && domain.match(/^am[0-9]*\./) && /\/tms\/+cnt\/+uploads\//.test(src)) ||
			(domain_nosub === "pressassociation.io" && string_indexof(domain, "static.pressassociation.io") >= 0) ||
			domain === "assets.vg247.com" ||
			(domain_nowww === "theblemish.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "dailyxtra.com" && /\/content\/+uploads\//.test(src)) ||
			domain === "media.metrolatam.com" ||
			domain === "media.comicbook.com" ||
			domain_nowww === "grazia.it" ||
			domain === "img.kpopmap.com" ||
			domain === "s.nbst.gr" ||
			domain === "assets.metrolatam.com" ||
			domain_nosub === "mthai.com" ||
			domain === "cdn.webnoviny.sk" ||
			domain === "bloggar.expressen.se" ||
			(domain_nosub === "saostar.vn" && domain.match(/img[0-9]*\.saostar\.vn/)) ||
			(domain_nosub === "gossipcop.com" && domain.match(/s[0-9]*\.gossipcop\.com/)) ||
			(domain_nowww === "petapixel.com" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "d3i6fh83elv35t.cloudfront.net" ||
			domain === "d17fnq9dkz9hgj.cloudfront.net" ||
			domain === "images.everyeye.it" ||
			googlestorage_container === "koreaboo-cdn" ||
			(domain_nowww === "behindzscene.net" && string_indexof(src, "/file/") >= 0) ||
			(domain_nowww === "hipertextual.com" && string_indexof(src, "/files/") >= 0) ||
			(domain_nowww === "geeksofdoom.com" && string_indexof(src, "/img/") >= 0) ||
			domain === "newsimages.fashionmodeldirectory.com" ||
			domain === "img.blogtamsu.vn" ||
			(domain_nosub === "starsdaily.net" && domain.match(/cdn[0-9]+\.starsdaily\.net/)) ||
			(domain_nowww === "nextnature.net" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "vooks.net" && string_indexof(src, "/img/") >= 0) ||
			domain === "i.ido.bi" ||
			domain === "cdn.techgyd.com" ||
			(domain_nowww === "4girls.co.il" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "gceleb.com" && string_indexof(src, "/photo/") >= 0) ||
			(domain_nowww === "seriouseats.com" && string_indexof(src, "/images/") >= 0) ||
			domain === "i.epochtimes.com" ||
			domain === "cdn.thammysen.vn" ||
			domain === "d1lofqbqbj927c.cloudfront.net" ||
			(domain_nowww === "180grados.com.mx" && string_indexof(src, "/img/") >= 0) ||
			domain === "photo.tin8.co" ||
			(domain_nosub === "whatculture.com" && domain.match(/^cdn[0-9]*\.whatculture\.com/) && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "electronicbeats.net" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "media.iconsingapore.com" ||
			domain === "p.cosmopolitan.bg" ||
			domain === "cache.pakistantoday.com.pk" ||
			domain === "media.breitbart.com" ||
			domain === "s.rozali.com" ||
			domain === "s.sdgcdn.com" ||
			(domain === "ticket.heraldtribune.com" && string_indexof(src, "/files/") >= 0) ||
			domain === "blog.hola.com" ||
			(domain_nowww === "therussiantimes.com" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "static.idolator.com" ||
			domain === "images.saloona.co.il" ||
			(domain_nowww === "bellezaenvena.com" && string_indexof(src, "/my_uploads/") >= 0) ||
			(domain_nosub === "thejournal.ie" && string_indexof(src, "/media/") >= 0) ||
			domain_nowww === "tvperson.ru" ||
			domain_nowww === "iwantpix.com" ||
			domain_nowww === "nudemodelpics.com" ||
			(domain === "images.chr.bg" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "woman.ua" && string_indexof(src, "/file/images/") >= 0) ||
			domain === "gdsit.cdn-immedia.net" ||
			domain_nowww === "cseditors.com" ||
			(domain_nowww === "imcdn.org" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "t.a4vn.com" ||
			domain_nowww === "dodskypict.com" ||
			domain === "files.dals.media" ||
			domain === "cdn.crhoy.net" ||
			domain_nowww === "longwallpapers.com" ||
			domain === "files.greatermedia.com" ||
			(domain_nowww === "tsundora.com" && string_indexof(src, "/image/") >= 0) ||
			(domain_nosub === "twitch.tv" && domain.match(/^clips-media-assets[0-9]*\./) && src.match(/-preview-[0-9]+x[0-9]+\.[^/.]*$/)) ||
			(domain === "file.immo.vlan.be" && string_indexof(src, "/Image/Wordpress/") >= 0) ||
			domain === "media.trud.bg" ||
			(domain_nowww === "rotativo.com.mx" && string_indexof(src, "/assets/") >= 0) ||
			(domain_nowww === "chfi.com" && string_indexof(src, "/wp-content/") >= 0) ||
			googlestorage_container === "sin-cdn" ||
			domain === "cdn.appleigeek.com" ||
			domain === "media.cnnchile.com" ||
			(domain_nowww === "festivalteen.com.br" && string_indexof(src, "/uploads/") >= 0) ||
			(amazon_container === "rhodiesworld" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "ntdtv.kr" && string_indexof(src, "/assets/") >= 0) ||
			domain === "xdn.tf.rs" ||
			domain === "static.acg12.com" ||
			domain === "img.zone5.ru" ||
			(domain_nosub === "bssl.es" && domain.match(/^i[0-9]*\./)) ||
			domain === "images.virgula.com.br" ||
			(domain_nowww === "rotana.net" && string_indexof(src, "/assets/uploads/") >= 0) ||
			(domain === "elle.unitedinfluencers.org" && string_indexof(src, "/content/uploads/") >= 0) ||
			(domain_nowww === "notredamedeparis.fr" && string_indexof(src, "/content/uploads/") >= 0) ||
			(domain === "zenska.hudo.com" && string_indexof(src, "/files/") >= 0) ||
			(amazon_container === "seenitblog" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "marieclaire.hu" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "infinitymemories.com" && string_indexof(src, "/files/") >= 0) ||
			(domain_nowww === "tuxboard.com" && string_indexof(src, "/photos/") >= 0) ||
			(domain_nosub === "mundotkm.com" && domain.match(/^arcdn[0-9]*\./)) ||
			(domain_nosub === "game4v.com" && domain.match(/^cdn[0-9]*\./)) ||
			(domain_nosub === "cosplaytime.pl" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "img.wkorea.com" ||
			(domain === "i.mdel.net" && string_indexof(src, "/newfaces/i/") >= 0) ||
			domain === "media.celebmasta.com" ||
			domain === "media.korea25.com" ||
			(domain_nowww === "sexyfandom.com" && string_indexof(src, "/images/") >= 0) ||
			domain === "i.dmarge.com" ||
			domain === "assets.boundingintocomics.com" ||
			domain === "media.profootballfocus.com" ||
			(domain_nowww === "redu.pl" && string_indexof(src, "/img/") >= 0) ||
			(domain === "multifiles.pressherald.com" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "img.time2draw.com" ||
			(domain === "ffw.uol.com.br" && string_indexof(src, "/app/uploads/") >= 0) ||
			domain === "images.harianjogja.com" ||
			domain === "images.hamodia.com" ||
			(domain_nowww === "bz-berlin.de" && string_indexof(src, "/data/uploads/multimedia/") >= 0) ||
			(domain_nowww === "luxury-inside.vn" && src.match(/\/data\/+uploads\//)) ||
			domain_nowww === "worldcupgirls.net" ||
			(domain_nosub === "playstationlifestyle.net" && domain.match(/^cdn[0-9]*-www\./) && string_indexof(src, "/assets/uploads/") >= 0) ||
			(domain_nosub === "aving.net" && domain.match(/^image[0-9]*\./)) ||
			domain === "ss-images.catscdn.vn" ||
			(domain === "blogs.gnome.org" && string_indexof(src, "/files/") >= 0) ||
			(domain_nosub === "zoomit.ir" && domain.match(/^cdn[0-9]*\./)) ||
			domain === "img.myfirstshow.com" ||
			(domain_nosub === "musicfeeds.com.au" && domain.match(/^cdn[0-9]*/) && string_indexof(src, "/assets/uploads/") >= 0) ||
			(domain === "d13vpcwfpcq1p8.cloudfront.net" && string_indexof(src, "/contents/") >= 0) ||
			(domain_nosub === "paperblog.fr" && domain.match(/^media[0-9]*\./)) ||
			(domain_nosub === "paperblog.com" && domain.match(/^m[0-9]*\./)) ||
			(domain === "bikini.sbgefree.org" && string_indexof(src, "/files/") >= 0) ||
			(domain_nowww === "redbust.com" && string_indexof(src, "/stuff/") >= 0) ||
			domain === "img.providr.com" ||
			domain === "static.hiphopdx.com" ||
			amazon_container === "queerty-prodweb" ||
			domain === "static.timesofisrael.com" ||
			(domain_nowww === "hairstylesweekly.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "famousbirthsdeaths.com" && string_indexof(src, "/fbd-uploads/") >= 0) ||
			domain === "img.leaksx.com" ||
			(domain_nowww === "top10films.co.uk" && string_indexof(src, "/img/") >= 0) ||
			domain_nowww === "hotel-aramis.com" ||
			(domain === "dvfmubv4tjrqd.cloudfront.net" && string_indexof(src, "/uploads/") >= 0) ||
			amazon_container === "assets.whatson.cityofsydney.nsw.gov.au" ||
			domain === "static.hasselblad.com" ||
			(domain_nowww === "saywho.fr" && string_indexof(src, "/app/uploads/") >= 0) ||
			(domain_nowww === "talentandpartner.com" && string_indexof(src, "/data/uploads/") >= 0) ||
			domain === "files.vividscreen.info" ||
			(amazon_container === "lilianpacce" && string_indexof(src, "/media/") >= 0) ||
			(amazon_container === "chl-network" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "starkbros.com" && string_indexof(src, "/images/dynamic/") >= 0) ||
			domain === "m.actve.net" ||
			(domain === "d279m997dpfwgl.cloudfront.net" && string_indexof(src, "/wp/") >= 0) ||
			(domain_nowww === "telegraf.com.ua" && string_indexof(src, "/files/") >= 0) ||
			domain === "media.womanista.com" ||
			(domain_nowww === "jenny.gr" && string_indexof(src, "/storage/photos/") >= 0) ||
			(domain === "static.infomusic.ro" && string_indexof(src, "/media/") >= 0) ||
			(domain_nowww === "csiete.net" && string_indexof(src, "/contenido/imagenes/") >= 0) ||
			(domain_nowww === "wallpaper4rest.com" && string_indexof(src, "/wallpaper/") >= 0) ||
			(domain_nowww === "ichip.ru" && string_indexof(src, "/blobimgs/uploads/") >= 0) ||
			(domain_nowww === "pophaircuts.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "she12.com" && string_indexof(src, "/uploads/") >= 0) ||
			(domain === "cdn.stylefrizz.com" && string_indexof(src, "/img/") >= 0) ||
			(domain_nosub === "windows7themes.net" && string_indexof(src, "/wp-content/files/") >= 0) ||
			(domain === "quotes.whyfame.com" && string_indexof(src, "/files/") >= 0) ||
			(domain_nosub === "mozilla.org" && src.match(/:\/\/[^/]*\/files\/+[0-9]{4}\/+[0-9]{2}\/+/)) ||
			(amazon_container === "pas-wordpress-media" && string_indexof(src, "/uploads/") >= 0) ||
			(domain === "news.artnet.com" && string_indexof(src, "/news-upload/") >= 0) ||
			(domain === "edmhunters-563e.kxcdn.com" && string_indexof(src, "/mediafiles/") >= 0) ||
			(amazon_container === "bkt-respaldomtonline" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "img.emao.net" ||
			domain === "p.potv.bg" ||
			domain === "media.yadbegir.com" ||
			(domain_nosub === "llnwd.net" && src.match(/\/site\/+uploads\/+/)) ||
			(domain_nowww === "cinemio.it" && string_indexof(src, "/upload/") >= 0) ||
			(domain_nowww === "flavourmag.co.uk" && string_indexof(src, "/files/") >= 0) ||
			domain === "img.ananweb.jp" ||
			(domain_nowww === "filmz.dk" && string_indexof(src, "/files/") >= 0) ||
			domain_nowww === "mit24h.com" ||
			domain === "dimwhp0w2rs83.cloudfront.net" ||
			(domain === "cdn.macrumors.com" && string_indexof(src, "/article-new/") >= 0) ||
			(domain_nosub === "xcdnpro.com" && domain.match(/images\./)) ||
			(domain_nowww === "lifezette.com" && string_indexof(src, "/files/") >= 0) ||
			(domain === "cdn.junglecreations.com" && string_indexof(src, "/wp/") >= 0) ||
			(domain_nowww === "rip-youth.jp" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "asian-sirens.net" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nosub === "comingsoon.net" && src.match(/\/assets\/+uploads\//)) ||
			domain === "cdn.zoomg.ir" ||
			(domain_nowww === "wikiofthrones.com" && src.match(/\/static\/+uploads\//)) ||
			(domain_nowww === "hitc.com" && src.match(/\/static\/+uploads\//)) ||
			(domain === "files.theblemish.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "esmas.com" && domain.match(/^i[0-9]*\./)) ||
			(domain_nowww === "mortalfm.es" && string_indexof(src, "/archivos/") >= 0) ||
			(domain === "d2yoo3qu6vrk5d.cloudfront.net" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "courrier.jp" && string_indexof(src, "/media/") >= 0) ||
			(domain === "dieta.pourfemme.it" && string_indexof(src, "/img/") >= 0) ||
			(domain === "static.atmag.co.il" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "xtra.works" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "myce.com" && string_indexof(src, "/images_posts/") >= 0) ||
			(domain_nowww === "unison.org.uk" && string_indexof(src, "/content/uploads/") >= 0) ||
			(domain_nowww === "businessinsider.fr" && string_indexof(src, "/content/uploads/") >= 0) ||
			(digitalocean_container === "btrtoday" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "m8q3v4v6.stackpathcdn.com" ||
			(domain_nowww === "linda.nl" && string_indexof(src, "/uploads/") >= 0) ||
			(domain === "ww1.sites-telechargement.com" && string_indexof(src, "/affiche/") >= 0) ||
			(domain === "d3n2u7gfnpd084.cloudfront.net" && src.match(/\/(?:[0-9a-f]{2}\/+){4}/)) ||
			(domain_nowww === "journal-farandole.com" && src.match(/\/content\/+uploads\/+/)) ||
			(domain_nowww === "dpstreaming.live" && string_indexof(src, "/upload/") >= 0) ||
			domain === "cdn.videos.rollcall.com" ||
			(domain_nowww === "rawkblog.com" && string_indexof(src, "/uploads/") >= 0) ||
			(domain === "cdn.stereo.vn" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "dailybruin.com" && string_indexof(src, "/images/") >= 0) ||
			domain_nowww === "razorpics.net" ||
			(domain_nowww === "1in.am" && string_indexof(src, "/assets/") >= 0) ||
			(domain === "cdn.entertainmentfuse.com" && string_indexof(src, "/media/") >= 0) ||
			(domain_nowww === "n3rdabl3.com" && /\/wp-content\/+images\/+uploads\/+/.test(src)) ||
			(domain_nowww === "kizsalsorunlar.com" && string_indexof(src, "/uploads/") >= 0) ||
			domain_nowww === "neskaties.lv" ||
			domain === "img.eroero-gazou.net" ||
			domain === "media.sistemampa.com.br" ||
			(domain_nosub === "looper.com" && /^img[0-9]*\./.test(domain) && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nosub === "dtslb.com" && /^i[0-9]*\./.test(domain)) ||
			domain === "static.otvfoco.com.br" ||
			(domain_nosub === "diariouno.com.ar" && /^static[0-9]*\./.test(domain) && string_indexof(src, "/media/") >= 0) ||
			(domain_nowww === "thugarmada.com" && string_indexof(src, "/ta-files/") >= 0) ||
			(domain_nowww === "flipwallpapers.com" && string_indexof(src, "/wallpapers/") >= 0) ||
			(domain_nowww === "hanamaru-photo.com" && /\/common\/+images\//.test(src)) ||
			domain === "p.elle.bg" ||
			(domain_nowww === "illustrationwest.org" && string_indexof(src, "/files/") >= 0) ||
			(domain_nowww === "myjane.ru" && /\/data\/+cache\//.test(src)) ||
			(domain_nowww === "chickradar.net" && /\/content\/+uploads\//.test(src)) ||
			(domain_nowww === "creepmachine.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "theinspirationgrid.com" && /\/app\/+uploads\//.test(src)) ||
			(domain === "static-koimoi.akamaized.net" && string_indexof(src, "/new-galleries/") >= 0) ||
			(domain_nosub === "elperiodico.com" && /^img[0-9]*\./.test(domain)) ||
			domain_nosub === "cdn-immedia.net" ||
			(domain_nowww === "mmglobalmovies.com" && /\/wp-content\/+upload_folders\//.test(src)) ||
			(domain === "images.in.com" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "staticuestudio.blob.core.windows.net" ||
			domain === "cdn.imvges.com" ||
			domain === "media.pamper.my" ||
			(domain_nowww === "rnbjunk.com" && string_indexof(src, "/foto/") >= 0) ||
			(domain === "cdn.xpicsxx.com" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "zokatv.net" && string_indexof(src, "/media/") >= 0) ||
			(domain_nowww === "magazin.lufthansa.com" && /\/content\/+uploads\//.test(src)) ||
			(domain_nowww === "nexofin.com" && string_indexof(src, "/archivos/") >= 0) ||
			domain === "gallery.southindianactress.in" ||
			(domain === "ffp4g1ylyit3jdyti1hqcvtb-wpengine.netdna-ssl.com" && /\/addons\/+files\//.test(src)) ||
			(domain === "medinaa.archolda.com" && string_indexof(src, "/ime/") >= 0) ||
			(domain_nowww === "londonsvenskar.com" && string_indexof(src, "/files/") >= 0) ||
			(domain === "ia.eferrit.com" && string_indexof(src, "/ia/") >= 0) ||
			(domain_nowww === "dokkaebi.tv" && string_indexof(src, "/file/") >= 0) ||
			(domain_nowww === "porncomix.one" && string_indexof(src, "/gallery/") >= 0) ||
			(domain_nowww === "porncomix.info" && string_indexof(src, "/images/") >= 0) ||
			(domain === "celebsfake.adultcase.com" && string_indexof(src, "/files/") >= 0) ||
			(domain_nowww === "theonemilano.com" && string_indexof(src, "/the-one-milano-uploads/") >= 0) ||
			domain === "public.flashingjungle.com" ||
			(domain === "static.pr.ricmais.com.br" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "smarthomebeginner.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "inspirationde.com" && string_indexof(src, "/media/") >= 0) ||
			domain === "cache.escapistmagazine.com" ||
			(domain_nowww === "stickboybkk.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "fitolsam.com" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "sevelina.ru" && /\/images\/+uploads\//.test(src)) ||
			(domain_nowww === "cdprojekt.com" && string_indexof(src, "/wp-content/") >= 0) ||
			(domain_nowww === "bilgimanya.com" && string_indexof(src, "/resimler/") >= 0) ||
			googlestorage_container === "unlimitedcnd.appspot.com" ||
			domain === "cdn.newlineporn.com" ||
			(domain === "galleries.xxxasianpussy.com" && /\/thumbs\//.test(src)) ||
			(domain_nowww === "okdiario.com" && string_indexof(src, "/img/") >= 0) ||
			(amazon_container === "static-spin-com" && string_indexof(src, "/files/") >= 0) ||
			(domain_nowww === "lapisrelights.com" && /\/assets\/+img\/+uploads\//.test(src)) ||
			((domain_nowww === "wbbjtv.com" ||
				domain_nowww === "channel3000.com" ||
				domain_nowww === "9and10news.com" ||
				(domain_nosub === "tn-cloud.net" && /^wpcdn\./.test(domain)) ||
				domain_nowww === "kxly.com") && /\/content\/+uploads\//.test(src)) ||
			(domain === "static.acgsoso.com" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nosub === "billboard.com" && /static\./.test(domain)) ||
			(domain === "images.fastcompany.net" && /\/wp-cms\/+uploads\//.test(src)) ||
			(domain_nowww === "gamerevolution.com" && /\/assets\/+uploads\//.test(src)) ||
			(domain_nowww === "inglam.ru" && /\/img\/+[0-9]{4}\/+/.test(src)) ||
			(domain === "media.spiked-online.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "unicef.ie" && /\/app\/+uploads\//.test(src)) ||
			domain === "cdn.downriversundaytimes.com" ||
			(domain === "media.hotpress.com" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "images.thedigitalfix.com" ||
			domain === "d2r55xnwy6nx47.cloudfront.net" ||
			domain === "cdn.entameclip.com" ||
			(domain_nowww === "generalarcade.com" && /\/content\/+uploads\//.test(src)) ||
			(domain === "news.r18.com" && /\/assets\/+[0-9]{4}\/+[0-9]{2}\/+/.test(src)) ||
			(domain_nowww === "stylebook.de" && /\/data\/+uploads\//.test(src)) ||
			(domain === "cdn.kastatic.org" && string_indexof(src, "/images/") >= 0) ||
			(domain === "cdn.theathletic.com" && /\/app\/+uploads\//.test(src)) ||
			digitalocean_container === "cgaxisimages" ||
			(domain_nowww === "pockettactics.com" && /\/wp-content\//.test(src)) ||
			amazon_container === "ogden_images" ||
			(domain_nowww === "lapersonne.com" && /\/app\/+uploads\//.test(src)) ||
			(domain_nowww === "ipcc.ch" && /\/assets\/+uploads\//.test(src)) ||
			(domain === "lindenstaub.b-cdn.net" && /\/app\/+uploads\//.test(src)) ||
			(domain === "blogs.stlawu.edu" && string_indexof(src, "/files/") >= 0) ||
			domain === "static.nexilia.it" ||
			(domain_nowww === "fractal-design.com" && /\/app\/+uploads\//.test(src)) ||
			domain === "static.purple.fr" ||
			(domain_nowww === "voguehk.com" && /\/media\//.test(src)) ||
			domain === "cdn.anime-planet.com" ||
			(domain_nowww === "inglam.club" && /\/img\//.test(src)) ||
			(domain_nowww === "d23.com" && /\/app\/+uploads\//.test(src)) ||
			(domain_nosub === "sunderlandafc.news" && /^cdn[0-9]*\./.test(domain) && /\/uploads\//.test(src)) ||
			domain === "wp-assets.futurism.com") {
			src = src.replace(/-[0-9]+x[0-9]+\.([^/]*(?:[?#].*)?)$/, ".$1");
		}
		if ((domain === "store.pinseyun.com" && string_indexof(src, "/uploads/") >= 0) ||
			(domain === "s3.manualzz.com" && /\/store\/+data\//.test(src)) ||
			(domain === "media.coindesk.com" && string_indexof(src, "/uploads/") >= 0)) {
			return {
				url: src.replace(/-[0-9]*x[0-9]*\.([^/.]*)$/, ".$1"),
				can_head: false
			};
		}
		if (domain === "cdn.fashionmagazine.com") return src.replace(/(\/+wp-content\/+uploads\/+[0-9]{4}\/+[0-9]{2}\/+[^/]*)-[0-9]+x[0-9]+-c-[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "cdn.heatworld.com" ||
			domain_nowww === "sohobluesgallery.com" ||
			domain === "media.indiatimes.in" ||
			domain_nowww === "bangkokpost.com" ||
			(domain_nosub === "mensxp.com" && domain.match(/media[0-9]*\./) && string_indexof(src, "/media/") >= 0) ||
			domain === "221.132.38.109" ||
			(domain_nowww === "jpcoast.com" && string_indexof(src, "/img/") >= 0) ||
			domain === "pics.prcm.jp" ||
			(domain_nosub === "lprs1.fr" && domain.match(/s[0-9]*\.lprs1\.fr/)) ||
			domain === "m.wsj.net" ||
			domain === "img.lifestyler.co.kr" ||
			domain === "fototo.blox.pl" ||
			domain === "media.nvyouj.com" ||
			(domain === "cl.buscafs.com" && string_indexof(src, "/www.tomatazos.com/") >= 0) ||
			(domain === "tomatazos.buscafs.com" && string_indexof(src, "/uploads/images/") >= 0) ||
			(domain === "nisfeldunia.ahram.org.eg" && string_indexof(src, "/Media/") >= 0) ||
			domain === "d2t7cq5f1ua57i.cloudfront.net" ||
			domain === "socdn.smtown.com" ||
			(domain_nowww === "lecturas.com" && string_indexof(src, "/medio/") >= 0) ||
			(domain_nowww === "clara.es" && string_indexof(src, "/medio/") >= 0) ||
			domain === "images.anandtech.com" ||
			domain === "cdn.popbela.com" ||
			(domain_nosub === "lizhi.fm" && domain.match(/^cdnimg[0-9]*\./)) ||
			domain === "img.cf.47news.jp" ||
			domain === "static.filmin.es" ||
			(domain_nosub === "ropose.com" && domain.match(/^img[0-9]*\./)) ||
			domain === "resource.info.mn" ||
			(domain_nosub === "thegioitre.vn" && domain.match(/^image[0-9]*\./)) ||
			domain === "img.uduba.com" ||
			domain === "img.51ztzj.com" ||
			(domain === "mediaresources.idiva.com" && string_indexof(src, "/media/") >= 0) ||
			domain === "static.bangkokpost.com" ||
			((domain_nowww === "lepoint.fr" || domain === "static.lpnt.fr") && string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "sdpnoticias.com" && domain.match(/^i[0-9]*\./)) ||
			(domain === "s.thestreet.com" && string_indexof(src, "/files/") >= 0) ||
			(domain_nowww === "cosmopolitan.com.hk" && src.match(/\/storage\/+nodejs\/+(?:legacy\/+images|files)\//)) ||
			(domain_nosub === "bbwc.cn" && domain.match(/^s[0-9]*\.cdn\./)) ||
			(domain === "d4zcrs0v202ys.cloudfront.net" && string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "sornamag.com" && src.match(/\/files\/+images\//)) ||
			(domain === "arhiva.nacional.hr" && string_indexof(src, "/img/") >= 0) ||
			(domain === "img.myvideo.net.tw" && string_indexof(src, "/images/") >= 0) ||
			(domain === "image.apost.com" && string_indexof(src, "/media/") >= 0) ||
			(domain === "im.indiatimes.in" && string_indexof(src, "/content/") >= 0) ||
			(domain === "admin.alo.rs" && /\/resources\/+images\//.test(src)) ||
			(domain === "img.pcauto.com.cn" && /\/images\/+upload\//.test(src)) ||
			(domain === "cdn.sportrebel.pl" && string_indexof(src, "/photos/") >= 0) ||
			domain === "cdn.sweatband.com" ||
			domain === "images.cinefil.com" ||
			(domain_nowww === "palmaresadisq.ca" && string_indexof(src, "/uploads/") >= 0) ||
			domain === "image.b2bmilestone.com" ||
			domain === "music-bandlink.s3.yandex.net") {
			newsrc = src.replace(/_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "mediaonlinevn.com" ||
			(domain_nowww === "delas.pt" && string_indexof(src, "/files/") >= 0) ||
			(domain_nowww === "xda-developers.com" && string_indexof(src, "/files/") >= 0) ||
			domain_nowww === "onthemoveworld.com" ||
			/^[a-z]+:\/\/[^?]+\/wp(?:-content\/+(?:uploads|images|photos|blogs.dir)|\/+uploads)\/[^?]+-[0-9]+x[0-9]+(?:_c)?\./.test(src)
		) {
			newsrc = src.replace(/(?:-uai)?-[0-9]+x[0-9]+(?:_c)?(\.[^/.]*(?:\.webp)?)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (string_indexof(src, "/wp-content/uploads/") >= 0 ||
			string_indexof(src, "/wp/uploads/") >= 0) {
			src = src.replace(/\(pp_w[0-9]+_h[0-9]+\)(\.[^/.]*)$/, "$1");
		}
		if (
		string_indexof(src, "/wp-content/uploads/") >= 0 ||
			string_indexof(src, "/wp/uploads/") >= 0) {
			src = src.replace(/__[0-9]{2,}(\.[^/.]*)$/, "$1");
		}
		if (string_indexof(src, "/wp-content/uploads/") >= 0 ||
			string_indexof(src, "/wp/uploads/") >= 0) {
			src = src.replace(/-[0-9]+x[0-9]+-c-default(\.[^/.]*)$/, "$1");
		}
		if (domain === "pictures.ozy.com" ||
			domain_nowww === "retail-jeweller.com" ||
			domain === "d1nslcd7m2225b.cloudfront.net") {
			return src.replace(/(\/[Pp]ictures\/)[0-9any]+x[0-9any]+(?:[a-z]+)?\//, "$199999999x99999999/");
		}
		if (domain === "static.gofugyourself.com" ||
			(domain_nowww === "kencarson.xyz" && string_indexof(src, "/files/") >= 0) ||
			domain === "static.stereogum.com") {
			return src.replace(/-(?:[0-9]+x[0-9]+|compressed)(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain === "hips.hearstapps.com") {
			newsrc = src.replace(/.*hips\.hearstapps\.com\/([^/]+\.[^/]+)/, "http://$1");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\?[^/]*$/, "");
		}
		if (domain === "img.wennermedia.com") return src.replace(/:\/\/img\.wennermedia\.com\/[^?#]*\/([^/]*)$/, "://img.wennermedia.com/$1");
		if (domain_nosub === "forbesimg.com" ||
			domain === "imageio.forbes.com") {
			return {
				url: src
					.replace(/(\/imageserve\/+[0-9a-f]{10,}\/+(?:[^/]+\/+)?)[0-9]+x[0-9]+(\.[^/.?#]+)$/, "$10x0$2")
					.replace(/(\/imageserve\/+[0-9a-f]{10,}\/+(?:[^/]+\/+)?[0-9]+x[0-9]+\.[^/.?#]+)(?:[?#].*)?$/, "$1"),
				head_wrong_contentlength: true
			};
			/*return {
				url: src.replace(/\/[0-9]*x[0-9]*\.([^/.?]*)(\?.*)?/, "/0x0.$1"),
				head_wrong_contentlength: true
			};*/
		}
		if (domain === "pixel.nymag.com") {
			return src
				.replace(/\/([^/.]*)(\.[^/]*)?\.([^/.]*)$/, "/$1.$3")
				.replace(/(\/slideshows\/.*\/[^/]*)\.[a-z](\.[^/.]*)\/[^/]*(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "pyxis.nymag.com") return src.replace(/(\/v1\/+imgs\/+[0-9a-f]{3}\/+[0-9a-f]{3}\/+[0-9a-f]{10,}[^/.?#]*\.)(?:(?:r(?:deep-)?(?:square|horizontal|vertical|social)(?:-[a-z]+)?|[wh][0-9]+|[0-9]+x)\.){0,}([a-z]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "assets.nydailynews.com" ||
			(domain_nosub === "nydailynews.com" && domain.match(/^static[0-9]*\./)) ||
			domain === "i.cbc.ca" ||
			domain === "cdn.newsday.com" ||
			domain_nowww === "stripes.com" ||
			domain_nowww === "irishtimes.com" ||
			domain_nowww === "ctvnews.ca" ||
			domain_nowww === "lancashirelife.co.uk" ||
			domain === "images.archant.co.uk" ||
			domain === "images.glaciermedia.ca" ||
			domain === "static.gulfnews.com" ||
			domain === "www.cp24.com" ||
			domain_nosub === "anandabazar.com" ||
			domain_nowww === "islingtongazette.co.uk" ||
			domain_nowww === "vrak.tv" ||
			domain === "images.haaretz.co.il" ||
			domain_nowww === "ltu.se" ||
			domain_nowww === "lanuovasardegna.it" ||
			domain_nowww === "huntspost.co.uk" ||
			domain == "rdsimages.cookieless.ca" ||
			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(/\?.*/, "");
			}
		}
		if (domain === "static.gulfnews.com") {
			return {
				url: src,
				head_wrong_contenttype: true
			};
		}
		if (domain_nowww === "tsn.ca") {
			newsrc = src.replace(/(\/images\/+[0-9]{4}\/+(?:[0-9]{1,2}\/+){2}[^/]+)\/+jcr:.*/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "www.tsn.ca") return src.replace(/(\/image\.[^_/]*_gen\/+derivatives\/+)[^/]*\//, "$1default/");
		if ((domain_nosub === "bbci.co.uk" ||
			domain_nosub === "bbc.co.uk") && domain.match(/^ichef(?:-[0-9]*)?\./)) {
			newsrc = src.replace(/\.jpg\.webp([?#].*)?$/, ".jpg$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/[0-9]+_[0-9]+\//, "/original/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\.[^/.]*)\/[0-9]+$/, "$1/0");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(:\/\/[^/]*)\/images\/ic\/[0-9n]+x[0-9n]+(?:_[a-z])?\//, "$1/images/ic/raw/");
			if (newsrc !== src)
				return newsrc;
			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;
			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;
			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 === "ychef.files.bbci.co.uk") return src.replace(/(:\/\/[^/]+\/+)[0-9]+x[0-9]+\/+/, "$1original/");
		if (domain_nowww === "bbc.co.uk") {
			match = src.match(/\/rd\/+images\/+dynamic\/+([^/.]{50,})\/+/);
			if (match) {
				var decoded = base64_decode(match[1]);
				var parsed = JSON_parse(decoded);
				for (var i_1 = 0; i_1 < parsed.length; i_1++) {
					if (!parsed[i_1].length)
						continue;
					if (parsed[i_1][0] === "ff") {
						var internal_filename = parsed[i_1][1];
						if (string_indexof(internal_filename, "public/") === 0) {
							return "https://www.bbc.co.uk/" + internal_filename.substr(7);
						} else {
							break;
						}
					}
				}
				console_error("Unhandled URL", parsed);
			}
		}
		if (domain === "amp.thisisinsider.com" ||
			domain === "amp.insider.com" ||
			domain === "amp.businessinsider.com") {
			return src.replace(/^[a-z]+:\/\/amp\.([^/]*)\/images\/([a-f0-9]+)-[0-9]+(?:-[0-9]+)?(\.[^/.]*)$/, "https://static2.$1/image/$2/");
		}
		if ((domain_nosub === "businessinsider.com" ||
			domain_nosub === "insider.com" ||
			domain_nosub === "thisisinsider.com") &&
			domain.match(/^static[0-9]*\./)) {
			return src.replace(/(\/image\/[0-9a-f]+)(?:-[^/]*|\.[^/]*)?(?:\/.*)?$/, "$1/");
		}
		if (domain === "media.nbcwashington.com" ||
			domain === "media.nbcnewyork.com" ||
			domain === "media.graytvinc.com" ||
			domain === "media.telemundochicago.com" ||
			domain === "media.nbcdfw.com" ||
			domain === "media.nbcphiladelphia.com" ||
			domain === "media.nbcsandiego.com" ||
			domain === "media.heartlandtv.com" ||
			domain === "media.nbcmiami.com" ||
			domain === "media.nbcconnecticut.com" ||
			domain === "media.nbclosangeles.com" ||
			domain === "media.nbcboston.com" ||
			domain === "media.nbcbayarea.com" ||
			domain === "media.winnipegfreepress.com" ||
			domain === "media.brandonsun.com" ||
			domain === "media.necn.com" ||
			domain === "media.telemundoareadelabahia.com" ||
			domain === "media.nbcchicago.com") {
			return src.replace(/\/images\/+[0-9]+\*[0-9]+\//, "/images/");
		}
		if (domain_nowww === "bet.com") {
			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/");
		}
		if (domain_nosub === "cbsistatic.com" && /^gamefaqs[0-9]*\./.test(domain)) {
			newsrc = src.replace(/(:\/\/[^/]+\/+)screen\/+thumb\/+/, "$1screen/full/");
			if (newsrc !== src)
				return {
					url: newsrc,
					head_wrong_contentlength: true
				};
		}
		if (domain_nosub === "cbsistatic.com" && /cnet[0-9]*\./.test(domain)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+img\/+([^/]+=\/+)/, "/$1");
			if (newsrc !== src) {
				return urljoin("https://" + domain + "/img/", common_functions["get_thumbor_url"](newsrc), true);
			}
		}
		if (domain_nosub === "cbsistatic.com" ||
			domain_nosub === "cbsnewsstatic.com" ||
			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 === "cbsstatic.com" &&
			domain.match(/wwwimage[0-9]*(?:-secure)?\.cbsstatic\.com/)) ||
			(domain_nosub === "pplusstatic.com" &&
				domain.match(/wwwimage[0-9]*(?:-(?:secure|us))?\.pplusstatic\.com/))) {
			return src
				.replace(/\/thumbnails\/([^/]*)\/[-a-z0-9:]*\//, "/thumbnails/$1/files/")
				.replace("/thumbnails/photos/files/", "/base/files/");
		}
		if (domain === "api.fidji.lefigaro.fr") {
			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;
			return src.replace(/\/media\/([a-z]*)\/[^/]*\//, "/media/$1/orig/");
		}
		if ((domain_nosub === "h-cdn.co" ||
			(domain_nosub === "cosmopolitan.nl" && domain.match(/h\.cdn\.cosmopolitan\./))) &&
			string_indexof(src, "/assets/") >= 0) {
			return src
				.replace(/\/[0-9]*x[0-9]*\//, "/")
				.replace(/\/(?:landscape|[a-z]+-aspect)[-_]((?:nrm_)?[0-9]{5,}[^/]*)(?:[?#].*)?$/, "/$1");
		}
		if (domain === "imgix.ranker.com") return src.replace(/\?.*$/, "?fm=png");
		if (domain_nosub === "rnkr-static.com" &&
			domain.match(/^img[0-9]*\./)) {
			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") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\.imgix\.net\/(https?%3A[^?]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain === "data.whicdn.com") {
			match = src.match(/^([a-z]+:\/\/[^/]+\/+images\/+([0-9]+)\/+)[^/.]*\.([^/.]*)$/);
			if (match) {
				return {
					url: match[1] + "original." + match[3],
					extra: {
						page: "https://weheartit.com/entry/" + match[2]
					}
				};
			}
		}
		if (domain_nosub === "whicdn.com" && domain.match(/^data[0-9]*\./)) {
			return src.replace(/:\/\/data[0-9]*\./, "://data.");
		}
		if (host_domain_nowww === "weheartit.com" && options.element) {
			if (domain === "assets.whicdn.com" && /\/assets\/+whi-[^/]+\/+entry_stub\/+entry_stub_unsafe-/.test(src)) {
				if (options.element.parentElement && options.element.parentElement.tagName === "A") {
					var href = options.element.parentElement.href;
					match = href.match(/\/entry\/+([0-9]+)\/*(?:[?#].*)?$/);
					if (match) {
						return "https://data.whicdn.com/images/" + match[1] + "/original.jpg";
					}
				}
			}
		}
		if (domain === "cdn.empireonline.com") return src.replace(/cdn\.empireonline\.com\/(?:jpg|png|gif)\/(?:[^/.]+\/){12}/, "cdn.empireonline.com/");
		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]*\./)) {
			return src
				.replace(/(:\/\/[^/]*\.)pixhost\.org\//, "$1pixhost.to/")
				.replace(/\/t([0-9]*\.pixhost\.[a-z]*)\/thumbs\//, "/img$1/images/");
		}
		if (domain_nosub === "ulximg.com" ||
			domain_nowww === "hotnewhiphop.com") {
			return src
				.replace(/\/image\/[0-9a-z]*x[0-9a-z]*\//, "/image/full/");
		}
		if (domain === "fm.cnbc.com") return src.replace(/\.[0-9]+x[0-9]+\.([^/.]*)$/, ".$1");
		if (domain === "images.bwwstatic.com" ||
			domain === "cloudimages.broadwayworld.com" ||
			domain === "newimages.bwwstatic.com") {
			return src
				.replace(/\/tn-[0-9]+_([^/]*)$/, "/$1")
				.replace(/\/(?:[0-9]+)?x(?:[0-9]*)(?:x[0-9]+)?([^/]*)\.pagespeed\.[^/]*(?:[?#].*)?$/, "/$1");
		}
		if (domain_nowww === "broadwayworld.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+ezoimgfmt\/+([^/]+\.[^/]+\/[^?#]+)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return add_http(newsrc);
		}
		if (common_functions["is_pinterest_domain"](domain)) {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+pin\/+([0-9]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://www.pinterest.com/pin/${id}/",
				process: function(done, resp, cache_key, website_match) {
					var match = resp.responseText.match(/<script id="initial-state" type="application\/json">({.*?})<\/script>/);
					if (!match) {
						console_error(cache_key, "Unable to find initial state for", resp);
						return done(null, false);
					}
					var initial_state = JSON_parse(match[1]);
					var id = website_match[1];
					var responses = initial_state.resourceResponses;
					var response = null;
					for (var i = 0; i < responses.length; i++) {
						if (responses[i].options.id !== id)
							continue;
						response = responses[i];
						break;
					}
					if (!response) {
						console_error(cache_key, "Unable to find response for id", id, " in", resp, initial_state);
						return done(null, false);
					}
					response = response.response.data;
					var urls = [];
					var baseobj = {
						extra: {
							page: resp.finalUrl
						}
					};
					if (response.title) {
						baseobj.extra.caption = response.title;
					}
					if (response.videos) {
						var videolist = [];
						var deduplicated_urls = {};
						for (var video_id in response.videos.video_list) {
							var video = response.videos.video_list[video_id];
							if (video.url in deduplicated_urls)
								continue;
							video.id = video_id;
							deduplicated_urls[video.url] = video;
							videolist.push(video);
						}
						videolist.sort(function(a, b) {
							var a_wh = a.width * a.height;
							var b_wh = b.width * b.height;
							if (a_wh !== b_wh) {
								return b_wh - a_wh;
							}
							var a_id = a.id.replace(/^V_/, "");
							var b_id = b.id.replace(/^V_/, "");
							var a_hls = string_indexof(a_id, "HLS") === 0;
							var b_hls = string_indexof(b_id, "HLS") === 0;
							if (a_hls) {
								if (b_hls) {
									return 0;
								} else {
									return -1;
								}
							} else {
								if (b_hls) {
									return 1;
								} else {
									return parseInt(b_id) - parseInt(a_id);
								}
							}
						});
						var videourls = [];
						for (var i = 0; i < videolist.length; i++) {
							var video = videolist[i];
							var video_hls = string_indexof(video.id, "V_HLS") === 0;
							videourls.push({
								url: video.url,
								video: video_hls ? "hls" : true
							});
						}
						array_extend(urls, videourls);
					}
					if (response.images) {
						urls.push(response.images.orig);
					}
					var obj = fillobj_urls(urls, baseobj);
					if (response.link) {
						obj.unshift({
							url: response.link,
							is_pagelink: true
						});
					}
					return done(obj, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (common_functions["is_pinterest_domain"](host_domain) && options.element) {
			var current = options.element;
			do {
				if (current.tagName === "A" && /^[a-z]+:\/\/[^/]+\/+pin\/+[0-9]{5,}/.test(current.href)) {
					return {
						url: current.href,
						is_pagelink: true
					};
				}
				if (current.tagName === "DIV" && current.getAttribute("data-test-id") === "pin-closeup-image") {
					var script = current.querySelector("script[type=\"application/ld+json\"]");
					if (!script)
						continue;
					try {
						var parsed = JSON_parse(script.innerHTML);
						if (parsed["@id"]) {
							return {
								url: parsed["@id"],
								is_pagelink: true
							};
						}
					} catch (e) {
						console_error(e);
					}
				}
			} while (current = current.parentElement);
		}
		if (domain === "i.pinimg.com" ||
			(domain_nosub === "pinimg.com" && domain.match(/^(?:i|(?:s-)?media-cache)-[^.]*\.pinimg/)) ||
			amazon_container === "media.pinterest.com") {
			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
				});
			}
		}
		if (domain_nosub === "condecdn.net" && string_indexof(domain, "images.condecdn.net") >= 0) {
			obj = { url: src };
			match = src.match(/\/image\/+([a-zA-Z0-9]+)\//);
			if (match) {
				obj.filename = match[1];
			}
			newsrc = src.replace(/(\/image\/[^/]*\/).*/, "$1original/");
			if (newsrc !== src)
				obj.url = newsrc;
			return obj;
		}
		if (domain === "media.fromthegrapevine.com" ||
			(domain_nowww === "gretschpages.com" && string_indexof(src, "/media/img/") >= 0) ||
			(domain_nowww === "pornstars.me" && string_indexof(src, "/media/") >= 0) ||
			(domain === "jz.img0.cz" && string_indexof(src, "/media/") >= 0) ||
			domain_nowww === "mediavillage.com") {
			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;
			return src.replace(/\/[rc]_[0-9]+_[0-9]+\//, "/");
		}
		if (domain === "em.wattpad.com") {
			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 === "camo.githubusercontent.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+[0-9a-f]+\/+(68747470[0-9a-f]+)(?:[?#].*)?$/);
			if (match) {
				var hex = match[1];
				return hex.replace(/[0-9a-f]{2}/g, function(x) {
					return string_fromcharcode(parseInt(x, 16));
				});
			}
		}
		if (host_domain_nosub === "fandom.com" && options.element) {
			if (src.length < 10 && options.element.hasAttribute("data-src")) {
				return options.element.getAttribute("data-src");
			}
			if (options.element.hasAttribute("data-video-key") && options.do_request && options.cb) {
				var query_wikia_video = function(key, cb) {
					api_query("wikia:" + key, {
						url: urljoin(options.host_url, "/wikia.php?controller=Lightbox&method=getMediaDetail&fileTitle=" + key + "&format=json", true),
						headers: {
							"x-requested-with": "XMLHttpRequest"
						}
					}, cb, function(done, resp, cache_key) {
						try {
							var json = JSON_parse(resp.responseText);
							if (json.videoEmbedCode.provider === "youtube") {
								return done("https://i.ytimg.com/vi/" + json.videoEmbedCode.jsParams.videoId + "/mqdefault.jpg", 24 * 60 * 60);
							}
						} catch (e) {
							console_error(e);
						}
						return done(null, false);
					});
				};
				query_wikia_video(options.element.getAttribute("data-video-key"), options.cb);
				return {
					waiting: true
				};
			}
		}
		if (domain_nosub === "nocookie.net" &&
			domain.match(/^(?:vignette|static|img)[0-9]*\.wikia\./)) {
			obj = {
				url: src
			};
			match = src.match(/\/images\/+[0-9a-f]\/+[0-9a-f]{2}\/+([^/]+)\/+revision\//);
			if (match) {
				obj.filename = match[1];
			}
			newsrc = src.replace(/(:\/\/[^/]+\/+[-a-f0-9]{10,})\/+.*$/, "$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/revision\/[^/?#]+\/*)(?:[?#].*)?$/, "$1?format=original");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			newsrc = src.replace(/(:\/\/[^/]+\/+)__cb[0-9]{5,}\/+/, "$1");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			newsrc = src
				.replace(/\/revision\/([^/]*)\/.*?(\?.*)?$/, "/revision/$1/$2")
				.replace(/^http:\/\//, "https://");
			if (newsrc !== src)
				obj.url = newsrc;
			return obj;
		}
		if (domain === "static.asiachan.com") {
			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" ||
			domain === "club-img.kdslife.com" ||
			(domain_nosub === "meituan.net" && /^p[0-9]*\./.test(domain)) ||
			(domain === "piccn.ihuaben.com" && string_indexof(src, "/pic/") >= 0) ||
			(domain_nosub === "lanlanlife.com" && /^oss[0-9]*\./.test(domain)) ||
			domain === "img.zcool.cn" ||
			(domain_nosub === "hdslb.com" && /^i[0-9]*\./.test(domain)) ||
			domain === "album.biliimg.com" ||
			domain === "pic-bstarstatic.akamaized.net" ||
			domain === "img.sdxapp.com") {
			newsrc = src.replace(/(?:@|%40)[^/]*$/, "");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "oss.tan8.com") return src.replace(/(\/resource\/+attachment\/+[0-9]{4}\/+[0-9]{6}\/+[0-9a-f]{20,})_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "ultimate-guitar.com") return src.replace(/(\/images\/+(?:[0-9a-f]\/+){2}[0-9a-f]+\.[^/.]*?)@[0-9]+(?:[?#].*)?$/, "$1");
		if ((domain_nosub === "yinyuetai.com" && domain.match(/^img[0-9]*\.c\.yinyuetai\.com/)) ||
			(domain_nosub === "yytcdn.com" && domain.match(/^img[0-9]*\./))) {
			return src.replace(/[0-9]+x[0-9]+(\.[^/.]*)$/, "0x0$1");
		}
		if (domain.search(/mp[0-9]*\.qiyipic\.com/) >= 0 && string_indexof(src, "/passport/") < 0) {
			return src.replace(/[0-9]*_[0-9]*(\.[^/.]*)$/, "0_0$1");
		}
		if (domain_nosub === "duitang.com" || domain_nosub === "dtstatic.com") {
			return src
				.replace(/(\.[a-z]+)_webp(?:[?#].*)?$/, "$1")
				.replace(/(\/uploads\/+[^/]+\/+.*)\.thumb\.[0-9]+_[0-9]+(?:_c)?\./, "$1.");
		}
		if (domain_nosub === "vcimg.com" &&
			domain.match(/i-[0-9]\.vcimg.com/)) {
			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-9a-z]\.zhimg\.com/)) {
			return {
				url: src.replace(/\/((?:v[0-9]*-)?[0-9a-f]+)(?:_[^/._]*)?(\.[^/.]*)$/, "/$1_r$2"),
				headers: {
					Referer: ""
				},
				referer_ok: {
					same_domain: true
				}
			};
		}
		if (domain === "img.hb.aicdn.com" ||
			domain === "hbimg.huabanimg.com" ||
			domain === "gd-hbimg.huaban.com" ||
			domain_nosub === "upaiyun.com") {
			return {
				url: src.replace(/_[^/_]*$/, ""),
				headers: {
					Referer: ""
				}
			};
		}
		if (domain === "imagev2.xmcdn.com") {
			return src.replace(/![^/]*$/, "").replace(/(\/[^/]*?)(?:_[a-z_]+)?(\.[^/.]*)$/, "$1$2");
		}
		if ((domain_nosub === "bdimg.com" || domain_nosub === "baidu.com") &&
			(domain.match(/timg.*?\.bdimg\.com/) ||
				domain.match(/timg.*?\.baidu\.com/))) {
			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 (string_indexof(src, "/timg?") >= 0) {
				return {
					url: decodeURIComponent(src.replace(/.*?\/timg.*?[?&]src=([^&]*).*/, "$1")),
					head_wrong_contenttype: true
				};
			}
			if (string_indexof(src, "/sign=") >= 0 ||
				string_indexof(src, "/pic/item/") >= 0) {
				return {
					url: src.replace(/:\/\/[^/]*\/[^/]*\//, "://imgsrc.baidu.com/"),
					head_wrong_contenttype: true
				};
			}
		}
		if (domain === "imgsrc.baidu.com" ||
			domain === "tiebapic.baidu.com" ||
			(domain_nosub === "baidu.com" && domain.match(/^(?:[a-z]\.)?hiphotos\./)) ||
			domain === "imgsa.baidu.com") {
			newsrc = decodeURIComponent(src.replace(/.*\/[^/]*[?&]src=([^&]*).*/, "$1"));
			if (newsrc !== src)
				return newsrc;
			newsrc = src
				.replace("/abpic/item/", "/pic/item/")
				.replace(/\/[^/]*(?:=|%3D)[^/]*\/sign=[^/]*\//, "/pic/item/");
			if (newsrc !== src)
				return {
					url: newsrc,
					head_wrong_contenttype: true
				};
			if (domain !== "imgsrc.baidu.com") {
				return remove_queries(src.replace(/:\/\/[^/]+\/+/, "://imgsrc.baidu.com/"), ["tbpicau"]);
			}
			return {
				url: newsrc,
				head_wrong_contenttype: true
			};
		}
		if (domain_nosub === "baidu.com" && string_indexof(domain, "himg.baidu.com") >= 0) {
			return src.replace(/\/sys\/[^/]*\/item\//, "/sys/original/item/");
		}
		if (domain_nosub === "baidu.com" && /^img[0-9]*\./.test(domain)) {
			if (/\/it\/+u=/.test(src)) {
				var fm = src.match(/[?&](fm=[0-9]+)(?:[&#].*)?$/);
				if (fm) {
					return src.replace(/[?&#].*/, "&" + fm[1]);
				}
			}
		}
		if (domain_nosub === "baidu.com" && /^pics[0-9]*\./.test(domain)) {
			return src.replace(/(\/feed\/+[0-9a-f]{5,}(?:\.[a-z]+)?)@.*/, "$1");
		}
		if (domain_nosub === "doubanio.com" &&
			domain.match(/^img[0-9]*\./)) {
			baseobj = {
				url: src,
				head_wrong_contentlength: true
			};
			newsrc = src.replace(/\/img\/+trailer\/+small\/+/, "/img/trailer/medium/");
			if (newsrc !== src) {
				baseobj.url = newsrc;
				return baseobj;
			}
			newsrc = src
				.replace(/\/[a-z]+(\/public\/[a-f0-9]+\.[^/.]*)$/, "/raw$1")
				.replace(/\/(?:small|medium)\//, "/large/")
				.replace(/\/[a-z]pic\//, "/opic/")
				.replace(/\/+img\/+([^/]*)\/+o\/+([0-9]+[^/]*)(?:[?#].*)?$/, "/view/$1/raw/public/p$2")
				.replace(/\/+img\/+([^/]*)\/+[^/]*\/+([0-9]+[^/]*)(?:[?#].*)?$/, "/img/$1/o/$2");
			if (newsrc !== src) {
				baseobj.url = newsrc;
				return baseobj;
			}
			newsrc = src.replace(/\/view\/+subject\/+[a-z]+\/+/, "/view/subject/raw/");
			if (newsrc !== src) {
				baseobj.url = newsrc;
				return baseobj;
			}
			if (src.match(/\/+view\/+([^/]*)\/+[^/]*\/+/)) {
				newsrc = src.replace(/(\/+view\/+[^/]+\/+[^/]+\/+.*?)\.webp(?:[?#].*)?$/, "$1.jpg");
				if (newsrc !== src) {
					baseobj.url = newsrc;
					return baseobj;
				}
				newsrc = src.replace(/(\/+view\/+[^/]+\/+)o\/+/, "$1raw/");
				if (newsrc !== src) {
					baseobj.url = newsrc;
					return baseobj;
				}
				if (!/\/view\/+[^/]+\/+raw\//.test(src)) {
					newsrc = src.replace(/(\/+view\/+[^/]+\/+)[^/]+\/+/, "$1o/");
					if (newsrc !== src) {
						baseobj.url = newsrc;
						return baseobj;
					}
				}
				newsrc = src.replace(/\/+view\/+([^/]*)\/+[^/]*\/+/, "/pview/$1/raw/");
				if (newsrc !== src) {
					return fillobj_urls(add_extensions(newsrc.replace(/\.webp(?:[?#].*)?$/, ".jpg")), baseobj);
				}
			}
			return baseobj;
		}
		if (domain === "img.idol001.com") {
			return src
				.replace(/(:\/\/[^/]*\/+)thumbnail\/+/, "$1origin/")
				.replace(/(\/[0-9a-f]+)_watermark(\.[^/.]*)$/, "$1$2");
		}
		if (domain === "star-img.idol001.com") return src.replace(/(\/images\/+[0-9]{4}\/+(?:[0-9]{1,2}\/+){2}[^/]+\.[^/.]+)\/+[^/]*(?:[?#].*)?$/, "$1");
		if (domain === "image-api.nrj.fr") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/(https?)\/([^/?&#]*).*?$/, "$1://$2");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain_nowww === "norwalkreflector.com" &&
			string_indexof(src, "/image/") >= 0) {
			return src.replace(/(\/image\/[0-9]*\/[0-9]*\/[0-9]*\/)[^/]*\/([^/]+)$/, "$1$2");
		}
		if (domain === "assets.bwbx.io") return src.replace(/\/[-0-9]*x[-0-9]*(\.[^/]*)$/, "/-1x-1$1");
		if (domain === "file.osen.co.kr") {
			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") {
			return src.replace(/.*\/(?:view|m?news)[0-9]*\//, "");
		}
		if (domain === "thumb.pann.com") {
			return src.replace(/^[a-z]+:\/\/[^/]*\/[^/]*\//, "");
		}
		if (domain_nosub === "nate.com" && string_indexof(domain, ".video.nate.com") >= 0) {
			return src.replace(/\/img\/thumb\/[0-9]+[^/]*\//, "/img/");
		}
		if (domain === "newsimg.sedaily.com") {
			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_nosub === "blogimg.jp" ||
			domain === "image.news.livedoor.com") {
			return src.replace(/(\/[^/.]*)-[sm](\.[^/.]*)/, "$1$2");
		}
		if (domain === "cdn.livedoor.jp") return src.replace(/(\/[0-9a-f]{10,}\.[^/.]+)\/+r\.[0-9]+x[0-9]+(?:[?#].*)?$/, "$1");
		if (domain === "image.cine21.com") {
			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" ||
			domain === "image.melon.co.kr" ||
			domain === "kakaoimg.melon.co.kr" ||
			domain === "cdnticket.melon.co.kr" ||
			domain === "cmtimg.melon.co.kr" /* &&
		(string_indexof(src, "/images/") >= 0 ||
		 string_indexof(src, "/image/") >= 0 ||
		 string_indexof(src, "/user_images/") >= 0)*/) {
			if (/\/resource\/+image\/+web\/+(?:artist|main)\/+/.test(src) ||
				/\/resource\/+image\/+(?:cmt\/+)?web\/+common\/+bg_(?:album_)?frame/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			newsrc = src.replace(/(\.[a-zA-Z]+)\/melon\/.*/, "$1");
			if (newsrc !== src)
				return newsrc;
			if (string_indexof(src, "/images/main/") >= 0) {
				newsrc = src.replace(/(images\/.*\/[^/_]*)((_[^/.]*)_)?(_?[^/._]*)?(\.[^/.?]*)(?:[?/].*)?$/, "$1$3$5");
			} else {
				newsrc = src.replace(/(images\/.*\/[^/_]*)((_[^/.]*)_)?(_?[^/._]*)?(\.[^/.?]*)(?:[?/].*)?$/, "$1$3_org$5");
			}
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/cm[0-9]*\/+mv\/+images\/+.*\/([0-9]+)_[0-9]+_(?:[0-9]+|org)\.[^/.]+(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://www.melon.com/video/player.htm?mvId=" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain === "cdnticket.melon.co.kr") {
			if (/\/resource\/+image\/+web\/+common\//.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "melon.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+(?:player|detail2)\.htm\?(?:.*&)?mvId=([0-9]+)/,
				run: function(cb, match) {
					var id = match[1];
					var cache_key = "melon_video:" + id;
					api_query(cache_key, {
						url: "https://www.melon.com/delivery/streamingInfo.json?contsId=" + id + "&contsType=VIDEO&bitrate=HD&stRight=N&_=" + Date.now(),
						imu_mode: "xhr",
						headers: {
							Referer: "https://www.melon.com/video/player.htm?mvId=" + id,
							"X-Requested-With": "XMLHttpRequest",
							"Content-Type": "application/json",
							"Accept": "application/json, text/javascript, */*; q=0.01"
						},
						json: true
					}, cb, function(done, resp, cache_key) {
						var videourl = resp.streamingInfo.encUrl;
						if (!videourl) {
							console_error(cache_key, "Unable to find video url in", resp);
							return done(null, false);
						}
						if (!/\.m3u8\?/.test(videourl)) {
							console_error(cache_key, "Unknown video url type", { videourl: videourl, json: resp });
							return done(null, false);
						}
						videourl = force_https(videourl);
						return done({
							url: videourl,
							video: "hls"
						}, 60 * 60);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "mzstatic.com" && domain.match(/is[0-9](-ssl)?\.mzstatic\.com/) &&
			string_indexof(src, "/image/thumb/") >= 0) {
			obj = {
				can_head: false // GET can return 502, but HEAD is ok
			};
			match = src.match(/\/([-0-9a-f]{20,}(?:_[^/]+)?)\/+source\/+[^/]+(?:[?#].*)?$/);
			if (!match)
				match = src.match(/\/[-0-9a-f]{20,}\/+([^/]+)\.[^/.]+\/+[^/]+(?:[?#].*)?$/);
			if (match)
				obj.filename = match[1];
			obj.url = src.replace(/\/[0-9]*x[0-9]*[a-z]*(?:-[0-9]+)?(\.[^/.]*)$/, "/999999999x0w-999$1");
			if (obj.url !== src)
				return obj;
			obj.url = src.replace(/(_file)_cropped(\.[a-z]+\/+999999999x0w[^/]+)$/, "$1$2");
			if (obj.url !== src)
				return obj;
			if (/\.png(?:[?#].*)?$/i.test(obj.url)) {
				match = src.match(/image\/+thumb\/+(.*?\/+(?:[a-f0-9]{2}\/+){3}(?:[-0-9a-f]{20,}\/)?[^/]+)\//);
				if (match) {
					obj.url = "https://a1.mzstatic.com/us/r1000/063/" + match[1];
					return obj;
				}
			}
			return fillobj_urls(add_full_extensions(obj.url, ["png", "jpg"], true), obj);
		}
		if (domain_nosub === "mzstatic.com" && /^[as][0-9]+\./.test(domain)) {
			return src.replace(/(\/v4\/+(?:[a-f0-9]{2}\/+){3}[-0-9a-f]{20,}\/+)[^/]+(?:[?#].*)?$/, "$1source");
		}
		if (domain === "images.moviesrankings.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+/, "https://is3-ssl.mzstatic.com/");
		if (domain === "img-tmdetail.alicdn.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+bao\/+uploaded\/+([^/]+\.[^/]+\/+)/, "$1");
			if (newsrc !== src)
				return add_http(newsrc);
		}
		if (domain_nosub === "alicdn.com" ||
			domain_nosub === "aliexpress-media.com") {
			return src
				.replace(/\.[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1")
				.replace(/(\.[^/._?#]+)_(?:[0-9z]+x[0-9z]+(?:x[0-9z]+)?)?(?:[qQ][0-9]+)?\.[^/.]+$/, "$1")
				.replace(/(\.[^/._?#]+)_\.webp(?:[?#].*)?$/, "$1")
				.replace(/\?.*/, "");
		}
		if (domain_nosub === "1818lao.com" &&
			domain.match(/^i[0-9]*\./)) {
			return src.replace(/:\/\/[^/]*\/aliexpress[0-9]*(\/kf\/)/, "://ae01.alicdn.com$1");
		}
		if (domain === "lastfm-img2.akamaized.net" ||
			domain === "lastfm.freetls.fastly.net" ||
			domain_nosub === "lst.fm") {
			return src.replace(/\/i\/+u\/+(?:avatar)?(?:[0-9]+x[0-9]+|[0-9]+s|ar(?:X?L|[0-9]))\//, "/i/u/");
		}
		if (domain_nosub === "myspacecdn.com" &&
			domain.match(/a[0-9](?:\...)?-images\.myspacecdn\.com/)) {
			return src.replace(/\/[^/.]*(\.[^/.]*)$/, "/full$1");
		}
		if (domain === "geo-media.beatport.com") {
			return {
				url: src.replace(/\/image_size\/+[0-9]*x[0-9]*\//, "/image_size/0x0/"),
				can_head: false // 400
			};
		}
		if (domain_nosub === "tumblr.com" &&
			string_indexof(domain, "media.tumblr.com") >= 0) {
			obj = {
				headers: {
					"Accept": "*/*" // otherwise it can return an HTML
				},
				problems: {
					possibly_broken: false
				}
			};
			if (false && src.match(/_[0-9]*\.gif$/)) {
				obj.problems.possibly_broken = true;
			}
			newsrc = src
				.replace(/\.pnj(\?.*)?$/, ".png$1")
				.replace(/\.gifv(\?.*)?$/, ".gif$1");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			if (src.match(/\/avatar_[0-9a-f]+_(?:16|64|128)\./))
				return src.replace(/_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "_512$1");
			newsrc = src.replace(/(\/(?:tumblr(?:_(?:static|inline))?_)?[0-9a-zA-Z]+(?:_og)?(?:_r[0-9]*)?)_[0-9]+(?:sq)?(\.[^/.]*)$/, "$1_1280$2");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+(?:previews\/+)?(tumblr_[^/_.]+)_(?:filmstrip|(?:frame|smart)1)\.jpg(?:[?#].*)?$/, "https://ve.media.tumblr.com/$1.mp4");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			if (false) {
				newsrc = src.replace(/^[a-z]+:\/\/[0-9]+\.media\./, "https://media.");
				if (newsrc !== src) {
					obj.url = newsrc;
					return obj;
				}
			}
			if (options.do_request && options.cb && /:\/\/[^/]+\/+[0-9a-f]{32}\/+[0-9a-f]{16}-[0-9a-f]{2}\/+s[0-9]+x[0-9]+u?(?:_[fc][0-9]+)?\/+[0-9a-f]{20,}\./.test(src)) {
				var get_initialstate_from_text = function(text) {
					var match = text.match(/window\['___INITIAL_STATE___'\]\s*=\s*({.*?"ImageUrlPage":.*?})\s*;\s*(?:<\/script>[\s\S]*)?$/);
					if (!match) {
						match = text.match(/___INITIAL_STATE___">\s*({.*?})\s*<\/script/);
					}
					if (match) {
						var json = match[1].replace(/(\"\s*:)\s*(?:\/.*?\/|undefined|new RegExp\(.*?\))\s*([,}])/g, "$1null$2");
						try {
							var parsed = JSON_parse(json);
							return parsed;
						} catch (e) {
							console_error(e, {
								match: match,
								text: text,
								json: json
							});
						}
						return null;
					}
					return null;
				};
				var url_to_tumblr_imageinfo = function(url) {
					var match = url.match(/:\/\/[^/]+\/+([0-9a-f]{32})\/+([0-9a-f]{16}-[0-9a-f]{2})\/+s([0-9]+)x([0-9]+)u?(?:_[a-z][0-9]+)?\/+[0-9a-f]{20,}\.([^/.?#]+)(?:[?#].*)?$/);
					if (match) {
						return {
							mediaKey: match[1] + ":" + match[2],
							url: url,
							width: match[3],
							height: match[4]
						};
					} else {
						return null;
					}
				};
				var query_tumblr_original = function(url, cb) {
					url = url
						.replace(/\/s[0-9]+x[0-9]+u?(?:_c[0-9]+)?\/+([0-9a-f]{20,}\.)/, "/s999999999x999999999/$1")
						.replace(/:\/\/media\./, "://66.media.");
					var cache_key = "tumblr_image_page:" + url;
					api_cache.fetch(cache_key, cb, function(done) {
						options.do_request({
							url: url,
							headers: {
								Referer: "",
								"sec-fetch-mode": "navigate",
								"sec-fetch-dest": "document",
								"sec-fetch-site": "none",
								"if-none-match": "",
								"accept": "text/html" // This appears to be the important line
							},
							method: "GET",
							onload: function(resp) {
								if (resp.status !== 200) {
									console_error(cache_key, resp);
									return done(null, false);
								}
								var initialstate = get_initialstate_from_text(resp.responseText);
								if (!initialstate) {
									console_warn(cache_key, "Unable to get initial state from", resp);
									return done(null, false);
								}
								try {
									var imageresponse_raw = deepcopy(initialstate.ImageUrlPage.photo.imageResponse);
									var imageresponse = [];
									for (var i = 0; i < imageresponse_raw.length; i++) {
										if (!imageresponse_raw[i])
											continue;
										imageresponse.push(imageresponse_raw[i]);
									}
									var request_imageinfo;
									if (initialstate.ImageUrlPage.requestedImage) {
										request_imageinfo = url_to_tumblr_imageinfo(initialstate.ImageUrlPage.requestedImage);
										if (request_imageinfo)
											imageresponse.push(request_imageinfo);
									}
									var page = null;
									if (initialstate.ImageUrlPage.post) {
										page = initialstate.ImageUrlPage.post.postUrl;
									}
									return done({
										images: imageresponse,
										page: page
									});
								} catch (e) {
									console_error(e, initialstate);
								}
								return done(null, false);
							}
						});
					});
				};
				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 get_obj_from_imageinfo = function(imageinfo) {
					var largest = find_largest_from_media(imageinfo.images);
					if (!largest)
						return;
					var obj = {
						url: largest.url, //.replace(/^[a-z]+:\/\/[0-9]+\.media\./, "https://media."),
						headers: {
							"Accept": "*/*" // otherwise it can return an HTML
						},
						is_original: largest.hasOriginalDimensions
					};
					if (imageinfo.page) {
						obj.extra = { page: imageinfo.page };
					}
					return obj;
				};
				query_tumblr_original(src, function(imageinfo) {
					if (!imageinfo) {
						return options.cb(null);
					}
					var newobj = get_obj_from_imageinfo(imageinfo);
					newobj = fillobj(newobj, obj);
					return options.cb(newobj);
				});
				return {
					waiting: true
				};
			}
		}
		if (domain_nosub === "tumblr.com" && /media\.tumblr\.com$/.test(domain) && options && options.element &&
			options.do_request && options.cb) {
			var apikey = null;
			if (options.rule_specific && options.rule_specific.tumblr_api_key)
				apikey = options.rule_specific.tumblr_api_key;
			var get_initialstate_from_text = function(text) {
				var match = text.match(/window\['___INITIAL_STATE___'\]\s*=\s*({.*?"tumblelog":.*?})\s*;\s*(?:<\/script>[\s\S]*)?$/);
				if (match) {
					var json = match[1].replace(/(\"\s*:)\s*\/.*?\/\s*([,}])/g, "$1null$2");
					try {
						var parsed = JSON_parse(json);
						return parsed;
					} catch (e) {
						console_error(e);
					}
					return null;
				}
				return null;
			};
			var get_initialstate = function() {
				var scripts = document.getElementsByTagName("script");
				for (var i = 0; i < scripts.length; i++) {
					var text = scripts[i].innerText;
					if (text.length < 100)
						continue;
					var initialstate = get_initialstate_from_text(text);
					if (initialstate)
						return initialstate;
				}
				return null;
			};
			var get_apikey_from_initialstate = function(initialstate) {
				if (initialstate && initialstate.apiFetchStore && "API_TOKEN" in initialstate.apiFetchStore) {
					return initialstate.apiFetchStore.API_TOKEN;
				}
				return null;
			};
			var initialstate = get_initialstate();
			var initialstate_api_key = get_apikey_from_initialstate(initialstate);
			var get_beta_api_key = function(cb) {
				api_cache.fetch("tumblr_api_key", cb, function(done) {
					if (initialstate_api_key) {
						return done(initialstate_api_key, 24 * 60 * 60);
					}
					options.do_request({
						method: "GET",
						url: "https://support.tumblr.com/archive",
						headers: {
							Referer: ""
						},
						onload: function(resp) {
							if (resp.readyState !== 4)
								return;
							if (resp.status !== 200) {
								console_error(resp);
								return done(null, false);
							}
							var initialstate = get_initialstate_from_text(resp.responseText);
							if (initialstate) {
								var apikey = get_apikey_from_initialstate(initialstate);
								if (apikey) {
									return done(apikey, 24 * 60 * 60);
								}
							}
							return done(null, false);
						}
					});
				});
			};
			var do_tumblr_api_call = function(path, params, cb) {
				var request_obj = {
					url: "https://api.tumblr.com/v2" + path + "?api_key=" + apikey + "&" + params,
					method: "GET",
					onload: function(resp) {
						if (resp.readyState !== 4)
							return;
						if (resp.status !== 200) {
							console_error(resp);
							return cb(null);
						}
						return cb(resp.responseText);
					}
				};
				if (!apikey) {
					get_beta_api_key(function(apikey) {
						request_obj.headers = {
							"Authorization": "Bearer " + apikey,
							"X-Version": "redpop/3/0//redpop/"
						};
						request_obj.url = request_obj.url.replace(/\?api_key=.*?&/, "?");
						options.do_request(request_obj);
					});
				} else {
					options.do_request(request_obj);
				}
			};
			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) {
					do_tumblr_api_call("/blog/" + blogname + "/posts", "id=" + postid + "&npf=true", function(data) {
						if (!data) {
							return done(null, false);
						}
						try {
							var json = JSON_parse(data);
							var post = json.response.posts[0];
							var content = post.content;
							if (post.trail) {
								for (var i = 0; i < post.trail.length; i++) {
									array_extend(content, post.trail[i].content);
								}
							}
							return done(content, 6 * 60 * 60);
						} catch (e) {
							console_error(e, data);
							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);
							}
							var jsontxt = match[1].replace(/,\"[^"]+?\":\/.*?,\"/, ",\"");
							try {
								var json = JSON_parse(jsontxt);
								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 || initialstate_api_key) {
					return get_post_api(blogname, postid, cb);
				} else {
					get_beta_api_key(function(apikey) {
						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 find_blogname_from_initialstate = function() {
				if (initialstate && "tumblelog" in initialstate && "name" in initialstate.tumblelog) {
					return initialstate.tumblelog.name;
				}
				return null;
			};
			var find_postid_from_el = function(el) {
				var currentel = el;
				while ((currentel = currentel.parentElement)) {
					if (currentel.tagName === "ARTICLE" && currentel.hasAttribute("data-id")) {
						var id = currentel.getAttribute("data-id");
						if (/^[0-9]+$/.test(id)) {
							return id;
						}
					}
					var id = currentel.getAttribute("id");
					if (id) {
						var match = id.match(/^photoset_([0-9]+)$/);
						if (match) {
							return match[1];
						}
						if (currentel.tagName === "ARTICLE") {
							return id;
						}
					}
					if (currentel.tagName === "A") {
						var match = currentel.href.match(/:\/\/[^/]+\/+image\/+([0-9]{8,})\/*(?:[?#].*)?$/);
						if (match) {
							return match[1];
						}
					}
					if (currentel.tagName === "FIGURE") {
						try {
							var as = currentel.parentElement.parentElement.getElementsByTagName("a");
							for (var i = 0; i < as.length; i++) {
								var match = as[i].href.match(/:\/\/[^/]+\/+(?:image|post)\/+([0-9]{8,})\/*(?:[?#].*)?$/);
								if (match) {
									return match[1];
								}
							}
						} catch (e) {
							console_error(e);
						}
					}
				}
				return null;
			};
			var el_has_mediakey = function(el, mediakey) {
				if (el.tagName === "IMG") {
					return find_mediakey_from_url(el.src) === mediakey;
				} else if (el.tagName === "IFRAME" && /\/post\/+[0-9]+\/+/.test(el.src)) {
					try {
						var images = el.contentDocument.querySelectorAll("img");
						for (var i = 0; i < images.length; i++) {
							if (el_has_mediakey(images[i], mediakey))
								return true;
						}
					} catch (e) {
						console_error(e, el);
						return false;
					}
				}
				return false;
			};
			var try_finding_postid_from_url = function(url) {
				if (!options.document)
					return null;
				var mediakey = find_mediakey_from_url(url);
				if (!mediakey)
					return null;
				var cache_key = "tumblr_url_postid:" + mediakey;
				if (api_cache.has(cache_key)) {
					return api_cache.get(cache_key);
				}
				var els = options.document.querySelectorAll("article img, article iframe");
				for (var i = 0; i < els.length; i++) {
					if (el_has_mediakey(els[i], mediakey)) {
						var postid = find_postid_from_el(els[i]);
						if (postid) {
							api_cache.set(cache_key, postid);
						}
						return postid;
					}
				}
				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) {
					blogname = find_blogname_from_initialstate();
				}
				if (blogname) {
					var obj = {
						blogname: blogname
					};
					var postid = find_postid_from_el(options.element);
					if (!postid) {
						postid = try_finding_postid_from_url(src);
					}
					if (postid) {
						obj.postid = postid;
						return obj;
					}
				} else if (host_domain_nowww === "tumblr.com") {
					var currentel = options.element;
					while ((currentel = currentel.parentElement)) {
						if ((currentel.tagName === "DIV" || currentel.tagName === "ARTICLE") && 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);
							}
							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) {
							console_warn("Unable to get post data from API", info);
							return options.cb(null);
						}
						var media = find_media_from_post_mediakey(data, mediakey);
						if (!media) {
							console_warn("Unable to find media from post and mediakey", data, mediakey);
							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" ||
			domain === "cdn.worldcosplay.net") {
			newsrc = src;
			if (string_indexof(src, "/max-1200/") >= 0) {
				newsrc = src.replace(/-[0-9a-z]+(\.[^/.]*)$/, "-1200$1");
			} else {
				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]*\//)) {
			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");
		}
		if (domain === "art.wsj.net") {
			if (string_indexof(src, "/api/photos/gams-files/") >= 0) {
				return src.replace(/\/gams-files\/[^-_/.]*-[^-_/.]*_([^/_.]*)_.*$/, "/gams-id:$1");
			}
			if (string_indexof(src, "/api/photos/gams-id:") >= 0) {
				return src.replace(/(\/gams-id:[^/]*)\/.*$/, "$1");
			}
		}
		if (domain_nosub === "fanpop.com" &&
			domain.match(/images[0-9]*\.fanpop\.com/)) {
			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") return src.replace(/(\/app\/cms\/image\/transf\/)[^/]*\//, "$1none/");
		if ((domain_nosub === "ladmedia.fr" ||
			domain_nosub === "lanmedia.fr") &&
			domain.match(/(?:resize|cdn)[0-9]*-[a-z]*\./)) {
			return {
				url: src
					.replace(/:\/\/resize[0-9]*-([a-z]+[^/]*?)\/+img\/var\//, "://cdn-$1/var/")
					.replace(/\/(?:[rf]|crop|rcrop)\/[^/]*\//, "/")
					.replace(/_(?:original|portrait)_[a-z0-9_]+(\.[^/.]*)$/, "$1"),
				can_head: true
			};
		}
		if (domain === "resize.elle.fr") {
			return src
				.replace(/:\/\/[^/]+\/+original\/+(var\/.*)$/, "://cdn-elle.ladmedia.fr/$1")
				.replace(/(:\/\/[^/]+\/+)[^/]+\/+var\/+/, "$1original/var/");
		}
		if (domain_nowww === "parismatch.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+lmnr\/+/, "https://resize-parismatch.lanmedia.fr/");
		if (domain_nosub === "imgbox.com" &&
			(domain.match(/^thumbs[0-9]*\./) ||
				domain.match(/images[0-9]*\./))) {
			var obj_1 = {
				url: src
			};
			var match_1 = src.match(/\/(?:[0-9a-f]{2}\/+){2}([^/_.]+)_([a-z])\./);
			if (match_1) {
				if (match_1[2] === "o")
					obj_1.is_original = true;
				obj_1.extra = {
					page: "https://imgbox.com/" + match_1[1]
				};
			}
			newsrc = src
				.replace(/\/thumbs([0-9]*)\.imgbox\.com\//, "/images$1.imgbox.com/")
				.replace(/_[a-z](\.[^/.]*)/, "_o$1");
			if (newsrc !== src) {
				obj_1.url = newsrc;
				return obj_1;
			}
			return obj_1;
		}
		if (domain_nosub === "imgbox.com" && /^(?:[0-9]+[-.])?t\./.test(domain) && options.do_request && options.cb) {
			newsrc = src.replace(/^[a-z]+:\/\/(?:[0-9]+[-.])?t\./, "https://t.");
			api_query("imgbox_redirect:" + newsrc, {
				url: newsrc
			}, options.cb, function(done, resp, cache_key) {
				done(resp.finalUrl, 6 * 60 * 60);
			});
			return {
				waiting: true
			};
		}
		if (domain_nowww === "imgbox.com") {
			if (/\/images\/+background-body\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([0-9a-zA-Z]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					return cb("https://t.imgbox.com/" + match[1] + ".jpg");
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "community.akamai.steamstatic.com") {
			if (/\/public\/+images\/+sharedfiles\/+game_highlight_activethumb/.test(src))
				return {
					url: src,
					bad: "mask"
				};
			newsrc = src.replace(/(\/economy\/+image\/+[^/]+\/+)[0-9]+x[0-9]+([?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return {
					url: newsrc,
					head_wrong_contentlength: true
				};
		}
		if ((domain_nosub === "steamstatic.com" && domain.match(/(?:cdn|shared)\.[^.]*\.steamstatic\.com/)) ||
			(domain_nosub === "akamaihd.net" && domain.match(/steamcdn(?:-[a-z]*)?\.akamaihd\.net/))) {
			newsrc = src.replace(/(\/steam\/+apps\/+[0-9]+\/+movie)[0-9]+(?:_vp9)?(\.[^/.]+)(?:[?#].*)?$/, "$1_max$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/steam\/+apps\/+[0-9]+\/+movie)\.(?:jpg|JPG|jpeg|JPEG|png|PNG)(?:[?#].*)?$/, "$1_max.webm");
			if (newsrc !== src)
				return {
					url: newsrc,
					video: true
				};
			newsrc = src.replace(/(\/steamcommunity\/+public\/+images\/+clans\/+[0-9]+\/+[0-9a-f]{20,})_[0-9]+x[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			if (string_indexof(src, "/public/images/avatars/") >= 0) {
				src = src.replace(/(?:_[^/.]*)?(\.[^/.]*)$/, "_full$1");
			}
			newsrc = src.replace(/(\/steam\/+apps\/+[0-9]+\/+library_[0-9]+x[0-9]+)\./, "$1_2x.");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\.[0-9]+x[0-9]+(\.[^/]*)$/, "$1");
		}
		if (domain === "steamstore-a.akamaihd.net") {
			if (/\/public\/+images\/+v[0-9]*\/+(?:app\/+game_page|(?:(?:ico_)?game_|arrows\.)).*/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain_nosub === "steamstatic.com" && /^avatars\./.test(domain)) {
			return src.replace(/(:\/\/[^/]+\/+[0-9a-f]{10,})(?:_medium)?\./, "$1_full.");
		}
		if (domain_nosub === "nutaku.com" && /^cdn[0-9]*-images\./.test(domain)) {
			return src.replace(/(\/images\/.*)-thumb(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nosub === "medium.com" &&
			(domain.match(/cdn-images-[0-9]*\.medium\.com/) ||
				domain === "miro.medium.com")) {
			return src.replace(/(:\/\/[^/]*\/+(?:v2\/+)?).*?\/([^/]*)$/, "$1$2");
		}
		if ((domain_nosub === "zimbio.com" ||
			domain_nosub === "stylebistro.com" ||
			domain_nosub === "livingly.com") &&
			domain.match(/www[0-9]*\.pictures\.(.*\.)?[a-z]+\.com/)) {
			return src.replace(/[a-z](\.[^/.]*)$/, "x$1");
		}
		if (domain_nowww === "theplace2.ru" ||
			domain_nowww === "theplace.ru" ||
			domain === "image.chaojimote.com" ||
			domain === "moviepic.manmankan.com" ||
			domain === "img.star.iecity.com") {
			newsrc = src.replace(/_[a-z](\.[^/.]*)$/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "theplace2.ru" ||
			domain_nowww === "theplace.ru" ||
			domain_nowww === "theplace-2.com") {
			return src.replace(/(:\/\/[^/]*\/)cache\/(.*?)-g[^/.]*(\.[^/.]*)/, "$1$2$3");
		}
		if ((domain_nosub === "craveonline.com" && domain.match(/cdn[0-9]*-www\.craveonline\.com/)) ||
			domain_nowww === "legswiki.com" ||
			(domain_nosub === "mandatory.com" && domain.match(/^cdn[0-9]*-www\./)) ||
			domain_nowww === "indiancinemagallery.com" ||
			(domain_nowww === "allwomensites.com" && string_indexof(src, "/gallery/") >= 0) ||
			domain_nowww === "zemanceleblegs.com" ||
			domain === "blog.chron.com" ||
			(domain_nosub === "comingsoon.net" && domain.match(/cdn[0-9]*-www\./)) ||
			(domain_nowww === "porngirlserotica.com" && /\/wp-content\/+blogs\.dir\/+[0-9]+\/+files\/+/.test(src)) ||
			(domain_nosub === "dogtime.com" && domain.match(/cdn[0-9]*-www\./))) {
			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") {
			return src
				.replace("/smallcrops/", "/")
				.replace("/thumbs/", "/")
				.replace(/sm(\.[^/.]*)$/, "$1")
				.replace(/_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "blogcdn.com") {
			return src
				.replace(/(\/S[0-9]+\/)[a-z](\.[^/.]*)$/, "$1l$2")
				.replace(/\/slug\/[a-z]\//, "/slug/l/");
		}
		if (domain === "photos.imageevent.com") return src.replace(/\/(?:small|large|huge|giant|icons)\/([^/]*)$/, "/$1");
		if (domain === "image.ajunews.com") return src.replace(/_[0-9]*_[0-9]*(\.[^/.]*)$/, "$1");
		if (domain_nosub === "telegraph.co.uk" &&
			(domain_nowww === "telegraph.co.uk" ||
				string_indexof(domain, "aws.telegraph.co.uk") >= 0 ||
				domain === "subscriber.telegraph.co.uk")) {
			return src.replace(/-(?:x*(?:large|medium|small))(_[^/]*)?(\.[^/.]*$)$/, "$1$2");
		}
		if (domain === "image.munhwa.com") {
			return src.replace("/gen_thumb/", "/gen_news/").replace(/_[^/._]*(\.[^/.]*$)/, "_b$1");
		}
		if (domain_nosub === "dspmedia.co.kr") 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)) {
			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
								}
							};
						}
						if (!is_array(obj))
							obj = [obj];
						var normalize_da = function(url) { return url
							.replace(/([?&])(?:token|ts)=[^&]+/g, "$1")
							.replace(/[?&]+$/, ""); };
						array_foreach(obj, function(sobj) {
							if (sobj.url) {
								var simplesrc = normalize_da(src);
								var simplenewsrc = normalize_da(sobj.url);
								if (simplesrc === simplenewsrc)
									sobj.url = src;
							}
							sobj.forcerecurse = true;
							if (!sobj.extra) {
								sobj.extra = {
									page: result.finalUrl
								};
							}
						});
						return options.cb(obj);
					});
				});
				return {
					waiting: true
				};
			}
		}
		if (domain === "static.wixstatic.com" ||
			domain_nosub === "wixmp.com") {
			if (/^[a-z]+:\/\/[^/]+\/+media\/+0da768_361994b0f154464682a0aaf9724471cc\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			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 = common_functions["_wix_bigimage_inner"](src);
			if (newsrc) {
				obj.url = newsrc;
				var normalize_da = function(url) { return url
					.replace(/([?&])(?:token|ts)=[^&]+/g, "$1")
					.replace(/[?&]+$/, ""); };
				if (normalize_da(src) === normalize_da(newsrc))
					obj.url = src;
			}
			return obj;
		}
		if (domain_nosub === "kukinews.com" ||
			domain_nowww === "inews365.com" ||
			domain_nowww === "newsinstar.com" ||
			domain_nowww === "artkoreatv.com" ||
			domain_nowww === "cnbnews.com" ||
			domain_nowww === "newsgg.net" ||
			domain_nowww === "newsam.co.kr" ||
			domain_nowww === "fetv.co.kr" ||
			domain_nowww === "ddaily.co.kr") {
			return src
				.replace(/\/data\/+cache\/+public\//, "/data/")
				.replace(/_[0-9]+x[0-9]+(?:_c[0-9]*)?\.([^/.]*)/, ".$1");
		}
		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" ||
			domain_nosub === "imgspice.com" ||
			domain_nosub === "imageporter.com" ||
			domain_nosub === "imagedunk.com" ||
			domain === "main.imgclick.net" ||
			domain_nosub === "imagedax.net" ||
			domain_nosub === "piclambo.net" ||
			domain_nosub === "picturedip.com" ||
			domain_nosub === "pixroute.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([a-z0-9]{5,})(?:(?:\/+[^/?#]*)?\.html)?(?:[?#].*)?$/,
				query_for_id: "https://" + domain + "/${id}/.html",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<img id="imgpreview" src="(https?:\/\/[^/]+\/+i\/+[^"]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done(decode_entities(match[1]), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
			newsrc = src.replace(/(\/i\/+(?:[0-9]+\/+)?[0-9]+\/+[a-z0-9]{5,})_t(\.[^/.]*)$/, "$1$2");
			obj = {
				url: src,
				headers: {
					Referer: ""
				},
				bad_if: [
					{
						headers: {
							"content-length": "40275",
							"content-type": "image/jpeg"
						}
					}
				]
			};
			if (newsrc !== src) {
				return fillobj_urls(add_extensions_jpeg(newsrc), obj);
			} else {
				return obj;
			}
		}
		if (domain_nosub === "imagetwist.com" && src.match(/:\/\/[^/]*\/+error\.[^/.]*(?:[?#].*)?$/)) {
			return {
				url: src,
				bad: true
			};
		}
		if (domain_nosub === "imagetwist.com" ||
			domain_nosub === "imagexport.com" ||
			domain_nosub === "imagenpic.com" ||
			domain_nosub === "vipr.im" ||
			domain_nosub === "picshick.com") {
			var bad_if_1 = [
				{
					headers: {
						"Last-Modified": "Fri, 28 May 2010 08:58:40 GMT",
						"Content-Length": "8183"
					}
				}
			];
			var is_picdomain = false;
			var request_domain;
			match = domain.match(/^[uis](?:mg)?[0-9]+([a-z]+)?\./);
			if (match) {
				is_picdomain = true;
				request_domain = domain_nosub;
				if (match[1]) {
					request_domain = match[1] + "." + request_domain;
				}
			}
			if (!is_picdomain) {
				newsrc = website_query({
					website_regex: {
						regex: /^[a-z]+:\/\/([^/]+)\/+([0-9a-z]{8,})\/+[^/.?#]*(\.[^/.]+)(?:[?#].*)?$/,
						groups: ["domain", "id", "ext"]
					},
					query_for_id: "https://${domain}/${id}/${ext}",
					process: function(done, resp, cache_key) {
						var match = resp.responseText.match(/<a\s+href=["'](https?:\/\/[ius](?:mg)?[0-9]*(?:[a-z]+)?\.[^/]+\/+i\/+.*?)["'][^>]*\sdownload/);
						if (!match) {
							match = resp.responseText.match(/<p[^>]*>\s*<img\s+src=["'](https?:\/\/[ius](?:mg)?[0-9]*(?:[a-z]+)?\.[^/]+\/+i\/+[^"']+)["'][^>]*\sclass="[^"]*pic[^"]*"/);
						}
						if (!match) {
							console_error(cache_key, "Unable to find match for", resp);
							return done(null, false);
						}
						done({
							url: decode_entities(match[1]),
							headers: {
								Referer: src.replace(/:\/\/(?:[^/]*\.)?([^/.]*\.[^/.]*)\/.*/, "://$1/"),
								Origin: src.replace(/:\/\/(?:[^/]*\.)?([^/.]*\.[^/.]*)\/.*/, "://$1/"),
								"Sec-Metadata": "destination=image, site=same-site"
							},
							bad_if: bad_if_1,
							is_original: true
						}, 60 * 60);
					}
				});
				if (newsrc)
					return newsrc;
			} else {
				newsrc = src.replace(/^([a-z]+:\/\/)[^/]+\/+th\/+[0-9]+\/+([0-9a-z]+)(\.[^/.]*)?$/, "$1" + request_domain + "/$2/$3");
				if (newsrc !== src) {
					return [
						{
							url: newsrc,
							is_pagelink: true
						},
						{
							url: src.replace(/\/th\//, "/i/"),
							headers: {
								Referer: src.replace(/:\/\/(?:[^/]*\.)?([^/.]*\.[^/.]*)\/.*/, "://$1/"),
								Origin: src.replace(/:\/\/(?:[^/]*\.)?([^/.]*\.[^/.]*)\/.*/, "://$1/"),
								"Sec-Metadata": "destination=image, site=same-site"
							},
							bad_if: bad_if_1
						}
					];
				}
			}
		}
		if (domain_nosub === "fappic.com") {
			if (domain_nosub === domain_nowww) {
				newsrc = website_query({
					website_regex: {
						regex: /^[a-z]+:\/\/([^/]+)\/+([0-9a-z]{8,})\/+[^/.?#]*(\.[^/.]+)(?:[?#].*)?$/,
						groups: ["domain", "id", "ext"]
					},
					query_for_id: "https://${domain}/${id}/${ext}",
					process: function(done, resp, cache_key) {
						var match = resp.responseText.match(/<img\s+src=["'](https?:\/\/[^/]+\/+img\/+.*?)["'][^>]*\s+class=['"]pic["']/);
						if (!match) {
							console_error(cache_key, "Unable to find match for", resp);
							return done(null, false);
						}
						done({
							url: decode_entities(match[1]),
							headers: {
								Referer: src.replace(/:\/\/(?:[^/]*\.)?([^/.]*\.[^/.]*)\/.*/, "://$1/"),
								Origin: src.replace(/:\/\/(?:[^/]*\.)?([^/.]*\.[^/.]*)\/.*/, "://$1/"),
								"Sec-Metadata": "destination=image, site=same-site"
							},
							is_private: true, // linked to ip
							is_original: true
						}, 60 * 60);
					}
				});
				if (newsrc)
					return newsrc;
			}
			newsrc = src.replace(/^([a-z]+:\/\/)(?:[^/.]*\.)?([^/.]+\.[^/.]+\/+)(?:th|i)\/+[0-9]+\/+([0-9a-z]+)(?:_t)?(\.[^/.]*)?$/, "$1$2$3/$4");
			if (newsrc !== src) {
				return [
					{
						url: newsrc,
						is_pagelink: true
					},
					{
						url: src,
						headers: {
							Referer: src.replace(/:\/\/(?:[^/]*\.)?([^/.]*\.[^/.]*)\/.*/, "://$1/"),
							Origin: src.replace(/:\/\/(?:[^/]*\.)?([^/.]*\.[^/.]*)\/.*/, "://$1/"),
							"Sec-Metadata": "destination=image, site=same-site"
						}
					}
				];
			}
		}
		if (domain_nowww === "imgflare.com") {
			var get_form_inputs = function(text) {
				var matches = match_all(text, /<input\s+(?:id=\S+\s+)?type="hidden"\s+name="([^"]+)" value="([^"]+)"/);
				if (!matches || !matches.length)
					return null;
				var data = {};
				array_foreach(matches, function(match) {
					data[decode_entities(match[1])] = decode_entities(match[2]);
				});
				return data;
			};
			var get_img_from_imgflare = function(resp) {
				var match = resp.responseText.match(/<img[^>]*src="(https?:\/\/i\.imgflare\.com\/+i\.php\?[^"]+)"/);
				if (!match)
					return null;
				return {
					url: decode_entities(match[1]),
					headers: {
						Referer: resp.finalUrl,
						Origin: "https://www.imgflare.com"
					},
					is_private: true // linked to ip
				};
			};
			var query_imgflare = function(url, cb, inputs, times) {
				if (!times)
					times = 0;
				if (times >= 5) {
					console_error("Unable to find image for", url, "(tried too many times)");
					return cb(null);
				}
				var req = {
					url: url,
					imu_mode: "document",
					headers: {
						Referer: "https://www.imgflare.com/",
						Origin: "https://www.imgflare.com"
					}
				};
				if (inputs) {
					req.method = "POST",
						req.data = stringify_queries(inputs);
					req.headers["Content-Type"] = "application/x-www-form-urlencoded";
				}
				api_query("imgflare:" + url, req, function(data) {
					if (!data)
						return cb(null);
					if (data.img)
						return cb(data.img);
					if (data.inputs) {
						return setTimeout(function() {
							query_imgflare(url, cb, data.inputs, times + 1);
						}, 3 * 1000);
					}
				}, function(done, resp, cache_key) {
					var img = get_img_from_imgflare(resp);
					if (img) {
						return done({
							img: img
						}, 60 * 60);
					}
					var inputs = get_form_inputs(resp.responseText);
					if (!inputs) {
						console_error(cache_key, "Unable to find form inputs for", resp, "(is captcha solved?)");
						return done(null, false);
					}
					return done({
						inputs: inputs
					}, false);
				});
			};
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+([0-9a-z]{5,})\/+[^/]*\.html(?:[?#].*)?$/, // old style
					/^[a-z]+:\/\/[^/]+\/+f\/+([0-9a-z]{5,})(?:[?#].*)?$/
				],
				run: function(cb, match) {
					var id = match[1];
					var url = "https://www.imgflare.com/f/" + id;
					query_imgflare(url, cb);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "i.imgflare.com") {
			match = src.match(/\/i\/+[0-9]+\/+([0-9a-z]{5,})_t\./);
			if (match)
				return {
					url: "https://www.imgflare.com/f/" + match[1],
					is_pagelink: true
				};
		}
		if (domain_nosub === "tezzpic.com" ||
			domain_nosub === "piczhq.com" ||
			domain_nosub === "crownimg.com" ||
			domain_nosub === "outletpic.com" ||
			domain_nosub === "imgoutlet.com" ||
			domain_nosub === "pictwn.com" ||
			domain_nosub === "trypicz.com" ||
			domain_nosub === "imgtown.net" ||
			domain_nosub === "dewimg.com" ||
			domain_nosub === "imgdew.com" ||
			domain_nosub === "imgmaze.com" ||
			domain_nosub === "meetimgz.com" ||
			domain_nosub === "imgview.net" ||
			domain_nosub === "picyield.com" ||
			domain_nosub === "usefto.com") {
			var img_domain_1 = domain_nosub;
			if (img_domain_1 === "piczhq.com")
				img_domain_1 = "tezzpic.com";
			if (img_domain_1 === "usefto.com" ||
				img_domain_1 === "imgoutlet.com")
				img_domain_1 = "outletpic.com";
			if (img_domain_1 === "trypicz.com" ||
				img_domain_1 === "imgtown.net")
				img_domain_1 = "pictwn.com";
			if (img_domain_1 === "imgdew.com")
				img_domain_1 = "dewimg.com";
			if (img_domain_1 === "imgmaze.com")
				img_domain_1 = "meetimgz.com";
			if (img_domain_1 === "imgview.net")
				img_domain_1 = "picyield.com";
			var query_tezzpic_img_1 = function(url, id, token, cb) {
				api_query(img_domain_1 + ":" + id + ":" + token, {
					url: url,
					imu_mode: "document",
					method: "POST",
					headers: {
						origin: "https://" + img_domain_1,
						referer: url,
						"content-type": "application/x-www-form-urlencoded"
					},
					data: "op=view&id=" + id + "&pre=1&" + token + "=1"
				}, cb, function(done, resp, cache_key) {
					var match = resp.responseText.match(/<img src="(https?:\/\/[^"]+)" class="pic(?:view)?"/);
					if (!match) {
						console_error(cache_key, "Unable to find img match for", {
							resp: resp,
							url: url,
							id: id,
							token: token
						});
						return done(null, false);
					}
					return done(match[1], 60 * 60);
				});
			};
			var check_captcha_1 = function(responseText) {
				if (/Completing the CAPTCHA proves you are a human and gives you access to/.test(responseText)) {
					return true;
				}
				return false;
			};
			var advise_captcha_1 = function(responseText) {
				if (check_captcha_1(responseText)) {
					console_error("You may need to solve a CAPTCHA");
				}
			};
			var process_final_tezzpic_1 = function(done, resp, cache_key, match, options) {
				var section_match = resp.responseText.match(/(?:\$\(document\)\['\\x6f\\x6e'\]\(|'\\x70\\x72\\x65\\x76\\x65\\x6e\\x74\\x44\\x65\\x66\\x61\\x75\\x6c\\x74'|'\\x62\\x75\\x74\\x74\\x6f\\x6e\\x5b\\x6e\\x61\\x6d\\x65\\x3d\\x22\\x6e\\x65\\x78\\x74\\x22\\x5d').*?(?:'\\x6f\\x72\\x69\\x67\\x69\\x6e\\x61\\x6c\\x45\\x76\\x65\\x6e\\x74'|'\\x69\\x73\\x54\\x72\\x75\\x73\\x74\\x65\\x64'|'\\x73\\x65\\x74\\x41\\x74\\x74\\x72\\x69\\x62\\x75\\x74\\x65').*?,((?:_0x[0-9a-f]+\s*(?:\+\s*)?)+)\);\s*}?else/);
				if (!section_match) {
					console_error(cache_key, "Unable to find section match for", resp);
					advise_captcha_1(resp.responseText);
					return done(null, false);
				}
				var section_text = section_match[0];
				var id = null;
				var url_id_match = options.url.match(/:\/\/[^/]+\/+([0-9a-z]+)\/+[^/]*\.html/);
				if (url_id_match) {
					id = url_id_match[1];
				} else {
					var id_match = resp.responseText.match(/(?:'|0x[0-9a-f]+\))\s*\+\s*'([0-9a-z]+)'\s*\+\s*(?:'[^']+'|_0x[0-9a-f]+\(0x[0-9a-f]+\))\s*\+\s*'[0-9a-f]{32}'/);
					if (!id_match) {
						console_error(cache_key, "Unable to find image ID match for", resp);
						return done(null, false);
					}
					id = id_match[1];
				}
				var args_text = section_match[1];
				var args = args_text.match(/(_0x[0-9a-f]+)/g);
				var values = [];
				for (var _i = 0, args_1 = args; _i < args_1.length; _i++) {
					var arg = args_1[_i];
					var argval_match = section_text.match(new RegExp(arg + "='([^']*)'"));
					if (!argval_match) {
						console_error("Unable to find value for arg", arg, {
							section_text: section_text,
							args: args,
							args_text: args_text,
							resp: resp
						});
						return done(null, false);
					}
					values.push(argval_match[1]);
				}
				var token = values.join("");
				query_tezzpic_img_1(options.url, id, token, function(url) {
					if (!url) {
						return done(null, false);
					}
					return done({
						url: url,
						headers: {
							Referer: "https://" + domain + "/"
						}
					}, 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([-_0-9a-zA-Z]{20,})\.php(?:[?#].*)?$/,
				query_for_id: "https://" + img_domain_1 + "/${id}.php",
				process: process_final_tezzpic_1
			});
			if (newsrc)
				return newsrc;
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([0-9a-z]+)\/+[^/]*\.html(?:[?#].*)?$/,
				query_for_id: "https://" + img_domain_1 + "/${id}/.html",
				process: function(done, resp, cache_key, match, options) {
					if (domain_nosub === "crownimg.com") {
						return process_final_tezzpic_1(done, resp, cache_key, match, options);
					}
					var vars_string_match = resp.responseText.match(/((?:_0x[0-9a-f]+\s*=\s*(?:(?:'[^']*'|(?:_0x[0-9a-f]+\s*(?:\+\s*)?)+),\s*))+_0x[0-9a-f]+=atob\([^)]+\);)/);
					if (!vars_string_match) {
						console_error(cache_key, "Unable to find vars match for", resp);
						advise_captcha_1(resp.responseText);
						return done(null, false);
					}
					var vars_parsed = match_all(vars_string_match[1], /(_0x[0-9a-f]+)\s*=\s*([^,]+)\s*[;,]/);
					var vars_obj = {};
					var final_var = null;
					for (var _i = 0, vars_parsed_1 = vars_parsed; _i < vars_parsed_1.length; _i++) {
						var parsed_1 = vars_parsed_1[_i];
						var varname = parsed_1[1];
						var varvalue = parsed_1[2];
						if (varvalue[0] === "'") {
							varvalue = varvalue.replace(/^'(.*)'$/, "$1");
						} else {
							var refs = varvalue.match(/(_0x[0-9a-f]+)/g);
							var varvalues = [];
							for (var _a = 0, refs_1 = refs; _a < refs_1.length; _a++) {
								var ref = refs_1[_a];
								varvalues.push(vars_obj[ref]);
							}
							var new_varvalue = varvalues.join("");
							if (/^atob/.test(varvalue)) {
								varvalue = base64_decode(new_varvalue);
								final_var = varname;
							} else {
								varvalue = new_varvalue;
							}
						}
						vars_obj[varname] = varvalue;
					}
					if (!final_var || !/^https?:\/\//.test(vars_obj[final_var])) {
						console_error(cache_key, "Unable to find final var for", resp, vars_obj);
						return done(null, false);
					}
					done({
						url: vars_obj[final_var],
						is_pagelink: true
					}, 10 * 60);
				}
			});
			if (newsrc)
				return newsrc;
			match = src.match(/\/i\/+[0-9]+\/+([0-9a-z]+)(?:_t)?\./);
			if (match) {
				return {
					url: "https://" + img_domain_1 + "/" + match[1] + "/.html",
					is_pagelink: true
				};
			}
		}
		if (domain === "www.theactuary.com") return src.replace(/getresource\.axd\?.*(AssetID=[0-9]*).*/, "getresource.axd?$1");
		if (domain === "static.new-magazine.co.uk" ||
			amazon_container === "star-magazine.co.uk") {
			return src.replace(/(\/prod\/media\/images\/)[^/]*\//, "$1original/");
		}
		if (domain_nowww === "irishexaminer.com" ||
			domain_nowww === "breakingnews.ie" ||
			domain === "ip.index.hr" ||
			domain === "images.radiotimes.com" ||
			domain_nowww === "mffashion.com" ||
			domain === "download.iask.ca" ||
			domain === "ip.trueachievements.com") {
			newsrc = src.replace(/.*:\/\/[^/]*\/remote\/([^?]*).*/, "$1");
			if (newsrc !== src)
				return "http://" + decodeURIComponent(newsrc);
		}
		if (domain === "images.radiotimes.com") {
			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") {
			return src.replace(/(\/uploads\/+images\/+[a-zA-Z]+\/+[0-9]+(?:\.[-0-9a-f]+)?\.[^/.?]*)(?:[?#].*)?$/, "$1");
		}
		if ((domain === "tellymix-spykawebgroup.netdna-ssl.com" ||
			domain_nosub === "tellymixcdn.com") &&
			src.match(/:\/\/[^/]*\/+ts\//)) {
			return src.replace(/^[a-z]+:\/\/[^/]*\/+ts\/+[0-9]*\/+[0-9]*\/+/, "http://");
		}
		if (domain === "assets.goodhousekeeping.co.uk") return src.replace(/(\/(?:embedded|galleries)\/+(?:[0-9]*\/+)[^/]*)__[^/.]*(\.[^/]*)$/, "$1$2");
		if (domain === "img.buzzfeed.com") {
			return src
				.replace(/_big(\.[^/.]*)$/, "_dblbig$1")
				.replace(/_wide(\.[^/.]*)$/, "_dblbig$1")
				.replace(/_dblwide(\.[^/.]*)$/, "_dblbig$1");
		}
		if (domain_nowww === "thegenealogist.co.uk") return src.replace(/\/images\/+featuredarticles\/+header_sm\//, "/images/featuredarticles/header_lg/");
		if (domain === "251d2191a60056d6ba74-1671eccf3a0275494885881efb0852a4.ssl.cf1.rackcdn.com" ||
			domain === "8583b52b4a309671f69d-b436b898353c7dc300b5887446a26466.ssl.cf1.rackcdn.com" ||
			domain === "2e0a24317f4a9294563f-26c3b154822345d9dde0204930c49e9c.ssl.cf1.rackcdn.com" ||
			domain === "7f9c61237bd6e732e57e-5fa18836a2ae6b5e7c49abcc89b20237.ssl.cf1.rackcdn.com" ||
			domain === "b6c18f286245704fe3e9-05e2055f4cd9122af02914269431c9f6.ssl.cf1.rackcdn.com" ||
			domain === "41dcdfcd4dea0e5aba20-931851ca4d0d7cdafe33022cf8264a37.ssl.cf1.rackcdn.com" ||
			domain === "575717b777ff8d928c6b-704c46a8034042e4fc898baf7b3e75d9.ssl.cf1.rackcdn.com" ||
			domain === "598d5fcf392acad97538-395e64798090ee0a3a571e8c148d44f2.ssl.cf1.rackcdn.com") {
			return src.replace(/(\/[^/.]*)_[a-z](\.[^/.?]*)(?:\?[^/]*)?$/, "$1$2");
		}
		if (domain === "be35832fa5168a30acd6-5c7e0f2623ae37b4a933167fe83d71b5.ssl.cf3.rackcdn.com") return src.replace(/__hero(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain === "7e7781e2f767494a7128-d0458b7f69ca26f2871554faadb4939e.ssl.cf5.rackcdn.com") {
			if (/\/wp-content\/+themes\/+photolux\/+images\//.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if ((domain_nosub === "shopify.com" && /^cdn[0-9]*\./.test(domain)) ||
			((domain_nowww === "fellowproducts.com" ||
				domain === "store.mossyoak.com" ||
				domain_nosub === "ecoflow.com" ||
				domain_nowww === "levitation.fm" ||
				domain_nowww === "mariahcarey.store" ||
				domain_nowww === "trueself2020.com" ||
				domain_nowww === "theoldmapshop.com" ||
				domain_nowww === "ballyrobertgardens.coM" ||
				domain_nowww === "herb-era.com" ||
				domain_nowww === "deltagoodrem.com" ||
				domain === "partners.spigen.com" ||
				domain_nowww === "cosmicbackground.io" ||
				domain_nowww === "roguewavecoffee.ca") && /\/cdn\/+shop\//.test(src)) ||
			/^[a-z]+:\/\/[^/]+\/+cdn\/+shop\/+(?:products|collections|files|articles)\/+[^/.?#]+(?:\.progressive)?\.[a-zA-Z]+(?:[?#].*)?$/.test(src)) {
			if (/\/assets\/+product-highlight-color-hover\.svg(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			newsrc = src.replace(/_(?:large|medium|small|grande|compact|[0-9]+x(?:[0-9]+)?|x[0-9]+)(?:@[0-9]+x)?(?:_crop_[a-z]+)?(?:\.progressive)?(\.[^/.]*)(?:[?#].*)?$/, "$1");
			return remove_queries(newsrc, ["width", "height"]);
		}
		if (domain === "cdn.itv.com") return src.replace(/\/[a-z]*_([^/_]*)$/, "/$1");
		if (domain === "thumbnailer.mixcloud.com") return src.replace(/\/unsafe\/[0-9]+x[0-9]+\//, "/unsafe/0x0/");
		if (domain === "d3mkh5naggjddw.cloudfront.net" ||
			domain === "img.blvds.com" ||
			domain === "resizer.mundotkm.com" ||
			domain === "d2isyty7gbnm74.cloudfront.net" ||
			domain === "thumb.connect360.vn" ||
			domain === "img.movietimes.com" ||
			domain === "t.t2online.co.in" ||
			domain === "thum.buzzni.com" ||
			domain === "resizer.mundotkm.com" ||
			domain === "quicksilver.scoopwhoop.com" ||
			domain_nosub === "telegraphindia.com" ||
			domain === "mediacdn.libertatea.ro" ||
			domain === "imgresizer.eurosport.com" ||
			domain === "gdn.printerval.com" ||
			(domain_nosub === "genius.com" && domain.match(/t[0-9]*\.genius\.com/))) {
			return add_http(decodeURIComponent(src
				.replace(/.*\/unsafe\/(?:fit-in\/)?(?:[0-9]+x[0-9]+\/)?smart\/(?:filters:[^/]*\/)?/, "")
				.replace(/.*\/unsafe\/(?:fit-in\/)?(?:[0-9]+x[0-9]+\/)?filters:[^/]*\//, "")
				.replace(/.*\/unsafe\/fit-in\/smart\//, "")
				.replace(/.*\/unsafe\/(?:fit-in\/)?(?:[0-9]*x[0-9]*\/)?(?:center\/)?(?:smart\/)?/, "")));
		}
		if (domain === "cdn.uwants.com" ||
			domain === "cdn.discuss.com.hk") {
			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") return src.replace(/\/images\/[sv][0-9]+\/articles\//, "/images/downloads/articles/");
		if (domain === "japantoday-asset.scdn3.secure.raxcdn.com") 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" ||
			(domain_nosub === "nytimes.com" && domain.match(/^graphics[0-9]*\./)) ||
			domain === "cdn1.nyt.com") {
			newsrc = src.replace(/[?#].*$/, "");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/images\/.*)_[0-9]+h(\.[a-z]+)$/, "$1_large$2");
			if (newsrc !== src)
				return newsrc;
			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] === "videoSmall" ||
					matched[1] === "videoLarge" ||
					matched[1] === "thumbLarge" ||
					matched[1] === "tmagArticle" ||
					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(/^threeByTwo(?:Small|Medium)(?:At[0-9]+X)/) ||
					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") {
			newsrc = src.replace(/render\.fineartamerica\.com\/images\/rendered\/search\/print\/[^/]*(-[0-9]*)\/([^/]*)$/, "images.fineartamerica.com/images-medium-large$1/$2");
			if (newsrc !== src)
				return newsrc;
			if (/\/previewhighresolutionimage\.php\?/.test(src)) {
				return add_queries(src, { domainUrl: "++++++++++" });
			}
		}
		if (domain === "media.npr.org") {
			return {
				url: src
					.replace(/(\/[^/]*)-[sc][0-9]*(?:-[sc][0-9]*)?(\.[^/.]*)/, "$1$2")
					.replace(/(_custom)?(?:_[a-z]+)?-([a-f0-9]{30,})(\.[^/.]*)$/, "$1-$2$3")
					.replace(/\.webp([?#].*)?$/, ".jpg$1"),
				head_wrong_contentlength: true
			};
		}
		if (domain_nosub === "pbsrc.com" && domain.match(/rs[0-9]*\.pbsrc\.com/)) {
			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)) {
			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 pbdomain = "www";
				if (match[1])
					pbdomain = "s" + match[1];
				var page = "http://" + pbdomain + ".photobucket.com/user/" + match[2] + "/media/" + match[3] + ".html";
				return {
					url: src,
					headers: {
						Referer: page
					},
					extra: {
						page: page
					}
				};
			}
		}
		if (domain === "www.welt.de" ||
			domain === "img.welt.de") {
			return src.replace(/-c[^-/]+-w[0-9]*(\/[^/]*)$/, "-coriginal-w0$1");
		}
		if (domain === "cdn.baeblemusic.com" && string_indexof(src, "/images/") >= 0) {
			return src.replace(/-[0-9]*(\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "deviantart.net" && domain.match(/^t[0-9]*\./)) {
			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/) ||
			domain_nowww === "glamour.de" ||
			domain === "asia.nikkei.com" ||
			domain_nosub === "elle.co.jp" ||
			domain_nowww === "harpersbazaar.jp" ||
			domain_nowww === "fotogramas.es" ||
			domain_nosub === "ellegirl.jp" ||
			domain_nosub === "esquire.jp" ||
			domain === "img.25ans.jp" ||
			domain_nowww === "cosmopolitan.com.hk" ||
			domain_nowww === "elle.com.hk" ||
			domain_nosub === "vogue.de" ||
			(domain_nosub === "telestar.fr" && domain.match(/img[0-9]*\.telestar\.fr/)) ||
			domain_nowww === "haz.de" ||
			domain_nowww === "connexionfrance.com" ||
			domain_nowww === "novilist.hr" ||
			domain_nowww === "ville-wasquehal.fr" ||
			domain_nowww === "gq-magazin.de" ||
			domain_nowww === "esa.int" ||
			domain_nowww === "quejadore.com" ||
			(domain_nosub === "grazia.fr" && /^file[0-9]*\./.test(domain)) ||
			domain_nosub === "esquirehk.com" ||
			domain === "gfx.elle.ci" ||
			(domain_nosub === "closermag.fr" && domain.match(/(?:img|file)[0-9]*\.closermag\.fr/))) {
			return src
				.replace(/(:\/\/[^/]*\/var\/+(?:[^/]*\/+)?storage\/+images\/+.*\/[^/]+?)(?:_[a-z][^-/._]*(?:_[0-9]+){0,})?(\.[^/.?]*)(?:[?#].*)?$/, "$1$2")
				.replace(/\/storage\/+images\/+_aliases\/+[^/]*\/+/, "/storage/images/");
		}
		if ((domain_nosub === "purepeople.com" ||
			domain_nosub === "purepeople.com.br" ||
			domain_nosub === "purebreak.com" ||
			domain_nosub === "purebreak.com.br" ||
			domain_nosub === "get-the-look.ca" ||
			domain_nosub === "hairstyle.com" ||
			domain_nosub === "puretrend.com") &&
			domain.match(/^static[0-9]*\./)) {
			return src.replace(/([-_])[0-9]+(?:x[0-9]+)?(-[0-9]\.[^/.]*)/, "$1999999999x0$2");
		}
		if (domain_nosub === "belezaextraordinaria.com.br" && domain.match(/^static[0-9]*\./)) {
			return src.replace(/([-_])(?:[0-9]+(?:x[0-9]+)?|(?:article|opengraph)_[^-/.]+)(-[0-9]\.[^/.]*)/, "$1article_news$2");
		}
		if (domain === "medias.unifrance.org") return src.replace(/(\/medias\/+.*\/+)format_(?:web|affiche|page)\/+/, "$1format_hd/");
		if (domain === "lthumb.lisimg.com") {
			newsrc = src.replace(/\?.*/, "");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+[0-9]+\/+([0-9]+)\..*/, "https://ilarge.lisimg.com/image/$1/0full.jpg");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "lisimg.com" ||
			domain_nosub === "listal.com") {
			obj = {
				url: src
			};
			id = src.match(/^[a-z]+:\/\/[^/]+\/+(?:image\/+)?([0-9]+)\/+[0-9]+/);
			if (id) {
				id = id[1];
				obj.extra = { page: "https://www.listal.com/viewimage/" + id };
			}
			obj.url = src
				.replace(/:\/\/[^\./]*\.lisimg\.com\//, "://ilarge.lisimg.com/")
				.replace(/(:\/\/[^/]+\/+(?:image\/+)?[0-9]+)\/+[0-9]+(?:full)?([^/]*?(?:\/[^/]*)?(?:[?#].*)?)$/, "$1/99999999999full$2");
			return obj;
		}
		if (domain_nosub === "lesinrocks.com") return src.replace(/\/width-[0-9]*-height-[0-9]*/, "/width-0-height-0");
		if (domain === "media.senscritique.com") return src.replace(/(\/media\/+[0-9]{8,}\/+)[0-9]+(?:[_x][0-9]+)?\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "$10/$2");
		if (domain_nowww === "franceinter.fr" ||
			domain === "cdn.radiofrance.fr") {
			return src.replace(/\/[0-9]+(?:x[0-9]+)?_([^/]*\.[^/.]+)(?:[?#].*)?$/, "/$1");
		}
		if (domain === "1645110239.rsc.cdn77.org" ||
			domain_nowww === "cinenews.be") {
			newsrc = 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");
			return {
				url: newsrc,
				head_wrong_contentlength: true
			};
		}
		if (domain_nowww === "diymag.com" && string_indexof(src, "/media/img") >= 0) {
			return src.replace(/(\/media\/img\/.*\/)_[^/]*\/([^/]*)$/, "$1$2");
		}
		if (domain_nowww === "kerry-brown.com") return src.replace(/(\/assets\/+[^/]+\/+)_[^/]+\/+/, "$1");
		if (domain_nowww === "semainedelacritique.com" && string_indexof(src, "/ttimg-rsz") >= 0) {
			newsrc = src.replace(/.*\/ttimg-rsz\?(?:.*&)?src=([^&]*).*/, "$1");
			if (newsrc !== src)
				return urljoin(src, newsrc, true);
		}
		if (domain === "photo.gala.fr") {
			return {
				url: src,
				head_wrong_contentlength: true
			};
		}
		if (domain === "cdn.cnn.com" ||
			(domain_nosub === "turner.com" && domain.match(/^(?:i[0-9]*\.)?cdn\.turner\.com/))) {
			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|plus))?(?:-(?:[0-9]+|gallery))?(\.[^/.]*)$/, "$1"),
				can_head: false
			};
		}
		if (domain === "media.cnn.com") return src.replace(/(\/api\/+v1\/+images\/[^?#]+)(?:[?#].*)?$/, "$1?c=original");
		if (domain === "ugc.kn3.net" /* &&
			string_indexof(src, "/i/origin/") >= 0*/) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/i\/(?:c_)?[0-9a-z]+\//, "");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "media.shoko.fr" ||
			domain === "media.fan2.fr" ||
			domain === "media.melty.it" ||
			domain === "media.virginradio.fr" ||
			domain === "media.melty.mx" ||
			domain === "media.melty.fr") {
			return src
				.replace(/(:\/\/[^/]*)\/([^/]*?)-[^-/]*((?:-f[^/]*)?\.[^/.]*)$/, "$1/$2-redim$3")
				.replace(/(:\/\/[^/]*)\/([^/-]*?-[0-9]*-)[^/-]*(-f[^/]*)?\//, "$1/$2redim$3/");
		}
		if (domain_nosub === "vogue.fr" ||
			domain_nowww === "glamourparis.com" ||
			domain_nowww === "gqmagazine.fr") {
			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") {
			newsrc = src.replace(/-(?:high|medium|low)(\.[^/.]*)$/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if ((domain_nosub === "reveliststatic.com" ||
			domain_nosub === "cafemom.com" ||
			domain_nosub === "cafemomstatic.com") &&
			domain.match(/^(?:cdn-)?ugc(?:-[0-9]*)?\./)) {
			return src.replace(/\/gen\/(?:constrain|crop|resize|min)\/[0-9]*\/[0-9]*\/[0-9]*\//, "/gen/full/");
		}
		if (domain === "images.shazam.com") return src.replace(/_s[0-9]+(\.[^/.]*)$/, "_s0$1");
		if (domain_nosub === "ebayimg.com") {
			obj = {
				url: src,
				can_head: false, // fixme: does it hang here too?
				bad_if: [{
						headers: {
							"x-ebay-c-extension": "responsecode=404,responsemessage=Not Found"
						}
					}]
			};
			newsrc = src.replace(/\/t\/.*?(\/[0-9]+\/s\/)/, "$1");
			if (newsrc !== src) {
				return fillobj_urls([newsrc, src], obj);
			}
			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 fillobj_urls([newsrc, src], obj);
			}
			newsrc = src
				.replace(/\/thumbs\/images\//, "/images/")
				.replace(/-l[0-9]+(\.[^/.]*)$/, "-l9999$1");
			if (newsrc !== src) {
				return fillobj_urls([newsrc, src], obj);
			}
			return obj;
		}
		if ((domain_nosub === "ebaystatic.com" && domain.match(/thumbs[0-9]*\.ebaystatic\.com/)) ||
			domain === "securethumbs.ebay.com") {
			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 === "q.ebaystatic.com") {
			if (/\/pics\/+cmp\/+ui\/+imgzoomregionmask/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "picclickimg.com") {
			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") {
			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") return src.replace(/^[a-z]+:\/\/[^/]*\/+d\//, "https://securethumbs.ebay.com/d/");
		if (domain === "i.slkimg.com") {
			return src
				.replace(/\/fill\/[0-9]+,[0-9]+\//, "/")
				.replace(/[0-9]+(\.[^/.]*)$/, "999999999$1");
		}
		if (domain === "i.vimeocdn.com" && string_indexof(src, "/filter/overlay") >= 0) {
			return decodeURIComponent(src.replace(/.*\/overlay\?.*?src0=([^&]*).*/, "$1"));
		}
		if (domain === "i.vimeocdn.com") {
			newsrc = src.replace(/(:\/\/[^/]+\/+(?:video|portrait|vod_poster)\/+[0-9]+(?:-[0-9a-f]{20,}-d)?)_[0-9]+x[0-9]+(\.[^/.?#]+)?(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src) {
				return newsrc;
			}
		}
		if (host_domain_nowww === "vimeo.com" && options.element) {
			newsrc = common_functions["get_pagelink_el_matching"](options.element, /^[a-z]+:\/\/(?:www\.)?vimeo\.com\/+([0-9]+)(?:[?#].*)?$/);
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "vimeo.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+([0-9]+)(?:[?#].*)?$/);
			if (match) {
				id = match[1];
				var query_vimeo_clippageconfig = function(id, cb) {
					api_query("vimeo:" + id, {
						url: "https://vimeo.com/" + id,
						headers: {
							Referer: ""
						}
					}, cb, function(done, resp, cache_key) {
						var match = resp.responseText.match(/window\.vimeo\.clip_page_config\s*=\s*({.*?});\s*\n/);
						if (!match) {
							console_warn(cache_key, "Unable to find match for", resp);
							return done(null, false);
						}
						try {
							var json = JSON_parse(match[1]);
							return done(json, 60 * 60);
						} catch (e) {
							console_error(cache_key, e);
							return done(null, false);
						}
					});
				};
				var get_id_from_vimeo_playerconfig_url = function(url) {
					var match = url.match(/^[a-z]+:\/\/player\.vimeo\.com\/+video\/+([0-9]+)\/+config/);
					if (match)
						return match[1];
					return null;
				};
				var query_vimeo_playerconfig = function(url, cb) {
					var id = get_id_from_vimeo_playerconfig_url(url);
					if (!id)
						return cb(null);
					api_query("vimeo_playerconfig:" + id, {
						url: url,
						headers: {
							Origin: "https://vimeo.com",
							Referer: "https://vimeo.com/" + id
						}
					}, cb, function(done, resp, cache_key) {
						try {
							var json = JSON_parse(resp.responseText);
							return done(json, json.request.expires || 60 * 60);
						} catch (e) {
							console_error(cache_key, e);
							return done(null, false);
						}
					});
				};
				var page_nullobj = {
					url: src,
					is_pagelink: true
				};
				var get_obj_from_vimeo_playerconfig = function(data) {
					if (!data || !data.request || !data.video)
						return page_nullobj;
					var obj = { extra: {} };
					var urls = [];
					if (data.video.title) {
						obj.extra.caption = data.video.title;
					}
					if (data.video.share_url) {
						obj.extra.page = data.video.share_url;
					}
					try {
						var files = data.request.files;
						var progressive = files.progressive;
						var max = 0;
						var maxobj = null;
						for (var i = 0; i < progressive.length; i++) {
							var ourobj = progressive[i];
							if (!ourobj.url)
								continue;
							var oursize = ourobj.width * ourobj.height;
							if (oursize > max) {
								max = oursize;
								maxobj = ourobj;
							}
						}
						if (maxobj) {
							urls.push({
								url: maxobj.url,
								video: true
							});
						}
						urls.push(data.video.thumbs.base);
					} catch (e) {
						console_error(e);
					}
					urls.push(page_nullobj);
					return fillobj_urls(urls, obj);
				};
				var query_vimeo_for_obj = function(id, cb) {
					query_vimeo_clippageconfig(id, function(data) {
						if (!data || !data.player || !data.player.config_url)
							return cb(page_nullobj);
						query_vimeo_playerconfig(data.player.config_url, function(data) {
							cb(get_obj_from_vimeo_playerconfig(data));
						});
					});
				};
				if (options.do_request && options.cb) {
					query_vimeo_for_obj(id, options.cb);
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if (domain === "imagelab.nownews.com") {
			return decodeURIComponent(src.replace(/.*[/?&]src=(.*)$/, "$1"));
		}
		if (host_domain_nowww === "discord.com" && options.element) {
			var has_discord_class_1 = function(el, cl) {
				var regex = new RegExp("^" + cl + "_+[0-9a-f]+$");
				for (var _i = 0, _a = el.classList; _i < _a.length; _i++) {
					var c = _a[_i];
					if (regex.test(c))
						return true;
				}
				return false;
			};
			if (options.element.tagName === "IMG" && has_discord_class_1(options.element, "lazyImg")) {
				var el_1 = common_functions["get_parent_el_matching"](options.element, function(x) {
					return has_discord_class_1(x, "imageWrapper");
				});
				if (el_1) {
					var ael_1 = el_1.querySelector('a[data-role="img"]');
					return ael_1.href;
				}
			}
		}
		if (domain === "cdn.discordapp.com") {
			return src
				.replace(/(\/emojis\/+[0-9]+\.[^/.?#]+)(?:[?#].*)?$/, "$1?size=4096")
				.replace(/(\/[-a-z]+\/+[0-9]{5,}\/+(?:users\/+[0-9]+\/+avatars\/+)?[^/]+\.[^/.?#]+)(?:[?#].*)?$/, "$1?size=4096");
		}
		if (domain === "media.discordapp.net") {
			newsrc = src.replace(/(\/stickers\/+[0-9]{5,}\.[^/.?#]+)(?:[?#].*)?$/, "$1?size=4096");
			if (newsrc !== src)
				return newsrc;
			if (/\/attachments\/+[0-9]+\/+/.test(src)) {
				return keep_queries(src, ["ex", "is", "hm"]);
			}
		}
		if (domain_nosub === "discordapp.net" && domain.match(/images-ext-[0-9]*\.discordapp\.net/)) {
			return decodeURIComponent(src.replace(/.*\/external\/[^/]*\/(?:([^/]*)\/)?(https?)\/(.*?)(?:\?[^/]*)?$/, "$2://$3$1"));
		}
		if (domain_nowww === "hot-korea.net") return src.replace(/\/uploads\/+([^/]*\/+)thumbs\//, "/uploads/$1");
		if (domain_nosub === "sndcdn.com" && domain.match(/i[0-9]*\.sndcdn\.com/)) {
			newsrc = src.replace(/-[^-/.]*(\.[^/.]*)$/, "-original$1");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (domain_nowww === "soundcloud.com") {
			var soundcloud_get_clientid_from_js_resp = function(resp) {
				var match = resp.responseText.match(/[{,]client_id:("[^"]{20,}"),/);
				if (!match) {
					console_error("Unable to find text from", resp);
					return null;
				}
				return JSON_parse(match[1]);
			};
			var soundcloud_fetch_clientid_from_js = function(jsfile, cb) {
				api_query("soundcloud:clientid:js:" + jsfile, {
					url: jsfile,
					headers: {
						Referer: "https://soundcloud.com/",
						Origin: "https://soundcloud.com"
					}
				}, cb, function(done, resp, cache_key) {
					var clientid = soundcloud_get_clientid_from_js_resp(resp);
					return done(clientid, clientid ? 2 * 60 * 60 : false);
				});
			};
			var soundcloud_fetch_clientid_js_from_resp = function(resp, cb) {
				var match = match_all(resp.responseText, /<script crossorigin src="(https?:\/\/[^/]+\.sndcdn\.com\/+assets\/+1-[0-9a-f]+(?:-[0-9]+)?\.js)"><\/script>/);
				if (!match || !match.length) {
					console_error("Unable to find clientjs match from", resp);
					return cb(null);
				}
				var lastmatch = match[match.length - 1];
				var url = lastmatch[1];
				soundcloud_fetch_clientid_from_js(url, cb);
			};
			var query_soundcloud = function(clientid, url, cb) {
				api_query("soundcloud_api:" + url, {
					url: url + "?client_id=" + clientid,
					imu_mode: "xhr",
					headers: {
						Accept: "*/*",
						Origin: "https://soundcloud.com",
						Referer: " https://soundcloud.com/",
						"Sec-Fetch-Dest": "empty",
						"Sec-Fetch-Mode": "cors",
						"Sec-Fetch-Site": "same-site"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					return done(resp, 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: {
					regex: /^[a-z]+:\/\/[^/]+\/+([^/]+)\/+([^/]+)\/*(?:[?#].*)?$/,
					groups: ["author", "permalink_id"]
				},
				query_for_id: "https://soundcloud.com/${author}/${permalink_id}",
				id: "${author}/${permalink_id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/,(\[{"id":[0-9]+,"chunks":\[[0-9]+\],"data":.*?}\])\);<\/script/);
					if (!match) {
						match = resp.responseText.match(/__sc_hydration\s*=\s*(\[.*?\]);<\/script/);
					}
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					var author_data, track_data;
					array_foreach(json, function(data) {
						var kind = null;
						if (!data.hydratable) {
							if (!data.data || data.data.length !== 1)
								return;
							data = data.data[0];
							kind = data.kind;
						} else {
							kind = data.hydratable;
							data = data.data;
						}
						if (kind === "user") {
						} else if (kind === "track" || kind === "sound") {
							track_data = data;
						}
					});
					if (!track_data) {
						console_error(cache_key, "Unable to find track data from", resp);
						return done(null, false);
					}
					if (false && !author_data) {
						console_warn(cache_key, "Unable to find author data from", resp);
					}
					var obj = {
						extra: {
							page: track_data.permalink_url,
							id: track_data.id,
							created_date: new Date(track_data.created_at).getTime(),
							updated_date: new Date(track_data.last_modified).getTime(),
							caption: track_data.title || track_data.description,
							author_username: track_data.user.username,
						}
					};
					var waiting = false;
					var urls = [];
					if (!track_data.media || !track_data.media.transcodings || !track_data.media.transcodings.length) {
						console_warn(cache_key, "Unable to find audio from", track_data, resp);
					} else {
						soundcloud_fetch_clientid_js_from_resp(resp, function(clientid) {
							var backup = fillobj_urls(urls, obj);
							if (!clientid)
								return done(backup, 60 * 60);
							var progressive = null;
							array_foreach(track_data.media.transcodings, function(media) {
								if (media.format.protocol !== "progressive") {
									return;
								}
								progressive = media.url;
								return false;
							});
							if (!progressive) {
								console_error(cache_key, "Unable to find progressive track from", track_data);
								return done(backup, 60 * 60);
							}
							query_soundcloud(clientid, progressive, function(data) {
								if (!data || !data.url) {
									console_error(cache_key, "Unable to fetch progressive track url", track_data, resp);
									return done(backup, 60 * 60);
								}
								urls.unshift({
									url: data.url,
									headers: {
										Referer: "https://soundcloud.com/"
									},
									media_info: {
										type: "audio"
									}
								});
								return done(fillobj_urls(urls, obj), 60 * 60);
							});
						});
						waiting = true;
					}
					urls.push(track_data.artwork_url.replace(/-[^-/.]*(\.[^/.]*)$/, "-original$1"));
					urls.push(track_data.artwork_url);
					if (!waiting)
						return done(fillobj_urls(urls, obj), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "licdn.com" && /^media(?:-[^.]+)?\./.test(domain)) {
			return src.replace(/\/shrinknp_[0-9]+_[0-9]+\//, "/");
		}
		if ((domain_nosub === "townnews.com" && domain.match(/bloximages\..*vip\.townnews\.com/)) ||
			amazon_container === "syd.cdn.coreweb.com.au") {
			return src.replace(/^(.*?:\/\/)[^/]*\//, "http://");
		}
		if (domain_nosub === "psbin.com" && domain.match(/cdn[^.]*\.psbin\.com/)) {
			return {
				url: src.replace(/\/img\/[^/]*=[^/]*\//, "/img/"), // repeated
				head_wrong_contentlength: true
			};
		}
		if (domain === "wac.450f.edgecastcdn.net") return src.replace(/^(.*?:\/\/)[^/]*\/80450F\/(.*?)$/, "http://$2");
		if (domain === "gp1.wac.edgecastcdn.net") {
			return src.replace(/(\/images\/[0-9]*\/[^/]*\/)[^/]*:[^/]*\//, "$1"); // repeated
		}
		if (domain === "r.fashionunited.com") {
			newsrc = src.replace(/.*?\/(aHR0c.*?)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain === "cdn.tag-walk.com" ||
			domain === "d2r7w2ky9n5k2b.cloudfront.net") {
			return {
				url: src.replace(/\/(?:webp|jpeg)\/+[^/]+\/+/, "/webp/custom,fit_cover/"),
				can_head: false // 403
			};
		}
		if (domain_nowww === "century21.com") return src.replace(/.*?\/photo\/[0-9a-z]*x[0-9a-z]*\//, "https://");
		if (domain === "cdn.instructables.com") return src.replace(/(:\/\/[^/]*\/)(.*)\.[^/.]*(\.[^/.]*)$/, "$1ORIG/$2$3");
		if (domain_nosub === "pressreader.com" && domain.match(/cdn[0-9]*-img\.pressreader\.com/)) {
			return src.replace(/getimage\.aspx[^/]*[?&](regionKey=[^&]*).*$/, "getimage.aspx?$1");
		}
		if (domain_nowww === "layfielddesign.com") return src.replace(/\/uploads\/+([^/]*)\/+_[^/]*\//, "/uploads/$1/");
		if (googlestorage_container === "mediaslide-europe") {
			return src.replace(/\/[a-z]*-([^/]*)$/, "/$1");
		}
		if (domain_nosub === "netinfo.bg" && domain.match(/m[^.]*\.netinfo\.bg/)) {
			return src.replace(/([/=]media\/images\/[0-9]*\/[0-9]*\/)(?:r-)?[^-/.]*-[^-/.]*/, "$1orig-orig");
		}
		if (domain_nowww === "imgur.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:a|gallery)\/+([a-zA-Z0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					common_functions["imgur_fetch_album_media"](options, api_cache, "album", match[1], function(data) {
						if (!data)
							return cb(null);
						if (!data.media || data.media.length === 0) {
							console_error("Unable to find images in", data);
							return cb(null);
						}
						var imageobjs = [];
						array_foreach(data.media, function(image) {
							var baseobj = { extra: {} };
							var obj = common_functions["imgur_image_to_obj"](options, baseobj, image);
							imageobjs.push(fillobj_urls(obj, baseobj));
						});
						var obj = {
							extra: {
								page: data.url,
								caption: data.title || null
							}
						};
						if (data.created_at) {
							obj.extra.created_date = new Date(data.created_at).getTime();
						}
						if (data.media.length > 1) {
							obj.album_info = {
								type: "links",
								links: []
							};
							array_foreach(imageobjs, function(imageobj, i) {
								obj.album_info.links.push({
									url: imageobj[0].extra.page,
									is_current: i === 0
								});
							});
						}
						var newobj = fillobj_urls(imageobjs[0], obj);
						return cb(newobj);
					});
				}
			});
			if (newsrc)
				return newsrc;
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([a-zA-Z0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					common_functions["imgur_fetch_album_media"](options, api_cache, "image", match[1], function(data) {
						if (!data)
							return cb(null);
						var baseobj = {
							extra: {
								page: data.url,
								caption: data.title || null
							}
						};
						if (data.created_at) {
							baseobj.extra.created_date = new Date(data.created_at).getTime();
						}
						var media = data;
						if (media.media && media.media[0])
							media = media.media[0];
						var obj = common_functions["imgur_image_to_obj"](options, baseobj, media);
						if (!obj) {
							console_error("Unable to parse obj from", data);
							return cb(null);
						}
						return cb(obj);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "i.imgur.com" ||
			domain === "i.imgur.io") {
			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 };
				return [
					{ url: baseobj.extra.page, is_pagelink: true },
					baseobj
				];
			}
			return baseobj;
		}
		if (domain === "imgur.dcard.tw" ||
			domain === "i.wgirlz.us") {
			return src.replace(/:\/\/[^/]*\//, "://i.imgur.com/");
		}
		if (domain_nowww === "siamzone.com") {
			return src
				.replace(/^[a-z]+:\/\/[^/]*\/board\/+(?:imgur\.php\?|imgur\/+.\/+)([^/]*)$/, "https://i.imgur.com/$1");
		}
		if (domain_nosub === "disp.cc" && /^i[0-9]*\./.test(domain)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+imgur\/+([^/?#]+)(?:[?#].*)?$/, "https://i.imgur.com/$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "i.stack.imgur.com") {
			return src.replace(/\?.*/, "");
		}
		if (domain_nowww === "vidble.com" ||
			domain === "i.vidble.com") {
			return src.replace(/_[^/._]*(\.[^/.]*)$/, "$1");
		}
		if (domain === "itpro.nikkeibp.co.jp") return src.replace(/\/thumb_[0-9]+_([^/]*)$/, "/$1");
		if (domain === "media-cdn.tripadvisor.com") return src.replace(/\/media\/photo-[a-z]\//, "/media/photo-o/");
		if (domain === "dynamic-media-cdn.tripadvisor.com") return src.replace(/:\/\/dynamic-([^?#]*)\?.*$/, "://$1");
		if (domain_nowww === "traveller.com.au" ||
			domain === "resources.stuff.co.nz" ||
			domain_nowww === "fairfaxstatic.com.au" ||
			domain_nowww === "smh.com.au" ||
			domain_nowww === "dailylife.com.au" ||
			domain_nowww === "essentialbaby.com.au") {
			return src.replace(/(\/images\/+(?:[0-9a-z]\/+){4,}image\.).*$/, "$1");
		}
		if (domain_nowww === "getwallpapers.com" ||
			domain_nowww === "hintergrundbild.org" ||
			domain_nowww === "wallpapertag.com") {
			return src.replace(/\/wallpaper\/+[^/]*\/+((?:[0-9a-f]\/+){3})/, "/wallpaper/full/$1");
		}
		if (domain === "ideascdn.lego.com") {
			return src
				.replace(/-thumbnail[^/.]*(\.[^/.]*)$/, "$1")
				.replace(/-square[^/.]*(\.[^/.]*)$/, "$1");
		}
		if (domain === "images.newindianexpress.com" ||
			domain === "images.indulgexpress.com") {
			return src.replace(/\/[wh][0-9]+X[0-9]*\//, "/original/");
		}
		if (domain_nosub === "blastingcdn.com" && domain.match(/staticr[0-9]*\.blastingcdn\.com/)) {
			return src
				.replace(/\/b_[auto0-9]+x[auto0-9]+\/([^/]*)$/, "/$1")
				.replace(/\/[0-9]+x[0-9]+\/([^/]*)$/, "/main/$1");
		}
		if (domain_nowww === "gjdream.com") return src.replace(/_tmb(\.[^/.]*)$/, "$1");
		if (domain === "www.imaeil.com") return src.replace(/\/m_wiz\/imgsrc[0-9]\.php.*?[?&]src=([^&]*).*/, "/$1");
		if (domain_nowww === "kwnews.co.kr") 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") return src.replace(/\/mnt\/+(?:thum|file_[a-z])\/+/, "/mnt/file/");
		if (domain === "db.kookje.co.kr") {
			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") {
			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" ||
			domain_nowww === "viva100.com") {
			return src.replace(/\/webdata\/+content\/+([0-9]{4}y\/+[0-9]{2}m\/+[0-9]{2}d\/+)crop([0-9]+\.[^/.]+)(?:[?#].*)?$/, "/file/$1$2");
		}
		if (domain === "img.asiatoday.co.kr") {
			newsrc = src.replace(/(\/file\/+.*\/+[0-9]{10,}_)[0-9]+\./, "$11.");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "img.asiatoday.co.kr") {
			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" ||
			(domain_nowww === "urbanbug.net" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "shobiddak.com" && /\/uploads\/+picture\//.test(src)) ||
			(domain_nowww === "celebs-news.ru" && string_indexof(src, "/images/") >= 0)) {
			return src.replace(/\/thumb_([^/]*)$/, "/$1");
		}
		if (domain === "cdn.ppomppu.co.kr" ||
			domain_nowww === "popco.net") {
			return src.replace(/(\/zboard\/+data[0-9]*\/+(?:[^/]*\/+)?[0-9]{4}\/+[0-9]{2}\/*[0-9]{2}\/+)(?:thumb|m)_/, "$1");
		}
		if (domain === "media.codeweavers.com") return src.replace(/\/thumb_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain === "img.tvreport.co.kr" ||
			domain === "img.tvreportcdn.de") {
			return src.replace(/_[0-9]*(\.[^/.]*)$/, "_0$1");
		}
		if (domain === "ojsfile.ohmynews.com") {
			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" ||
			domain === "cmsimg.global.mnet.com") {
			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") return src.replace(/_[0-9]*(\.[^/.]*)$/, "$1");
		if ((domain_nosub === "st-hatena.com" && /^cdn-ak-scissors\./.test(domain)) ||
			domain === "cdn-scissors.gigaviewer.com" ||
			domain === "cdn.image.st-hatena.com") {
			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/)) {
			return src.replace(/_(?:[0-9]+|m)(\.[^/.]*)$/, "$1");
		}
		if (domain === "nimage.newsway.kr") {
			if (src.match(/[?&]simg=[%/]/)) {
				return decodeURIComponent(src.replace(/\/phpwas\/restmb_idxmake\.php.*?simg=([^&]*).*?$/, "$1"));
			}
		}
		if (domain === "imgsrv.piclick.me") {
			newsrc = src.replace(/\/publish\.php\?(?:.*&)?pid=([0-9]+)(?:[?#].*)?$/, "/cimg/$1.jpg");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/cimg\/+[0-9]+x[0-9]+x/, "/cimg/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/cimg\/+N_/, "/cimg/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "slate.com") return src.replace(/(\/[^/.]*\.[^/.]*)\.[^/]*$/, "$1");
		if (domain === "img.cinemablend.com" ||
			domain === "img.minq.com") {
			return src.replace(/(:\/\/[^/]*\/)filter:[^/]*\/(.*?)(?:\?[^/]*)?$/, "$1$2");
		}
		if (domain_nowww === "cinemablend.com") {
			if (/\/static\/+images\/+icons\/+/.test(src))
				return {
					url: origsrc,
					bad: "mask"
				};
		}
		if (((domain_nosub === "abcimg.es" && domain.match(/r[0-9]*\.abcimg\.es/)) ||
			domain === "resizer.lasprovincias.es" ||
			domain === "resizer.abc.es" ||
			domain === "resizer.elcorreo.com") &&
			string_indexof(src, "/resizer.php") >= 0) {
			newsrc = src.replace(/.*\/resizer\.php.*?[?&]imagen=([^&]*).*$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "resizer.elnortedecastilla.es" ||
			domain === "resizer.ideal.es" ||
			domain === "resizer.nortecastilla.es") {
			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") return src.replace(/\/thumb[a-z]*-[0-9]+x[0-9]+\//, "/");
		if (domain_nowww === "coleman-rayner.com" &&
			string_indexof(src, "/watermark/insertwm.php?") >= 0) {
			return {
				can_head: false,
				url: decodeURIComponent(src.replace(/.*\/watermark\/insertwm\.php.*?[?&]src=([^&]*).*$/, "$1"))
			};
		}
		if (domain === "media.guestofaguest.com") return src.replace(/(:\/\/[^/]*\/)[^/]*\/(wp-content|gofg-media)\//, "$1$2/");
		if (domain === "d3wo5wojvuv7l.cloudfront.net") {
			return src
				.replace(/^[a-z]+:\/\/[^/]+\/+(images\.spreaker\.com\/)/, "http://$1")
				.replace(/(:\/\/[^/]+\/+)t_[^/.]+\/+/, "$1");
		}
		if (domain_nosub === "heartyhosting.com" &&
			domain.match(/i[0-9]*\.heartyhosting\.com/)) {
			return src.replace(/.*?:\/\/[^/]*\//, "http://");
		}
		if (domain === "images.contactmusic.com") {
			newsrc = src.replace(/-cm(\.[^/.]*)$/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "contactmusic.com") {
			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") return src.replace(/(\/i\/[0-9]*)\/.*/, "$1");
		if (domain === "th.bing.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+th\/+id\/+R\.?[a-f0-9]{30,}\?(?:.*&)?riu=(http[^&]+).*/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if ((domain_nosub === "bing.net" && domain.match(/tse[0-9]*\.(?:mm|explicit)\.bing\.net/)) ||
			domain_nosub === "bing.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/th[^/]*[?&]rurl=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
			newsrc = src.replace(/(:\/\/[^/]*)\/th[^/]*[?&]id=([^&]*)&[^/]*$/, "$1/th?id=$2");
			if (newsrc !== src)
				return newsrc;
			if (/\/th\/+id\//.test(src)) {
				newsrc = remove_queries(src, ["w", "h", "rs", "qlt"]);
				if (newsrc !== src)
					return newsrc;
			}
		}
		if (domain === "cdn.4archive.org") return src.replace(/(\/img\/[^/.]{7})m(\.[^/.]*)$/, "$1$2");
		if (domain === "i.4cdn.org" ||
			domain === "i.4pcdn.org") {
			return fillobj_urls(add_extensions(src.replace(/(\/[0-9]*)s(\.[^/.]*)$/, "$1$2")), {
				headers: {
					Referer: ""
				},
				referer_ok: {
					same_domain_nosub: true
				}
			});
		}
		if (domain === "img.4plebs.org" ||
			domain === "img.fireden.net" ||
			domain === "img-lb.fireden.net" ||
			domain === "torako.wakarimasen.moe" ||
			domain_nowww === "thebarchive.com" ||
			domain_nosub === "desu-usergeneratedcontent.xyz" ||
			(domain_nosub === "nyafuu.org" && /^archive-media/.test(domain)) ||
			domain_nowww === "archiveofsins.com") {
			var baseobj_1 = {};
			if (domain_nowww === "thebarchive.com" ||
				domain_nowww === "archiveofsins.com") {
				baseobj_1 = {
					headers: {
						Referer: "https://" + domain + "/"
					}
				};
			}
			newsrc = src.replace(/\/thumb(\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]+)s(\.[^/.]*)(?:[?#].*)?$/, "/image$1$2");
			if (newsrc !== src)
				return fillobj_urls(add_full_extensions(newsrc), baseobj_1);
			baseobj_1.url = src;
			return baseobj_1;
		}
		if (domain === "arch.b4k.co") {
			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;
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+media\/+([^/]+)\/+thumb\/+[0-9]+\/+[0-9]+\/+([0-9]+)s(\.[^/.]*)$/, "https://arch-img.b4k.co/$1/$2$3");
			if (newsrc !== src)
				return add_full_extensions(newsrc);
		}
		if (domain === "i.warosu.org") return src.replace(/\/thumb\/([0-9]+\/[0-9]+\/[0-9]+)s?(\.[^/.]*)$/, "/img/$1$2");
		if (domain === "ii.yakuji.moe" ||
			domain_nowww === "iichan.hk" ||
			domain_nosub === "2chan.net" ||
			domain_nowww === "kurisa.ch" ||
			domain_nowww === "niuchan.org" ||
			domain_nowww === "nowere.net" ||
			domain_nowww === "ponyach.ru" ||
			domain_nowww === "02ch.su" ||
			domain_nowww === "410chan.org" ||
			domain_nowww === "desuchan.net" ||
			domain_nowww === "ernstchan.xyz" ||
			domain_nowww === "neochan.net" ||
			domain === "gaia.komica1.org" ||
			domain === "aqua.komica.org") {
			newsrc = src.replace(/\/thumb\/([0-9]{5,}(?:-[0-9]+)?)s?(\.[^/.]*)$/, "/src/$1$2");
			if (newsrc !== src)
				return add_full_extensions(newsrc, ["mp4", "webm", "png", "jpg", "jpeg"]);
		}
		if (domain_nowww === "crystal.cafe" ||
			domain === "cdn.syn-ch.com" ||
			domain === "cdn.syn-ch.org" ||
			domain_nowww === "alphachan.org" ||
			(domain_nowww === "zonadelta.net" && string_indexof(src, "/deltachan/") >= 0) ||
			domain_nowww === "wikieat.club" ||
			domain_nowww === "kropyva.ch" ||
			domain_nowww === "lainchan.org" ||
			domain_nowww === "ponychan.net" ||
			domain_nowww === "2-ch.su" ||
			domain_nowww === "2--ch.ru" ||
			domain_nowww === "55chan.org" ||
			domain_nowww === "leftychan.net" ||
			domain_nowww === "anonimageboards.com" ||
			domain_nowww === "lolcow.farm") {
			newsrc = src.replace(/\/thumb\//, "/src/");
			if (newsrc !== src)
				return add_full_extensions(newsrc, ["mp4", "webm", "png", "jpg", "jpeg"]);
		}
		if (domain_nowww === "2ch.hk" ||
			domain_nowww === "2ch.pm" ||
			domain_nowww === "2channel.moe" ||
			domain_nowww === "2ch.rip" ||
			domain_nowww === "dva-ch.net" ||
			domain_nowww === "shisharc.com") {
			return add_extensions(src.replace(/\/thumb\/([0-9]+\/[0-9]+)s(\.[^/.]*)$/, "/src/$1$2"));
		}
		if (domain_nowww === "m2ch.hk") return src.replace(/\/big\/thumb(\/[0-9]+\/[0-9]+)s(\.[^/.]*)$/, "/src/$1$2");
		if (domain_nowww === "neochan.ru") {
			newsrc = src.replace(/:\/\/(?:www\.)?([^/]+\/+[^/]+\/+)thumb\/+/, ":\/\/s.$1");
			if (newsrc !== src) {
				obj = add_extensions_gif(newsrc);
				array_extend(obj, add_extensions_gif(src.replace(/\/thumb\//, "/src/")));
				return obj;
			}
		}
		if (domain_nowww === "soyjak.party") return src.replace(/\/thumb\//, "/src/");
		if (domain === "file.tinnhac.com" ||
			domain === "file.tintuckpop.net" ||
			domain === "media.bongda.com.vn" ||
			domain_nosub === "404content.com" ||
			domain === "image.vtcns.com" ||
			domain === "media.cungcau.vn" ||
			domain === "cdn-storage-tass.cdnvideo.ru" ||
			domain === "cdn-storage-media.tass.ru" ||
			domain === "image.vtc.vn") {
			return src
				.replace(/\/crop\/+[-0-9]+x[-0-9]+\//, "/")
				.replace(/\/resize\/+[-0-9]+x[-0-9]+\//, "/");
		}
		if (domain === "cdn-media.tass.ru") return src.replace(/(:\/\/[^/]+\/+)width\/+[0-9]+_[0-9a-f]+\/+/, "$1");
		if ((domain_nosub === "zadn.vn" && domain.match(/^photo-resize-/)) ||
			domain === "org.photo-resize.mp3.zdn.vn") {
			newsrc = src.replace(/(:\/\/[^/]*\/+)w[0-9]+h[0-9]+(?:_[a-z]+)?\/+/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "image.mp3.zdn.vn") return src.replace(/\/thumb\/+[0-9]+_[0-9]+\/+/, "/");
		if (domain_nosub === "zadn.vn" ||
			(domain_nosub === "vov.vn" && domain.match(/images?\.(?:[^/.]*\.)?vov\.vn/)) ||
			domain === "ss-images.catscdn.vn" ||
			domain_nosub === "zdn.vn" ||
			domain === "media.stylenews.vn" ||
			domain === "img.vietnamplus.vn" ||
			domain === "cdnimg.vietnamplus.vn" ||
			(domain_nosub === "baonghean.vn" && domain.match(/^image[0-9]*\./)) ||
			domain === "image.baophapluat.vn" ||
			domain === "image.giaoducthoidai.vn" ||
			domain === "image.laodong.com.vn" ||
			domain === "cdn-images.saostar.vn" ||
			(domain_nosub === "tienphong.vn" && domain.match(/image[0-9]*\.tienphong\.vn/)) ||
			(domain_nosub === "infonet.vn" && /^img[0-9]*/.test(domain)) ||
			domain === "img.giaoduc.net.vn" ||
			domain === "media.laodong.vn") {
			newsrc = src
				.replace(/(:\/\/[^/]*)\/+[wht]p?m?[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" ||
			domain_nowww === "dantricdn.com" ||
			domain_nowww === "afamilycdn.com" ||
			domain_nosub === "cafebizcdn.vn" ||
			domain_nosub === "sohacdn.com" ||
			domain_nosub === "kenh14cdn.com" ||
			domain === "cafebiz.cafebizcdn.vn" ||
			domain_nosub === "vcmedia.vn" ||
			domain_nosub === "genkcdn.vn" ||
			domain === "icdn.dantri.com.vn" ||
			domain_nosub === "mediacdn.vn") {
			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" ||
			domain_nosub === "24h.com.vn" ||
			(domain_nosub === "danviet.vn" && domain.match(/^streaming[0-9]*\./)) ||
			(domain_nosub === "eva.vn" && domain.match(/^image(?:-[a-z]+)?\./)) ||
			domain === "anh.eva.vn") {
			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/)) ||
			(domain_nowww === "myzutv.ro" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "rainews.it" && string_indexof(src, "/img/") >= 0) ||
			(domain === "a.jeu.cc" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "soyuz.ru" && /\/uploads\/+files\//.test(src)) ||
			(domain_nowww === "mjuznews.com" && string_indexof(src, "/photos/") >= 0)) {
			return src.replace(/\/[0-9]+x[0-9]+_([^/]*)$/, "/$1");
		}
		if (domain_nowww === "raiplay.it") return src.replace(/\/cropgd\/+[0-9]+x[0-9]+\/+/, "/");
		if (domain_nosub === "autoimg.cn") return src.replace(/\/(?:[0-9]+x[0-9]+_(?:[0-9]+_)?|[0-9]+_)([^/]+)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "xperienceunited.com") {
			return src
				.replace(/(\/userphotos\/+[0-9a-f]+-[0-9]+)-thumbnail([?#].*)?$/, "$1.webp$2")
				.replace(/(\/userphotos\/+[0-9a-f]+-[0-9]+)-[0-9]+\./, "$1.");
		}
		if (domain === "image.thanhnien.vn") {
			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?
			};
		}
		if (domain === "images2.thanhnien.vn") {
			return src
				.replace(/(:\/\/[^/]+\/+[0-9]{5,}\/+[0-9]{4}\/+(?:[0-9]{1,2}\/+){2}[^/.]+?)-(?:[0-9]+-){4}crop-[0-9]+\./, "$1.")
				.replace(/(:\/\/[^/]+\/+)(?:zoom\/+[0-9]+_[0-9]+|thumb_[wh]\/+[0-9]+)\/+/, "$1");
		}
		if (domain === "media-local.phunu365.net" ||
			domain === "media-local.mywow.vn") {
			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/)) ||
			domain === "media.doisongphapluat.com" ||
			domain === "media.vietq.vn" ||
			domain_nowww === "baouc.com" ||
			domain === "media.hay.tv" ||
			domain === "media.hotbirthdays.com") {
			return src.replace(/(:\/\/[^/]*)\/[^/]*x[0-9]+x(?:[0-9]+)?\//, "$1/");
		}
		if (domain_nowww === "wowkorea.live" ||
			(domain_nowww === "fotofap.net" && string_indexof(src, "/img/") >= 0) ||
			domain === "images.vfl.ru") {
			return src.replace(/(\/[0-9]*)_[a-z](\.[^/.]*)$/, "$1$2");
		}
		if (domain === "content.erooups.com") return src.replace(/(\/img[0-9]*\/+[0-9]{8}\/+[0-9]+\/+[^/]*)_(?:m|thumb)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "seoul.co.kr" && domain.match(/img[^.]*\.seoul\.co\.kr/)) {
			return src.replace(/_[A-Z](?:[0-9]){0,2}(\.[^/.]*)$/, "$1");
		}
		if (domain === "img.yonhapnews.co.kr" ||
			domain === "vmg.yonhapnews.co.kr" ||
			(domain_nosub === "yna.co.kr" && domain.match(/^img[0-9]*\./))) {
			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/)) {
			return src.replace(/.*:\/\/[^/]*\/gate\/[^/]*\//, "http://");
		}
		if (domain_nosub === "bunjang.net") {
			return {
				url: src.replace(/_[wh][0-9]*(\.[^/.]*)$/, "$1"),
				can_head: false // 404
			};
		}
		if (domain === "betanews.heraldcorp.com" ||
			domain_nowww === "betanews.net") {
			return src
				.replace(/(\/imagedb\/(:?[^/]*\/)?)(?:first|thumb)\//, "$1orig/");
		}
		if (domain === "img.smlounge.co.kr") return src.replace(/\/thumb\/([^/.]*)-sample[^/.-]*(\.[^/.]*)$/, "/$1$2");
		if (domain === "img.etoday.co.kr") return src.replace(/(\/pto_db\/+[0-9]{4}\/+[0-9]{2}\/+)[0-9]+\/+([0-9]+_[0-9]+[^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "image.tving.com" &&
			string_indexof(src, "tving.com/resize.php") >= 0) {
			return src.replace(/.*:\/\/[^/]*\/resize\.php.*?[?&]u=([^&]*).*/, "$1");
		}
		if (domain === "cdn.pastemagazine.com") {
			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") return src.replace(/\/news\/+assets_[^/]*\/+[0-9]{4}\/+[0-9]{2}\/+([^-]*)-.*(\.[^/.]*)$/, "/news/img/$1$2");
		if (domain_nowww === "seichimap.jp") {
			newsrc = src.replace(/(\/[^/]*\/)assets_[^/]*\/+[0-9]{4}\/+[0-9]{2}\/+([^-]*)-.*(\.[^/.]*)$/, "$1pht/$2$3");
			if (newsrc !== src) {
				return add_extensions_upper(newsrc);
			}
		}
		if (domain === "community.pia.jp") return src.replace(/(\/stage_pia)\/+assets_[^/]*\/+[0-9]{4}\/+[0-9]{2}\/+([^-/]*)-.*(\.[^/.]*)$/, "$1/img/$2$3");
		if (domain === "lp.p.pia.jp") return src.replace(/(\/shared\/+materials\/+[-0-9a-f]{10,}\/+)thumbnail(?:[?#].*)?$/, "$1origin.jpg");
		if (domain === "cdn.fashionsnap.com" ||
			domain_nowww === "fashionsnap.com") {
			return src.replace(/:\/\/[^/]*\/collection\/+assets_c\/+([0-9]{4}\/+[0-9]{2}\/+[^/]*)-thumb-[auto0-9]+x[auto0-9]+-[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "://res.fashionsnap.com/image/upload/media2/$1$2");
		}
		if (domain_nowww === "joqr.co.jp") {
			newsrc = src.replace(/(:\/\/[^/]*\/agson\/+)assets_c\/+[0-9]{4}\/+[0-9]{2}\/+([^/]*)-thumb-[auto0-9]+x[auto0-9]+-[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
			if (newsrc !== src)
				return add_extensions_upper(newsrc);
		}
		if (domain === "sportiva.shueisha.co.jp") return src.replace(/(:\/\/[^/]+\/+contents\/+entertainment\/+[0-9]{4}\/+)assets_c\/+[0-9]{4}\/+[0-9]{2}\/+([^/]*)-thumb-[auto0-9]+x[auto0-9]+-[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1images/$2$3");
		if (domain_nowww === "rooftop1976.com") return src.replace(/(\/news)\/+assets_[^/]*\/+[0-9]{4}\/+[0-9]{2}\/+([^-/]*)-.*(\.[^/.]*)$/, "$1/$2$3");
		if (domain_nowww === "agencyteo.com") {
			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/)) {
			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]*(?:-prd)?\./) ||
				domain.match(/^[^.]*media\./))) {
			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]+\//)) {
			return src.replace(/\/size\/[0-9]+x[0-9]+\//, "/size/0x0/");
		}
		if (domain === "i.neoseeker.com" &&
			src.match(/\/p\/[0-9]*\/[0-9]*\//)) {
			return src.replace(/_thumb_([^/]*$)/, "_image_$1");
		}
		if (domain === "resource.supercheats.com") return src.replace(/\/library\/(?:(?:[0-9]*[wh])|thumbs)\//, "/library/");
		if (amazon_container === "intergi-phoenix") {
			return src.replace(/\/images\/thumb_large_([^/]*)$/, "/images/$1");
		}
		if (domain_nowww === "primagames.com" ||
			domain_nosub === "rockpapershotgun.com" ||
			domain === "assets.cosplaycentral.com" ||
			domain === "images.eurogamer.net" ||
			domain === "assets.rockpapershotgun.com") {
			return src.replace(/(\/[^/]*\.[^/.]*)\/[A-Z0-9]+\/(?:resize|format|crop|quality)?\/.*$/, "$1");
		}
		if (amazon_container === "assets.primagames.com") {
			return src.replace(/\/_resized\/+(images\/.*\.[^/._?#]+)_[0-9]+x[0-9]+_\.[^/.]+(?:[?#].*)?$/, "/$1");
		}
		if ((domain_nosub === "ixquick.com" ||
			domain_nosub === "startpage.com") &&
			domain.match(/s[0-9]*-[^.]*\./)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+cgi-bin\/+serveimage.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain_nowww === "startpage.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+av\/+proxy-image\?(?:.*&)?piurl=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (host_domain_nowww === "startpage.com" && /\/sp\/+search/.test(options.host_url) && options.element) {
			if (options.element.parentElement && options.element.parentElement.tagName === "DIV") {
				if (options.element.parentElement.classList.contains("image-container")) {
					var imgurl = options.element.parentElement.getAttribute("data-img-click-url");
					if (imgurl !== src)
						return imgurl;
				}
			}
		}
		if (domain === "beta.ems.ladbiblegroup.com") return src.replace(/\/s3\/content\/[0-9]+x[0-9]+\//, "/s3/content/");
		if (domain === "gaia.adage.com") return src.replace(/\/images\/bin\/image\/[^/]*\//, "/images/bin/image/");
		if (domain === "t-eska.cdn.smcloud.net") return src.replace(/\/[^/]*?n-([^/]*)$/, "/n-$1");
		if (domain === "cdn.wegow.com") return src.replace(/\.[-0-9]*x[-0-9]*(\.[^/.]*)$/, "$1");
		if (domain_nowww === "ecestaticos.com") return src.replace(/\/clipping\/[0-9]*\//, "/clipping/0/");
		if (domain_nowww === "sonarreykjavik.com" ||
			domain_nowww === "gamer.ru" ||
			domain_nosub === "linode.com" ||
			domain === "img.noritter.com" ||
			domain_nowww === "esportivo.net" ||
			domain_nowww === "pvgroup.ru" ||
			domain_nowww === "leit.is" ||
			domain_nowww === "rovina-project.eu" ||
			domain_nowww === "mmorpg.org.pl" ||
			domain_nowww === "girlspolish.jp" ||
			domain_nowww === "joah-girls.com" ||
			domain === "listas.eleconomista.es" ||
			domain_nowww === "gonintendo.com" ||
			(domain_nowww === "gozzip.id" && /\/BlogBody\/+photos\//.test(src)) ||
			domain_nowww === "greasyfork.org" ||
			domain === "static.themezy.com" ||
			domain === "static.vecteezy.com" ||
			domain_nowww === "hairhapi.com" ||
			domain_nowww === "babyfashion.me" ||
			domain === "cdn-learn.adafruit.com" ||
			domain_nowww === "advocate-art.com" ||
			domain === "d34gglw95p9zsk.cloudfront.net" ||
			domain_nowww === "sonar.es") {
			return src
				.replace(/(\/attached_images\/+[0-9]+\/+)[a-z]+\/+/, "$1original/")
				.replace(/(\/system\/+resources\/+)thumbnails\/+/, "$1previews/")
				.replace(/(\/(?:(?:system|images)\/+)?(?:(?:attached|item)_images|App\/+BlogBody|post_pictures|events|posts|items|articles|file_uploads|screenshots|resources|pictures|guides|Image|item_cocreco_images)\/+(?:(?:images|photos|files|assets|pictures|posters|uploads|screenshots|previews|imgs|cropped_images)\/+)?(?:[0-9]{3}\/+){3})[a-z_0-9]+\/+/, "$1original/");
		}
		if (domain === "pgw.udn.com.tw") return src.replace(/.*\/photo\.php.*?[?&]u=([^&]*).*/, "$1");
		if (domain === "uc.udn.com.tw") {
			return {
				url: src,
				can_head: false
			};
		}
		if ((domain_nosub === "hdslb.com" && domain.match(/i[0-9]*\.hdslb\.com/)) ||
			domain === "img.xiaohongshu.com" ||
			(domain_nosub === "xiaoka.tv" && domain.match(/alcdn\.img\.xiaoka\.tv/))) {
			if (/:\/\/[^/]+\/+bfs\/+videoshot\/+[0-9]+\.[^/]+(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			return src
				.replace(/(:\/\/[^/]*\/)[0-9]+_[0-9]+\//, "$1")
				.replace(/(\.[^/.]*)@[_0-9a-zQ]*(?:\.[^/.]*)?$/, "$1")
				.replace(/(\/[0-9a-f]{20,}\.[^/._]+)_[0-9]+x[0-9]+\.[^/]+(?:[?#].*)?$/, "$1");
		}
		if (domain === "d.ifengimg.com") return src.replace(/.*?\/[a-z]+[0-9]*(?:_[whq][0-9]*)?\//, "http://");
		if (domain_nowww === "nationalgeographic.com") return src.replace(/\.[^/]*(\.[^/.]*)$/, "$1");
		if (domain === "media.mnn.com" ||
			domain_nowww === "alljapantours.com" ||
			domain === "shows.gqimg.com.cn" ||
			domain === "shows.vogueimg.com.cn" ||
			(domain_nosub === "webcollage.net" && string_indexof(domain, "media.webcollage.net") >= 0) ||
			domain_nowww === "metronews.ca" ||
			domain === "images.meredith.com" ||
			domain === "img-cdn.jg.jugem.jp" ||
			domain_nowww === "anime-thai.net" ||
			domain_nowww === "mymypic.net" ||
			domain_nowww === "styleyen.com" ||
			domain_nowww === "nbstr.org" ||
			(domain_nosub === "forbiddenplanet.com" && domain.match(/^dyn[0-9]*\.media\.forbiddenplanet\.com/)) ||
			domain === "media.treehugger.com" ||
			(domain_nowww === "attitude.co.uk" && string_indexof(src, "/media/images/") >= 0) ||
			domain === "media.allyou.net" ||
			domain === "image.pbs.org" ||
			(domain_nowww === "plasticsurgerystar.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "peoplite.com" && string_indexof(src, "/public/album_photo/") >= 0) ||
			(domain === "cdn.admireme.vip" && string_indexof(src, "/media/") >= 0) ||
			(domain_nosub === "globo.com" && string_indexof(src, "/fotos/") >= 0) ||
			domain === "d26oc3sg82pgk3.cloudfront.net" ||
			(domain_nowww === "memberme.net" && string_indexof(src, "/media/") >= 0) ||
			(domain_nowww === "funasia.net" && string_indexof(src, "/site_media/") >= 0) ||
			domain === "image.photocnc.com" ||
			domain === "d53l9d6fqlxs2.cloudfront.net") {
			newsrc = src.replace(/(\/[^/.]*\.[^/.]*)\.[^/]*$/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "media.contentapi.ea.com") {
			newsrc = src.replace(/(\/[^/.]*\.[^/.]*)\.[^/]*$/, "$1");
			if (newsrc !== src)
				return {
					url: newsrc,
					can_head: false
				};
		}
		if (domain === "img.bleacherreport.net") {
			return src
				.replace(/\/crop_exact_([^/]*)$/, "/$1")
				.replace(/\?.*$/, "?w=999999999999&h=999999999999");
		}
		if (domain === "images.gr-assets.com") {
			return src
				.replace(/(\/(?:authors|users)\/[0-9]*p)[0-9]\//, "$18/")
				.replace(/(\/books\/[0-9]*)[a-z]\//, "$1l/");
		}
		if (domain === "dynamic.indigoimages.ca") return src.replace(/(\?.*)?$/, "?width=999999999");
		if (domain === "cdn.mos.cms.futurecdn.net") return src.replace(/-[0-9]+-[0-9]+(\.[^/.]*(?:\.webp)?)(?:[?#].*)?$/, "$1");
		if (domain === "www.allkpop.com") return src.replace(/\/af\/([0-9]*\/[^/]*)$/, "/af_org/$1");
		if (domain === "cwcontent.asiae.co.kr") {
			return src
				.replace(/^(.*?:\/\/).*\/[^/]*resize\/[0-9]*\/([^/]*)$/, "$1cphoto.asiae.co.kr/listimglink/4/$2");
		}
		if (domain === "cphoto.asiae.co.kr") {
			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") return src.replace(/.*\/(https?:\/\/)/, "$1");
		if (domain === "assets.atlasobscura.com") return src.replace(/\/article_images\/[0-9]*x\//, "/article_images/");
		if (domain_nowww === "wonderopolis.org" && string_indexof(src, "/_img") >= 0) {
			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" ||
			((domain_nosub === "mirror.co.uk" ||
				domain_nosub === "birminghammail.co.uk" ||
				domain_nosub === "dailypost.co.uk" ||
				domain_nosub === "bristolpost.co.uk" ||
				domain_nosub === "irishmirror.ie" ||
				domain_nosub === "coventrytelegraph.net" ||
				domain_nosub === "dublinlive.ie") &&
				domain.match(/i[0-9]*(?:-prod)?\./)) ||
			domain_nowww === "mirror.co.uk" ||
			domain === "beta.images.theglobeandmail.com" ||
			domain_nowww === "globalblue.com" ||
			(domain_nosub === "belfasttelegraph.co.uk" && domain.match(/^(?:cdn(-[0-9]+)?|www)\./)) ||
			domain_nowww === "ladylike.gr" ||
			domain_nowww === "24horas.cl" ||
			domain_nowww === "jyllands-posten.dk" ||
			domain_nowww === "svtstatic.se" ||
			domain_nowww === "adressa.no" ||
			domain_nowww === "miamiherald.com" ||
			domain_nowww === "filmweb.no" ||
			domain_nowww === "kansascity.com" ||
			domain_nowww === "sanluisobispo.com" ||
			domain_nowww === "star-telegram.com" ||
			domain_nosub === "jutarnji.hr" ||
			domain_nowww === "oneman.gr" ||
			domain_nowww === "th.thgim.com" ||
			domain_nowww === "thehindubusinessline.com" ||
			domain === "d30fl32nd2baj9.cloudfront.net" ||
			domain_nowww === "elsoldepuebla.com.mx" ||
			domain_nowww === "svensktnaringsliv.se" ||
			(domain_nosub === "jyllands-posten.dk" && /\/pictures\/+image\/+[0-9]+\//.test(src)) ||
			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)
		) {
			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") return src.replace(/\/IMAGE_ALTERNATES\/+[^/]*\/+/, "/IMAGE_BINARY/original/");
		if (domain_nowww === "tvn.pl") return src.replace(/\/alternates\/+[A-Z]+_[0-9]+(\/.*)?$/, "/BINARY$1");
		if (domain === "images.fandango.com" ||
			domain_nowww === "statf.com") {
			newsrc = src.replace(/\/ImageRenderer\/.*?\/images\//, "/images/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "images.fandango.com") return src.replace(/_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (amazon_container === "assets.forward.com") {
			return src.replace(/.*:\/\/[^/]*\//, "http://");
		}
		if (domain === "assets.forward.com" ||
			domain === "assets.forwardcdn.com") {
			return src.replace(/\/images\/cropped\//, "/images/");
		}
		if (domain_nowww === "thejewelleryeditor.com") return src.replace(/\/images_thumbnails\/+[^/]*_thumbnails\/+([^/]*\/+[0-9]*\/+[^/.]*\.[^_/.]*)__[^/]*(?:[?#].*)?$/, "/images/$1");
		if (domain_nowww === "sass.com.ua" ||
			domain === "media.globalcitizen.org" ||
			(domain_nowww === "kexp.org" && /:\/\/[^/]+\/+media\//.test(src)) ||
			domain === "bento.cdn.pbs.org") {
			return src.replace(/\/(?:filer_)?(?:public_)?thumbnails\/+(.*\/[^/]*?\.[a-z]+)__[^/]*(?:[?#].*)?$/, "/$1");
		}
		if (domain === "files.sharenator.com") return src.replace(/(:\/\/[^/]*\/)[^/.]+-s[0-9]+x[0-9]+-([0-9]{4,})(?:-[0-9]*)?(\.[^/.]*)$/, "$1$2$3");
		if (domain === "cdn.jolie.de" ||
			domain === "cdn.maedchen.de") {
			return src.replace(/\/image[0-9]*[wh]\//, "/original/");
		}
		if (domain === "img.mp.itc.cn" ||
			(domain_nowww === "wallpapercraze.com" && string_indexof(src, "/images/wallpapers/") >= 0) ||
			domain === "img.mp.sohu.com") {
			return src.replace(/_th(\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "qpic.cn" ||
			domain === "wx.qlogo.cn") {
			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" ||
			domain_nosub === "ii77.com" ||
			domain_nosub === "vhaor.com")
			&& domain.match(/^img[0-9]*\./)) {
			return src.replace(/:\/\/[^/]*\/mmbiz_jpg\//, "://mmbiz.qpic.cn/mmbiz_jpg/");
		}
		if (domain_nowww === "vod.lu" && /\/media\/+cache\//.test(src)) {
			return src.replace(/\/media\/+cache\/+(?:resolve\/+)?[0-9]+x[0-9]+\/+/, "/media/");
		}
		if (domain_nowww === "vogue.ua") {
			return src
				.replace(/\/media\/+cache\/+resolve\//, "/cache/")
				.replace(/\/cache\/+[^/]+\/+(uploads?)\//, "/$1/");
		}
		if (domain_nosub === "blogspot.es") return src.replace(/(?:\/media)?\/+cache\/+(?:resolve\/+)?media\/+files\//, "/files/");
		if (domain === "csn.naekranie.pl") return src.replace(/\/media\/+cache\/+(?:resolve\/+)?[^/]*\/+([0-9]{4}\/+[0-9]{2}\/+)/, "/wp-content/uploads/$1");
		if (domain === "imagesvc.timeincuk.net" ||
			domain === "imagesvc.meredithcorp.io") {
			return decodeuri_ifneeded(src.replace(/^[a-z]+:\/\/[^/]*\/v3\/+[a-z]+\/+image.*?[?&]url=([^&]*).*/, "$1"));
		}
		if (domain === "img.timeinc.net") return src.replace(/\/[0-9]+_([^/_]+_[0-9]+(?:_[^/]*)?\.[^/.]*)$/, "/$1");
		if (domain === "i.ksd-i.com") return src.replace(/^[a-z]+:\/\/[^/]*\/+s\/+[0-9]+_[0-9]+_[0-9a-f]+\/+/, "http://");
		if (domain === "a.ksd-i.com") return src.replace(/.*:\/\/[^/]*\/s\/[^/]*\//, "http://");
		if (domain === "static.koreastardaily.com") 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") {
			return src
				.replace(/\/[a-z]+_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "/$1")
				.replace(/_w?[a-z](\.[^/]*)$/, "$1");
		}
		if (domain === "imageproxy.pimg.tw") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+(?:zoomcrop|resize)\?(?:.*?&)?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "images.sidearmdev.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+resize\?(?:.*?&)?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "helloidol.com" &&
			string_indexof(src, "/script/get_pic.php") >= 0) {
			return src.replace(/.*\/script\/get_pic\.php.*?[?&]src=([^&]*).*?$/, "$1");
		}
		if (domain === "yams.akamaized.net" &&
			string_indexof(src, "/Assets/") >= 0) {
			return src.replace(/\/(?:[^/._]*_)?([^/_]*)$/, "/l_$1");
		}
		if (domain_nosub === "pixpo.net" && domain.match(/img[0-9]\.pixpo\.net/)) {
			return src.replace(/_t[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain === "www.mirrormedia.mg" &&
			string_indexof(src, "/assets/images/") >= 0) {
			return src.replace(/-desktop(\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "kknews.cc" && domain.match(/i[0-9]*\.kknews\.cc/)) {
			return src.replace(/_[a-z]*(\.[^/.]*)$/, "$1");
		}
		if (domain === "resource.holyshare.com.tw") return src.replace(/\/article\/[0-9]*x[0-9]*\//, "/article/");
		if (domain_nowww === "kyeongin.com") {
			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)) {
				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
				};
			}
		}
		if (domain_nowww === "wallpaperup.com") return src.replace(/-[0-9]+(\.[^/.]*)$/, "$1");
		if ((domain_nosub === "wallhere.com" ||
			domain_nosub === "pxhere.com") &&
			domain.match(/^[a-z]*\./)) {
			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") {
			return src.replace(/\/v[0-9]+\/[^/]*$/, "");
		}
		if ((domain_nosub === "goodfon.com" ||
			domain_nosub === "goodfon.ru" ||
			domain_nosub === "badfon.ru") &&
			domain.match(/^img[0-9]*\./)) {
			newsrc = src.replace(/(:\/\/[^/]*\/)[^/]*\/[^/]*\//, "$1wallpaper/original/");
			if (newsrc !== src)
				return newsrc;
			if (/\.webp(?:[?#].*)?$/.test(src))
				return src.replace(/\.webp(?:[?#].*)?$/, ".jpg");
		}
		if (domain_nosub === "greatfon.com" && domain.match(/^cdn[0-9]*\./)) {
			return src.replace(/(\/uploads\/+picture\/.*\/)thumbs_([^/]*)(?:[?#].*)?$/, "$1$2");
		}
		if ((domain_nosub === "yimg.jp" && string_indexof(domain, ".c.yimg.jp") >= 0) &&
			src.match(/:\/\/[^/]*\/im_/)) {
			return src.replace(/(:\/\/[^/]*\/)im_[^/]*\//, "$1");
		}
		if ((domain_nosub === "yimg.jp" && string_indexof(domain, ".c.yimg.jp") >= 0) &&
			src.match(/:\/\/[^/]*\/sim\?/)) {
			return src.replace(/.*:\/\/[^/]*\/sim.*?[?&]furl=([^&]*).*/, "http://$1");
		}
		if ((domain_nosub === "yimg.jp" && string_indexof(domain, ".c.yimg.jp") >= 0) &&
			src.match(/\/Images\/(?:[a-z]_)?[0-9]+(\.[^/]*)$/)) {
			return src.replace(/\/Images\/(?:[a-z]_)?([0-9]+\.[^/.]*)$/, "/Images/f_$1");
		}
		if (domain_nosub === "yimg.jp" && string_indexof(domain, ".c.yimg.jp") >= 0 &&
			src.match(/:\/\/[^/]*\/yjimage\?/)) {
			return keep_queries(src, ["q", "sig"]);
		}
		if (domain_nosub === "yimg.jp" && string_indexof(domain, ".c.yimg.jp") >= 0) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+i\/+([^/]+\.yimg\.jp\/+[^?#]+)(?:[?#].*)?$/, "https://$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "yimg.jp" && string_indexof(domain, ".c.yimg.jp") >= 0 &&
			(/:\/\/[^/]*\/r\/+iwiz-amd\//.test(src) || /:\/\/[^/]+\/+i\/+/.test(src))) {
			return {
				url: src.replace(/\?.*$/, ""),
				can_head: false // 404
			};
		}
		if (domain === "av.watch.impress.co.jp") return src.replace(/(\/[0-9]+)_s(\.[^/.]*)$/, "$1_o$2");
		if (domain === "internet.watch.impress.co.jp" ||
			domain === "pc.watch.impress.co.jp") {
			return src.replace(/(\/[0-9]+)_s(\.[^/.]*)$/, "$1$2");
		}
		if (domain === "media.image.infoseek.co.jp") return src.replace(/-[a-z]*(\.[^/.]*)$/, "$1");
		if (domain === "bundles.sfd.pl") return src.replace(/(\/SFD\/+[0-9]{4}\/+[0-9]+\/+[0-9]+\/+[0-9a-f]{10,})-small(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "s.eximg.jp") return src.replace(/(_[0-9]+)_s(\.[^/.]*)$/, "$1$2");
		if (domain === "imgc.eximg.jp") {
			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]+_[^/]*$/)) {
			return src.replace(/\/([^/]*)$/, "/l_$1");
		}
		if (domain_nosub === "bigcommerce.com" && domain.match(/cdn[0-9]*\.bigcommerce\.com/)) {
			newsrc = src.replace(/\/images\/+stencil\/+[0-9]+(?:x[0-9]+|w)\//, "/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") {
			return [
				{
					url: src.replace(/(\/project(?:_modules|s)\/+)[^/]*\//, "$1source/"),
					is_original: true
				},
				src.replace(/(\/project(?:_modules|s)\/+)[^/]*\//, "$1fs/")
			];
		}
		if (domain === "www.worldatlas.com") return src.replace(/(:\/\/[^/]*\/)r\/[^/]*\/(upload\/)/, "$1$2");
		if (domain_nosub === "thrillist.com" && domain.match(/assets[0-9]*\.thrillist\.com/)) {
			return src.replace(/(:\/\/[^/]+\/+v1\/+image\/+[0-9]+)(?:\/.*)?(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "vacationidea.com" &&
			string_indexof(src, "/pix/") >= 0) {
			return src.replace(/_mobi(\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "quoracdn.net") {
			return src
				.replace(/(\/main-)thumb-([0-9]+-)[0-9]+-([a-z]{10,}\.)/, "$1raw-$2$3")
				.replace(/(\/main-qimg-[0-9a-f]{10,})-(?:[a-z]|(?:pj)?lq)$/, "$1");
		}
		if (domain_nosub === "haibao.cn" && domain.match(/c[0-9]*\.haibao\.cn/)) {
			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/)) {
			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/)) {
			return {
				url: src.replace(/\/(?:thumbs|tuku|snsthumbs)\/[0-9]+(?:_[0-9]+)\//, "/wm/"),
				problems: {
					watermark: true
				}
			};
		}
		if (domain_nowww === "wallpaperset.com") return src.replace(/(:\/\/[^/]*\/w\/)[^/]*\//, "$1full/");
		if (domain_nosub === "wallpapermania.eu") {
			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
					}
				};
			}
		}
		if (domain === "img-aws.ehowcdn.com" ||
			domain === "img.aws.ehowcdn.com" ||
			domain === "img.aws.livestrongcdn.com" ||
			domain === "img-aws.livestrongcdn.com") {
			/*newsrc = src.replace(/.*?:\/\/[^/]*\/[0-9]+x[0-9]+p\//, "http://")
			if (newsrc !== src) {
				return newsrc;
			}*/
			newsrc = src
				.replace(/(:\/\/[^/]*\/)[^/]*\//, "$1default/");
			if (newsrc !== src) {
				return newsrc;
			}
			newsrc = src.replace(/.*?:\/\/[^/]*\/.*?\/(photos\.demandstudios\.com\/)/, "http://$1");
			if (newsrc !== src) {
				return newsrc;
			}
			newsrc = src.replace(/.*?:\/\/[^/]*\/[^/]*\/ehow-([^-/.]*)-blog-([^/.]*)\//, "http://$1-ehow-com.blog.ehow.com/");
			if (newsrc !== src) {
				return newsrc;
			}
			newsrc = src.replace(/.*?:\/\/[^/]*\/.*?\/www_ehow_com\/([^/.]*\.[^/]*)\//, "http://$1/");
			if (newsrc !== src) {
				return newsrc;
			}
			newsrc = src.replace(/.*?:\/\/[^/]*\/[^/]*\/s3\.amazonaws\.com\//, "https://s3.amazonaws.com/");
			if (newsrc !== src) {
				return newsrc;
			}
		}
		if (amazon_container === "cme_public_images") {
			newsrc = src.replace(/.*?:\/\/[^/]*\/.*?\/(photos\.demandstudios\.com\/)/, "http://$1");
			if (newsrc !== src) {
				return newsrc;
			}
		}
		if (domain === "imageproxy.themaven.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+(?:[0-9]+x[0-9]+\/+)?(http)/, "$1");
			if (newsrc !== src) {
				return decodeURIComponent(newsrc.replace(/\?.*/, ""));
			}
		}
		if ((domain_nosub === "demandstudios.com" && domain.match(/photos[0-9]*\.demandstudios\.com/)) &&
			string_indexof(src, "/dm-resize/") >= 0) {
			return decodeURIComponent(src.replace(/.*?\/dm-resize\/([^/?]*).*/, "http://$1"));
		}
		if (domain_nosub === "demandstudios.com" && domain.match(/photos[0-9]*\.demandstudios\.com/)) {
			return src.replace(/(\/[0-9]+)_XS(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nosub === "abcnews.com") return src.replace(/_[0-9]+x[0-9]+[a-z]?_[0-9]+(\.[^/.]*)$/, "$1");
		if (domain_nowww === "nationmultimedia.com") return src.replace(/-[^/.]*(\.[^/.]*)$/, "$1");
		if (domain_nosub === "indiatimes.com" ||
			domain === "img.etimg.com" ||
			domain === "etimg.etb2bimg.com" ||
			domain === "telugu.samayam.com" ||
			domain === "static.langimg.com" ||
			domain_nosub === "timesofindia.com" ||
			domain_nosub === "vijaykarnataka.com" ||
			domain_nowww === "businessinsider.in" ||
			domain === "static.toiimg.com") {
			obj = {
				url: src,
				head_wrong_contentlength: true
			};
			newsrc = src.replace(/(:\/\/[^/]*\/)thumb\//, "$1photo/");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			newsrc = src.replace(/\/(?:thumb|photo)\/[^/]*msid-([0-9]*)[,/].*$/, "/photo/$1.cms");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			newsrc = src.replace(/\/(?:thumb|photo)\/(?:[^/]*\/)?([0-9]*)\.[^/.]*$/, "/photo/$1.cms");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
		}
		if (domain === "opt.toiimg.com") return src.replace(/\/recuperator\/+img\/+toi\/+m-([0-9]+)(?:,[^/]*)\/+.*/, "/recuperator/img/toi/$1.cms");
		if (domain_nowww === "jawapos.com") return src.replace(/\/thumbs\/+[^/]*\//, "/uploads/");
		if (domain_nowww === "tnnthailand.com") return src.replace(/\/media\/+[^/]+\/+([^/]+)(?:[?#].*)?$/, "/media/$1");
		if ((domain_nosub === "ibtimes.co.in" ||
			domain_nosub === "ibtimes.sg") &&
			domain.match(/data[0-9]*\.ibtimes\./)) {
			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" ||
			domain_nosub === "astro.com.my") {
			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 && string_indexof(amazon_container, "nxs-wkrgtv-media") >= 0) ||
			(domain_nosub === "win4000.com" && domain.match(/^pic[0-9]*\.win4000\.com/)) ||
			domain === "media.fox29.com" ||
			domain === "media.foxla.com" ||
			domain === "sharedmedia.grahamdigital.com" ||
			(domain === "pic.sucaibar.com" && src.match(/\/pic\/+[0-9]{6}\/+/)) ||
			domain === "mediaassets.wxyz.com") {
			newsrc = src.replace(/_[0-9]+_[0-9]+(\.[^/.]*)$/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "win4000.com" && domain.match(/^pic[0-9]*\./)) {
			return src.replace(/\?down$/, ""); // removes forced downloading
		}
		if (domain === "bobcat.grahamdigital.com") return src.replace(/^[a-z]+:\/\/[^/]*\/image\/+upload\/+view.*?[?&]url=([^&]*).*?$/, "$1");
		if ((domain === "image.photohito.k-img.com" ||
			domain === "photohito.k-img.com") &&
			string_indexof(src, "/uploads/") >= 0) {
			return src.replace(/_[a-z]*(\.[^/]*)/, "_o$1");
		}
		if (domain === "eiga.k-img.com") {
			return src
				.replace(/(\/images\/+movie\/+[0-9]+\/+gallery\/+[0-9]+)\./, "$1_large.")
				.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" ||
			domain === "image.akiba-souken.k-img.com") {
			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") {
			return src.replace(/(:\/\/[^/]*\/goods\/[0-9]+)(?:\/S)?$/i, "$1/L");
		}
		if (domain_nowww === "phileweb.com") {
			newsrc = src.replace(/(\/photo\/+[0-9]{6}\/+[0-9]+)\./, "$1_big.");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "img.danawa.com" ||
			domain_nowww === "wallpoper.com" ||
			domain === "cdn.maximsfinest.com" ||
			domain_nowww === "phileweb.com" ||
			(domain_nowww === "imgpic.org" && string_indexof(src, "/upload/images/") >= 0) ||
			(domain_nosub === "imgdino.com" && domain.match(/img[0-9]*\.imgdino\.com/) && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "foto-pic.net" && /\/images\/+[0-9]{10,}_thumb\./.test(src)) ||
			(domain === "storage.cobak.co" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "mycotopia.net" && string_indexof(src, "/uploads/") >= 0) ||
			(domain === "static.becomegorgeous.com" && string_indexof(src, "/img/") >= 0) ||
			domain === "i.imagepow.com" ||
			(domain_nosub === "techadvisor.co.uk" && domain.match(/^cdn[0-9]*\./)) ||
			domain === "images.macworld.co.uk" ||
			(domain_nowww === "funtasticecards.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "hockey-live.sk" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "khaandaniha.ir" && src.match(/\/Upload\/+Public\/+Content\/+Images\/+/)) ||
			(domain_nowww === "mediavida.com" && string_indexof(src, "/imagenes/") >= 0) ||
			(domain === "img.twitrer.com" && string_indexof(src, "/upload/") >= 0) ||
			(domain === "img.beevar.com" && string_indexof(src, "/upload/") >= 0) ||
			(domain === "adobe-abid.waphall.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "cdnme.se" && string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "zadn.vn" && src.match(/\/uploaded\//i)) ||
			(domain_nowww === "tv-tokyo.co.jp" && /\/photo\/+img\//.test(src)) ||
			domain === "ecdnimg.toranoana.jp" ||
			domain_nowww === "bellazon.com") {
			newsrc = src.replace(/_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "pcgames.com.cn" && domain.match(/^img[0-9]*\./)) {
			return src.replace(/_(?:thumb|small|medium)(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "mosaicon.hu" && string_indexof(src, "/wallpapers/") >= 0) {
			return src.replace(/_(?:large)?thumb(\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "imagecurl.com") return src.replace(/(\/images\/+[0-9]{5,})_(?:thumb|medium)(\.[^/.]*)$/, "$1$2");
		if (domain === "item.ssgcdn.com") return src.replace(/(\/item\/[^/]*)_[0-9]+(\.[^/.]*)$/, "$1$2");
		if (domain_nosub === "coupangcdn.com" && domain.match(/thumbnail[0-9]*\.coupangcdn\.com/)) {
			return src
				.replace(/thumbnail([0-9]*\.coupangcdn\.com)/, "image$1")
				.replace(/\/thumbnails\/remote\/[^/]*\//, "/");
		}
		if (domain === "image.notepet.co.kr") return src.replace(/\/resize\/[^/]*\//, "/");
		if (domain_nowww === "koreamg.com" ||
			domain_nowww === "yufit.co.kr" ||
			domain_nowww === "lovelanc.com" ||
			domain_nowww === "mimibabi.com" ||
			domain === "akamai.poxo.com" ||
			domain_nowww === "getbarrel.com" ||
			domain_nowww === "sexypet.co.kr" ||
			domain_nowww === "withdrama.net" ||
			domain === "cafe24img.poxo.com" ||
			domain_nowww === "dunststudio.com" ||
			domain_nowww === "fncstore.com") {
			newsrc = src.replace(/(\/web\/+product\/+(?:extra\/+)?)(?:tiny|small|medium)\//, "$1big/");
			if (newsrc !== src) {
				return [newsrc, newsrc.replace(/0(\.[^/.]*)(?:[?#].*)?$/, "00$1")];
			}
		}
		if (domain_nosub === "mynavi.jp") {
			return src
				.replace(/\/index_images\/[^/]*(?:\/[^/]*)?$/, "/images/001l.jpg")
				.replace(/\/images\/([0-9]+)(\.[^/.]*)$/, "/images/$1l$2")
				.replace(/(\/images\/+[0-9]+l?\.[^/.]+)\/+webp(?:[?#].*)?$/, "$1");
		}
		if (domain === "cdn.deview.co.jp") return src.replace(/\/imgs\/news_image\.img\.php.*?am_file=([^&])([^&])([^&])([^&]*).*/, "/imgs/news/$1/$2/$3/$1$2$3$4");
		if (domain === "imgcache.dealmoon.com") return src.replace(/.*?:\/\/[^/]*\/(.*?)(\.[^/._]*)_[^/]*?$/, "http://$1$2");
		if (domain === "www.usmall.us" ||
			domain === "www.sofiehouse.co" ||
			domain === "www.thecelebritydresses.com" ||
			domain === "www.celebredcarpetdresses.com" ||
			domain === "www.minimal.co.id" ||
			domain === "www.bridesmaidca.ca" || // doesn't work
			domain === "www.sisley-paris.com" ||
			domain === "d2ovdo5ynwfl3w.cloudfront.net" ||
			domain === "d1cizyvjjqnss7.cloudfront.net" ||
			domain_nowww === "executiveponies.com" ||
			domain_nowww === "trendygowns.com" ||
			domain === "www.lizandliz.com" ||
			domain === "cdn.sportshop.com" ||
			(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}\//)) {
			/*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]+|stores)\/+[^/]*\/+)?(?:[0-9]*x[0-9]*\/+)?[0-9a-f]{32}\/+((?:.\/+.\/+)|(?:[^/]*\/+))([^/]*)$/, "/$1$2");
			if (newsrc !== src)
				return newsrc;
			/*newsrc = src.replace(/(\/+cache\/+[0-9]+\/+)thumbnail\/+[0-9]+x[0-9]+\/+/, "$1image/");
			if (newsrc !== src)
				return newsrc;*/
		}
		if (domain === "cdn.okdress.co.nz" ||
			(domain_nowww === "promshopau.com" && false)) {
			return src.replace(/(\/media\/catalog\/product\/)cache\/[0-9]*\/[^/]*\/[0-9]+x[0-9]+\//, "$1");
		}
		if (domain === "img.nextmag.com.tw") return src.replace(/\/[0-9]+x(?:[0-9]+)?_([^/]*)$/, "/$1");
		if (domain_nosub === "meitudata.com") {
			return src.replace(/![^/]*$/, "");
		}
		if (domain === "www.shogakukan.co.jp") return src.replace(/\/thumbnail\/books\//, "/thumbnail/snsbooks/");
		if (domain === "images.sysapi.mtg.now.com") return src.replace(/\/[a-z]\/([^/]*)_[a-z](\.[^/.]*)$/, "/o/$1_o$2");
		if (domain_nosub === "lst.fm" && domain.match(/img[0-9]*[^.]*\.lst\.fm/)) {
			return src.replace(/(\/i\/[a-z]\/)(?:avatar)?[0-9]+s\//, "$1");
		}
		if (domain === "www.hdwallpapers.in" ||
			domain_nowww === "bhmpics.com" ||
			domain_nowww === "freshwallpapers.in") {
			return src
				.replace(/\/(?:download|thumbs)\//, "/walls/")
				.replace(/-[^-_/.]*(\.[^/.]*)$/, "-wide$1");
		}
		if (domain_nowww === "superwallpapers.in") return src.replace(/(\/hdwallpapers\/+[^/]+)_[0-9]+_[0-9]+_[0-9]+_[0-9a-f]{2}(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if ((domain_nosub === "deezer.com" || domain_nosub === "dzcdn.net") && /images\./.test(domain)) {
			newsrc = src.replace(/(\/[0-9a-f]{32}\/+[0-9]+x[0-9]+)(?:(?:-[0-9]+){4})?(\.[^/.]+)(?:[?#].*)?$/, "$1-000000-100-0-0$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/([0-9a-f]{32})\/+([0-9]+)x([0-9]+)/);
			if (match) {
				id = match[1];
				var current_x = parseInt(match[2]);
				var current_y = parseInt(match[3]);
				if (current_x < 1200 && current_y < 1200 && !problem_excluded("possibly_upscaled")) {
					return {
						url: src.replace(/(\/[0-9a-f]{32}\/+)[0-9]+x[0-9]+/, "$11200x0"),
						problems: {
							possibly_upscaled: true
						}
					};
				} else if (get_image_size && options.cb && !problem_excluded("bruteforce")) {
					var mingood = 1200;
					var minbad = null;
					var firstrun = true;
					var currentsrc = src;
					var get_deezer_image_url = function(origsrc, newsize, newquality) {
						return origsrc.replace(/(\/[0-9a-f]{32}\/+)[0-9]+x[0-9]+(?:(?:-[0-9]+){4})?(\.[^/.]+)(?:[?#].*)?$/, "$1" + newsize + "-000000-" + newquality + "-0-0$2");
					};
					if (current_x <= 1200) {
						currentsrc = get_deezer_image_url(currentsrc, "1201x0", 1);
						firstrun = false;
					}
					var cache_key = "deezer:" + id;
					var fetch_image_size = function(src, cb) {
						api_cache.fetch("deezer:" + src, cb, function(done) {
							get_image_size(src, function(x, y) {
								done([x, y], 60 * 60);
							});
						});
					};
					var try_new_image = function() {
						fetch_image_size(currentsrc, function(xy) {
							if (window.do_stop)
								return;
							var x = xy[0];
							var y = xy[1];
							if (!x || !y) {
								if (!minbad || current_x < minbad) {
									minbad = current_x;
								}
							} else {
								var largest = Math_max(x, y);
								if (x === 1200 || y === 1200) {
									if (!minbad || current_x < minbad) {
										minbad = current_x;
									}
								} else {
									if (current_x > mingood) {
										mingood = current_x;
									}
								}
							}
							if (!minbad) {
								if (firstrun && current_x < 4000) {
									current_x++;
								} else if (current_x < 1920) {
									current_x = 1921;
								} else if (current_x < 4000) {
									current_x *= 2;
									if (current_x < 4000)
										current_x = 4000;
								}
							} else if ((minbad - mingood) > 1) {
								current_x = (mingood + Math_floor((minbad - mingood) / 2)) | 0;
							}
							var goodsrc = get_deezer_image_url(currentsrc, mingood + "x0", 100);
							if (current_x !== mingood) {
								var newsrc = get_deezer_image_url(currentsrc, current_x + "x0", 1);
								if (newsrc !== currentsrc) {
									currentsrc = newsrc;
									firstrun = false;
									try_new_image();
								} else {
									options.cb(goodsrc);
								}
							} else {
								options.cb(goodsrc);
							}
						});
					};
					if (get_image_size && options.cb) {
						try_new_image();
						return {
							waiting: true
						};
					}
				} else if (current_x < 1920 && current_y < 1920) {
					return {
						url: src.replace(/(\/[0-9a-f]{32}\/+)[0-9]+x[0-9]+/, "$11920x0"),
						problems: {
							possibly_upscaled: true
						}
					};
				}
			}
		}
		if (domain === "cdn.wallpaper.com") {
			regex = /\/main\/styles\/[^/]*\/[^/]*\/(.*\/)?(?:l-)?([^/]*)/;
			return [src.replace(regex, "/main/$2"), src.replace(regex, "/main/$1$2")];
		}
		if (domain === "cdn.wallpaper.com") return src.replace(/\/main\/styles\/[^/]*\/[^/]*\//, "/");
		if (domain === "static.warthunder.com") return src.replace(/\/_thumbs\/[0-9]+x(?:[0-9]+)?\//, "/");
		if (domain === "cdn.wallpaperdirect.com") return src.replace(/(\/[0-9]*)_[^/.]*(\.[^/.]*)$/, "$1orig$2");
		if (domain_nosub === "bamcontent.com" ||
			domain_nosub === "bamgrid.com") {
			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/)) {
			return decodeURIComponent(src.replace(/.*\/pic.*?[?&]url=([^&]*).*?$/, "$1"));
		}
		if (domain_nosub === "mail.ru" && /^content-[0-9]+\.foto\.my\./.test(domain)) {
			return {
				url: src.replace(/(\/community\/+[^/]+\/+_groupsphoto\/+)i(-[0-9]+\.[^/.?#]+)(?:[?#].*)?$/, "$1b$2"),
				can_head: false // 400
			};
		}
		if (domain_nosub === "mail.ru" &&
			domain.match(/^avt.*\.foto\.mail\.ru/)) {
			return src.replace(/\/_avatar[0-9]*(?:[?#].*)?$/, "/_avatarbig");
		}
		if (domain === "games.mail.ru") {
			return src
				.replace(/\/pre_(?:[0-9]+x[0-9]+|[a-z]+)_(?:resize|crop)\/+(pic|hotbox)\/+/, "/$1/")
				.replace(/\?quality.*/, "");
		}
		if (domain === "my.mail.ru") {
			var query_mailru_videometa_1 = function(vidid, cb) {
				var cache_key = "mailru_video:" + vidid;
				api_query(cache_key, {
					url: "https://my.mail.ru/+/video/meta/" + vidid,
					imu_mode: "xhr",
					headers: {
						Referer: "https://my.mail.ru/",
						Accept: "application/json, text/javascript, */*; q=0.01"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					done(resp, 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(fb\/+[0-9]+\/+video\/+_myvideo\/+[0-9]+)\.html(?:[?#].*)?$/,
				query_for_id: "https://my.mail.ru/${id}.html",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<script type="text\/plain" class="sp-video__page-config">\s*({.*})\s*<\/script>/);
					if (!match) {
						console_error(cache_key, "Unable to find video page config for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					var vidid = json.itemId;
					if (!vidid) {
						console_error(cache_key, "Unable to find video id for", resp, json);
						return done(null, false);
					}
					query_mailru_videometa_1(vidid, function(meta) {
						if (!meta) {
							return done(null, false);
						}
						var baseobj = {
							extra: {
								caption: meta.meta.title,
								created_at: meta.meta.timestamp * 1000
							}
						};
						var urls = [];
						for (var _i = 0, _a = meta.videos; _i < _a.length; _i++) {
							var video = _a[_i];
							urls.push({
								url: urljoin(resp.finalUrl, meta.videos[0].url, true),
								headers: {
									Referer: resp.finalUrl
								},
								video: true,
								is_private: true
							});
						}
						urls.push(urljoin(resp.finalUrl, meta.meta.poster, true));
						return done(fillobj_urls(urls, baseobj), 60 * 60);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "mg.soupingguo.com") return src.replace(/(\/attchment[^/]*\/[^/]*Img\/)[0-9]+x[0-9]+\//, "$10x0/");
		if (domain === "img.yaplog.jp") return src.replace(/(\/img\/[^/]*\/)mo\//, "$1pc/");
		if (domain === "www.hochi.co.jp") return src.replace(/-[A-Z](\.[^/.]*)$/, "-L$1");
		if (domain_nosub === "wikispaces.com") return src.replace(/(\/view\/[^/]*\.[^/]*)\/.*?$/, "$1");
		if (domain === "img-mdpr.freetls.fastly.net") return src.replace(/(?:\?.*)?$/, "?quality=100");
		if (domain_nowww === "sponichi.co.jp") {
			return {
				url: src.replace(/_thum(\.[^/.]*)$/, "_view$1"),
				can_head: false
			};
		}
		if (domain === "thumbnail.image.rakuten.co.jp") return src.replace(/.*?:\/\/[^/]*\/@[^/]*\/([^?]*).*?$/, "http://shop.r10s.jp/$1");
		if (domain === "tshop.r10s.com") return src.replace(/:\/\/[^/]*\/(.*?)(?:[?#].*)?$/, "://shop.r10s.com/$1");
		if (domain_nowww === "billboard-japan.com" ||
			domain === "fotos.jornaldacidadeonline.com.br") {
			return src.replace(/\/(?:[0-9]+)?x(?:[0-9]+)?_([^/]*)$/, "/$1");
		}
		if (domain_nosub === "tsite.jp" &&
			string_indexof(domain, "top.tsite.jp") >= 0 &&
			string_indexof(src, "/contents_image/") >= 0) {
			return src.replace(/(\/[0-9]+)_[0-9]+(?:_[^/.]+)?(\.[^/.]*)$/, "$1_0$2");
		}
		if (domain === "www.sanspo.com") {
			newsrc = src.replace(/(\/images\/[0-9]*\/[^/]*-)[a-z]([0-9]+\.[^/.]*)$/, "$1p$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "www.sonymusicshop.jp") return src.replace(/__[0-9]+_[0-9]+_[0-9]+_([a-z]+\.[a-z]*)(?:\?.*)?$/, "_$1");
		if (domain_nowww === "prtimes.jp") {
			if (/\/api\/+file\.php\?/.test(src)) {
				var queries = get_queries(src);
				return "https://prtimes.jp/i/" + queries.c + "/" + queries.r + "/original/" + queries.f;
			}
			return src
				.replace(/\/thumb\/+(?:[0-9]+x[0-9]+\/+)?(d[0-9]+-)/, "/original/$1")
				.replace(/\/resize\/+([^/]*)$/, "/original/$1");
		}
		if (domain_nosub === "vietbao.vn") {
			return src
				.replace(/:\/\/img\.vietbao\.vn\/images\/[0-9]+\//, "://a9.vietbao.vn/images/");
		}
		if (domain === "media.tinnong.net.vn") return src.replace(/\/Images\/[^/]*\//, "/Images/Original/");
		if (domain === "images.kienthuc.net.vn" ||
			domain === "images.khoeplus24h.vn") {
			return src.replace(/\/zoom[a-z]\/[0-9]*\//, "/");
		}
		if (domain === "rez.cdn.kul.vn" ||
			domain_nowww === "glamour.pl" ||
			domain_nowww === "al3arabi.com" ||
			domain_nowww === "starwars-holocron.net" ||
			domain_nowww === "elle.pl" ||
			domain_nowww === "gala.pl" ||
			domain === "i.moveek.com" ||
			domain_nowww === "mainstyles.ru" ||
			domain === "programme-tv.leparisien.fr" ||
			domain_nowww === "longtake.it" ||
			src.match(/^[a-z]+:\/\/[^/]*\/+media\/+cache\/+[^/]*\/+uploads\/+media\//)) {
			return src
				.replace(/\/media\/+cache\/+.*\/+uploads\/+/, "/uploads/")
				.replace(/\/media\/+cache\/+[^/]*\//, "/");
		}
		if (domain_nowww === "themebeta.com") return src.replace(/\/media\/+cache\/+[0-9]+x[0-9]+\/+files\//, "/files/");
		if (domain === "static.kstyle.com") {
			return src.replace(/\/r\.[0-9]+x[0-9]+$/, "");
		}
		if (amazon_container === "lifesite-cache" ||
			domain_nowww === "golocalprov.com" ||
			(domain === "d1lfxha3ugu3d4.cloudfront.net" && /\/assets\/+system-images\/+remote\/+http/.test(src)) ||
			amazon_container === "ee-harpers-bazaar" ||
			domain === "assets.lifesitenews.com" ||
			(domain_nosub === "thelineofbestfit.com" && domain.match(/^cdn[0-9]*\.thelineofbestfit\.com/))) {
			return src
				.replace(/.*\/(?:(?:system-)?images|made)\/+remote\/+(https?)_(.*?)(?:(?:_[0-9]+)?_[0-9]+_[0-9]+(?:_[a-z]_[a-z][0-9])?)?(\.[^/.]*)$/, "$1://$2$3");
		}
		if (domain === "d1lfxha3ugu3d4.cloudfront.net") return src.replace(/(\/exhibitions\/+images\/+[^/]+)_[0-9]+w(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "mosaic.tnaflix.com" ||
			domain === "img.empstatic.com" ||
			domain === "img.moviefap.com") {
			newsrc = src.replace(/(\/a[0-9]+):[0-9a-z]+(\/|\.[^/.]*)/, "$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "tnastatic.com" && domain.match(/^img[0-9]*\./)) {
			newsrc = src.replace(/(:\/\/[^/]*\/)[^/]*\/(pics|thumbs)\//, "$1q100/$2/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "tnaflix.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+[^/]+\/+[^/]+\/+video([0-9]+)(?:[?#].*)?$/,
				query_for_id: function(id) {
					return {
						url: "https://www." + domain_nosub + "/ajax/video-player/" + id,
						headers: {
							Accept: "*/*",
							Referer: "https://" + domain + "/"
						},
						imu_mode: "xhr",
						json: true
					};
				},
				process: function(done, resp, cache_key) {
					if (!resp.html) {
						console_error(cache_key, "Unable to find html from", resp);
						return done(null, false);
					}
					var fakeresp = {
						responseText: resp.html,
						finalUrl: "https://www.tnaflix.com/"
					};
					var obj = common_functions["get_videotag_obj"](fakeresp);
					if (!obj)
						return done(null, false);
					return done(fillobj_urls(obj, {
						headers: {
							Referer: fakeresp.finalUrl
						}
					}), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "tnaflix.com" || domain_nosub === "tnastatic.com" ||
			domain_nosub === "empflix.com" || domain_nosub === "empstatic.com") {
			var is_pagelink = true;
			var is_vkey = false;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+[^/]+\/+[^/]+\/+video([0-9]+)(?:[?#].*)?$/);
			if (!match) {
				match = src.match(/^[a-z]+:\/\/[^/]+\/+view_video\.php\?(?:.*&)?viewkey=([0-9a-f]+)/);
				if (match)
					is_vkey = true;
			}
			if (!match) {
				is_pagelink = false;
				match = src.match(/^[a-z]+:\/\/img[0-9]*\.[^/]+\/+[^/]+\/+thumbs\/+[0-9a-f]{2}\/+[0-9a-f]{1,2}_([0-9]+)l\./);
			}
			if (!match) {
				is_pagelink = false;
				match = src.match(/^[a-z]+:\/\/img[0-9]*\.[^/]+\/+[^/]+\/+thumbs\/+[0-9a-f]{2}\/+([0-9]+)-[0-9]+l\./);
			}
			if (!match) {
				is_pagelink = false;
				match = src.match(/^[a-z]+:\/\/mosaic\.[^/]+\/+([0-9]+)\/+a[0-9]+(?::[^/]+)?\/+/);
			}
			if (!match) {
				is_pagelink = false;
				match = src.match(/\/trailer\/+empflix\/+(?:[0-9a-f]\/+){3}([0-9a-f]+)\./);
				if (match)
					is_vkey = true;
			}
			var base_domain = domain_nosub.replace(/static\./, "flix.");
			var base_domain_noext = base_domain.replace(/\..*/, "");
			var vid_suffix = "";
			if (base_domain_noext === "empflix") {
				vid_suffix = "-1";
			}
			if (match) {
				id = match[1];
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				if (!is_pagelink)
					page_nullobj = null;
				var query_tnaflix_api = function(data, cb) {
					if (!data || !data.vkey || !data.nkey || !data.VID || !("thumb" in data) || !data.finalUrl) {
						console_error("Invalid parameters", data);
						return cb(null);
					}
					var url = "https://cdn-fck." + base_domain + "/" + base_domain_noext + "/" + data.vkey + vid_suffix + ".fid?key=" + data.nkey + "&VID=" + data.VID + "&startThumb=" + data.thumb + "&nomp4=1&catID=0&rollover=1&embed=0&utm_source=0&multiview=0&premium=1&country=0user=0&vip=1&cd=0&ref=0&alpha";
					api_query(base_domain + "_api:" + data.VID, {
						url: url,
						headers: {
							origin: "https://www." + base_domain,
							Referer: data.finalUrl
						}
					}, cb, function(done, resp, cache_key) {
						var urls = common_functions.parse_flixv2(resp, cache_key);
						if (!urls || urls.length === 0) {
							urls = [];
						}
						if (page_nullobj)
							urls.push(page_nullobj);
						if (!urls.length) {
							return done(null, false);
						} else {
							for (var i = 0; i < urls.length; i++) {
								urls[i].url = urljoin("https://www." + base_domain + "/", urls[i].url, true);
							}
							var baseobj = {
								headers: {
									Referer: "https://www." + base_domain + "/",
									"Sec-Fetch-Dest": "video"
								}
							};
							if (page_nullobj)
								urls.push(page_nullobj);
							return done(fillobj_urls(urls, baseobj), 60 * 60);
						}
					});
				};
				var process_tnaflix_site = function(done, resp, cache_key) {
					var regex = /<input id="(VID|vkey|nkey|thumb)" type="hidden" value="([^"]+)"/;
					var global_regex = new RegExp(regex, "g");
					var match = resp.responseText.match(global_regex);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var values = {};
					for (var i = 0; i < match.length; i++) {
						var smatch = match[i].match(regex);
						var key = smatch[1];
						var value = smatch[2];
						values[key] = value;
					}
					values["finalUrl"] = resp.finalUrl;
					done(values, 60 * 60);
				};
				var query_tnaflix_site_by_vid = function(vid, cb) {
					api_query(base_domain + "_site_vid:" + vid, {
						url: "https://www." + base_domain + "/a/a/video" + vid
					}, cb, process_tnaflix_site);
				};
				var query_tnaflix_site_by_vkey = function(vkey, cb) {
					api_query(base_domain + "_site_vkey:" + vkey, {
						url: "https://www." + base_domain + "/view_video.php?viewkey=" + vkey
					}, cb, process_tnaflix_site);
				};
				if (options.do_request && options.cb) {
					var final = function(data) {
						query_tnaflix_api(data, options.cb);
					};
					if (!is_vkey) {
						query_tnaflix_site_by_vid(id, final);
					} else {
						query_tnaflix_site_by_vkey(id, final);
					}
					return {
						waiting: true
					};
				}
			}
		}
		if (domain_nowww === "imagefap.com") {
			var query_imagefap_photo = function(id, cb) {
				api_query("imagefap_photo:" + id, {
					url: "https://www.imagefap.com/photo/" + id + "/"
				}, cb, function(done, resp, cache_key) {
					var link_regex = /<a href="(https?:\/\/[a-z]+\.imagefap\.com\/+images\/+full[^"]+)"[^>]+?imageid="([0-9]+)"/;
					var links = resp.responseText.match(new RegExp(link_regex, "g"));
					if (!links) {
						console_error(cache_key, "Unable to find image links for", resp);
						return done(null, false);
					}
					var url = null;
					array_foreach(links, function(link) {
						var submatch = link.match(link_regex);
						var our_url = decode_entities(submatch[1]);
						var our_id = submatch[2];
						if (our_id != id) {
							api_cache.set("imagefap_photo:" + our_id, our_url, 60 * 60);
						} else {
							url = our_url;
						}
					});
					if (!url) {
						console_error("Unable to find", id, "in", links, resp);
						return done(null, false);
					}
					return done(url, 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+photo\/+([0-9]+)\/*(?:[?#].*)?$/,
				run: function(done, match) {
					var id = match[1];
					query_imagefap_photo(id, function(url) {
						if (!url) {
							return done(null, false);
						} else {
							return done({
								url: url,
								extra: {
									page: "https://www.imagefap.com/photo/" + id + "/"
								}
							}, 60 * 60);
						}
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "imagefap.com" ||
			domain_nowww === "moviefap.com") {
			var query_moviefap_flv = function(flvurl, cb) {
				api_query("moviefap_flv:" + flvurl, {
					url: flvurl,
					headers: {
						Origin: "https://www.imagefap.com",
						Referer: "https://cdn-fck.moviefap.com/",
						"Content-Type": "application/x-www-form-urlencoded"
					}
				}, cb, function(done, resp, cache_key) {
					var urls = common_functions.parse_flixv2(resp, cache_key);
					if (!urls || urls.length === 0) {
						urls = [];
					}
					if (page_nullobj)
						urls.push(page_nullobj);
					if (!urls.length) {
						return done(null, false);
					} else {
						var baseobj = {
							headers: {
								Referer: "https://www.imagefap.com/",
								"Sec-Fetch-Dest": "video"
							}
						};
						if (page_nullobj)
							urls.push(page_nullobj);
						return done(fillobj_urls(urls, baseobj), 60 * 60);
					}
				});
			};
			var get_flvurl = null;
			match = src.match(/:\/\/[^/]*imagefap\.com\/+video\.php\?(?:.*?&)?vid=([0-9]+)/);
			if (match) {
				id = match[1];
				var query_imagefap_flvurl = function(vid, cb) {
					api_query("imagefap_flvurl:" + vid, {
						url: "https://www.imagefap.com/video.php?vid=" + vid
					}, cb, function(done, resp, cache_key) {
						var match = resp.responseText.match(/url: '(https?:\/\/cdn-fck\.moviefap.com\/+moviefap\/+[0-9a-f]{10,}\.flv\?(?:.*&)?VID=.*?)',/);
						if (!match) {
							console_error(cache_key, "Unable to find info flv URL for", resp);
							return done(null, false);
						}
						return done(match[1], 60 * 60);
					});
				};
				get_flvurl = function(cb) {
					query_imagefap_flvurl(id, cb);
				};
			} else {
				match = src.match(/:\/\/[^/]+\/+videos\/+([0-9a-f]{10,})\/+[^/]*\.html(?:[?#].*)?$/);
				if (match) {
					id = match[1];
					var query_moviefap_flvurl = function(vid, cb) {
						api_query("moviefap_flvurl:" + vid, {
							url: "https://www.moviefap.com/videos/" + vid + "/a.html"
						}, cb, function(done, resp, cache_key) {
							var match = resp.responseText.match(/<input type="hidden" id="config1" name="config1" value="(https?:\/\/cdn-fck\.moviefap.com\/+moviefap\/+[0-9a-f]{10,}\.flv\?(?:.*(?:&|%26))?VID=.*?)" \/>/);
							if (!match) {
								console_error(cache_key, "Unable to find info flv URL for", resp);
								return done(null, false);
							}
							return done(match[1], 60 * 60);
						});
					};
					get_flvurl = function(cb) {
						query_moviefap_flvurl(id, cb);
					};
				}
			}
			if (get_flvurl) {
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				if (options.do_request && options.cb) {
					get_flvurl(function(flvurl) {
						if (!flvurl) {
							return options.cb(page_nullobj);
						}
						query_moviefap_flv(flvurl, options.cb);
					});
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if (domain === "img.moviefap.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+[^/]+\/+thumbs\/+[0-9a-f]{2}\/+([0-9]+)-[0-9]+l\.[^/.]+/, "https://www.imagefap.com/video.php?vid=$1");
			if (newsrc !== src)
				return {
					url: newsrc,
					is_pagelink: true
				};
		}
		if (domain_nowww === "imagefap.com" ||
			(domain_nosub === "imagefap.com" && /^(?:cdn[ch]?|images)\./.test(domain)) ||
			domain_nosub === "fap.to") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:[a-z][a-z0-9.]+\/+)?images\/+(?:mini|thumb)\/+[0-9]+\/+[0-9]+\/+([0-9]+)\./);
			if (match) {
				return {
					url: "https://www.imagefap.com/photo/" + match[1] + "/",
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "imagefapusercontent.com" && /^x[0-9]*\./.test(domain)) {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+u\/+[^/]+\/+[0-9]+\/+([0-9]+)\/+[^/]+\./);
			if (match) {
				return {
					url: "https://www.imagefap.com/photo/" + match[1] + "/",
					is_pagelink: true
				};
			}
		}
		if (domain === "www.gannett-cdn.com" &&
			string_indexof(src, "/-ip-/") >= 0) {
			return src.replace(/.*?\/-ip-\//, "");
		}
		if (domain === "cdn.mainichi.jp") return src.replace(/\/[0-9]+(\.[^/.]*)$/, "/9$1");
		if (domain === "img.evbuc.com" ||
			domain === "cdn.mall.adeptmind.ai") {
			return decodeURIComponent(src.replace(/.*:\/\/[^/]*\/([^?]*).*/, "$1"));
		}
		if (domain === "img.cdandlp.com") {
			return src.replace("/imgS/", "/imgL/").replace("/imgM/", "/imgL/");
		}
		if (domain === "walter.trakt.tv") {
			return src
				.replace(/\/(posters|fanarts|avatars)\/(?:thumb|medium|large|full)\/([^/]*?)(\.webp)?$/, "/$1/original/$2");
		}
		if (domain === "cdn.apk-cloud.com" ||
			domain_nowww === "apk-dl.com") {
			return src
				.replace(/(?:=[a-z][0-9]*)?(\.[^/.]*)$/, "=h0$1");
		}
		if (domain_nosub === "polyvoreimg.com") {
			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" &&
			string_indexof(src, "/cgi/") >= 0) {
			return src
				.replace(/\/img-set(.*?)&size=[^&]*/, "/img-set$1&size=c99999x99999");
		}
		if (domain === "aliyun-cdn.hypebeast.cn" &&
			string_indexof(src, "/hypebeast.com/") >= 0) {
			return src.replace(/.*:\/\/[^/]*\//, "http://");
		}
		if (domain_nowww === "girlscene.nl" ||
			domain_nowww === "beautyscene.nl" ||
			domain_nowww === "trendalert.nl") {
			return src.replace(/\/thumb\/+[0-9]+x[0-9]+\/+ckfinder\/+/, "/ckfinder/");
		}
		if (domain_nowww === "hdfullfilmizle.com" ||
			domain_nowww === "hdfilmcix.net" ||
			domain_nowww === "fullhdfilmizletio.com" ||
			domain_nowww === "sinefun.com" ||
			domain_nowww === "1080hdfilmizle.com" ||
			domain_nowww === "sinemagecesi.com" ||
			domain_nowww === "fullfilmburada.com" ||
			domain_nowww === "evrenselfilmizle.net" ||
			domain_nowww === "vizyonfilmlerizle.com" ||
			domain_nowww === "sinemangoo.org" ||
			/^[a-z]+:\/\/[^/]+\/+thumb\/+[0-9]+x[0-9]+\/+uploads\/+(?:film|oyuncu)\/+[0-9]{4}\/+(?:[0-9]{2}\/+[^/]+-[0-9]{3}|[0-9]{2}[^/]+)\.[^/.]+(?:[?#].*)?$/.test(src)) {
			return src.replace(/\/thumb\/+[0-9]+x[0-9]+\/+uploads\//, "/uploads/");
		}
		if (domain_nowww === "hairstyleinsider.com" ||
			domain === "sites.eveyo.com" ||
			domain_nowww === "24sata.info" ||
			domain_nowww === "alankabout.com" ||
			domain_nowww === "cosmopolitan.rs" ||
			domain_nowww === "elle.rs") {
			return src.replace(/\/(?:thumbnail|files).php.*?file=([^&]*).*/, "/files/$1");
		}
		if (domain_nowww === "zkpm.net" ||
			domain_nowww === "zyzpes.com" ||
			domain_nowww === "yoptel.ru" ||
			domain === "img.viyuedu.com") {
			return src.replace(/.*\/img\.php.*?url=(.*)/, "$1");
		}
		if (domain_nowww === "aidu360.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+img\.php\?(?:.*?&)?u=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "img.xiaohuazu.com") {
			return src.replace(/.*?[?&]url=(.*)/, "$1").replace(/z-z/g, ".").replace(/^/, "http://");
		}
		if (domain_nowww === "viewsofia.com") {
			return src.replace("/fck_editor_thumb/", "/fck_editor/");
		}
		if (domain_nosub === "condenast.ru" && string_indexof(domain, ".static.media.condenast.ru") >= 0) {
			return src.replace(/\/[a-z][0-9]*(?:x[0-9]+)?$/, "/w99999999");
		}
		if (domain_nowww === "vogue.co.jp") return src.replace(/(\/uploads\/+media\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[^/]+)-[0-9]+-[0-9]+(\.[^/.]*)$/, "$1$2");
		if (domain_nosub === "vogue.mx" ||
			domain_nosub === "glamour.mx" ||
			domain_nosub === "glamour.es" ||
			domain === "cdn.gq.com.mx" ||
			domain === "cdn.revistavanityfair.es" ||
			domain_nosub === "vogue.es") {
			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;
		}
		if (domain_nosub === "ykt.ru" ||
			domain_nosub === "ykt2.ru") {
			newsrc = src.replace(/\/thumb\/([^/]*)$/, "/$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "i.guim.co.uk") return src.replace(/:\/\/[^/]*\/img\/([^/]*)\/([^?]*).*?$/, "://$1.guim.co.uk/$2");
		if (domain === "media.guim.co.uk") {
			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") return src.replace(/(\/img\/+Photo\/+[0-9]+\/+)(?:sml|med)_([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "vogue.gjstatic.nl" ||
			domain === "glamour.gjstatic.nl") {
			return src
				.replace(/\/teaserFileUpload\//, "/fileUpload/") // doesn't work on all
				.replace(/\/fileUpload\/[^/]*\//, "/fileUpload/big/");
		}
		if (domain_nosub === "favim.com" && domain.match(/^s[0-9]*\./)) {
			return src.replace(/(:\/\/[^/]*\/)[^/]*\//, "$1orig/");
		}
		if (domain_nowww === "derpibooru.org" ||
			domain_nowww === "furbooru.org") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:images\/+)?([0-9]+)\/*(?:[?#].*)?$/,
				query_for_id: function(id) {
					return {
						url: "https://" + domain_nosub + "/" + id
					};
				},
				process: function(done, resp, cache_key) {
					var ogimage = resp.responseText.match(/<meta content="([^"]+)" property="og:image">/);
					if (!ogimage) {
						console_error(cache_key, "Unable to find og:image match for", resp);
						return done(null, false);
					}
					return done(decode_entities(ogimage[1]), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "derpibooru.org" ||
			host_domain_nowww === "furbooru.org") {
			var link = common_functions["get_link_el_matching"](options.element, function(a) {
				return /^[a-z]+:\/\/[^/]+\/+(?:images\/+)?([0-9]+)\/*(?:[?#].*)?$/.test(a.href);
			});
			if (link) {
				return {
					url: link.href,
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "derpicdn.net" ||
			domain_nowww === "furrycdn.org") {
			newsrc = src.replace(/\/(?:thumb|large)(\.[^/.]*)$/, "/full$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/img\/+)([0-9]{4}\/+[0-9]{1,2}\/+[0-9]{1,2}\/+[0-9]+)\/+[^/.]+(\.[^/.]+)(?:[?#].*)?$/, "$1view/$2$3");
			if (newsrc !== src)
				return newsrc;
			var basedomain = "derpibooru.org";
			if (domain_nosub === "furrycdn.org")
				basedomain = "furbooru.org";
			match = src.match(/\/img\/+(?:view\/+)?[0-9]{4}\/+(?:[0-9]{1,2}\/+){2}([0-9]+)[./]/);
			if (match) {
				return {
					url: src,
					extra: { page: "https://" + basedomain + "/" + match[1] }
				};
			}
		}
		if (domain_nosub === "iimg.me") {
			newsrc = src.replace(/.*\/[a-z]*\.php.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src && string_indexof(newsrc, "http") === 0) {
				return decodeURIComponent(newsrc);
			}
		}
		if (domain === "pix.avaxnews.com" ||
			domain === "pix.avax.news" ||
			domain_nowww === "pixhost.icu" ||
			domain_nowww === "pxhst.co") {
			return src.replace(/_[^/]*(\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "hurimg.com" ||
			domain === "img.posta.com.tr" ||
			domain === "icdn.pstimg.com" ||
			domain === "img.fanatik.com.tr" ||
			domain === "assets.dogannet.tv" ||
			domain_nosub === "fanatik.com.tr" ||
			((domain_nosub === "pstimaj.com" ||
				domain_nosub === "milimaj.com" ||
				domain_nosub === "cnnturk.com") && /^i[0-9]*\./.test(domain))) {
			return src.replace(/\/[0-9]+\/[0-9]+x[0-9]+\/([0-9a-f]+(?:\.[^/.]*)?)([?#].*)?$/, "/100/0x0/$1");
		}
		if (domain === "image.gazetevatan.com" ||
			domain === "image.posta.com.tr") {
			return src.replace(/(\/i\/+[^/]+\/+)[0-9]+\/+[0-9]+x[0-9]+\/+/, "$1100/0x0/");
		}
		if (domain === "www.kurtkomaromi.com" ||
			domain_nosub === "typepad.com" ||
			domain === "blogs.elpais.com" ||
			domain === "www.summerofdan.net" ||
			domain_nowww === "thequeenofstyle.com" ||
			domain_nowww === "thequestforit.com" ||
			domain_nosub === "blogs.com" ||
			domain === "latimesblogs.latimes.com" ||
			domain === "www.weeklystorybook.com") {
			return src.replace(/^([a-z]+:\/\/[^/]+\/+\.a\/+[0-9a-f]{10,})-[^/]*(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "bathingnews.com") {
			return {
				can_head: false,
				url: src.replace(/(\/\.a\/[^-/]*)-[^/]*$/, "$1")
			};
		}
		if (domain_nowww === "fmyokohama.jp") return src.replace(/\/thumbnail\/+([^/]*)-[0-9]+wi(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain === "gd.image-qoo10.jp") return src.replace(/\.[^/.]*(\.[^/.]*)$/, "$1");
		if (domain === "img.jakpost.net") {
			return [
				src.replace(/\.[^/.]*(\.[^/.]*)$/, "$1"),
				src.replace(/\._[a-z]+(\.[^/.]*)$/, "._large$1")
			];
		}
		if (domain === "r.ddmcdn.com") return src.replace(/:\/\/[^/]*\/(?:[^/_]*_[^/_]*\/)*/, "://static.ddmcdn.com/");
		if ((domain_nosub === "newegg.com" && /images[0-9]*\./.test(domain)) ||
			domain_nosub === "neweggimages.com") {
			return src
				.replace(/(:\/\/[^/]*\/)(?:NeweggImage\/)?(?:ProductImage|productimage)[^/]*\//, "$1ProductImageOriginal/")
				.replace(/\/itemreivewimages\/+reviewimg[0-9]+\/+/, "/itemreivewimages/original/");
		}
		if (domain === "images.costco-static.com" ||
			domain === "images.costcobusinesscentre.ca") {
			return src
				.replace(/([?&])recipeName=[^&]*/, "$1")
				.replace(/&$/, "");
		}
		if (amazon_container === "emerge-tech") {
			return src.replace(/\/[a-z]*\/([0-9]*_[a-z]*_)[a-z]*(\.[^/.]*)$/, "/full/$1full$2");
		}
		if (domain_nosub === "wfcdn.com" && domain.match(/img[0-9]*(?:-[^.]*)?\.wfcdn\.com/) ||
			domain === "assets.wfcdn.com") {
			return src
				.replace(/\/im\/+[0-9]+\/+compr-r85\/+([0-9]+\/+[0-9]+\/+)/, "/lf/unprocessed/hash/$11/")
				.replace(/(\/lf\/+)[a-z]+(\/+hash\/)/, "$1unprocessed$2")
				.replace(/(\/im\/[0-9]+\/)[^/]*\//, "$1compr-r85/");
		}
		if (domain_nosub === "hdnux.com") return src.replace(/(\/photos\/+(?:[0-9]{2}\/+){3,4}[0-9]+\/+[0-9]+\/+)[^/.?#]+(\.[^/.]*)(?:[?#].*)?$/, "$1rawImage$2");
		if (domain_nosub === "busan.com" && domain.match(/^news[0-9]*\./)) {
			return src.replace(/(\/content\/+image\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+)_t(\.[^/.]*)$/, "$1_0$2");
		}
		if (domain_nowww === "busan.com") return src.replace(/(\/wcms\/+wcms_data\/+photos\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+)_[sm](\.[^/.]*)(?:[?#].*)?$/, "$1_l$2");
		if (amazon_container === "bucket.scribblelive.com" ||
			domain === "images.scribblelive.com") {
			return src.replace(/_[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain === "www.dhresource.com" ||
			domain === "image.dhgate.com") {
			return src
				.replace(/(:\/\/[^/]*\/albu_[0-9]+_[0-9]+[-/].*?)[0-9]+x[0-9]+/, "$10x0")
				.replace(/(:\/\/[^/]*\/)[0-9]+x[0-9]+/, "$10x0")
				.replace(/(:\/\/[^/]*\/)[^/]*\/[^/]*\/[0-9]+x[0-9]+\//, "$10x0/");
		}
		if (domain_nowww === "storify.com" && /\/services\/+proxy\//.test(src)) {
			return src.replace(/.*\/services\/proxy\/[0-9]+\/[^/]*\/([a-z]+)\/(.*)$/, "$1://$2");
		}
		if (domain_nowww === "mbcsportsplus.com" ||
			domain === "m.mbcsportsplus.com") {
			var outdir = null;
			if (src.match(/[?&]type=m[^a-z0-9A-Z]/))
				outdir = "/data/home/data/msplMain";
			else if (src.match(/[?&]type=a[^a-z0-9A-Z]/))
				outdir = "/data/board/attach";
			if (outdir)
				return src.replace(/\/images\/+img\.php\?(?:.*&)?src=([^&]*).*/, outdir + "$1");
		}
		if (domain_nosub === "joomag.com" && domain.match(/s[0-9]*cdn\.joomag\.com/)) {
			return src.replace(/(\/mobile\/.*\/[0-9]+_)[0-9]+(-[0-9]*\.[^/]*)$/, "$10$2");
		}
		if (domain === "i.pximg.net" ||
			domain === "pixiv.pximg.net" ||
			domain === "i.pixiv.re" ||
			(domain_nosub === "techorus-cdn.com" && /^tc-pximg[0-9]*\./.test(domain))) {
			newsrc = src
				.replace(/(\/user-profile\/+img\/.*\/[0-9]+_[0-9a-f]{20,})_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2")
				.replace(/\/c\/[0-9]+x[0-9]+(?:_[0-9]+)?(?:_[ag][0-9]+)*\//, "/")
				.replace(/\/(?:img-master|custom-thumb)\//, "/img-original/")
				.replace(/(\/[0-9]+_p[0-9]+)_[^/]*(\.[^/.]*)$/, "$1$2");
			var referer_url = "https://www.pixiv.net/";
			if (domain === "pixiv.pximg.net" || domain_nosub === "pixiv.re") {
				referer_url = null;
			}
			match = src.match(/\/([0-9]+)_p([0-9]+)(?:_[^/.]+)?\.[^/.]+$/);
			if (!match) {
				id = null;
			} else {
				id = match[1];
				referer_url = "https://www.pixiv.net/artworks/" + id;
			}
			obj = {};
			if (referer_url && domain_nosub !== "pixiv.re") {
				obj.headers = {
					Referer: referer_url
				};
			}
			if (id) {
				obj.extra = {
					page: referer_url
				};
			}
			var urls = [src];
			if (newsrc !== src) {
				urls = add_extensions(newsrc);
			}
			var retobj = fillobj_urls(urls, obj);
			if (id && options && options.force_page && options.cb && options.do_request) {
				retobj.unshift({
					url: referer_url + "#imu-page=" + match[2],
					is_pagelink: true
				});
			}
			return retobj;
		}
		if (domain_nowww === "pixiv.net") {
			var query_pixiv_page = function(id, page, cb) {
				var url = "https://www.pixiv.net/artworks/" + id;
				api_query("pixiv_page:" + id, {
					url: url
				}, function(obj) {
					if (!obj)
						return cb(null);
					if (obj[0].album_info) {
						var links = obj[0].album_info.links;
						for (var i = 0; i < links.length; i++) {
							if (i != page) {
								links[i].is_current = false;
								continue;
							}
							links[i].is_current = true;
							obj[0].url = links[i].url;
						}
					}
					return cb(obj);
				}, function(done, resp, cache_key) {
					var match = resp.responseText.match(/<meta\s+name=\"preload-data\"\s+id=\"meta-preload-data\"\s+content='(.*?)'>/);
					if (!match) {
						console_error(cache_key, "Unable to find match", resp);
						return done(null, false);
					}
					var json = JSON_parse(decode_entities(match[1]));
					var illust = json.illust[id];
					var obj = {
						extra: {
							page: resp.finalUrl
						},
						headers: {
							Referer: resp.finalUrl
						}
					};
					if (illust.illustTitle) {
						obj.extra.caption = illust.illustTitle;
					}
					var urls = [];
					var urltypes = ["original", "regular", "small", "thumb", "mini"];
					var unsorted_urls = [];
					for (var type in illust.urls) {
						unsorted_urls.push({
							type: type,
							url: illust.urls[type]
						});
					}
					unsorted_urls.sort(function(a, b) {
						var a_index = array_indexof(urltypes, a.type);
						var b_index = array_indexof(urltypes, b.type);
						if (a_index < 0)
							return 1;
						if (b_index < 0)
							return -1;
						return a_index - b_index;
					});
					for (var i = 0; i < unsorted_urls.length; i++) {
						if (array_indexof(urltypes, unsorted_urls[i].type) >= 0)
							urls.push(unsorted_urls[i].url);
					}
					if (urls.length === 0) {
						console_error(cache_key, "Unable to find valid urls from", json, illust);
						return done(null, false);
					}
					var url = urls[0];
					if (illust.pageCount && illust.pageCount > 1) {
						obj.album_info = {
							type: "links",
							links: []
						};
						for (var i = 0; i < illust.pageCount; i++) {
							obj.album_info.links.push({
								url: url.replace(/(_p)[0-9]+(_[^/.]+)?(\.[^/.]+)$/, "$1" + i + "$2$3")
							});
						}
					}
					return done(fillobj_urls([urls[0]], obj), 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+(?:[^/]+\/+)?artworks\/+([0-9]+)\/*(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+member_illust\.php\?(?:.*&)?illust_id=([0-9]+)/
				],
				run: function(cb, match, website_options) {
					var page = 0;
					var pagematch = website_options.url.match(/#imu-page=([0-9]+)/);
					if (pagematch)
						page = pagematch[1];
					query_pixiv_page(match[1], page, cb);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "booth.pm" && domain.match(/s[0-9]*\.booth\.pm/) ||
			domain === "booth.pximg.net") {
			newsrc = src
				.replace(/\/c\/[a-z]_[0-9]+\//, "/")
				.replace(/_c_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
			if (newsrc !== src) {
				return add_full_extensions(newsrc);
			}
			newsrc = src.replace(/(:\/\/[^/]*\/)c\/[0-9]+x[0-9]+(?:_[^/]*)?\//, "$1");
			if (newsrc !== src)
				return add_full_extensions(newsrc);
			newsrc = src.replace(/(\/[-0-9a-f]+)_[^/.]*(\.[^/.]*)$/, "$1$2");
			if (newsrc !== src)
				return add_full_extensions(newsrc);
		}
		if (domain === "downloads.fanbox.cc") {
			var page_1 = null;
			match = src.match(/\/images\/+post\/+([0-9]+)\/+/);
			if (match) {
				page_1 = "https://a.fanbox.cc/posts/" + match[1];
			}
			obj = {
				url: src,
				extra: { page: page_1 }
			};
			newsrc = src.replace(/(\/images\/+post\/+[0-9]+\/+)w\/+[0-9]+\/+/, "$1");
			if (newsrc !== src) {
				obj.url = newsrc;
				return fillobj_urls(add_extensions_with_jpeg(newsrc), obj);
			}
			return obj;
		}
		if (domain === "cache-graphicslib.viator.com") {
			return {
				url: src.replace(/([-_][0-9]+)-[^-_/.]*(\.[^/.]*)$/, "$1-raw$2"),
				head_wrong_contentlength: true
			};
		}
		if (domain_nosub === "4sqi.net") return src.replace(/\/img\/+general\/+[0-9]+x[0-9]+\//, "/img/general/original/");
		if (domain === "static.panoramio.com" ||
			googlestorage_container === "static.panoramio.com") {
			return src.replace(/\/photos\/[^/]*\//, "/photos/original/");
		}
		if (domain_nosub === "myportfolio.com" && domain.match(/.*cdn.*\.myportfolio\.com$/)) {
			return src.replace(/_(?:rw_[0-9]+|rwc_[0-9]+(?:x[0-9]+){4})(\.[^/.?]*)(?:\?.*)?$/, "$1");
		}
		if (domain === "i.dell.com") return src.replace(/(\/(?:[0-9a-f]+-){4}[0-9a-f]+\/[0-9]+\/)LargePNG/, "$1originalpng");
		if (domain === "thumb.zumst.com") {
			return src.replace(/.*:\/\/[^/]*\/[0-9]+[^/]*\//, "");
		}
		if (domain === "imgp.golos.io") return src.replace(/^[a-z]+:\/\/[^/]*\/+[0-9]+x[0-9]+\/+(https?:)/, "$1");
		if (domain === "images.underskog.no") return src.replace(/^[a-z]+:\/\/[^/]+\/+[0-9]*x[0-9]*\/+(https?:\/\/)/, "$1");
		if ((domain_nosub === "zumst.com" ||
			domain_nosub === "zum.com") &&
			domain.match(/^static\./)) {
			return src
				.replace(/\/images\/+thumb\/+/, "/images/")
				.replace(/\/([0-9a-f]+)_[0-9]+x[0-9]+[a-z]?(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		}
		if (domain === "file.mk.co.kr" ||
			domain_nosub === "mediapundit.net") {
			newsrc = src.replace(/\.thumb(?:[?#].*)?$/, "");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "kobis.or.kr") return src.replace(/\/thumb\/+thn_/, "/");
		if (domain_nowww === "breaknews.com") return src.replace(/\/data\/([^/]*)\/mainimages\/[0-9]*\/([0-9]{6})/, "/imgdata/$1/$2/$2");
		if (domain_nowww === "ilyo.co.kr" ||
			domain_nowww === "beatsports.net" ||
			domain_nowww === "ohfun.net") {
			return src.replace(/\/thm[0-9]+_/, "/");
		}
		if (domain_nowww === "joseilbo.com") {
			return src
				.replace(/\.thumbnail(\.[^/.]*)$/, "$1")
				.replace(/\/gisa_img\/([0-9]+_[^/._]+)(\.[^/.]*)$/, "/gisa_img_origin/$1_origin$2");
		}
		if (domain_nosub === "phncdn.com") {
			match = src.match(/\/pics\/+albums\/+(?:[0-9]+\/+){3}([0-9]+)\/+/);
			if (match) {
				return {
					url: "https://www.pornhub.com/photo/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "pornhub.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+photo\/+([0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://www.pornhub.com/photo/${id}",
				process: function(done, resp, cache_key) {
					var imagesrc = get_meta(resp.responseText, "twitter:image:src"); //og:image is thumbnail
					if (!imagesrc) {
						console_error(cache_key, "Unable to find source image for", resp);
						return done(null, false);
					}
					var obj = {
						url: imagesrc.replace(/:\/\/di\./, "://ci."), // normalize to avoid excessive redirects
						extra: {
							page: resp.finalUrl
						}
					};
					var caption = get_meta(resp.responseText, "twitter:title");
					if (caption) {
						obj.extra.caption = caption;
					}
					return done(obj, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "pornhub.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:view_video\.php\?(?:.*&)?viewkey=|embed\/+)([^&]+).*$/);
			if (!match) {
				match = src.match(/^[a-z]+:\/\/[^/]+\/+embed\/+([^?&#]+)(?:[?#].*)?$/);
			}
			if (match) {
				id = match[1];
				var get_pornhub_videodata = function(key, cb) {
					var cache_key = "pornhub_video:" + key;
					api_cache.fetch(cache_key, cb, function(done) {
						options.do_request({
							url: "https://www.pornhub.com/view_video.php?viewkey=" + key,
							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(/<script[^>]*>\s*var (flashvars_[0-9]+) = ({.*});\s*var player_mp4_seek\s*=\s*\S+;(?:\s*\/\/.*)?\s*(var ra[0-9a-z]{10,}\s*=.*;)?/);
								if (!match) {
									console_error("Unable to find flashvars match", resp);
									return done(null, false);
								}
								var vartable = {};
								try {
									vartable[match[1]] = JSON_parse(match[2]);
								} catch (e) {
									console_error(e, resp);
									return done(null, false);
								}
								var main_name = match[1];
								var obfuscated = match[3];
								if (!obfuscated) {
									return done(vartable[main_name], 3 * 60 * 60);
								}
								var tokens = [];
								var current_token = "";
								var in_comment = false;
								var escaping = false;
								var in_string = false;
								var commit_token = function() {
									if (current_token.length > 0) {
										tokens.push(current_token);
										current_token = "";
									}
								};
								for (var i = 0; i < obfuscated.length; i++) {
									var c = obfuscated[i];
									if (in_comment) {
										if (c === "/" && obfuscated[i - 1] === "*") {
											in_comment = false;
											continue;
										} else {
											continue;
										}
									}
									if (escaping) {
										current_token += c;
										escaping = false;
										continue;
									}
									if (in_string) {
										current_token += c;
										if (c === in_string) {
											in_string = false;
											commit_token();
										}
										continue;
									}
									if (/\s/.test(c)) {
										commit_token();
										continue;
									}
									if (/["']/.test(c)) {
										commit_token();
										current_token += c;
										in_string = c;
										continue;
									}
									if (/[\[\]=;+:,{}]/.test(c)) {
										commit_token();
										current_token = c;
										commit_token();
										continue;
									}
									if (c === "\\") {
										escaping = true;
										continue;
									}
									if (c === "/" && obfuscated[i + 1] === "*") {
										in_comment = true;
										i++;
										continue;
									}
									current_token += c;
								}
								var eval_varvalue = function(varvalue) {
									var newvalues = [];
									for (var i = 0; i < varvalue.length; i++) {
										var currentvalue = varvalue[i];
										currentvalue = currentvalue.replace(/^'(.*)'$/, '"$1"'); // TODO: handle "
										if (currentvalue === "+")
											continue;
										if (varvalue[i] in vartable) {
											currentvalue = vartable[varvalue[i]];
											var currentname = null;
											var startbracket = -1;
											var had_startbracket = false;
											for (; (i + 1) < varvalue.length; i++) {
												if (varvalue[i] === "[") {
													startbracket = i;
													had_startbracket = true;
													continue;
												} else if (!had_startbracket) {
													break;
												}
												if (varvalue[i] === "]") {
													had_startbracket = false;
													currentname = varvalue.slice(startbracket + 1, i);
													currentvalue = currentvalue[eval_varvalue(currentname)];
													continue;
												}
											}
											currentvalue = JSON_stringify(currentvalue);
										}
										if (i > 1 && varvalue[i - 1] === "+") {
											var lastvalue = JSON_parse(newvalues[newvalues.length - 1]);
											newvalues[newvalues.length - 1] = JSON_stringify(lastvalue + JSON_parse(currentvalue));
										} else {
											newvalues.push(currentvalue);
										}
									}
									return JSON_parse(newvalues.join(" "));
								};
								for (var i = 0; i < tokens.length; i++) {
									var token = tokens[i];
									if (token === "var") {
										var varname = tokens[i + 1];
										i += 3; // =
										var begin = i;
										for (; i < tokens.length; i++) {
											if (tokens[i] === ";")
												break;
										}
										var varvalue = tokens.slice(begin, i);
										vartable[varname] = eval_varvalue(varvalue);
									} else if (token in vartable) {
										var parent_table = vartable;
										var currentname = token;
										var startbracket = -1;
										var had_startbracket = false;
										i++;
										for (; (i + 1) < tokens.length; i++) {
											if (tokens[i] === "[") {
												startbracket = i;
												had_startbracket = true;
												continue;
											} else if (!had_startbracket) {
												break;
											}
											if (tokens[i] === "]") {
												had_startbracket = false;
												parent_table = parent_table[currentname];
												currentname = tokens.slice(startbracket + 1, i);
												currentname = eval_varvalue(currentname);
												continue;
											}
										}
										i++; // =
										var begin = i;
										for (; i < tokens.length; i++) {
											if (tokens[i] === ";")
												break;
										}
										var varvalue = tokens.slice(begin, i);
										parent_table[currentname] = eval_varvalue(varvalue);
									}
								}
								done(vartable[main_name], 3 * 60 * 60);
							}
						});
					});
				};
				var get_pornhub_obj = function(data, cb) {
					var obj = {
						url: null,
						headers: {
							Accept: "*/*",
							Origin: "https://www.pornhub.com",
							Referer: "https://www.pornhub.com/",
							"sec-fetch-dest": "empty",
							"sec-fetch-mode": "cors",
							"sec-fetch-site": "cross-site"
						},
						extra: {}
					};
					if (data.link_url) {
						obj.extra.page = data.link_url;
					}
					if (data.video_title) {
						obj.extra.caption = data.video_title;
					}
					if (!data.mediaDefinitions) {
						return cb(obj);
					}
					var process_mediadef = function(def) {
						if (typeof def.quality === "string")
							def.quality = parseInt(def.quality);
						if (typeof def.quality === "number")
							def.quality = [def.quality];
					};
					var mediadefs = [];
					var fetchurls = [];
					array_foreach(data.mediaDefinitions, function(def) {
						process_mediadef(def);
						if (!is_array(def.quality) || !def.quality.length) {
							if (def.remote && def.videoUrl) {
								fetchurls.push(def.videoUrl);
							} else {
								console_warn("Unable to find quality for", def, "in", data);
							}
							return;
						}
						mediadefs.push(def);
					});
					var get_largest_quality = function(x) {
						return x.sort().reverse()[0];
					};
					var final = function() {
						mediadefs.sort(function(a, b) {
							var a_quality = get_largest_quality(a.quality);
							var b_quality = get_largest_quality(b.quality);
							if (!a_quality || !b_quality)
								return 0;
							var diff = b_quality - a_quality;
							if (diff)
								return diff;
							return b.quality.length - a.quality.length;
						});
						var urls = [];
						array_foreach(mediadefs, function(def) {
							var video = true;
							if (def.format === "hls") {
								video = "hls";
							}
							if (!def.videoUrl) {
								return;
							}
							urls.push({
								url: def.videoUrl,
								video: video,
								is_private: true // linked to ip
							});
						});
						if (data.image_url)
							urls.push(data.image_url);
						return cb(fillobj_urls(urls, obj));
					};
					var waiting = false;
					var finished = 0;
					array_foreach(fetchurls, function(url) {
						api_query("pornhub_url: " + url, {
							url: url,
							imu_mode: "ajax",
							headers: {
								Referer: "https://www.pornhub.com/"
							},
							json: true
						}, function(data) {
							if (data)
								array_extend(mediadefs, data);
							finished++;
							if (finished >= fetchurls.length)
								final();
						}, function(done, resp, cache_key) {
							if (!is_array(resp) || !resp.length) {
								console_error(cache_key, "Invalid response", resp);
								return done(null, false);
							}
							array_foreach(resp, process_mediadef);
							return done(resp);
						});
						waiting = true;
					});
					if (!waiting)
						final();
				};
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				if (options.do_request && options.cb) {
					get_pornhub_videodata(id, function(data) {
						if (!data) {
							return options.cb(page_nullobj);
						}
						get_pornhub_obj(data, function(obj) {
							if (!obj)
								return options.cb(page_nullobj);
							obj.push(page_nullobj);
							return options.cb(obj);
						});
					});
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if (host_domain_nosub === "pornhub.com" && options.element) {
			newsrc = common_functions["get_pagelink_host_el_matching"](options, {
				url_match: /^[a-z]+:\/\/[^/]+\/+view_video\.php\?(.*&)?viewkey=/,
				el_match: function(x) {
					return x.tagName.toLowerCase() === "video-element" && x.hasAttribute("unique-id");
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "pornkai.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+view\?(?:.*&)?key=(ph[0-9a-z]+)(?:&.*)?$/, "https://pornhub.com/view_video.php?viewkey=$1");
			if (newsrc !== src) {
				return {
					url: newsrc,
					is_pagelink: true
				};
			}
		}
		if (host_domain_nowww === "youporn.com") {
			newsrc = common_functions["get_pagelink_host_el_matching"](options, {
				url_match: /^[a-z]+:\/\/[^/]+\/+(?:watch|embed)\/+([0-9]+)(?:\/+(?:[^/]+\/*)?)?(?:[?#].*)?$/,
				el_match: function(x) {
					return x.tagName === "DIV" && x.id === "videoContainer";
				}
			});
			if (newsrc && newsrc.url !== src)
				return newsrc;
		}
		if (domain_nosub === "t8cdn.com" ||
			domain_nosub === "ypncdn.com") {
			newsrc = src
				.replace(/\/[0-9]+x[0-9]+\/+([0-9]+)(?:[(][a-z]+=[^/)]*\)){1,}([^/]*)$/, "/originals/$1$2")
				.replace(/(\/originals?\/+[0-9]+(?:\/+[^/]*?)?)(?:[(][a-z]+=[^/)]*\)){1,}([^/]*)$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "rdtcdn.com" && /^[a-z]i\./.test(domain)) {
			newsrc = src
				.replace(/\.webp(?:[?#].*)?$/, ".jpg")
				.replace(/\/m=[^/]*\/+_thumbs\/+/, "/m=/_thumbs/")
				.replace(/\/m=[^/]*\/+(_thumbs\/+gallery\/.*_[0-9]+_)\/+[^/]+-([0-9]+\.[^/.]+)(?:[?#].*)?$/, "/m=/$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "rdtcdn.com" ||
			domain_nowww === "redtube.com" ||
			domain_nowww === "redtube.com.br" ||
			domain === "embed.redtube.com") {
			page_nullobj = null;
			var get_redtube_id_from_url = function(url) {
				var match = url.match(/:\/\/[^/]+\/+(?:m=[^/]+\/+)?media\/+videos\/+[0-9]{6}\/+[0-9]{2}\/+([0-9]+)\/+/);
				if (match) {
					return match[1];
				}
				match = url.match(/:\/\/embed\.[^/]+\/+\?(?:.*&)?id=([0-9]+)/);
				if (!match) {
					match = url.match(/:\/\/(?:www\.)redtube\.com\/+([0-9]+)(?:[?#].*)?$/);
				}
				if (match) {
					page_nullobj = {
						url: url,
						is_pagelink: true
					};
					return match[1];
				}
				return null;
			};
			var query_redtube = function(id, cb) {
				var cache_key = "redtube:" + id;
				api_cache.fetch(cache_key, cb, function(done) {
					options.do_request({
						url: "https://www.redtube.com/" + id,
						method: "GET",
						onload: function(resp) {
							if (resp.status !== 200) {
								console_error(cache_key, resp);
								return done(null, false);
							}
							var match = resp.responseText.match(/page_params\.video_player_setup[\s\S]+playervars:\s*({.*}),/);
							if (!match) {
								console_error(cache_key, "Unable to find match for", resp);
								return done(null, false);
							}
							try {
								var json = JSON_parse(match[1]);
								return done(json, 60 * 60);
							} catch (e) {
								console_error(cache_key, e);
							}
							return done(null, false);
						}
					});
				});
			};
			var get_obj_from_redtube_info = function(data) {
				var baseobj = {
					extra: {
						page: data.link_url,
						caption: data.video_title
					}
				};
				var max = 0;
				var maxobj = null;
				for (var i = 0; i < data.mediaDefinitions.length; i++) {
					var media = data.mediaDefinitions[i];
					var our_quality = parseInt(media.quality);
					if (!isNaN(our_quality) && our_quality > max && media.videoUrl) {
						max = our_quality;
						maxobj = media;
					}
				}
				var urls = [];
				if (maxobj) {
					urls.push({
						url: maxobj.videoUrl,
						video: true,
						headers: {
							Referer: baseobj.extra.page,
							Origin: "https://redtube.com"
						}
					});
				}
				urls.push(data.image_url);
				return fillobj_urls(urls, baseobj);
			};
			id = get_redtube_id_from_url(src);
			if (id) {
				obj = {
					url: src,
					extra: {
						page: "https://www.redtube.com/" + id
					}
				};
				if (page_nullobj)
					obj.is_pagelink = true;
				if (options.do_request && options.cb) {
					query_redtube(id, function(data) {
						if (!data) {
							return options.cb(obj);
						}
						var newobj = get_obj_from_redtube_info(data);
						if (!is_array(newobj))
							newobj = [newobj];
						newobj.push(obj);
						return options.cb(newobj);
					});
					return {
						waiting: true
					};
				}
				return obj;
			}
		}
		if (domain_nowww === "tube8.com") {
			var fetch_tube8_flashvars = function(id, cb) {
				api_query("tube8_flashvars:" + id, {
					url: "https://www.tube8.com/a/a/" + id + "/"
				}, cb, function(done, resp, cache_key) {
					var match = resp.responseText.match(/var\s+flashvars\s*=\s*({.*?})\s*; *\n/);
					if (!match) {
						console_error(cache_key, "Unable to find match", resp);
						return done(null, false);
					}
					try {
						var json = JSON_parse(match[1]);
						done(json, 6 * 60 * 60);
					} catch (e) {
						console_error(cache_key, e);
						return done(null, false);
					}
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+[^/]+\/+[^/]+\/+([0-9]+)\/*(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					fetch_tube8_flashvars(id, function(data) {
						var origsrc = src;
						if (options._internal_info && options._internal_info.mediadefinition_src) {
							origsrc = options._internal_info.mediadefinition_src;
						}
						cb(common_functions["parse_mediadefinition"](origsrc, data, cache_key));
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "youporn.com") {
			var fetch_youporn_flashvars = function(id, cb) {
				api_query("youporn_flashvars:" + id, {
					url: "https://www.youporn.com/watch/" + id + "/"
				}, cb, function(done, resp, cache_key) {
					var match = resp.responseText.match(/(?:page_params.video.mediaDefinition\s*=|\s+mediaDefinition:)\s*(\[{.*?}\])\s*[;,] *\n/);
					if (!match) {
						console_error(cache_key, "Unable to find match", resp);
						return done(null, false);
					}
					try {
						var mediaDefinition = JSON_parse(match[1]);
						var json = {
							link_url: resp.finalUrl,
							mediaDefinition: mediaDefinition
						};
						done(json, 6 * 60 * 60);
					} catch (e) {
						console_error(cache_key, e);
						return done(null, false);
					}
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:watch|embed)\/+([0-9]+)(?:\/+(?:[^/]+\/*)?)?(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					fetch_youporn_flashvars(id, function(data) {
						var origsrc = src;
						if (options._internal_info && options._internal_info.mediadefinition_src) {
							origsrc = options._internal_info.mediadefinition_src;
						}
						cb(common_functions["parse_mediadefinition"](origsrc, data, cache_key));
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "xtube.com") {
			var fetch_xtube_flashvars = function(id, cb) {
				api_query("xtube_flashvars:" + id, {
					url: "https://www.xtube.com/video-watch/a-" + id
				}, cb, function(done, resp, cache_key) {
					var match = resp.responseText.match(/var playerConf\s*=\s*({.*?}),\s*loaderConf/);
					if (!match) {
						console_error(cache_key, "Unable to find match", resp);
						return done(null, false);
					}
					try {
						var match1 = match[1].replace(/![01]/g, "\"true\"");
						var fixup = fixup_js_obj_proper(match1);
						var playerconf = JSON_parse(fixup);
						var json = playerconf.mainRoll;
						json.link_url = json.videoUrl;
						json.video_title = json.title;
						done(json, 6 * 60 * 60);
					} catch (e) {
						console_error(cache_key, e, match);
						return done(null, false);
					}
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video-watch\/+[^/]+-([0-9]+)\/*(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					fetch_xtube_flashvars(id, function(data) {
						var origsrc = src;
						if (options._internal_info && options._internal_info.mediadefinition_src) {
							origsrc = options._internal_info.mediadefinition_src;
						}
						cb(common_functions["parse_mediadefinition"](origsrc, data, cache_key));
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "xtube.com" && /^cdn[0-9]*-/.test(domain)) {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+m=[^/]+\/+videos\/+[0-9]{6}\/+[0-9]{1,2}\/+([0-9]+)\/+/);
			if (match) {
				id = match[1];
				options._internal_info.mediadefinition_src = src;
				return {
					url: "https://www.xtube.com/video-watch/a-" + id,
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "t8cdn.com" || domain_nosub === "ypncdn.com") {
			id = src.match(/:\/\/[^/]+\/+[0-9]{6}\/+[0-9]{1,2}\/+([0-9]+)\/+(?:vl_|[0-9]+[pP]_[0-9]+[kK]_|(?:[0-9]+x[0-9]+|originals?)\/+(?:[0-9]+\/+[^/]+-[0-9]+|[0-9]+(?:[(][a-z]+=[^/)]*\)){0,})\.)/);
			if (id) {
				id = id[1];
				options._internal_info.mediadefinition_src = src;
				if (domain_nosub === "t8cdn.com") {
					return {
						url: "https://www.tube8.com/a/a/" + id + "/",
						is_pagelink: true
					};
				} else if (domain_nosub === "ypncdn.com") {
					return {
						url: "https://www.youporn.com/watch/" + id + "/",
						is_pagelink: true
					};
				}
			}
		}
		if (domain === "cci.xnxx.fan") return src.replace(/(\/original\/)(?:\([a-z]+=[^/)]*\))*([^/]*)$/, "$1$2");
		if (domain === "img.fril.jp") return src.replace(/\/[a-z]\/([^/]*)$/, "/l/$1");
		if (domain === "img.cinematoday.jp") {
			newsrc = src
				.replace(/-[a-z0-9]*x[a-z0-9]*(\.[^/.]*)$/, "$1")
				.replace(/\/_size_[^/]*\//, "/_size_rx9999/");
			return {
				url: newsrc,
				head_wrong_contentlength: true
			};
		}
		if (domain_nosub === "seesaa.net" ||
			(domain_nowww === "fanblogs.jp" && string_indexof(src, "/file/") >= 0)) {
			return src.replace(/-thumbnail[0-9]*(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain_nosub === "ledevoir.com" && domain.match(/media[0-9]*\.ledevoir\.com/)) {
			return src.replace(/\/images_galerie\/(?:[^-/._]*_)?([0-9]+_[0-9]+)\//, "/images_galerie/nwdp_$1/");
		}
		if (domain_nowww === "infotel.ca") return src.replace(/\/medialibrary\/image\/[^-_/.]*-/, "/medialibrary/image/orig-");
		if ((domain_nowww === "eleconomista.com.mx" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "informador.mx" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "eldeber.com.bo" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "chispa.tv" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "debate.com.mx" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "diarioshow.com" && string_indexof(src, "/img/") >= 0) ||
			(domain === "wp.eldeber.com.bo" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "tribuna.com.mx" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "nacionrex.com" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "enpareja.com" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "filo.news" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "laverdadnoticias.com" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "rosario3.com" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "soycarmin.com" && string_indexof(src, "/img/") >= 0) ||
			src.match(/^[a-z]+:\/\/[^/]*\/(?:__)?export\/+(?:[0-9]{10,}\/+)?sites\/+[^/]+\/+img\/+(?:[^/]*\/+)?[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[^/]*\.[^/._]*_[0-9]{5,}\.[^/.]*(?:_[0-9]{5,}\.[^/.]*)?(?:[?#].*)?$/)) {
			return src.replace(/(\/[^/.]*\.[^/]*)_[0-9]+\.[^/._]*$/, "$1");
		}
		if (domain === "gcm-v2.omerlocdn.com") return src.replace(/_[0-9]+(\.[^/.]*)$/, "$1");
		if (domain === "www.dailystar.com.lb" ||
			domain === "dailystar.com.lb") {
			return src.replace(/([0-9]+)(?:_[^0-9][^/.]*)*(\.[^/.]*)$/, "$1$2");
		}
		if (domain === "images.dailykos.com") return src.replace(/(\/(?:images|avatars)\/[0-9]+\/)[^/]*\/([^/]*)$/, "$1original/$2");
		if (domain === "i.pixl.li") {
			if (/image3b64ca9d2cf0688e\./.test(src)) {
				return {
					url: src,
					bad: true
				};
			}
		}
		if (domain_nosub === "jpg.church") return src.replace(/(:\/\/(?:[^/]+\.)?)jpg\.church\/+/, "$1host.church/");
		if (domain_nowww === "imgmax.com" ||
			domain_nowww === "404store.com" ||
			domain_nowww === "imgpost.co.uk" ||
			domain === "ap.imagensbrasil.org" ||
			domain_nowww === "picture-post.com" ||
			domain_nowww === "stakimages.me" ||
			domain_nowww === "imgsnap.com" ||
			domain === "img.imgmax.com" ||
			domain === "i.img.ie" ||
			domain === "i.lensdump.com" ||
			domain === "img.faploads.com" ||
			(domain_nowww === "celebact.org" && string_indexof(src, "/images/") >= 0) ||
			domain_nosub === "imghost.io" ||
			domain_nosub === "img26.com" ||
			(domain_nowww === "cheapesthosting.xyz" && src.match(/\/i\/+images\//)) ||
			domain_nowww === "s4tu.com" ||
			domain_nowww === "jiopic.com" ||
			domain_nowww === "beautifulmodels.xyz" ||
			domain === "images.superimg.com" ||
			(domain_nowww === "ultraimg.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "celebfeetpics.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "lolzilla.net" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "extraimage.net" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "celebphotos.club" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "image.farm" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "girlspic.net" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "tgfimage.rocks" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "imgfy.net" && string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "picho.st" && /^s[0-9]*\./.test(domain)) ||
			domain_nowww === "imagenup.com" ||
			(domain_nowww === "imgz.pw" && /\/ch\/+images\//.test(src)) ||
			(domain_nowww === "xxximg.art" && string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "tag-fox.com" && /^data[0-9]*\./.test(domain)) ||
			(domain_nosub === "gifyu.com" && string_indexof(src, "/images/") >= 0) ||
			domain_nowww === "iili.io" ||
			domain_nowww === "privacypic.com" ||
			(domain_nosub === "imgcredit.xyz" && /^s[0-9]*\./.test(domain)) ||
			(domain_nowww === "imgcloud.pw" && string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "imgmak.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "pixio.pw" && string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "jpg.church" && /^simp[0-9]*\./.test(domain)) ||
			(domain_nosub === "host.church" && /^simp[0-9]*\./.test(domain)) ||
			(domain_nosub === "jpg5.su" && /^simp[0-9]*\./.test(domain)) ||
			(domain_nowww === "photoloading.com" && string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "lensdump.com" && /^i[0-9]*\./.test(domain)) ||
			domain === "i.pixl.li" ||
			(domain_nosub === "picturedent.org" && string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "media-storage.net" && /^s[0-9]\./.test(domain)) ||
			domain === "imagehost.thasnasty.com" ||
			domain_nowww === "img.kiwi" ||
			domain_nowww === "add.pics" ||
			domain_nowww === "putmega.com" ||
			domain_nowww === "image-bugs.com") {
			return src.replace(/\.(?:th|md)(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "imgpile.com" && /\/images\//.test(src)) {
			return {
				url: src.replace(/\.(?:th|md)(\.[^/.]*)$/, "$1"),
				headers: {
					"Accept": "*/*"
				}
			};
		}
		if (domain_nowww === "cheapesthosting.xyz") return src.replace(/\/upload\/[a-z]+(\/[0-9]+\/[0-9]+\/[0-9]+\/)/, "/upload/big$1");
		if (domain === "static.maxmodels.pl") {
			if (string_indexof(src, "/photos/") >= 0 || string_indexof(src, "/article/") >= 0) {
				return src.replace(/_thumb(\.[^/.]*)$/, "$1");
			}
			if (string_indexof(src, "/profile/") >= 0) {
				return src.replace(/_[a-z]+(\.[^/.]*)$/, "_profile$1");
			}
		}
		if (domain_nosub === "img.yt") {
			return src.replace("/small/", "/big/");
		}
		if (domain === "cdn.wallpaperjam.com") return src.replace(/\/static\/images\/.*?\/([a-f0-9]+)(\.[^/.]*)$/, "/$1/image$2");
		if (domain === "cdn.oboi7.com") return src.replace(/\/static\/images\/[a-z]\//, "/content/images/");
		if (domain === "media.tabloidbintang.com") return src.replace(/\/thumb\/([^/]*\.[^/.]*)(?:\/.*)/, "/$1");
		if (domain === "media.teen.co.id") return src.replace(/\/thumb\/([^/?]*\.[^/.?]*).*?[?&](p=[^&]*).*/, "/view/$1?$2");
		if (domain === "cdn.imgchest.com") return src.replace(/\/files\/+thumb\//, "/files/");
		if ((domain_nosub === "hudong.com" && string_indexof(domain, ".att.hudong.com") >= 0) ||
			(domain_nowww === "eiga-board.com" && string_indexof(src, "/assets/medias/") >= 0) ||
			(domain_nowww === "kaigai-drama-board.com" && string_indexof(src, "/assets/medias/") >= 0)) {
			newsrc = src.replace(/_s(\.[^/.]*)$/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "hudong.com" && string_indexof(domain, ".att.hudong.com") >= 0) {
			return src.replace(/_[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "ihanyu.com") return src.replace(/\/cache\/([^/]*)\/([^/]*\/[0-9]+\/[0-9]+\/)[0-9]+\/([0-9]+\.[^/.]*)$/, "/uploadfile/$1/$2$3");
		if (domain_nowww === "gongl8.com" ||
			domain === "upload.mcchina.com" ||
			domain_nowww === "suanning.com" ||
			domain === "upload.site.cnhubei.com" ||
			domain_nowww === "artsbj.com" ||
			domain === "upload.taihainet.com" ||
			domain === "news.yule.com.cn" ||
			domain === "upload.sanqin.com" ||
			domain === "upload.art.ifeng.com" ||
			domain === "uploads.rayli.com.cn" ||
			(domain_nosub === "ablwang.com" && domain.match(/m[0-9]*\.ablwang\.com/)) ||
			(domain_nosub === "m1905.cn" && domain.match(/image[0-9]*\.m1905\.cn/)) ||
			domain_nowww === "ozanyerli.com" ||
			domain_nowww === "entline.cn" ||
			domain === "img.ixiumei.com" ||
			domain_nowww === "69876.com" ||
			domain === "222.186.12.239") {
			newsrc = src.replace(/(\/[0-9]{4}\/+[0-9]{4}\/+)thumb_[0-9]+_(?:[0-9]+_){0,2}([0-9]{8,})(?:_watermark)?(\.[^/.]+)(?:[?#].*)?$/, "$1$2$3");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "imgsh.jpnxcn.com" ||
			domain === "img.94hnr.com" ||
			domain === "img.cancai.net" ||
			domain === "img.sexbeautygirl.com" ||
			(domain_nosub === "huanqiu.com" && /^himg[0-9]*\./.test(domain)) ||
			domain === "file.acgxmanga.com") {
			return src.replace(/\/thumb_[0-9]+_[0-9]+_/, "/");
		}
		if (domain_nowww === "gaobei.com" &&
			string_indexof(src, "/upload/") >= 0) {
			return src.replace(/_[a-z](\.[^/.]*)$/, "_b$1");
		}
		if (domain_nowww === "urlebird.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+video\/+(?:[^/?#]+-)?([0-9]{10,})\/*(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://www.tiktok.com/@a/video/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (host_domain_nowww === "urlebird.com" && options.element) {
			if (!src && options.element.classList.contains("overlay")) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
			if (domain_nowww !== "tiktok.com" && options.element.parentElement && options.element.parentElement.parentElement) {
				var dparent = options.element.parentElement.parentElement;
				if (dparent.classList.contains("thumb")) {
					var a = dparent.querySelector("a[href*=video]");
					if (a) {
						return {
							url: a.href,
							is_pagelink: true
						};
					}
				}
			}
		}
		if (host_domain_nosub === "tiktok.com" && options.element) {
			if (options.element.tagName === "DIV" && options.element.classList.contains("play-button")) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "tiktok.com") {
			var query_tiktok_url = function(url, cb) {
				var normalized_url = url
					.replace(/^[a-z]+:\/\//, "https://")
					.replace(/:\/\/[^/]*tiktok\.com\/+/, "://www.tiktok.com/")
					.replace(/\/*(?:[?#].*)?$/, "");
				var cache_key = "tiktok_nextdata:" + normalized_url;
				api_cache.fetch(cache_key, cb, function(done) {
					options.do_request({
						url: url.replace(/#.*/, ""),
						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(/<script[^>]+id="__UNIVERSAL_DATA_FOR_REHYDRATION__"[^>]*>({.*?})<\/script>/);
							if (!match)
								match = resp.responseText.match(/<script[^>]+id="SIGI_STATE"[^>]*>({.*?})\s*<\/script>/);
							if (!match) {
								console_error("Unable to find sigi match", resp);
								return done(null, false);
							}
							try {
								var json = JSON_parse(match[1]);
								if (json.__DEFAULT_SCOPE__) {
									json = json.__DEFAULT_SCOPE__["webapp.video-detail"];
								}
								return done(json, 60 * 60);
							} catch (e) {
								console_error(e);
								return done(null, false);
							}
						}
					});
				});
			};
			var query_tiktok_post = function(params, cb) {
				var url = "https://www.tiktok.com/@" + params.username + "/video/" + params.web_vid;
				return query_tiktok_url(url, cb);
			};
			var query_tiktok1 = function(params, cb) {
				var url = "https://www.tiktok.com/node/share/video/@" + params.username + "/" + params.web_vid + "?request_from=server";
				var cache_key = "tiktok_node:" + params.username + "/" + params.web_vid;
				api_query(cache_key, {
					url: url,
					json: true
				}, cb, function(done, resp) {
					if (!resp || !resp.itemInfo || !resp.itemInfo.itemStruct) {
						console_error(cache_key, "Unable to get tiktok info from API", resp, params);
						return done(null, false);
					}
					done(resp, 60 * 60);
				});
			};
			var query_tiktok_appapi = function(params, cb) {
				if (!options.rule_specific || !options.rule_specific.tiktok_app_api) {
					return cb(null);
				}
				var cache_key = "tiktok_appapi:" + params.username + "/" + params.web_vid;
				api_query(cache_key, {
					url: "https://api2.musical.ly/aweme/v1/feed/?aweme_id=" + params.web_vid,
					headers: {
						"User-Agent": "TikTok 32.6.0 rv:326001 (iPhone; iOS 17.1.2; en_US) Cronet"
					},
					json: true
				}, cb, function(done, resp) {
					var found_item = null;
					for (var _i = 0, _a = resp.aweme_list; _i < _a.length; _i++) {
						var item = _a[_i];
						if (item.aweme_id === params.web_vid) {
							found_item = item;
							break;
						}
					}
					if (!found_item) {
						console_error(cache_key, "Unable to find", params.web_vid, "from API", resp);
						return done(null, false);
					}
					return done(found_item, 60 * 60);
				});
			};
			var tiktok_api_to_obj = function(data) {
				if (!data || !data.itemInfo || !data.itemInfo.itemStruct) {
					return null;
				}
				try {
					var item = data.itemInfo.itemStruct;
					var caption = item.desc;
					var baseobj_2 = {
						extra: {
							caption: caption
						},
						headers: {
							"accept": "*/*",
							referer: "https://www.tiktok.com/",
							"sec-fetch-dest": "video",
							"sec-fetch-mode": "no-cors",
							"sec-fetch-site": "same-site"
						},
						cookie_url: "https://www.tiktok.com/",
						can_head: false,
					};
					if (data.metaParams && data.metaParams.canonicalHref) {
						baseobj_2.extra.page = data.metaParams.canonicalHref;
					} else {
						baseobj_2.extra.page = "https://www.tiktok.com/@" + item.author.uniqueId + "/video/" + item.id;
					}
					var urls_3 = [];
					for (var _i = 0, _a = item.video.bitrateInfo; _i < _a.length; _i++) {
						var bri = _a[_i];
						var codec = null;
						if (bri.CodecType === "h265_hvc1") {
							codec = "hevc";
						} else if (bri.CodecType !== "h264") {
							console_warn("Unknown codec type for", bri);
						}
						if (!bri.PlayAddr.UrlList.length || !bri.PlayAddr.UrlList[0]) {
							console_warn("Skipping", bri);
							continue;
						}
						urls_3.push({
							url: bri.PlayAddr.UrlList[0],
							media_info: {
								type: "video",
								codec: codec
							}
						});
					}
					var finalobj = fillobj_urls(urls_3, baseobj_2);
					for (var _b = 0, finalobj_1 = finalobj; _b < finalobj_1.length; _b++) {
						var obj_2 = finalobj_1[_b];
						common_functions["set_tiktok_vid_filename"](obj_2);
					}
					return finalobj;
				} catch (e) {
					console_error(e);
					return null;
				}
			};
			var tiktok_sigiapi_to_obj = function(data, id) {
				if (!data || !data.ItemModule || !(id in data.ItemModule)) {
					console_warn("Unable to find", id, "in", data);
					return null;
				}
				try {
					var item = data.ItemModule[id];
					var videourl = item.video.downloadAddr || item.video.playAddr;
					var caption = item.desc;
					var obj = {
						url: videourl,
						extra: {
							caption: caption,
							author_username: item.author,
							created_date: parse_int(item.createTime) * 1000,
							page: "https://www.tiktok.com/@" + item.authorId + "/video/" + item.id
						},
						headers: {
							"accept": "*/*",
							referer: "https://www.tiktok.com/",
							"sec-fetch-dest": "video",
							"sec-fetch-mode": "no-cors",
							"sec-fetch-site": "same-site"
						},
						cookie_url: "https://www.tiktok.com/",
						video: true,
						can_head: false,
					};
					common_functions["set_tiktok_vid_filename"](obj);
					return obj;
				} catch (e) {
					console_error(e, data);
					return null;
				}
			};
			var tiktok_live_sigiapi_to_obj = function(data) {
				if (!data || !data.LiveRoom) {
					console_warn("Unable to find LiveRoom in", data);
					return null;
				}
				try {
					var userinfo = data.LiveRoom.liveRoomUserInfo.user;
					var streamdata_str = data.LiveRoom.liveRoomUserInfo.liveRoom.streamData.pull_data.stream_data;
					var streamdata = JSON_parse(streamdata_str);
					var obj = {
						url: streamdata.data.origin.main.hls,
						extra: {
							author_username: userinfo.uniqueId,
							page: "https://www.tiktok.com/@" + userinfo.uniqueId + "/live"
						},
						headers: {
							"accept": "*/*",
							origin: "https://www.tiktok.com",
							referer: "https://www.tiktok.com/",
							"sec-fetch-dest": "none",
							"sec-fetch-mode": "no-cors",
							"sec-fetch-site": "cross-site"
						},
						media_info: {
							type: "video",
							delivery: "hls",
							is_live: true
						}
					};
					return obj;
				} catch (e) {
					console_error(e, data);
					return null;
				}
			};
			var tiktok_webvideo_to_obj = function(data, id) {
				if (data.itemInfo) {
					return tiktok_api_to_obj(data);
				} else {
					return tiktok_sigiapi_to_obj(data, id);
				}
			};
			var tiktok_appapi_to_obj = function(data) {
				if (!data || !data.video) {
					console_warn("Unable to find data in", data);
					return null;
				}
				try {
					var obj = {
						url: data.video.bit_rate[0].play_addr.url_list[0],
						extra: {
							caption: data.desc,
							author_username: data.author.unique_id,
							created_date: parse_int(data.create_time) * 1000,
							page: "https://www.tiktok.com/@" + data.author.unique_id + "/video/" + data.aweme_id
						},
						headers: {
							"accept": "*/*",
							referer: "https://www.tiktok.com/",
							"sec-fetch-dest": "video",
							"sec-fetch-mode": "no-cors",
							"sec-fetch-site": "same-site"
						},
						cookie_url: "https://www.tiktok.com/",
						video: true,
						can_head: false,
					};
					common_functions["set_tiktok_vid_filename"](obj);
					return obj;
				} catch (e) {
					console_error(e, data);
					return null;
				}
			};
			var remove_tiktok_watermark = function(obj, cb) {
				var page = null;
				var sobj = obj;
				if (is_array(obj))
					sobj = obj[0];
				if (sobj.extra && sobj.extra.page)
					page = sobj.extra.page;
				common_functions["tiktok_remove_watermark"](api_cache, options, sobj.url, page, function(newurl) {
					if (newurl) {
						sobj = fillobj_urls([newurl], sobj)[0];
					}
					if (!common_functions["set_tiktok_vid_filename"](sobj)) {
						delete sobj.filename;
					}
					if (is_array(obj))
						obj[0] = sobj;
					return cb(obj);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(@[^/]+)\/+live(?:[?#].*)?$/,
				run: function(cb, match) {
					query_tiktok_url("https://www.tiktok.com/" + match[1] + "/live", function(data) {
						if (!data)
							return cb(null);
						var obj = tiktok_live_sigiapi_to_obj(data);
						return cb(obj);
					});
				}
			});
			if (newsrc)
				return newsrc;
			var params = common_functions["get_tiktok_weburl_parts"](src);
			if (params) {
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				var finalcb = function(obj) {
					if (!obj) {
						var match = src.match(/#imu-video=(https?:\/\/.*)$/);
						if (match) {
							return options.cb([{
									url: src,
									video: true,
									can_head: false
								}, page_nullobj]);
						} else {
							return options.cb(page_nullobj);
						}
					} else {
						remove_tiktok_watermark(obj, function(obj) {
							if (!is_array(obj))
								obj = [obj];
							obj.push(page_nullobj);
							return options.cb(obj);
						});
					}
				};
				query_tiktok_appapi(params, function(data) {
					if (!data) {
						query_tiktok_post(params, function(data) {
							if (!data) {
								return finalcb(null);
							}
							finalcb(tiktok_webvideo_to_obj(data, params.web_vid));
						});
						return;
					}
					finalcb(tiktok_appapi_to_obj(data));
				});
				return {
					waiting: true
				};
			}
		}
		if (host_domain_nosub === "tiktok.com" && options && options.cb && options.do_request && options.element) {
			var current = options.element;
			while (current) {
				if (current.tagName === "A" && /\/@[^/]+\/+video\/+[0-9]+\/*(?:[?#].*)?$/.test(current.href)) {
					var pageurl = current.href;
					var video_query = current.querySelector("video");
					if (video_query && video_query.src && /(?:muscdn|tiktokcdn)\.com\//.test(video_query.src)) {
						pageurl += "#imu-video=" + video_query.src;
					}
					return {
						url: pageurl,
						is_pagelink: true
					};
				}
				current = current.parentElement;
			}
			var params = common_functions["get_tiktok_weburl_parts"](options.host_url);
			if (params) {
				return {
					url: options.host_url,
					is_pagelink: true
				};
			}
		}
		if ((domain_nosub === "muscdn.com" || domain_nosub === "tiktokcdn.com") && /^v[0-9]+m?\./.test(domain)) {
			var baseobj_3 = {
				url: src,
				video: true,
				can_head: false // 503 sometimes
			};
			common_functions["set_tiktok_vid_filename"](baseobj_3);
			if (options.do_request && options.cb && options.rule_specific && options.rule_specific.tiktok_no_watermarks) {
				common_functions["get_best_tiktok_url"](api_cache, options.do_request, src, function(newurl) {
					if (newurl) {
						baseobj_3.url = newurl;
					}
					common_functions["set_tiktok_vid_filename"](baseobj_3);
					options.cb(baseobj_3);
				});
				return {
					waiting: true
				};
			} else {
				return baseobj_3;
			}
		}
		if ((domain_nosub === "pstatp.com" ||
			domain_nosub === "ipstatp.com" ||
			domain_nosub === "sgpstatp.com")
			&& domain.match(/[pi][a-z]?[0-9]*\./) ||
			domain === "p16-tiktokcdn-com.akamaized.net" ||
			domain === "p16-va-default.akamaized.net" ||
			((domain_nosub === "tiktokcdn.com" ||
				domain_nosub === "tiktokmusic.me" ||
				domain_nosub === "resso.me" ||
				domain_nosub === "tiktokcdn-us.com" ||
				domain_nosub === "hypstarcdn.com") &&
				(/^p[0-9]+(?:-[^/]+)?\./.test(domain) && !/-sign[-.]/.test(domain))) ||
			domain === "p16-hypstarcdn-com.akamaized.net" ||
			domain_nosub === "bytecdn.cn" ||
			domain_nosub === "byteimg.com" ||
			domain_nosub === "ibyteimg.com" ||
			domain_nosub === "ibytedtos.com" ||
			domain_nosub === "douyinpic.com" ||
			domain_nosub === "toutiaoimg.com" ||
			domain_nosub === "bytexservice.com" ||
			domain_nosub === "muscdn.com") {
			newsrc = src
				.replace(/\?imageView2.*/, "")
				.replace(/(\/[0-9a-f]{10,})\.a?webp$/, "$1.png")
				.replace(/\.avif$/, ".png")
				.replace(/^([a-z]+:\/\/[^/]+\/+)([^/.:~]+)~(?:[^/.:]+:0:0|noop)\./, "$1origin/$2.")
				.replace(/(~[^/.:]+-[^/.:]+):[0-9]+:[0-9]+(\.(?:webp|avif))(?:[?#].*)?$/, "$1:0:0$2")
				.replace(/(:\/\/[^/]+\/+origin\/.*\.[a-z]+)\.[a-z]+(?:[?#].*)?$/, "$1")
				.replace(/(:\/\/[^/]+\/+)(?:medium|large|obj|img|aweme|list)\/+(?:[0-9]+x[0-9]+\/+)?((?:.*?\/+)?[^/~]+)(?:~noop)?(\.[^/.]+)?(?:[?#].*)?$/, "$1origin/$2$3")
				.replace(/(:\/\/[^/]+\/+)((?:(?:tos|musically)-(?:maliva|alisg|cn|us[a-z]+[0-9]*[a-z]*)-[^/]+|tiktok-obj|web\.[^/]+)\/+.*)$/, "$1img/$2")
				.replace(/(:\/\/[^/]+\/+.*?)\.image(?:[?#].*)?$/, "$1.png")
				.replace(/\/details\/+v1\/+[wh][0-9]+\/+/, "/origin/")
				.replace(/~[^/.?#:]+:0:0(\.[^/.?#]+)$/, "~noop$1")
				.replace(/(:\/\/[^/]+\/+(?:medium|large|obj|img|aweme|list)\/+.*)~[^/.?#]+(\.[^/.?#]+)?(?:[?#].*)?$/, "$1~noop$2");
			newsrc = remove_queries(newsrc, ["from"]);
			obj = {
				url: newsrc, /*src
					.replace(/(:\/\/[^/]*\/+)(?:medium|large|obj|aweme|list)\/+(?:[0-9]+x[0-9]+\/+)?/, "$1origin/")
					.replace(/(:\/\/[^/]+\/+.*?)\.image(?:[?$].*)?$/, "$1.jpg")
					.replace(/\/img\/+(.+\/+[0-9a-f]{10,}(?:_[0-9]+)?(?:\/+[^/]+|\.[^/.~?#]+)?)~noop(\.[^/.]*)(?:[?#].*)?$/, "/origin/$1$2")
					.replace(/(\/origin\/+.+\/+[0-9a-f]{10,}\/+[^/.]+\.[^/.]+)\.[^/.]+$/, "$1")
					.replace(/(\/img\/+.+\/+[0-9a-f]{10,}(?:\/+[^/]+|\.[^/.~?#]+)?~)[^/.]*?(\.[^/.]*)(?:[?#].*)?$/, "$1noop$2")
					.replace(/(:\/\/[^/]+\/+)(tos-[^/]+\/+.*)/, "$1img/$2")
					.replace(/\?imageView2.*$/, ""),*/
				can_head: false // 404
			};
			if (/^v[0-9]*\./.test(domain) && string_indexof(src, "/video/") >= 0) {
				obj.video = true;
			}
			return obj;
		}
		if (false) {
			newsrc = src
				.replace(/(\/img\/+[^/]*\/+[0-9a-f]+~)[^/.]*?(\.[^/.]*)(?:[?#].*)?$/, "$1noop$2")
				.replace(/\/large(\/+[^/]*\/+[0-9a-f]+)(?:\.[^/.]*)?(?:[?#].*)?$/, "/img$1~noop.jpeg")
				.replace(/\/(?:aweme|list)\/+[0-9]+x[0-9]+\/+/, "/obj/")
				.replace(/\?imageView2.*/, "");
			if (newsrc !== src)
				return newsrc;
			return {
				url: src,
				can_head: false // 404
			};
		}
		if (domain_nosub === "tiktokcdn.com" && /^p[0-9]*-sign-[^/.]+\./.test(domain)) {
			return src.replace(/(:\/\/p[0-9]+-)sign-([^/]+\/[^?#]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nosub === "tiktokcdn.com" && /^p[0-9]*-sign-(?:va|sg)\./.test(domain)) {
			return src.replace(/:\/\/[^/]+\/+([^?#&]+)(?:[?#].*)?$/, "://p16-amd-va.tiktokcdn.com/$1");
		}
		if (domain_nosub === "tiktokcdn-us.com" && /^p[0-9]*-sign/.test(domain)) {
			return src.replace(/:\/\/(p[0-9]+)-sign(?:-[^/.]+)?(\.[^?#]+)(?:[?#].*)?$/, "://$1$2");
		}
		if (domain_nosub === "bcyimg.com" && /^p[0-9]*-bcy-sign\./.test(domain)) {
			return src.replace(/:\/\/[^/]+\/+(banciyuan\/[^?#&]+)(?:[?#].*)?$/, "://p1-bcy.byteimg.com/img/$1");
		}
		if (host_domain_nowww === "bcy.net" && !src && options.element) {
			var parent_1 = options.element.parentElement;
			if (parent_1 && parent_1.tagName === "A") {
				var dparent_1 = parent_1.parentElement;
				if (dparent_1 && dparent_1.tagName === "DIV" && dparent_1.classList.contains("publish-loaf")) {
					return {
						url: origsrc,
						bad: "mask"
					};
				}
			}
		}
		if (domain === "img-bcy-qn.pstatp.com") {
			return src
				.replace(/(\/post\/[a-z0-9]+\/[a-z0-9]+\.[^/.]*)\/[^/]*(?:[?#].*)?$/, "$1")
				.replace(/(\/avatar\/[0-9]+\/[a-f0-9]+\/[^/]*\.[^/.]*)\/[^/]*(?:[?#].*)?$/, "$1");
		}
		if (domain === "tuchong.pstatp.com") {
			return add_full_extensions(src.replace(/(\/[0-9]+\/+)[a-z](?:t[0-9]+)?(\/+[0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1f$2"));
		}
		if (domain === "p16-sg-default.akamaized.net") return src.replace(/^[a-z]+:\/\/[^/]+\/+china-img\/+/, "https://p0.pstatp.com/");
		if (domain_nosub === "tiktokcdn.com" && /^v[0-9]*m?(?:-[^.]+)?\./.test(domain) && string_indexof(src, "/video/") >= 0) {
			return {
				url: src,
				video: true,
				can_head: false,
				headers: {
					Referer: "https://www.tiktok.com/"
				}
			};
		}
		if (domain === "img.jizy.cn") return src.replace(/\/img\/[a-z]\//, "/img/l/");
		if (domain === "v.img.pplive.cn") return src.replace(/(:\/\/[^/]*\/)sp[0-9]+\//, "$1");
		if (domain === "uploadfile.bizhizu.cn") return src.replace(/(\/[0-9a-f]*\.)([^/.]*)(?:\.[0-9]+\.[0-9]+\.[^/.]*)?$/, "$1$2.source.$2");
		if (domain_nosub === "tgbusdata.cn" ||
			domain_nosub === "tuwandata.com") {
			return src.replace(/.*\/thumb\/[^/]*\/[^/]*\/u\//, "http://");
		}
		if (domain_nowww === "dajiazhao.com" ||
			domain_nowww === "hscbw.com" ||
			domain_nowww === "xgkoushi.com" ||
			domain_nowww === "youdew88yl.com" ||
			domain_nowww === "nvshenmen.com" ||
			domain_nowww === "sfyry.com" ||
			domain_nowww === "ynjzsf.com" ||
			src.match(/:\/\/[^/]*\/+(?:uploads|upfile)\/+allimg\/+[0-9]{6,8}\/+[0-9]+-[0-9A-Z]+-lp\.[^/.]*(?:[?#].*)?$/)) {
			return src.replace(/(\/(?:uploads|upfile)\/+allimg\/+[0-9]+\/+[0-9A-Z]+(?:-[0-9A-Z]+)?)(?:-lp)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nosub === "taopic.com" && domain.match(/^pic[0-9]*\./)) {
			return src.replace(/:\/\/pic([0-9]*\.[^/]*\/[0-9]+\/[0-9]+-[A-Z0-9]+)-[a-z]+(\.[^/.]*)$/, "://img$1$2");
		}
		if (domain_nowww === "renwenjun.com") return src.replace(/_lit(\.[^/.]*)$/, "_0$1");
		if (domain_nowww === "9x2.net" ||
			(domain_nosub === "izaoxing.com" && /^img[0-9]*\./.test(domain))) {
			return src.replace(/_lit(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "lrfczp.com") return src.replace(/_[0-9]+_[0-9]+(\.[^/.]*)$/, "$1");
		if (domain === "img-toutiao.mia.com") {
			return src.replace(/\&.*/, ""); // removing @ works, but forces download, and very big images have imgScale so it's probably fine
		}
		if (domain_nosub === "xeeok.com" && string_indexof(domain, "pic.xeeok.com") >= 0) {
			return src.replace(/_s[0-9]*(\.[^/.]*)$/, "$1");
		}
		if (domain === "img.laonanren.com" ||
			(domain_nosub === "imhentai.xxx" && /^m[0-9]+/.test(domain) && /\/[0-9a-z]+\/+[0-9]+t\./.test(src)) ||
			domain === "cf.whl4u.jp") {
			return src.replace(/t(\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "xuite.net" && string_indexof(domain, ".share.photo.xuite.net") >= 0) {
			return src.replace(/_[a-zA-Z](\.[^/.]*)$/, "_y$1");
		}
		if (domain === "img.sportsv.net") return src.replace(/\/[a-z]+-([^-/]*)-[0-9a-z]*x[0-9a-z]*(\.[^/.]*)$/, "/$1$2");
		if (domain_nosub === "espncdn.com") {
			newsrc = decodeURIComponent(src.replace(/\/combiner\/i\?img=([^&]*).*/, "$1"));
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/r[0-9]+(?:_[0-9]+)?)(?:_[^/.]*)(\.[^/.]*)$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (host_domain_nosub === "fc2.com" && options.element) {
			if (options.element.tagName === "svg" && options.element.parentElement && options.element.parentElement.tagName === "DIV") {
				if (string_indexof(options.element.parentElement.getAttribute("class"), "c-videoThumbOver") >= 0)
					return {
						url: origsrc,
						bad: "mask"
					};
			}
		}
		if (domain_nosub === "fc2.com" && domain.match(/blog-imgs-[0-9]*(?:-[^.]*)?.*\.fc2\.com/)) {
			newsrc = src.replace(/:\/\/(blog-imgs-[0-9]*)\./, "://$1-origin.");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/s(\.[^/.]*)$/, "$1");
		}
		if (domain === "blogthumbnail.fc2.com") return src.replace(/:\/\/[^/]+\/+r[0-9]+\/+([0-9]+)\/+/, "://blog-imgs-$1.fc2.com/");
		if (domain === "video.fc2.com") {
			var query_fc2 = function(pageurl, token, id, cb) {
				api_query("fc2_api:" + id, {
					url: "https://video.fc2.com/api/v3/videoplaylist/" + id + "?sh=1&fs=0",
					imu_mode: "xhr",
					headers: {
						Referer: pageurl,
						"X-FC2-Video-Access-Token": token
					},
					json: true
				}, cb, function(done, json, cache_key) {
					var playlist = json.playlist;
					var newurl = playlist.nq || playlist.sample;
					if (!newurl) {
						console_error(cache_key, "Unable to find playlist URL", json);
						return done(null, false);
					}
					var obj = {
						url: urljoin(pageurl, newurl, true),
						extra: {
							page: pageurl
						},
						headers: {
							Referer: pageurl
						},
						referer_ok: {
							same_domain_nosub: true
						},
						video: true
					};
					return done(obj, 6 * 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:a\/+)?content\/+([0-9a-zA-Z]+)(?:[?#&].*)?$/,
				query_for_id: "https://video.fc2.com/content/${id}",
				process: function(done, resp, cache_key, match) {
					var id = match[1];
					var match = resp.responseText.match(/window\.FC2VideoObject\.push\(\['..',\s*'([0-9a-f]{10,})'/);
					if (!match) {
						console_error(cache_key, "Unable to find access token for", resp);
						return done(null, false);
					}
					var token = match[1];
					query_fc2(resp.finalUrl, token, id, function(data) {
						if (!data)
							return done(null, false);
						return done(data, 6 * 60 * 60);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "fc2.com" && /^(?:vip-)?video[0-9]*-thumbnail[0-9]*\./.test(domain)) {
			obj = {
				url: src
			};
			id = null;
			match = src.match(/\/up\/+thumb[0-9]*\/+[0-9]{6}\/+[0-9]{2}\/+.\/+([0-9]{8}[a-zA-z0-9]+)\./);
			if (match) {
				id = match[1];
				obj.extra = { page: "https://video.fc2.com/content/" + id };
			}
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+(?:[wh][0-9]+){1,2}\/+([^/]+\.fc2\.com\/)/, "http://$1");
			if (newsrc !== src)
				return fillobj_urls([newsrc, src], obj);
			newsrc = src.replace(/(\/member\/+[0-9]+\/+[0-9]+\/+mb_pict_)icon_/, "$1");
			if (newsrc !== src)
				return fillobj_urls([newsrc, src], obj);
			newsrc = src.replace(/\/up\/+thumb\/+([0-9]{6}\/+)/, "/up/thumb2/$1");
			if (newsrc !== src)
				return fillobj_urls([newsrc, src], obj);
			if (id) {
				return {
					url: obj.extra.page,
					is_pagelink: true
				};
			}
			return obj;
		}
		if (domain_nosub === "fc2.com" && /^contents-thumbnail[0-9]*\./.test(domain)) {
			return src.replace(/:\/\/[^/]+\/+w[0-9]+\/+(storage[0-9]+\.contents\.fc2\.com\/)/, "://$1");
		}
		if (domain === "photos.hancinema.net" ||
			domain_nowww === "hancinema.net") {
			return src.replace(/\/photos\/[a-z]*(photo[0-9]*\.[^/.]*)$/, "/photos/fullsize$1");
		}
		if (domain_nowww === "inimura.com" ||
			domain_nowww === "celebritydresses.shop" ||
			domain_nowww === "thecelebritydresses.us" ||
			domain_nowww === "customcelebritydresses.com" ||
			domain_nowww === "realistgold.com" ||
			domain_nowww === "supersoccershop.com" ||
			domain_nowww === "cheap-promdresses.com" ||
			domain_nowww === "weandestudio.com" ||
			domain_nowww === "black-leatherjacket.com" ||
			domain_nowww === "kpopultra.net" ||
			domain_nowww === "myhaircare.com.au" ||
			domain_nowww === "ultimateapparels.com" ||
			domain_nowww === "cajalwinterconference.es" ||
			domain_nowww === "justfashionnow.com" ||
			domain === "mall.3785tv.com" ||
			domain_nowww === "layla-lingerie.com" ||
			domain_nowww === "fnac-andorra.com" ||
			domain_nowww === "keymailrecords.com" ||
			domain_nowww === "bdmaster.net" ||
			domain_nowww === "prettyzone.net" ||
			domain_nowww === "filmstarjackets.com" ||
			domain_nowww === "moviesjacket.com" ||
			domain_nowww === "af-hobby.com" ||
			domain_nowww === "sky-seller.com" ||
			domain_nowww === "i-aurai.com" ||
			domain_nowww === "onesieponatime.com" ||
			domain_nowww === "ucanstarjob.com" ||
			domain === "beniko.ninethemes.net" ||
			domain_nowww === "duvardamoda.com" ||
			domain_nowww === "fresh38.ru" ||
			domain_nowww === "malaysiadropship.com" ||
			domain_nowww === "yukite.ru" ||
			domain_nowww === "huzzk.com" ||
			domain_nowww === "gasookpopgalore.net" ||
			domain_nowww === "honeydear.my" ||
			domain_nowww === "americasuits.com" ||
			src.match(/^[a-z]+:\/\/[^/]+\/+image\/+cache\/+(?:data|catalog)\/.*-[0-9]+x[0-9]+\.[^/.]+(?:[?#].*)?$/)) {
			return src
				.replace(/\/image_cache\/+resize\/+[0-9]+x[0-9]+\/+image\/+/, "/image/")
				.replace(/\/cache\/(.*)-[0-9]+x[0-9]*(?:-[a-z_]+)?(?:_[0-9]+|[wh])?(?:\.[a-z_]+)?(\.[^/.]*(?:[?#].*)?)$/, "/$1$2");
		}
		if (domain_nowww === "outlookweekly.net" && string_indexof(src, "/images/") >= 0) {
			return src.replace(/.*:\/\/[^/]*\/images\//, "http://");
		}
		if (domain === "www.cdn.tv2.no" ||
			domain === "image.klikk.no" ||
			domain === "image.side2.no" ||
			domain === "image.side3.no" ||
			domain_nowww === "dagbladet.no" ||
			domain_nowww === "seher.no" ||
			domain === "image.underdusken.no" ||
			domain === "image.seiska.fi" ||
			domain === "image.elle.no" ||
			domain === "image.nyheder.dk" ||
			domain_nowww === "dbstatic.no") {
			newsrc = src
				.replace(/(:\/\/[^/]+\/+(?:images\/+)?[0-9]+\.[^/.?#]*)(?:[?#].*)?$/, "$1?width=-1&height=-1")
				.replace(/\/(?:images)?\?(?:.*&)?imageId=([0-9]+).*/, "/?imageId=$1&height=-1")
				.replace(/(\/[0-9]+\.webp\?width=-1&height=-1)$/, "$1&format=jpg");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "media-spiceee.net") return src.replace(/\/(?:large|small|thumb_lg|thumb)_([^/]*)$/, "/$1");
		if (domain_nowww === "vettri.net") return src.replace(/\/thumb\/([^/]*)_resize(\.[^/.]*)$/, "/$1$2");
		if (domain_nowww === "tiarashop.eu" ||
			domain_nowww === "streetstylestore.com" ||
			domain_nowww === "asog-labs.com" ||
			domain_nowww === "dreamline.com" ||
			domain_nowww === "techno-import.fr" ||
			domain === "cdn.poplook.com" ||
			domain_nowww === "directgardening.com" ||
			domain_nowww === "kanedashop.com" ||
			domain_nowww === "myamericanmarket.com" ||
			domain_nowww === "lapakfiguremiina.com" ||
			domain_nowww === "donnashape.com" ||
			(domain_nosub === "nin-nin-game.com" && domain.match(/^media[0-9]*\.nin/)) ||
			domain_nowww === "adintime.com" ||
			domain === "shop.marymary.gr" ||
			domain_nowww === "evawigs.com" ||
			domain_nowww === "tehrankbs.pw" ||
			domain_nowww === "ticketshow.ma" ||
			domain_nowww === "asiaworldmusic.fr" ||
			domain_nowww === "kpopmart.com" ||
			domain_nowww === "planetongames.com" ||
			domain_nowww === "baba.es" ||
			domain_nowww === "teamworldshop.it" ||
			domain_nowww === "donnemetropolitane.it" ||
			domain_nowww === "extremehobby.eu" ||
			domain_nowww === "besto24.com" ||
			domain === "static.footshop.com" ||
			domain_nowww === "rosendy.com" ||
			domain_nowww === "ultimateselfcare.com" ||
			domain_nowww === "tucano.com" ||
			domain_nowww === "project-38music.nl" ||
			domain_nowww === "recordsalbums.com" ||
			domain_nowww === "libreriaeldesvan.com" ||
			domain_nowww === "fortunapost.com" ||
			domain_nowww === "flyhighstore.pl" ||
			/^[a-z]+:\/\/[^/]+\/+[0-9]+-(?:home|large|thickbox)_default\/+[^/.]+\.jpg(?:[?#].*)?$/.test(src)) {
			newsrc = src.replace(/(\/img\/+p\/+(?:[0-9]\/+){1,}[0-9]+)[-_][^/.]*(\.[^/.]*)$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			var prefix = "(://[^/]+/+";
			if (domain_nowww === "donnemetropolitane.it" ||
				domain_nowww === "project-38music.nl") {
				prefix += "shop/+";
			} else if (domain_nowww === "ultimateselfcare.com") {
				prefix += "en/+";
			}
			newsrc = src.replace(new RegExp(prefix + "[0-9]+(?:-[0-9]+)?)(?:[-_][^/]*?)?(\/[^/]*)$"), "$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "skinzwearphotography.com") return src.replace(/\/prod[A-Z][a-z]*\//, "/prodImages/");
		if (domain_nowww === "dubiobikinis.com") return src.replace(/(\/prodimages\/+[^/]*(?:-[A-Z]|_[0-9]+))t(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "shelot.com") return src.replace(/\/upload\/thumbnails\/[0-9]+x[0-9]+[^/]*\//, "/upload/");
		if (domain === "xo.lulus.com") return src.replace(/(\/images\/[^/]*\/)[^/]*\/([^/]*)$/, "$1w_1.0/$2");
		if (domain_nowww === "in-tense.se") {
			return src
				.replace(/\/thumbnails\/[^/]*\//, "/")
				.replace(/(\.[^/._])*_[^/]*$/, "$1");
		}
		if (domain === "image.brazilianbikinishop.com") return src.replace(/\/cache_images\/([^/_]*)_[^/.]*(\.[^/.]*)$/, "/$1$2");
		if (domain === "i.embed.ly" ||
			domain === "i-cdn.embed.ly") {
			newsrc = src.replace(/.*\/(?:display|image).*?[?&]url=([^&]*).*/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "i.genius.com") {
			return decodeURIComponent(src.replace(/.*\/[0-9a-f]+.*?[?&]url=([^&]*).*/, "$1"));
		}
		if (domain_nowww === "hdqwalls.com") {
			return src
				.replace(/\/wallpapers\/[a-z]?thumb\//, "/wallpapers/");
		}
		if (domain_nowww === "wallpaperclicker.com") {
			if (src.match(/\/storage\/+Thumb\/+/)) {
				return [
					src.replace(/\/storage\/+Thumb\/+/, "/storage/wallpaper/"),
					src.replace(/\/storage\/+Thumb\/+/, "/storage/image/")
				];
			}
			return src
				.replace(/\/download\/+Image\.aspx.*?[?&]Imagefilename=([^&]*).*?$/, "/storage/Thumb/$1")
				.replace(/\/wallpaper\/+Download\.aspx.*?[?&]wallfilename=([^&]*).*?$/, "/storage/Thumb/$1");
		}
		if (domain_nosub === "prothomalo.com") return src.replace(/\/cache\/images\/[0-9]+x[0-9]+(?:x[0-9]+)\//, "/");
		if (domain === "c.tribune.com.pk") return src.replace(/-[0-9]+-[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
		if (domain_nosub === "reutersmedia.net" ||
			domain === "static.reuters.com") {
			var queries = get_queries(src);
			if (queries.d && queries.i) {
				return src.replace(/\/r\/\?.*/, "/r/?d=" + queries.d + "&t=2&i=" + queries.i);
			}
		}
		if (domain === "r.fod4.com") return src.replace(/^[a-z]*:\/\/[^/]*\/.*\/([a-z]*:\/\/)/, "$1");
		if (domain === "p.fod4.com") return src.replace(/(\/media\/[0-9a-f]+\/)[a-z]=[a-z0-9]+\//, "$1");
		if (domain_nowww === "xdressy.com" ||
			domain_nowww === "starcelebritydresses.com") {
			return src.replace(/-thumb(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "wallpaperflare.com" && src.match(/\/static\//)) {
			return src.replace(/-(?:thumb|preview)(\.[^/.]*)$/, "$1");
		}
		if (domain === "cdn.store-assets.com") return src.replace(/_[0-9]+x(?:[0-9]+)?(\.[^/.]*)$/, "$1");
		if (domain === "img.shopperboard.com") return src.replace(/-[a-z]+(\.[^/.]*)$/, "$1");
		if ((domain_nosub === "gog.com" ||
			domain_nosub === "gog-statics.com") && domain.match(/images.*\./)) {
			newsrc = src.replace(/(\/[0-9a-f]{10,}_bs_logo)_small(\.[^/.]+)(?:[?#].*)?$/, "$1_big$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/[0-9a-f]{10,}_bs_background)_(?:500|800)(\.[^/.]+)(?:[?#].*)?$/, "$1_1275$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/[0-9a-f]{10,}_product_tile_(?:349|398))(\.[^/.]+)(?:[?#].*)?$/, "$1_2x$2");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/[0-9a-f]*)_[^/.]*(\.[^/.]*)$/, "$1$2");
		}
		if (domain === "items.gog.com") {
			if (/\/mp4\/+[^/]+\.mp4(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					video: true
				};
			}
		}
		if (domain === "www.destructoid.com") return src.replace(/-(?:t|noscale)(\.[^/.]*)$/, "$1");
		if (domain_nosub === "xboxlive.com" &&
			domain.match(/images.*\.xboxlive\.com/) &&
			src.match(/\/image\?/)) {
			newsrc = src.replace(/\/image[^/]?[?&]url=([^&]*).*/, "/image?url=$1");
			if (newsrc !== src)
				return newsrc;
			return {
				url: src,
				head_wrong_contenttype: true
			};
		}
		if (domain === "musicimage.xboxlive.com") {
			return {
				url: src.replace(/\/image\?.*/, "/image?locale=en-US"),
				can_head: false // GET, OPTIONS
			};
		}
		if (domain === "media.withtank.com") return src.replace(/_[0-9]+_wide(\.[^/.]*)$/, "$1");
		if (domain === "images.cdn.realviewdigital.com") {
			var type_1 = src.match(/[?&]type=([^&]*)/);
			return src.replace(/\?.*/, "?type=" + type_1[1]);
		}
		if (domain === "proxy.duckduckgo.com" ||
			domain === "external-content.duckduckgo.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+iur?\/\?(?:.*&)?u=([^&]*).*/, "$1");
			if (newsrc !== src) {
				return decodeuri_ifneeded(newsrc);
			}
		}
		if (host_domain_nowww === "duckduckgo.com" && options.element && options.do_request && options.cb) {
			var get_query_params = function(url, cb) {
				var query = url.replace(/.*\?(?:.*&)?q=([^&]+).*?$/, "$1");
				var cache_key = "duckduckgo_imagequeryparams:" + query;
				api_cache.fetch(cache_key, cb, function(done) {
					options.do_request({
						url: url,
						method: "GET",
						onload: function(resp) {
							if (resp.readyState !== 4)
								return;
							if (resp.status !== 200) {
								console_error(resp);
								return done(null, false);
							}
							var respobj = {
								query: query,
								start: 0
							};
							var match = resp.responseText.match(/'\/[td]\.js\?(?:.*?&)?l=([^&]+)/);
							if (!match) {
								console_error("Unable to find language", resp);
								return done(null, false);
							}
							respobj.lang = match[1];
							match = resp.responseText.match(/;\s*vqd\s*=\s*["']([-0-9]{20,})["']/);
							if (!match) {
								console_error("Unable to find vqd", resp);
								return done(null, false);
							}
							respobj.vqd = match[1];
							return done(respobj, 60 * 60);
						}
					});
				});
			};
			var get_images = function(querydata, cb) {
				var cache_key = "duckduckgo_imageresults:" + querydata.query + "," + querydata.start;
				api_cache.fetch(cache_key, cb, function(done) {
					var start_query = "";
					if (querydata.start) {
						start_query = "&s=" + querydata.start;
					}
					options.do_request({
						method: "GET",
						url: "https://duckduckgo.com/i.js?l=" + querydata.lang + "&o=json&q=" + querydata.query + "&vqd=" + querydata.vqd + "&p=-1" + start_query + "&v7exp=a",
						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);
								return done(json, 60 * 60);
							} catch (e) {
								console_error(e);
								return done(null, false);
							}
						}
					});
				});
			};
			var get_bing_imageid = function(url) {
				var newurl = url.replace(/.*[?&]id=([^&]+).*/, "$1");
				if (newurl !== url)
					return newurl;
				return null;
			};
			var get_result_from_image = function(querydata, image, cb) {
				get_images(querydata, function(data) {
					if (!data) {
						return cb(null);
					}
					var image_src = decodeURIComponent(image.src);
					var image_id = get_bing_imageid(image_src);
					if (!image_id) {
						console_warn("Unable to get bing image id for" + image.src);
						return cb(null);
					}
					for (var i = 0; i < data.results.length; i++) {
						var thumbnail_id = get_bing_imageid(data.results[i].thumbnail);
						if (!thumbnail_id) {
							console_warn("Unable to get bing image id for" + data.results[i].thumbnail);
							continue;
						}
						if (image_id === thumbnail_id) {
							return cb(data.results[i].image);
						}
					}
					if (data.next) {
						var start = data.next.replace(/.*&s=([0-9]+).*$/, "$1");
						if (start !== data.next) {
							querydata.start = start;
						}
						return get_result_from_image(querydata, image, cb);
					}
					return cb(null);
				});
			};
			if (!options._internal_info || !options._internal_info.duckduckgo_host) {
				if (options.element.tagName === "IMG") {
					if (options.element.classList.contains("tile--img__img") ||
						options.element.classList.contains("module--images__thumbnails__image")) {
						options._internal_info.duckduckgo_host = true;
						get_query_params(document.location.href, function(data) {
							if (!data) {
								return options.cb(null);
							}
							get_result_from_image(data, options.element, function(url) {
								return options.cb(url);
							});
						});
						return {
							waiting: true
						};
					}
				}
			}
		}
		if (domain === "static.scientificamerican.com") return src.replace(/(?:_[^/.]*)?(\.[^/.?]*)(?:\?.*)?$/, "_source$1");
		if (domain_nosub === "qwant.com" && domain.match(/s[0-9]*\.qwant\.com/) &&
			string_indexof(src, "/thumbr/") >= 0) {
			return decodeURIComponent(src.replace(/.*[?&]u=([^&]*).*/, "$1"));
		}
		if (domain === "b.fssta.com") return src.replace(/(\/[^/.]*)\.[^/]*(\.[^/.]*)$/, "$1$2");
		if (domain_nosub === "espn.com" && domain.match(/media\..*\.espn\.com$/)) {
			return src.replace(/(\/[0-9]+\/[0-9]+\/)([^/]*)\/[^/]*(\.[^/.]*)$/, "$1$2\/$2$3");
		}
		if (domain === "img.skysports.com" ||
			domain_nosub === "365dm.com") {
			return src.replace(/(:\/\/[^/]*\/[0-9]*\/[0-9]*\/)[^/]*\/(?:[0-9]*\/)?([^/]*)$/, "$1master/$2");
		}
		if (domain_nosub === "bcbits.com" &&
			domain.match(/f[0-9]*\.bcbits\.com/) &&
			string_indexof(src, "/img/") >= 0) {
			return src.replace(/_[0-9]+(\.[^/.]*)?$/, "_0$1");
		}
		if (domain === "tent.sny.sh" ||
			domain === "tent.bloatcat.tk" ||
			domain === "tent.bloat.cat" ||
			domain === "tn.vern.cc" ||
			domain === "tent.vern.cc" ||
			domain === "bandcamp.vern.cc" ||
			domain === "tent.deep-swarm.xyz") {
			return src.replace(/\/image\.php\?(?:.*&)?file=([0-9]+_)[0-9]+(\.[^/.&#]+)?(?:[#&].*)?$/, "/image.php?file=$10$2");
		}
		if (domain_nosub === "bandcamp.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/([^/]+\/+track\/+[^/]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<script.*?data-tralbum="({[^"]+?})"/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var json_txt = decode_entities(match[1]);
					var json = JSON_parse(json_txt);
					var trackinfo = json.trackinfo[0];
					var obj = {
						extra: {
							page: urljoin(resp.finalUrl, trackinfo.title_link, true) || resp.finalUrl,
							caption: trackinfo.title
						}
					};
					var urls = [];
					var file = trackinfo.file["mp3-128"];
					if (file) {
						urls.push({
							url: file,
							media_info: {
								type: "audio"
							}
						});
					}
					var art_fn = "a" + zpadnum(json.art_id, 10, "0") + "_0.jpg";
					urls.push("https://f4.bcbits.com/img/" + art_fn);
					return done(fillobj_urls(urls, obj), 60 * 60);
				}
			});
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "motherlessmedia.com") {
			return src
				.replace(/(:\/\/cdn[0-9]*\.)thumbs(\.motherlessmedia\.com\/)/, "$1images$2")
				.replace(/\/thumbs\//, "/images/")
				.replace(/-[a-z]*(\.[^/.?]*)(?:\?.*)?$/, "$1");
		}
		if (domain_nosub === "kiev.ua" &&
			string_indexof(domain, "shram.kiev.ua") >= 0 &&
			string_indexof(src, "/img/") >= 0) {
			return src
				.replace(/-small(\.[^/.]*)$/, "-big$1")
				.replace(/-w[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (googlestorage_container === "cr-resource" &&
			string_indexof(src, "/image/") >= 0) {
			return src.replace(/\/[0-9]+(\/[0-9a-f]*\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "iol.pt" &&
			string_indexof(src, "/multimedia/") >= 0) {
			return src.replace(/(\/id\/[0-9a-f]+)\/[0-9]+(?:\.[0-9a-f]+)?(?:\.[^/.]*)?$/, "$1");
		}
		if (domain === "img.purch.com") {
			newsrc = src
				.replace(/\/[a-z]+\/[0-9]+(?:x[0-9]+)?\//, "/o/")
				.replace(/\/[a-z0-9]+-[0-9]+x[0-9]+(?:-[^/]*)?\/o\//, "/o/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+.*?\/(aHR0c[^?#/.]+)(?:[?#.].*)?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if ((domain_nosub === "taobaocdn.com" ||
			domain_nosub === "tbcdn.cn") &&
			domain.match(/img[0-9]*\./)) {
			return src.replace(/(\.[^/._]*)_[^/.]*\.[^/.]*$/, "$1");
		}
		if (domain === "www.musictory.com" &&
			src.match(/\/pictures\//)) {
			return src.replace(/\/pictures\/[a-z]*\//, "/pictures/originali/");
		}
		if (domain_nosub === "santabanta.com" && domain.match(/media[0-9]*\.santabanta\.com/)) {
			newsrc = src
				.replace(/_th(\.[^/.]*)$/, "$1")
				.replace(/:\/\/media\.santabanta\.com\/medium[0-9]*\//, "://media1.santabanta.com/full1/");
			if (newsrc !== src)
				return newsrc;
			if (src.match(/\/full[0-9]*\//)) {
				return [
					src.replace(/\/full[0-9]*\//, "/full8/"),
					src.replace(/\/full[0-9]*\//, "/full7/"),
					src.replace(/\/full[0-9]*\//, "/full6/"),
					src.replace(/\/full[0-9]*\//, "/full5/")
				];
			}
		}
		if (domain === "www.movieinsider.com" &&
			string_indexof(src, "/images/p/") >= 0) {
			return src.replace(/\/images\/p\/[0-9]+\//, "/images/p/");
		}
		if (domain_nosub === "kastden.org") {
			return src
				.replace(/\/thumbs\/+([^/]+)_th(\.[^/]+)(?:[?#].*)?$/, "/$1$2")
				.replace(/\/thumb\//, "/original/");
		}
		if (domain === "img.hani.co.kr") {
			return src
				.replace(/\/(?:thumbnail|resize)\//, "/original/")
				.replace(/\/[0-9]+_[0-9]+_([0-9]+_[0-9]+\.[^/.]*)$/, "/$1");
		}
		if (domain === "flexible.img.hani.co.kr") return src.replace(/:\/\/[^/]*\/flexible\/.*?\/imgdb\//, "://img.hani.co.kr/imgdb/");
		if (domain === "static.ok.co.uk" ||
			amazon_container === "static.ok.co.uk" ||
			domain === "images.24ur.com" ||
			domain === "image.dnevnik.hr" ||
			domain === "img.bg.sof.cmestatic.com" ||
			domain === "static.altchar.com" ||
			domain === "img.cz.prg.cmestatic.com" ||
			domain === "image.stirileprotv.ro" ||
			amazon_container === "ns.hitcreative.com") {
			return src
				.replace(/\?.*/, "")
				.replace(/\/media\/images\/[^/]*\//, "/media/images/original/");
		}
		if (domain_nosub === "galaxypub.vn" && domain.match(/rs[0-9]*\.galaxypub\.vn/)) {
			return src.replace(/:\/\/[^/]*(\/.*?)(?:\?.*)?$/, "://st.galaxypub.vn$1");
		}
		if (domain_nowww === "implanetcorp.com" &&
			string_indexof(src, "/upload/ctoon/") >= 0) {
			return src
				.replace(/\/[a-z]*\/([0-9]+\.[^/.]*)$/, "/original/$1");
		}
		if (domain_nowww === "doramakun.ru") return src.replace(/\/thumbs\/(.*)-[0-9]+(\.[^/.]*)$/, "/$1$2");
		if (domain === "1gr.cz") return src.replace(/(\/[0-9]+\/[0-9]+\/)[^/]*\/([^/]*)$/, "$1org/$2");
		if (domain_nosub === "ancensored.com" &&
			src.match(/\/files\/images\//)) {
			return src.replace(/(\/[0-9a-f]*)(?:_[a-z]*)?(\.[^/.]*)$/, "$1_full$2");
		}
		if (domain_nowww === "desktopbackground.org" ||
			domain_nowww === "desktop-background.com") {
			return src
				.replace(/\/download\/[^/]*\//, "/download/o/")
				.replace(/(:\/\/[^/]*)\/[pt]\//, "$1/download/o/");
		}
		if (domain === "image.mlive.com" ||
			domain === "image.nj.com" ||
			domain === "image.cleveland.com") {
			return src.replace(/:\/\/image\.([^/]*)\/home\/[a-z]+-media\/[^/]*\/img\//, "://media.$1/");
		}
		if (domain === "s9v7j7a4.ssl.hwcdn.net" ||
			domain === "data-cdn.multi.xnxx.com") {
			return src.replace(/(\/galleries\/+)[^/]+\/+([0-9a-f]{2}\/+)/, "$1full/$2");
		}
		if (domain === "k5x5n5g8.ssl.hwcdn.net" ||
			domain === "k4b8k3x5.ssl.hwcdn.net" ||
			domain === "f6j6u6m9.ssl.hwcdn.net" ||
			domain === "cdn.yavtube.com" ||
			domain === "img.yavtube.com" ||
			domain === "a2h6m3w6.ssl.hwcdn.net" ||
			domain === "p8k5i9q7.map2.ssl.hwcdn.net" ||
			domain === "cdn.elitebabes.com" ||
			domain === "c9w8v3m5.ssl.hwcdn.net") {
			newsrc = src.replace(/(\/content\/+[0-9]+\/+[^/]+-[0-9]+)_(?:[wh][0-9]+|1200)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "xjapanese.com") return src.replace(/(\/pornpics\/.*)-pin(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "hwcdn.funbags.com" ||
			domain === "hwcdn.voyeurweb.com") {
			regex = /(\/albums\/+[0-9]+\/+)(?:thumb|large)\/+/;
			obj = [];
			newsrc = src.replace(regex, "$1orig/");
			if (newsrc !== src)
				obj.push(newsrc);
			newsrc = src.replace(regex, "$1large/");
			if (newsrc !== src)
				obj.push(newsrc);
			if (obj.length > 0)
				return obj;
		}
		if (domain === "aws-foto.amateri.com") return src.replace(/\/[0-9]+x[^/.]*(\.[^/.]*)$/, "/x$1");
		if (domain === "cdn.tobi.com") {
			return src
				.replace(/\/product_images\/[a-z]+\//, "/product_images/lg/")
				.replace(/(\/[^/.@]*)(\.[^/.]*)$/, "$1@2x$2");
		}
		if (domain === "www.rfa.org") {
			return src.replace(/\/@@images\/.*/, "");
		}
		if (domain === "resize.blogsys.jp") return src.replace(/^[a-z]*:\/\/.*\/([a-z]*:\/\/.*)$/, "$1");
		if (amazon_container === "bw-1651cf0d2f737d7adeab84d339dbabd3-gallery") {
			return src.replace(/_[a-z]+(\.[^/.]*)$/, "_original$1");
		}
		if (domain_nosub === "rl0.ru" && domain.match(/img[0-9]*\.rl0\.ru/)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/[^/]*\/+[ce]?[-0-9]+x[-0-9]+(?:[pf][0-9]+x[0-9]+)*(?:q[0-9]+)?i?\/+([^/]*\.[^/.]*\/)/, "$1");
			if (newsrc !== src)
				return add_http(newsrc);
		}
		if (domain === "news.store.rambler.ru") return src.replace(/(\/img\/+[0-9a-f]+)\?.*/, "$1?img-format=png");
		if (domain_nosub === "wanelo.com" && domain.match(/cdn-img-[0-9]+\.wanelo\.com/)) {
			return src.replace(/\/[^/.]*(\.[^/.]*)$/, "/full_size$1");
		}
		if (domain === "static.kvraudio.com") return src.replace(/(:\/\/[^/]*\/i\/)[a-z]\//, "$1b/");
		if (domain === "contents.dt.co.kr") return src.replace(/\/thum\/[0-9]+\/([0-9]{6})([0-9]+)_[^/.]*(\.[^/.]*)/, "/images/$1/$1$2$3");
		if (domain === "eng.dt.co.kr") return src.replace(/\/images\/thum\/([0-9]+)/, "/images/oriimg/$1[0]");
		if (domain === "image.ytn.co.kr" ||
			domain === "img.sciencetv.kr") {
			return src
				.replace(/(:\/\/[^/]*\/[^/]*\/jpg\/[^/]*\/[^/]*\/[0-9]+_)[a-z](\.[^/.]*)$/, "$1d$2")
				.replace(/^[a-z]+:\/\/[^/]*\/osen\/+([0-9]{4}\/+[0-9]{2}\/+)([0-9]{6})([0-9]{2})([^/]*)(?:[?#].*)?$/, "http://file.osen.co.kr/article/$1$3/$2$3$4");
		}
		if (domain === "photo.kmib.co.kr") return src.replace(/\/thumb_([0-9]+\.[^/.]*)$/, "/$1");
		if (domain === "image.kmib.co.kr") {
			var extra = {};
			match = src.match(/\/online_image\/+[0-9]{4}\/+[0-9]{4}\/+[0-9]*([0-9]{10})(?:_[0-9]+)?\.[^/.]*(?:[?#].*)?$/);
			if (match) {
				extra.page = "http://news.kmib.co.kr/article/view.asp?arcid=" + match[1];
			}
			return {
				url: src,
				extra: extra
			};
		}
		if (domain === "r.kelkoo.com") {
			newsrc = src.replace(/^[a-z]*:\/\/(?:[^/]*\/){7}(http[^/]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+resize\.php\?(?:.*?&)?image=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (((domain_nosub === "assetsadobe2.com" ||
			domain_nosub === "legocdn.com" ||
			domain === "store.storeimages.cdn-apple.com" ||
			domain === "media.playstation.com" ||
			domain === "images.samsung.com" ||
			domain === "images.anthropologie.com" ||
			domain_nosub === "louisvuitton.com" ||
			domain === "images.ulta.com" ||
			domain === "image.uniqlo.com" ||
			domain_nowww === "staples-3p.com" ||
			domain === "s.shld.net" ||
			domain === "assets.ray-ban.com" ||
			domain === "images.menswearhouse.com" ||
			domain === "images.shaneco.com" ||
			domain === "media.kohlsimg.com" ||
			domain === "photos.mandarinoriental.com" ||
			domain_nosub === "assetsadobe.com" ||
			domain === "images.asics.com" ||
			domain_nosub === "scene7.com") && string_indexof(src, "/is/image/") >= 0) ||
			domain === "images.asos-media.com" ||
			domain === "images.nike.com" ||
			domain === "c.shld.net" ||
			domain === "image.panasonic.com" ||
			domain === "store.storeimages.cdn-apple.com" ||
			/^[a-z]+:\/\/[^/]+\/+is\/+image\/+[^/]+\/+[^/]+(?:[?#].*)?$/.test(src)) {
			obj = { url: src };
			if (domain_nosub === "scene7.com") {
				obj.bad_if = [
					{
						headers: {
							"content-type": "image/jpeg",
							"content-length": "27898"
						}
					},
					{
						headers: {
							"content-type": "image/jpeg",
							"content-length": "5996"
						}
					}
				];
			}
			match = src.match(/\/i\/s\/.*\?(?:.*&)?(?:\$p_)?src=(https?%3A.*?)(?:&.*)?$/);
			if (match) {
				obj.url = decodeURIComponent(match[1]);
				return obj;
			}
			match = src.match(/\/is\/image\/+.*\?(?:.*?&)?(?:\$p_)?src=is(?:{|%7B)(.*?)(?:}|%7D)/);
			if (match) {
				obj.url = src.replace(/\/is\/image\/.*/, "/is/image/" + decodeURIComponent(match[1]));
				return obj;
			}
			match = src.match(/\/is\/+image\/+.*?[?&]\$product=([^&]+).*?$/);
			if (match) {
				obj.url = src.replace(/\/is\/+image\/.*/, "/is/image/" + decodeURIComponent(match[1]));
				return obj;
			}
			if (domain === "bonprix.scene7.com") {
				src = src.replace(/\/[0-9]+[wh]\/+([^/]+(?:[?#].*)?)$/, "/original/$1"); // can be anything
			}
			if (domain === "image.panasonic.com") {
				src = src.replace(/\$Thumbnail\d+\$/, "");
				return add_queries(src, {
					wid: "2000",
					hei: "2000"
				});
			}
			if (string_indexof(src, "?") < 0) {
				var basename = url_basename(src);
				var querystr = basename.replace(/.*?-qm-/, "?");
				if (querystr !== basename) {
					querystr = querystr
						.replace(/-eq-/g, "=")
						.replace(/-amp-/g, "&");
					newsrc = src.replace(/^(.*\/)[^/]+$/, "$1") + basename.replace(/(.*)?-qm-.*$/, "$1") + querystr;
					if (newsrc !== src)
						return newsrc;
				}
			}
			if (/:[0-9]+-[0-9]+\?.*$/.test(src)) {
				return src.replace(/:[0-9]+-[0-9]+(\?.*)?$/, "$1");
			}
			var srcadd = "";
			if (src.match(/\.(?:jpe?g|JPE?G)(?:\?.*)?$/))
				srcadd = "scl=1";
			else
				srcadd = "scl=1&fmt=png-alpha";
			newsrc = src.replace(/(\/is\/+image\/+.*)\?(?:.*?&)?((?:\$p_)?src)=([^&]*).*?$/, "$1?$2=$3&" + srcadd);
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			if (!(/[?&]src=/.test(src))) {
				obj.url = src.replace(/(?:[?#].*)?$/, "") + "?" + srcadd;
				return obj;
			}
		}
		if (domain === "media.bechtle.com") return src.replace(/(\/is\/+[0-9]+\/+[0-9a-f]{20,}\/+[0-9a-f]+\/+)[a-z]+\/+/, "$1original/");
		if (domain === "sm.ign.com") return src.replace(/\.[0-9]+\.([^/.]*)$/, ".999999999999999.$1");
		if ((domain === "shop.unitedcycle.com" ||
			domain_nowww === "unicorncards.co.uk" ||
			domain_nowww === "4my3boyz.com") &&
			string_indexof(src, "/images/thumbs/") >= 0) {
			return src.replace(/_[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "imgr.es") {
			return src.replace(/\/thumb(?:[?#].*)?$/, "");
		}
		if (domain_nosub === "frgimages.com" ||
			domain === "images.footballfanatics.com") {
			newsrc = decodeURIComponent(src.replace(/\/FFImage\/thumb.aspx.*?[?&]i=([^&]*).*/, "$1"));
			if (newsrc !== src)
				return newsrc;
			return src
				.replace(/_[a-z]+(\.[^/.?&]*)$/, "_full$1");
		}
		if (domain === "myanimelist.cdn-dena.com" ||
			domain === "cdn.myanimelist.net" ||
			domain_nowww === "dizigol.net") {
			return src.replace(/(:\/\/[^/]*\/)r\/+[0-9]+x[0-9]+\/+/, "$1");
		}
		if (domain === "picture-cdn.wheretoget.it") return src.replace(/(\/[a-z0-9]*-[a-z])[^/.]*(\.[^/.]*)$/, "$1$2");
		if (domain === "sl.sbs.com.au") return src.replace(/(\/public\/image\/file\/[-a-f0-9]*)\/.*/, "$1");
		if ((domain_nosub === "prezly.com" && string_indexof(domain, ".assets.prezly.com") >= 0) ||
			domain === "i.shgcdn.com" ||
			domain_nowww === "ucarecdn.com" ||
			domain === "cdn.vyper.io" ||
			domain === "assets.myzeki.com" ||
			domain === "thumb.tildacdn.com" ||
			domain === "cdn.slant.co") {
			return src.replace(/(:\/\/[^/]*\/+(?:[a-z]+)?[-a-f0-9]{30,}(?:~[0-9a-f]+)?\/+(?:nth\/+[0-9]+\/+)?).*?(?:\/([^/.]+\.[^/.]+))?(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "slant.co") {
			if (/:\/\/[^/]+\/+images\/+play\.png(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain === "leonardo.osnova.io" ||
			domain === "images.universe.com") {
			return src.replace(/(:\/\/[^/]*\/[-a-f0-9]*\/)-\/.*/, "$1");
		}
		if (domain === "cdn.iview.abc.net.au") return src.replace(/\/thumbs\/[0-9]+\//, "/thumbs/i/");
		if (domain_nosub === "ipstatic.net") {
			newsrc = decodeURIComponent(src.replace(/.*\/img.*?[?&]url=([^&]*).*?$/, "$1"));
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\/thumbs\/[0-9]+x[0-9]+\//, "/photos/");
		}
		if (domain === "image.fnnews.com") {
			return src
				.replace(/(\/[a-z]?[0-9]+)_[a-z](\.[^/.]*)/, "$1$2");
		}
		if (domain_nosub === "kym-cdn.com") {
			return add_extensions({
				url: src.replace(/(:\/\/[^/]*\/[^/]*\/(?:images|icons)\/)[^/]*\//, "$1original/"),
				is_original: true
			});
		}
		if (domain === "cmeimg-a.akamaihd.net" ||
			domain === "leafimg-a.akamaihd.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/(?:[0-9]+(?:x[0-9]+)?|x[0-9]+|cute-article-rcp)\/([^/.]*\.[^/]*\/.*)/, "http://$1");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/^([a-z]+:\/\/[^/]*\/)(?:[0-9]+(?:x[0-9]+)?|x[0-9]+)\//, "$1default/");
		}
		if ((domain_nosub === "luxnet.ua" && domain.match(/imagecdn[0-9]*\.luxnet\.ua/)) ||
			domain_nowww === "beztabu.net" ||
			domain_nowww === "34.ua" ||
			domain_nosub === "24tv.ua" ||
			domain_nowww === "football24.ua" ||
			domain_nowww === "maximum.fm" ||
			domain_nowww === "lux.fm") {
			return src.replace(/\/[0-9]+(?:x[0-9]+|[wh])?_DIR\//, "/");
		}
		if (domain_nowww === "userstyles.org") {
			return src.replace("/style_screenshot_thumbnails/", "/style_screenshots/");
		}
		if ((domain_nosub === "narvii.com" ||
			domain_nosub === "aminoapps.com") && /^[a-z]+[0-9]*\./.test(domain)) {
			regex = /(\/[0-9a-z]+(?:-[-0-9a-z]+)?_)[^/.]*(\.[^/.]*)/;
			return [
				src.replace(regex, "$1uhq$2"),
				src.replace(regex, "$1hq$2")
			];
		}
		if (domain === "img.oastatic.com") {
			return src
				.replace(/\/img\/[0-9]+\/[0-9]+(?:\/fit)?\/([0-9]+)\/([^/]*)$/, "/img/$1/$2")
				.replace(/\/img\/([0-9]+)\/([^/]*)$/, "/img2/$1/full/$2")
				.replace(/\/imgmax\/([0-9]+)\/([^/]*)$/, "/img2/$1/full/$2")
				.replace(/(\/img2\/[0-9]+\/)[^/]*\/([^/]*)$/, "$1full/$2")
				.replace(/\/img2\/([0-9]+)\/full\/([^/]*)$/, "/imgsrc/$1/$2");
		}
		if (domain === "img.valais.ch" ||
			domain === "wsrv.nl" ||
			domain === "images.weserv.nl" ||
			(domain_nosub === "qiuzhi5.com" && domain.match(/^i[0-9]*\./)) ||
			(domain_nosub === "baaz.com" && domain.match(/^proxy[0-9]*\./)) ||
			(domain_nosub === "powr-media.com" && domain.match(/^p[0-9]*-ia\./)) ||
			domain === "nimg.ws.126.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/.*?[?&]url=([^&]*).*/, "$1");
			if (newsrc !== src)
				return add_http(decodeURIComponent(newsrc));
		}
		if (domain_nosub === "etsystatic.com" &&
			(domain.match(/img[0-9]*\.etsystatic\.com/) ||
				domain === "i.etsystatic.com")) {
			return src.replace(/(\/[a-z]+_)[0-9a-zA-Z]+x[0-9a-zA-Z]+\./, "$1fullxfull.");
		}
		if (domain_nosub === "twnmm.com") {
			return urljoin(src, src.replace(/^[a-z]+:\/\/[^/]*\/thumb.*?[?&]src=([^?&]*).*/, "$1"), true);
		}
		if (domain_nowww === "vuecinemas.nl") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+thumb\?(?:.*&)?src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return urljoin(src, decodeURIComponent(newsrc), true);
		}
		if (domain === "www.findx.com" &&
			string_indexof(src, "/api/images/assets/") >= 0) {
			return src.replace(/^[a-z]+:\/\/[^/]*\/api\/images\/assets\/[^/]*\//, "");
		}
		if (domain_nowww === "konsolinet.fi") return src.replace(/(:\/\/[^/]*\/[^/]*\/)[0-9]+x[0-9]+\//, "$1");
		if ((domain_nosub === "vigbo.com" ||
			domain_nosub === "gophotoweb.com") &&
			domain.match(/^static[0-9]*\./)) {
			return src.replace(/\/[0-9]+-((?:[^/]*-)?[a-f0-9]{20,}\.[^/.]*)$/, "/2000-$1");
		}
		if (domain_nosub === "feelway.com" && domain.match(/img[0-9]*.feelway\.com/)) {
			return src.replace(/(\/[0-9]+\/)small([^/]*)$/, "$1$2");
		}
		if (domain_nosub === "pichunter.com") {
			newsrc = src.replace(/(:\/\/[^/]*\/+(?:[0-9]+\/+[0-9]+\/+[0-9]+\/+)?[0-9]+_[0-9]+)(?:_[a-z])?(\.[^/.]*)(?:[?#].*)?$/, "$1_o$2");
			if (newsrc !== src) {
				return {
					url: newsrc,
					headers: {
						Referer: "https://www.pichunter.com/"
					},
					referer_ok: {
						same_domain: true
					}
				};
			}
		}
		if (domain === "appdb.winehq.org") {
			return src.replace(/(\/appimage\.php.*?)([?&])bThumbnail=[^&]*/, "$1$2").replace(/&$/, "");
		}
		if (domain_nosub === "ikea.com" &&
			string_indexof(src, "/images/") >= 0) {
			return src.replace(/([-_][sS])[0-9](\.[^/.]*)/, "$15$2");
		}
		if (domain === "img.onestore.co.kr") return src.replace(/\/[0-9]+_[0-9]+_(?:F[0-9]+_)?[0-9]+\//, "/0_0_100/");
		if (domain_nosub === "ismcdn.jp" ||
			domain === "mikiki.tokyo.jp" ||
			domain === "wedge.ismedia.jp" ||
			domain === "ure.pia.co.jp" ||
			domain_nowww === "wanibooks-newscrunch.com" ||
			domain_nowww === "afpbb.com") {
			return src.replace(/(\/mwimgs\/+(?:[0-9a-f]\/+){2})[0-9]+(?:[xmhw][whm]?[0-9]*)?(\/+img_[0-9a-f]{20,}\.[^/.]*)(?:[?#].*)?$/, "$1-$2");
		}
		if (domain_nosub === "yomiuri.co.jp" && string_indexof(src, "/photo/") >= 0) {
			return src.replace(/-[A-Z0-9](\.[^/.]*)$/, "-L$1");
		}
		if (domain_nosub === "newswitch.jp" && domain.match(/c[0-9]*\.newswitch\.jp/)) {
			return decodeURIComponent(src.replace(/^[a-z]*:\/\/[^/]*\/cover.*?[?&]url=([^&]*).*?$/, "$1"));
		}
		if (domain_nowww === "fashion-headline.com") return src.replace(/\/api\/+image\/+(?:width|height)\/+[0-9]+\//, "/");
		if (domain_nosub === "stream.ne.jp" && string_indexof(domain, "cdnext.stream.ne.jp") >= 0) {
			return src.replace(/(\/[0-9a-f]+)_[0-9]*_[0-9]*(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nosub === "ptcdn.info") return src.replace(/([-_])[a-z](\.[^/.]*)$/, "$1o$2");
		if (domain_nosub === "pikabu.ru") {
			return src
				.replace(/\/post_img\/([0-9]+)\//, "/post_img/big/$1/")
				.replace(/\/images\/+previews_comm\/+/, "/images/big_size_comm/");
		}
		if (domain_nosub === "podium.life") return src.replace(/\/content\/r\/[wh]?[0-9]*(?:x[0-9]+)?\//, "/content/");
		if (domain_nowww === "lelulove.com") return src.replace(/(\/content\/+photo\/+[0-9a-z]+\/+)thumbs\/+/, "$1full/");
		if (domain_nosub === "filesor.com") {
			return {
				url: src.replace(/_(?:[a-z]|[0-9])(\.[^/.]*)/, "$1"),
				bad_if: [{
						headers: {
							"content-length": "9408",
							"content-type": "image/gif"
						}
					}]
			};
		}
		if (domain_nowww === "namooactors.com") return src.replace(/\/thumb(?:_[^/]*)?\/[a-z]+_[0-9]+(?:px|X[0-9]+)_(.*?\.[^/.]*)\.[^/.]*$/, "/$1");
		if (domain_nowww === "ftopx.com" ||
			domain_nowww === "goodwp.com" ||
			domain_nowww === "kartinkijane.ru" ||
			domain_nowww === "nastol.com.ua" ||
			domain_nowww === "fonstola.ru" ||
			domain_nowww === "luxfon.com" ||
			domain_nowww === "artleo.com") {
			var prefix_1;
			if (domain_nowww === "ftopx.com") {
				var timestamp = parseInt(src.replace(/.*[/_]([a-f0-9]{10,})\.[^/.]*$/, "$1"), 16);
				prefix_1 = ["ftop.ru", "ftopx.com"];
				if (timestamp > 1579484587755500)
					prefix_1 = ["ftopx.com", "ftop.ru"];
			} else {
				prefix_1 = domain_nosub;
			}
			regex = /\/(?:(?:(?:mini?|large)|pic\/+[0-9]+x[0-9]+)\/+([0-9]+)|pic\/+([0-9]{6})\/+[0-9]+x[0-9]+)\/+(?:[^/]*?\.[a-z]+[-_])?((?:[0-9a-f]+|[0-9]+)\.[^/.]*)(?:[?#].*)?$/;
			if (is_array(prefix_1)) {
				var urls = [];
				for (i = 0; i < prefix_1.length; i++) {
					urls.push(src.replace(regex, "/images/$1$2/" + prefix_1[i] + "_$3"));
				}
				return urls;
			} else {
				return src.replace(regex, "/images/$1$2/" + prefix_1 + "_$3");
			}
		}
		if (domain_nowww === "wykop.pl" && string_indexof(src, "/cdn/") >= 0) {
			return src.replace(/,[^/.]*(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "phoronix.net") {
			return src
				.replace(/(\/image\.php.*?[?&]image=[^&]*)_show/, "$1")
				.replace(/(\/image\.php.*?[?&]image=[^&]*)_med/, "$1_show");
		}
		if (domain === "image.diyidan.net") {
			return {
				url: src.replace(/!.*/, ""),
				headers: {
					Referer: "https://www.diyidan.com/"
				}
			};
		}
		if (domain === "www.hrkgame.com" &&
			string_indexof(src, "/.thumbnails/") >= 0) {
			return src.replace(/\/\.thumbnails\/([^/]*)\/.*/, "/$1");
		}
		if (domain_nowww === "dlcompare.com" &&
			string_indexof(src, "/upload/cache/") >= 0) {
			return src.replace(/\/upload\/cache\/[^/]*\//, "/");
			/*newsrc = src.replace(/\/upload\/cache\/[^/]*\/upload\//, "/upload/");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\/upload\/cache\/[^/]*\//, "/upload/cache/slider/");*/
		}
		if (domain_nosub === "alphacoders.com" &&
			(domain.match(/images[0-9]*\.alphacoders\.com/) ||
				domain === "artfiles.alphacoders.com" ||
				domain === "picfiles.alphacoders.com" ||
				domain === "avatarfiles.alphacoders.com" ||
				domain === "coverfiles.alphacoders.com" ||
				domain === "photofiles.alphacoders.com")) {
			newsrc = src.replace(/\/thumb(?:-[0-9]*|big)?-([0-9]*\.[^/.]*)$/, "/$1");
			if (newsrc !== src)
				return add_extensions_from_webp(newsrc);
		}
		if (domain === "wall.alphacoders.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+big\.php\?(?:.*&)?i=([0-9]+)(?:[&#].*)?$/,
				query_for_id: "https://wall.alphacoders.com/big.php?i=${id}",
				process: function(done, resp, cache_key) {
					var image = get_meta(resp.responseText, "og:image");
					if (!image) {
						console_error(cache_key, "Unable to find og:image for", resp);
						return done(null, false);
					}
					var obj = {
						url: image,
						extra: {
							page: resp.finalUrl,
						}
					};
					var wallpaper_name = resp.responseText.match(/<h1 class="[^"]+wallpaper-name">([^<]+)<\/h1>/);
					if (wallpaper_name) {
						wallpaper_name = decode_entities(wallpaper_name[1]);
						obj.extra.caption = wallpaper_name;
					}
					return done(obj, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "mobile.alphacoders.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+wallpapers\/+view\/+([0-9]+)(?:\/+[^/]*\/*)?(?:[?#].*)?$/,
				query_for_id: "https://mobile.alphacoders.com/wallpapers/view/${id}/",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/href="([a-z]+:\/\/wall\.alphacoders\.com\/big\.php\?i=[0-9]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find big.php match for", resp);
						return done(null, false);
					}
					var mobile_url = get_meta(resp.responseText, "image");
					return done([
						{
							url: match[1],
							is_pagelink: true,
							problems: {
								uncropped: true
							}
						},
						{
							url: mobile_url
						}
					], 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "mfiles.alphacoders.com") {
			id = src.replace(/.*\/(?:thumb(?:-[0-9]*)?-)?([0-9]+)\.[^/.]*$/, "$1");
			if (id !== src) {
				return {
					url: "https://mobile.alphacoders.com/wallpapers/view/" + id + "/",
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "gpstatic.com") return src.replace(/\/(s[0-9]*)_thumb(-[a-f0-9]*\.[^/.]*)$/, "/$1$2");
		if (domain_nosub === "walldevil.com") return src.replace(/\/(?:thumb|preview)\//, "/");
		if (domain === "www.peency.com" &&
			string_indexof(src, "/images/") >= 0) {
			return src.replace(/_[^/._]*(\.[^/.]*)$/, "$1");
		}
		if (domain === "www.wallpaperbetter.com" &&
			string_indexof(src, "/wallpaper/") >= 0) {
			return src.replace(/-(?:thumb|middle-size)(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "thiswallpaper.com" && string_indexof(src, "/cdn/") >= 0) {
			return src.replace("/cdn/thumb/", "/cdn/hdwallpapers/");
		}
		if (domain_nowww === "superwallpapers.in" ||
			domain_nowww === "hdcarwallpapers.in") {
			return src.replace(/_[0-9]+_[0-9]+_[0-9]+_cf(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "booklikes.com") {
			newsrc = src.replace(/.*\/www\/+thumb\.php\?(?:.*&)?img=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return "http://" + domain + "/" + decodeURIComponent(newsrc);
			return src.replace(/\/photo\/+max\/+[0-9]+\/+[0-9]+\/upload\/+/, "/upload/");
		}
		if ((domain_nowww === "hdwallsource.com" ||
			domain_nowww === "pickywallpapers.com") &&
			string_indexof(src, "/img/") >= 0) {
			return src.replace(/\/thumb\/+([^/.]*)-thumb(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		}
		if ((domain_nowww === "customity.com" && string_indexof(src, "/storage/public/") >= 0) ||
			(domain_nowww === "wisebread.com" && string_indexof(src, "/files/") >= 0)) {
			return src.replace(/\/imagecache\/+[0-9]+x[0-9]+\//, "/");
		}
		if ((domain_nowww === "desktopimages.org" ||
			domain_nowww === "hdbilder.eu" ||
			domain_nowww === "hdfondos.eu" ||
			domain_nowww === "banktapet.pl" ||
			domain_nowww === "fondsecran.eu")) {
			if (string_indexof(src, "/pictures/") >= 0) {
				newsrc = src.replace(/\/[^/]*[-_]([0-9]+\.[^/.]*)$/, "/orig_$1");
				if (newsrc !== src)
					return newsrc;
			}
			if (options && options.cb && options.do_request &&
				src.match(/\/(?:p|preview)\/+get_photo\/+[0-9]+\/+[0-9]+/)) {
				var querysrc = src.replace(/\/(?:p|preview)\/+get_photo\/+([0-9]+\/+[0-9]+)(?:\/.*)?$/, "/p/$1/0/o");
				options.do_request({
					url: querysrc,
					method: "GET",
					onload: function(resp) {
						if (resp.readyState === 4) {
							var match = resp.responseText.match(/<img *src="([^">]*\/orig_[^/">]*)"/);
							if (match) {
								options.cb(match[1]);
							} else {
								options.cb(null);
							}
						}
					}
				});
				return {
					waiting: true
				};
			}
		}
		if (domain_nowww === "bikerpunks.com" && string_indexof(src, "/media/") >= 0) {
			return src.replace(/\/media\/[^/]*\/([0-9a-f]*\.[^/.]*)$/, "/media/$1");
		}
		if (domain_nosub === "livejournal.com" && domain.match(/i[a-z]*\.pics\.livejournal\.com/)) {
			return src
				.replace(/(\/pic\/[0-9a-z]+\/)s[0-9]+x[0-9]+(?:[?#].*)?$/, "$1")
				.replace(/_[0-9]*(\.[^/.]*)$/, "_original$1")
				.replace(/(\/[0-9]+\/)[0-9]+(\.[^/.]*)$/, "$1original$2");
		}
		if (domain === "pics.livejournal.com") return src.replace(/\/s[0-9]+x[0-9]+(?:[?#].*)?$/, "/original");
		if (host_domain_nosub === "livejournal.com" && options.element && domain === "imgprx.livejournal.net") {
			if (options.element.tagName === "IMG" && options.element.getAttribute("loading") === "lazy" &&
				options.element.parentElement && options.element.parentElement.tagName === "A" && options.element.parentElement.getAttribute("rel") === "nofollow") {
				return options.element.parentElement.href;
			}
		}
		if (domain === "imgprx.livejournal.net") {
			if (options.do_request && options.cb) {
				common_functions["get_redirect_url"](api_cache, options, {
					url: src,
					imu_mode: "document"
				}, options.cb);
				return {
					waiting: true
				};
			}
		}
		if (domain_nowww === "yastatic.net") {
			if (/\/s3\/+web4static\/+_\/+v2\/+/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain_nowww === "dzen.ru") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+watch\/+([0-9a-f]{10,})(?:[?#].*)?$/,
				query_for_id: "https://dzen.ru/video/watch/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/var data\s*=\s*({.*"__serverSettings__video-site_.*});\s*\n/);
					if (!match) {
						console_error(cache_key, "Unable to find data match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					var serversettingskey = null;
					for (var key_1 in json) {
						if (string_indexof(key_1, "serverSettings") >= 0) {
							serversettingskey = key_1;
							break;
						}
					}
					if (!serversettingskey) {
						console_error(cache_key, "Unable to find serverSettings key in", {
							resp: resp,
							json: json
						});
						return done(null, false);
					}
					var serversettings = json[serversettingskey];
					var videodata = serversettings.exportData.video;
					var extra = {
						caption: videodata.title,
						page: videodata.link,
						created_date: parse_int(videodata.publicationDate) * 1000
					};
					var urls = [];
					for (var _i = 0, _a = videodata.video.streams; _i < _a.length; _i++) {
						var url_2 = _a[_i];
						if (/\.m3u8\?/.test(url_2)) {
							urls.push({
								url: url_2,
								video: "hls"
							});
						} else if (/\.mpd\?/.test(url_2)) {
							urls.push({
								url: url_2,
								video: "dash"
							});
						} else {
							console_warn(cache_key, "Unhandled url", url_2);
						}
					}
					urls.push(videodata.image);
					return done(fillobj_urls(urls, {
						extra: extra
					}), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "zen.yandex.ru") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+watch\/+([0-9a-f]{10,})(?:[?#].*)?$/,
				run: function(cb, match) {
					return cb({
						url: "https://dzen.ru/video/watch/" + match[1],
						is_pagelink: true
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if ((host_domain_nowww === "yandex.ru" ||
			host_domain_nowww === "yandex.com")
			&& options && options.element) {
			var current = options.element;
			while ((current = current.parentElement)) {
				if (current.tagName === "A") {
					match = current.href.match(/^[a-z]+:\/\/[^/]+\/+images\/+search\?(?:.*&)?img_url=([^&]+)/);
					if (match) {
						newsrc = decodeuri_ifneeded(match[1]);
						if (newsrc !== src)
							return newsrc;
					}
					break;
				}
			}
		}
		if (domain === "img-fotki.yandex.ru") return src.replace(/_[^-/._]*(\.[^/.]*)?$/, "_orig$1");
		if (domain_nosub === "yandex.ru" && /downloader.disk.yandex.ru/.test(domain)) {
			return src.replace(/(\/preview\/+[0-9a-f]{30,}\/+.*?\?(?:.*&)?size=)[0-9]+x[0-9]+(&.*)?$/, "$10x0$2");
		}
		if (domain_nosub === "steemitimages.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/[0-9]+x[0-9]+\//, "");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\?.*/, "");
		}
		if (amazon_container &&
			amazon_container.match(/^steemit-production-imageproxy-[^-.]*/)) {
			return src
				.replace(/-imageproxy-thumbnail((?:\.[^/]*)?\/[A-Za-z0-9]*)_[0-9]+x[0-9]+$/, "-imageproxy-upload$1");
		}
		if (domain === "images.hive.blog") return src.replace(/(\/p\/+[0-9a-zA-Z]{50,})\?.*/, "$1");
		if (domain_nowww === "newsprom.ru") return src.replace(/\/([0-9]+_[a-f0-9]+\.[^/.]*)$/, "/tn_$1");
		if (domain_nosub === "fotocdn.net" && domain.match(/i[0-9]*\.fotocdn\.net/)) {
			regex = /_(?:[a-z]+|[0-9]+c)(\/+[0-9]+\/+[0-9]+\.[^/.]*)$/;
			return [
				src.replace(regex, "_xl$1"),
				src.replace(regex, "_l$1")
			];
		}
		if (domain_nowww === "news-people.fr" && string_indexof(src, "/galerie/") >= 0) {
			return src.replace(/\/([0-9]*)(\.[^/.]*)$/, "/$1_hd$2");
		}
		if (domain_nosub === "cdn107.com") return src.replace(/_[a-z]*(\.[^/.]*)$/, "$1");
		if (domain === "hairstyles.thehairstyler.com") return src.replace(/(\/[0-9]*\/)[^/]*\/([^/]*)$/, "$1original/$2");
		if (domain_nowww === "abload.de") {
			return {
				url: src.replace(/(:\/\/[^/]+\/+)thumb\/+/, "$1img/"),
				head_wrong_contenttype: true
			};
		}
		if (domain_nowww === "wallpaperpulse.com") return src.replace(/\/thumb\//, "/img/");
		if (domain === "assets.capitalfm.com" ||
			domain === "assets.gcstatic.com") {
			return src.replace(/(\/[^/]*-[0-9]{8,})-[^/]*(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "leathercelebrities.com") {
			return decodeURIComponent(src
				.replace(/^[a-z]+:\/\/[^/]*\/download\.php.*?[?&]file=([^&]*).*?$/, "$1")
				.replace(/(\/uploads\/[0-9]*\/[^/]*)__thumb(\.[^/.]*)$/, "$1$2"));
		}
		if (domain === "img.cache.vevo.com" ||
			domain === "scache.vevo.com") {
			newsrc = src.replace(/[?#].*$/, "");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/thumb\/[^/]*\/[^/]*)\/[0-9]+x[0-9]+(\.[^/.]*?)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "superiorpics.com" ||
			domain === "i.bollywoodmantra.com") {
			return src.replace(/\/thumb[0-9]+\//, "/");
		}
		if (domain_nowww === "celebjihad.com" ||
			domain === "image.dek-d.com") {
			return src.replace(/\/t_([^/]*)$/, "/$1");
		}
		if (domain === "cdn.teamcococdn.com") return src.replace(/\/image\/[^/]*\//, "/file/");
		if (domain === "live.staticflickr.com") {
			newsrc = src.replace(/(\/buddyicons\/+[0-9]+@N[0-9]+)(?:_[slm])?(\.[^/.]*)(?:[?#].*)?$/, "$1_r$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (host_domain_nowww === "flickr.com" && domain === "combo.staticflickr.com" && options.element) {
			if (/\/images\/+(?:fuzzy\/+)?photo-fuzzy(?:-t)?\./.test(src)) {
				if (options.element.tagName === "IMG" && options.element.parentElement && options.element.parentElement.tagName === "A") {
					return options.element.parentElement.href;
				}
			}
		}
		if ((domain_nosub === "staticflickr.com" ||
			domain === "static.flickr.com" ||
			(domain_nosub === "flickr.com" && string_indexof(domain, ".static.flickr.com") >= 0)) &&
			(src.match(/\/[0-9]+_[0-9a-f]+(?:_[a-z0-9]*)*\.[a-z]+.*$/) || /\/video\/+[0-9]+\/+[0-9a-f]+\/+/.test(src)) &&
			options && options.do_request && options.cb) {
			var find_photoid_secret_from_url = function(src) {
				var match = src.match(/\/video\/+([0-9]+)\/+([0-9a-f]+)\/+/);
				if (!match) {
					match = src.match(/\/[0-9]+\/+([0-9]+)_([0-9a-z]+)(?:_[^/.]+)?\..*/);
				}
				if (match) {
					return {
						id: match[1],
						secret: match[2]
					};
				} else {
					return null;
				}
			};
			var find_image_obj = function(info, src, cb, origobj) {
				var photoinfo = find_photoid_secret_from_url(src);
				var cache_key = "flickr_image_obj:" + photoinfo.id;
				api_cache.fetch(cache_key, function(obj) {
					if (!obj)
						return cb(null);
					if (origobj) {
						if (!is_array(origobj))
							origobj = [origobj];
						cb(fillobj_urls(origobj, obj));
					} else {
						cb(obj);
					}
				}, function(done) {
					find_image_info(info, src, function(info) {
						if (!info)
							return done(null, false);
						return done(common_functions["flickr_info_to_obj"](info), 60 * 60);
					});
				});
			};
			var find_image_info = function(info, src, cb) {
				var photoinfo = find_photoid_secret_from_url(src);
				var cache_key = "flickr_image_info:" + photoinfo.id + "_" + photoinfo.secret;
				api_cache.fetch(cache_key, cb, function(done) {
					var apirequest = "method=flickr.photos.getInfo&photo_id=" + photoinfo.id;
					if (photoinfo.secret !== "face")
						apirequest += "&secret=" + photoinfo.secret;
					common_functions["flickr_api_request"](options, info, apirequest, function(out) {
						if (!out)
							return done(null, false);
						done(out.photo, 60 * 60);
					});
				});
			};
			var get_obj_from_image_info = function(info) {
				try {
					var url = info.urls.url[0]._content;
					if (!(/^https?:\/\//.test(url))) {
						url = null;
					}
					var caption = info.title._content;
					if (!caption)
						caption = null;
					var extra = {
						page: url,
						caption: caption
					};
					return extra;
				} catch (e) {
					console_error(e, info);
				}
				return null;
			};
			var find_video_info = function(info, photoinfo, cb) {
				var cache_key = "flickr_video:" + photoinfo.id + "_" + photoinfo.secret;
				api_cache.fetch(cache_key, cb, function(done) {
					var apirequest = "method=flickr.video.getStreamInfo&photo_id=" + photoinfo.id;
					if (photoinfo.secret !== "face")
						apirequest += "&secret=" + photoinfo.secret;
					common_functions["flickr_api_request"](options, info, apirequest, function(out) {
						if (!out)
							return done(null, false);
						if (out.streams.stream.length > 0) {
							done(out.streams.stream, 60 * 60);
						} else {
							console_error(cache_key, "No streams in", out);
							done(null, false);
						}
					});
				});
			};
			var find_largest_video = function(videodata) {
				var max = 0;
				var maxobj = null;
				for (var i = 0; i < videodata.length; i++) {
					var quality = parseInt(videodata[i].type);
					if (!quality || isNaN(quality) || !videodata[i]._content)
						continue;
					if (quality > max) {
						maxobj = videodata[i];
						max = quality;
					}
				}
				if (maxobj) {
					return maxobj._content;
				} else {
					return null;
				}
			};
			newsrc = src.replace(/(:\/\/[^/]*\/(?:[0-9]+\/)?[0-9]+\/[0-9]+_[0-9a-f]+(?:_[a-z])?\.[a-zA-Z0-9]*).*$/, "$1");
			if (newsrc.match(/\/[0-9]+_[0-9a-f]+_o\.[a-z]+.*$/)) {
				obj = {
					url: src,
					is_original: true
				};
				if (options.force_page) {
					common_functions["flickr_find_api_info"](options, api_cache, function(info) {
						if (!info) {
							return options.cb(obj);
						}
						find_image_obj(info, newsrc, function(newobj) {
							options.cb(newobj || obj);
						}, obj);
					});
					return {
						waiting: true
					};
				} else {
					return obj;
				}
			}
			var find_larger_image = function(info, src, cb) {
				var photoinfo = find_photoid_secret_from_url(src);
				var photoid = photoinfo.id;
				var cache_key = "flickr_larger:" + photoid;
				api_cache.fetch(cache_key, cb, function(done) {
					common_functions["flickr_api_request"](options, info, "method=flickr.photos.getSizes&photo_id=" + photoid, function(out) {
						if (!out)
							return done(null, false);
						var largesturl = null;
						var largestsize = 0;
						var is_video = false;
						array_foreach(out.sizes.size, function(size) {
							var currentsize = parseInt(size.width) * parseInt(size.height);
							if (currentsize > largestsize || size.label === "Original") {
								largestsize = currentsize;
								largesturl = size.source;
							}
							if (size.media === "video") {
								is_video = true;
							}
						});
						if (typeof largesturl === "string" && /^https?:\/\//.test(largesturl)) {
							done({
								url: largesturl,
								has_video: is_video
							}, 10 * 60);
						} else {
							done(null, false);
						}
					});
				});
			};
			common_functions["flickr_find_api_info"](options, api_cache, function(info) {
				if (!info) {
					return options.cb(null);
				}
				find_larger_image(info, src, function(largest_data) {
					if (!largest_data) {
						return options.cb(null);
					}
					var baseobj = {};
					var urls = [largest_data.url];
					var final_cb = function(photoinfo) {
						if (photoinfo && largest_data.has_video) {
							find_video_info(info, photoinfo, function(video_data) {
								if (video_data) {
									var largest_video_url = find_largest_video(video_data);
									if (largest_video_url) {
										if (largest_video_url.replace(/[?#].*/, "") === src.replace(/[?#].*/, "")) {
											largest_video_url = src;
										}
										urls.unshift({
											url: largest_video_url,
											video: true
										});
									}
								}
								return options.cb(fillobj_urls(urls, baseobj));
							});
						} else {
							return options.cb(fillobj_urls(urls, baseobj));
						}
					};
					if (largest_data.has_video) {
						find_image_info(info, newsrc, function(info) {
							if (info) {
								baseobj = {
									extra: get_obj_from_image_info(info)
								};
							}
							final_cb(info);
						});
					} else if (options.force_page) {
						find_image_obj(info, newsrc, function(obj) {
							if (obj)
								baseobj = obj;
							final_cb();
						});
					} else {
						final_cb();
					}
				});
			});
			return {
				waiting: true
			};
		}
		if (domain === "flimg.flickr.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+\?(?:.*&)?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (host_domain_nosub === "flickr.com" && options.element) {
			if (options.element.tagName === "DIV") {
				var imgel = options.element.querySelector("img.main-photo");
				if (imgel)
					return imgel.src;
			}
			if (!src) {
				if (options.element.classList.contains("spaceball")) {
					return {
						url: origsrc,
						bad: "mask"
					};
				}
			} else if (string_indexof(src, "staticflickr.com/") < 0) {
				var current = options.element;
				while ((current = current.parentElement)) {
					if (current.tagName === "DIV" && current.classList.contains("restricted-interstitial")) {
						var meta_image = document.head.querySelector("meta[property=\"og:image\"]");
						if (meta_image) {
							return meta_image.content;
						}
					}
				}
			}
		}
		if (domain_nowww === "flickr.com") {
			var paginate = function(query, cb, token, arr) {
				if (!arr)
					arr = [];
				query(token, function(data, nexttoken) {
					if (data)
						array_extend(arr, data);
					if (nexttoken) {
						paginate(query, cb, nexttoken, arr);
					} else {
						cb(arr);
					}
				});
			};
			var get_album_photos = function(info, albumid, cb) {
				var queries = {
					per_page: 200,
					page: 1,
					extras: "can_addmeta,can_comment,can_download,can_print,can_share,contact,count_comments,count_faves,count_views,date_taken,date_upload,description,icon_urls_deep,isfavorite,ispro,license,media,needs_interstitial,owner_name,owner_datecreate,path_alias,perm_print,realname,rotation,safety_level,secret_k,secret_h,url_sq,url_q,url_t,url_s,url_n,url_w,url_m,url_z,url_c,url_l,url_h,url_k,url_3k,url_4k,url_f,url_5k,url_6k,url_o,visibility,visibility_source,o_dims,publiceditability,system_moderation",
					photoset_id: albumid,
					method: "flickr.photosets.getPhotos"
				};
				var getpage = function(page, cb) {
					if (!page)
						page = 1;
					console_log("Querying", page);
					queries.page = page;
					common_functions["flickr_api_request"](options, info, stringify_queries(queries), function(data) {
						if (!data)
							return cb(null);
						var photoset = data.photoset;
						var photos = photoset.photo;
						var objs = [];
						array_foreach(photos, function(photo) {
							var obj = common_functions["flickr_info_to_obj"](photo);
							if (!obj)
								return;
							api_cache.set("flickr_image_obj:" + photo.id, obj);
							objs.push(obj);
						});
						var current_page = parseInt(photoset.page);
						var total_pages = parseInt(photoset.pages);
						var next_page = current_page < total_pages ? current_page + 1 : null;
						cb(objs, next_page);
					});
				};
				api_cache.fetch("flickr_album:" + albumid, cb, function(done) {
					paginate(getpage, function(data) {
						if (!data || !data.length)
							done(null, false);
						done(data, 60 * 60);
					});
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+photos\/+[^/]+\/+([0-9]+)(?:\/+(?:(?:in|sizes)\/+.*)?)?(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					return cb("https://live.staticflickr.com/0000/" + id + "_face_b.jpg");
				}
			});
			if (newsrc)
				return newsrc;
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+photos\/+[^/]+\/+albums\/+([0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					common_functions["flickr_find_api_info"](options, api_cache, function(info) {
						get_album_photos(info, id, function(objs) {
							if (!objs || !objs.length)
								return cb(null);
							var links = [];
							array_foreach(objs, function(obj, i) {
								links.push({
									url: obj.url,
									is_current: i === 0
								});
							});
							objs[0].album_info = {
								type: "links",
								links: links
							};
							cb(objs[0]);
						});
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "www.imagozone.com" ||
			domain_nowww === "imagozone.ro" ||
			domain_nowww === "ohsohumorous.com" ||
			domain_nowww === "travelseyahat.com" ||
			domain_nowww === "carphotoshow.com" ||
			domain_nowww === "crnobelo.com" ||
			domain_nowww === "myhentaicomics.com" ||
			domain_nowww === "komodogirls.com" ||
			domain_nowww === "celebritiestown.com") {
			if (/\/modules\/+hover_navigation\/+images\//.test(src))
				return {
					url: src,
					bad: "mask"
				};
			if (!src.match(/\/\.album\.[^/.]*$/)) {
				newsrc = src.replace(/(\/var\/+thumbs\/)/, "/var/resizes/");
				if (newsrc !== src)
					return newsrc;
				return src.replace(/\/var\/(?:resizes|thumbs)\//, "/var/albums/");
			}
		}
		if (domain_nowww === "bjwinslow.com") return src.replace(/(\/albums\/.*)\.sized(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "tunes.zone") {
			var basic = src.replace(/\/[0-9]+x[0-9]+[a-z]?\//, "/full/");
			if (basic !== src) {
				var other = basic.replace(/-[a-z]+-[a-z]+(-[0-9]+)?(\.[^/.]*)$/, "$1$2");
				var other1 = basic.replace(/(\/[0-9]+-+)[^/]*-([0-9]+\.[^/.]*)$/, "$1$2");
				if (basic.match(/\/[0-9]+--/))
					return [other1, basic, other];
				else if (basic.match(/-[0-9]+\.[^/.]*$/))
					return [other, basic, other1];
				else
					return [basic, other, other1];
			}
		}
		if (domain === "sf.co.ua") return src.replace(/\/tn-([0-9]*\.[^/.]*)/, "/wallpaper-$1");
		if (domain_nosub === "zerochan.net" && domain.match(/^s[^.]*.zerochan.net/)) {
			obj = {
				url: src
			};
			id = src.match(/:\/\/[^/]+\/+(?:[^/]*\.[^/.]+\.([0-9]+)|[^/]+\/+(?:[0-9]+\/+){2}([0-9]+))\.[^/.]+(?:[?#].*)?$/);
			if (id) {
				obj.extra = { page: "https://www.zerochan.net/" + (id[1] || id[2]) };
			}
			obj.url = src
				.replace(/:\/\/s[^.]*.zerochan.net\//, "://static.zerochan.net/")
				.replace(/(:\/\/[^/]*\/[^/]*\.)[0-9]+(\.[0-9]+\.[^/.]*)$/, "$1full$2")
				.replace(/(:\/\/[^/]+\/+)[0-9]+\/+([0-9]+\/+[0-9]+\/+[0-9]+\.)/, "$1full/$2");
			if (obj.url !== src) {
				return fillobj_urls(add_extensions(obj.url), obj);
			}
			return obj;
		}
		if (domain === "cdn.aibooru.download") {
			newsrc = src.replace(/(:\/\/[^/]+\/+)(?:preview|[0-9]+x[0-9]+)\/+((?:[a-f0-9]{2}\/+){2})/, "$1sample/$2__a__sample-");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(:\/\/[^/]+\/+)sample\/+((?:[a-f0-9]{2}\/+){2}__[^/]+?__)sample-/, "$1original/$2");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (domain === "cdn.donmai.us") {
			newsrc = src.replace(/^([a-z]+:\/\/[^/]+\/+)[0-9]+x[0-9]+\/+/, "$1preview/");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/^[a-z]+:\/\/[^/]+\/+(preview|sample)\/+(?:[0-9a-f]{2}\/+){2}((?:(?:[^/]+__)?sample-)?[0-9a-f]{10,}\.[^/.]+)(?:[?#].*)?$/, "https://danbooru.donmai.us/data/$1/$2");
		}
		if (domain_nosub === "donmai.us") {
			newsrc = src
				.replace(/\/data\/+((?:[0-9a-f]{2}\/+){2}__original)/, "/data/original/$1")
				.replace(/\/data\/sample\/((?:(?:[0-9a-f]{2}\/+){2})?[^/]*__)?sample-([0-9a-f]*\.[^/.]*)$/, "/data/$1$2")
				.replace(/:\/\/danbooru\.donmai\.us\/data\/preview\//, "://hijiribe.donmai.us/data/")
				.replace(/\/data\/preview\/([^/]*)$/, "/data/__original__$1");
			if (newsrc !== src)
				return add_extensions_gif(newsrc);
		}
		if (domain === "yukkuri.shii.org") {
			newsrc = src.replace(/\/data\/+(?:preview|sample)\/+(?:sample-)?([0-9a-f]{20,}\.[^/.]*)(?:[?#].*)?$/, "/data/$1");
			if (newsrc !== src) {
				return add_extensions(newsrc);
			}
		}
		if ((domain_nosub === "e621.net" && /^static[0-9]*\./.test(domain)) ||
			domain_nowww === "behoimi.org") {
			newsrc = src.replace(/(:\/\/[^/]+\/+data\/+)(?:preview|sample)\/+([0-9a-f]{2}\/+)/, "$1$2");
			if (newsrc !== src) {
				return add_extensions(newsrc);
			}
		}
		if (domain_nowww === "hypnohub.net") {
			newsrc = src.replace(/\/data\/+(?:preview|sample)\/+([0-9a-f]{20,}\.[^/.]*)(?:[?#].*)?$/, "/data/image/$1");
			if (newsrc !== src) {
				return add_extensions(newsrc);
			}
		}
		if (domain === "files.yande.re") {
			return add_extensions(src
				.replace(/\/(?:sample|jpeg)\/+([0-9a-f]+\/)/, "/image/$1"));
		}
		if (domain === "assets.yande.re") {
			return add_extensions(src.replace(/:\/\/assets.yande.re\/data\/preview\/[0-9a-f]+\/[0-9a-f]+\//, "://files.yande.re/image/"));
		}
		if (domain_nowww === "konachan.com" ||
			domain_nowww === "konachan.net") {
			newsrc = src.replace(/(?:\/data\/preview\/[0-9a-f]+\/[0-9a-f]+\/|\/(?:sample|jpeg)\/)([0-9a-f]+)(\/[^/]*)?(\.[^/.?]*)(?:[?#]*)?$/, "/image/$1$3");
			if (newsrc !== src)
				return add_full_extensions(newsrc);
			return {
				url: src,
				headers: {
					Referer: "https://konachan.com/post"
				}
			};
		}
		if (domain_nowww === "gelbooru.me") return src.replace(/^[a-z]+:\/\/[^/]+\/+cdn(img[0-9]+)\/+/, "https://$1.gelbooru.com/");
		if (domain_nowww === "gelbooru.com") return src.replace(/:\/\/[^/]*\/thumbnails\//, "://img2.gelbooru.com/thumbnails/");
		if (domain_nosub === "gelbooru.com" && /^s?img[0-9]*\./.test(domain)) {
			obj = {
				url: src,
				can_head: false,
				imu_mode: "image",
				headers: {
					Referer: "https://www." + domain_nosub + "/"
				}
			};
			newsrc = src.replace(/\/+thumbnails\/+([0-9a-f]+\/[0-9a-f]+\/)thumbnail_/, "/images/$1")
				.replace(/\/+samples\/+([0-9a-f]+\/[0-9a-f]+\/)sample_/, "/images/$1");
			if (newsrc !== src) {
				return fillobj_urls(add_full_extensions(newsrc), obj);
			}
		}
		if (domain === "cali.rule34.xxx") return src.replace(/^[a-z]+:\/\/[^/]+\/+/, "https://us.rule34.xxx/");
		if (domain_nowww === "safebooru.org" ||
			domain_nowww === "tbib.org" ||
			domain === "img.xbooru.com" ||
			domain === "img.booru.org" ||
			domain_nosub === "rule34.xxx" ||
			domain_nowww === "realbooru.com") {
			newsrc = src.replace(/\/(?:thumbnails|samples|images)(\/+(?:[0-9a-f]+\/+)?[0-9a-f]+\/+)(?:(?:thumbnail|sample)_)?([0-9a-f]+\.[^/.]*)$/, "/images$1$2");
			if (/\/images\/+(?:[0-9a-f]+\/+)?[0-9a-f]+\/[0-9a-f]+\./.test(newsrc))
				return add_full_extensions(newsrc, [
					"mp4", "MP4", "jpg", "jpeg", "png", "gif", "webp",
					"JPG", "JPEG", "PNG", "GIF"
				], true);
		}
		if (domain === "thumbs.booru.org") return src.replace(/:\/\/[^/]*\//, "://img.booru.org/");
		if (domain_nosub === "booru.org" && domain !== "img.booru.org") {
			return src.replace(/:\/\/([^/]*)\.booru\.org\/thumbnails\/+/, "://img.booru.org/$1/thumbnails/");
		}
		if (domain === "cdn.aibooru.online") {
			newsrc = src.replace(/(:\/\/[^/]+\/+)[0-9]+x[0-9]+\/+/, "$1original/");
			if (newsrc !== src)
				return add_full_extensions(newsrc, ["mp4", "gif", "png", "jpg"], true);
		}
		if (domain === "cdn.vor.us") return src.replace(/\/thumbs[a-z]?\//, "/og/");
		if (domain === "wallpapers.wallhaven.cc" ||
			domain === "alpha.wallhaven.cc") {
			return src.replace(/\/thumb\/[^/]*\/th-/, "/full/wallhaven-");
		}
		if (domain === "static.wallhaven.cc") {
			if (/\/images\/+layout\/+bg-/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "wallhaven.cc") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+w\/+([a-z0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://wallhaven.cc/w/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<img id="wallpaper" src="(https?:\/\/[^/]+\/+full\/+[^"']+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done(decode_entities(match[1]), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "th.wallhaven.cc") {
			newsrc = src.replace(/:\/\/th\.([^/]+\/+)(?:small|lg|orig)\/+([a-z0-9]{2}\/+)([a-z0-9]+\.)/, "://w.$1full/$2wallhaven-$3");
			if (newsrc !== src) {
				return add_extensions(newsrc);
			}
		}
		if (domain_nowww === "pussycalor.com") return src.replace(/(\/fotospc\/+)th-([0-9]+\.)/, "$1$2");
		if (domain === "cdn.animenewsnetwork.com" ||
			domain_nowww === "animenewsnetwork.com") {
			return src
				.replace(/\/thumbnails\/[^/]*\/cms\//, "/images/cms/")
				.replace(/(\.[a-z]{3,4})\.jpg(?:[?#].*)?$/, "$1");
		}
		if ((domain_nowww === "digitalart.io" && string_indexof(src, "/storage/") >= 0) ||
			domain_nowww === "fashion-press.net" && string_indexof(src, "/img/") >= 0) {
			return src.replace(/(\/[0-9]*\/)[wh][0-9]+_([^/]*)$/, "$1$2");
		}
		if (domain_nowww === "4everstatic.com" ||
			domain === "pictures.4ever.eu") {
			if (!src.match(/:\/\/[^/]*\/data\/+download\//)) {
				return [
					src.replace(/:\/\/[^/]*\/[a-z]+\/(?:[0-9X]+x[0-9X]+\/)?([^?]*).*?$/, "://pictures.4ever.eu/data/download/$1?no-logo"),
					src.replace(/(:\/\/[^/]*\/[a-z]+\/)[0-9X]+x[0-9X]+\//, "$1")
				];
			}
		}
		if (domain_nowww === "tapeciarnia.pl") return src.replace(/\/tapety\/[^/]*\//, "/tapety/normalne/");
		if (domain_nowww === "zastavki.com") return src.replace(/\/pictures\/[0-9]+x[0-9]+\/(.*_[0-9]+)_[0-9]+(\.[^/.]*)$/, "/pictures/originals/$1_$2");
		if (domain_nosub === "wallls.com" && domain.match(/w[0-9]*\.wallls.com/)) {
			return src.replace(/\/uploads\/[^/]*\/([0-9]*\/[0-9]*\/)([0-9]*\.[^/.]*)$/, "/uploads/original/$1wallls.com_$2");
		}
		if (domain === "content.hardtunes.com") return src.replace(/\/[0-9]+x[0-9]+(\.[^/.]*)$/, "/original$1");
		if (domain_nowww === "4kw.in" &&
			string_indexof(src, "/Wallpapers/") >= 0) {
			return src.replace(/1(\.[^/.]*)$/, "$1");
		}
		if (domain === "imgs-art-dragoart-386112.c.cdn77.org") return src.replace(/_[0-9]*(\.[^/.]*)$/, "_1$1");
		if (domain_nosub === "hulkshare.com" && domain.match(/s[0-9]*\.hulkshare\.com/)) {
			return src.replace(/\/[0-9]*\/([0-9a-f]\/[0-9a-f]\/[0-9a-f]\/[0-9a-f]*\.[^/.]*)$/, "/original/$1");
		}
		if (domain_nowww === "wikihow.com" &&
			string_indexof(src, "/images/") >= 0) {
			return src.replace(/\/thumb\/(.*?\.[^/.]*)(?:\/.*)/, "/$1");
		}
		if (domain_nosub === "kakaocdn.net" ||
			domain_nosub === "kakao.co.kr") {
			newsrc = src
				.replace(/(\/img(?:_[a-z]+)?\.[^/.?#]*)(?:[?#].*)?$/, "$1")
				.replace(/\/img_[a-z]+(\.[^/.]*)$/, "/img$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (host_domain === "tv.kakao.com" && domain_nosub === "kakaocdn.net" && /\/vod_thumbnail\//.test(src) && options.element) {
			newsrc = common_functions["get_pagelink_el_matching"](options.element, /\/channel\/+[0-9]+\/+cliplink\/+[0-9]+/);
			if (newsrc)
				return newsrc;
		}
		if (domain === "tv.kakao.com") {
			var query_dash_with_params = function(req, params, cb) {
				req.method = "GET";
				req.onload = function(resp) {
					if (resp.status !== 200) {
						console_error("Unable to request", req, resp);
						return cb(null);
					}
					var text = resp.responseText;
					var baseurl = req.url.replace(/\/[^/]+(?:[?#].*)?$/, "/");
					params = encode_entities(params);
					text = text.replace(/((?:initialization|media)=")([^"]+)(")/g, "$1" + baseurl + "$2?" + params + "$3");
					cb(text);
				};
				options.do_request(req);
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:channel\/+[0-9]+|embed\/+player)\/+cliplink\/+([0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					var cache_key = "kakao_video:" + id;
					var queries = {
						player: "monet_html5",
						referer: "https://tv.kakao.com/",
						uuid: "",
						profile: "HIGH4", // 1080p ... is there anything larger?
						service: "kakao_tv",
						fields: "seekUrl,abrVideoLocationList",
						playerVersion: "3.7.1",
						startPosition: "0",
						tid: "",
						dteType: "PC",
						contentType: ""
					};
					queries[Date.now()] = "";
					api_query(cache_key, {
						url: "https://tv.kakao.com/katz/v1/ft/cliplink/" + id + "/readyNplay?" + stringify_queries(queries),
						imu_mode: "xhr",
						headers: {
							"Content-Type": "application/x-www-form-urlencoded",
							Referer: "https://tv.kakao.com/"
						},
						json: true
					}, cb, function(done, resp, cache_key) {
						if (!resp.videoLocation || !resp.videoLocation.url) {
							console_error(cache_key, "Unable to find video URL for", resp);
							return done(null, false);
						}
						var baseobj = {
							headers: {
								Referer: "https://tv.kakao.com/",
								Origin: "https://tv.kakao.com"
							}
						};
						var urls = [];
						var abr_urls = resp.abrVideoLocationList;
						var waiting = false;
						if (abr_urls) {
							for (var i = 0; i < abr_urls.length; i++) {
								var videotype = null;
								if (abr_urls[i].type === "DASH") {
									videotype = "dash";
								} else if (abr_urls[i].type === "HLS") {
									videotype = "hls";
								}
								if (!videotype) {
									console_warn(cache_key, "Unknown ABR content type", abr_urls[i].type, "for", abr_urls[i], resp);
									continue;
								}
								var obj = {
									video: videotype
								};
								var url = abr_urls[i].url;
								obj.url = url;
								if (abr_urls[i].params) {
									url += "?" + abr_urls[i].params;
									obj.url = url;
									if (abr_urls[i].type === "DASH") {
										query_dash_with_params({
											url: url,
											headers: {
												Referer: "https://tv.kakao.com/",
												Origin: "https://tv.kakao.com"
											}
										}, abr_urls[i].params, function(dash) {
											if (dash) {
												obj.url = "data:application/dash+xml," + encodeURIComponent(dash);
											}
											return done(fillobj_urls(urls, baseobj), 60 * 60);
										});
										waiting = true;
									}
								}
								urls.push(obj);
							}
						}
						var contenttype = resp.videoLocation.contentType;
						var video = true;
						if (contenttype) {
							if (contenttype === "HLS") {
								video = "hls";
							} else if (contenttype === "DASH") {
								video = "dash";
							} else if (contenttype === "MP4") {
								video = true;
							} else {
								console_warn(cache_key, "Unknown contentType:", { contenttype: contenttype, json: resp });
								video = null;
							}
						}
						if (video) {
							urls.push({
								url: resp.videoLocation.url,
								video: video,
								can_head: false // 404
							});
						}
						if (urls.length === 0)
							return done(null, false);
						if (!waiting)
							return done(fillobj_urls(urls, baseobj), 60 * 60);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "dn-img-page.kakao.com" ||
			domain === "page-images.kakaoentcdn.com") {
			if (/\/download\/+resource\?/.test(src)) {
				return keep_queries(src, "kid") + "&filename=o1";
			}
		}
		if (domain === "obs.line-scdn.net") {
			return {
				can_head: false,
				url: src.replace(/(:\/\/[^/]*\/(?:r\/+musicjp\/+.\/+)?[-_0-9A-Za-z]*)\/(?:small|large|preview|[fsm][0-9]+x[0-9]+)(?:[?#].*)?$$/, "$1")
			};
		}
		if (domain === "scdn.line-apps.com") return src.replace(/^[a-z]+:\/\/[^/]*\/(?:obs\/)?([-_0-9A-Za-z]*)(?:\/[a-z0-9]*)?$/, "https://obs.line-scdn.net/$1");
		if (domain === "cdn-obs.line-apps.com") return src.replace(/(\/[-0-9A-F]+\.[0-9a-z]+)\/[^/]*$/, "$1");
		if (domain === "resize-image.lineblog.me") return src.replace(/^[a-z]+:\/\/[^/]*\/[0-9a-f]*\/.*?\/([a-z]+:\/\/.*)/, "$1");
		if (domain === "stickershop.line-scdn.net") {
			return src.replace(/;[a-z]+=[^/]*(?:[?#].*)?$/, "");
		}
		if (domain === "d.line-scdn.net") {
			return src.replace(/[?].*/, "");
		}
		if (domain_nosub === "viki.io" && domain.match(/^[0-9]*\.viki\.io/)) {
			return {
				can_head: false,
				url: src.replace(/\?.*/, "")
			};
		}
		if (domain_nosub === "crunchyroll.com" && domain.match(/img[0-9]*\.[^/.]*\.crunchyroll\.com/)) {
			return src.replace(/(\/[0-9a-f]+)_(?:thumb|full)(\.[^/.]*)$/, "$1_main$2");
		}
		if (domain === "d3ieicw58ybon5.cloudfront.net") {
			return {
				url: src
					.replace(/\/resize\/[0-9]+\//, "/full/")
					.replace(/\/ex\/[0-9]+\.[0-9]+\/(?:(?:[0-9]+\.){3}[0-9]+\/)?/, "/full/"),
				can_head: false
			};
		}
		if (domain === "az616578.vo.msecnd.net") return src.replace(/\/files\/responsive\/[^/]*\/[^/]*\/[^/]*\//, "/files/");
		if ((domain_nosub === "dreamwiz.net" && domain.match(/img[0-9]*\.dreamwiz\.net/)) ||
			domain === "kep.cdn.index.hu" ||
			domain === "kep.index.hu" ||
			domain === "kep.cdn.indexvas.hu") {
			return src.replace(/_(?:[a-z]|wm)(\.[^/.]*)$/, "_o$1");
		}
		if (domain === "galeria.cdn.index.hu") return src.replace(/_[a-z]{1,2}(\.[a-z]+)(?:[?#].*)?$/, "$1");
		if ((domain_nosub === "sportsworldi.com" ||
			domain_nosub === "segye.com") &&
			string_indexof(src, "/content/image/") >= 0) {
			return src.replace(/(\/content\/+image\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+)[0-9]+\/+([0-9]+(?:_[^/.]*)?\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "maximkorea.net") return src.replace(/(\/[0-9]+_[0-9]+(?:_[0-9]+)?_img)_[0-9]+(\.[^/.]*)$/, "$1$2");
		if (domain === "blogimgc.eximg.jp") {
			return decodeURIComponent(decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/.*?i=([^,]*).*?$/, "$1")));
		}
		if (domain === "i.gzn.jp" ||
			(domain_nosub === "uludagsozluk.com" && domain.match(/^galeri[0-9]*\./))) {
			return src.replace(/_[a-z](\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "okmusic.jp" ||
			domain === "newsimg.music-book.jp") {
			return src.replace(/(\/images\/[0-9]*\/)[^/.]*(\.[^/.]*)$/, "$1original$2");
		}
		if (domain_nowww === "kai-you.net") {
			return src
				.replace(/\/r\/img\/[a-z]\/[a-z]?[0-9]+x(?:[0-9]+)?\//, "/press/img/")
				.replace(/(\/images\/.*)\/[a-z]?[0-9]+x(?:[0-9]+)?\/([^/]*)$/, "$1/$2");
		}
		if (domain === "cdn.fortune-girl.com") return src.replace(/(:\/\/[^/]*\/)[a-z]*\/([-0-9a-f]*\.[^/.]*)$/, "$1original/$2");
		if (domain === "storage.withnews.jp" ||
			amazon_container === "storage.withnews.jp") {
			return src.replace(/-[a-z]+(\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "wowma.net" && domain.match(/ic[0-9]*-a\.wowma\.net/)) {
			return src.replace(/^[a-z]*:\/\/[^/]*\/mis?\/.*?\/([^/]*\.[^/]*\/.*)/, "http://$1");
		}
		if (domain_nowww === "sokuup.net") return src.replace(/\/img[a-z]\//, "/img/");
		if (domain_nosub === "cosp.jp" && domain.match(/image[0-9]\.cosp\.jp/)) {
			return src
				.replace(/\/thumb\/(.*?\/[0-9]+)[a-z]\.(?:gif|jpg)$/, "/images/$1.jpg")
				.replace(/(\/images\/.*\/[0-9]+)_[0-9]+(\.[^/.]*)$/, "$1$2")
				.replace(/(\/[0-9]+)[a-z](\.[^/.]*)/, "$1$2");
		}
		if (domain_nowww === "gahag.net") {
			return {
				url: src.replace(/:\/\/[^/]*\/img\/([^/]*)\/([0-9]+)[a-z]\/([^-/]+-[0-9]+)-[0-9](\.[^/.]*)/, "://img01.gahag.net/$1/$2o/$3$4"),
				headers: {
					Referer: "http://gahag.net/",
				}
			};
		}
		if (domain === "img-cdn.jg.jugem.jp") return src.replace(/_[a-z](\.[^/.]*)$/, "$1");
		if (domain === "public.muragon.com") return src.replace(/\/(?:crop|resize)\/[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
		if (domain === "base-ec2if.akamaized.net") return src.replace(/(:\/\/[^/]*\/)[^/]*[a-z]=[0-9][^/]*\//, "$1");
		if (domain_nosub === "imageflux.jp" ||
			domain === "static.mercdn.net" ||
			domain === "img-comic.pximg.net" ||
			domain === "public-img-comic.pximg.net") {
			newsrc = src.replace(/\/c!\/+[^/]*[a-z]=[0-9a-z%A-Z]+[^/]*\/+/, "/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "img-comic.pximg.net") {
			return {
				url: src,
				imu_mode: "xhr",
				headers: {
					Referer: "https://comic.pixiv.net/",
					Origin: "https://comic.pixiv.net"
				}
			};
		}
		if (domain_nosub === "bloguru.com" &&
			string_indexof(src, "/userdata/") >= 0) {
			return src.replace(/\/([^/_]*)$/, "/orig_$1");
		}
		if (domain === "www.atpress.ne.jp") return src.replace(/(\/[0-9]+\/)[a-zA-Z]{2}_(img_[0-9]+[^/]*\.[^/.]*)$/, "$1$2");
		if (domain === "img-proxy.blog-video.jp" ||
			domain === "api.pddataservices.com") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/images.*?[?&]url=([^&]*).*?$/, "$1"));
		}
		if (domain === "cdn.otamart.com") return src.replace(/-thumbnail(\.[^/.]*)$/, "$1");
		if (domain === "www.pakutaso.com") return src.replace(/(\/img\/thumb\/[^/_.]*)_[^/.]*(\.[^/.]*)$/, "$1$2");
		if (domain === "cdn.atwiki.jp" ||
			(domain === "kinohron.mskcentrum.sk" && string_indexof(src, "/data-files/") >= 0)) {
			return src.replace(/\/small_([^/]*)$/, "/$1");
		}
		if (domain === "pliki.ppe.pl") return src.replace(/(\/storage\/+[0-9a-f]+\/+[0-9a-f]+)@[a-z]+\./, "$1.");
		if (domain === "getfile.fmkorea.com") {
			return decodeURIComponent(src.replace(/.*?\/getfile\.php.*?[?&]file=([^&]*).*/, "$1"));
		}
		if (domain === "img.ruliweb.com" ||
			domain === "img.korewaeroi.com" ||
			domain === "abc.imgxyqpdrs.xyz" ||
			(domain_nowww === "koreanartist.jp" && string_indexof(src, "/img/") >= 0 && src.match(/\/[0-9]+s\./)) ||
			domain === "image-bankingf25.com") {
			return src.replace(/s(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain_nosub === "dtiblog.com" && /^[0-9]*\./.test(domain)) {
			return src.replace(/(?:_thumb|s)(\.[^/.]+)(?:[?#].*)?$/, "$1");
		}
		if (domain === "img2.ruliweb.com") return src.replace(/(\/mypi\/gup\/a\/[0-9]+\/[0-9]+\/)[a-z]+(\/[0-9]+\.[^/.]*)$/, "$1o$2");
		if (domain === "file.thisisgame.com") return src.replace(/\/s_([0-9]+_[0-9]+\.[^/.]*)$/, "/$1");
		if (domain === "www.op.gg") return src.replace(/^.*?\/forum\/outImage\/(http.*)$/, "$1");
		if (domain === "ssproxy.ucloudbiz.olleh.com" ||
			domain === "s.gae9.com") {
			return src.replace(/\.[a-z]*(?:[?#].*)?$/, ".orig");
		}
		if (domain_nowww === "artstation.com") {
			if (/\/assets\/+overlay-no-triangle-[0-9a-f]+\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nosub === "artstation.com" && domain.match(/cdn[a-z0-9]*\.artstation\.com/)) {
			regex = /(\/assets\/+(?:images|covers)\/+images\/+[0-9]{3}\/+[0-9]{3}\/+[0-9]{3}\/+)(?:[0-9]+\/+)?(?:small(?:er)?|micro|medium|large|4k)(?:_square)?\/([^/]*)$/;
			if (regex.test(src)) {
				return [
					src.replace(regex, "$1original/$2"),
					src.replace(regex, "$14k/$2"),
					src.replace(regex, "$1large/$2")
				];
			}
			return src.replace(/(\/marketplace\/+printed_product_covers\/+(?:[0-9]{3}\/+){3})(?:downscaled|(?:white_wrap|art_print)_(?:small|big)|hd_metal_print_scene)\/+/, "$1big_image/");
		}
		if (domain === "static.cosplay-it.com") return src.replace(/(\/[-0-9a-f]*)_[a-z]+(\.[^/.]*)/, "$1$2");
		if (domain === "a.fsdn.com") return src.replace(/(\/screenshots\/[^/]*)\/[0-9]+\/.*/, "$1");
		if (domain === "media.moddb.com" ||
			domain === "cdn.dbolical.com" ||
			domain === "media.indiedb.com") {
			newsrc = src.replace(/\/cache\/+images\/(.*?)\/[a-z]+_[0-9]+[^/]*(\/[^/]*\.[^/.]*)$/, "/images/$1$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/images\/+(.*?)\.mp4\.jpg(?:[?#].*)?$/, "/videos/$1.mp4");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "thumb.modcdn.io") return src.replace(/:\/\/thumb\.(.*\/)(?:crop|thumb)_[0-9]+x[0-9]+\/+/, "://image.$1");
		if (domain === "static.gamefront.com" ||
			domain_nowww === "wallpaperawesome.com" ||
			(domain_nowww === "ukstockingsex.com" && string_indexof(src, "/galleries/") >= 0) ||
			domain === "cg.adultwork.com") {
			return src.replace("/thumbnails/", "/");
		}
		if (domain === "thumb.test.mod.io" ||
			domain === "thumb.mod.io") {
			return src.replace(/:\/\/thumb\.([^/]*\..*?\/)[a-z]+_[0-9]+[^/]*\/([^/]*)$/, "://image.$1$2");
		}
		if (domain_nosub === "scirra.net" && domain.match(/static[0-9]*\.scirra\.net/)) {
			return src.replace(/\/avatars\/[0-9]+\//, "/avatars/256/");
		}
		if (domain === "cdn.gamer-network.net" ||
			domain === "d2skuhm0vrry40.cloudfront.net") {
			return src.replace(/(\.[^/.]*)\/EG[0-9]+\/.*/, "$1");
		}
		if (domain_nosub === "wikiart.org" && domain.match(/uploads[0-9]*\.wikiart\.org/)) {
			return src.replace(/![^/]*$/, "");
		}
		if ((domain_nosub === "fdncms.com" ||
			domain_nosub === "miaminewtimes.com" ||
			domain_nosub === "houstonpress.com" ||
			domain_nosub === "laweekly.com" ||
			domain_nosub === "cltampa.com" ||
			domain_nosub === "phoenixnewtimes.com") &&
			domain.match(/^(?:images|media)[0-9]*\./)) {
			newsrc = src.replace(/\/imager\/u\/[^/]*\/([0-9]+\/[^/]*)(?:\/.*)?/, "/imager/u/original/$1");
			if (newsrc !== src)
				return newsrc;
			if (src.match(/\/imager\/u\/[^/]*\/[0-9]+\/https?_3[aA]/)) {
				newsrc = src
					.replace(/.*?\/imager\/u\/[^/]*\/[0-9]+\/(https?_3[aA].*\.[^/._]*)(?:_[^/]*)?$/, "$1")
					.replace(/_([0-9a-fA-F][0-9a-fA-F])/g, "%$1");
				newsrc = decodeURIComponent(newsrc);
				return newsrc;
			}
		}
		if (domain === "images.techhive.com" ||
			domain === "images.idgesg.net") {
			return src.replace(/-[a-z]+(?:\.[^/.]*)?(\.[^/.]*)$/, "-orig$1");
		}
		if (domain_nosub === "rimg.com.tw" ||
			domain_nosub === "rimg.tw" ||
			domain === "photo.roodo.com" ||
			domain === "img.ruten.com.tw") {
			if (src.match(/(\/photos\/[0-9]+_[0-9a-z]+_)[a-z](\.[^/.]*)$/)) {
				return src.replace(/(\/photos\/[0-9]+_[0-9a-z]+_)[a-z](\.[^/.]*)$/, "$1o$2");
			}
			return {
				url: src.replace(/_[a-z](\.[^/.]*)$/, "$1"),
				headers: {
					Referer: "https://goods.ruten.com.tw/item/show"
				},
				referer_ok: {
					same_domain: true
				}
			};
		}
		if (domain === "buy.line-scdn.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/[a-f0-9]+\/s\//, "https://s.yimg.com/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "hc360.cn" && domain.match(/img[0-9]*\.hc360\.cn/)) {
			return src.replace(/(\.[^/.]*)\.[^/]*$/, "$1");
		}
		if (domain_nosub === "ganref.jp" && domain.match(/photo[0-9]*\.ganref\.jp/)) {
			return src.replace(/(\/[0-9a-f]+\/)thumb[0-9]*(\.[^/.]*)$/, "$1original$2");
		}
		if (domain === "img.cdn.nimg.jp") return src.replace(/:\/\/img\.cdn\.nimg\.jp\/s\/(.*?\/images\/+[0-9]+\/+(?:[0-9a-f]+|[^/.]*\.[^/.]*))\/.*/, "://dcdn.cdn.nimg.jp/$1");
		if (domain_nosub === "photozou.jp") {
			return src
				.replace(/(\/photo\/[0-9]+\/org\.bin)\?.*$/, "$1")
				.replace(/(\/photo\/[0-9]+)_[a-z0-9]+(\.[^/]*)$/, "$1_org$2");
		}
		if (domain === "desktop.sakura.ne.jp" ||
			domain === "kysiamesecat.sakura.ne.jp") {
			return src.replace(/-thumbnail[0-9]*(\.[^/.]*)$/, "$1");
		}
		if ((domain_nowww === "ya.sakura.ne.jp" || domain === "mabi4751.orz.hm") &&
			string_indexof(src, "/~mabi/") >= 0) {
			return src.replace(/[sm](\.jpg|\.JPG)$/, "$1");
		}
		if (domain === "waganeko.sakura.ne.jp") return src.replace(/\/\.thumbnail\/([^/]*\.[^/.]*)\.[^/.]*$/, "/$1");
		if (domain_nosub === "storage-yahoo.jp") return src.replace(/_(?:m|thumb)(\?.*)?$/, "$1");
		if (domain === "static-mercari-jp-imgtr2.akamaized.net" ||
			domain === "mercari-images.global.ssl.fastly.net") {
			return src
				.replace(/\/thumb\/+(photos|members)\/+/, "/$1/")
				.replace(/(\/(?:photos|members)\/.*?)(?:[?#].*)$/, "$1");
		}
		if (domain === "assets.mercari-shops-static.com") {
			return src
				.replace(/(:\/\/[^/]+\/+-\/+large\/+[^/]+\/+[^/.]+\.[a-z]+)(?:@webp)?(?:[?#].*)?$/, "$1@jpg")
				.replace(/(:\/\/[^/]+\/+-\/+)small\/+/, "$1large/");
		}
		if (domain_nowww === "facebook.com" ||
			domain === "m.facebook.com" ||
			domain === "mbasic.facebook.com") {
			var find_from_serverjs = function(obj, requireid) {
				var require = [];
				if (obj.pre_display_requires) {
					require = obj.pre_display_requires;
				} else {
					if (obj.require) {
						require = obj.require;
					} else {
						return null;
					}
				}
				var result = [];
				for (var i = 0; i < require.length; i++) {
					if (require[i][0] === requireid) {
						result.push(require[i]);
					}
				}
				if (result.length === 0)
					return null;
				return result;
			};
			var find_prefetched_from_serverjs = function(obj, find) {
				var prefetched = find_from_serverjs(obj, "RelayPrefetchedStreamCache");
				if (!prefetched)
					return null;
				if (!find)
					find = [];
				if (!is_array(find))
					find = [find];
				var result = [];
				for (var i = 0; i < prefetched.length; i++) {
					var pre = prefetched[i];
					var data = pre[3];
					if (find.length > 0) {
						var found = false;
						for (var j = 0; j < find.length; j++) {
							if (find[j].test(data[0])) {
								found = true;
								break;
							}
						}
						if (!found)
							continue;
					}
					result.push(data);
				}
				if (result.length === 0)
					return null;
				return result;
			};
			var get_fb_serverjs = function(cache_key, resp, find) {
				var regex = /\(new ServerJS\(\)\)\.handleWithCustomApplyEach\(ScheduledApplyEach,({"(?:define|require)":.*?\]\]})\);\}/;
				var global = new RegExp(regex, "g");
				var match = resp.responseText.match(global);
				if (!match) {
					console_error(cache_key, "Unable to find matches for", resp);
					return null;
				}
				var jsons = [];
				for (var i = 0; i < match.length; i++) {
					var m = match[i];
					var submatch = m.match(regex);
					try {
						var json = JSON_parse(submatch[1]);
						var prefetched = find_prefetched_from_serverjs(json, find);
						if (!prefetched)
							continue;
						for (var j = 0; j < prefetched.length; j++) {
							jsons.push(prefetched[j]);
						}
					} catch (e) {
						console_error(cache_key, e, { match: m, submatch: submatch, resp: resp });
					}
				}
				if (jsons.length === 0)
					return null;
				return jsons;
			};
			var find_prefetched_from_bigpipe = function(bigpipe, find) {
				if (!bigpipe.jsmods || !bigpipe.jsmods.pre_display_requires)
					return;
				return find_prefetched_from_serverjs(bigpipe.jsmods, find);
			};
			var find_jsmods_instances_from_bigpipe = function(bigpipe, find) {
				if (!bigpipe.jsmods || !bigpipe.jsmods.instances)
					return;
				var instances = bigpipe.jsmods.instances;
				var retinstances = [];
				for (var i = 0; i < instances.length; i++) {
					if (find.length > 0 && false) {
						var type = instances[i][1];
						var found = false;
						for (var j = 0; j < find.length; j++) {
							for (var k = 0; k < type.length; k++) {
								console_log(type[k]);
								if (find[j].test(type[k])) {
									found = true;
									break;
								}
							}
							if (found)
								break;
						}
						if (!found)
							continue;
					}
					retinstances.push(instances[i]);
				}
				if (retinstances.length === 0)
					return null;
				return retinstances;
			};
			var get_fb_bigpipe = function(cache_key, resp, find) {
				var regex = /requireLazy\(\["__bigPipe"\],\(function\(bigPipe\){bigPipe\.onPageletArrive\(({.*?})\);}\)\);/;
				var global = new RegExp(regex, "g");
				var match = resp.responseText.match(global);
				if (!match) {
					console_error(cache_key, "Unable to find matches for", resp);
					return null;
				}
				if (!find)
					find = [];
				if (!is_array(find))
					find = [find];
				var ourfind = [];
				for (var i = 0; i < find.length; i++) {
					ourfind.push(new RegExp(find[i].source.replace(/[$^]/g, "")));
				}
				var jsons = [];
				for (var i = 0; i < match.length; i++) {
					var m = match[i];
					var submatch = m.match(regex);
					if (ourfind.length > 0 && false) {
						var found = false;
						for (var j = 0; j < ourfind.length; j++) {
							console_log(ourfind[j]);
							if (ourfind[j].test(submatch[1])) {
								found = true;
								break;
							}
						}
						if (!found)
							break;
					}
					try {
						var fixedup = fixup_js_obj_proper(submatch[1]);
						var json = JSON_parse(fixedup);
						var prefetched = find_prefetched_from_bigpipe(json, find);
						if (prefetched)
							array_extend(jsons, prefetched);
					} catch (e) {
						console_error(cache_key, e, { match: m, submatch: submatch, resp: resp });
					}
				}
				if (jsons.length === 0)
					return null;
				return jsons;
			};
			var parse_newstyle_fb = function(cache_key, resp) {
				var serverjs = get_fb_serverjs(cache_key, resp, /^adp_CometPhotoRootQueryRelayPreloader_/);
				if (!serverjs) {
					console_error(cache_key, "Unable to find serverjs match for", resp);
					return null;
				}
				var json = serverjs[0];
				var data = json[1].__bbox.result.data;
				var currMedia = data.currMedia;
				var obj = {
					extra: {
						page: resp.finalUrl
					}
				};
				if (currMedia.message && currMedia.message.text) {
					obj.extra.caption = currMedia.message.text;
				} else if (currMedia.accessibility_caption) {
					obj.extra.caption = currMedia.accessibility_caption;
				}
				obj.url = common_functions["instagram_norm_url"](currMedia.image.uri);
				return obj;
			};
			var parse_oldstyle_fb = function(cache_key, resp) {
				var match = resp.responseText.match(/\<div\s+class=\"hidden_elem\"\s*>.*?data-ploi=\"(https?:\/\/[^"]*?)\"/);
				if (!match) {
					console_error(cache_key, "Unable to find match for", resp);
					return null;
				}
				var obj = {
					extra: {
						page: resp.finalUrl
					}
				};
				obj.url = decode_entities(match[1]);
				return obj;
			};
			var parse_html_post = function(cache_key, resp, current_id) {
				var matches = match_all(resp.responseText, /<a rel="theater" ajaxify="([^"]+)"/);
				if (!matches) {
					console_error(cache_key, "Unable to find theater match for", resp);
					return null;
				}
				var links = [];
				array_foreach(matches, function(match, i) {
					var url = match[1];
					url = url.replace(/[?#].*$/, "");
					url = urljoin("https://www.facebook.com/", url, true);
					links.push({
						url: url,
						is_current: i === current_id
					});
				});
				if (!links.length) {
					console_error(cache_key, "No photos found for", resp, matches);
					return null;
				}
				return {
					url: links[current_id].url,
					is_pagelink: true,
					album_info: {
						type: "links",
						links: links
					}
				};
			};
			var query_facebook_post = function(uid, post_id, cb) {
				var cache_key = "facebook_post:" + uid + ":" + post_id;
				var url = "https://www.facebook.com/" + uid + "/posts/" + post_id;
				if (/^[0-9]{10,}$/.test(uid)) {
					url = "https://www.facebook.com/permalink.php?story_fbid=" + post_id + "&id=" + uid;
				}
				api_query(cache_key, {
					url: url,
					imu_mode: "document"
				}, cb, function(done, resp, cache_key) {
					var current_id = 0;
					var serverjs = get_fb_serverjs(cache_key, resp, [
						/^adp_CometSinglePostRootQueryRelayPreloader_/,
						/^adp_CometPagePostsRootHoistedStoryQueryRelayPreloader_/ // xpost
					]);
					if (!serverjs) {
						var html_parse = parse_html_post(cache_key, resp, 0);
						if (html_parse)
							return done(html_parse, 60 * 60);
						console_error(cache_key, "Unable to find serverjs match for", resp);
						return done(null, false);
					}
					var json = serverjs[0];
					var data = json[1].__bbox.result.data;
					var node;
					if ("node" in data) {
						node = data.node;
					} else if ("nodes" in data) { // hoisted story
						node = data.nodes[0];
					} else {
						console_error(cache_key, "Unable to find node from", data, json, resp);
						return done(null, false);
					}
					var story = node.comet_sections.content.story;
					if (story.attached_story)
						story = story.attached_story;
					var attachments = story.attachments;
					for (var i = 0; i < attachments.length; i++) {
						try {
							var attachment = attachments[i].style_type_renderer.attachment;
							var album_info = null;
							if (attachment.all_subattachments) {
								var nodes = attachment.all_subattachments.nodes;
								attachment = nodes[current_id];
								album_info = {
									type: "links",
									links: []
								};
								for (var j = 0; j < nodes.length; j++) {
									var node = nodes[j];
									var node_url = node.url || node.media.url;
									var media_url;
									try {
										var node_image = node.image || node.media.image;
										var media_url = node_image.uri;
									} catch (e) {
										console_error(e);
									}
									album_info.links.push({
										url: node_url,
										x_id: media_url,
										is_current: j === current_id
									});
								}
							}
							var url = attachment.url || attachment.media.url;
							var obj = {
								url: url,
								is_pagelink: true,
								album_info: album_info
							};
							return done(obj, 6 * 60 * 60);
						} catch (e) {
							console_error(cache_key, e);
						}
					}
					return done(null, false);
				});
			};
			var parse_facebook_post_url = function(url) {
				var match = url.match(/^[a-z]+:\/\/[^/]+\/+([^/]+)\/+posts\/+([0-9]+)(?::[0-9]+)?\/*(?:[?#].*)?$/);
				if (match) {
					return {
						uid: match[1],
						post_id: match[2]
					};
				}
				match = url.match(/^[a-z]+:\/\/[^/]+\/+(?:permalink|story)\.php\?/);
				if (match) {
					var queries = get_queries(url);
					if (queries.story_fbid && queries.id) {
						return {
							uid: queries.id,
							post_id: queries.story_fbid
						};
					}
				}
				return null;
			};
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+[^/]+\/+photos\/+(?:[^/]+\/+)?([0-9]+)\/*(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+photo(?:\/+|\.php)\?(?:.*&)?fbid=([0-9]+)(?:[&#].*)?$/
				],
				cache_key: "facebook_photo",
				query_for_id: function(id) {
					return {
						url: "https://www.facebook.com/photo/?fbid=" + id, // needed for private photos
						imu_mode: "document"
					};
				},
				process: function(done, resp, cache_key) {
					var obj = parse_newstyle_fb(cache_key, resp);
					if (!obj) {
						obj = parse_oldstyle_fb(cache_key, resp);
					}
					if (obj) {
						return done(obj, 60 * 60);
					} else {
						return done(null, false);
					}
				}
			});
			if (newsrc)
				return newsrc;
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+watch\/+\?(?:.*&)?v=([0-9]+)(?:&.*)?(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+[^/]+\/+videos\/+([0-9]+)\/*(?:[?#].*)?$/
				],
				cache_key: "facebook_video",
				query_for_id: function(id) {
					return {
						url: "https://www.facebook.com/watch/?v=" + id,
						imu_mode: "document"
					};
				},
				process: function(done, resp, cache_key) {
					var results = get_fb_serverjs(cache_key, resp, [
						/^adp_CometVideoHomeInjectedFeedUnitQueryRelayPreloader_/,
						/^adp_CometTahoeRootQueryRelayPreloader_/
					]);
					if (!results) {
						results = get_fb_bigpipe(cache_key, resp, [
							/^adp_CometVideoHomeFeedRootQueryRelayPreloader_/,
							/^adp_CometVideoHomeInjectedFeedUnitQueryRelayPreloader_/
						]);
						if (!results) {
							console_error(cache_key, "Unable to find serverjs match for", resp);
							return done(null, false);
						}
					}
					for (var i = 0; i < results.length; i++) {
						var data = results[i][1].__bbox.result.data;
						if (!data.video && !data.story)
							continue;
						var media;
						if (data.video)
							media = data.video;
						else if (data.story) // bigpipe
							media = data;
						if (media.story && media.story.attachments && media.story.attachments.length && media.story.attachments[0].media) {
							media = media.story.attachments[0].media;
						}
						if (!media.videoId && !media.id && !media.permalink_url) {
							continue;
						}
						var obj = {
							extra: {
								page: media.permalink_url || media.url || resp.finalUrl
							}
						};
						var video_data = {};
						try {
							var json_video_data = media.video_player_component_renderer.video.video_player_dash_module_renderer.json_encoded_video_data;
							video_data = JSON_parse(json_video_data);
						} catch (e) {
							video_data = media;
						}
						var urls = [];
						if (false && media.playable_url_dash) {
							urls.push({
								url: media.playable_url_dash,
								video: "dash"
							});
						}
						if (video_data.dash_manifest) {
							urls.push({
								url: "data:application/dash+xml," + encodeURIComponent(video_data.dash_manifest),
								video: "dash"
							});
						}
						if (media.playable_url_quality_hd || video_data.hd_src) {
							urls.push({
								url: media.playable_url_quality_hd || video_data.hd_src,
								video: true
							});
						}
						if (media.playable_url || video_data.sd_src_no_ratelimit || video_data.sd_src) {
							urls.push({
								url: media.playable_url || video_data.sd_src_no_ratelimit || video_data.sd_src,
								video: true
							});
						}
						var thumbnail = media.thumbnailImage || media.image;
						if (thumbnail && thumbnail.uri) {
							urls.push(thumbnail.uri);
						}
						return done(fillobj_urls(urls, obj), 60 * 60);
					}
					console_error(cache_key, "Unable to find media from", { resp: resp, serverjs: results });
					return done(null, false);
				}
			});
			if (newsrc)
				return newsrc;
			var parsed_url = parse_facebook_post_url(src);
			if (parsed_url) {
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				if (options.do_request && options.cb) {
					query_facebook_post(parsed_url.uid, parsed_url.post_id, function(obj) {
						if (!obj) {
							return options.cb(page_nullobj);
						}
						var imuurl;
						var imu_imageid;
						var imu_match = src.match(/#imu-url=(.*)$/);
						if (imu_match) {
							imuurl = imu_match[1];
							imu_imageid = common_functions["instagram_get_imageid"](imuurl);
						}
						if (imuurl && obj.album_info) {
							common_functions["update_album_info_links"](obj, function(x) {
								var imageid = common_functions["instagram_get_imageid"](x);
								return imu_imageid === imageid;
							});
						}
						return options.cb([obj, page_nullobj]);
					});
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
			if (false) {
				newsrc = website_query({
					website_regex: [
						/^[a-z]+:\/\/[^/]+\/+stories\/([0-9]+)\/+([^/]+)\/*(?:[?#].*)?$/
					],
					cache_key: "facebook_story",
					query_for_id: function(id) {
						return {
							url: "https://www.facebook.com/stories/" + id,
							imu_mode: "document"
						};
					},
					process: function(done, resp, cache_key) {
						/*var results = get_fb_serverjs(cache_key, resp);
						console_log(results);*/
					}
				});
				if (newsrc)
					return newsrc;
			}
		}
		if (host_domain === "m.facebook.com" && options.element) {
			if (options.element.tagName === "IMG" && options.element.classList.contains("img")) {
				common_functions["get_pagelink_el_matching"](options.element, /\/photos\//);
			}
		}
		if (domain === "waichi.sakura.ne.jp") return src.replace(/(\/[^/_.]*)(\.(?:jpg|JPG|jpeg|png|PNG))$/, "$1_L$2");
		if (domain === "news.merumo.ne.jp") {
			newsrc = src
				.replace(/\/imgs\/+rect[0-9]*\//, "/imgs/src/")
				.replace(/\/(?:article)?img\/+([0-9]+)(?:\/+[0-9]+)?(?:[?#].*)?$/, "/imgs/src/$1");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/imgs\/+src\/+([0-9]+)(?:[?#].*)?$/);
			if (false && match) {
				var id_1 = match[1];
				var folder_id = zpadnum(match[1], 9);
				return "https://images.merumo.ne.jp/" + folder_id.slice(0, 3) + "/" + folder_id.slice(3, 6) + "/" + folder_id.slice(6, 9) + "/" + id_1 + "_src_0.jpg";
			}
		}
		if (domain === "images.merumo.ne.jp") return src.replace(/(\/(?:[0-9]{3}\/+){3}[0-9]+)_(?:[a-z]+|rect[0-9]*)((?:_[0-9]+)?\.)/, "$1_src$2");
		if ((domain_nosub === "shikimori.org" ||
			domain_nosub === "shikimori.one") &&
			string_indexof(src, "/system/") >= 0) {
			return src.replace(/\/[a-z]+\/+((?:[0-9]+\/+)?[0-9]+\.[^/.]*)$/, "/original/$1");
		}
		if (domain === "assets.survivalinternational.org") return src.replace(/_[0-9a-z_]+(\.[^/.]*)$/, "_original$1");
		if (domain === "alioss.g-cores.com" &&
			string_indexof(src, "/uploads/image/") >= 0) {
			return src.replace(/_watermark(\.[^/.]*)$/, "$1");
		}
		if (domain === "img.nyato.com" ||
			domain === "img.ifun01.com" ||
			domain === "img.itw01.com" ||
			domain === "img.mttmp.com" ||
			domain === "img.maoduoer.com" ||
			domain === "img.sycs.net" ||
			domain === "img.6jyx.com" ||
			domain === "dn-kdt-img.qbox.me" ||
			domain === "pic-cdn.35pic.com" ||
			domain === "images.sharerails.com" ||
			domain === "oi5mmhyk8.qnssl.com" ||
			domain === "pic.cr173.com" ||
			(domain_nosub === "5ceimg.com" && /^i[0-9]*\./.test(domain)) ||
			domain === "movieboo.oss-cn-hangzhou.aliyuncs.com" ||
			domain === "cover.read.duokan.com" ||
			(domain_nosub === "asus.com" && /^img(?:-[a-z]+)?[0-9]*\./.test(domain) && /!t[0-9]+x[0-9]+(?:[?#].*)?$/.test(src)) ||
			(domain_nosub === "gitee.com" && /\/avatar\//.test(src)) ||
			domain === "img.mgpyh.com") {
			newsrc = src.replace(/!.*/, "");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "90sjimg.com" ||
			domain === "bpic.588ku.com" ||
			domain === "588ku.qiao88.com" ||
			domain === "static.pptstore.net" ||
			domain === "img.lovepik.com") {
			newsrc = src.replace(/(?:!|%21)\/.*/, "");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "woyaogexing.com" && domain.match(/^img[0-9]*\./)) {
			return src.replace(/(\/[0-9a-z]+)![^/]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "inews.gtimg.com" ||
			domain === "pnewsapp.tc.qq.com") {
			return {
				url: src.replace(/\/newsapp_[a-z]+\/+([0-9]+\/+[0-9]+\/+)[0-9]+(?:\/+[0-9]+)?(?:[?#].*)?$/, "/newsapp_match/$10"),
				headers: {
					"Origin": "",
					"Referer": ""
				}
			};
		}
		if ((domain === "acg.ms" ||
			domain === "m.acg.ms") &&
			string_indexof(src, "/photo/") >= 0) {
			return {
				redirects: true,
				url: src.replace(/(\/[0-9]+)_[0-9]+_[0-9]+(\.[^/.]*)$/, "$1_0_9999999$2")
			};
		}
		if (domain === "sl.news.livedoor.com") {
			return src.replace(/^[a-z]+:\/\/[^/]*\/[a-f0-9]+\/[^/]*\//, "");
		}
		if (domain === "photo.tuchong.com") return src.replace(/\/[a-z]\/([0-9]+\.[^/.]*)/, "/f/$1");
		if ((domain === "arine.akamaized.net" ||
			domain === "media-assets.aumo.jp") &&
			string_indexof(src, "/uploads/photo/") >= 0) {
			return src.replace(/(\/[0-9]+\/)[a-z]+_([-0-9a-z]+\.[^/.]*)$/, "$1$2");
		}
		if (domain === "newsimg.glossom.jp") return src.replace(/(\/[0-9]+_)[0-9]+(_[0-9]+\.[^/.]*)$/, "$1org$2");
		if (domain === "www.vtianxia.cn") return src.replace(/(\/uploadfile\/[a-z]+\/)[a-z]+\//, "$1big/");
		if (domain === "img.over-blog-kiwi.com" ||
			domain === "img.over-blog.com" ||
			(domain_nosub === "over-blog.com" && string_indexof(domain, ".idata.over-blog.com") >= 0)) {
			return src.replace(/(:\/\/[^/]*\/)[0-9]+x[0-9]+(?:-[a-z]+)?\//, "$1");
		}
		if (domain === "resize.over-blog.com") {
			return src.replace(/^[a-z]+:\/\/[^/]*\/[0-9]+x[0-9]+(?:-[a-z]+)?\.[^/.?]*\?/, "");
		}
		if (domain_nosub === "eastday.com" && domain.match(/[0-9]*\.?imgmini\.eastday\.com/)) {
			return src
				.replace(/(\/[0-9]+_[0-9a-f]+_[0-9]+)_[^/.]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/_wmk(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain_nosub === "so-net.ne.jp" ||
			domain_nosub === "ss-blog.jp") {
			return src.replace(/\/(?:m|S[0-9]+)_([^/]*)$/, "/$1");
		}
		if (amazon_container === "rejob-v2-images-production" ||
			(amazon_container === "mosaia" && src.match(/\/images\/[0-9]+\/[^/]*$/))) {
			return src.replace(/\/[^/.]*(\.[^/.]*)$/, "/original$1");
		}
		if (domain === "lohas.nicoseiga.jp") {
			newsrc = src.replace(/(\/thumb\/+[0-9]+)[a-z][a-z]?(\?.*)?$/, "$1l$2");
			if (newsrc !== src)
				return newsrc;
			var get_nicovideo_obj = function(id) {
				return {
					url: src,
					extra: { page: "https://seiga.nicovideo.jp/seiga/im" + id }
				};
			};
			obj = null;
			match = src.match(/\/thumb\/+([0-9]+)(?:[a-z]+)(?:[?#].*)?$/);
			if (match) {
				id = match[1];
				obj = get_nicovideo_obj(id);
			}
			if (match && options.do_request && options.cb) {
				var cache_key = "nicoseiga:" + id;
				api_cache.fetch(cache_key, options.cb, function(done) {
					options.do_request({
						url: "https://seiga.nicovideo.jp/image/source/" + id,
						method: "GET",
						onload: function(resp) {
							if (resp.readyState !== 4)
								return;
							if (resp.status !== 200) {
								console_error(resp);
								return done(null, false);
							}
							var headers = headers_list_to_dict(parse_headers(resp.responseHeaders));
							if ("content-type" in headers) {
								if (/^image\//.test(headers["content-type"])) {
									return done(resp.finalUrl, 6 * 60 * 60);
								}
							}
							var match = resp.responseText.match(/<div\s+class=\"illust_view_big\"[^>]+data-src=\"([^"]+)\"/);
							if (!match) {
								console_error("Unable to find match (are you logged in to nicovideo?)", resp);
								return done(null, false);
							}
							var url = decode_entities(match[1]);
							obj.url = urljoin(resp.finalUrl, url, true);
							done(obj, 6 * 60 * 60);
						}
					});
				});
				return {
					waiting: true
				};
			}
			if (!match) {
				match = src.match(/\/priv\/+[0-9a-f]{10,}\/+[0-9]+\/+([0-9]+)(?:[?#].*)?$/);
				if (match) {
					id = match[1];
					obj = get_nicovideo_obj(id);
				}
			}
			if (obj) {
				return obj;
			}
		}
		if (domain === "appdata.hungryapp.co.kr") {
			return src
				.replace(/\/data_img_[a-z]\//, "/data_img/")
				.replace(/(\/[0-9]{6}\/[0-9]{2}\/[^/]*\.[^/.]*)\/hungryapp\/.*/, "$1");
		}
		if (domain === "media.funradio.fr") return src.replace(/\/cache\/[0-9a-zA-Z]+\/[0-9a-z]+-[0-9]+\//, "/");
		if (domain === "image.afcdn.com" ||
			domain === "assets.afcdn.com" ||
			domain === "imalbum.aufeminin.com" ||
			domain === "imworld.aufeminin.com") {
			return {
				url: src
					.replace(/(\/acc[0-9]+_(?:[a-z]+_)?[0-9]+\/+[a-z0-9]+)_[a-z0-9]+(\.[^/.]*)/, "$1$2")
					.replace(/(-[0-9]+_[A-Z0-9]+_)[A-Z](?:_[a-z[0-9]+)?(\.[^/.]*)/, "$1L$2")
					.replace(/\/(?:[^/.?#]+-)?((?:[a-z]+)?[0-9]+)_[a-z0-9]+(\.[^/.]*)/, "/$1_origin$2"),
				headers: {
					Origin: "https://www.sofeminine.co.uk/",
					Referer: "https://www.sofeminine.co.uk/"
				}
			};
		}
		if ((domain_nosub === "greatsong.net" && domain.match(/static[0-9]*\.greatsong\.net/)) ||
			(domain_nosub === "china.com" && domain.match(/img[0-9]*\.(?:[a-z]+\.)?china\.com/))) {
			return src.replace(/\/[0-9]+x[0-9]+\//, "/original/");
		}
		if (domain === "ipravda.sk") return src.replace(/\/thumbs\/([^/]*)-(?:stvorec|nestandard[0-9]*|galeria|clanokW?|strednaW?|malaW?)(\.[^/.]*)$/, "/$1$2");
		if (domain === "d919ce141ef35c47fc40-b9166a60eccf0f83d2d9c63fa65b9129.ssl.cf5.rackcdn.com" ||
			domain === "media.phillyvoice.com") {
			return src.replace(/(\/images\/[^/.]+\.)[^/]*(\.[^/.]*)$/, "$1original$2");
		}
		if (domain === "nation.com.pk") return src.replace(/\/print_images\/[a-z]+\//, "/print_images/large/");
		if (domain === "dazedimg.dazedgroup.netdna-cdn.com" ||
			domain === "images-prod.anothermag.com" ||
			domain === "anotherimg-dazedgroup.netdna-ssl.com" ||
			domain === "images-prod.dazeddigital.com" ||
			domain === "dazedimg-dazedgroup.netdna-ssl.com") {
			newsrc = src.replace(/(:\/\/[^/]*\/)[0-9]+\/(?:[0-9]+-[0-9]+-[0-9]+-[0-9]+\/)?/, "$1");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/^[a-z]+:\/\/[^/]+\/+azure\/+(.*)/, "https://dazedprod.blob.core.windows.net/$1");
		}
		if (domain === "www.fuse.tv") return src.replace(/(\/image\/[0-9a-f]+\/)[0-9]+\/[0-9]+\/([^/]*)$/, "$1$2");
		if (domain === "assets.capitalxtra.com") return src.replace(/(\/[^/.]*-[0-9]{8,})-[^/.]*(\.[^/.]*)$/, "$1$2");
		if (domain === "imgproc.airliners.net") return src.replace(/(\/photos\/+[^/]+\/+(?:[0-9]\/+){3}[^/]+)-v[0-9a-f]+-[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "ukmix.org") {
			match = src.match(/\/proxy\.php\?(?:.*&)?url=([^&]+)/);
			if (match) {
				return base64_decode(decodeURIComponent(match[1]));
			}
		}
		if (domain === "m.static.newsvine.com" &&
			string_indexof(src, "/servista/imagesizer?") >= 0) {
			return src.replace(/(\/servista\/imagesizer).*?[?&](file=[^&]*).*/, "$1?$2");
		}
		if (domain_nosub === "cosplaywon.com" && domain.match(/theprecious[0-9]*\.cosplaywon\.com/)) {
			return src.replace(/(\/photo\/[0-9]+\/)[a-z]+_([-0-9a-f]+\.[^/.]*)$/, "$1original_$2");
		}
		if (domain_nowww === "otaku.com") return src.replace(/(\/files\/images\/)[^/]*\/(?:[A-Z]+_)?([^/]*)$/, "$1fullsize/$2");
		if ((domain_nosub === "joyreactor.com" ||
			domain_nosub === "reactor.cc" ||
			domain_nosub === "thatpervert.com" ||
			domain_nosub === "joyreactor.cc") &&
			domain.match(/^img[0-9]*\./)) {
			newsrc = src.replace(/(\/pics\/post\/)([^/]*)$/, "$1full/$2");
			if (newsrc !== src)
				return newsrc;
			id = src.replace(/.*\/pics\/thumbnail\/post-([0-9]+)\.[^/.]*$/, "$1");
			if (id !== src && options && options.cb && options.do_request) {
				options.do_request({
					url: src.replace(/:\/\/img[0-9]*\.([^/]*\/).*/, "://$1post/" + id),
					method: "GET",
					onload: function(resp) {
						if (resp.readyState === 4) {
							var match = resp.responseText.match(/<div class="image">\s*(?:<a[^>]*>)?\s*<img[^>]*src="([^"]*)"/);
							if (match) {
								options.cb(match[1]);
							} else {
								options.cb(null);
							}
						}
					}
				});
				return {
					waiting: true
				};
			}
		}
		if (domain_nowww === "coolwallpaperz.info") return src.replace(/(\/uploads\/wall\/)thumb(\/[0-9]+\/[^/]*)$/, "$1o$2");
		if (domain_nowww === "besthqwallpapers.com" ||
			domain_nowww === "wallpapers4screen.com" ||
			domain_nowww === "brightwallpapers.com.ua") {
			return src.replace(/(\/[Uu]ploads\/+(?:[0-9]{1,2}-){2}[0-9]{4}\/+(?:[0-9]+|[-0-9a-f]+)\/+)thumb[0-9]*-([^/]*)$/, "$1$2");
		}
		if (domain_nowww === "avatanplus.com") {
			if (string_indexof(src, "/resize.php?") >= 0) {
				var queries = get_queries(src);
				return "https://avatanplus.com/files/" + queries.type + "/original/" + queries.file;
			}
			return src
				.replace(/(\/files\/[a-z]+)\/[a-z]+\/([0-9a-f]+\.[^/.]*)$/, "$1/original/$2");
		}
		if (domain === "data.japanese.kpopstarz.com" ||
			domain === "image.kpopstarz.com" ||
			domain === "images.kpopstarz.com" ||
			domain === "images.kstars.kr" ||
			domain === "images.enstarz.com" ||
			domain === "cdn.breathecast.com" ||
			(domain_nosub === "yibada.com" && /^image\./.test(domain)) ||
			(domain_nosub === "cdn77.org" && /^[0-9]+\.rsc\./.test(domain)) ||
			(domain_nosub === "stackpathdns.com" && domain.match(/1tmxd3aba43noa\./))) {
			newsrc = src
				.replace(/\/data\/thumbs\/full\/([0-9]+)\/[0-9]+\/[0-9]+\/[0-9]+\/[0-9]+\/([^/]*)$/, "/data/images/full/$1/$2")
				.replace(/[?#].*$/, "");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "studiosol-a.akamaihd.net") {
			return src
				.replace(/(:\/\/[^/]*\/)([a-z]+)\/[0-9]+x[0-9]+\//, "$1uploadfile/$2/")
				.replace(/-tb_[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "letradamusica.net" && string_indexof(src, "/fotos/") >= 0) {
			return src.replace(/-tb(?:_[0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (amazon_container === "quietus_production") {
			return src.replace(/_crop_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "bmi.com" &&
			string_indexof(src, "/images/") >= 0) {
			return src.replace(/\/cache\/([^/]*)_[0-9]+_[0-9]+_[0-9]+(?:_[a-z]+)?(\.[^/.]*)$/, "/$1$2");
		}
		if (domain === "media.rbl.ms") {
			if (string_indexof(src, "/image?") >= 0) {
				var queries = get_queries(src);
				return urljoin(decodeURIComponent(queries.ho), decodeURIComponent(queries.u));
			}
		}
		if (domain_nowww === "filepicker.io" ||
			domain === "cdn.filestackcontent.com" ||
			domain === "process.fs.grailed.com" ||
			domain === "media.graphcms.com" ||
			domain === "blog.cdn.own3d.tv" ||
			domain === "d1t35hkz8sx2bl.cloudfront.net") {
			newsrc = src
				.replace(/^[a-z]+:\/\/[^/]+\/+(?:[a-zA-Z0-9]{15,}\/+)?(?:(?:(?:[a-z]+=[^/]*|(?:fl[io]p|compress|auto_image))\/+)+|api\/+file\/+)?/, "")
				.replace(/^(?:convert(?:[?#].*)?|[?#.].*)$/, ""); // to remove invalid urls
			if (newsrc !== src && newsrc.length) {
				if (/^[a-z]+:\/\/[^/]+\/+/.test(newsrc))
					return newsrc;
				return urljoin(src, "/" + newsrc, true);
			}
			return {
				url: src.replace(/^([a-z]+:\/\/[^/]+\/+(?:api\/+file\/+)?[0-9a-zA-Z]{15,})\/+convert\?.*/, "$1"),
				head_wrong_contenttype: true
			};
		}
		if (domain === "cdn.teenidols4you.com" ||
			domain === "www.teenidols4you.com") {
			return src.replace(/:\/\/[^/]*\/thumb\/(.*?)\/(?:[0-9]+)?([^/]*)$/, "://www.teenidols4you.com/blink/$1/$2");
		}
		if (domain === "cdn.pixabay.com") {
			newsrc = src.replace(/.*?\/photo\/.*\/([^/]*-[0-9]+)_+[0-9]+[^/]*(\.[^/.]*)$/, "https://pixabay.com/en/photos/download/$1$2");
			obj = {
				url: src,
				redirects: true,
				headers: {
					Referer: "https://pixabay.com/"
				}
			};
			var ret = [obj];
			if (newsrc !== src) {
				var newobj = deepcopy(obj);
				newobj.url = newsrc;
				ret.unshift(newobj);
			}
			return ret;
		}
		if (domain_nosub === "meetupstatic.com") {
			return src
				.replace(/\/photo_api\/([^/]*)\/.*\/([0-9]+\.[^/.]*)$/, "/photos/$1/0/0/0/highres_$2")
				.replace(/\/(?:thumb|[0-9]+)_([0-9]+\.[^/.]*)$/, "/highres_$1");
		}
		if (domain === "d38c5dutwb1t0j.cloudfront.net") return src.replace(/\/Pictures\/[0-9a-z]+x[0-9a-z]+\//, "/Pictures/9999999xany/");
		if (domain === "img.drillspin.com") return src.replace(/(:\/\/[^/]*\/[a-z]+\/)[0-9]+\//, "$1orig/");
		if (domain === "pics.drillspin.com") return src.replace(/\/[0-9]+(\.[^/.]*)$/, "/orig$1");
		if ((domain_nosub === "bestie.vn" && domain.match(/^static[0-9]*\./)) ||
			domain === "img.highloadtest.com" ||
			domain === "cdn.sinemia.com") {
			return src.replace(/(:\/\/[^/]*\/)[0-9]+x[0-9]+\//, "$1");
		}
		if (domain === "cdn.britannica.com") return src.replace(/(:\/\/[^/]*\/)(?:s:)?[0-9]+x[0-9]+(?:,[^/]+)?\//, "$1");
		if (domain === "cdn.awsli.com.br") return src.replace(/(:\/\/[^/]+\/+)[0-9]+x[0-9]+\/+([0-9]+\/+[0-9]+\/+)/, "$1$2");
		if (domain_nowww === "pets4homes.co.uk") return src.replace(/(\/images\/[^/]+\/[0-9]+\/)[a-z]+\/([^/]*)$/, "$1original/$2");
		if (domain === "r.hswstatic.com") return src.replace(/:\/\/[^/]*\/[a-z]_[0-9]+\//, "://s.hswstatic.com/");
		if (domain === "images.woovly.com") return src.replace(/(:\/\/[^/]+\/+)[wh]_[0-9]+\/+/, "$1");
		if (domain_nowww === "candb.com") return src.replace(/(\/candb\/)cache\/([^/]*\/)[0-9]+\/([^/]*)_[0-9]+x[0-9]+(?:[^/]*)?(\.[^/.]*)$/, "$1images/$2$3$4");
		if (domain_nowww === "ottawalife.com") return src.replace(/\/cms\/images\/[a-z]+\//, "/cms/images/large/");
		if (domain === "assets.rpgsite.net") return src.replace(/(\/images\/[0-9]+\/[0-9]+\/[0-9]+\/)[a-z]+\/([^/]+)$/, "$1original/$2");
		if (domain_nowww === "nusabali.com") return src.replace(/(\/article_images\/[0-9]+\/[^/]*)-(?:thumb|800)(-[0-9]+-[0-9]+-[0-9]+-[0-9]+_[0-9]+\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "wowkeren.com") {
			return src
				.replace(/\/display\/images\/[0-9]+x[0-9]+\//, "/display/images/photo/")
				.replace(/\/images\/events\/[^/]*\//, "/images/events/ori/");
		}
		if (domain === "m.aceshowbiz.com" ||
			domain_nowww === "aceshowbiz.com") {
			newsrc = src
				.replace(/(\/display\/images\/)[0-9]+x[0-9]+\//, "$1/photo/")
				.replace(/(\/images\/[^/]*\/)preview\//, "$1");
			if (newsrc !== src)
				return newsrc;
			regex = /\/images\/+news-thumb\/+[0-9]{4}\/+[0-9]{2}\/+/;
			if (regex.test(src))
				return [
					src.replace(regex, "/images/wennpic/"),
					src.replace(regex, "/images/news/")
				];
		}
		if (domain === "asset.kompas.com" ||
			domain === "assets.pikiran-rakyat.com" ||
			(domain_nosub === "grid.id" && domain.match(/^asset(?:-[a-z]*)?\./))) {
			return src
				.replace(/\/crop\/[0-9x:]+\/[0-9]*x[0-9]*\//, "/")
				.replace(/\/crops\/+.*\/+(data\/+photo\/+)/, "/$1");
		}
		if (domain === "cdn.thinglink.me") return src.replace(/(\/api\/image\/[0-9a-zA-Z]+)\/.*$/, "$1");
		if (domain === "images.sk-static.com") {
			return {
				url: src.replace(/(\/[0-9]+\/)[a-z_]+$/, "$1original"),
				head_wrong_contenttype: true
			};
		}
		if (domain === "www.stalkcelebs.com" && string_indexof(src, "/img-folder/") >= 0) {
			return src.replace(/_t(_[0-9]+\.[^/.]*)$/, "$1");
		}
		if (domain === "www.picsofcelebrities.com") return src.replace(/\/media(\/.*\/pictures\/)[a-z]+(\/[^/]*)$/, "$1large$2");
		if (domain === "dxglax8otc2dg.cloudfront.net") return src.replace(/\/media\/cache\/(.*)[-_]thumb\.[a-f0-9]+(\.[^/.]*)$/, "/media/$1$2");
		if (domain_nosub === "smugmug.com" ||
			domain === "photos.smugmug.com") {
			if (/\/img\/+spacer\.gif(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			regex = /(\/i-[A-Za-z0-9]+\/+[0-9]+\/+(?:[^/]+\/+)?)(?:[A-Z0-9x]+|Ti)(\/+[^/]*)(?:\?.*)?$/;
			newsrc = src.replace(regex, "$1O$2");
			obj = {
				url: src
			};
			if (newsrc !== src) {
				if (options.do_request) {
					common_functions["get_redirect_url"](api_cache, options, newsrc, options.cb);
					return {
						waiting: true
					};
				} else {
					return newsrc;
				}
			}
			if (options.force_page && options.do_request && options.cb && (newsrc !== src || regex.test(src))) {
				var get_original_page = function(imageid, cb) {
					api_cache.fetch("smugmug_original_page:" + imageid, cb, function(done) {
						options.do_request({
							method: "GET",
							url: "https://washingtonlife.smugmug.com/A/" + imageid + "/A",
							onload: function(result) {
								if (result.readyState !== 4)
									return;
								var match = result.responseText.match(/document\.location\.href\s*=\s*["'](.*?)["']/);
								if (match) {
									return done(match[1], 6 * 60 * 60);
								}
								done(null, false);
							}
						});
					});
				};
				match = src.match(/\/(i-[A-Za-z0-9]+)\/+[0-9]+\/+/);
				if (match) {
					get_original_page(match[1], function(originalpage) {
						if (originalpage)
							obj.extra = { page: originalpage };
						options.cb(obj);
					});
					return {
						waiting: true
					};
				}
			}
			return obj;
		}
		if (domain_nosub === "lithium.com" && string_indexof(domain, ".i.lithium.com") >= 0 ||
			domain === "answers.ea.com" ||
			(domain_nosub === "samsung.com" && /^(?:[^.]+\.)?community\.samsung\./.test(domain)) ||
			domain === "community.amd.com" ||
			domain === "community.spotify.com" ||
			domain === "nasz.orange.pl" ||
			/^[a-z]+:\/\/[^/]+\/+t5\/+image\/+serverpage\/+image-id\/+[0-9]+i[0-9A-F]+\//.test(src)) {
			var v = src.replace(/.*[?&](v=[^&]*).*/, "$1");
			if (v === src)
				v = "";
			else
				v = "?" + v;
			return {
				url: src.replace(/(\/image-id\/+[0-9]+i[0-9A-F]+)\/+image-size\/.*(?:\?.*)?$/, "$1" + v),
				head_wrong_contentlength: true
			};
		}
		if (domain === "www.favepeople.com") return src.replace(/(\/photos\/[0-9a-z]+\/[0-9a-z]+\/[0-9a-z]+)(?:_[a-z]+)?(\/[^/]*)?(\.[^/.]*)$/, "$1_b$2$3");
		if (domain === "img.anews.com") {
			newsrc = src.replace(/.*\?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
			return src.replace(/\/r\/[0-9]+x[0-9]+\//, "/media/posts/images/");
		}
		if (domain_nosub === "5ce.com" && /^img(?:-[0-9]+)\.proxy\./.test(domain)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+\?(?:.*?&)?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "immagini.quotidiano.net" ||
			domain === "safeimage.vusercontent.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+\?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "realitytvworld.com" ||
			domain === "cdn.realitytvworld.com") {
			newsrc = src.replace(/(\/images\/+gallery\/+[0-9]+)-[a-z](\.[^/.]*)(?:[?#].*)?$/, "$1-o$2");
			if (newsrc !== src)
				return newsrc;
			regex = /(\/heads\/gen\/embedded\/[0-9]+)-[a-z](\.[^/.]*)$/;
			return [
				src.replace(regex, "$1-a$2"),
				src.replace(regex, "$1-l$2")
			];
		}
		if (domain === "video.newsserve.net" ||
			domain === "cdn.newsserve.net") {
			return src.replace(/(:\/\/[^/]*\/)[0-9]+\//, "$1");
		}
		if (domain_nowww === "laughspark.info") return src.replace(/\/thumbfiles\/[0-9]+X[0-9]+\//, "/uploadfiles/");
		if (domain_nosub === "giphy.com" && domain.match(/^(?:media[0-9]*|i)\./)) {
			var baseobj_4 = {
				url: src,
				headers: {
					Referer: "https://giphy.com/"
				}
			};
			obj = baseobj_4;
			match = src.match(/\/media\/+([^/]{10,})\/+/);
			if (match) {
				var get_giphy_page = function(id) {
					return "https://giphy.com/gifs/" + id;
				};
				id = match[1];
				var page = get_giphy_page(id);
				baseobj_4.extra = { page: page };
				var query_giphy = function(id, cb) {
					var cache_key = "giphy:" + id;
					api_cache.fetch(cache_key, cb, function(done) {
						options.do_request({
							url: get_giphy_page(id),
							method: "GET",
							headers: {
								Referer: ""
							},
							onload: function(result) {
								if (result.readyState !== 4)
									return;
								if (result.status !== 200) {
									console_error(result);
									return done(null, false);
								}
								var match = result.responseText.match(/<script>\s*Giphy\.renderDesktop\(.*?{\s*gif:\s*({.+}),/);
								if (match) {
									try {
										var json = JSON_parse(match[1]);
										return done(json, 6 * 60 * 60);
									} catch (e) {
										console_error(e);
									}
								} else {
									console_warn("No match found", result);
								}
								done(null, false);
							}
						});
					});
				};
				if (options && options.do_request && options.cb) {
					query_giphy(id, function(data) {
						if (!data) {
							return options.cb(null);
						}
						var images = data.images;
						var get_image = function(obj) {
							var ourobj = deepcopy(baseobj_4);
							ourobj.url = obj.url;
							return ourobj;
						};
						if (images.source) {
							return options.cb(get_image(images.source));
						} else {
							return options.cb(null);
						}
					});
					return {
						waiting: true
					};
				}
			}
			if (false) {
				newsrc = src.replace(/:\/\/media[0-9]*\./, "://i.");
				if (newsrc !== src) {
					obj.url = newsrc;
					return obj;
				}
				newsrc = src.replace(/\/(?:giphy|[0-9]+[whs_]*)\.(?:gif|webp|mp4)/, "/source.mp4");
				if (newsrc !== src) {
					obj.url = newsrc;
					return obj;
				}
			}
			return obj;
		}
		if (domain === "www.showgle.co.kr" && string_indexof(src, "/uploads/") >= 0) {
			return src.replace(/(\/[0-9a-f]+)_[a-z](\.[^/.]*)$/, "$1$2");
		}
		if (domain === "photos.modelmayhem.com") {
			newsrc = src
				.replace(/(\/photos\/[0-9]+\/[0-9a-f]+\/[0-9a-f]+)_[a-z](\.[^/.]*)$/, "$1$2")
				.replace(/(\/potd\/entrants\/[0-9]+\/[^/]*)-[a-z]+(\.[^/.]*)$/, "$1-big$2")
				.replace(/(\/avatars\/+(?:[0-9]\/+){1,}[0-9a-f]+)_x?t(\.[^/.]+)(?:[?#].*)?$/, "$1_m$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (host_domain_nosub === "modelmayhem.com" && options.element) {
			if (!src) {
				var current = options.element;
				while ((current = current.parentElement)) {
					if (current.tagName === "DIV" && current.id === "viewpic") {
						var og_image_meta = document.querySelector("meta[property=\"og:image\"]");
						if (og_image_meta) {
							return og_image_meta.getAttribute("content");
						}
						break;
					}
				}
			}
			var query_picid = function(picid, cb) {
				var cache_key = "modelmayhem:" + picid;
				api_cache.fetch(cache_key, cb, function(done) {
					options.do_request({
						url: "https://www.modelmayhem.com/portfolio/pic/" + picid,
						method: "GET",
						onload: function(resp) {
							if (resp.readyState !== 4)
								return;
							if (resp.status !== 200) {
								console_error(cache_key, resp);
								return done(null, false);
							}
							var match = resp.responseText.match(/<meta\s+property="og:image"\s+content="([^"]+)"/);
							if (!match) {
								console_error(cache_key, "Unable to find match", resp);
								return done(null, false);
							}
							return done(decode_entities(match[1]), 24 * 60 * 60);
						}
					});
				});
			};
			var get_picid_from_url = function(url) {
				return url.replace(/.*\/portfolio\/+pic\/+([0-9]+)(?:[?#].)?$/, "$1");
			};
			if (options.do_request && options.cb) {
				var parent = options.element.parentElement;
				if (parent && parent.tagName === "A" && /\/portfolio\/+pic\/+[0-9]+/.test(parent.href)) {
					query_picid(get_picid_from_url(parent.href), function(newsrc) {
						if (newsrc) {
							var obj = {
								url: newsrc
							};
							if (/\/images\/+nopic_worksafe-on\./.test(src)) {
								obj.can_cache = false;
							}
							options.cb(obj);
						} else {
							options.cb(null);
						}
					});
					return {
						waiting: true
					};
				}
			}
		}
		if (domain === "static.artbible.info") return src.replace(/(:\/\/[^/]*\/)[a-z]+\//, "$1large/");
		if (domain_nosub === "oclc.org" && domain.match(/\.contentdm\./) ||
			domain === "digital.denverlibrary.org") {
			newsrc = src
				.replace(/\/+digital\/+api\/+singleitem\/+image\/+([^/]*\/+[0-9]+)\/+.*(\.[^/.?#]*)(?:[?#].*)?$/, "/digital/iiif/$1/full/full/0/default$2")
				.replace(/\/+digital\/+download\/+collection\/+([^/]*)\/(?:.*\/)?id\/+([0-9]+).*?$/, "/digital/api/singleitem/image/$1/$2/default.jpg");
			if (newsrc !== src)
				return newsrc;
			if (src.match(/:\/\/[^/]*\/+utils\/+ajaxhelper\/+/)) {
				var queries = get_queries(src);
				var folder = queries.CISOROOT;
				var id = queries.CISOPTR;
				return src.replace(/(:\/\/[^/]*\/).*$/, "$1digital/api/singleitem/image/" + folder + "/" + id + "/default.jpg");
			}
		}
		if (domain === "tools.wmflabs.org") {
			newsrc = src.replace(/(\/zoomviewer\/+iipsrv\.fcgi\/+\?(?:.*&)?iiif=[^/]+\/+[^/]+\/+)[^/]+\/[^/]+\/[^/]+\/([^/]+\.[^/.]*)$/, "$1full/full/0/$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "koodtv.com" ||
			domain_nowww === "hanimusic.com") {
			return src.replace(/\/thumb-([^/.]*)_[0-9]+x[0-9]+(\.[^/.]*)$/, "/$1$2");
		}
		if (domain === "file.bodnara.co.kr") {
			return decodeURIComponent(src.replace(/.*?\/insidelogo\.php.*?[?&]image=([^&]*).*$/, "$1")).replace(/^\/*/, "");
		}
		if (domain === "passport.mobilenations.com" ||
			(domain_nowww === "timpul.md" && string_indexof(src, "/uploads/") >= 0)) {
			return src.replace(/\/[0-9]+x[0-9]+_([^/]*\.[^/.]*)$/, "/$1");
		}
		if (domain === "www.dollargeneral.com" &&
			string_indexof(src, "/media/") >= 0) {
			return src.replace(/\/cache\/(?:image|thumbnail)\/[0-9]+x[0-9]+\//, "/cache/image/");
		}
		if (domain === "www.dollartree.com" &&
			string_indexof(src, "/assets/") >= 0) {
			return src.replace(/\/styles\/[^/]*\/([^/]*)$/, "/styles/jumbo/$1");
		}
		if (domain === "d2192bm55jmxp1.cloudfront.net") return src.replace(/\/resize\/[a-z]+\//, "/origin/");
		if (domain === "i.marieclaire.com.tw") {
			newsrc = src.replace(/\/[0-9]+X[0-9]+\/([0-9A-F]+\.[^/.]*)$/, "/$1");
			if (newsrc !== src) {
				return [newsrc.replace(/\.jpg$/, ".jpeg"), newsrc];
			}
		}
		if (domain === "ir.marieclaire.com.tw") return src.replace(/:\/\/[^/]*\/(?:[a-z][0-9]+){1,}\/+assets\/+/, "://i.marieclaire.com.tw/assets/");
		if (domain === "img.vogue.com.tw" ||
			domain === "dw6vrgax4fzym.cloudfront.net" ||
			domain === "img.gq.com.tw") {
			return src
				.replace(/\/_rs\/[0-9]+\//, "/")
				.replace(/\/userfiles\/(?:sm|thumbnail)\/sm[0-9]+_images/, "/userfiles/images");
		}
		if (domain === "niuerdata.donews.com" ||
			domain === "niuerdata.g.com.cn") {
			return src
				.replace(/\/new_thumb\//, "/big_media_img/")
				.replace(/\/thumb_([0-9a-f]+\.[^/.]*)$/, "/$1");
		}
		if (domain === "pictures.icpress.cn") return src.replace(/s(\.[^/.]*)$/, "$1");
		if ((domain === "interview365.mk.co.kr" &&
			string_indexof(src, "/images/") >= 0)) {
			return src.replace(/(\/[0-9]+_)[A-Z](_[0-9]+\.[^/.]*)$/, "$1L$2");
		}
		if (domain === "draw.acharts.net") return src.replace(/-[a-z](\.[^/.]*)$/, "-l$1");
		if (domain === "gqhotstuff.gq.com.mx") return src.replace(/\/api\/photos\/[a-z]+\//, "/api/photos/original/");
		if (domain === "images.apester.com") {
			return {
				url: src.replace(/(:\/\/[^/]*\/[^/]*\.[^/.]*)\/[/a-z0-9]+$/, "$1"),
				head_wrong_contentlength: true
			};
		}
		if (domain === "twt-thumbs.washtimes.com") return src.replace(/(:\/\/twt-)thumbs(\.[^/]*\/media\/(?:image|img)\/.*?)_[cs][0-9][-_0-9a-z]+(\.[^/.?]*)(?:\?.*)?$/, "$1media$2$3");
		if (domain === "dynamicmedia.zuza.com") {
			return src
				.replace(/\/zz\/m\/[^/]*\//, "/zz/m/original_/")
				.replace(/(\.[0-9]*(?:-[0-9]+)?)_[^-./]*(\.[^/.]*)$/, "$1$2");
		}
		if (domain === "images.commeaucinema.com") return src.replace(/\/galerie\/([^/]*)$/, "/galerie/big/$1");
		if (domain === "static.screenweek.it" ||
			amazon_container === "static.screenweek.it") {
			return src.replace(/_[a-z]+(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "goodblud.com") return src.replace(/(\/media\/+mppicture\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9]+_[-0-9a-f]{30,})_mid(\.[^/.]*)(?:[?#].*)?$/, "$1_big$2");
		if (domain === "da4pli3l5vc0d.cloudfront.net") return src.replace(/(:\/\/[^/]*\/(?:(?:[0-9a-f]{2})\/){2}[0-9a-f]+)\/.*$/, "$1");
		if (domain_nosub === "hollywood.com" && domain.match(/photo\.media[0-9]*\.hollywood\.com/)) {
			return src.replace(/(:\/\/[^/]*\/)[^/]*\//, "$1full/");
		}
		if (((domain === "www.doodoo.ru" ||
			domain === "www.youloveit.ru" ||
			domain_nowww === "take.az" ||
			domain_nowww === "starmodels.ru" ||
			domain_nowww === "nevseoboi.com.ua" ||
			domain_nowww === "photoofnude.com" ||
			domain_nowww === "hronika.info" ||
			domain_nowww === "qadin.net" ||
			domain_nowww === "allday2.com" ||
			domain_nowww === "tonshuul.mn" ||
			domain_nowww === "animechan.ru" ||
			domain_nowww === "sexs-foto.com" ||
			domain_nowww === "sexs-foto.info" ||
			domain_nowww === "informaplus.ru" ||
			domain_nowww === "modnaya.org" ||
			domain_nowww === "negani.com" ||
			domain_nowww === "chukcha.net" ||
			domain_nowww === "opa.kg" ||
			domain_nowww === "pirojok.net" ||
			domain_nowww === "femanes.ru" ||
			domain_nowww === "vistanews.ru" ||
			domain_nowww === "tour-rest.ru" ||
			domain_nowww === "znamenitka.ru" ||
			domain_nowww === "all-stars.su" ||
			domain_nowww === "kinoukr.com" ||
			domain === "ww22.zone-telechargement.lol" ||
			domain_nowww === "hdxa.me" ||
			domain_nowww === "razdam.net" ||
			domain_nowww === "bugaga.ru") &&
			string_indexof(src, "/uploads/") >= 0) ||
			domain === "cdn.prognozist.ru" ||
			src.match(/^[a-z]+:\/\/[^/]*\/uploads\/posts\/[0-9]{4}-[0-9]{2}\/(?:thumbs|medium)\/[0-9]+(?:_[^/]*)?\.[^/.]*$/) ||
			src.match(/^[a-z]+:\/\/[^/]*\/uploads\/[a-z]+\/(?:[0-9]+x[0-9]+\/)?[0-9]{4}-[0-9]{2}\/thumbs\/[0-9]+x[0-9]+_crop_[0-9]+_[^/]*$/)) {
			newsrc = src.replace(/\/uploads\/[a-z]+\/(?:[0-9]+x[0-9]+\/)?([0-9]+-[0-9]+\/)(?:(?:thumbs|medium)\/)?(?:[0-9]+x[0-9]+_crop_)?([^/]*)$/, "/uploads/posts/$1$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/+posts\/+[0-9]{4}-[0-9]{2}\/+)thumbs\/+/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "henchan.me") return src.replace(/(:\/\/[^/]*\/)[^/]*\/+(uploads\/+posts\/+)/, "$1$2");
		if (domain_nowww === "goldwallpapers.com") return src.replace(/(\/uploads\/posts\/[^/]*\/)thumb\/([^/]*)$/, "$1$2");
		if (domain_nowww === "tooob.com" &&
			string_indexof(src, "/api/") >= 0) {
			return src.replace(/(\/[0-9]+\/)__[^/]*$/, "$1");
		}
		if (domain_nosub === "ask.fm" && domain.match(/akphoto[0-9]*\.ask\.fm/) ||
			domain === "dok7xy59qfw9h.cloudfront.net") {
			return src.replace(/\/[a-z]+\/((?:[0-9]+|.+)\.[^/.]*)$/, "/large/$1");
		}
		if (domain_nosub === "ask.fm" && domain.match(/^akimg[0-9]*\.ask\.fm/) ||
			domain === "d2hhj3gz5jljkm.cloudfront.net" ||
			domain === "d15eldcwi10xcl.cloudfront.net") {
			return src.replace(/\/thumb(?:_big)?\/+([^/]+)(?:[?#].*)?$/, "/normal/$1");
		}
		if (domain === "d2p4y1juxwnww4.cloudfront.net") return src.replace(/(\/(?:[0-9a-f]+\/+){6})thumb\/+/, "$1original/");
		if (domain_nowww === "alchetron.com") return src.replace(/-resize-[0-9]+(\.[^/.]*)$/, "$1");
		if (domain === "img.ltn.com.tw") {
			return src
				.replace(/(\/Upload\/+(?:[a-z]+\/+page|news)\/+)[0-9]+[A-Z]?\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+)/, "$1orig/$2")
				.replace(/\/Upload\/+style\/+bphoto\/+[^/]+\/+/, "/Upload/style/bphoto/original/");
		}
		if (domain_nosub === "lystit.com" && domain.match(/cdn[a-z]?\.lystit\.com/)) {
			return src.replace(/(:\/\/[^/]*\/)[0-9]+\/[0-9]+\/[0-9a-z]+\/photos\//, "$1photos/");
		}
		if (domain === "www.newshub.co.nz") {
			return {
				url: src.replace(/(\/image(?:[_.][0-9]+)?\.dynimg\.)[^/]*(\.q[0-9]+\.[^/.]*)(\/.*)?$/, "$1full$2$3"),
				can_head: false
			};
		}
		if (amazon_container === "s3.931wolfcountry.com" ||
			domain === "assets.instyle.co.uk" ||
			domain === "d2nzqyyfd6k6c7.cloudfront.net" ||
			(amazon_container && amazon_container.match(/^s3(?:\.[^/]*)?\.radio\.com$/)) ||
			domain === "qtxasset.com" ||
			amazon_container === "wpr-public" ||
			amazon_container === "prod-media.gameinformer.com" ||
			domain === "community-content-assets.minecraft.net" ||
			domain === "cdn-s3.si.com" ||
			(domain_nosub === "hercampus.com" && domain.match(/^cdn[0-9]*\./)) ||
			amazon_container === "southbank-ipcmedia-com" ||
			domain === "cdn.newsbusters.org" ||
			amazon_container === "radioimg" ||
			amazon_container === "b2bm" ||
			amazon_container === "looppacificassets" ||
			amazon_container === "botw-pd" ||
			amazon_container === "cartoons-s3" ||
			domain === "static.cdn.turner.com" ||
			amazon_container === "kpopimg") {
			newsrc = src.replace(/\/styles\/+[^/]+\/+s3(?:fs)?\//, "/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "s-nbcnews.com" && domain.match(/media[0-9]*\.s-nbcnews\.com/)) {
			return src.replace(/(:\/\/[^/]*\/)j(\/.*\/[^/.]*)[^/]*(\.[^/.]*)$/, "$1i$2$3");
		}
		if (domain === "imgcp.aacdn.jp") return src.replace(/\/img-a\/[0-9a-z]+\/[0-9a-z]+\//, "/img-a/auto/auto/");
		if (domain_nowww === "kpopselca.com") return src.replace(/\/selca\/thumb\//, "/selca/");
		if (domain_nowww === "koogle.tv") return src.replace(/\/\.thumbnails\/([^/]*)-[0-9]+x[0-9]+(\.[^/.]*)$/, "/$1$2");
		if (domain_nowww === "fanaru.com" ||
			domain_nowww === "stuffpoint.com") {
			return src.replace(/\/image\/thumb\//, "/image/");
		}
		if (domain === "d9nvuahg4xykp.cloudfront.net" ||
			domain === "d1w8cc2yygc27j.cloudfront.net") {
			return src.replace(/_thumbnail(\.[^/.]*)$/, "$1");
		}
		if (domain === "i.lihkg.com" ||
			domain_nowww === "f3img.gq") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/[0-9]+\/http/, "http");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "24minus.ru") return src.replace(/^[a-z]+:\/\/[^/]+\/+[0-9]+\/+[0-9]+\/+(https?)\/+(.*)/, "$1://$2");
		if (domain_nowww === "f3img.gq") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/[0-9]*.*?[?&]u=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "www.nintendoworldreport.com" &&
			string_indexof(src, "/media/") >= 0) {
			return src.replace(/\/gallery\/([0-9]+\.[^/.]*)$/, "/$1");
		}
		if (domain_nowww === "nintendoeverything.com" &&
			string_indexof(src, "/gallery/") >= 0) {
			return src.replace(/\/thumbs\/thumbs_([^/]*)$/, "/$1");
		}
		if (domain === "images.nintendolife.com") {
			return src
				.replace(/(\/attachment\/[^/]*\/)[^/]+(\.[^/.]*)$/, "$1original$2")
				.replace(/(:\/\/[^/]+\/+[0-9a-f]{5,}\/+(?:[^/]+\.)?)(?:cover_)?(?:[0-9]*x[0-9]*|large|cover)(\.[^/.]+)(?:[?#].*)?$/, "$1original$2");
		}
		if (domain === "cdn.igromania.ru") return src.replace(/(\/[0-9a-f]+)(?:_[^-_/.]*)?(\.[^/.]*)$/, "$1_original$2");
		if (domain === "i.blogs.es") return src.replace(/\/[0-9]+_[0-9]+(\.[^/.]*)$/, "/original$1");
		if (domain_nosub === "rbl.ms") {
			newsrc = src.replace(/.*\/image.*?[?&]source=([^&]*).*/, "$1");
			if (newsrc !== src) {
				return decodeURIComponent(newsrc);
			}
			newsrc = src.replace(/.*?\/simage\/([^/]*)\/.*/, "$1");
			if (newsrc !== src) {
				return decodeURIComponent(newsrc);
			}
		}
		if (domain === "resize-rbl-ms.cdn.ampproject.org" ||
			(domain_nosub === "ampproject.org" && domain.match(/\.cdn\.ampproject/))) {
			return src.replace(/^[a-z]+:\/\/[^/]*\/(?:ii\/[wh][0-9]+|i)\/s\/([^/]+\.[^/]+\/[^?#]+)(?:[?#].*)?$/, "http://$1");
		}
		if (domain === "assets.rbl.ms") return src.replace(/(:\/\/[^/]*\/[0-9]+\/)[^/.]*(\.[^/.]*)$/, "$1origin$2");
		if (domain === "i.paigeeworld.com" ||
			domain === "d395qfwg4461au.cloudfront.net") {
			return src.replace(/(\/user-(?:uploads|media\/[0-9]+)\/[0-9a-f]+_[0-9a-f]+_)[^/.]*(\.[^/.]*)$/, "$1rz$2");
		}
		if (domain === "1d31c772ec21a65b0a71-0707aae3004193da193e1ad4a942592d.ssl.cf2.rackcdn.com") return src.replace(/(:\/\/[^/]*\/[0-9]+\/[^/.]*)__[^_/.]*(\.[^/.]*)$/, "$1$2");
		if (domain === "i.nextmedia.com.au") {
			return decodeURIComponent(src.replace(/.*\/Utils\/ImageResizer\.ashx.*?[?&]n=([^&]*).*?$/, "$1"));
		}
		if ((domain_nosub === "heritagestatic.com" && /^dyn[0-9]*\.heritagestatic\.com/.test(domain)) ||
			domain === "prodimage.images-bn.com" ||
			(domain_nosub === "hm.com" && /^lp[0-9]*\./.test(domain)) ||
			domain === "images.biglots.com") {
			if (/[?&](?:set|source)=/.test(src)) {
				var querystring = src.replace(/.*?\?/, "");
				var splitted = querystring.split("&");
				var newkvs = {};
				var rawkvs = [];
				var parse_command = function(value) {
					var match = value.match(/^([a-z_A-Z]+)\[([^\]]*)\]?$/);
					if (!match) {
						return null;
					}
					return {
						cmd: match[1],
						arg: decodeURIComponent(match[2])
					};
				};
				array_foreach(splitted, function(query) {
					var key = query.replace(/=.*$/, "");
					var value = decodeURIComponent(query.replace(/^.*?=/, ""));
					if (key === "set") {
						var setcmds = value.split(",");
						var local_kvs = {};
						array_foreach(setcmds, function(setcmd) {
							var parsed_command = parse_command(setcmd);
							if (!parsed_command) {
								console_error("Unable to parse command:", setcmd, setcmds);
								return false;
							}
							local_kvs[parsed_command.cmd] = parsed_command.arg;
						});
						if (local_kvs["key"]) {
							newkvs[local_kvs["key"]] = {
								value: local_kvs["value"],
								type: "kv"
							};
							delete local_kvs["key"];
							delete local_kvs["value"];
						}
						for (var lkey in local_kvs) {
							newkvs[lkey] = {
								value: local_kvs[lkey],
								type: "string"
							};
						}
					} else {
						var parsed_command = parse_command(value);
						if (!parsed_command) {
							console_warn("Unable to parse command:", parsed_command, value);
							rawkvs.push(query);
							return;
						}
						newkvs[key] = {
							value: parsed_command.arg,
							type: parsed_command.cmd
						};
					}
				});
				console_log(newkvs);
				delete newkvs.scale;
				delete newkvs.sizedata;
				delete newkvs.rotate;
				var imageurls = [];
				if (newkvs.source && newkvs.source.type === "url") {
					imageurls.push(newkvs.source.value);
				}
				if (newkvs.imageURL) {
					if (domain === "images.biglots.com") {
						newkvs.imageURL.value = urljoin("https://www.biglots.com/", newkvs.imageURL.value, true);
						newkvs.imageURL.type = "url";
					}
					imageurls.push(newkvs.imageURL.value);
				}
				var modified_size = false;
				if ("resolve.width" in newkvs)
					newkvs["resolve.width"].value = 99999;
				if ("resolve.height" in newkvs)
					newkvs["resolve.height"].value = 99999;
				if (modified_size)
					newkvs["resolve.allowImageUpscaling"].value = 0;
				if ("resolve.pixelRatio" in newkvs)
					newkvs["resolve.pixelRatio"].value = 1;
				if ("quality" in newkvs) {
					if (/^[0-9]{1,2}$/.test(newkvs["quality"].value))
						newkvs["quality"].value = 100;
				}
				if ("res" in newkvs && domain_nosub === "hm.com") {
					var resvalue = newkvs["res"].value;
					if (resvalue === "s" || // 564x846
						resvalue === "m" || // 1536x2304
						resvalue === "l") // 2160x3240
						newkvs["res"].value = "x"; // 2280x4320
				}
				if ("call" in newkvs && domain_nosub === "hm.com") {
					newkvs["call"].value = newkvs["call"].value
						.replace(/product\/main$/, "product/fullscreen")
						.replace(/product\/(?:thumb|small|medium|large)$/, "product/full");
				}
				var newqueries = [];
				var sets = [];
				for (var key_2 in newkvs) {
					var objvalue = newkvs[key_2];
					if (objvalue.type === "kv") {
						newqueries.push("set=" + encodeURIComponent("key[" + key_2 + "],value[" + objvalue.value + "]"));
					} else if (objvalue.type === "string") {
						sets.push([key_2, objvalue.value]);
					} else {
						newqueries.push(key_2 + "=" + encodeURIComponent(objvalue.type + "[" + objvalue.value + "]"));
					}
				}
				if (sets.length > 0) {
					var setkvs_1 = [];
					array_foreach(sets, function(kv) {
						setkvs_1.push(kv[0] + "[" + kv[1] + "]");
					});
					newqueries.unshift("set=" + encodeURIComponent(setkvs_1.join(",")));
				}
				querystring = newqueries.join("&");
				newsrc = src.replace(/\?.*/, "?" + querystring);
				if (newsrc !== src)
					return {
						url: newsrc,
						can_head: false
					};
				if (imageurls.length > 0)
					return imageurls;
				return {
					url: src,
					can_head: false
				};
			}
		}
		if (domain_nowww === "natedsanders.com" && string_indexof(src, "/ItemImages/") >= 0) {
			return src.replace(/(\/[0-9a-z]+)_[a-z]+(\.[^/.]*)$/, "$1_lg$2");
		}
		if (domain === "d1x0dndjbjw02n.cloudfront.net" ||
			amazon_container === "static.lovely-media.jp" ||
			amazon_container === "static.cdn.xtreeem.com" ||
			amazon_container === "cdn.bibi-star.jp" ||
			amazon_container === "cdn.panda-gossips.com") {
			return src.replace(/(\/(?:[0-9]{3}\/+){3})[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		}
		if (domain === "summary-sv.fc2.com") {
			return decodeURIComponent(src.replace(/.*?\/api\/resize_img\.php.*?[?&]src=([^&]*).*?$/, "$1"));
		}
		if (domain === "c.fc2.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+imgs\/+(http[^/]*)\/*$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "image.tmdb.org" ||
			domain_nowww === "themoviedb.org") {
			return src.replace(/\/[wh][0-9]+(?:_and[^/]*)?\/+([0-9a-zA-Z]+\.[^/.]*)$/, "/original/$1");
		}
		if (domain_nowww === "lookmovie.ag") return src.replace(/(\/images\/+[bpf]\/+)[wh][0-9]+\/+([0-9a-f]{10,}\.)/, "$1original/$2");
		if (domain === "embedly.massrelevance.com") {
			return decodeURIComponent(src.replace(/.*\/image.*?[?&]url=([^&]*).*?$/, "$1"));
		}
		if (domain === "media.lolusercontent.com") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/api\/embedly\/1\/image\/resize.*?[?&]url=([^&]*).*?$/, "$1"));
		}
		if (domain === "img.day.az" ||
			domain === "img.milli.az") {
			newsrc = src.replace(/\/(?:(?:[0-9]+x[0-9]+[a-z]?)|thumb)(\/[^/]*)$/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "publika.az") return src.replace(/(\/storage\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/)[0-9]+x[0-9]+[a-z]?\/([^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "fotos.caras.uol.com.br") return src.replace(/\/media\/images\/[^/]*\//, "/media/images/original/");
		if (domain === "img.uol.com.br") {
			if (/\/_template\/+v1\/+(?:bgs\/+bg_|album\/+seta-nav-)/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nosub === "uol.com.br") {
			newsrc = src.replace(/\/media\/+_versions\/+(.*)_(?:sq|wide)(?:sm|md|lg)\./, "/media/uploads/$1.");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "www.wmj.ru" ||
			domain === "sih.avn.com" ||
			domain_nowww === "ferra.ru" ||
			domain_nowww === "motor.ru" ||
			domain_nowww === "passion.ru") {
			return src.replace(/(:\/\/[^/]*\/)(?:thumb\/)?[0-9]+x[0-9]+\/(?:top\/)?filters:[^/]*\//, "$1");
		}
		if (domain_nosub === "centerblog.net" && string_indexof(domain, "pic.centerblog.net") >= 0) {
			return src.replace(/(:\/\/[^/]*\/)(?:[a-z]\/)?([^/]*)$/, "$1o/$2");
		}
		if (domain === "d2n4wb9orp1vta.cloudfront.net") {
			return src.replace(/;.*/, "");
		}
		if (domain === "gd.image-gmkt.com") return src.replace(/\.[^/.]*(\.[^/.]*)$/, "$1");
		if (domain_nosub === "toonpool.com") {
			return {
				url: src
					.replace(/(\/user\/[0-9]+\/)thumbs\/([^/.]+_[0-9]+)(\.[^/.]*)$/, "$1files/$29$3")
					.replace(/(\/user\/[0-9]+\/)files\/([^/.]+_[0-9]+)[0-9](\.[^/.]*)$/, "$1files/$29$3"),
				problems: {
					watermark: true
				}
			};
		}
		if (domain === "www.cartoonmovement.com") return src.replace(/\/cartoon_thumbnails\//, "/cartoons/");
		if (domain_nosub === "sndimg.com") return src.replace(/(\/[^/.]+\.[^/.]+)\.[^/]*(?:\/[^/]*)?$/, "$1");
		if (domain === "st.hzcdn.com") {
			return src
				.replace(/\/fimgs\/([0-9a-f]+)_([0-9]+)-[^/]*(\.[^/.]*)$/, "/simgs/$1_14-$2$3")
				.replace(/(\/simgs\/[0-9a-f]+)_[0-9]+(-[0-9]+[./])/, "$1_14$2")
				.replace(/\/[fs](imgs\/+pictures\/+.*-img~[0-9a-f]+)_[0-9]+(-[0-9]+)/, "/s$1_14$2");
		}
		if ((domain_nowww === "axisanimation.com" ||
			domain_nowww === "opernhaus.ch" ||
			domain_nowww === "sexo18.net") &&
			string_indexof(src, "/assets/") >= 0) {
			return src.replace(/\.[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain === "media.baselineresearch.com") return src.replace(/(\/[0-9]+_)[a-z]+(\.[^/.]*)$/, "$1full$2");
		if (domain_nowww === "mireportz.com" ||
			domain_nowww === "gameworld.gr" ||
			domain_nowww === "pakistani.pk") {
			return src.replace(/\/photos\/+thumbnail\/+[0-9]+x[0-9]+[a-z]*\//, "/photos/original/");
		}
		if (domain_nosub === "gazeta.pl" && domain.match(/bis?\.gazeta\.pl/)) {
			return src.replace(/(\/z[0-9]+)[A-Z]+(,[^/.]*)?(\.[^/.]*)$/, "$1O$2$3");
		}
		if (domain_nosub === "static6.com" && domain.match(/cdn[0-9]*(-[a-z]+)?\.production\.[^./]*\.static6\.com$/)) {
			newsrc = src.replace(/(:\/\/cdn[0-9]*(?:-[a-z]+)?\.production\.)[^./]*(\.static6\.com)\/.*?\/([^/.-]+)-media-production\/(medias\/)/, "$1$3$2/$4");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "lajt.co.uk") return src.replace(/\/media\/cache\/[0-9]+x[0-9]+\//, "/media/cache/original/");
		if (domain_nowww === "ellearabia.com" ||
			domain_nowww === "national-geographic.pl" ||
			domain_nowww === "ecranlarge.com" ||
			domain === "estaticos.marie-claire.es") {
			return src.replace(/\/+media\/+cache\/+[^/]*\/+/, "/");
		}
		if (domain === "static.t13.cl") {
			match = src.match(/\/images\/+sizes\/+[^/]*\/+([0-9]{8,})-/);
			if (match) {
				var date = new Date(match[1] * 1000);
				return src.replace(/\/images\/+sizes\/+[^/]*\/+/, "/images/original/" + date.getUTCFullYear() + "/" + zpadnum(date.getUTCMonth() + 1, 2) + "/");
			}
			return src.replace(/__[0-9]+x(?:[0-9]+)?(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "cosmo.com.ua") return src.replace(/(\/photos_publication\/[0-9]+\/)[0-9]+_[0-9]+\//, "$1");
		if (domain_nosub === "trrsf.com" && domain.match(/p[0-9]*\.trrsf\.com/)) {
			return src.replace(/^[a-z]+:\/\/[^/]*\/image\/fget\/[^/]*\/(?:(?:[0-9]+\/){4})?(?:fit-in\/+)?[0-9]+\/[0-9]+\//, "http://");
		}
		if (domain === "c.igte.ch" ||
			domain === "img.digitalag.ro") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/.*?[?&]u=([^&]*).*/, "$1"));
		}
		if (domain_nowww === "trendus.com" ||
			domain === "trendus.igte.ch" ||
			domain_nowww === "boxerdergisi.com.tr") {
			return src.replace(/\/PhotoGallery\/+size[0-9]*\//, "/PhotoGallery/original/");
		}
		if (domain === "mediacdn.grabone.co.nz") return src.replace(/(\/asset\/[-_=a-zA-Z0-9]+)\/[a-z]+=.*/, "$1");
		if (domain_nosub === "woman.ru" && domain.match(/i[0-9]*(?:-cdn)?\.woman\.ru/)) {
			return src.replace(/_[0-9]+_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "20minutos.es" && domain.match(/st-[^/.]*\.20minutos\.es/)) {
			return src.replace(/(\/[0-9a-z]+)_[0-9]+px(\.[^/.]*)$/, "$1_original$2");
		}
		if (domain_nosub === "thehunt.com" && domain.match(/cdn[0-9]*\.thehunt\.com/)) {
			return src.replace(/(\/[0-9]+\/)[^/]*\/([0-9a-f]+\.[^/.]*)$/, "$1original/$2");
		}
		if (domain === "hosted.thehun.net") return src.replace(/(\/\.content\/+[0-9a-f]{3}\/+[0-9a-f]{5,}\/+)thumb\./, "$1");
		if (domain_nosub === "devote.se" && domain.match(/static[0-9]*\.devote\.se/)) {
			return src.replace(/\/gallery\/[^/]+\//, "/gallery/big/");
		}
		if (domain_nowww === "vev.ru" &&
			string_indexof(src, "/uploads/images/") >= 0) {
			return src.replace(/(?:_[a-z]+)?(\.[^/.]*)$/, "_original$1");
		}
		if (domain === "s.glbimg.com") return src.replace(/\/[0-9]+x[0-9]+\//, "/original/");
		if (domain === "image.xahoi.com.vn" ||
			domain === "media.tinmoi.vn" ||
			domain === "media.ngoisao.vn") {
			return src.replace(/(:\/\/[^/]*\/)resize_[0-9]+(?:x[0-9]+)?\//, "$1");
		}
		if (domain_nosub === "intermoda.ru" && domain.match(/s[0-9]*\.intermoda\.ru/)) {
			return src.replace(/\/p\/(?:max|h|w)[0-9]*\//, "/p/original/");
		}
		if (domain === "static.life.ru") return src.replace(/__[0-9]+x(?:[0-9]+)?(\.[^/.]*)$/, "$1");
		if (domain === "a.ltrbxd.com") {
			return src
				.replace(/(\/avatar\/+upload\/.*\/avtr)\.[a-z]+([?#].*)?$/, "$1$2")
				.replace(/\/resized\/(.*)-(?:[0-9]+-){4}crop(?:-[0-9]+)?(\.[^/.]*)?$/, "/$1$2");
		}
		if (domain === "images.goodsmile.info") return src.replace(/\/[a-z]+(\/[0-9a-f]+\.[^/.]*)$/, "/original$1");
		if (domain === "dzt1km7tv28ex.cloudfront.net") return src.replace(/_[a-z](\.[^/.]*)$/, "_o$1");
		if (domain_nowww === "celebs-place.com") return src.replace(/(\/(?:gallery|news\/+pics)\/+[^/]*\/+[^/]*)_[a-z](\.[^/.]*)$/, "$1$2");
		if (domain === "static.vfiles.com") {
			return {
				url: src.replace(/(\/image\/media\/[0-9]+\/)[a-z]+(?:\?.*)?$/, "$1original"),
				can_head: false
			};
		}
		if (domain === "img.mediacentrum.sk") return src.replace(/\/gallery\/(?:.*?\/)?[0-9]+(?:_[a-z])?\/([0-9]+\.[^/.]*)$/, "/gallery/original/$1");
		if (domain === "images.says.com") return src.replace(/(\/[0-9]+\/)[a-z_]+_([0-9]+\.[^/.]*)$/, "$1$2");
		if (domain_nosub === "skyrock.net" && /^(?:[0-9]+\.)?wir\./.test(domain)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/.*[?&]im=([^&]*).*$/, "$1");
			if (newsrc !== src)
				return urljoin("https://i.skyrock.net/", decodeuri_ifneeded(newsrc), true);
		}
		if (domain === "i.skyrock.net") {
			return src
				.replace(/(\/pics\/(?:photo_)?[0-9]+)_[a-z]+((?:_[0-9]+)?\.[^/.]*)$/, "$1$2")
				.replace(/(\/pics\/[0-9]+)_[0-9]_([0-9]+_[A-Za-z0-9]+\.[^/.]*)$/, "$1_1_$2");
		}
		if (domain === "mgl.skyrock.net") return src.replace(/(\/art\/+[A-Z]+\.[0-9]+\.[0-9]+)\.0(\.[^/.]*)(?:[?#].*)?$/, "$1.1$2");
		if (domain_nowww === "xh.video") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+[ve]\/+([-_a-zA-Z0-9]{2,5})\/*(?:[?#].*)?$/,
				query_for_id: "https://xh.video/v/${id}",
				process: function(done, resp, cache_key) {
					done({
						url: resp.finalUrl,
						is_pagelink: true
					}, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "xh.video" ||
			(domain_nosub === "xhamster.com" || // 1-45?, 500
			domain_nosub === "xhamster.one" ||
			domain_nosub === "xhamster.desi" || // 1-5, 7
			//domain_nosub === "xhamsterpremium.com" ||
			domain_nosub === "openxh.com" ||
			domain_nosub === "openxh1.com" ||
			domain_nosub === "openxh2.com" ||
			domain_nosub === "xhopen.com" ||
			domain_nosub === "xhlocal.com" ||
			domain_nosub === "unlockxh.com" || // 1-5
			domain_nosub === "fullxh.com" ||
			domain_nosub === "xhtotal.com" ||
			domain_nosub === "localxh.com" || // 1-5
			// 1-4
			domain_nosub === "xhofficial.com")) {
			var query_xhamster_hashslug_by_id = function(id, cb) {
				if (/^xh/.test(id))
					return cb(id);
				api_query("xhamster_hashslug:" + id, {
					url: "https://xhamster.com/api/flash.php?/video/info&video_id=" + id,
					headers: {
						Referer: "https://www.xhamster.com/"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					if (!resp.shareUrl) {
						console_error(cache_key, "Unable to find shareUrl in", resp);
						return done(null, false);
					}
					var match = resp.shareUrl.match(/^[a-z]+:\/\/[^/]+\/+(?:videos|embed|x)\/+(?:[^/?#.]*-)?([0-9]+|xh[0-9a-zA-Z]+)(?:[?#].*)?$/);
					if (!match) {
						console_error(cache_key, "Unsupported shareUrl", resp.shareUrl);
						return done(null, false);
					}
					return done(match[1], 6 * 60 * 60);
				});
			};
			var get_xhamster_initials = function(resp) {
				var match = resp.responseText.match(/window\.initials\s*=\s*({.*});/);
				if (!match) {
					console_error("Unable to find initials from", resp);
					return null;
				}
				try {
					var json = JSON_parse(match[1]);
					return json;
				} catch (e) {
					console_error(e, resp);
				}
				return null;
			};
			var query_xhamster_video = function(id, cb) {
				var cache_key = "xhamster:" + id;
				api_cache.fetch(cache_key, cb, function(done) {
					var tested_hashslug = false;
					var do_query = function() {
						options.do_request({
							url: "https://www." + domain_nosub + "/videos/" + id,
							method: "GET",
							onload: function(resp) {
								if (resp.status !== 200) {
									if (/^[0-9]+$/.test(id) && !tested_hashslug) {
										query_xhamster_hashslug_by_id(id, function(hashslug) {
											if (!hashslug || hashslug === id) {
												console_error(cache_key, resp);
												return done(null, false);
											} else {
												tested_hashslug = true;
												id = hashslug;
												do_query();
											}
										});
										return;
									} else {
										console_error(cache_key, resp);
										return done(null, false);
									}
								}
								var initials = get_xhamster_initials(resp);
								if (!initials)
									return done(null, false);
								try {
									var videomodel = initials.videoModel;
									if (videomodel.title && videomodel.pageURL) {
										return done(videomodel, 60 * 60);
									}
								} catch (e) {
									console_error(cache_key, e);
								}
								return done(null, false);
							}
						});
					};
					do_query();
				});
			};
			var get_max_source = function(sources) {
				if (!sources)
					return null;
				var max = 0;
				var maxobj = null;
				for (var quality in sources) {
					var qualityn = parseInt(quality);
					if (!isNaN(qualityn) && qualityn > max) {
						max = qualityn;
						maxobj = sources[quality];
					}
				}
				return maxobj;
			};
			var get_xhamster_photomodel = function(galleryid, photoid, cb) {
				api_query("xhamster_photo:" + photoid, {
					url: "https://" + domain + "/photos/gallery/" + galleryid + "/" + photoid
				}, cb, function(done, resp, cache_key) {
					var initials = get_xhamster_initials(resp);
					if (!initials)
						return done(null, false);
					var gallery = initials.photosGalleryModel;
					var photos = gallery.photos.items;
					var our_photo = null;
					array_foreach(photos, function(photo) {
						api_cache.set("xhamster_photo:" + photo.id, photo, 6 * 60 * 60);
						if (photo.id == photoid) {
							our_photo = photo;
						}
					});
					if (!our_photo) {
						console_error(cache_key, "Unable to find photo from", initials, resp);
						return done(null, false);
					}
					return done(our_photo, 6 * 60 * 60);
				});
			};
			var get_obj_from_xhamster_model = function(model) {
				if (!model)
					return null;
				var baseobj = {
					extra: {
						page: model.pageURL,
						caption: model.titleLocalized || model.title
					}
				};
				var origin = "https://" + domain;
				if (domain_nosub === "xh.video") {
					origin = "https://www.xhamster.com/";
					baseobj.extra.page = baseobj.extra.page.replace(/xh\.video\//, "xhamster.com/");
				}
				var urls = [];
				if ("sources" in model) {
					var goodsources = [
						"mp4",
						"download"
					];
					for (var i = 0; i < goodsources.length; i++) {
						var our_source = goodsources[i];
						var max = get_max_source(model.sources[our_source]);
						if (max) {
							var our_obj = {
								headers: {
									Accept: "*/*",
									Origin: origin,
									Referer: baseobj.extra.page,
									"Sec-Fetch-Dest": "empty"
								},
								url: max,
								video: true
							};
							urls.push(our_obj);
							break;
						}
					}
				}
				if (model.imageURL)
					urls.push(model.imageURL); // for photos
				if (model.thumbURL)
					urls.push(model.thumbURL);
				return fillobj_urls(urls, baseobj);
			};
			newsrc = website_query({
				website_regex: {
					regex: /^[a-z]+:\/\/[^/]+\/+photos\/+gallery\/+([0-9]+)\/+([0-9]+)\/*(?:[?#].*)?$/,
					groups: ["gallery", "id"]
				},
				run: function(cb, match) {
					get_xhamster_photomodel(match.groups.gallery, match.groups.id, function(data) {
						return cb(get_obj_from_xhamster_model(data));
					});
				}
			});
			if (newsrc)
				return newsrc;
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+(?:videos|embed|x)\/+(?:[^/?#.]*-)?([0-9]+|xh[0-9a-zA-Z]+)(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+xembed\.php\?(?:.*&)?video=([0-9]+|xh[0-9a-zA-Z]+)(?:&.*)?(?:#.*)?$/,
					/^[a-z]+:\/\/[^/]+\/+movies\/+([0-9]+)\/+[^/]+\.html(?:[?#].*)?$/
				],
				run: function(cb, match) {
					query_xhamster_video(match[1], function(data) {
						return cb(get_obj_from_xhamster_model(data));
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "xhcdn.com") {
			if (/\/xh-(?:tpl|desktop)[0-9]*\/+images\/+pixel\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nosub === "xhcdn.com" && /^thumb-(?:lvlt|v[0-9]*)\./.test(domain)) {
			match = src.match(/\/a\/+[^/.]{20,}\/+((?:[0-9]{3}\/+){3})/);
			if (match) {
				id = match[1].replace(/\/+/g, "").replace(/^0+/, "");
				return "https://www.xhamster.com/videos/" + id;
			}
		}
		if (domain_nosub === "xhcdn.com" && /^thumb-(?:lvlt|p[0-9]*)\./.test(domain) &&
			options.element &&
			(host_domain_nosub === "xhamster.com" || // 1-45?, 500
			host_domain_nosub === "xhamster.one" ||
			host_domain_nosub === "xhamster.desi" || // 1-5, 7
			//host_domain_nosub === "xhamsterpremium.com" ||
			host_domain_nosub === "openxh.com" ||
			host_domain_nosub === "openxh1.com" ||
			host_domain_nosub === "openxh2.com" ||
			host_domain_nosub === "xhopen.com" ||
			host_domain_nosub === "xhlocal.com" ||
			host_domain_nosub === "unlockxh.com" || // 1-5
			host_domain_nosub === "fullxh.com" ||
			host_domain_nosub === "xhtotal.com" ||
			host_domain_nosub === "localxh.com" || // 1-5
			// 1-4
			host_domain_nosub === "xhofficial.com")) {
			newsrc = common_functions["get_pagelink_el_matching"](options.element, /^[a-z]+:\/\/[^/]+\/+photos\/+gallery\/+[0-9]+\/+[0-9]+/);
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "netease.com" && domain.match(/img[0-9]*\.cache\.netease\.com/)) {
			return src
				.replace(/[?#].*$/, "")
				.replace(/\/(?:[a-z]|[0-9]+x[0-9]+)_([^/]*)$/, "/$1")
				.replace(/_[0-9]+(\.[^/.]*)$/, "$1")
				.replace(/\.[0-9]+x\.[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain === "img.lengding.cn") return src.replace(/.*?\/getImage\.php.*?[?&]url=(.*)$/, "$1");
		if (domain === "cdn.sabay.com") return src.replace(/:\/\/[^/]+\/cdn\/([a-z]+\.[a-z]+\.[a-z]+\/)/, "://$1");
		if (domain === "media.sabay.com") return src.replace(/_[a-z]+(\.[^/.]*)$/, "$1");
		if (domain === "s.olj.me" ||
			(domain === "static.addiyar.com" && string_indexof(src, "/storage/attachments/") >= 0) ||
			(domain_nosub === "annahar.com" && domain.match(/^static[0-9]*\.annahar/) && string_indexof(src, "/storage/attachments/") >= 0)) {
			return src.replace(/(\/storage\/+attachments\/+[0-9]+\/+[^/]*_[0-9]+)(?:_(?:large|thumbnail))?(\.[^/.]*)(?:\/+r\/+[0-9]+)?(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "binaryapi.ap.org") {
			return {
				url: src,
				can_head: false
			};
		}
		if (domain_nosub === "ekladata.com") return src.replace(/@[0-9]+x(?:[0-9]+)?(\.[^/.]*)$/, "$1");
		if (domain === "img.geinoueroch.com" ||
			domain === "image.hoopchina.com" ||
			(domain === "san.imatin.net" && string_indexof(src, "/images/") >= 0) ||
			(domain_nowww === "kandamori.com" && src.match(/\/hamblog[0-9]+\/+[0-9]+/)) ||
			domain === "img.momon-ga.com") {
			return src.replace(/-s(\.[^/.]*)$/, "$1");
		}
		if (domain === "note.taable.com" &&
			string_indexof(src, "/photo/") >= 0) {
			return decodeURIComponent(src.replace(/:\/\/[^/]*\/photo\//, "://"));
		}
		if (domain_nosub === "adult-gazou.me" && domain.match(/img-[^.]*\.adult-gazou\.me/)) {
			return src.replace(/\/[a-z](\/[0-9]*\.[^/.]*)$/, "/l$1");
		}
		if (domain_nosub === "fukugan.com" &&
			string_indexof(src, "/rssimg/") >= 0) {
			return decodeURIComponent(decodeURIComponent(src.replace(/.*\/(https?[%:].*)/, "$1"))).replace(/\.#.*/, "");
		}
		if ((domain_nosub === "lostbird.vn" ||
			domain_nosub === "nginx.page") &&
			domain.match(/img[0-9]*\./)) {
			return src.replace(/(:\/\/[^/]*\/)[-0-9]+x[-0-9]+\//, "$1");
		}
		if (domain === "img.biggo.com.tw") {
			return src.replace(/^[a-z]+:\/\/[^/]*\/[^/]*\//, "");
		}
		if (((domain_nosub === "book.com.tw" && domain.match(/im[0-9]*\.book\.com\.tw/)) ||
			domain === "www.books.com.tw" ||
			domain === "buy.line-scdn.net") &&
			string_indexof(src, "/getImage") >= 0) {
			return decodeURIComponent(src.replace(/.*\/getImage.*?[?&]i=([^&]*).*?$/, "$1"));
		}
		if (domain === "img.feebee.com.tw") {
			return src.replace(/^[a-z]+:\/\/[^/]*\/ip\/[0-9]+\/[^/]+=\//, "");
		}
		if (domain === "www.consolefun.fr" ||
			domain_nowww === "nookthem.com" ||
			domain_nowww === "nude-gals.com") {
			return src.replace(/\/thumbs\/+th_/, "/");
		}
		if (domain === "ex.f3img.gq") {
			return decodeURIComponent(src.replace(/.*?\/api\/image.*?[?&]url=([^&]*).*?$/, "$1"));
		}
		if (domain === "images.everyeye.it") return src.replace(/(-v[0-9]+-[0-9]+)-[0-9]+(\.[&/.]*)/, "$1$2");
		if (domain_nowww === "bobx.com") {
			var get_obj = function(url) {
				var normurl = url
					.replace(/\/thumbnail\/+(.*?)(?:-preview)?(-[0-9]+)(?:\.t)?(\.[^/.]*)$/, "/$1-$2$3")
					.replace(/--([0-9]+\.[^/.]*)$/, "-$1");
				var obj = {
					url: url,
					headers: {
						Referer: normurl.replace(/\/([^/]+)\.[^/.]*$/, "/$1.html")
					},
					bad_if: [{
							headers: {
								"content-length": "281567",
								"last-modified": function(value) {
									if (/^Tue, 19 Nov 2019/i.test(value)) {
										return true;
									}
									return false;
								}
							}
						}]
				};
				if (url.match(/\/[^/]+[^-]-[0-9]+\.[^/.]+(?:[?#].*)?$/)) {
					obj.headers.Referer = normurl.replace(/\/([^/]+)\.[^/.]*$/, "/large-$1.html");
					obj.is_original = true;
				}
				obj.extra = { page: obj.headers.Referer };
				return obj;
			};
			newsrc = src.replace(/\/thumbnail\/+(.*?)(?:-preview)?(-[0-9]+)(?:\.t)?(\.[^/.]*)$/, "/$1-$2$3");
			if (newsrc !== src)
				return get_obj(newsrc);
			newsrc = src.replace(/--([0-9]+\.[^/.]*)$/, "-$1");
			if (newsrc !== src)
				return get_obj(newsrc);
			return get_obj(src);
		}
		if ((domain === "www.altcine.com" && string_indexof(src, "/photo/") >= 0) ||
			domain === "gallery-cdn.tiscali.it" ||
			(domain === "img.amur.info" && string_indexof(src, "/res/") >= 0) ||
			(domain === "thumbs.vaultsex.com" && string_indexof(src, "/content/") >= 0) ||
			(domain_nowww === "dspdaily.com" && string_indexof(src, "/data/") >= 0)) {
			return src.replace(/\/[0-9]+x[0-9]+\/([^/]*)$/, "/$1");
		}
		if (domain_nowww === "spacetelescope.org" ||
			domain === "cdn.spacetelescope.org" ||
			domain_nowww === "esahubble.org") {
			return src.replace(/(\/archives\/+images\/+)[a-z]+(?:[0-9]+x)?(\/+[^/.]*\.[^/.]*)(?:[?#].*)?$/, "$1large$2");
		}
		if (domain === "static.qobuz.com") {
			return src
				.replace(/_[0-9]+(\.[^/.]*)$/, "_org$1")
				.replace(/(\/images\/+artists\/+covers\/+)(?:small|medium)\/+/, "$1large/");
		}
		if (domain_nowww === "sarajevo.travel" &&
			string_indexof(src, "/assets/photos/") >= 0) {
			return src.replace(/\/[a-z]+\/([^/]*)$/, "/original/$1");
		}
		if (domain === "avatars.mds.yandex.net" ||
			domain === "avatars.yandex.net" ||
			domain === "avatars.dzeninfra.ru") {
			obj = {
				url: src.replace(/\/(?:[a-z]+_(?:[a-z]+_)?|[a-zA-Z]|pjpg)?[0-9]+(?:x[0-9]+)?(?:[A-Za-z_0-9]+)([?&].*)?$/, "/orig$1")
			};
			match = src.match(/\/get-[^/]+\/+([0-9]+)\/+[^/]+\/+[^/]+(?:[?#].*)?$/);
			if (match)
				obj.filename = match[1];
			newsrc = src.replace(/(:\/\/[^/]+\/+i\?)(?:.*&)?id=([0-9a-f]{10,}[^&#]+)(?:[&#].*)?$/, "$1id=$2&n=13");
			if (newsrc !== src)
				return newsrc;
			return obj;
		}
		if (domain_nowww === "t2online.com") return src.replace(/^[a-z]+:\/\/[^/]*\/unsafe\//, "http://");
		if (domain_nowww === "filmnegah.com") {
			return decodeURIComponent(src.replace(/(:\/\/[^/]*)\/Image\/(?:Resize|Thumbnail).*?[?&](?:url|path)=~([^&]*).*?$/, "$1$2"));
		}
		if (domain_nowww === "niagara.sk" && string_indexof(src, "/images/") >= 0) {
			return src.replace(/\/tmb-[0-9]+(?:-[0-9]+)\//, "/big/");
		}
		if (domain_nowww === "cdn-cinenode.com") return src.replace(/(\/[0-9]+\/)([^/]*)-[0-9]+-[0-9]+(\.[^/.]*)$/, "$1full/$2$3");
		if (domain_nosub === "canalblog.com" && domain.match(/\.storage\.canalblog\.com$/)) {
			return src
				.replace(/\.[^/]*(\.[^/.]*)$/, "$1")
				.replace(/(\/[0-9]+)(?:_[a-z])?(\.[^/.]*)$/, "$1_o$2");
		}
		if (domain_nowww === "film-like.com") return src.replace(/\/thumb\//, "/full/");
		if (domain_nowww === "24smi.org" ||
			domain_nowww === "24celebs.com") {
			return src
				.replace(/\/img\/+[0-9]+_[0-9]+\//, "/img/999999999_999999999/")
				.replace(/\/public\/+media\/+(?:resize\/+)?[-0-9]+x[-0-9]+\//, "/public/media/");
		}
		if (domain === "cdn.metrotvnews.com" ||
			domain === "cdn.medcom.id") {
			return src.replace(/\?.*/, "?w=99999999999");
		}
		if (domain_nowww === "znqnet.com" && string_indexof(src, "/fileupload/") >= 0) {
			return src.replace(/\/fileupload\/thumb\//, "/fileupload/image/");
		}
		if (domain_nosub === "rpp-noticias.io" && domain.match(/[a-z]\.rpp-noticias\.io/)) {
			return src.replace(/:\/\/e\.rpp-noticias\.io\/[a-z]+\//, "://f.rpp-noticias.io/");
		}
		if (domain_nowww === "digi-film.ro") return src.replace(/\/onedb\/picture\([^/]*\//, "/onedb/picture/");
		if (domain === "s.iw.ro") {
			newsrc = src.replace(/\.thumb(\.[^/.]+)([?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/gateway\/+g\/+(([^/.?]{32}\/+){1,}[^/.]*\.[^/.?#]*)/);
			if (match) {
				var splittedhex = match[1].replace(/\/+/g, "/").replace(/\..*/, "").split("/");
				var endstr = "";
				for (var i_2 = 0; i_2 < splittedhex.length; i_2++) {
					endstr += base64_decode(splittedhex[i_2]);
				}
				newsrc = endstr.replace(/^(?:.*&)?fileSource=([^&]*).*?$/, "$1");
				if (newsrc !== src)
					return decodeURIComponent(newsrc);
			}
		}
		if (domain_nosub === "jiemian.com" && domain.match(/img[0-9]*\.jiemian\.com/)) {
			return src.replace(/\/([0-9]+)_[a-zA-Z0-9]+x[a-zA-Z0-9]+(\.[^/.]*)$/, "/$1$2");
		}
		if (domain === "cdn.highdefdigest.com") return src.replace(/(\/uploads\/[0-9]+\/[0-9]+\/[0-9]+\/)[0-9]+\/([^/]*)$/, "$1$2");
		if (domain_nowww === "ojosdecafe.com") return src.replace(/\/thumbs\/[0-9]+x[0-9]+_/, "/");
		if (domain === "img.gestion.pe" ||
			domain_nowww === "multimedios.com" ||
			domain === "imagenes.heraldo.es" ||
			domain_nowww === "lavanguardia.com") {
			return src.replace(/\/files\/+[^/]+\/+uploads\//, "/uploads/");
		}
		if (domain === "imagenes.cronica.com.mx" ||
			domain === "imghandler.cronica.com.mx") {
			return src
				.replace(/:\/\/[^/]+\/+.*?\/(uploads\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]{5,}\.[a-z]+)(?:[?#].*)?/, "://imagenes.cronica.com.mx/$1")
				.replace(/(\/uploads\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]{5,}\.)[^/?#]+\.([a-z]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "thumb.guucdn.net") return src.replace(/:\/\/[^/]*\/[0-9]+x[0-9]+\//, "://");
		if ((domain_nowww === "game4v.com" && string_indexof(src, "/thumb/thumb.php?") >= 0) ||
			domain === "static.pinwallpapers.com") {
			newsrc = src.replace(/.*?\/thumb\.php.*?[?&]src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "newpal.ps" ||
			domain_nosub === "iravunk.com" ||
			(domain_nowww === "mrcapetown.co.za" && src.match(/\/wp-content\/.*\/functions\/+thumb\.php/)) ||
			domain_nowww === "vtimes.com.au" ||
			domain_nowww === "pardisgame.net") {
			newsrc = decodeURIComponent(src.replace(/.*?\/thumb\.php.*?[?&]src=([^&]*).*?$/, "$1"));
			if (newsrc !== src) {
				if (newsrc.match(/^[a-z]+:\/\//))
					return newsrc;
				else
					return urljoin(src, ("/" + newsrc).replace(/^\/\//, "/"), true);
			}
		}
		if (domain === "static.santruyen.com") return src.replace(/(\/[0-9]+)_[a-z]+(\.[^/.]*)$/, "$1$2");
		if (amazon_container === "boligsurf-production" &&
			string_indexof(src, "/assets/images/") >= 0) {
			return src.replace(/\/fixed_[0-9]+_[0-9]+\//, "/original/");
		}
		if (domain_nowww === "sonara.net") {
			return decodeURIComponent(src.replace(/:\/\/[^/]*\/cro\.php.*?[?&]image=([^&]*).*?$/, "://images.sonara.net$1"));
		}
		if (domain === "d2u7zfhzkfu65k.cloudfront.net" &&
			string_indexof(src, "/resize/wp-content/") >= 0) {
			return src.replace(/:\/\/[^/]*\/resize\//, "://d3kszy5ca3yqvh.cloudfront.net/");
		}
		if (domain === "imgbp.hotp.jp") return src.replace(/_[0-9]+-[0-9]+(\.[^/.]*)$/, "$1");
		if (domain === "review.zafcdn.com") return src.replace(/(\/upload\/+zaful\/+review\/+[0-9]{8}\/+)(?:thumb\/+)?([0-9A-F]{10,})_(?:[0-9]+-[0-9]+|thumb)(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		if (amazon_container === "ro69-bucket") {
			return src.replace(/(\/image\/[0-9]+\/)[^/]*\/resize_image/, "$1default/resize_image");
		}
		if (domain === "aimg-pictpix.akamaized.net") return src.replace(/(:\/\/[^/]*\/)ts[0-9]+x[0-9]+\/img\//, "$1img/");
		if (amazon_container === "lattepic") {
			return src.replace(/(\/[a-z]+_)[a-z]+(\.[^/.?]*)$/, "$1org$2");
		}
		if (domain === "coconala.akamaized.net") return src.replace(/\/service_images\/[0-9]+x[0-9]+\//, "/service_images/original/");
		if (domain === "dplhqivlpbfks.cloudfront.net") return src.replace(/.*(\/[0-9a-f]+-[0-9]+\.[^/.]*)$/, "https://coconala.akamaized.net/coconala-public-files/service_images/original$1");
		if (domain_nowww === "ysbnow.com") return src.replace(/(:\/\/[^/]*\/dam).*?[?&](media-id=[^&]*).*?$/, "$1?$2");
		if (domain_nowww === "quizz.biz") return src.replace(/(\/uploads\/+quizz\/+[0-9]+\/+)[a-z]+(\/+[0-9]+)(?:_[0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1orig$2$3");
		if (domain_nosub === "flipagramcdn.com" && domain.match(/c[0-9]*\.flipagramcdn\.com/)) {
			return src.replace(/-[a-z]+(?:\?.*)?$/, "");
		}
		if (domain === "images-cdn.9gag.com" ||
			domain === "img-9gag-fun.9cache.com" ||
			domain === "d24w6bsrhbeh9d.cloudfront.net" ||
			domain === "miscmedia-9gag-fun.9cache.com") {
			return src
				.replace(/\/thumbnail-facebook\/([^/]*)_[0-9]+x[0-9]+(\.[^/.]*)$/, "/thumbnail-facebook/$1_n$2")
				.replace(/_460swp(\.[^/.]*)$/, "_700bwp$1")
				.replace(/_460s(_v1)?(\.[^/.]*)$/, "_700b$1$2");
		}
		if (domain_nowww === "samironsheadshots.com" &&
			string_indexof(src, "/images/") >= 0) {
			return src.replace(/\/small\/([^/]*)$/, "/large/$1");
		}
		if (domain === "cps-static.rovicorp.com") {
			return src
				.replace(/\/_derived_[^/]*(\/[^/]*)$/, "$1")
				.replace(/\/JPG_[0-9]+\//, "/JPG_SRC/");
		}
		if (domain === "rovimusic.rovicorp.com") {
			if (/[?&]c=[^&]{10,}/.test(src)) {
				var queries = get_queries(src);
				newsrc = src.replace(/\?.*/, "?c=" + queries.c + "&f=0");
				if (newsrc !== src)
					return newsrc;
			}
		}
		if (domain_nosub === "netflixmovies.com" && domain.match(/i[0-9]*\.netflixmovies\.com/)) {
			return src.replace(/\/image\/upload\/[wh]_[0-9]+\//, "/image/upload/");
		}
		if (domain_nowww === "shakespearesglobe.com") return src.replace(/(\/images\/[0-9]+)\/[a-z]+(?:\?.*)?$/, "$1");
		if (domain_nosub === "rsc.org.uk" && domain.match(/cdn[0-9]*\.rsc\.org\.uk/)) {
			return src.replace(/\.tmb-img-[0-9]*\./, ".");
		}
		if (domain === "images.fashionmodeldirectory.com") return src.replace(/-(?:square(?:small|medium)|single|fit|modelprofile[A-Za-z]+|profile|alternative)(\.[^/.]*)$/, "-fullsize$1");
		if (domain === "cdn.public.hegre.com" ||
			domain === "p.hegre.com") {
			newsrc = src.replace(/-image-[0-9]+x(?:_2x)?(\.[^/.]*)(?:[?#].*)?$/, "-image-fullsize$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/films\/+[^/]+\/+[0-9]+\/+[^/]+)-[0-9]*x[0-9]*\./, "$1.");
			if (newsrc !== src)
				return newsrc;
			var sizes = [
				"2160p",
				"1080p",
				"720p",
				"480p"
			];
			match = src.match(/\/films\/+[^/]+\/+[^/]+-([0-9]+p)\.mp4/);
			if (match && array_indexof(sizes, match[1]) > 0) {
				sizes = sizes.slice(0, array_indexof(sizes, match[1]));
				var urls = [];
				for (var i_3 = 0; i_3 < sizes.length; i_3++) {
					urls.push({
						url: src.replace(/(\/films\/+[^/]+\/+[^/]+-)[0-9]+p\./, "$1" + sizes[i_3] + "."),
						video: true
					});
				}
				return urls;
			}
		}
		if (domain === "storage.hegre.com") return src.replace(/(\/img\/+gallery-[0-9]+-)thumb(-[0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1image$2");
		if ((domain_nowww === "skinnygossip.com" ||
			domain_nowww === "alternatehistory.com" ||
			domain_nowww === "gtplanet.net" ||
			domain_nowww === "burbuja.info" ||
			domain_nowww === "kadinlarkulubu.com" ||
			domain_nowww === "arrse.co.uk") &&
			string_indexof(src, "/proxy.php?") >= 0) {
			return decodeURIComponent(src.replace(/.*?\/proxy\.php.*?[?&]image=([^&]*).*?$/, "$1"));
		}
		if (domain === "usa-grlk5lagedl.stackpathdns.com") return src.replace(/(\/images\/[^/]*)\?.*$/, "$1?fm=pjpg");
		if (domain === "static.sify.com") return src.replace(/(\/cms\/image\/[^/]*)_[a-z]+(\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "wikifeet.com") return src.replace(/(\/profiles\/+[0-9]+)(\.[^/.]+)(?:[?#].*)?$/, "$1_fs$2");
		if (domain === "thumbs.wikifeet.com") return src.replace(/:\/\/[^/]*\//, "://pics.wikifeet.com/");
		if (domain === "my.wikifeet.com") {
			obj = {
				url: src.replace(/\/(photos|avatars)\/+t([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1/$2"),
				bad_if: [{
						headers: {
							"content-length": "169698",
							"last-modified": "Thu, 01 Aug 2019 12:02:01 GMT"
						}
					}]
			};
			match = obj.url.match(/:\/\/[^/]+\/+avatars\/+([0-9]+)\./);
			if (match) {
				obj.extra = { page: "https://my.wikifeet.com/models/" + match[1] };
			}
			return obj;
		}
		if (domain === "static.spotboye.com") return src.replace(/(_[0-9a-f]+)(?:_[a-z]+)?(\.[^/.]*)$/, "$1_original$2");
		if (domain === "img.news.goo.ne.jp") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/cpimg\/([^/]*\.[^/]*)/, "http://$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "img.news.goo.ne.jp" ||
			domain === "img.topics.smt.news.goo.ne.jp") {
			return src
				.replace(/(\/picture\/+[a-z]+\/+m[^/?#]+)(?:[?#].*)?$/, "$1")
				.replace(/\/picture\/+([a-z]+)\/+s((?:_\1-[0-9]{8}wow[0-9]+|_\1-[0-9]{10,}|_?[0-9]{10,})\.[^/.]*)(?:[?#].*)?$/, "/picture/$1/m$2");
		}
		if (domain_nowww === "redditstatic.com") {
			if (/^[a-z]+:\/\/[^/]+\/+(?:sprite|sidebar|icon)[-_][^/]+\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src.replace(/(\/gold\/+awards\/+icon\/+[^/]+)_[1-4]?[0-9]{2}\./, "$1_512.");
		}
		if (domain === "preview.redd.it") return src.replace(/:\/\/preview\.redd\.it\/(award_images\/+t[0-9]*_[0-9a-z]+\/+)?(?:[-0-9a-z]+-)?([^/.]*\.[^/.?]*)\?.*$/, "://i.redd.it/$1$2");
		if (domain === "i.redd.it" && src.match(/^[a-z]+:\/\/[^/]*\/[0-9a-z]+\.[^-/._?#]*$/)) {
			return {
				url: src,
				headers: {
					Accept: '*/*',
					Referer: null
				},
				is_original: true
			};
		}
		if (domain === "i.reddituploads.com") {
			newsrc = src.replace(/(:\/\/[^/]*\/[0-9a-f]+)\?.*$/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (host_domain_nosub === "reddit.com" && options.element) {
			if (src === "" && options.element.tagName === "A" && options.element.classList.contains("image")) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
		}
		if (domain_nosub === "redditmedia.com" && options.element) {
			if (options.element.tagName === "DIV") {
				if (options.element.classList.contains("arrow")) {
					return {
						url: origsrc,
						bad: "mask"
					};
				}
			}
		}
		if (domain === "v.redd.it") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([a-z0-9]+)(?:[?#].*)?$/,
				query_for_id: {
					url: "https://v.redd.it/${id}",
					method: "HEAD"
				},
				process: function(done, resp, cache_key) {
					return done({
						url: resp.finalUrl,
						is_pagelink: true
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "reddit.com" || domain_nowww === "redd.it") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+media\?(?:.*&)?url=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			var request_reddit_api = function(id, cb) {
				api_query("reddit_api:" + id, {
					url: "https://www.reddit.com/api/info.json?id=" + id,
					imu_mode: "xhr",
					headers: {
						"Origin": "https://old.reddit.com",
						"Referer": "https://old.reddit.com/"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					console_log(resp);
					var item = resp.data.children[0].data;
					if (_nir_debug_) {
						console_log(id, item);
					}
					done(item, 60 * 60);
				});
			};
			var request_reddit = function(id, cb) {
				request_reddit_api(id, function(item) {
					if (!item) {
						return cb(null);
					}
					if (item.crosspost_parent) {
						return request_reddit(item.crosspost_parent, cb);
					}
					var urls = [];
					var obj = {
						extra: {}
					};
					if (item.permalink) {
						obj.extra.page = urljoin("https://www.reddit.com/", item.permalink, true);
					}
					if (item.title) {
						obj.extra.caption = item.title;
					}
					var is_selfpost = item.domain && /^self\./.test(item.domain) && item.url && /^[a-z]+:\/\/[^/]*reddit\.com\/r\//.test(item.url);
					if (!is_selfpost && item.preview && item.preview.images) {
						var preview_image;
						if (item.preview.images[0].variants.gif)
							preview_image = item.preview.images[0].variants.gif.source.url;
						else
							preview_image = item.preview.images[0].source.url;
						preview_image = preview_image.replace(/&amp;/g, "&");
						urls.push(preview_image);
					}
					if (item.secure_media && item.secure_media.reddit_video) {
						var rv = item.secure_media.reddit_video;
						if (rv.fallback_url) {
							urls.unshift({
								url: rv.fallback_url,
								video: true
							});
						}
						if (rv.hls_url) {
							urls.unshift({
								url: rv.hls_url,
								video: "hls"
							});
						}
						if (rv.dash_url) {
							urls.unshift({
								url: rv.dash_url,
								video: "dash"
							});
						}
					}
					if (item.gallery_data && item.gallery_data.items) {
						var first_url = null;
						var album_links = [];
						array_foreach(item.gallery_data.items, function(item) {
							var url = "https://i.redd.it/" + item.media_id + ".jpg";
							if (!first_url)
								first_url = url;
							album_links.push({
								url: url,
								is_current: first_url === url
							});
						});
						if (first_url) {
							urls.unshift({
								url: first_url,
								album_info: {
									type: "links",
									links: album_links
								}
							});
						}
					}
					if (!/^[a-z]+:\/\/(?:[^/]*\.)?reddit\.com\/+gallery\//.test(item.url) &&
						looks_like_valid_link(item.url, item.url)) {
						urls.unshift(item.url);
					}
					return cb(fillobj_urls(urls, obj));
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:(?:(?:r|u(?:ser)?)\/+[^/]+\/+comments|gallery)\/+)?([a-z0-9]+)(?:\/+.*)?(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					request_reddit("t3_" + id, function(data) {
						cb(data);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if ((domain_nosub === "redditmedia.com" ||
			domain_nosub === "redd.it" ||
			(domain_nosub === "reddit.com" && /:\/\/[^/]+\/+[ru]\/+/.test(src)) ||
			string_indexof(origsrc, "blob:") === 0) &&
			host_domain_nosub === "reddit.com" && options.element) {
			var get_reddit_link = function(id) {
				id = id.replace(/^t[0-9]+_/, "");
				return {
					url: "https://redd.it/" + id,
					is_pagelink: true
				};
			};
			var current = options.element;
			do {
				if (current.tagName === "DIV") {
					var testid = current.getAttribute("data-testid") || current.getAttribute("data-fullname") || current.getAttribute("id");
					if (testid && testid === "post-container") {
						testid = current.getAttribute("id");
					}
					if (testid) {
						match = testid.match(/^t3_([a-z0-9]{2,8})$/);
						if (match) {
							return get_reddit_link(match[1]);
						}
					}
				}
			} while (current = current.parentElement);
		}
		if ((domain_nosub === "gstatic.com" ||
			domain === "") &&
			host_domain_nosub.match(/^google\./) && options.element) {
			newsrc = (function() {
				var get_imagesearch_url = function(current) {
					do {
						if (current.tagName !== "A")
							continue;
						if (!current.href.match(/\/imgres\?/))
							continue;
						var newsrc = current.href.replace(/.*?\/imgres.*?[?&]imgurl=([^&]*).*?$/, "$1");
						if (newsrc !== src)
							return decodeURIComponent(newsrc);
					} while (current = current.parentElement);
					return null;
				};
				var newsrc = get_imagesearch_url(options.element);
				if (newsrc)
					return newsrc;
				var tbnid = null;
				current = options.element;
				if (current.tagName === "IMG") {
					while ((current = current.parentElement)) {
						if (current.tagName !== "DIV")
							continue;
						var our_tbnid = current.getAttribute("data-tbnid");
						if (!our_tbnid)
							continue;
						tbnid = our_tbnid;
						var regex = new RegExp("\\[[0-9]+\\s*,\\s*\"" + tbnid + "\"\\s*,\\s*\\[[^\\]]*\\]\\s*,\\s*\\[(\"[^\"]+\")\\s*,");
						var match = document.documentElement.innerHTML.match(regex); // TODO: optimize
						if (match) {
							return JSON_parse(match[1]);
						} else {
							break;
						}
					}
				}
				if (tbnid && options.cb) {
					try {
						var event = new MouseEvent("mousedown", {
							bubbles: true,
							cancelable: true,
							button: 2,
							buttons: 2,
							clientX: 1,
							clientY: 1
						});
						options.element.dispatchEvent(event);
						setTimeout(function() {
							options.cb(get_imagesearch_url(options.element));
						}, 500);
						return {
							waiting: true
						};
					} catch (e) {
						console_error(e);
					}
				}
				current = options.element;
				while ((current = current.parentElement)) {
					if (current.tagName !== "A")
						continue;
					if (!current.href.match(/\/search\?/))
						continue;
					var parent = current.parentElement;
					if (parent.tagName !== "DIV")
						continue;
					var notranslate = parent.getElementsByClassName("notranslate");
					if (!notranslate.length) {
						parent = parent.parentElement;
						if (!parent || parent.tagName !== "DIV")
							break;
						notranslate = parent.getElementsByClassName("notranslate");
						if (!notranslate.length)
							continue;
					}
					for (var i = 0; i < notranslate.length; i++) {
						var el = notranslate[i];
						if (!el.innerHTML.match(/^ *{/))
							continue;
						var json = JSON_parse(el.innerHTML);
						if (json.ou.match(/^[a-z]+:/))
							return json.ou;
						break;
					}
				}
			})();
			if (newsrc !== void 0)
				return newsrc;
		}
		if (domain_nosub === "fbcdn.net") {
			if (/^[a-z]+:\/\/[^/]+\/+rsrc\.php\//.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nosub === "fbcdn.net" && host_domain_nosub === "facebook.com" && options.element) {
			var element = options.element;
			if (element.tagName === "IMG") {
				while ((element = element.parentElement)) {
					if (element.tagName === "A") {
						var ploi = element.getAttribute("data-ploi");
						if (ploi && ploi.match(/^https?:\/\/[^/]*fbcdn\.net\//) && ploi !== src) {
							return ploi;
						} else if (/^[a-z]+:\/\/[^/]+\.?facebook\.com\//.test(element.href)) {
							return {
								url: element.href,
								is_pagelink: true
							};
						}
					}
				}
			}
		}
		if (domain === "thumbnail.named.com" ||
			domain === "thumb.named.com") {
			return [
				src.replace(/:\/\/[^/]*\/.*?(\/+file\/+photo\/+.*)/, "://thumb.named.com/normal/resize/origin$1")
			];
		}
		if (host_domain_nosub === "bing.com" &&
			(domain === "" || domain_nosub === "bing.com") && options.element) {
			var current = options.element;
			while ((current = current.parentElement)) {
				if (current.tagName === "DIV" && current.id === "mainImageWindow" && current.hasAttribute("data-m")) {
					var parsed_2 = JSON_parse(current.getAttribute("data-m"));
					return parsed_2.murl;
				}
				if (current.tagName !== "A")
					continue;
				if (!current.href.match(/\/images\/search\?.*mediaurl=/))
					continue;
				newsrc = current.href.replace(/.*?\/search.*?[?&]mediaurl=([^&]*).*?$/, "$1");
				if (newsrc !== current.href && newsrc !== src) {
					newsrc = decodeuri_ifneeded(newsrc);
					return newsrc;
				}
			}
		}
		if (domain_nosub === "deviantart.net" &&
			(domain.match(/^pre[0-9]*\.deviantart\.net/) ||
				domain.match(/^img[0-9]*\.deviantart\.net/)) &&
			src.match(/\/[a-z0-9]\/[0-9]+\/[0-9a-z]+\/[0-9a-z]+\/[0-9a-z]+\/[^/]*-[0-9a-z]+\.[^/.]*$/) &&
			options && options.do_request && options.cb) {
			newsrc = (function() {
				var id = src.replace(/.*-([0-9a-z]+)\.[^/.]*$/, "$1");
				return common_functions["deviantart_fullimage"](options, api_cache, src, id, options.cb);
			})();
			return {
				"waiting": true
			};
		}
		if (domain_nowww === "huangdi5000.com") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/p\.php.*?[?&]p=(.*)$/, "$1"));
		}
		if (domain_nowww === "popcornfor2.com" && string_indexof(src, "/upload/") >= 0) {
			return src.replace(/\/news-[a-z]+-([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/news-full-$1");
		}
		if (domain === "img.daily.co.kr") {
			return src.replace("/content_watermark/", "/content/");
		}
		if (domain === "file.gamedonga.co.kr") return src.replace(/(\/files\/[0-9]+\/[0-9]+\/[0-9]+\/)[a-z]\/([^/]*)$/, "$1$2");
		if (domain === "jrimage.dongascience.com") return src.replace(/(\/[0-9]+)_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "cloud.tcusercontent.net") return src.replace(/(-[0-9]+-[0-9a-f]+)-[0-9]+(\.[^/.]*)$/, "$1$2");
		if (domain === "image.entertainment-topics.jp" ||
			domain === "image.code-file.jp" ||
			domain === "image.make-book.jp") {
			return src.replace(/(:\/\/[^/]*\/)(item\/image\/|article\/)[a-z]+(\/[^/]*)$/, "$1$2original$3");
		}
		if ((domain_nosub === "styapokupayu.ru" &&
			string_indexof(src, "/images/") >= 0) ||
			(domain_nosub === "yapokupayu.ru" &&
				string_indexof(src, "/system/images/") >= 0)) {
			return src.replace(/(\/[0-9]+)_[a-z]+(\.[^/.]*)$/, "$1_original$2");
		}
		if (domain_nowww === "thai.ac") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/news\/tn\/.*?[?&]fn=([^&]*).*?/, "$1"));
		}
		if (domain_nosub === "styleshare.kr" &&
			domain.match(/usercontents(?:-[a-z])?\.styleshare\.kr/)) {
			return src.replace(/(\/images\/[0-9]+\/)[-0-9]+x[-0-9]+(?:\?.*)?$/, "$1original");
		}
		if (domain === "images.vingle.net") return src.replace(/(:\/\/[^/]*\/upload\/)t_[^/]*\/([^/]*)$/, "$1$2");
		if (domain === "media.vingle.net") {
			newsrc = src.replace(/(\/images\/+(?:ca|us))_s\//, "$1_l/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/images\/+(?:ca|us))_l\//, "$1_xl/");
			if (newsrc !== src)
				return newsrc;
			return {
				url: src,
				headers: {
					Referer: ""
				}
			};
		}
		if (domain_nowww === "anewsa.com") return src.replace(/(_images\/[0-9]+\/[0-9]+\/[0-9]+\/)mark(\/[^/]*)$/, "$1original$2");
		if (domain === "img.newspim.com") {
			return src
				.replace(/(\/[0-9]+)_(?:t[a-z0-9]|w)(\.[^/.]*)$/, "$1$2")
				.replace(/(\/magazine\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]+_[0-9a-f]+)_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "insectidentification.org") return src.replace(/(\/imgs\/[a-z]+\/)thumbnails\//, "$1");
		if (domain_nowww === "a-z-animals.com") return src.replace(/\/images\/[0-9]+x[0-9]+\//, "/images/original/");
		if (domain_nosub === "nicematin.com" && /^cdn\.static[0-9]*\./.test(domain)) {
			return src.replace(/(:\/\/[^/]*\/+media\/+[^/]*\/+)[^/]*(\/+[0-9]+\/+[0-9]+\/+[^/]*)(?:[?#].*)?$/, "$1original$2");
		}
		if (domain_nosub === "fbcdn.net" || domain_nosub === "cdninstagram.com") {
			newsrc = common_functions["instagram_norm_url"](src);
			if (newsrc !== src)
				return common_functions["set_cdninstagram_obj"](newsrc);
			/*newsrc = remove_queries(src, ["se"]);
			if (newsrc !== src)
				return newsrc;

			newsrc = remove_queries(src, ["_nc_cat", "_nc_rid", "efg", "ig_cache_key"]);
			if (newsrc !== src)
				return newsrc;*/
		}
		if (domain_nowww === "instagram.com") {
			newsrc = website_query({
				website_regex: {
					regex: /^[a-z]+:\/\/[^/]+\/+(p|tv|reel)\/+([^/]+)(?:\/+(?:(?:media|embed).*)?)?(?:[?#].*)?$/,
					groups: ["type", "id"]
				},
				id: "post:${type}:${id}",
				run: function(cb, match) {
					var info = [{
							type: "post",
							subtype: "link",
							url: "https://www.instagram.com/" + match[1] + "/" + match[2] + "/",
							element: options.element
						}];
					var queries = common_functions["parse_imu_hash"](src);
					if (queries) {
						if (queries.i) {
							info[0].image = parseInt(queries.i);
						} else if (queries.image_url) {
							info[0].image = queries.image_url;
						}
					}
					if (!info[0].image)
						info[0].image = "first";
					return common_functions["instagram_parse_el_info"](api_cache, options.do_request, options.rule_specific.instagram_use_app_api, options.rule_specific.instagram_dont_use_web, options.rule_specific.instagram_prefer_video_quality, info, options.host_url, cb);
				}
			});
			if (newsrc)
				return newsrc;
			newsrc = website_query({
				website_regex: {
					regex: /^[a-z]+:\/\/[^/]+\/+stories\/+([^/]+)\/+([0-9]+)\/*(?:[?#].*)?$/,
					groups: ["user", "id"]
				},
				id: "story:${user}:${id}",
				run: function(cb, match) {
					var info = [{
							type: "story",
							url: "https://www.instagram.com/stories/" + match.groups.user + "/" + match.groups.id + "/",
							element: options.element
						}];
					info[0].image = info[0].url;
					return common_functions["instagram_parse_el_info"](api_cache, options.do_request, options.rule_specific.instagram_use_app_api, options.rule_specific.instagram_dont_use_web, options.rule_specific.instagram_prefer_video_quality, info, options.host_url, cb);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (((domain_nosub === "fbcdn.net" && domain.match(/^instagram\./)) ||
			domain_nosub === "cdninstagram.com" ||
			(!src && origsrc)) &&
			host_domain_nosub === "instagram.com" && options.element && options.cb) {
			newsrc = (function() {
				var info = common_functions["instagram_find_el_info"](document, options.element, options.host_url);
				return common_functions["instagram_parse_el_info"](api_cache, options.do_request, options.rule_specific.instagram_use_app_api, options.rule_specific.instagram_dont_use_web, options.rule_specific.instagram_prefer_video_quality, info, options.host_url, options.cb);
			})();
			if (newsrc !== void 0)
				return newsrc;
		}
		if (domain_nowww === "instagram.com") {
			if (/\/static\/+(?:bundles\/+[^/]+\/+sprite_|images\/+ico\/+)/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nosub === "instagram.com" &&
			src.match(/:\/\/[^/]*\/+p\/+[^/]*\/+media\/*[?]size=[a-z](?:[&#].*)?$/)) {
			newsrc = {
				url: src.replace(/\/media.*?[?&]size=[a-z].*?$/, "/media?size=l"),
				can_head: false
			};
			match = src.match(/\/p\/+([^/]+)\/+media/);
			if (match) {
				return [
					{ url: "https://www.instagram.com/p/" + match[1] + "/", is_pagelink: true },
					newsrc
				];
			} else {
				return newsrc;
			}
		}
		if (domain === "l.instagram.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+\?(?:.*&)?u=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain === "s9e.github.io") {
			match = src.match(/\/iframe\/+[0-9]+\/+instagram\.min\.html#(.*)$/);
			if (match) {
				return {
					url: "https://www.instagram.com/p/" + match[1] + "/",
					is_pagelink: true
				};
			}
		}
		if (domain === "cdns.klimg.com" ||
			domain === "cdn.klimg.com") {
			return src
				.replace(/(:\/\/[^/]*\/+[^/]*\.[^/]*\/+)resized\/+[0-9]+x(?:[0-9]+)?\/+/, "$1")
				.replace(/\/resized\/[0-9]+x(?:[0-9]+)?\//, "/kapanlagi.com/")
				.replace(/(\/g\/.\/.\/[^/]*\/)t\/([^/]*)$/, "$1$2")
				.replace(/(\/p\/+[^/]*\/+)[0-9]+x[0-9]+\/+([^/]*$)/, "$1$2")
				.replace(/\/t\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "/$1")
				.replace(/(\/resources\/.*\/)[auto0-9]+x[auto0-9]+-([^/]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nosub === "nintendo-europe.com" && /^cdn[0-9]*\./.test(domain)) {
			return src.replace(/_image[0-9]*[wh](\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "15min.lt" && /^s[0-9]*\./.test(domain)) {
			return src.replace(/(\/images\/+photos\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2})[a-z]+(\/+[^/]+\.[^/.]+)(?:[?#].*)?$/, "$1original$2");
		}
		if (domain === "image.way2enjoy.com") return src.replace(/^[a-z]+:\/\/[^/]*\/misc\/lazyg\/.*?\/([^/]*)\.[^/.]*\.[^/.]*$/, "http://lzimages.lazygirls.info/$1");
		if (domain_nowww === "mobtada.com") return src.replace(/(:\/\/[^/]*\/)resize.*?[?&]src=([^&]*).*?$/, "$1$2");
		if (domain_nowww === "art-dept.com") return src.replace(/\/cache\/([^/]*)_[0-9]+(\.[^/.]*)$/, "/$1$2");
		if (domain === "static.stylosophy.it" ||
			domain === "static.ellahoy.es" ||
			domain === "image.nanopress.it") {
			newsrc = src.replace(/(:\/\/[^/]*\/)(r\/+|[^/]+\/+fotogallery\/+)[0-9]+[xX][0-9]+\//, "$1$2999999999999X0/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/r\/+[0-9]+[xX][0-9]+\/+([^/]*\.[^/]*\/)/, "http://$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "static.stylosophy.it" ||
			domain === "static.ellahoy.es") {
			return src.replace(/(:\/\/[^/]*\/)[0-9]+X[0-9]+\/+www\/+/, "$1999999999999X0/www/");
		}
		if (amazon_container === "nikeinc" &&
			string_indexof(src, "/assets/") >= 0) {
			return src.replace(/_hd_[0-9]+(\.[^/.]*)$/, "_original$1");
		}
		if ((domain_nowww === "mitazamagica.com" ||
			domain === "mengqi.chenggong.it") &&
			string_indexof(src, "/Shops/") >= 0) {
			return src.replace(/_(?:s|m|ml)(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "imgbase.info" &&
			string_indexof(src, "/images/safe-wallpapers/") >= 0) {
			newsrc = src.replace(/\/[a-z]+_([0-9]+[^/]*)$/, "/$1");
			return {
				url: newsrc,
				headers: {
					Referer: "https://www.wallpapervortex.com/wallpaper-" + src.replace(/\/[a-z]+_([0-9]+[^/]*)\.[^/.]*$/, "$1") + ".html"
				}
			};
		}
		if (domain_nowww === "paperlief.com" ||
			domain_nowww === "celebritywc.com" ||
			domain_nowww === "ya-webdesign.com" ||
			domain_nowww === "quotationof.com" ||
			domain_nowww === "7desktopthemes.com" ||
			domain_nowww === "eskipaper.com") {
			return src.replace(/\/images[0-9]+_([0-9]+)?\//, "/images/");
		}
		if (domain_nosub === "anidb.net" && /^cdn[0-9]*(?:-[a-z]+)?\./.test(domain)) {
			return src.replace(/\/(thumbs|images)\/+[0-9]+(?:x[0-9]+)?\/+([0-9]+\.[^/.-?#]*)-thumb\.[^/.]+$/, "/$1/main/$2");
		}
		if (domain === "web-ace.jp") return src.replace(/\/rp\/[0-9_]+\/[0-9]+_[0-9]+\/img\//, "/img/");
		if (domain_nowww === "classy-girls.com" ||
			domain_nowww === "dillonmarsh.com") {
			return src.replace(/\/images\/+thumbnails\//, "/images/");
		}
		if (domain === "staticdelivery.nexusmods.com") return src.replace(/(\/images\/+(?:[0-9]+\/+)?)thumbnails\//, "$1");
		if (domain === "forums.nexusmods.com") return src.replace(/\/uploads\/profile\/photo-thumb-([0-9]+)/, "/uploads/profile/photo-$1");
		if ((domain_nowww === "kb4images.com" ||
			domain_nowww === "digitalimagemakerworld.com" ||
			domain_nowww === "99desktopwallpapers.com") &&
			string_indexof(src, "/images/") >= 0) {
			return src.replace(/-small(\.[^/.]*)$/, "$1");
		}
		if (domain === "pics.me.me") return src.replace(/\/thumb_([^/]*-[0-9]+\.[^/.]*)$/, "/$1");
		if (domain === "image.winudf.com") {
			if (/\/v2\/+image\//.test(src)) {
				return {
					url: add_queries(remove_queries(src, ["w", "h"]), {
						type: ".png"
					}),
					headers: {
						Accept: '*/*'
					}
				};
			}
		}
		if (domain === "i.supload.com") return src.replace(/\/[0-9]+x[0-9]+\//, "/");
		if (domain_nosub === "yaplakal.com" &&
			domain.match(/s[0-9]*\.yaplakal\.com/)) {
			return src.replace(/\/pics\/pics_[a-z]+\//, "/pics/pics_original/");
		}
		if (domain === "static.comicvine.com" ||
			domain === "static.giantbomb.com" ||
			domain === "static.gamespot.com" ||
			domain_nosub === "cbsistatic.com") {
			newsrc = src.replace(/(:\/\/[^/]+\/+)uploads\/+[^/]+\/+((?:mig\/+(?:[0-9]\/+){4}|[0-9]+\/+[0-9]+\/+)[0-9]+(?:-[^/]+)?\.)/, "$1uploads/original/$2");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (domain_nowww === "ibb.co") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([a-zA-Z0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://ibb.co/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/CHV\.obj\.image_viewer\.image\s*=\s*{.*?[^a-zA-Z0-9_]["']?url["']?:["'](.*?)["']/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var url = JSON_parse('"' + match[1] + '"');
					var obj = {
						url: url,
						extra: {
							page: urljoin(resp.finalUrl + "/", url.replace(/.*\/([^/.]*).*?$/, "$1"), true)
						}
					};
					var title = get_meta(resp.responseText, "og:title");
					if (title)
						obj.extra.caption = title;
					return done(obj, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "i.ibb.co" ||
			domain === "image.ibb.co" ||
			domain === "thumb.ibb.co" ||
			domain === "preview.ibb.co") {
			match = src.match(/^[a-z]+:\/\/[^/]*\/+([-_A-Za-z0-9=]+)\/+([^?#]*?)(\.[^/.]*)?(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://ibb.co/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain === "cdn.imagepush.to") return src.replace(/(:\/\/[^/]*\/)(?:in|out)\/[0-9]+x[0-9]+\//, "$1");
		if (domain === "storage.bhs.cloud.ovh.net") {
			newsrc = src.replace(/(\/v1\/+AUTH_[0-9a-f]+\/+images\/+[^/]+\/+[0-9]+\/+[^/]+)\.[0-9]+x[0-9]+\./, "$1.");
			if (newsrc !== src)
				return add_full_extensions(newsrc, ["mp4", "jpg"]);
		}
		if (domain_nosub === "luscious.net" && /^w[0-9]+\./.test(domain)) {
			return {
				url: src.replace(/^[a-z]+:\/\/[^/]+\/+/, "https://cdnio.luscious.net/"),
				can_head: false, // 403
				headers: {
					Referer: ""
				}
			};
		}
		if (domain_nosub === "luscious.net" && /^(?:cdn[a-z]*|gifs)\./.test(domain)) {
			newsrc = src
				.replace(/\.[0-9]+x[0-9]+(\.[^/]*)$/, "$1")
				.replace(/\/resized\/[0-9]+\//, "/");
			if (newsrc !== src) {
				return fillobj_urls(add_full_extensions(newsrc), {
					can_head: false,
					headers: {
						Referer: ""
					}
				});
			}
		}
		if (domain === "d2pqhom6oey9wx.cloudfront.net") return src.replace(/\/img_(?:thumb|resize)\//, "/img_original/");
		if (domain === "i.gyazo.com") return src.replace(/\/thumb\/[0-9]+\/([0-9a-f]+)-([a-z]+)\.[^/.]*$/, "/$1.$2");
		if (domain === "cdn.theatlantic.com") {
			newsrc = src.replace(/\/thumbor\/.*\/(?:assets\/+)?media\/+/, "/assets/media/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "cdn.theatlantic.com" &&
			src.match(/\/assets\/+media\/+(?:[^/]*\/)?img\//)) {
			return src.replace(/\/[^/.]*(\.[^/.]*)$/, "/original$1");
		}
		if (domain === "media.tag24.de") return src.replace(/(:\/\/[^/]*\/)[0-9]+\//, "$10/");
		if (amazon_container === "customink-iotw-east-prod" ||
			domain === "d2fzf9bbqh0om5.cloudfront.net") {
			return src.replace(/(\/images\/[0-9]+\/)[^/]*\//, "$1original/");
		}
		if (domain === "customink-prod.imgix.net") return src.replace(/^[a-z]+:\/\/[^/]+\/+photos\/+system\/+(images\/+[0-9]+\/+[a-z]+\/+[^/?#]+)(?:[?#].*)?$/, "https://s3.amazonaws.com/customink-iotw-east-prod/$1");
		if (domain_nowww === "mypokecard.com") return src.replace(/\/galery\/thumbs\//, "/galery/");
		if (domain === "media.women.com" &&
			string_indexof(src, "/images/images/") >= 0) {
			return src.replace(/\/[a-z]+\/([^/]*)$/, "/original/$1");
		}
		if (domain_nowww === "alternathistory.com") return src.replace(/\/files\/+resize(\/+.*\/+[^/]*)-[0-9]+x[0-9]+(\.[^/.]*)$/, "/files$1$2");
		if (domain === "img.velvet.by") return src.replace(/\/files\/+resize\/+(userfiles\/+[0-9]+\/+[^/]*)-[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/files/$1$2");
		if (domain_nowww === "mtvwe.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+vpic\.php\?(?:.*&)?f=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return urljoin(src, newsrc, true);
		}
		if (domain === "yahoo.tw.weibo.com") return src.replace(/(:\/\/[^/]+\/)[a-z]+\//, "$1large/");
		if (domain === "mobile.pic.people.com.cn") return src.replace(/\/thumbs\/+[0-9]+\/+[0-9]+\/+/, "/");
		if (domain === "images.asianstar.cz") return src.replace(/\/[a-z]+_([^/]*)$/, "/$1");
		if (domain === "images-cache.asianstar.cz") return src.replace(/:\/\/[^/]*\//, "://images.asianstar.cz/");
		if (domain === "picservice.qimai.cn") return src.replace(/^[a-z]+:\/\/[^/]*\/+get\/+(https?:)/, "$1");
		if (domain === "mediaday.co.kr" ||
			domain_nowww === "secretvt.com" ||
			domain === "file.candlemystar.com" ||
			domain_nowww === "5rs-1.com") {
			return src.replace(/\/cache\/+([_a-z]+\/+[0-9]{4}\/+[0-9]{2}\/+)thumb-([0-9a-f]+(?:_[0-9]+)?)_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/$1$2$3");
		}
		if (domain === "up.kpop.re" ||
			domain === "store.kpop.events") {
			newsrc = src.replace(/(:\/\/[^/]*\/)[a-z]+(\/[0-9a-f]{2}\/[0-9a-f]+\.[^/.]*)(?:\/[^/]*)?$/, "$1src$2");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (domain === "st.kp.yandex.net" &&
			string_indexof(src, "/images/") >= 0) {
			return src
				.replace(/_iphone\/+iphone[0-9]+_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "_original/$1")
				.replace(/\/[a-z]+_([0-9]+(?:_[^/]*)?\.[^/.]*)$/, "/$1");
		}
		if (domain_nowww === "startfilm.ru" && string_indexof(src, "/images/") >= 0) {
			return src
				.replace(/\/sm_([0-9]+_[^/]*)$/, "/$1")
				.replace(/(\/film\/+f_[0-9]+\/+)film_/, "$1");
		}
		if (domain_nowww === "publicfeet.com") return src.replace(/\/img\/t([0-9]+\.[^/.]*)$/, "/img/$1");
		if (domain_nowww === "twatis.com") return src.replace(/\/thumb(\.[^/.]*)$/, "/photo$1");
		if (domain === "s.smutty.com" ||
			domain === "i.smutty.com") {
			return src.replace(/\/[a-z]\/+([^/]*)(?:[?#].*)?$/, "/b/$1");
		}
		if (domain_nowww === "welovesexyfeet.com" ||
			domain_nowww === "podolatria.net" ||
			domain === "img.ibxk.com.br") {
			return src.replace(/-t[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "hotflick.net" ||
			amazon_container === "hotflicknet") {
			return src
				.replace(/(:\/\/[^/]*\/.*\/[0-9]+\/)tn\/[0-9]+_[a-z]+\/([^/]*)$/, "$1$2")
				.replace(/\/+(?:tn[0-9]+|Thumb)\/+([^/]*)(?:[?#].*)?$/, "/$1")
				.replace(/:\/\/(?:[^/.]*-)?s3\.amazonaws\.com\/hotflicknet\/(.*\/)tn\/([^/]*)$/, "://hotflicknet.s3.amazonaws.com/$1$2")
				.replace(/:\/\/[^/]*\/(.*\/)tn\/([^/]*)$/, "://hotflicknet.s3.amazonaws.com/$1$2");
		}
		if (domain_nowww === "seniorclassaward.com" ||
			domain_nowww === "raincoast.com" ||
			domain_nowww === "zocalo.com.mx") {
			return src.replace(/\/images\/sized(\/images\/.*)-[0-9]+x[0-9]+(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "hentairing.com") {
			return src
				.replace(/\/(?:width|height)-[0-9]+\/([^/]*)(?:[?#].*)?$/, "/$1")
				.replace(/\?.*/, "");
		}
		if (domain_nosub === "enterdesk.com" && /^up\./.test(domain)) {
			return src.replace(/\/edpic_[0-9]+(?:_[0-9]+)?\//, "/edpic_source/");
		}
		if (domain_nosub === "gtimg.com" && /^img[0-9]*\./.test(domain)) {
			return {
				url: src.replace(/_[0-9]+x[0-9]+(?:_[0-9]+)?(\.[^/.]*)$/, "$1"),
				can_head: false // wrong content-length, and GET forces download (but not HEAD)
			};
		}
		if (domain_nosub === "zol-img.com.cn") {
			return src
				.replace(/(:\/\/[^/]*\/)t_[0-9a-z]+\//, "$1")
				.replace(/(\/article\/[0-9]+)_[0-9]+x[0-9]+\//, "$1/");
		}
		if (domain === "img.faxing11.com" ||
			domain === "img.pipimi.com") {
			return src.replace(/^[a-z]+:\/\/[^/]*\/img\//, "http://");
		}
		if (domain_nowww === "bifaxing.com") return src.replace(/^[a-z]+:\/\/[^/]*\/gpPic\/+[0-9]+\/+[0-9]+\/+([^/]*\.[^/]*)/, "http://$1");
		if (domain === "static.congnghe.vn" ||
			domain_nowww === "congnghe.vn") {
			newsrc = src.replace(/\/srv_thumb\.ashx.*?[?&]f=([^&]*).*/, "/$1");
			if (newsrc !== src)
				return newsrc.replace(/\\/g, "/");
			return src.replace(/\/[^/]*-([0-9]+\.[^/.]*)\.[0-9]+\.[0-9]+\.[^/.]*$/, "/$1");
		}
		if (domain === "images.foody.vn") return src.replace(/\/s[0-9]+x[0-9]+\/([^/]*)$/, "/s/$1");
		if (domain === "programma.sorrisi.com" ||
			domain_nowww === "shamra.sy") {
			return src.replace(/\/uploads\/+media\/+cache\/+[^/]*\/+uploads\//, "/uploads/");
		}
		if (domain_nowww === "vidofa.com") {
			newsrc = src.replace(/.*?\/module\/+thumb\/+sr\.php\?(?:.*&)?src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "free4kwallpapers.com") {
			return src
				.replace(/\/uploads\/+wallpaper\/+([0-9]{2}\/.*)-[0-9]+x[0-9]+-wallpaper(\.[^/.]*)$/, "/uploads/originals/20$1$2")
				.replace(/\/uploads\/+originals\//, "/no-watermarks/originals/");
		}
		if (domain_nosub === "webnode.com.br" ||
			domain_nosub === "webnode.cz" ||
			domain_nosub === "webnode.sk" ||
			domain_nosub === "webnode.com") {
			return src.replace(/(:\/\/(?:files\.[^/]*\.[^/.]*\.[^/]*\/+|[^/]*\/+_files\/+))(?:[^/]*_)?([0-9]+-[0-9a-f]+(?:-[a-z]+)?\/)+(?:[0-9]+\/+)?([^/]*)$/, "$1$2$3");
		}
		if (amazon_container === "cdn.roosterteeth.com") {
			return src.replace(/(\/images\/[-0-9a-f]+\/)[a-z]+(\/[^/]*)$/, "$1original$2");
		}
		if (domain_nowww === "wallpaperk.com") return src.replace(/\/resoluciones\/[0-9]+\/([^/]*)_[0-9]+x[0-9]+_([0-9]+\.[^/.]*)$/, "/$1-$2");
		if (domain === "pic.58pic.com" ||
			domain_nosub === "90sjimg.com" ||
			domain === "pic.qiantucdn.com") {
			return src.replace(/!.*/, "");
		}
		if (domain === "img.wallpapersafari.com" ||
			domain === "cdn.wallpapersafari.com") {
			newsrc = src
				.replace(/\/img[0-9]+\//, "/")
				.replace(/\/desktop\/+[0-9]+\/+[0-9]+\//, "/");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+[0-9]+\/+[0-9]+\/+([^/.]+)\.[^/.]+$/);
			if (match) {
				return {
					url: src,
					extra: {
						page: "https://www.wallpapersafari.com/w/" + match[1]
					}
				};
			}
		}
		if (domain === "mcdn.wallpapersafari.com") return src.replace(/:\/\/mcdn(\.[^/]*\/)(?:medium|small)\/+/, "://cdn$1");
		if ((domain_nosub === "fjcdn.com" && /^static[0-9]*\./.test(domain)) ||
			domain_nosub === "funnyjunk.com") {
			return src
				.replace(/\/thumbnails\/+comments\//, "/comments/")
				.replace(/\/pictures\/+[^/]*_([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]+_[0-9]+\.[^/.]*)$/, "/large/pictures/$1/$2/$1$2$3");
		}
		if (googlestorage_container === "kendam-148811.appspot.com") {
			return src.replace(/\/thumb[0-9]+\/tn[0-9]+_/, "/temp/");
		}
		if (domain === "image-cdn.hypb.st") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/([^&]*).*/, "$1"));
		}
		if (domain_nowww === "productionparadise.com") return src.replace(/(\/photos\/[0-9]+\/)[a-z]+(\/[^/]*)$/, "$1original$2");
		if (domain_nosub === "cargocollective.com" && /^payload[0-9]*\./.test(domain)) {
			return src.replace(/_[0-9]{3,4}(?:_c)?(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "imagebam.com") {
			var process_imagebam = function(done, resp, cache_key) {
				/*var ogimage = get_meta(resp.responseText, "og:image");
				if (!ogimage) {
					console_error(cache_key, "Unable to find og:image from", resp);
					return done(null, false);
				}*/
				var match = resp.responseText.match(/<img src="(https?:\/\/images[0-9]*\.imagebam\.com\/[^"]+)" [^>]*class="main-image/);
				if (!match) {
					console_error(cache_key, "Unable to find main image from", resp);
					return done(null, false);
				}
				var ogimage = match[1];
				done({
					url: ogimage,
					is_original: true,
					headers: {
						Referer: "https://www.imagebam.com/"
					},
					referer_ok: {
						same_domain_nosub: true
					},
					extra: {
						page: resp.finalUrl
					}
				}, 60 * 60);
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+image\/+([0-9a-f]+)(?:[?#].*)?$/,
				query_for_id: "https://www.imagebam.com/image/${id}",
				process: process_imagebam
			});
			if (newsrc)
				return newsrc;
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+view\/+([0-9A-Z]+)(?:[?#].*)?$/,
				query_for_id: "https://www.imagebam.com/view/${id}",
				process: process_imagebam
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "imagebam.com" && /^thumb(?:nail)?s[0-9]*\./.test(domain)) {
			id = src.replace(/.*\/([0-9a-f]+)\.[^/.]*$/, "$1");
			if (id !== src) {
				return {
					url: "https://www.imagebam.com/image/" + id,
					is_pagelink: true
				};
			}
			id = src.replace(/.*\/([0-9A-Z]+)_t\.[^/.]+$/, "$1");
			if (id !== src) {
				return {
					url: "https://www.imagebam.com/view/" + id,
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "imagebam.com") {
			if (/\/nohotlinking\.jpg(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: true
				};
			}
			if (string_indexof(src, "/download/") >= 0) {
				return {
					url: src,
					is_original: true,
					headers: {
						Referer: "https://www.imagebam.com/"
					},
					referer_ok: {
						same_domain_nosub: true
					}
				};
			}
		}
		if (domain_nosub === "imagevenue.com") {
			if (/^[a-z]+:\/\/[^/]+\/+no_image\./.test(src)) {
				return {
					url: src,
					bad: true
				};
			}
		}
		if (domain_nosub === "imagevenue.com" &&
			domain.match(/^img[0-9]+\.imagevenue\.com/) &&
			src.match(/\/th_([^/]*)$/) &&
			options && options.cb && options.do_request) {
			id = src.replace(/.*\/th_([^/]*?)(?:[?&#].*)?$/, "$1");
			if (id !== src) {
				var requrl = src.replace(/(:\/\/[^/]*\/).*/, "$1img.php?image=" + id);
				var query_imagevenue = function(requrl, cb) {
					var do_req = function(requrl, first, cb) {
						var headers = {
							Referer: requrl
						};
						options.do_request({
							url: requrl,
							method: "GET",
							headers: headers,
							onload: function(resp) {
								if (resp.status !== 200) {
									console_error("Bad status", resp);
									return cb(null);
								}
								var match = resp.responseText.match(/<img *id=['"]thepic['"][^>]* (?:src|SRC)=['"]([^"']*)['"]/);
								if (!match) {
									match = resp.responseText.match(/<a href="https?:\/\/www\.imagevenue\.com\/view\/o\?[\s\S]*?<img src="(https?:\/\/(?:img|cdn)[^/]*\.imagevenue\.[^"']+)"/);
								}
								var baseobj = {
									extra: {
										page: requrl
									},
									bad_if: [{
											headers: {
												"Last-Modified": "Mon, 04 May 2020 07:19:52 GMT",
												"Content-Length": "14396",
												"Content-Type": "image/jpeg"
											}
										}]
								};
								if (match) {
									cb(fillobj_urls([{
											url: urljoin(resp.finalUrl, match[1], true),
											is_original: true,
										}, src], baseobj));
								} else {
									console_error("Unable to find match", resp);
									if (first) {
										return do_req(resp.finalUrl, false, cb);
									} else {
										cb(null);
									}
								}
							}
						});
					};
					api_cache.fetch("imagevenue:" + requrl, cb, function(done) {
						do_req(requrl, true, function(data) {
							if (!data) {
								return done(null, false);
							} else {
								return done(data, 60 * 60);
							}
						});
					});
				};
				query_imagevenue(requrl, options.cb);
				return {
					waiting: true
				};
			}
		}
		if (domain_nowww === "imagevenue.com") {
			if (/\/images\/+loader\.svg/.test(src))
				return {
					url: src,
					bad: "mask"
				};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([A-Z0-9]{5,})(?:[?#].*)?$/,
				query_for_id: "https://www.imagevenue.com/${id}",
				process: function(done, resp, cache_key, match) {
					var match = resp.responseText.match(/<img src="(https?:\/\/(?:cdn-images\.[^"]+_o\.[^"]+|cdno-data\.[^"]+))"/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done(match[1], 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "cdn-thumbs.imagevenue.com") {
			match = src.match(/\/(?:[0-9a-f]{2}\/+){3}([A-Z0-9]+)_t\./);
			if (match) {
				return {
					url: "https://www.imagevenue.com/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain === "static.cinemagia.ro") return src.replace(/\/img\/resize\/db\/(.*\/(?:[^/]*?-)?[0-9]+[a-z])-[^/.]*?(\.[^/.]*)$/, "/img/db/$1$2");
		if (domain === "static.kinokopilka.pro") return src.replace(/(\/[0-9]+)_[a-z]+(\.[^/.]*)$/, "$1_original$2");
		if (domain === "d1uzk9o9cg136f.cloudfront.net") return src.replace(/(\/[a-f0-9]+)_[a-z]+(\.[^/.]*)$/, "$1$2");
		if (domain === "static.azteca.com") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/crop\/crop\.php.*?[?&]img=([^&]*).*?$/, "$1"));
		}
		if (domain_nowww === "tasoeur.biz") return src.replace(/\/thumbs\/([^/]*)\.thumb(\.[^/.]*)$/, "/$1$2");
		if (domain_nowww === "taipeitimes.com") return src.replace(/(\/images\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2})thumbs\/+/, "$1");
		if (domain === "imageproxy.ifcdn.com" ||
			domain === "imageproxy.ifunny.co") {
			return src.replace(/:\/\/[^/]*\/+[^/]*(\/(?:images|user_photos)\/+[^/]*)(?:[?#].*)?$/, "://img." + domain_nosub + "$1");
		}
		if (domain === "resource.mingweekly.com") return src.replace(/\/userfiles\/sm\/sm[0-9]+_images/, "/userfiles/images");
		if (domain_nosub === "allegroimg.com") return src.replace(/(:\/\/[^/]*\/)s[0-9]+\//, "$1original/");
		if (domain === "mmc.tirto.id") return src.replace(/\/image\/otf\/[0-9]+x[0-9]+\//, "/image/");
		if (domain === "ia.tmgrup.com.tr" ||
			domain === "iaahbr.tmgrup.com.tr") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/[^/]*\/(?:[0-9]+\/){5}[0-9]+\/?.*?[?&]u=([^&]*).*?$/, "$1"));
		}
		if (domain === "img.erogazou.co") return src.replace(/\/thumb\//, "/photo/");
		if (domain === "tracks.content.hardstyle.com") return src.replace(/\/thumbs\/[0-9]+x[0-9]+\//, "/original/");
		if ((domain_nosub === "thedjlist.com" && domain.match(/i[0-9]*\./)) ||
			domain === "static.inaturalist.org") {
			return src.replace(/(\/photos\/[0-9]+\/)[a-z]+(\.[^/.]*)$/, "$1original$2");
		}
		if (domain === "artist-assets.hubbardradio.com") return src.replace(/_v[0-9]+(\.[^/.]*)$/, "$1");
		if (domain === "cdn.ebaumsworld.com" ||
			domain === "images.ebaumsworld.com") {
			return src.replace(/\/thumbs\/(?:picture|gallery)\//, "/mediaFiles/picture/");
		}
		if (domain_nosub === "kapook.com") {
			return src
				.replace(/\/rf\/[0-9]+\/[0-9]+\//, "/o/")
				.replace(/\/rq\/+[0-9]+\/+auto\/+[0-9]+\/+pagebuilder\/+/, "/pagebuilder/");
		}
		if (domain_nosub === "amcn.in" &&
			domain.match(/^cdn[0-9]*\.amcn\.in/)) {
			return src.replace(/^[a-z]+:\/\/[^/]*\/a\/([^/.]*\.[^/]*\/)/, "http://$1");
		}
		if (domain_nosub === "litlepups.net" &&
			domain.match(/^cdn[0-9]*\.litlepups\.net/)) {
			return src.replace(/:\/\/[^/]*\/resize\/(.*)\/[a-z]+-([^/]*)$/, "://cdn.litlepups.net/$1/$2");
		}
		if (domain_nowww === "wede-mail.com" ||
			domain_nowww === "warnerchappell.com") {
			return src.replace(/\/slir\/(?:[whc][0-9:]+(?:-[^/]*)|orig)\//, "/");
		}
		if (domain_nowww === "photorator.com" ||
			domain_nowww === "contrastspace.ru" ||
			domain_nowww === "galleon-realty.ru" ||
			domain_nowww === "teatrvmeste.ru" ||
			domain_nowww === "pornopics.co") {
			newsrc = src.replace(/\/photos\/(?:thumbs|small)\//, "/photos/images/");
			page = src.replace(/(\/photo)s\/+[^/]+\/+[^/]+-([0-9]+)\.[^/.]+(?:[?#].*)?$/, "$1/$2");
			if (page !== src) {
				return {
					url: newsrc,
					extra: {
						page: page
					}
				};
			} else {
				return newsrc;
			}
		}
		if (domain_nowww === "expressen.se") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+videoplayer\/+embed\/+([^?#]*)(?:[?#].*)?$/,
				query_for_id: "https://www.expressen.se/videoplayer/embed/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<body>\s*<figure\s+class="evp evp--embeded"\s+data-article-data='({[^']+})'/);
					if (!match) {
						console_error(cache_key, "Unable to find figure match for", resp);
						return done(null, false);
					}
					var decoded = decode_entities(match[1]);
					var parsed = JSON_parse(decoded);
					var obj = {
						extra: {
							page: urljoin(resp.finalUrl, parsed.linkUrl, true),
							caption: parsed.title
						}
					};
					var urls = [];
					if (parsed.stream) {
						urls.push({
							url: parsed.stream,
							video: "hls"
						});
					}
					if (parsed.mp4File) {
						urls.push({
							url: parsed.mp4File,
							video: true
						});
					}
					if (parsed.image) {
						urls.push(parsed.image);
					}
					return done(fillobj_urls(urls, obj), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "cdn-expressen.se") {
			newsrc = src.replace(/\/[0-9]+(?:@[0-9]+)?(\.[^/.]*)$/, "/original$1");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/[0-9a-f]+\/)[0-9]+x[0-9]+(\/[^/]*)$/, "$1annan$2");
		}
		if (domain === "images.csmonitor.com") return src.replace(/(?:\?.*)?$/, "?alias=original");
		if (domain_nowww === "incimages.com" ||
			domain_nowww === "firenewsfeed.com") {
			newsrc = src.replace(/\/image\/[0-9]+x[0-9]+\//, "/image/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "firenewsfeed.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+image\/+(?:[0-9]+x[0-9]+\/+)?(aHR0c[^?#./]+)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain === "cached.imagescaler.hbpl.co.uk") return src.replace(/^[a-z]+:\/\/[^/]*\/resize\/[^/]*\/[0-9]+\/([^/]*\.[^/]*\/)/, "http://$1");
		if (domain === "i.tuenlinea.com") return src.replace(/(\/[^/]*(\.[^/.]*))\.img[wh]\.[0-9]+\.[0-9]+\.[^/.]*$/, "$1.imgo$2");
		if (domain === "cdn-photos.extratv.com") return src.replace(/_thumb(\.[^/.]*)$/, "_full$1");
		if (domain === "media.extratv.com") return src.replace(/-(?:[0-9]+x[0-9]+|[0-9]+[wh])(?:-[0-9]+)?(\.[^/.]*)$/, "$1");
		if (domain === "i.wpimg.pl") return src.replace(/^[a-z]+:\/\/[^/]*\/(?:[A-Z]\/)?[0-9]+x(?:[0-9]+)?\//, "http://");
		if (domain === "static.keptelenseg.hu") return src.replace(/\/thumbs\/thumb\/p\//, "/p/");
		if (domain_nosub === "wdfiles.com") return src.replace(/\/local--resized-images\/(.*\.[^/.]*)\/[a-z]+\.[^/.]*$/, "/local--files/$1");
		if (domain_nowww === "astrofactor.com") return src.replace(/(\/imgs\/[^/]*\/)[0-9]+(\/[^/]*)$/, "$1full$2");
		if (domain === "makeup.nuovogennarino.org") return src.replace(/^[a-z]+:\/\/[^/]*\/static\/[0-9]+\/img\/([^/.]+\.[^/]+)/, "http://$1");
		if ((domain_nosub === "newsdog.today" && domain.match(/^img[0-9]*\./)) ||
			amazon_container === "img.newsdog.today") {
			return src.replace(/(\.newsdog\.today\/)[a-z_]+_([a-f0-9]+)$/, "$1origin_$2");
		}
		if (domain === "d1qikntta4cp8k.cloudfront.net") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/.*?[?&]url=([^&]*)$/, "$1"));
		}
		if (domain_nosub === "img.com.ua") {
			newsrc = src.replace(/\/[0-9]+x[0-9]+(\/[0-9a-f]\/[0-9a-f]{2}\/[0-9a-f]+\.[^/.]*)$/, "/orig$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "rs.img.com.ua") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/crop.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src) {
				return urljoin(src, decodeURIComponent(newsrc), true);
			}
		}
		if (domain === "img-hw.xvideos.com" ||
			domain === "img-hw.xvideos-cdn.com") {
			return src.replace(/(\/pic_[0-9]+)_[a-z]+(\.[^/.]*)$/, "$1_big$2");
		}
		if (domain_nowww === "xvideos.com" ||
			domain === "flashservice.xvideos.com" ||
			domain_nowww === "xvideos.xxx" ||
			domain_nowww === "xvideos.net" ||
			domain_nowww === "xvideos.es" ||
			domain_nowww === "xnxx.com" ||
			domain_nowww === "xnxx.es") {
			var our_host = domain_nosub.replace(/\..*/, "");
			var full_videourl = function(videourl) {
				if (our_host === "xvideos") {
					return urljoin("https://www.xvideos.com/", videourl, true);
				} else if (our_host === "xnxx") {
					return urljoin("https://www.xnxx.com/", videourl, true);
				}
			};
			var parse_xvideos_page = function(cache_key, resp) {
				var matches = resp.responseText.match(/html5player\.set(.*)/g);
				if (!matches) {
					console_error(cache_key, "Unable to find matches", resp);
					return null;
				}
				var table = {};
				for (var i = 0; i < matches.length; i++) {
					var match = matches[i].match(/html5player\.set([a-zA-Z0-9]+)\('([^']+)'\);$/);
					if (!match) {
						continue;
					}
					table[match[1]] = decode_entities(match[2]);
				}
				return table;
			};
			var objify_xvideos_table = function(table) {
				var obj = {
					headers: {
						Referer: "https://www.xvideos.com/"
					},
					extra: {}
				};
				if (table.VideoTitle) {
					obj.extra.caption = table.VideoTitle;
				}
				if (table.VideoURL) {
					obj.extra.page = full_videourl(table.VideoURL);
				}
				var urls = [];
				if (table.VideoHLS) {
					urls.push({
						url: table.VideoHLS,
						video: "hls"
					});
				}
				if (table.VideoUrlHigh) {
					urls.push({
						url: table.VideoUrlHigh,
						video: true
					});
				}
				if (table.VideoUrlLow) {
					urls.push({
						url: table.VideoUrlLow,
						video: true
					});
				}
				urls.push(page_nullobj);
				return fillobj_urls(urls, obj);
			};
			var videoid_to_videourl = function(videoid) {
				if (our_host === "xvideos") {
					return "https://www.xvideos.com/video." + videoid + "/a";
				} else if (our_host === "xnxx") {
					return "https://www.xnxx.com/video-" + videoid + "/";
				}
			};
			var query_xvideos_page = function(videoid, cb) {
				var cache_key = "xvideos:" + videoid;
				if (our_host === "xnxx")
					cache_key = "xnxx:" + videoid;
				api_cache.fetch(cache_key, cb, function(done) {
					options.do_request({
						url: videoid_to_videourl(videoid),
						method: "GET",
						onload: function(resp) {
							if (resp.readyState !== 4)
								return;
							if (resp.status !== 200) {
								console_error(cache_key, resp);
								return done(page_nullobj, false);
							}
							var parsed_table = parse_xvideos_page(cache_key, resp);
							if (!parsed_table) {
								return done(page_nullobj, false);
							}
							var obj = objify_xvideos_table(parsed_table);
							if (!obj) {
								console_error(cache_key, "Unable to get URLs from", parsed_table, resp);
								return done(page_nullobj, false);
							}
							return done(obj, 3 * 60 * 60);
						}
					});
				});
			};
			var get_videoid_from_url = function(url) {
				var regex = null;
				if (our_host === "xvideos") {
					regex = /:\/\/[^/]+\/+(?:video\.?|embedframe\/+)([0-9a-z]+)(?:\/+.*)?(?:[?#].*)?$/;
				} else if (our_host === "xnxx") {
					regex = /:\/\/[^/]+\/+video-([^-/._]+)\//;
				}
				if (!regex)
					return null;
				var match = url.match(regex);
				if (!match)
					return null;
				return match[1];
			};
			page_nullobj = {
				url: src,
				is_pagelink: true
			};
			id = get_videoid_from_url(src);
			if (id) {
				if (options.do_request && options.cb) {
					query_xvideos_page(id, options.cb);
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if ((host_domain_nowww === "xvideos.com" ||
			host_domain_nowww === "xvideos.xxx" ||
			host_domain_nowww === "xvideos.net" ||
			host_domain_nowww === "xvideos.es" ||
			host_domain_nowww === "xnxx.com" ||
			host_domain_nowww === "xnxx.es") &&
			options.element && options.do_request && options.cb) {
			var our_host = host_domain_nosub.replace(/\..*/, "");
			;
			var videoid_to_videourl = function(videoid) {
				if (our_host === "xvideos") {
					return "https://www.xvideos.com/video" + videoid + "/";
				} else if (our_host === "xnxx") {
					return "https://www.xnxx.com/video-" + videoid + "/";
				}
			};
			var get_videoid_from_url = function(url) {
				var regex = null;
				if (our_host === "xvideos") {
					regex = /:\/\/[^/]+\/+(?:video|embedframe\/+)([0-9]+)/;
				} else if (our_host === "xnxx") {
					regex = /:\/\/[^/]+\/+video-([^-/._]+)\//;
				}
				if (!regex)
					return null;
				var match = url.match(regex);
				if (!match)
					return null;
				return match[1];
			};
			var get_xvideos_vidid_from_el = function(el) {
				for (var current = el; current; current = current.parentElement) {
					if (current.tagName === "A") {
						var id = get_videoid_from_url(current.href);
						if (id) {
							return id;
						}
					}
				}
			};
			var vidid = get_xvideos_vidid_from_el(options.element);
			if (vidid) {
				return videoid_to_videourl(vidid);
			}
		}
		if (domain === "camo.derpicdn.net") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/[0-9a-f]+\?url=([^&]*).*?$/, "$1"));
		}
		if (domain === "live.store.cmcm.com") return src.replace(/(:\/\/[^/]*\/)[a-z]+\/(liveme\/)/, "$1$2");
		if (domain === "media.timeout.com") return src.replace(/(\/images\/[0-9]+\/)[0-9]+\/[0-9]+\/([^/]*)$/, "$1$2");
		if (domain_nowww === "tokkoro.com") return src.replace(/\/thumbs\//, "/picsup/");
		if (domain_nowww === "wallpapermaiden.com") {
			newsrc = src.replace(/(\/image\/[0-9]+\/[0-9]+\/[0-9]+\/[^/]*)-resized(\.[^/.]*)$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			id = src.replace(/(\/wallpaper\/[0-9]+\/)download\/[0-9]+x[0-9]+\/([^/]*)\.[^/.]*(?:[?#].*)?$/, "$1$2");
			if (id !== src &&
				options && options.cb && options.do_request) {
				options.do_request({
					url: id,
					method: "GET",
					onload: function(resp) {
						if (resp.readyState === 4) {
							var match = resp.responseText.match(/<meta *property="og:image" *content="([^"]*)"/);
							if (match) {
								options.cb(match[1]);
							} else {
								options.cb(null);
							}
						}
					}
				});
			}
		}
		if (domain_nosub === "pictoa.com" ||
			domain_nosub === "lilitube.com" ||
			domain_nosub === "heavenlynudes.net" ||
			domain_nosub === "nufap.com" ||
			domain_nosub === "fapsex.com" ||
			domain_nosub === "clickmyboobs.com" ||
			domain_nosub === "papajizz.com" ||
			domain_nosub === "babaporn.com") {
			newsrc = src.replace(/(\/[0-9a-f]{3}\/+[0-9a-f]{3}\/+[0-9a-f]+\/+)thumbs\/+([^/]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/^([a-z]+:\/\/)t([0-9]*\.)/, "$1s$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "bbend.net" ||
			domain === "cdn.cnngreece.gr" ||
			domain_nowww === "funtime.gr" ||
			domain === "i.mommd.gr" ||
			domain === "i.rtpmd.gr" ||
			domain === "i.gosmd.gr" ||
			domain === "i.astmd.gr" ||
			domain === "i.onmmd.gr" ||
			domain === "i.lfmd.gr" ||
			domain === "i.qumd.gr") {
			newsrc = src
				.replace(/(\/media\/+.*\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+\/+)(?:facebook\/+facebook|(?:thumb|snapshot|facebook)\/+)/, "$1main/")
				.replace(/(\/media\/+.*\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+\/+photos\/+)[a-z]+\/+/, "$1full/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "i.gosmd.gr") {
			if (/\/templates\/+gossip\/+images\/+placeholder\.jpg/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "static.fustany.com") {
			return {
				url: src.replace(/\/photo\/[a-z]+_([^/]*)$/, "/photo/$1"),
				headers: {
					Referer: "http://fustany.com/en/fashion/celebrity-style/front-row-celebrities-at-new-york-fashion-week-spring-2015"
				}
			};
		}
		if (domain_nosub === "protv.md" &&
			domain.match(/^assets[0-9]*\.protv/)) {
			return src
				.replace(/:\/\/[^/]*\/articles\/files\/thumbs\/[0-9]+x(?:[0-9]+)?(\/[0-9]+\.[^/.]*)$/, "://retete.perfecte.md/assets/articles/images/original$1")
				.replace(/\/articles\/+files\/+thumbs\/+[0-9]+x(?:[0-9]+)?\/+/, "/articles/images/original/");
		}
		if (domain_nowww === "bgol.us" ||
			domain_nowww === "defenceforumindia.com") {
			return decodeURIComponent(src.replace(/.*?\/forum\/proxy\.php.*?[?&]image=([^&]*).*?$/, "$1"));
		}
		if (domain === "resources.tidal.com") return src.replace(/\/[0-9]+x[0-9]+(\.[^/.]*)$/, "/origin$1");
		if (domain === "i.kfs.io") return src.replace(/\/(?:fit|cropresize)\/+[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/original$1");
		if (domain_nosub === "fuskator.com") {
			return {
				url: src
					.replace(/(:\/\/[^/]*\/)small\//, "$1large/"),
				can_head: false
			};
		}
		if (domain === "ssref.net") {
			return decodeURIComponent(src.replace(/.*?\/image_resize\.cgi.*?[?&]url=([^&]*).*?$/, "$1"));
		}
		if (domain_nosub === "intermedia.ge" /* &&
			domain.match(/server[0-9]*\.intermedia\.ge/)*/) {
			return src
				.replace(/(\/article_images[0-9]*\/)[a-z]+\//, "$1large/")
				.replace(/\/pictures\/[a-z]+\//, "/pictures/original/");
		}
		if (domain_nowww === "sqshi.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/img\.php.*?[?&]imgurl=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "i.annihil.us") return src.replace(/(\/[0-9a-f]+\/)detail(\.[^/.]*)$/, "$1clean$2");
		if (domain === "pimg.mycdn.me" ||
			(domain_nosub === "sywcdn.net" && domain.match(/^s[0-9]*\./))) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/getImage.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "dissidia-france.com") return src.replace(/\/small\/([^/]*)$/, "/big/$1");
		if (domain === "cdn.asiatatler.com" ||
			domain_nowww === "indonesiatatler.com") {
			return src.replace(/_(?:cropped|resized)_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "stylowi.pl" &&
			domain.match(/^img[0-9]*\.stylowi\.pl/)) {
			return src.replace(/\/images\/items\/[a-z]\//, "/images/items/o/");
		}
		if (domain === "files.dals.media") return src.replace(/__[a-z]+__(\.[^/.]*)$/, "__original__$1");
		if (domain === "media.linkonlineworld.com") return src.replace(/\/img\/large\//, "/img/original/");
		if (amazon_container === "marieclairebucket") {
			return src.replace(/000[0-9]+?x[0-9]+(\.[^/.]*)$/, "000$1");
		}
		if (domain_nosub === "nh.ee" ||
			domain_nosub === "delphi.lv" ||
			domain_nosub === "delfi.ee" ||
			domain_nosub === "dcdn.lt") {
			return src.replace(/\/images\/pix\/[0-9]+x[0-9]+\//, "/images/pix/");
		}
		if (domain === "read.html5.qq.com" ||
			domain === "cdn.read.html5.qq.com") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/image.*?[?&]imageUrl=([^&]*).*?$/, "$1"));
		}
		if (domain === "img.chuansong.me" ||
			domain === "img.weiduba.net" ||
			(domain_nosub === "zx590.com" && domain.match(/^img[0-9]*\./)) ||
			(domain_nosub === "jinciwei.cn" && domain.match(/img[0-9]*\./))) {
			return src.replace(/:\/\/[^/]*\/(mmbiz(?:_[a-z]+)?)\//, "://mmbiz.qpic.cn/$1/");
		}
		if (domain === "cdn.iguang.co") return src.replace(/:\/\/[^/]*\/[0-9a-f]+\/(mmbiz(?:_[a-z]+)?)\//, "://mmbiz.qpic.cn/$1/");
		if (domain === "pic.kuaizhan.com") {
			return src.replace(/\/imageView\/v[0-9]*\/.*/, "");
		}
		if ((domain_nosub === "popcornnews.ru" && domain.match(/v[0-9]*\.popcornnews\.ru/)) ||
			domain === "static.kinoafisha.info") {
			return src
				.replace(/(:\/\/[^/]*\/+)k\/+[a-z_]+\/+[0-9]+(?:x[0-9]+)?\/+upload\//, "$1upload/")
				.replace(/(:\/\/[^/]*\/+upload\/+)_[0-9]+_[0-9]+_[0-9]+_([^/_.]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "amorq.com" ||
			domain_nowww === "prikolno.cc" ||
			domain_nowww === "interesno.cc" ||
			domain_nowww === "obaldenno.com") {
			return src.replace(/\/uploads\/tumb(\/[a-z]+\/[0-9]+\/[^/.]+)_tumb_[0-9]+(\.[^/.]*)$/, "/uploads$1$2");
		}
		if (domain_nosub === "pinme.ru" &&
			domain.match(/^cdn/)) {
			return src.replace(/\/+tumb\/+[0-9]+\/+photo\//, "/photo/");
		}
		if (domain_nosub === "kakprosto.ru") return src.replace(/\/tumb\/+[0-9]+\/+images\//, "/images/");
		if (domain_nosub === "postila.ru" &&
			domain.match(/^img[0-9]*\.postila\.ru/)) {
			return urljoin(src, decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/resize.*?[?&]src=([^&]*).*?$/, "$1")), true);
		}
		if (domain_nowww === "enolivier.com" ||
			domain_nowww === "fotoventasdigital.com") {
			return src.replace(/\/_thumb\/([^/]*)_[0-9]+x[0-9]+(\.[^/.]*)$/, "/_fullsize/$1$2");
		}
		if (domain === "ss.metronews.ru" ||
			domain === "ss.sport-express.ru") {
			return src.replace(/(\/userfiles\/materials\/[0-9]+\/[0-9]+\/)(?:[0-9]+x[0-9]+|[a-z]+)(\.[^/.]*)$/, "$1origin$2");
		}
		if (domain_nosub === "mtvnimages.com" ||
			domain === "images.paramount.tech" ||
			domain === "imagesmtv-a.akamaihd.net") {
			newsrc = remove_queries(src, ["quality", "width", "height", "crop", "legacyStatusCode", "gen"]);
			if (newsrc !== src) {
				return {
					url: newsrc,
					can_head: false
				};
			}
			newsrc = src.replace(/\?.*$/, "");
			if (false && newsrc !== src) {
				return {
					url: newsrc,
					can_head: false
				};
			}
		}
		if (domain_nosub === "mtvnimages.com" ||
			domain === "imagesmtv-a.akamaihd.net") {
			return src.replace(/^[a-z]+:\/\/[^/]*\/uri\/mgid:file:(https?):shared:([^/:]*\/)/, "$1://$2");
		}
		if (domain_nowww === "vh1.com") {
			return {
				url: src,
				can_head: false
			};
		}
		if (domain === "user-uploads.aznude.com") return src.replace(/(:\/\/[^/]*\/data\/)thumbs\//, "$1azncdn/");
		if (domain_nosub === "aznude.com" && /^cdn[0-9]*\./.test(domain)) {
			newsrc = src.replace(/\/antibandit\/+([^/]+\/+[^/]+\/+)thumb[0-9]+_/, "/$1");
			if (newsrc !== src)
				return newsrc;
			regex = /(:\/\/[^/]+\/+(?:[^/]+\/+){2}[^/]+)-(?:lo|hi)(\.[^/.]+)(?:[?#].*)?$/;
			if (regex.test(src)) {
				return [
					src.replace(regex, "$1-hd$2"),
					src.replace(regex, "$1-hi$2")
				];
			}
		}
		if (domain_nowww === "bstars.eu" ||
			domain_nowww === "wstars.net" ||
			domain_nowww === "bstars.ru") {
			return src
				.replace(/(\/media\/+djcatalog2\/+images\/+item\/+[0-9]+\/+[^/]+\.[0-9]+)_[a-z](\.[^/.]*)$/, "$1$2")
				.replace(/(\/media\/+djcatalog2\/+images\/+[^/]+)_[a-z](\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "media.toofab.com" ||
			domain === "toofab.akamaized.net") { // doesn't work for all urls
			src = src.replace(/-[0-9]+w\.([^/.]*)/, ".$1");
			src = src.replace(/-[0-9]+x[0-9]+\.([^/.]*)/, ".$1");
			return src;
		}
		if (domain === "thumb.tvpalace.org") return src.replace(/\/[wh][0-9]+_([^/]*\.[^/.]*)$/, "/$1");
		if (domain_nowww === "mafab.hu") return src.replace(/\/static\/thumb\/[wh][0-9]+\//, "/static/");
		if (domain === "film.kinootziv.com" ||
			(domain_nosub === "moviesfan.org" && domain.match(/^static/)) ||
			domain_nowww === "kinokach.com") {
			return src.replace(/(:\/\/[^/]*\/source\/files\/[^/]*)_thumbs\//, "$1/");
		}
		if (amazon_container === "harmony-assets-live") {
			return {
				src: url,
				can_head: false
			};
		}
		if (domain === "cdn.kme.si") return src.replace(/\/public\/images-cache\/[0-9X]+x[0-9X]+\/([0-9]+\/[0-9]+\/[0-9]+\/)[0-9a-f]+\/[0-9a-f]+\/([0-9a-f]+\.[^/.]*)$/, "/public/images/$1$2");
		if (domain_nosub === "slidely.com" &&
			domain.match(/cdn\.slidely\.com$/)) {
			return src.replace(/^[a-z]+:\/\/[^/]*\/img-proxy\//, "http://");
		}
		if (domain_nosub === "hochu.ua") return src.replace(/\/thumbnails\/articles\/crop[a-z]*_[0-9]+x[0-9]+\//, "/images/articles/");
		if (domain === "media.professionali.ru") return src.replace(/(\/processor\/[a-z]+\/)[^/]*\//, "$1original/");
		if (domain_nowww === "stars-naked.ru") return src.replace(/(:\/\/[^/]*\/pictures\/[^/]*\/)[^/]*\/[a-z]+_([^/]*)$/, "$1$2");
		if (domain_nowww === "avsforum.com" ||
			domain_nowww === "sitcomsonline.com") {
			return src.replace(/(\/photopost\/data\/[0-9]+\/)(?:thumbs|medium)\//, "$1");
		}
		if (domain_nowww === "pgmscreen.fr") {
			newsrc = decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/(?:protect|watermark)\.php.*?[?&]src=([^&]*).*?$/, "$1"));
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\/galerie\/[a-z]+\/[a-z]+-/, "/galerie/grande/max-");
		}
		if (domain === "celeb.gate.cc" ||
			domain_nowww == "celebgate.org") {
			return src.replace(/(:\/\/[^/]*\/+media\/+cache\/+)[a-z]+\/+upload\//, "$1image/upload/");
		}
		if (domain_nowww === "modagid.ru") return src.replace(/(\/files\/photos\/imgs\/[0-9]+\/[0-9]+\/)[a-z]+_/, "$1original_");
		if (domain_nowww === "zdf.de" &&
			string_indexof(src, "/assets/") >= 0) {
			return src.replace(/~[0-9]+x[0-9]+([?#].*)?$/, "~original$1");
		}
		if (domain_nowww === "arcinfo.ch" ||
			domain_nowww === "lacote.ch") {
			return src.replace(/(\/media\/image\/[0-9]*\/)[^/]*\/([0-9]+-[0-9]+\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "gulf365.co" ||
			domain_nosub === "mogaznews.com" ||
			domain_nowww === "ksa-press.com" ||
			domain_nowww === "news-sinaa.com" ||
			domain_nowww === "akherkhabrtoday.com" ||
			domain_nowww === "arabyoum.com" ||
			domain_nowww === "uk-arabicnews.com" ||
			domain_nowww === "alsharqtimes.com" ||
			domain_nowww === "news.fox-24.com" ||
			src.match(/^[a-z]+:\/\/[^/]*\/temp\/+(?:thumb|resized)\/+(?:small|medium|[0-9]+x[0-9]+)_[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9a-f]{10}\.[^/._]+(?:[?#].*)?$/) ||
			src.match(/^[a-z]+:\/\/[^/]*\/temp\/+(?:thumb|resized)\/+(?:small|medium|[0-9]+x[0-9]+)_uploads,[0-9]{4},[0-9]{2},[0-9]{2},[0-9a-f]{10}\.[^/._]+(?:[?#].*)?$/)) {
			return src
				.replace(/(\/)temp\/(?:thumb|resized)\/[^-/_.]+_uploads,([0-9]+),([0-9]+),([0-9]+),([0-9a-f]+\.[^/.]*)$/, "$1content/uploads/$2/$3/$4/$5")
				.replace(/(\/)temp\/(?:thumb|resized)\/[a-z]+_([0-9]+)-([0-9]+)-([0-9]+)-([0-9a-f]+\.[^/.]*)$/, "$1content/uploads/$2/$3/$4/$5");
		}
		if (domain_nowww === "aljazeera.com") return src.replace(/\/mritems\/imagecache\/[^/]*\/mritems\//, "/mritems/");
		if (domain === "media.publika.md" ||
			domain === "media.dcbusiness.ro" ||
			domain === "media.realitatea.net" ||
			domain === "media.feminis.ro") {
			return src.replace(/(\/image\/+[0-9]{6}\/)+w[0-9]+(?:h[0-9]+)?\/+/, "$1full/");
		}
		if (domain === "images.tagesschau.de") return src.replace(/(\/image\/+[-0-9a-f]{10,}\/+[^/]+\/+[^/]+\/+)[^/]+\/+([^/]+)(?:[?#].*)?$/, "$1original/$2");
		if (domain === "www1.wdr.de" ||
			domain === "kinder.wdr.de" ||
			domain_nowww === "tagesschau.de" ||
			domain_nowww === "hr.de") {
			return {
				url: src.replace(/~(?:_t-[0-9]+)?_v-[a-zA-Z0-9]+(\.[^/.]*)$/, "~_v-original$1"),
				can_head: false // wrong content-type
			};
		}
		if (domain_nowww === "xrimaonline.gr" ||
			domain_nowww === "athensmagazine.gr" ||
			domain_nowww === "digalakis.com" ||
			domain_nowww === "youweekly.gr" ||
			src.match(/^[a-z]+:\/\/[^/]+\/+photos\/+[wc]_[0-9]+px(?:_[0-9]+px)?\/+(?:products|articles)\//)) {
			return src.replace(/\/photos\/+[a-z]_[0-9]+px[^/]*\/+([^/]+)\//, "/photos/master/$1/");
		}
		if (domain_nosub === "avisen.dk" &&
			domain.match(/^media[0-9]*\.avisen\.dk/)) {
			return src.replace(/([?&]sizeid=)[0-9]+/, "$1255");
		}
		if (domain_nowww === "elimparcial.es" &&
			string_indexof(src, "/fotos/") >= 0) {
			return src.replace(/_thumb_[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain_nosub === "agora.md" &&
			domain.match(/^st[0-9]*\.agora\.md/)) {
			return src.replace(/(:\/\/[^/]*\/news\/)[a-z]+\//, "$1big/");
		}
		if (domain_nowww === "demokrathaber.org") return src.replace(/\/images\/resize\/[0-9]+\/[0-9]+x[0-9]+\//, "/images/");
		if (domain === "imgl.krone.at") return src.replace(/(\/scaled\/[0-9]+\/[0-9a-z]+\/)[0-9]+x[0-9]+((?:\.[^/.]+)?(?:[?#].*)?)?$/, "$1full$2");
		if (domain_nowww === "elfinanciero.com.mx" &&
			string_indexof(src, "/uploads/") >= 0) {
			return src.replace(/(\/[0-9a-f]+)_[a-z_]+(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nosub === "redcdn.pl" &&
			string_indexof(domain, "dcs.redcdn.pl") >= 0) {
			return src.replace(/(:\/\/[^/]*\/)scale(\/.*?)(?:[?#].*)?$/, "$1dcs/$2");
		}
		if (domain === "media.nu.nl") return src.replace(/(:\/\/[^/]*\/+m\/+[0-9a-z]+)_[0-9a-z]+(\.[^/.]*)?(\/[^/]*\.[^/.]*)?$/, "$1$2$3");
		if (domain === "cloudia.hnonline.sk" ||
			domain === "img.joj.sk") {
			return src.replace(/(:\/\/[^/]*\/)[a-z]?[0-9]*x[0-9]*[a-z]?\/([-0-9a-f]+(?:\.[^/.]*?)?)(?:\?.*)?$/, "$1$2");
		}
		if (googlestorage_container === "nana10img") {
			return src.replace(/\/crop\/(?:_[a-z]-[0-9]+){1,}\/images\//, "/images/");
		}
		if ((domain_nowww === "webnews.bg" ||
			domain === "static.webcafe.bg" ||
			domain === "static.dir.bg") &&
			string_indexof(src, "/uploads/images/") >= 0) {
			return src.replace(/\/[0-9]+x(?:[0-9]+)?(\.[^/.]*)$/, "/orig$1");
		}
		if (domain === "static.ffx.io") {
			return {
				url: src.replace(/\/images\/\$[^/]*\/.*\/([0-9a-f]+)([?#].*)?$/, "/images/$1$2"),
				can_head: false // 404 for some images
			};
		}
		if (domain === "images.stv.tv") return src.replace(/\/articles\/[wh][0-9]+(?:xh[0-9]+)?(?:xm[^/]*)?\/([^/]*)$/, "/articles/master/$1");
		if (domain === "cdn.cretalive.gr") return src.replace(/(:\/\/[^/]*\/)_[a-z]+Image\//, "$1");
		if (domain === "img.budgettravel.com") return src.replace(/(:\/\/[^/]+\/+)_[a-zA-Z]+\/+/, "$1");
		if (amazon_container === "festivalkontoret") {
			return src.replace(/\/_[a-zA-Z]+\/+([^/]+)$/, "/$1");
		}
		if ((domain_nosub === "ellingtoncms.com" &&
			domain.match(/\.media\.clients\.ellingtoncms\.com$/)) ||
			domain === "media.lasvegasweekly.com" ||
			domain === "media.spokesman.com") {
			return src.replace(/_t[0-9]*(?:x[0-9]+)?(\.[^/.]*)$/, "$1");
		}
		if (domain === "ajo.prod.reuters.tv") return src.replace(/(\/img\/[0-9a-f]+-[0-9]+).*?[?&](location=[^&]*).*?$/, "$1?$2");
		if (domain_nowww === "nos.nl" ||
			domain === "cdn.nos.nl" ||
			domain === "assets.nos.nl") {
			return src.replace(/(\/image\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+\/+)(?:[a-z]+|[0-9]+x[0-9]+[a-z]*)(\.[^/.]+)(?:[?#].*)?$/, "$1original$2");
		}
		if (domain_nowww === "braunschweiger-zeitung.de" ||
			domain === "img.derwesten.de" ||
			domain_nowww === "thueringen24.de" ||
			domain_nowww === "helmstedter-nachrichten.de") {
			return src.replace(/\/img\/(?:panorama|welt|landsberg)\/crop([0-9]+)\/.*(\.[^/.]*)$/, "/bin/src-$1$2");
		}
		if (domain === "iprx.ten.com.au") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/ImageHandler\.ashx.*?[?&]u=([^&]*).*?$/, "$1"));
		}
		if (domain === "images.sudouest.fr") return src.replace(/(\/[0-9a-f]+\/)[a-z]+\/[0-9]+x[0-9]+\/([^/]*)$/, "$1$2");
		if (domain === "gdb.rferl.org" ||
			domain === "gdb.voanews.com" ||
			domain === "gdb.alhurra.eu" ||
			domain === "gdb.rferl.org" ||
			domain === "gdb.radiosawa.us") {
			return src.replace(/(:\/\/[^/]*\/+[-0-9A-Fa-f]+)(?:_c?[a-z][0-9]*){1,}(\.[^/.]*)$/, "$1$2");
		}
		if (domain === "img.nzz.ch") return src.replace(/^[a-z]+:\/\/[^/]+\/+(?:[A-Z]=[^/]+\/+){1,}(https?:\/\/)/, "$1");
		if (domain === "images-cdn.impresa.pt" ||
			domain === "images.impresa.pt") {
			newsrc = src
				.replace(/\/(?:[0-9]+x[0-9]+|original)\/+m[wh]-[0-9]+(?:\?.*)?$/, "/original")
				.replace(/\?.*/, "");
			if (newsrc !== src)
				return newsrc;
			obj = {
				url: src,
				head_wrong_contentlength: true
			};
			match = src.match(/^[a-z]+:\/\/[^/]+\/+[a-z]+\/+([^/]+\.[^/.]*?)(?:-[0-9])?\/original/);
			if (match) {
				obj.filename = match[1];
			}
			return obj;
		}
		if (domain === "awsimages.detik.net.id" ||
			domain === "akcdn.detik.net.id") {
			if (src.match(/\/customthumb\//)) {
				return src.replace(/\?.*/, "");
			}
			newsrc = src.replace(/(\/community\/+media\/+visual\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[-0-9a-f]{20,})_[0-9]+\./, "$1.");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(?:\?.*)?$/, "?a=1");
		}
		if (domain_nowww === "sexhd.pics" ||
			domain_nowww === "sexphotos.pw" ||
			domain_nosub === "yespornpics.com" ||
			domain_nowww === "babe.today" ||
			domain_nowww === "xxxporn.pics" ||
			domain_nosub === "jjgirls.com") {
			newsrc = src
				.replace(/(:\/\/[^/]*\/)photo(\/.*\/)hd-([^/]*)$/, "$1gallery$2$3")
				.replace(/(:\/\/[^/]*\/)image(\/.*\/)hd-([^/]*)$/, "$1xxx$2$3")
				.replace(/(:\/\/[^/]*\/)(?:thumbs|pictures)(\/.*\/)hd-([^/]*)$/, "$1pictures$2$3")
				.replace(/(:\/\/[^/]*\/)thumb(\/.*\/)hd-([^/]*)$/, "$1media$2$3")
				.replace(/(:\/\/[^/]*\/)pic(\/.*\/)hd-([^/]*)$/, "$1pics$2$3");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "nakedwench.com") return src.replace(/(\/galleries\/+[0-9]{4}\/+[^/]*\/+)thumbnail([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1middle$2");
		if (domain === "pics.tubetubetube.com" ||
			domain === "pics.javbtc.com") {
			return src.replace(/(:\/\/[^/]*\/)thumbs(\/.*\/)hd-([^/]*)$/, "$1pornpics$2$3");
		}
		if (domain_nowww === "jav.gallery" ||
			domain_nowww === "javpics.com" ||
			domain_nowww === "javpornpics.com" ||
			domain_nowww === "javhd.pics" ||
			domain_nowww === "jav.photos") {
			var thumbdir = null;
			var fulldir = null;
			if (domain_nowww === "jav.gallery") {
				thumbdir = "photo";
				fulldir = "pics";
			} else if (domain_nowww === "jav.photos") {
				thumbdir = "pics";
				fulldir = "pictures";
			} else if (domain_nowww === "javpics.com") {
				thumbdir = "xxx";
				fulldir = "images";
			} else if (domain_nowww === "javhd.pics" ||
				domain_nowww === "javpornpics.com") {
				thumbdir = "media";
				fulldir = "photos";
			}
			if (thumbdir && fulldir) {
				regex = new RegExp("(:\/\/[^/]*\/)" + thumbdir + "(\/.*\/)(?:u?hd|pin)-([^/]*)(?:[?#].*)?$");
				return src.replace(regex, "$1" + fulldir + "$2$3");
			}
		}
		if (domain_nowww === "pornpics.vip") return src.replace(/(\/xxx\/.*\/)hd-([^/]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "purejapanese.com" ||
			domain_nowww === "jjgirls.com" ||
			domain_nowww === "1pondo.com" ||
			domain_nowww === "asiauncensored.com" ||
			domain_nowww === "69dv.com" ||
			domain_nowww === "japanesethumbs.com" ||
			domain === "img.yavtube.com" ||
			domain_nowww === "javtube.com") {
			newsrc = src.replace(/(:\/\/[^/]*\/)(pic|tokyo(?:pic|sex)|uncensored|javmodel|japansex|heydouga|jav|japanese(?:girl)?)(\/.*\/)cute-([^/]*)$/, "$1$2$3$4");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "jjgirls.com") {
			return src
				.replace(/(\/photo\/+[^/]*\/+[^/]*\/+[^/]*\/+[0-9]+)t(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/photo\/+[^/]*\/+[^/]*\/+[^/]*\/+[^/]*)_small(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/photo\/+[^/]+\/+[^/]+\/+[0-9]+\/+)tn([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/photo\/+watch4beauty\/+.*\/+)thumbnail([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1middle$2");
			;
		}
		if (domain_nowww === "javbtc.com") return src.replace(/(:\/\/[^/]*\/)media(\/.*\/)hd-([^/]*)$/, "$1photos$2$3");
		if (domain_nowww === "japanesebeauties.net") return src.replace(/\/media\/+(.*\/)hd-([^/]*)(?:[?#].*)?$/, "/$1$2");
		if (domain_nowww === "tubetubetube.com") return src.replace(/(:\/\/[^/]*\/)media(\/.*\/)(?:u?hd|pin)-([^/]*)$/, "$1pics$2$3");
		if (domain_nowww === "nuceleb.ru") return src.replace(/(\/assets\/images\/resources\/[0-9]+\/)[0-9]+x[0-9]+\/([^/]*)$/, "$1$2");
		if (domain_nosub === "imgserve.net") {
			return {
				url: src.replace(/(:\/\/[^/]*\/)images\/[a-z]+\//, "$1images/big/"),
				headers: {
					Referer: src
				}
			};
		}
		if (domain === "image.celebrityrave.com") return src.replace(/(\/[0-9a-f]*)-[0-9a-z]+(\.[^/.]*)$/, "$1$2");
		if (domain === "photo.addyoursex.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/remote_control\.php.*?[?&]file=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return urljoin(src, decodeURIComponent(newsrc), true);
		}
		if (domain_nowww === "nudogram.com") {
			newsrc = src.replace(/(\/contents\/+.\/+.\/+[^/]+\/+[0-9]+\/+[^/]+)_280\./, "$1.");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "statics.cdntrex.com" ||
			domain_nowww === "anon-v.com" ||
			domain_nowww === "break.ie" ||
			domain_nowww === "xcadr.org" ||
			domain_nowww === "fitting-room.com" ||
			domain_nowww === "camwhoreshd.com" ||
			domain_nowww === "cwtvembeds.com" ||
			domain_nosub === "camwhores.tv" ||
			domain_nowww === "camwhoresbay.com" ||
			domain_nowww === "asianleak.com" ||
			domain_nosub === "zbporn.tv" ||
			domain_nosub === "zbporn.com" ||
			domain_nowww === "dato.porn" ||
			domain_nowww === "smutr.com" ||
			domain_nosub === "fapster.xxx" ||
			domain_nowww === "bogmedia.org" ||
			domain_nowww === "femdomtb.com" ||
			domain_nowww === "solopornoitaliani.xxx" ||
			domain_nowww === "mature-porn.xxx" ||
			domain_nowww === "camhub.cc" ||
			domain_nowww === "camhub.world" ||
			domain_nowww === "zzpornozz.xyz" ||
			domain_nowww === "hiddencam.tv" ||
			domain_nowww === "mypornhere.com" ||
			(domain_nowww === "mvpchannel.net" && string_indexof(src, "/tube/") >= 0) ||
			domain_nowww === "gaythebest.com" ||
			domain_nosub === "watchmygf.me" ||
			domain_nosub === "yeswegays.com" ||
			domain_nowww === "mytradevideo.com" ||
			domain_nosub === "boundhub.com" ||
			domain_nowww === "youhealthtube.com" ||
			domain_nowww === "mywebgirls.tv" ||
			domain_nowww === "thebestshemalevideos.com" ||
			domain_nosub === "katestube.com" ||
			domain_nowww === "nudogram.com" ||
			domain_nosub === "analdin.com" ||
			domain_nosub === "tube-bunny.com" ||
			domain_nowww === "blackporn24.com" ||
			domain_nosub === "pornwhite.com" ||
			domain_nosub === "sleazyneasy.com" ||
			domain_nosub === "vikiporn.com" ||
			domain_nosub === "sheshaft.com" ||
			domain_nosub === "xozilla.com" ||
			domain_nosub === "xtits.com" ||
			domain_nosub === "wankoz.com" ||
			domain_nosub === "fetishshrine.com" ||
			domain_nowww === "x18.xxx" ||
			domain_nosub === "mt-static.com" ||
			domain_nosub === "megatube.xxx" ||
			domain_nosub === "slutload-media.com" ||
			domain_nowww === "porngem.com" ||
			domain_nowww === "uiporn.com" ||
			domain_nosub === "pornicom.com" ||
			domain_nosub === "youx.xxx" ||
			domain_nosub === "pornalin.com" ||
			domain_nosub === "cartoontube.xxx" ||
			domain_nowww === "amateurporn.me" ||
			domain_nowww === "hardsexvids.com" ||
			domain_nosub === "sexvid.xxx" ||
			domain_nosub === "its.porn" ||
			domain === "itsporn.woxcdn.com" ||
			domain_nosub === "frprn.com" ||
			domain_nosub === "japan-whores.com" ||
			domain_nosub === "pornid.xxx" ||
			domain_nosub === "mypornhere.com" ||
			domain_nosub === "pornhat.com" ||
			domain_nosub === "camshooker.com" ||
			domain_nosub === "cambro.tv" ||
			domain_nosub === "camseek.tv" ||
			domain_nowww === "camvideos.tv" ||
			domain_nosub === "anysex.com" ||
			domain_nosub === "mrdeepfakes.com" ||
			domain_nosub === "pornktu.be" ||
			domain_nosub === "3movs.com" ||
			domain_nosub === "sunporno.com" ||
			domain_nosub === "xcafe.com" ||
			domain_nowww === "18fuck.me" ||
			domain_nowww === "my18pussy.com" ||
			domain_nowww === "freepornvideo.sex" ||
			domain_nosub === "sexroom.xxx" ||
			domain_nosub === "porno666.cam" ||
			domain_nosub === "pornfappy.com" ||
			domain_nosub === "aporn.xxx" ||
			domain_nosub === "fapteentube.net" ||
			domain_nosub === "xxxsextube.tv" ||
			domain_nosub === "camfz.com" ||
			domain_nowww === "camclips.tv" ||
			domain_nowww === "tubedupe.com" ||
			domain_nosub === "stfucdn.com" ||
			domain_nosub === "porntn.com" ||
			domain_nosub === "tolkorus.info" ||
			domain_nosub === "pornozavod.cc" ||
			domain_nosub === "onlineporno.cc" ||
			domain_nosub === "prostoporno.help" ||
			domain === "jb503wdraf.ent-cdn.com" ||
			domain_nosub === "freehardcore.com" ||
			domain === "b3bepw16kz.ent-cdn.com" ||
			domain_nowww === "asianpornvideo.xxx" ||
			domain_nowww === "18pussy.porn" ||
			domain_nowww === "fuckteen.xxx" ||
			domain_nowww === "japanporn.tv" ||
			domain_nowww === "18teenporno.tv" ||
			domain_nowww === "japaneseporn.xxx" ||
			domain_nowww === "hdteen.porn" ||
			domain_nowww === "indiansexvideo.xxx" ||
			domain_nosub === "theyarehuge.com" ||
			domain_nosub === "videocelebs.net" ||
			domain_nowww === "mangovideo.club" ||
			domain_nosub === "xmegadrive.com" ||
			domain_nosub === "deviants.com" ||
			domain_nosub === "cuckoldplacetube.com" ||
			domain_nosub === "alphaporno.com" ||
			domain_nosub === "fapality.com" ||
			domain_nowww === "freeporn8.com" ||
			(domain_nosub === "b-cdn.net" && /^(18yos|amateurporn(?:girlfriends|tape|vidz|wives)|analcuties|asian(?:cuties|teens)|boombj|brosislove|cuteasians|d1ck|d1rty|extremejapanese|faphard(?:er)?|fi1thy|f1ix|fl1rt|freexxxhardcore|hard(?:(?:core)?teens|family|jap|milfs|moms)|hotmature|japteens|k1nk|milfz|porn(?:ouploads|n|r[yz])|roleplayers|taboofamily|teenanal|twistednuts|wanktank|extremeteens)\./.test(domain)) ||
			domain_nosub === "hardmoms.co" ||
			domain_nosub === "d1ck.co" ||
			domain_nosub === "twistednuts.com" ||
			domain_nosub === "f1ix.com" ||
			domain_nosub === "18yos.co" ||
			domain_nosub === "amateurporngirlfriends.com" ||
			domain_nosub === "amateurporntape.com" ||
			domain_nosub === "amateurpornvidz.com" ||
			domain_nosub === "amateurpornwives.com" ||
			domain_nosub === "analcuties.co" ||
			domain_nosub === "asian-cuties.com" ||
			domain_nosub === "asian-teens.co" ||
			domain_nosub === "boombj.com" ||
			domain_nosub === "brosislove.com" ||
			domain_nosub === "cuteasians.co" ||
			domain_nosub === "d1rty.com" ||
			domain_nosub === "extremejapanese.co" ||
			domain_nosub === "faphard.co" ||
			domain_nosub === "fapharder.com" ||
			domain_nosub === "fi1thy.com" ||
			domain_nosub === "fl1rt.com" ||
			domain_nosub === "freexxxhardcore.com" ||
			domain_nosub === "hardcoreteens.co" ||
			domain_nosub === "hardfamily.co" ||
			domain_nosub === "hardjap.co" ||
			domain_nosub === "hardmilfs.co" ||
			domain_nosub === "hardteens.co" ||
			domain_nosub === "hotmature.co" ||
			domain_nosub === "japteens.co" ||
			domain_nosub === "k1nk.co" ||
			domain_nosub === "milfz.co" ||
			domain_nosub === "pornouploads.com" ||
			domain_nosub === "pornn.co" ||
			domain_nosub === "pornry.com" ||
			domain_nosub === "pornrz.com" ||
			domain_nosub === "roleplayers.co" ||
			domain_nosub === "taboofamily.co" ||
			domain_nosub === "teenanal.co" ||
			domain_nosub === "wanktank.co" ||
			domain_nosub === "extremeteens.co" ||
			domain_nowww === "thothub.lol" ||
			domain_nowww === "thothub.to" ||
			domain_nowww === "thothub.tube" ||
			domain_nowww === "thothub.is" ||
			domain_nowww === "cartoon-sex.tv" ||
			domain_nowww === "cartoonporn.pro" ||
			domain_nosub === "love4porn.com" ||
			domain_nosub === "hoes.tube" ||
			domain_nosub === "hqbang.com" ||
			domain_nosub === "porndr.com" ||
			domain_nosub === "pervclips.com" ||
			domain_nosub === "fapnado.xxx" ||
			domain_nosub === "homemade.xxx" ||
			domain_nosub === "xgroovy.com" ||
			domain_nosub === "jizzberry.com" ||
			domain_nosub === "alotporn.com" ||
			domain_nosub === "analdin.xxx" ||
			domain_nosub === "4kporn.xxx" ||
			domain_nosub === "xozilla.xxx" ||
			domain_nosub === "xxxshake.com" ||
			domain_nosub === "fapnow.xxx" ||
			domain_nosub === "4wank.com" ||
			domain_nosub === "fapnado.com" ||
			domain_nosub === "crazyporn.xxx" ||
			domain_nowww === "thisvid.com" ||
			domain_nowww === "amateur8.com" ||
			domain_nowww === "fpo.xxx" ||
			domain_nosub === "mylust.com" ||
			domain_nosub === "yourlust.com" ||
			domain_nowww === "pornrewind.com") {
			if (/\/(?:kt_)?player\/+skin\/+img\//.test(src) ||
				/\/images\/+title_icon\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
			page_nullobj = null;
			var is_pagelink = false;
			id = null;
			match = src.match(/\/(?:videos_(?:screenshots|sources)|v?th|kvs|videos\/+th)\/+[0-9]+\/+([0-9]+)\/+(?:(?:[0-9]+x[0-9]+|screenshots)\/+|preview(?:mp4_hd|_(?:trailer|[0-9]+p?|[hn]|embed_[0-9]+p))?\.)/);
			if (!match) {
				match = src.match(/\/get_file\/+[0-9a-f]+\/+[0-9a-f]{30,}\/+[0-9a-f]\/+([0-9]+)\/+screenshots\/+/);
			}
			if (!match) {
				match = src.match(/(?:\/get_file\/+[0-9a-f]+\/+[0-9a-f]{30,}|:\/\/[^/]+)\/+[0-9]+\/+[0-9]+\/+([0-9]+)_preview\./);
			}
			if (!match) {
				match = src.match(/\/(?:contents|c1)\/+videos\/+[0-9]+\/+[0-9]+\/+([0-9]+)(?:_(?:short|small))?_(?:preview|tr)\./);
			}
			if (!match) {
				match = src.match(/\/storage[0-9]*\/+([0-9a-zA-Z]+)\/+(?:[0-9]+|default)\./);
			}
			if (match) {
				id = match[1];
			} else {
				match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:(?:(?:tube\/+)?v(?:id(?:eo)?s?)?|embed)\/+(?:([0-9]+)(?:\/+[^/]+)?|([^/]+))\/*)?(?:[?#].*)?$/);
				if (!match) {
					if (domain_nowww === "pornid.xxx") {
						match = src.match(/^[a-z]+:\/\/[^/]+\/+([^/.]{20,})\.html(?:[?#].*)?$/);
					} else if (domain_nosub === "cartoon-sex.tv") {
						match = src.match(/^[a-z]+:\/\/[^/]+\/+video\/+([^/.]+)\.html(?:[?#].*)?$/);
					} else if (domain_nosub === "alotporn.com" || domain_nosub === "xcafe.com") {
						match = src.match(/^[a-z]+:\/\/[^/]+\/+([0-9]+)\/+(?:[^/]+\/*)?(?:[?#].*)?$/);
					}
				}
				if (match) {
					id = match[1] || match[2];
					is_pagelink = true;
					page_nullobj = {
						url: src,
						is_pagelink: true
					};
				}
			}
			var basedomain = "https://www." + domain_nosub + "/";
			var base_component = "";
			var videos_component = "videos";
			var videos_slash = "/";
			var addslash = "/";
			var a_component = "/a";
			var idprefix = "";
			var can_detect_videourl = true;
			var cache_host = domain_nosub;
			var can_add_referer_1 = true;
			if (domain_nosub === "porntrex.com" || domain_nosub === "cdntrex.com") {
				basedomain = "https://www.porntrex.com/";
				cache_host = "porntrex.com";
				videos_component = "video";
				addslash = "";
			} else if (domain_nosub === "porntb.com" ||
				domain_nosub === "pornstarsadvice.com" ||
				domain_nosub === "fetishburg.com" ||
				domain_nosub === "camhub.cc" ||
				domain_nosub === "mytradevideo.com" ||
				domain_nosub === "japan-whores.com" ||
				domain_nosub === "camshooker.com" ||
				domain_nosub === "aporn.xxx" ||
				domain_nosub === "camwhoreshd.com" ||
				domain_nosub === "mywebgirls.tv") {
				basedomain = "http://www." + domain_nosub + "/";
			} else if (domain_nosub === "tolkorus.info") {
				basedomain = "http://" + domain_nosub + "/";
			} else if (domain_nosub === "smutr.com") {
				videos_component = "v";
				a_component = "";
			} else if (domain_nosub === "mature-porn.xxx") {
				videos_component = "v";
				addslash = "";
				basedomain = "http://www." + domain_nosub + "/";
			} else if (domain_nosub === "bogmedia.org") {
				basedomain = "https://bogmedia.org/";
			} else if (domain_nosub === "solopornoitaliani.xxx") {
				videos_component = "video";
				addslash = ".html";
			} else if (domain_nosub === "mvpchannel.net") {
				videos_component = "tube/videos";
			} else if (domain_nosub === "watchmygf.me" ||
				domain_nosub === "yeswegays.com" ||
				domain_nosub === "x18.xxx" ||
				domain_nosub === "thebestshemalevideos.com" ||
				domain_nosub === "its.porn" ||
				domain_nosub === "yourlust.com" ||
				domain_nosub === "sexroom.xxx" ||
				domain_nosub === "pornalin.com" ||
				domain_nosub === "fapteentube.net" ||
				domain_nosub === "alphaporno.com" ||
				domain_nosub === "videocelebs.net" ||
				domain_nosub === "pornfappy.com" ||
				domain_nosub === "theyarehuge.com" ||
				domain_nosub === "pervclips.com" ||
				domain_nosub === "thisvid.com") {
				videos_component = "embed";
				addslash = "";
				a_component = "";
			} else if (domain_nosub === "xxxsextube.tv") {
				videos_component = "embed";
				addslash = "";
				a_component = "";
				basedomain = "https://" + domain + "/";
			} else if (domain_nosub === "cuckoldplacetube.com") {
				videos_component = "embed";
				addslash = "";
				a_component = "";
				basedomain = "http://www." + domain_nosub + "/";
			} else if (domain_nosub === "mcstatic.com") {
				basedomain = "https://www.metacafe.com/";
				videos_component = "watch";
				cache_host = "metacafe.com";
			} else if (domain_nosub === "mt-static.com") {
				basedomain = "https://www.megatube.xxx/";
			} else if (domain_nosub === "tube-bunny.com") {
				videos_component = "watch";
			} else if (domain_nosub === "slutload-media.com") {
				videos_component = "embed";
				addslash = "";
				a_component = "";
				basedomain = "https://www.slutload.com/";
			} else if (domain_nosub === "porngem.com" ||
				domain_nosub === "uiporn.com") {
				idprefix = "a-";
				addslash = "";
				a_component = "";
			} else if (domain_nosub === "youx.xxx") {
				videos_component = "videos/embed";
				a_component = "";
			} else if (domain_nosub === "cartoontube.xxx") {
				idprefix = "video";
				videos_component = "";
			} else if (domain_nosub === "onlineporno.cc") {
				idprefix = "video";
				videos_component = "";
				a_component = "";
			} else if (domain === "cdn84436847.ahacdn.me" ||
				domain_nosub === "zteenporn.com") {
				basedomain = "https://www.zteenporn.com/";
				idprefix = "a-";
				videos_component = "";
				a_component = "";
			} else if (domain === "itsporn.woxcdn.com") {
				basedomain = "https://www.its.porn/";
				videos_component = "embed";
				addslash = "";
				a_component = "";
			} else if (domain === "frprn.com") {
				a_component = "";
			} else if (domain_nosub === "b-cdn.net") {
				var bcdn_basedomain_map = {
					"hardmoms": "hardmoms.co",
					"d1ck": "d1ck.co",
					"18yos": "18yos.co",
					"analcuties": "analcuties.co",
					"asiancuties": "asian-cuties.com",
					"asianteens": "asian-teens.co",
					"cuteasians": "cuteasians.co",
					"extremejapanese": "extremejapanese.co",
					"faphard": "faphard.co",
					"hardcoreteens": "hardcoreteens.co",
					"hardfamily": "hardfamily.co",
					"hardjap": "hardjap.co",
					"hardmilfs": "hardmilfs.co",
					"hardteens": "hardteens.co",
					"hotmature": "hotmature.co",
					"japteens": "japteens.co",
					"k1nk": "k1nk.co",
					"milfz": "milfz.co",
					"pornn": "pornn.co",
					"roleplayers": "roleplayers.co",
					"taboofamily": "taboofamily.co",
					"teenanal": "teenanal.co",
					"wanktank": "wanktank.co",
					"extremeteens": "extremeteens.co"
				};
				var bcdn_subdomain = domain.replace(/\.b-cdn\.net$/, "");
				if (bcdn_subdomain in bcdn_basedomain_map) {
					basedomain = "https://" + bcdn_basedomain_map[bcdn_subdomain] + "/";
				} else {
					basedomain = "https://" + bcdn_subdomain + ".com/";
				}
			} else if (domain_nosub === "pornid.xxx") {
				can_detect_videourl = false;
			} else if (domain_nosub === "pornhat.com" ||
				domain_nosub === "mrdeepfakes.com" ||
				domain_nosub === "tubedupe.com" ||
				domain_nosub === "porno666.cam") {
				videos_component = "video";
			} else if (domain_nosub === "anysex.com") {
				videos_component = "";
				a_component = "";
			} else if (domain_nosub === "cambro.tv") {
				videos_component = "";
			} else if (domain_nosub === "camvideos.tv") {
				videos_component = "";
				basedomain = "http://www." + domain_nosub + "/";
			} else if (domain_nosub === "xcafe.com") {
				videos_component = "";
				a_component = "";
			} else if (domain_nosub === "18fuck.me") {
				a_component = "/a.tube";
				addslash = "";
			} else if (domain_nosub === "freepornvideo.sex") {
				videos_component = "xxx";
			} else if (domain_nosub === "pervclips.com") {
				base_component = "tube/";
				videos_component = "embed";
				addslash = "";
				a_component = "";
			} else if (domain_nosub === "stfucdn.com") {
				basedomain = "https://tubedupe.com/";
				videos_component = "video";
			} else if (domain_nosub === "prostoporno.help") {
				basedomain = "https://xxx.prostoporno.help/";
				a_component = "";
			} else if (domain === "jb503wdraf.ent-cdn.com") {
				basedomain = "https://www.freehardcore.com/";
			} else if (domain === "b3bepw16kz.ent-cdn.com") {
				basedomain = "https://www.deviants.com/";
			} else if (domain_nosub === "japaneseporn.xxx") {
				videos_component = "u";
			} else if (domain_nosub === "fapality.com") {
				videos_component = "";
				a_component = "";
			} else if (domain_nosub === "cartoonporn.pro") {
				videos_component = "vids";
			} else if (domain_nosub === "cartoon-sex.tv") {
				videos_component = "video";
				a_component = "";
				addslash = ".html";
			} else if (domain_nosub === "fapnado.xxx") {
				can_add_referer_1 = false;
			} else if (domain_nosub === "alotporn.com" ||
				domain_nosub === "xcafe.com") {
				videos_component = "";
				videos_slash = "";
			}
			var detected_url = null;
			if (can_detect_videourl) {
				detected_url = basedomain + base_component + videos_component + videos_slash + idprefix + id + a_component + addslash;
			}
			if (is_pagelink) {
				if (domain === "embeds.sunporno.com") {
					src = src.replace(/^[a-z]+:\/\/[^/]+\/+embed\/+/, "https://www.sunporno.com/videos/");
				}
				detected_url = src;
			}
			cache_host = basedomain.replace(/^[a-z]+:\/\/(?:www\.)?([^/]+)\/*$/, "$1");
			var fixup_function_url = function(flashvars) {
				var global_fn_num = 0;
				var first_common_sub = function(url, base, mult, divisor) {
					for (var i = 0; i < 12; i++) {
						var num = base;
						for (var url_ch_i = 0; url_ch_i < url.length; url_ch_i++) {
							var current_num = parseInt(url[url_ch_i]) || 0;
							num += i * current_num;
						}
						global_fn_num += mult * Math_floor(num / divisor);
					}
				};
				function update_fn_num2(urls) {
					for (var url_i = 0; url_i < urls.length; url_i++) {
						var url = urls[url_i].url;
						first_common_sub(url, 0, -1, 7);
					}
				}
				function update_fn_num1(urls) {
					var c, d, f, g, i;
					for (var url_i = 0; url_i < urls.length; url_i++) {
						var urlobj = urls[url_i];
						var url_key = urlobj.key;
						var url = urlobj.url;
						var slash_index = string_indexof(url, "/");
						var fn_num, real_url;
						if (slash_index > 0) {
							fn_num = parseInt(url.substring(0, slash_index));
							real_url = url.substring(slash_index);
						} else {
							fn_num = 0;
							real_url = url;
						}
						first_common_sub(url, fn_num, 1, 6);
						if (flashvars[url_key] && flashvars[url_key].substring(0, 8) === "function") {
							if (global_fn_num < 0) {
								f = "" + -global_fn_num;
								for (c = 0; c < 4; c++)
									f += f;
								real_url = real_url.substring(1);
								real_url = real_url.split("/");
								for (c = 0; c < real_url[5].length; c++) {
									g = c;
									for (d = c; d < f.length; d++) {
										g += parseInt(f[d]);
									}
									while (g >= real_url[5].length) {
										g = g - real_url[5].length;
									}
									i = real_url[5][c];
									real_url[5] = real_url[5].substring(0, c) + real_url[5][g] + real_url[5].substring(c + 1);
									real_url[5] = real_url[5].substring(0, g) + (i + "") + real_url[5].substring(g + 1);
								}
								flashvars[url_key] = real_url.join("/");
							} else {
								flashvars[url_key] = "function" + "/" + global_fn_num + real_url;
							}
						}
					}
				}
				var get_license_from_flashvars = function(flashvars) {
					for (var key in flashvars) {
						if (string_indexof(key, "code") > 0 && flashvars[key].length == 16) {
							return flashvars[key];
						}
					}
					return "";
				};
				var decrypt_license = function(license_code) {
					if (!license_code)
						return license_code;
					var license_num = "";
					for (var license_i = 1; license_i < license_code.length; license_i++) {
						var current_code_n = parseInt(license_code[license_i]);
						if (current_code_n) {
							license_num += current_code_n;
						} else {
							license_num += 1;
						}
					}
					var first_half = parseInt(license_num.substring(0, 8));
					var second_half = parseInt(license_num.substring(7));
					var license_num1_int = (Math_abs(second_half - first_half) + Math_abs(first_half - second_half)) * 2;
					var license_num1 = "" + license_num1_int;
					var decrypted = "";
					for (var i = 0; i < 8; i++) {
						for (var j = 1; j <= 4; j++) {
							var n = parseInt(license_code[i + j]) + parseInt(license_num1[i]);
							if (n >= 10) {
								n -= 10;
							}
							decrypted += n;
						}
					}
					return decrypted;
				};
				var update_url = function(flashvars) {
					var function_header = "function" + "/";
					for (var key in flashvars) {
						var value = flashvars[key];
						if (string_indexof(value, function_header) === 0) {
							var splitted_url = value.substring(function_header.length).split("/");
							if (splitted_url[0] > 0) {
								var vidid = splitted_url[6].substring(0, 32);
								var decrypted_license = decrypt_license(get_license_from_flashvars(flashvars));
								if (decrypted_license && vidid) {
									var old_vidid = vidid;
									for (var vidid_ri = vidid.length - 1; vidid_ri >= 0; vidid_ri--) {
										var current_key = vidid_ri;
										for (var i = vidid_ri; i < decrypted_license.length; i++) {
											current_key += parseInt(decrypted_license[i]);
										}
										while (current_key >= vidid.length) {
											current_key -= vidid.length;
										}
										var new_vidid = "";
										for (var vidid_i = 0; vidid_i < vidid.length; vidid_i++) {
											if (vidid_i === vidid_ri) {
												new_vidid += vidid[current_key];
											} else if (vidid_i === current_key) {
												new_vidid += vidid[vidid_ri];
											} else {
												new_vidid += vidid[vidid_i];
											}
										}
										vidid = new_vidid;
									}
									splitted_url[6] = splitted_url[6].replace(old_vidid, vidid);
									splitted_url.splice(0, 1);
									flashvars[key] = splitted_url.join("/");
								}
							}
						}
					}
				};
				var main = function() {
					var urls = [];
					var function_header = "function" + "/";
					for (var key in flashvars) {
						if (flashvars[key].substring(0, 9) === function_header) {
							var url = flashvars[key].substring(function_header.length);
							urls.push({ key: key, url: url });
						}
					}
					if (urls.length === 0) {
						return flashvars;
					} else {
						update_fn_num1(urls);
						update_fn_num2(urls);
						update_url(flashvars);
						return main();
					}
				};
				return main();
			};
			if (id && options.do_request && options.cb) {
				var cache_key = cache_host + ":" + id;
				var parse_flashvars = function(ourdata) {
					if (!ourdata || !ourdata.data) {
						return null;
					}
					var data = ourdata.data;
					var origpage = ourdata.finalurl;
					var maxurl = null;
					var maxsize = null;
					fixup_function_url(data);
					for (var key in data) {
						if (/^video_.*url[0-9]*$/.test(key)) {
							var oururl = data[key];
							var oursize = oururl.replace(/.*_([0-9]+)p\.[^/.]+(?:\/*[^/]*)?(?:[?#].*)?$/, "$1");
							if (oursize === oururl) {
								oursize = oururl.replace(/.*\/storage[0-9]*\/+[a-zA-Z0-9]+\/+([0-9]+)p\.mp4(?:[?#].*)?$/, "$1");
							}
							if (oursize === oururl) {
								oursize = oururl.replace(/.*\/key=.*\/+([0-9]+)x[0-9]+_[0-9]+k(?:_h264)?_[0-9]+\.mp4(?:[?#].*)?$/, "$1");
							}
							if (oursize === oururl) {
								oursize = oururl.replace(/.*\/key=.*\/+mobile_[0-9]+\.mp4(?:[?#].*)?$/, "480");
							}
							if (oursize === oururl) {
								oursize = null;
								if ((key + "_text") in data) {
									var keytext = data[key + "_text"];
									if (keytext === "LQ") { // 320x180 for prostoporno
										oursize = 240;
									} else if (keytext === "SD") {
										oursize = 360; // 640x360 for japan-whores
									} else if (keytext === "HQ" || keytext === "HD") { // 1280x720 for prostoporno
										oursize = 720;
									} else {
										var keytext_match = keytext.match(/^([0-9]{3,})p$/);
										if (keytext_match) {
											oursize = keytext_match[1];
										}
									}
								}
								if ((key + "_redirect") in data) {
									console_warn("URL appears to redirect: " + oururl);
									continue;
								}
								if (!oursize) {
									if (oururl.match(/\/([0-9]+)\/+\1(?:_(?:trailer|s))?\.[^/.]+(?:\/*[^/]*)?(?:[?#].*)?$/)) {
										oursize = 480;
									} else {
										console_warn("Unable to detect size from URL: " + oururl, data);
										continue;
									}
								}
							}
							oursize = parseInt(oursize);
							if (!maxsize || oursize > maxsize) {
								maxsize = oursize;
								maxurl = oururl;
							}
						}
					}
					if (maxurl) {
						var newobj = {
							url: maxurl,
							headers: {
								Referer: origpage || basedomain
							},
							extra: {
								page: origpage,
								caption: data.video_title || data.video_tags || data.video_categories || void 0
							}
						};
						if (!can_add_referer_1)
							newobj.headers.Referer = null;
						if (string_indexof(maxurl, ".mp4") >= 0) {
							newobj.video = true;
						}
						return newobj;
					} else {
						return null;
					}
				};
				var find_flashvars_from_page = function(resp) {
					var resptext = resp.responseText;
					resptext = resptext.replace(/low_quality_for_uc == true\)\s*{\s*var flashvars[\s\S]+?}\s*else\s*{/, ""); // zbporn.com
					var match = resptext.match(/var\s+flashvars\s*=\s*({[\s\S]+?})\s*;/);
					if (!match) {
						console_warn(cache_key, "Unable to find flashvars match", resp);
						return null;
					}
					var jsoned = match[1]
						.replace(/adv_pre_vast(?:_alt)?:\s*'[^\\']+?'(?:\s*\+\s*[a-z_]+),/g, "") // theyarehuge.com, zbporn.com
						.replace(/adv_pre_vast(?:_alt)?:\s*'[^\\']+?'\s*,/g, "") // thisvid.com
						.replace(/([{,]\s*)([^"'\s:]+)\s*:/g, "$1\"$2\":")
						.replace(/:\s*encodeURIComponent\(('[^']+')\)/g, ":$1")
						.replace(/([^\\])\\'/g, "$1\\u0027")
						.replace(/(\"[^\s:"]+?\":)\s*'([^']*)'(\s*[,}])/g, "$1 \"$2\"$3")
						.replace(/,\s*}$/, "}")
						.replace(/((?:[0-9]|")\s*,)\s*\/\/[^\n]*/, "$1");
					try {
						var json = JSON_parse(jsoned);
						if (!("video_id" in json) && "flashvars" in json && json.flashvars && "video_id" in json.flashvars) {
							json = json.flashvars;
						}
						return json;
					} catch (e) {
						console_error(cache_key, e, { match: match[1], jsoned: jsoned });
						return null;
					}
				};
				var find_itsporn_video = function(resp) {
					var match = resp.responseText.match(/<video\s([^>]+data-src-(?:hls|dash|mp4)="https?:[^"]+".*?)>\s*<\/video>/);
					if (!match) {
						console_warn(cache_key, "Unable to find data-src-(hls|dash|mp4) match", resp);
						return null;
					}
					var obj = [];
					var matches = match_all(match[1], /data-src-(hls|dash|mp4)="(https?:[^"]+)"/);
					array_foreach(matches, function(submatch) {
						var videotype = submatch[1];
						if (videotype === "mp4")
							videotype = true;
						obj.push({
							url: submatch[2],
							video: videotype
						});
					});
					if (obj.length > 0)
						return obj;
					console_error(cache_key, "Unable to find sources for data-src match", resp);
					return null;
				};
				var find_embed = function(resp) {
					var match = resp.responseText.match(/"player-holder">\s*<div class="embed-wrap"[^>]*><iframe\s[^>]*src=['"]([^'"]+)['"]/);
					if (!match) {
						console_warn(cache_key, "Unable to find iframe embed for", resp);
						return null;
					}
					return decode_entities(match[1]);
				};
				var find_plainvid = function(resp) {
					var match = resp.responseText.match(/<div id="kt_player"[^>]*>\s*<video id="main_video"[^>]+>\s*<source\s[^>]*src="([^"]+)"/);
					if (!match) { // alphaporno.com
						match = resp.responseText.match(/<video id="bravoplayer"[^>]+>(?:\s*<source[^>]*>){0,}\s*<source\s[^>]*src="([^"]+)"/);
					}
					if (!match) {
						console_warn(cache_key, "Unable to find plain kt video for", resp);
						return null;
					}
					return [{
							url: decode_entities(match[1]),
							video: true
						}];
				};
				var find_pornktube = function(resp) {
					var match = resp.responseText.match(/<div id="player"(?:\s+data-(?:id|[sqnt])="[^"]+?"){5}\s*>/);
					if (!match) {
						console_warn(cache_key, "Unable to find player div for", resp);
						return null;
					}
					var playerdiv = match[0];
					var matches = match_all(playerdiv, /data-(id|[sqnt])="([^"]+?)"/);
					var attrs = {};
					array_foreach(matches, function(submatch) {
						attrs[submatch[1]] = decode_entities(submatch[2]);
					});
					var qualities = attrs["q"].split(",");
					qualities.sort(function(a, b) {
						return parseInt(b) - parseInt(a);
					});
					var http_prefix = "https://s" + attrs["n"] + ".fapmedia.com/" + "cq" + "p" + "vid/";
					var folder = 1000 * Math_floor(parseFloat(attrs["id"]) / 1000);
					var tfolder = folder + "/" + attrs["id"];
					var urls = [];
					for (var i = 0; i < qualities.length; i++) {
						var quality = qualities[i].split(";");
						var suffix = "";
						if (quality[0] !== "720p") {
							if (quality[0] === "2160p") {
								suffix = "_4k";
							} else {
								suffix = "_" + quality[0];
							}
						}
						urls.push(http_prefix + quality[4] + "/" + quality[5] + "/" + tfolder + "/" + attrs.id + suffix + ".mp4");
					}
					return urls;
				};
				api_cache.fetch(cache_key, function(obj) {
					if (!obj)
						return options.cb(page_nullobj);
					if (!is_array(obj))
						obj = [obj];
					if (page_nullobj)
						obj.push(page_nullobj);
					return options.cb(obj);
				}, function(done) {
					var url = detected_url;
					var fetch_video = function(url, can_refetch) {
						if (!url) {
							console_error("Null url, ignoring");
							return done(null, false);
						}
						options.do_request({
							url: url,
							method: "GET",
							onload: function(resp) {
								if (resp.readyState !== 4)
									return;
								if (resp.status === 404) {
									var match = resp.responseText.match(/<meta http-equiv="Refresh" content="[0-9]+; URL=(https?:\/\/[^"]+)">/);
									if (match) {
										finalurl = decode_entities(match[1]);
										if (finalurl !== resp.finalUrl) {
											return fetch_video(finalurl, false);
										}
									}
								}
								if (resp.status !== 200) {
									console_error(resp);
									return done(null, false);
								}
								var finalurl = resp.finalUrl;
								var match = resp.responseText.match(/<link href="(https?:\/\/[^"]+)" rel="canonical"\s*\/>/);
								if (match) {
									finalurl = decode_entities(match[1]);
								}
								var baseobj = {
									headers: {
										Referer: finalurl || basedomain
									},
									extra: {
										page: finalurl
									}
								};
								var flashvars = find_flashvars_from_page(resp);
								if (flashvars) {
									var dataobj = {
										data: flashvars,
										finalurl: finalurl
									};
									return done(parse_flashvars(dataobj), 60 * 60);
								}
								var obj = find_itsporn_video(resp) || find_plainvid(resp);
								if (obj) {
									return done(fillobj_urls(obj, baseobj), 60 * 60);
								}
								var embed_url = find_embed(resp);
								if (embed_url) {
									return done({
										url: embed_url,
										is_pagelink: true
									}, 60 * 60);
								}
								obj = find_pornktube(resp);
								if (obj) {
									return done(fillobj_urls(obj, baseobj), 60 * 60);
								}
								if (can_refetch && finalurl !== resp.finalUrl) {
									return fetch_video(finalurl, false);
								} else {
									return done(null, false);
								}
							}
						});
					};
					fetch_video(url, true);
				});
				return {
					waiting: true
				};
			}
		}
		if ((host_domain_nowww === "vikiporn.com" ||
			host_domain_nowww === "sleazyneasy.com") && options.element) {
			if (!src && options.element.tagName === "DIV" && options.element.classList.contains("fp-ui")) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
		}
		if (domain === "cora.porntrex.com") {
			return {
				url: src,
				headers: {
					Referer: "https://www.porntrex.com/"
				}
			};
		}
		if (domain_nowww === "vjav.com" ||
			domain_nowww === "upornia.com" ||
			domain_nowww === "hotmovs.com" ||
			domain_nowww === "shemalez.com" ||
			domain_nowww === "hdzog.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:videos|embed)\/+([0-9]+)(?:\/+.*)?(?:[?#].*)?$/);
			if (match) {
				id = match[1];
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				var base_domain = domain_nosub;
				var query_vjav_api = function(vidid, url, signature, cb) {
					api_query(base_domain + "_api:" + vidid, {
						url: "https://" + base_domain + "/sn4diyux.php",
						method: "POST",
						imu_mode: "iframe",
						headers: {
							"Content-Type": "application/x-www-form-urlencoded",
							"Origin": "https://" + base_domain,
							"Referer": url
						},
						data: "param=" + encodeURIComponent(vidid + "," + signature)
					}, cb, function(done, resp, cache_key) {
						var obf_b64_decode = function(url) {
							var origurl = url;
							url = url
								.replace(/\u041c/g, 'M')
								.replace(/\u0415/g, 'E')
								.replace(/\u0410/g, 'A')
								.replace(/\u0421/g, 'C')
								.replace(/\u0412/g, 'B')
								.replace(/~/g, '=');
							var splitted = url.split(",");
							try {
								url = base64_decode(splitted[0]);
								if (splitted.length > 1) {
									url += "?" + base64_decode(splitted[1]);
								}
								return url;
							} catch (e) {
								console_error(cache_key, "Unable to properly decode", url);
								throw e;
							}
						};
						var match = resp.responseText.match(/var [^\s=]+\s*='(\[[^']+aHR0[^']+\])';/);
						if (!match) {
							console_log(cache_key, "Unable to find match for", resp);
							return done(null, false);
						}
						var json = JSON_parse(match[1]);
						for (var key in json[0]) {
							if (/^aHR0/.test(json[0][key])) {
								json[0][key] = obf_b64_decode(json[0][key]);
							}
						}
						return done(json, 60 * 60);
					});
				};
				var query_vjav = function(vidid, cb) {
					api_query(base_domain + ":" + vidid, {
						url: "https://" + base_domain + "/videos/" + vidid + "/a/"
					}, cb, function(done, resp, cache_key) {
						var match = resp.responseText.match(/window\.jwsettings\s*=\s*{\s*pC3:\s*'([0-9]+\|[0-9]+,[0-9]+)'/);
						if (!match) {
							console_error(cache_key, "Unable to find signature for", resp);
							return done(null, false);
						}
						var sig = match[1];
						query_vjav_api(vidid, resp.finalUrl, sig, function(data) {
							if (!data)
								return done(null, false);
							return done(data, 60 * 60);
						});
					});
				};
				var jwplayer_obj_to_imu = function(data) {
					if (!data)
						return page_nullobj;
					var baseobj = {
						headers: {
							Referer: "https://" + base_domain + "/"
						}
					};
					var urls = [];
					urls.push({ url: data[0].video_url, video: true });
					urls.push(page_nullobj);
					return fillobj_urls(urls, baseobj);
				};
				if (options.do_request && options.cb) {
					query_vjav(id, function(data) {
						options.cb(jwplayer_obj_to_imu(data));
					});
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if (domain_nosub === "hclips.com" ||
			domain_nosub === "voyeurhit.com" ||
			domain_nowww === "txxx.com" ||
			domain_nowww === "thegay.com" ||
			domain_nowww === "tubepornclassic.com" ||
			domain_nosub === "videotxxx.com") {
			var match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:videos|embed)\/+([0-9]+)\//);
			if (match) {
				id = match[1];
				var base_domain = domain_nosub;
				if (domain_nosub === "videotxxx.com")
					base_domain = "txxx.com";
				var decode_hclips_base64 = function(data) {
					var charset = decodeURIComponent("%D0%90%D0%92%D0%A1D%D0%95FGHIJKL%D0%9CNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.%2C~"), output = "";
					var invalid_regex = new RegExp(decodeURIComponent("%5B%5E%D0%90%D0%92%D0%A1%D0%95%D0%9CA-Za-z0-9.%2C~%5D"), "g");
					if (invalid_regex.exec(data)) {
						console_warn("Invalid characters found in", data);
					}
					data = data.replace(invalid_regex, "");
					for (var i = 0; i < data.length;) {
						var c1 = string_indexof(charset, string_charat(data, i++)), c2 = string_indexof(charset, string_charat(data, i++)), c3 = string_indexof(charset, string_charat(data, i++)), c4 = string_indexof(charset, string_charat(data, i++));
						c1 = c1 << 2 | c2 >> 4;
						c2 = (15 & c2) << 4 | c3 >> 2;
						var last = (3 & c3) << 6 | c4;
						output += string_fromcharcode(c1);
						if (c3 !== 64) {
							output += string_fromcharcode(c2);
						}
						if (c4 !== 64) {
							output += string_fromcharcode(last);
						}
					}
					return unescape(output);
				};
				var query_hclips = function(vid, cb) {
					api_query(base_domain + ":" + vid, {
						url: "https://" + base_domain + "/api/videofile.php?video_id=" + vid + "&lifetime=8640000",
						headers: {
							"Accept": "application/json, text/plain, */*",
							"Referer": "https://" + base_domain + "/videos/" + vid + "/"
						},
						json: true
					}, cb, function(done, resp, cache_key) {
						var formats = ["_hq", "_lq"];
						var get_format_id = function(format) {
							format = format.replace(/\..*/, "");
							var index = array_indexof(formats, format);
							if (index < 0) {
								console_warn("Unknown format", format);
								return formats.length;
							} else {
								return index;
							}
						};
						resp.sort(function(a, b) {
							return get_format_id(a) - get_format_id(b);
						});
						for (var i = 0; i < resp.length; i++) {
							resp[i].video_url = urljoin("https://" + base_domain + "/", decode_hclips_base64(resp[i].video_url), true);
						}
						done(resp, 60 * 60);
					});
				};
				var hclips_to_obj = function(data) {
					if (!data || data.length === 0) {
						return page_nullobj;
					}
					var baseobj = {
						headers: {
							Referer: "https://" + base_domain
						}
					};
					urls = [{
							url: data[0].video_url,
							video: true
						}];
					urls.push(page_nullobj);
					return fillobj_urls(urls, baseobj);
				};
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				if (options.do_request && options.cb) {
					query_hclips(id, function(data) {
						options.cb(hclips_to_obj(data));
					});
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if (domain === "cdn69508963.ahacdn.me" ||
			domain === "cdn35854568.ahacdn.me" ||
			domain === "cdn60563788.ahacdn.me" ||
			domain === "12111549.pix-cdn.org" ||
			domain === "cdn56191079.ahacdn.me" ||
			domain === "cdn25122858.ahacdn.me" ||
			domain === "12111553.pix-cdn.org" ||
			domain === "cdn22821955.ahacdn.me" ||
			domain === "cdn37699375.ahacdn.me" ||
			(domain_nosub === "tubepornclassic.com" && /^static[0-9]*\./.test(domain)) ||
			domain === "cdn39638151.ahacdn.me" ||
			domain === "vjav1.hclips.net" ||
			domain === "vjav2.hclips.net" ||
			domain === "vjav3.hclips.net" ||
			domain === "cdn61283513.ahacdn.me" ||
			domain === "cdn42705446.ahacdn.me" ||
			domain === "cdn85419624.ahacdn.me" ||
			domain === "cdn49752055.ahacdn.me" ||
			domain === "cdn12694176.ahacdn.me" ||
			domain === "cdn27185998.ahacdn.me" ||
			domain === "cdn52810799.ahacdn.me" ||
			domain === "cdn47590165.ahacdn.me" ||
			(domain_nosub === "shemalez.com" && /^tn[0-9]*\./.test(domain)) ||
			domain === "cdn37804682.ahacdn.me") {
			var basedomain_map = {
				"cdn69508963.ahacdn.me": "hdzog.com",
				"cdn39638151.ahacdn.me": "vjav.com",
				"vjav1.hclips.net": "vjav.com",
				"vjav2.hclips.net": "vjav.com",
				"vjav3.hclips.net": "vjav.com",
				"cdn35854568.ahacdn.me": "upornia.com",
				"cdn60563788.ahacdn.me": "upornia.com",
				"12111549.pix-cdn.org": "upornia.com",
				"cdn56191079.ahacdn.me": "hotmovs.com",
				"cdn25122858.ahacdn.me": "hotmovs.com",
				"12111553.pix-cdn.org": "hotmovs.com",
				"cdn22821955.ahacdn.me": "tubepornclassic.com",
				"cdn37699375.ahacdn.me": "tubepornclassic.com",
				"cdn61283513.ahacdn.me": "hclips.com",
				"cdn42705446.ahacdn.me": "hclips.com",
				"cdn85419624.ahacdn.me": "hclips.com",
				"cdn49752055.ahacdn.me": "hdzog.com",
				"cdn12694176.ahacdn.me": "hdzog.com",
				"cdn27185998.ahacdn.me": "thegay.com",
				"cdn52810799.ahacdn.me": "thegay.com",
				"cdn47590165.ahacdn.me": "shemalez.com",
				"cdn37804682.ahacdn.me": "txxx.com"
			};
			var basedomain = basedomain_map[domain];
			if (!basedomain)
				basedomain = domain_nosub;
			match = src.match(/\/(?:c[0-9]*|contents)\/+videos(?:_(?:sources|screenshots))?\/+[0-9]+\/+([0-9]+)\/+(?:(?:[0-9]+_tr|preview)\.|(?:screenshots|[0-9]+x[0-9]+)\/)/);
			if (match) {
				return {
					url: "https://" + basedomain + "/videos/" + match[1] + "/a/",
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "xbabe.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+videos\/+([^/]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://xbabe.com/videos/${id}/",
				process: function(done, resp) {
					var obj = common_functions["get_videotag_obj"](resp);
					if (!obj)
						return done(null, false);
					return done(fillobj_urls(obj, {
						headers: {
							Referer: resp.finalUrl
						}
					}), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "zceleb.com" ||
			domain === "cdn.faponix.com" ||
			domain_nosub === "fapality.com" ||
			domain === "alb-xb.hellcdn.net" ||
			domain_nowww === "vjav.com" ||
			domain_nosub === "tubsexer.com" ||
			domain_nowww === "bobs-tube.com" ||
			domain === "i.pornsexer.com" ||
			domain_nowww === "pervertedmilfs.com" ||
			domain_nowww === "xcadr.com" ||
			domain_nowww === "anon-v.com" ||
			domain_nosub === "okporn.com" ||
			(domain_nosub === "cdntrex.com" && /^albums?[0-9]*\./.test(domain)) ||
			domain_nosub === "p7cdn.com" ||
			domain_nosub === "pornoreino.com" ||
			domain_nowww === "mylust.com" ||
			domain_nosub === "smutr.com" ||
			domain_nowww === "megaporn.co" ||
			domain === "i.tubsexer.com" ||
			domain_nowww === "break.ie" ||
			(domain_nosub === "watchmygf.me" && /^cdn[0-9]*\./.test(domain)) ||
			domain === "watchmyexgf.good-cdn.com" ||
			domain_nowww === "fitting-room.com" ||
			(domain_nosub === "tubepornclassic.com" && /^static[0-9]*\./.test(domain)) ||
			domain_nowww === "iloveporn.xxx" ||
			domain_nowww === "zzgays.com" ||
			domain_nowww === "pornhat.com" ||
			domain === "i.bobs-tube.com" ||
			domain_nowww === "xbabe.com" ||
			domain_nowww === "pornzee.com" ||
			domain === "media.thebestshemalevideos.com" ||
			domain_nowww === "themilf.net" ||
			domain_nowww === "pornstarsadvice.com" ||
			domain_nowww === "porntb.com" ||
			domain === "109.206.187.183" ||
			domain_nowww === "fetishburg.com" ||
			domain_nosub === "zbporn.tv" ||
			domain_nosub === "zbporn.com" ||
			domain_nosub === "stfucdn.com" ||
			domain_nowww === "mythumbnails.com" ||
			domain === "static.ok.xxx" ||
			domain_nowww === "nudems.com" ||
			(domain_nosub === "thub.lol" && /\/contents\/+albums\//.test(src)) ||
			domain === "cdn.pornstill.com") {
			if (domain_nosub !== "thebestshemalevideos.com" && domain_nosub !== "smutr.com") {
				newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+remote_control\.php\?(?:.*?&)?file=([^&]*).*?$/, "$1");
				if (newsrc !== src)
					return urljoin(src, decodeURIComponent(newsrc), true);
			}
			newsrc = src.replace(/\/get_image\/[0-9a-f]\/[0-9a-f]+\/main\/(.*?)\/+(?:[?#].*)?$/, "/contents/albums/main/$1");
			if (newsrc !== src)
				return newsrc;
			var max = null;
			if (domain_nowww === "porntb.com") {
				max = "1920x1920";
			} else if (domain_nowww === "fetishburg.com") {
				max = "1920x1200";
			} else if (domain_nosub === "zbporn.tv") {
				max = "9998x9998";
			}
			match = src.match(/\/main\/+([0-9]+x[0-9]+)\/+/);
			if (max && match) {
				var get_pixels = function(x) {
					var match = x.match(/^([0-9]+)x([0-9]+)$/);
					if (!match)
						return 0;
					return parseInt(match[1]) * parseInt(match[2]);
				};
				if (get_pixels(max) > get_pixels(match[1])) {
					newsrc = src.replace(/\/main\/+[0-9]+x[0-9]+\/+/, "/main/" + max + "/");
				}
			} else if (!max) {
				newsrc = src.replace(/\/main\/+[0-9]+x[0-9]+\/+/, "/sources/");
			}
			obj = {
				url: newsrc
			};
			var referer_1 = "http://" + domain_nosub + "/";
			if (domain_nosub === "p7cdn.com") {
				referer_1 = "https://www.sex-hd.xxx/";
			} else if (domain_nosub === "cdntrex.com") {
				referer_1 = "";
			} else if (domain === "109.206.187.183" || domain_nosub === "porntb.com") {
				referer_1 = "http://www.porntb.com/";
			} else {
				obj.referer_ok = { same_domain: true };
			}
			obj.headers = { Referer: referer_1 };
			return obj;
		}
		if (domain === "image.jeuxvideo.com") {
			return {
				url: src.replace(/(:\/\/[^/]+\/+(?:medias|images))-[a-z]+\//, "$1/"),
				can_head: false
			};
		}
		if (domain_nosub === "mt-static.com" && /^img[0-9]*\./.test(domain)) {
			return src.replace(/(\/contents\/+albums_overview\/+[0-9]+\/+[0-9]+\/+)[0-9]+x[0-9]+\/+/, "$1sources/");
		}
		if (domain === "images.pushsquare.com") {
			return src
				.replace(/((?:\/news\/+[0-9]+\/+[0-9]+\/+[^/]+\/+)|(?:\/screenshots\/+[0-9]+\/+)|(?:\/reviews\/+[^/]*\/+[^/]*\/+))(?:[0-9]+x(?:[0-9]+)?|[a-z]+)(\.[^/.]*)$/, "$1original$2")
				.replace(/(:\/\/[^/]+\/+[0-9a-f]{5,}\/+)(?:[0-9]+x(?:[0-9]+)?|large)\./, "$1original.")
				.replace(/(\/games\/.*\/cover)(?:_[a-z]+)?(\.[^/.]*)$/, "$1_original$2");
		}
		if (domain_nowww === "pcgames.de") return src.replace(/\/screenshots\/+[0-9]*x[0-9]*\//, "/screenshots/original/");
		if (domain_nowww === "collinsdictionary.com") return src.replace(/\/images\/thumb\/([^/]*)_[0-9]+(\.[^/.]*)(\?.*)?$/, "/images/full/$1$2$3");
		if (domain_nowww === "abc.net.au") {
			return src
				.replace(/(\/pluck-cache\/images\/[-0-9a-f]+\.)[A-Z][a-z]+(\.[^/.]*)$/, "$1Full$2")
				.replace(/(\/cm\/rimage\/[0-9]+-[0-9]+x[0-9]+-)[a-z]+(\.[^/.]*)$/, "$1large$2");
		}
		if (domain_nowww === "1x.com") {
			return src
				.replace(/(:\/\/[^/]*\/)img\/[^/]*?[?&]id=([0-9a-f]+).*$/, "$1images/user/$2-hd4.jpg")
				.replace(/(\/images\/user\/[0-9a-f]+)-[a-z]+(?:[0-9]+)?(\.[^/.]*)$/, "$1-hd4$2");
		}
		if (domain === "fotografroku.ifotovideo.cz") return src.replace(/(:\/\/[^/]*\/image\.php).*?[?&]id=([0-9]+).*?$/, "$1?id=$2&size=2");
		if (domain === "img.kutikomiya.jp") return src.replace(/\/thumbnail(\/[^/]*\/)W[0-9]+(?:xH[0-9]+)?\//, "/album$1");
		if (domain === "attach.setn.com") {
			regex = /(\/newsimages\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+[0-9]+)(?:-[A-Z]+)?(\.[^/.]*)$/;
			if (regex.test(src)) {
				return [
					src.replace(regex, "$1-SOURCE$2"),
					src.replace(regex, "$1$2")
				];
			}
		}
		if (domain_nowww === "heyzo.com") return src.replace(/\/gallery\/thumbnail_([0-9]+\.[^/.]*)$/, "/gallery/$1");
		if (domain === "img.picabcd.com") return src.replace(/\/thumbnail\/images\//, "/images/");
		if (domain === "mozishop.cdn.shoprenter.hu") return src.replace(/\/mozishop\/image\/cache\/(?:[a-z]{1,}[0-9]+){1,}\//, "/mozishop/image/data/");
		if (domain === "terrigen-cdn-dev.marvel.com") return src.replace(/(\/content\/[a-z]+\/)1x\//, "$12x/");
		if (domain_nowww === "czmodels.cz" ||
			domain_nowww === "phmodels.cz") {
			return src.replace(/(\/image\/itemid-([0-9]+)\/).*/, "$1q-100/$2.jpg");
		}
		if (domain_nosub === "amazonaws.com" && /^[a-z0-9]+\.execute-api\./.test(domain)) {
			return {
				url: src
					.replace(/(:\/\/[^/]*\/image\/)fit-in\/[0-9]+x[0-9]+\//, "$1")
					.replace(/\/prod\/+image-renderer\/+[^/]+\/+[^/]+\/+[0-9]+\/+[^/]+\/+[0-9]+\/+([-0-9a-f]{20}[^/]+)(?:[?#].*)?$/, "/prod/image-renderer/original/full/0/center/100/$1"),
				can_head: false // otherwise it returns 502
			};
		}
		if (domain === "cdn.pudra.com") return src.replace(/(:\/\/[^/]*\/[0-9]+\/)fit[a-z]?[0-9]+x[0-9]+\//, "$1");
		if (domain === "arhiva.dalje.com") return src.replace(/(\/slike_[0-9]*\/)r[0-9]*(\/g[0-9]+\/)/, "$1r1$2");
		if (domain === "media.super.cz") return src.replace(/(:\/\/[^/]*\/images\/+)[^/]+\/(.*?)(?:[?#].*)?$/, "$1original/$2");
		if (domain_nowww === "d1g.com") return src.replace(/(\/photos\/[0-9]+\/[0-9]+\/[0-9]+)_[a-z]+(\.[^/.]*)$/, "$1_max$2");
		if (domain_nowww === "e-shuushuu.net") {
			return add_extensions_jpeg(src.replace(/(:\/\/[^/]*\/images\/)thumbs\//, "$1"));
		}
		if (domain === "cdn.anime-pictures.net" ||
			domain_nosub === "anime-pictures.net") {
			return src.replace(/(\/[0-9a-f]+)_[a-z]+(\.[^/.]*)(?:\.webp)?(\?.*)?$/, "$1$2$3");
		}
		if (domain === "images.treccani.it") return src.replace(/\/enc\/+media\/+share\/+images\/+[a-z]+\/+system\//, "/enc/media/share/images/orig/system/");
		if (domain === "image-store.slidesharecdn.com") return src.replace(/(:\/\/[^/]*\/[-0-9a-f]+)-large(\.[^/.]*)$/, "$1-original$2");
		if (domain_nosub === "stgy.ovh" && /^(?:[0-9]+\.)?citynews-(?:rimini)?today\./.test(domain)) {
			return src.replace(/\/~media\/[-a-z]+(\/[0-9]+\/)/, "/~media/$1");
		}
		if (domain === "media.raccweb.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+(__sized__\/+)/, "https://www.racctrusted.com/media/$1");
		if (domain === "music.librepunk.club" ||
			domain_nowww === "racctrusted.com" ||
			domain === "d16kd6gzalkogb.cloudfront.net" ||
			domain_nowww === "oye-records.com" ||
			domain === "audio.gafamfree.party") {
			return src.replace(/(:\/\/[^/]*\/+(?:media\/+)?)__sized__\/+(.*)-(?:thumbnail|crop-c[0-9]+-[0-9]+__[0-9]+-[0-9]+)-[0-9]+x[0-9]+(?:-[0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		}
		if (domain_nowww === "mormonnewsroom.org" ||
			domain === "newsroom.churchofjesuschrist.org") {
			return src.replace(/\/media\/+[0-9]+x[0-9]+\//, "/media/original/");
		}
		if (domain === "contents.mediadecathlon.com") return src.replace(/(\/p[0-9]+\/)(?:[0-9]+x[0-9]+\/)?(?:[a-z]+\/)?([^/]*)$/, "$1$2");
		if (domain_nowww === "overcast.fm") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/art.*?[?&]u=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (amazon_container === "clovermedia") {
			return src.replace(/(\/store\/+[-0-9a-f]{20,}\/+[0-9a-f]+\/+thumbnails\/+)[a-z]+\/+/, "$1original/");
		}
		if (domain === "spottappeu01prd.blob.core.windows.net") return src.replace(/(\/[0-9a-f]+\/)[0-9]+(?:_[0-9]+)(\.[^/.]*)$/, "$10$2");
		if (domain === "medias.spotern.com") return src.replace(/\/[wh][0-9]+\/([0-9]+(?:_[0-9a-f]+)?(?:-[0-9]+)?\.[^/.]*)$/, "/original/$1");
		if (domain_nosub === "ounousa.com") return src.replace(/\/Content\/ResizedImages\/[0-9]+\/[0-9]+\/[a-z]+(\/[0-9]+\.[^/.]*)$/, "/content/uploads/Article$1");
		if (domain_nowww === "divahair.ro") return src.replace(/(\/articole_imagini\/[^/]*\/[0-9]+\.[0-9]+\.[0-9]+\/)[0-9]+x[0-9]+\/([^/]*)_[0-9]+_[0-9]+(\.[^/.]*)$/, "$1$2$3");
		if (domain_nowww === "wall.hr") return src.replace(/\/cdn\/uploads\/[0-9]+x\//, "/cdn/uploads/");
		if (domain_nosub === "tialoto.bg") return src.replace(/(\/media\/tialoto\/files\/[a-z]+\/)[0-9]+x[0-9]+(?:[a-z]+)?(\/[0-9a-f]+\.[^/.]*)$/, "$1orig$2");
		if (domain === "bizweb.dktcdn.net") return src.replace(/(:\/\/[^/]+\/+)thumb\/+(?:[a-z]+|[0-9]+x[0-9]+)\/+/, "$1");
		if (domain_nowww === "socialbliss.com") return src.replace(/\/img\/[0-9]+x[0-9]+\/assets\//, "/assets/");
		if (domain_nowww === "forumfr.com") {
			return "http://" + src.replace(/.*\/applications\/core\/interface\/imageproxy\/ximageproxy\.php.*?,qimg=,h(.*?)(?:,[^_].*)?$/, "$1").replace(/,_/g, "/");
		}
		if (domain_nowww === "pinkomatic.com") return src.replace(/(\/images\/[0-9]+\/)[a-z]+\//, "$1full/");
		if (domain_nowww === "khmeread.com" ||
			(domain_nosub === "techbang.com" && domain.match(/^cdn[0-9]*(?:-[a-z]+)?\./))) {
			return src.replace(/(\/images\/[0-9]+\/)[a-z]+\//, "$1original/");
		}
		if (domain === "cfshopeetw-a.akamaihd.net" ||
			domain === "cf.shopee.tw" ||
			domain === "cf.shopee.co.id" ||
			domain === "cf.shopee.ph" ||
			domain === "cf.shopee.com.my" ||
			domain === "cf.shopee.sg" ||
			domain === "cf.shopee.co.th" ||
			domain === "cf.shopee.vn") {
			return src.replace(/(\/file\/[0-9a-f]+)_tn(?:\?.*)?$/, "$1");
		}
		if (domain_nowww === "theredlist.com") return src.replace(/\/media\/\.cache\/database\/(.*\/)[0-9]+-([^/]*)$/, "/media/database/$1$2");
		if ((domain_nosub === "hentai-cosplay.com" ||
			domain_nosub === "hentai-image.com" ||
			domain_nosub === "porn-image-xxx.com" ||
			domain_nosub === "porn-movie-xxx.com" ||
			domain_nosub === "hentai-animes.com" ||
			domain_nosub === "hentai-comic.com" ||
			domain_nosub === "aniimg.com") &&
			domain.match(/^static[0-9]*\./) &&
			string_indexof(src, "/upload/") >= 0) {
			newsrc = src
				.replace(/^[a-z]+:\/\/[^/]*\/upload\/cache\/thumbnail\/create\.php.*?[?&]image=([^&]*).*?$/, "$1");
			if (newsrc !== src) {
				return newsrc;
			}
			return src
				.replace(/(\/+[0-9]+\/+)(?:[a-z]+=[^/]*\/+){1,}([0-9]+\.[^/.]*)$/, "$1$2")
				.replace(/(\/+[0-9A-Z]+\/+)(?:[a-z]+=[^/]*\/+){1,}([0-9A-Za-z]+\.[^/.]*)$/, "$1$2");
		}
		if (domain === "d1in1v57myx5v.cloudfront.net" ||
			domain === "mpics.mgronline.com") {
			return src.replace(/\/pics\/+Thumbnails\//, "/pics/Images/");
		}
		if (domain_nowww === "artistic-nude-images.com") return src.replace(/\/thumbnail\/tn-([^/]*)$/, "/$1");
		if (domain_nowww === "babefilter.net") {
			return {
				url: src.replace(/(\/i\/[0-9a-f]+\/[0-9a-f]+)_tn(\.[^/.]*)$/, "$1$2"),
				headers: {
					Referer: src
				}
			};
		}
		if ((domain_nosub === "dagospia.com" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "sutki.net" && string_indexof(src, "/img/") >= 0) ||
			(domain_nowww === "screensonic.net" && string_indexof(src, "/images/") >= 0)) {
			return src.replace(/_tn(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "fabhairypussy.com") {
			return {
				url: src.replace(/(\/+galleries\/+[^/]*\/+(?:[0-9]{4}\/+[0-9]{2}\/+)?[^/]+\/+[0-9]+)(?:_[a-z]+){1,}(\.[^/.]*)(?:[?#].*)?$/, "$1$2"),
				headers: {
					Referer: ""
				},
				referer_ok: {
					same_domain: true
				}
			};
		}
		if (domain_nowww === "redcarpetnudes.com" ||
			domain_nowww === "shamelesscelebrities.com" ||
			domain === "cdn.onedala.tv") {
			return src.replace(/-tn(\.[^/.]*)$/, "$1");
		}
		if (domain === "pat.primecdn.net") return src.replace(/\/pics\/[a-z]+(\/[0-9a-f]+\/[0-9a-f]+\.[^/.]*)$/, "/pics/original$1");
		if (domain_nosub === "imagearn.com") return src.replace(/(:\/\/[^/]*\/)([0-9]+\/[0-9]+\.[^/.]*)$/, "$1imags/$2");
		if (domain === "img.static-smb.be" ||
			domain === "img.static-rmg.be") {
			return src.replace(/\/view\/q[0-9]*\/w[0-9]*\/h[0-9]*\//, "/view/q100/w/h/");
		}
		if (domain_nosub === "buro247.mn" ||
			domain_nosub === "buro247.sg" ||
			domain_nosub === "buro247.kz" ||
			domain_nosub === "buro247.mx" ||
			domain_nosub === "buro247.com.au" ||
			domain_nosub === "buro247.ua" ||
			domain_nosub === "buro247.mn" ||
			domain_nosub === "buro247.ru") {
			return src
				.replace(/(\/thumb\/[^/]*\/)galleries\//, "$1local/images/buro/galleries/")
				.replace(/\/thumb\/[0-9]+x[0-9]+(?:_[0-9]+)?((?:\/local)?\/(?:images|thumb)\/)/, "$1");
		}
		if (domain_nosub === "hellomagazine.com") return src.replace(/\/thumb\/+[0-9]+x[0-9]+(?:_[0-9]+)?\/+(images|gallery\/+)/, "/$1");
		if (domain === "images.vogue.it") {
			return src
				.replace(/(\/gallery\/[0-9]+\/)[A-Za-z]+(\/[-0-9a-f]+\.[^/.]*)$/, "$1Original$2")
				.replace(/(\/Photovogue\/+[-0-9a-f]{10,})_small(\.[^/.]+)(?:[?#].*)?$/, "$1_large$2");
		}
		if (domain === "blogs.glamour.de") return src.replace(/\/thumbs\/[^/]*\//, "/files/");
		if (domain === "img.beatles.ru") return src.replace(/(\/[0-9]+)(\/[0-9]+\.[^/.]*)$/, "$1b$2");
		if (domain_nowww === "boutique.az") return src.replace(/(\/images\/[0-9]+)_[a-z](\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "izum.ua") return src.replace(/(_[0-9]+)_sml[0-9]*(\.[^/.]*)$/, "$1$2");
		if (domain_nosub === "senatus.net" &&
			domain.match(/^cache[0-9]*\./)) {
			return src.replace(/\/files\/albums\/resized(?:[0-9]+x)?\//, "/files/albums/");
		}
		if (domain_nowww === "max-pix.com" ||
			domain_nowww === "kollywoodzone.com" ||
			domain_nowww === "celebwallpaper.org" ||
			domain_nowww === "carlyslayjepsen.com" ||
			domain_nosub === "moregirls.org") {
			return src.replace(/\/data\/thumbnails(\/[0-9]+\/)/, "/data/media$1");
		}
		if (domain_nowww === "tapeteos.pl") {
			return src
				.replace(/\/data\/thumbnails(\/[0-9]+\/)/, "/data/media$1big/")
				.replace(/(\/data\/media\/[0-9]+\/)([^/]*)$/, "$1big/$2")
				.replace(/__resized_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain === "media.8ch.net" ||
			domain === "media.8kun.top") {
			return src.replace(/\/file_store\/thumb\//, "/file_store/");
		}
		if (domain_nowww === "elles-se-mettent-nues-pour-nous.fr") return src.replace(/(\/photos\/[^/]+\/)thumb\//, "$1");
		if (domain === "media.filmz.ru") return src.replace(/\/photos\/+[a-z]+\/+([^/_]{2,}_)?(?:[a-z]_)?([0-9]+\.[^/.]*)$/, "/photos/full/$1f_$2");
		if (domain_nowww === "kinofilms.ua") return src.replace(/\/images\/photos\/[a-z0-9]+\/([0-9]+\.[^/.]*)$/, "/images/photos/hd/$1");
		if (domain_nowww === "grandmagazine.gr") return src.replace(/\/cache\/uploaded_images\/(.*)\/[0-9]+_[0-9]+_([^/]*)$/, "/uploaded_images/$1/$2");
		if (domain === "a69.g.akamai.net") {
			return add_http(src.replace(/^[a-z]+:\/\/[^/]*\/[a-z]+\/[0-9]+\/[0-9]+\/v[0-9]+\//, ""));
		}
		if (domain === "images.allocine.fr") return src.replace(/\/[rc]_[0-9]+_[0-9]+\/+pictures\/+/, "/pictures/");
		if (domain === "cdn-media.rtl.fr") return src.replace(/\/cache\/[-a-zA-Z0-9_]+\/[0-9]+v[0-9]+(?:-[0-9]+)?\/online\//, "/online/");
		if (domain === "images.rtl.fr") return src.replace(/(:\/\/[^/]+\/+)~c\/+[^/]+\/+/, "$1");
		if (domain === "bcdn.newshunt.com" ||
			(domain_nosub === "dailyhunt.in" && domain.match(/bcdn[-.]/))) {
			obj = {
				url: src,
				head_wrong_contentlength: true
			};
			newsrc = src.replace(/\/cmd\/[a-z]+\/[^/]*\/(fetchdata[0-9]*\/images\/)/, "/$1");
			if (newsrc !== src) {
				obj.url = newsrc.replace(/\.webp(?:[?#].*)?$/, ".jpg");
			}
			return obj;
		}
		if (domain === "media.search.lt") return src.replace(/\/GetFile\.php.*?[?&](OID=[0-9]+).*?$/, "/GetFile.php?$1&filetype=4");
		if (domain_nowww === "wallofcelebrities.com") {
			return {
				url: src.replace(/\/pictures\/[a-z]+\/([^/]*_[0-9]+\.[^/.]*)$/, "/pictures/original/$1"),
				headers: {
					Referer: "https://www.wallofcelebrities.com/"
				}
			};
		}
		if (domain_nosub === "lmstube.com") return src.replace(/\/[0-9]+x[0-9]+\/([^/]*)$/, "/$1");
		if (domain === "assets.mubi.com") return src.replace(/(\/images?)-[a-z0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1-original$2");
		if (domain_nowww === "fundir.org") return src.replace(/(:\/\/[^/]*\/)th\//, "$1img/");
		if (domain_nowww === "spletnik.ru") return src.replace(/\/thumb\/[0-9]+x[0-9]+(?:_[0-9]+)?\/img\//, "/img/");
		if (domain === "r.mtdata.ru") return src.replace(/:\/\/[^/]*\/[a-z][-0-9]+x[-0-9]+\//, "://mtdata.ru/");
		if (domain_nowww === "mtdata.ru" &&
			src.match(/:\/\/[^/]*\/u[0-9]+\/photo/)) {
			return src.replace(/\/(?:huge|big)(\.[^/.]*)$/, "/original$1");
		}
		if (domain === "img.uduba.com") {
			newsrc = src.replace(/:\/\/[^/]*\/mtdata\.ru\//, "://mtdata.ru/");
			if (newsrc !== src) {
				return newsrc.replace(/\/[a-z]+_[0-9]+x[0-9]+(\.[^/.]*)$/, "/original$1");
			}
		}
		if (domain_nowww === "russianpulse.ru") return src.replace(/^[a-z]+:\/\/[^/]*\/img\/([a-z]+:\/\/.*)$/, "$1");
		if (domain === "img.noobzone.ru" ||
			domain === "m.btdx8.com" ||
			domain_nowww === "guihuayun.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+(?:uploads\/+)?getimg\.php\?(?:.*&)?(?:url|src)=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "media.aintitcool.com") return src.replace(/_(?:large|big|huge|medium)(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain_nowww === "lichnosti.net") {
			return src
				.replace(/\/rs\/+thumbs\/+([0-9]+)\/+set_([^/]*)_([a-z]+)_[0-9]+_[0-9]+_[0-9]+\.[^/.]*$/, "/photos/$1/sets/$2.$3")
				.replace(/\/rs\/+thumbs\/+([0-9]+)\/+([^/]*)_([a-z]+)_[0-9]+_[0-9]+_[0-9]+\.[^/.]*$/, "/photos/$1/$2.$3");
		}
		if (domain_nosub === "zmones.lt" &&
			domain.match(/^s[0-9]*\.zmones\.lt/)) {
			return src.replace(/(\/images\/photos\/[0-9]+\/[0-9]+\/[0-9]+\/)[a-z]+(\/[^/]*\.[^/.]*)$/, "$1original$2");
		}
		if (domain_nosub === "hsmedia.ru" ||
			domain_nosub === "elle.ru") {
			return src.replace(/(:\/\/[^/]*\/[0-9a-f]{2}\/[0-9a-f]{2}\/[0-9a-f]{2}\/[0-9a-f]+\/)[0-9]+x[0-9]+_[^/]*@([0-9]+x[0-9]+_[^/]*)$/, "$1$2");
		}
		if (domain_nowww === "starbeat.ru" &&
			string_indexof(src, "/gallery/") >= 0) {
			return src.replace(/\/(?:small|medium)\/([^/]*)$/, "/$1");
		}
		if ((domain === "image.kilimall.com" ||
			domain === "d2lpfujvrf17tu.cloudfront.net") &&
			string_indexof(src, "/shop/store/") >= 0) {
			return src.replace(/(\/[0-9]+_[0-9]+)_[0-9]+(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "zevenmart.com") return src.replace(/\/resized\/([^/]*)_[0-9]+x[0-9]+(\.[^/.]*)$/, "/$1$2");
		if (domain_nowww === "superherotv.net" ||
			domain_nowww === "starsplanet.ru") {
			return src.replace(/\/photo\/images_small\//, "/photo/images_large/");
		}
		if (domain_nowww === "xxx-photo.com") return src.replace(/\/photo\/t\/(.*?)(?:_t)?(\.[^/.]*)$/, "/photo/i/$1$2");
		if (domain_nowww === "div.bg" ||
			domain_nowww === "jenite.bg") {
			return src.replace(/(\/pictures\/[0-9]+)_[0-9]*(?:_[0-9]*)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "cdn.hqsluts.com" ||
			domain_nowww === "hqbabes.com" ||
			domain === "c.xme.net") {
			return src.replace(/(:\/\/[^/]*\/(?:t\/)?[0-9]+)[a-z]([0-9]+(?:\.[^/.]*)?)$/, "$1c$2");
		}
		if ((domain_nowww === "sensualgirls.org" ||
			domain_nowww === "deliciousbabes.org" ||
			domain_nowww === "girlsofdesire.org") &&
			src.match(/\/media\/pictures(?:_new)?\//)) {
			return {
				url: src.replace(/(\/[^/.]*)_thumb(\.[^/.]*)$/, "$1$2"),
				headers: {
					Origin: "https://" + domain,
					Referer: "https://" + domain + "/"
				}
			};
		}
		if (domain_nowww === "littlemutt.com") return src.replace(/(\/hosted\/+[^/]+\/+[0-9]+)_thumb(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if ((domain_nosub === "mainbabes.com" && domain.match(/^content[0-9a-z]*\./)) ||
			(domain_nosub === "livejasminbabes.net" && domain.match(/^content[0-9a-z]*\./)) ||
			(domain_nosub === "babesandgirls.com" && domain.match(/^content[0-9a-z]*\./)) ||
			(domain_nosub === "exgirlfriendmarket.com" && domain.match(/^content[0-9a-z]*\./)) ||
			(domain_nosub === "rossoporn.com" && domain.match(/^content[0-9a-z]*\./)) ||
			(domain_nosub === "novostrong.com" && domain.match(/^content[0-9a-z]*\./)) ||
			(domain_nosub === "novoporn.com" && domain.match(/^content[0-9a-z]*\./)) ||
			(domain_nosub === "silkengirl.com" && /^content[0-9a-z]*\./.test(domain)) ||
			(domain_nosub === "girlsofdesire.org" && /^content[0-9a-z]*\./.test(domain)) ||
			(domain_nosub === "babesbang.com" && /^content[0-9a-z]*\./.test(domain)) ||
			(domain && domain.match(/^content[0-9a-z]*\./) && src.match(/^[a-z]+:\/\/[^/]*\/[^/.]*(?:\.[^/.]*)?\/[0-9]{4,}\/(?:[^/]*_)?tn_[0-9]{2}\.[^/.]*(?:[?#].*)?$/)) ||
			(domain_nosub === "thousandbabes.com" && domain.match(/^content[0-9a-z]*\./)) ||
			(domain_nosub === "morazzia.com" && domain.match(/^content[0-9a-z]*\./)) ||
			(domain_nosub === "babesmachine.com" && domain.match(/^content[0-9a-z]*\./)) ||
			(domain_nosub === "glam0ur.com" && domain.match(/^content[0-9a-z]*\./)) ||
			domain_nosub === "avidolz.com" ||
			domain_nosub === "pbabes.com" ||
			(domain === "static.thenude.eu" && string_indexof(src, "/galleries/") >= 0) ||
			(domain_nowww === "eros-and-grace.net" && string_indexof(src, "/galleries/") >= 0) ||
			domain === "gals.sextronix.com" ||
			domain === "fhg.baberotica.com" ||
			domain_nosub === "pornodontstop.com") {
			newsrc = src.replace(/(\/(?:[^/]*_)?)tn_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			if (domain_nosub === "novoporn.com" ||
				domain_nosub === "silkengirl.com" ||
				domain_nosub === "babesbang.com" ||
				domain_nosub === "morazzia.com") {
				return src.replace(/(\/[0-9]+\/+)([0-9]+\.)/, "$1orig_$2");
			}
		}
		if (domain_nowww === "phun.org") return src.replace(/(\/galleries\/.*\/images\/+)tn_/, "$1");
		if (domain_nosub === "livejasminbabes.net" && domain.match(/^content[0-9]*\./)) {
			return src.replace(/\/upload\/main\/tn\//, "/upload/main/");
		}
		if (domain === "static.thenude.eu") return src.replace(/(\/admin\/+covers\/+.*\/+)(?:thumbs|medheads)\/+/, "$1");
		if ((domain_nowww === "captaingoodlink.com" && string_indexof(src, "/celebrities/") >= 0) ||
			domain_nowww === "nudecelebs-a-z.com" ||
			domain_nowww === "poseposter.com" ||
			(domain_nosub === "tacamateurs.com" && domain.match(/^cdn(?:-[^/]*)?\./) && src.match(/\/tn_pic[0-9]+\./))) {
			return src.replace(/\/tn_([^/]*\.[^/.]*)(?:[?#].*)?$/, "/$1");
		}
		if (domain_nosub === "pornodontstop.com" ||
			domain === "hosted.amourangels.com" ||
			domain_nowww === "hornyteen.pro" ||
			domain_nowww === "theasianpics.com" ||
			domain_nowww === "teenporngallery.net" ||
			domain_nowww === "asiangalleries.net" ||
			domain_nowww === "chinesepornpics.com" ||
			domain_nowww === "asianteenpictures.com" ||
			domain_nowww === "japanesegirlspictures.com" ||
			domain_nowww === "koreanpornpictures.com" ||
			domain_nowww === "sexyasians.net" ||
			domain_nowww === "maturexxxpics.net" ||
			domain_nowww === "japxxx.pro" ||
			domain_nowww === "girlsnudepussy.com" ||
			domain_nowww === "hornybabepics.com" ||
			domain === "hosted.showybeauty.com" ||
			domain_nowww === "sexyhairyvagina.com" ||
			domain_nowww === "pronpic.org" ||
			domain_nowww === "teengalleries.mobi") {
			return src.replace(/\/th_([0-9]+\.[^/.]*)$/, "/$1");
		}
		if (domain === "i.girlstop.info" ||
			domain_nosub === "girlstop-extra.info" ||
			domain_nosub === "girlstop.info") {
			return src.replace(/\/thumbs\/+[0-9]+px_([^/]*)$/, "/$1");
		}
		if (domain === "photos.freeones.com") return src.replace(/(:\/\/[^/]*\/[^/]*_[^/]*\/+[^/]*\/+[^/]*\/+)([^/]*)(?:[?#].*)?$/, "$1images/$2");
		if (domain === "cdn.freeones.com" ||
			domain === "media.freeones.com") {
			return src
				.replace(/(\/(?:photo-[^/]+|freeones-photo-generated)\/+.*)_big(\.[^/.]+)(?:[?#].*)?$/, "$1_ultra$2")
				.replace(/(\/(?:photo-[^/]+|freeones-photo-generated)\/+.*)_preview(\.[^/.]+)(?:[?#].*)?$/, "$1_big$2");
		}
		if (domain_nosub === "freeones.com" && /img\./.test(domain)) {
			newsrc = src.replace(/\/pinned_pictures\/pin\//, "/pinned_pictures/original/");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+videos\/+([0-9]{3}\/+[0-9a-zA-Z]{2}\/+[0-9a-zA-Z]{2}\/+[^/]{10,}\/+)(?:poster)\/+/);
			if (match) {
				return [
					{
						url: "https://videolb.freeones.com/fo/" + match[1] + "list.smil/playlist.m3u8",
						video: "hls"
					},
					{
						url: "https://videolb.freeones.com/fo/" + match[1] + "list.smil/manifest.mpd",
						video: "dash"
					}
				];
			}
			return src.replace(/(\/photos\/+[0-9]{3}\/+[0-9a-zA-Z]{2}\/+[0-9a-zA-Z]{2}\/+[^/]{10,}\/+)(?:preview|teaser)\/+/, "$1big/");
		}
		if (domain === "videolb.freeones.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+fo\/+([0-9]{3}\/+[0-9a-zA-Z]{2}\/+[0-9a-zA-Z]{2}\/+[^/]{10,}\/+)(?:trailerWebM)\./);
			if (match) {
				return [
					{
						url: "https://videolb.freeones.com/fo/" + match[1] + "list.smil/playlist.m3u8",
						video: "hls"
					},
					{
						url: "https://videolb.freeones.com/fo/" + match[1] + "list.smil/manifest.mpd",
						video: "dash"
					}
				];
			}
		}
		if (domain_nowww === "freeones.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([-a-z0-9]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://www.freeones.com/video/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/loadFOPlayer\(.*?({\s*\n[\s\S]*?})\);\s*\n/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var json_text = fixup_js_obj(match[1]);
					var json = JSON_parse(json_text);
					var urls = [];
					array_foreach(json.src, function(url) {
						var video = true;
						if (url.type === "application/x-mpegURL") {
							video = "hls";
						} else if (url.type === "application/dash+xml") {
							video = "dash";
						} else if (url.type === "video/mp4") {
							video = true;
						} else {
							console_warn(cache_key, "Unsupported video type", url);
							return;
						}
						urls.push({
							url: url.src,
							video: video
						});
					});
					urls.push(json.poster);
					var obj = {
						extra: {
							page: resp.finalUrl,
							caption: json.chromecast.metadata.title
						}
					};
					return done(fillobj_urls(urls, obj), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "freeones.com") {
			newsrc = common_functions["get_pagelink_host_el_matching"](options, {
				url_match: /^[a-z]+:\/\/[^/]+\/+video\/+([-a-z0-9]+)\/*(?:[?#].*)?$/,
				el_match: function(x) {
					return x.tagName === "DIV" && x.classList.contains("player");
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "starspics.ru" ||
			domain_nowww === "otherstars.ru") {
			return src.replace(/(:\/\/[^/]*\/)thumbs\//, "$1img/");
		}
		if (domain === "images.apina.biz") return src.replace(/(:\/\/[^/]*\/)[a-z]+\/[a-z]+_([0-9]+\.[^/.]*)$/, "$1full/$2");
		if (domain_nowww === "wallpaperaccess.com") return src.replace(/\/thumb\/+([0-9]+\.)/, "/full/$1");
		if (domain_nowww === "pluska.sk" ||
			domain_nosub === "casopiszdravie.sk") {
			return src.replace(/\/thumb\/images\/(.*?)(?:[?#].*)?$/, "/images/$1");
		}
		if (domain_nowww === "mad-movies.com") return src.replace(/(:\/\/[^/]*\/)[0-9]+-[0-9]+-[0-9]+-images\//, "$1images/");
		if (domain === "assets.mycast.io") return src.replace(/(\/[0-9]+)_[a-z]+(\.[^/.]*)$/, "$1_original$2");
		if (domain === "cdn.cinemur.fr") return src.replace(/(?:\/cache\/[0-9]+x[0-9]+_|\/blur\/)([0-9]+\.[^/.]*)$/, "/original/$1");
		if (domain_nowww === "farfarawaysite.com") return src.replace(/\/hires\/t\//, "/hires/");
		if (domain === "movieplayer.net-cdn.it" ||
			domain === "d17vsf20mehj1i.cloudfront.net" ||
			domain === "multiplayer.net-cdn.it") {
			return src.replace(/(?:\/(?:thumbs|t))?(\/+images\/.*?|:\/\/[^/]*\/[^/]*)_([a-z]+)_(?:[0-9]+x[0-9]+_)?(?:crop_)?(?:upscale_)?(?:q[0-9]+)?(\.[^/.]*)$/, "$1.$2");
		}
		if (domain === "u.livelib.ru") {
			return src
				.replace(/\/[a-z](\/[a-z0-9]+\/)[^/]*(\.[^/.]*)$/, "/o$1o-o$2")
				.replace(/\.jpg(\?.*)?$/, ".jpeg$1");
		}
		if (domain_nosub === "celebsnetworth.org") return src.replace(/(:\/\/[^/]*\/main\/)thumbs\//, "$1images/");
		if (domain === "file.hstatic.net") return src.replace(/(\/file\/[^/]*-[0-9]+)_[a-z]+(\.[^/.]*)$/, "$1$2");
		if (domain === "sm.askmen.com") return src.replace(/(:\/\/[^/]*\/)t\/(.*\/[^/]*)\.[0-9]+(\.[^/.]*)$/, "$1$2$3");
		if (domain_nosub === "elsiglodetorreon.com.mx" && /^media[0-9]*\./.test(domain)) {
			newsrc = src.replace(/:\/\/[^/]*\/+(n?[a-z]\/+)/, "://www.elsiglodetorreon.com.mx/m/$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "elsiglodetorreon.com.mx" ||
			domain_nowww === "siglo.mx") {
			newsrc = src
				.replace(/(:\/\/[^/]*\/+(?:[^/]*\/+)?m\/+)ni\/+(.*\/[0-9]+)\.[0-9]+(\.[^/.]*)$/, "$1i/$2$3");
			if (newsrc !== src)
				return newsrc
					.replace(/\.jpg(\?.*)?$/, ".jpeg$1");
		}
		if (domain_nowww === "elsiglo.mx") {
			return src
				.replace(/(:\/\/[^/]*\/m\/)n([a-z]\/.*\/[0-9]+)\.[0-9]+(\.[^/.]*)$/, "$1$2$3")
				.replace(/(\/[0-9]+)_[a-z](\.[^/.]*)$/, "$1$2")
				.replace(/\.jpg(\?.*)?$/, ".jpeg$1");
		}
		if (domain === "img.richestcelebrities.org" ||
			domain_nowww === "celebritypictures.wiki" ||
			domain === "img.networthpost.org" ||
			domain_nowww === "thefappeningpics.com") {
			return src.replace(/(:\/\/[^/]*\/)thumbs\//, "$1images/");
		}
		if (domain_nowww === "fashionscene.nl") return src.replace(/_thumb_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
		if (domain_nowww === "monitor.bg") return src.replace(/\/gallery\/thumb_[0-9]+x[0-9]+_([^/]*)$/, "/gallery/$1");
		if (domain_nowww === "textilwirtschaft.de" ||
			domain_nowww === "fashionmagazine.it") {
			return src.replace(/(\/gallery\/media\/[0-9]+\/[0-9]+)-[a-z]+(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "horizont.net" && string_indexof(src, "/media/") >= 0) {
			return src.replace(/(-[0-9]+)-[a-z]+(\.[^/.]*)$/, "$1$2");
		}
		if (domain === "twproxy.stiletto.fr") return src.replace(/^[a-z]+:\/\/[^/]*\/[0-9a-z]+\/[wh][0-9]+\//, "http://");
		if (domain_nowww === "we123.com") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/img\/p\.php.*?[?&]p=([^&]*).*?$/, "$1"));
		}
		if (domain_nosub === "vagalume.com" && /^s[0-9]*\./.test(domain)) {
			return src.replace(/(\/images\/g?[0-9]+)[wh][0-9]+(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nosub === "glanacion.com" && domain.match(/^bucket[0-9]*\./)) {
			return src.replace(/(\/fotos\/+[0-9]+\/+[0-9]+)[wh][0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "storage.gra1.cloud.ovh.net" &&
			src.match(/\/Futurenet[^/]*Images\//)) {
			return src.replace(/_[0-9]+x[0-9]+(\?.*)?$/, "$1");
		}
		if (domain === "iasbh.tmgrup.com.tr") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/[0-9a-f]+\/(?:[0-9]+\/){5}[0-9]+.*?[?&]u=([^&]*).*?$/, "$1"));
		}
		if (domain === "i.sabah.com.tr") return src.replace(/(\/sb\/+[^/]*\/+magazin\/+[^/]*\/+[^/]*)_[a-z](\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "bideew.com") return src.replace(/(\/photos\/thumbnail\/[0-9]+\/)[a-z]+(\/*)(\?.*)?$/, "$1master$2$3");
		if (domain === "media.filfan.com") return src.replace(/(\/NewsPics\/[^/]*\/)[a-z]+(\/[^/]*)$/, "$1original$2");
		if (domain_nowww === "ana.rs") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/forum\/thumbs\/img\.php.*?[?&]src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "squa.re") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/wp-content\/+themes\/+[^/]*\/+img\.php.*?[?&]src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return urljoin(src, newsrc, true);
		}
		if (domain_nosub === "itvnet.lv" &&
			src.match(/\/upload[0-9]*\/articles\//)) {
			return src
				.replace(/\/thumbs\/[0-9]+([^/]*)$/, "/images/$1")
				.replace(/\/images\/([^_][^/]*)$/, "/images/_origin_$1");
		}
		if (domain_nowww === "connectgalaxy.com") return src.replace(/\/gallery\/icon\/([0-9]+)\/[a-z0-9]+(\?.*)?$/, "/gallery/download/$1");
		if (domain === "nst.sky.it" ||
			domain === "sydney.edu.au" ||
			(domain_nosub === "deloitte.com" && /^www/.test(domain)) ||
			domain === "about.hm.com" ||
			domain_nowww === "prada.com" ||
			domain_nowww === "hbo.com") {
			return src.replace(/(\/[^/]*\.[^/.]*)\/_jcr_content\/renditions\/.*/, "$1");
		}
		if (domain === "cdnimage.terbitsport.com") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/image\.php.*?[?&]image=([^&]*).*?$/, "$1"));
		}
		if (domain_nowww === "beimg.com") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/fangimg\.php.*?[?&]url=([^&]*).*?$/, "$1"));
		}
		if (domain_nowww === "que.es") return src.replace(/-[0-9X]+x[0-9X]+(?:x[0-9]+)?(\.[^/.]*)$/, "$1");
		if (domain_nowww === "independent.com.mt") return src.replace(/(:\/\/[^/]*\/file\.aspx).*?[?&](f=[0-9]+).*?$/, "$1?$2");
		if (domain === "img.selenka.pl") return src.replace(/(\/(?:fb)?walls\/[0-9a-f]+\/)[a-z](\.[^/.]*)$/, "$1o$2");
		if (domain === "ki.ill.in.ua") return src.replace(/\/[0-9]+x[0-9]+(\/[0-9]+\.[^/.]*)$/, "/0x0$1");
		if (domain === "stg.pcg.space") return src.replace(/\/[a-z]+(\.[^/.]*)$/, "/org$1");
		if (domain === "static.noticiasaominuto.com" ||
			domain === "static.noticiasaominuto.com.br") {
			return src.replace(/(\/stockimages\/)(?:gallery\/)?[^/]*(\/[^/]*)$/, "$1hires_original$2");
		}
		if (domain === "media-manager.noticiasaominuto.com") {
			return src
				.replace(/\?.*/, "")
				.replace(/(:\/\/[^/]*\/)[0-9]+\/+[0-9]+\/+(naom_)/, "$1$2");
		}
		if (domain_nowww === "harry-potter.net.pl") return src.replace(/(\/images\/photoalbum\/[^/]*\/[^/]*)_t[0-9](\.[^/.]*)$/, "$1$2");
		if ((domain_nosub === "kanobu.ru" ||
			domain_nosub === "kanobu.net") &&
			domain.match(/^i[0-9]*\./)) {
			return src.replace(/:\/\/[^/]*\/r\/[0-9a-f]+\/[-0-9]+x[-0-9]+\//, "://");
		}
		if (domain_nowww === "tv3.lt" ||
			domain_nosub === "inspektorius.lt") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+usi\/+[0-9]+x[0-9]+\/+.*?[?&]f=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return urljoin(src, decodeURIComponent(newsrc), true);
		}
		if (domain_nosub === "gallery.ru" &&
			domain.match(/^data[0-9]*\.(?:i\.)?gallery\.ru/)) {
			return src.replace(/(\/albums\/gallery\/[^/]*-[0-9]{5,}-)[whmc]?[0-9]+(?:x[0-9]+)?(?:-[0-9a-z]+)?(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "fotosdefamosas.tk") return src.replace(/\/miniaturas\/TN_([^/]*)$/, "/$1");
		if (domain_nowww === "starwiki.org") {
			return {
				url: src.replace(/\/thumbs\/photos\//, "/photos/"),
				head_wrong_contenttype: true
			};
		}
		if (domain_nowww === "postervdom.ru" && string_indexof(src, "/upload/") >= 0) {
			return src.replace(/(\/item_[0-9]+\/)[a-z]+_(item_[0-9]+[^/]*)$/, "$1$2");
		}
		if ((domain_nosub === "fastpic.ru" || domain_nosub === "fastpic.org") &&
			domain.match(/^i[0-9]*\./)) {
			return {
				url: src.replace(/(:\/\/[^/]*\/)thumb(\/.*\.)jpeg/, "$1big$2jpg?noht=1"),
				headers: {
					Referer: "https://" + domain_nosub + "/",
					"Sec-Fetch-Dest": "image",
					"Accept": "image/webp,image/apng,image/*,*/*;q=0.8"
				}
			};
		}
		if (domain === "i.nahraj.to") return src.replace(/(:\/\/[^/]*\/)[a-z](\/[^/]+\.[^/.]*)$/, "$1f$2");
		if (domain === "skwww.plusden.sk") return src.replace(/\/thumb(\/images\/gallery\/.*?)(?:\?.*)?$/, "$1");
		if (domain_nowww === "admags.xyz" ||
			domain_nowww === "hotmags.xyz") {
			return src.replace(/_tb(\/[^/]*)$/, "$1");
		}
		if (domain === "img.topky.sk") return src.replace(/(\/dc\/+[0-9]+\/+)thumb\//, "$1");
		if (domain_nowww === "kungahuset.org") return src.replace(/\/uploads\/thumb\/[0-9]+X[0-9]+_/, "/uploads/");
		if (domain_nosub === "e-monsite.com") return src.replace(/\/resize_[0-9]+_[0-9]+\//, "/");
		if (domain === "static.guide.supereva.it" ||
			domain === "media.gossipblog.it" ||
			domain === "media.fashionblog.it") {
			return src.replace(/\/thn_([^/]*)$/, "/$1");
		}
		if (domain_nowww === "apachan.net" ||
			domain_nowww === "prokote.info") {
			return src.replace(/(:\/\/[^/]*\/)(?:thumbs|previews)\//, "$1images/");
		}
		if (domain === "imggaleri.hurriyet.com.tr" ||
			domain === "imgkelebek.hurriyet.com.tr") {
			return src.replace(/(\/+LiveImages\/+[^/]*\/+[0-9]+\/+[^/]*)(?:\/+ThumbFolder)?\/+([^/]*)$/, "$1/LargeFolder/$2");
		}
		if (domain_nowww === "army.mil") return src.replace(/(\/e2\/c\/images\/)(.*\/)size[0-9]*(\.[^/.]*)$/, "$1$2original$3");
		if (domain_nosub === "disquscdn.com") {
			regex = /(\/uploads\/+users\/+[0-9]+\/+[0-9]+\/+avatar)(?:36|92|128)\./;
			if (regex.test(src)) {
				return replace_sizes(src, [
					src.replace(regex, "$1200."),
					src.replace(regex, "$1128.")
				]);
			}
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/get.*?[?&]url=([^&]*).*?$/, "$1"));
		}
		if (domain_nowww === "smore.com") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/external_image.*?[?&]url=([^&]*).*?$/, "$1"));
		}
		if (domain === "images.ctfassets.net") {
			return src.replace(/\?.*$/, "");
		}
		if (domain_nosub === "okccdn.com") return src.replace(/(\/php\/load_okc_image\.php\/images\/)(?:[0-9]+(?:x[0-9]+)?\/){1,}([0-9]+\.[^/.]*)$/, "$1$2");
		if (domain_nosub === "metapix.net" ||
			domain_nowww === "inkbunny.net") {
			newsrc = src.replace(/\/files\/[a-z]+\/([0-9]+\/[^/]*)$/, "/files/full/$1");
			if (newsrc === src)
				newsrc = src.replace(/\/thumbnails\/[a-z]*\/([0-9]+\/[0-9]+[^/]*?)(?:_noncustom)?(\.[^/.]*)$/, "/files/full/$1$2");
			if (newsrc !== src)
				return add_extensions(newsrc);
			return src.replace(/(\/usericons\/+)(?:tiny|small)\/+/, "$1large/");
		}
		if (domain === "cdn.furiffic.com") {
			return add_extensions(src.replace(/(:\/\/[^/]*\/)[a-z]+(\/[0-9]+\.[^/.]*)$/, "$1originals$2"));
		}
		if (domain === "d3gz42uwgl1r1y.cloudfront.net") {
			return add_extensions(src.replace(/(\/submission\/[0-9]+\/[0-9]+\/[0-9a-f]+)\/[0-9]+x[0-9]+(\.[^/.]*)$/, "$1$2"));
		}
		if (domain_nosub === "route50.net") return src.replace(/(\/data\/gallery\/submissions\/[0-9a-f]+_)[a-z]+(\.[^/.]*)$/, "$1full$2");
		if (domain === "img.luxusbenz.com" ||
			domain === "img.bmwcase.com" ||
			domain === "img.benzspirit.com") {
			return src.replace(/(:\/\/[^/]*\/)[a-z]+(\/[a-f0-9]+(?:-[^/]*)?\.[^/.]*)$/, "$1full$2");
		}
		if (domain === "dot.asahi.com") return src.replace(/\/upload\/[0-9]+_([0-9]{10,}_[0-9]+\.[^/.]*)$/, "/upload/$1");
		if (domain === "p.potaufeu.asahi.com") return src.replace(/(\/picture\/+[0-9]+\/+[0-9a-f]{10,})_[0-9]+px\./, "$1.");
		if (domain === "news-img.dwango.jp" ||
			amazon_container === "img-news-dwango-jp-prod" ||
			amazon_container === "green-img-news-dwango-jp-prod") {
			newsrc = src.replace(/(\/uploads\/[a-z]+\/file\/.*\/)(?:md|sm|lg|xl)_([^/]*)$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/:\/\/news-img\.dwango\.jp\//, "://green-img-news-dwango-jp-prod.s3.amazonaws.com/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "getnews.jp") return src.replace(/^[a-z]+:\/\/[^/]*\/thumb2\/ext\/([a-z]+:\/\/.*)$/, "$1");
		if (domain_nowww === "amuro.fr" ||
			domain_nowww === "freshfappening.com" ||
			domain_nowww === "pornoplaatjes.nl" ||
			domain_nowww === "thefappening.sexy" ||
			domain_nowww === "thefappening.rocks" ||
			domain === "gallery.cyclegarden.com" ||
			src.match(/\/_data\/+i\/+upload\/+/)) {
			newsrc = src.replace(/(\/_data\/+i\/+(?:upload|galleries)\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]{10,}-[0-9a-f]+)-th\./, "$1-me.");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/i\.php\?\/upload\/+/, "/_data/i/upload/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/_data\/+i(\/+(?:upload|galleries)\/+(?:[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]{10,}-[0-9a-f]+|[^/]+\/+[^/]+\/+[^/]+))-(?:[^/.]*|cu_s[0-9]+x[0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "cdn-news30.it") return src.replace(/\/blobs\/variants\/((?:[a-f0-9]\/){4}[-0-9a-f]+)_[a-z]+(\.[^/.]*)$/, "/blobs/full/$1$2");
		if (domain_nowww === "osobnosti.cz") {
			if (/\/img\/+pic-hover\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "imagebox.cz.osobnosti.cz" ||
			domain === "img.osobnosti.cz") {
			return src.replace(/\/[A-Z]([0-9]+)(?:-[0-9]+x[0-9]+)?(-[0-9a-z]+)?(\.[^/.]*)(?:[?#].*)?$/, "/O$1$2$3");
		}
		if (domain === "spicy.southdreamz.com") return src.replace(/\/cache\/(.*?)(?:_[0-9]+|(?:(?:_[a-z][0-9]+){1,}(?:_thumb)?))(\.[^/.]*)$/, "/spicysource/$1$2");
		if (domain === "img.miumag.pl") return src.replace(/\/[a-z]([0-9]+\.[^/.]*)$/, "/c$1");
		if (domain_nowww === "hotnews.bg") return src.replace(/(\/uploads\/news\/[^/]*\/)thumb(\/[0-9]+\.[^/.]*)$/, "$1images$2");
		if (domain === "mediaproxy.salon.com" ||
			domain === "mediaproxy.snopes.com") {
			return src.replace(/^[a-z]+:\/\/[^/]+\/+[a-z]+\/+[0-9]+\/+(https?:\/\/)/, "$1");
		}
		if (domain_nosub === "cloudimg.io" ||
			(domain_nosub === "furniture1.eu" && /^cdn[0-9]*\./.test(domain))) {
			var get_orig_cloudimg_url = function(url) {
				var aliases = {};
				if (domain === "heise.cloudimg.io") {
					aliases["_www-heise-de_"] = "https://www.heise.de";
				}
				if (domain === "cdm0lfbn.cloudimg.io") {
					aliases["_origin_"] = "https://static1.seecannes.com";
				}
				if (domain === "cdheefyn.cloudimg.io") {
					aliases["--immosquare--"] = "https://s3.amazonaws.com";
				}
				var new_domain = url.replace(/^([^/]+)\/.*/, "$1");
				for (var alias in aliases) {
					if (new_domain === alias) {
						new_domain = aliases[new_domain];
						url = new_domain + url.replace(/^[^/]+\//, "/");
						break;
					}
				}
				if (string_indexof(new_domain, ".") < 0) {
					return null;
				}
				return add_http(url);
			};
			newsrc = src.replace(/^([a-z]+:\/\/[^/]+\/+)(?:(?:cdn|cdno|fit|width|height|crop(?:_px)?|cover|fit|bound)\/(?:[0-9]+|[0-9]+(?:,[0-9]+){3}-[0-9]*x?[0-9]+|[0-9]+x[0-9]+|n(?:one)?)\/[^/@]+\/|s\/+(?:crop|width|height|resizeinbox|resizenp|cdn|fit)\/+[0-9]*(?:x[0-9]*)?\/+)/, "$1cdn/n/n/");
			if (newsrc !== src)
				return newsrc;
			if (/^[a-z]+:\/\/[^/]+\/+v7\//.test(src) && !/[?#]ci_sign=/.test(src)) {
				newsrc = src.replace(/\?.*/, "");
				if (newsrc !== src)
					return newsrc;
			}
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+(?:(?:cdn|cdno|fit|width|height|crop(?:_px)?|cover|fit|bound)\/(?:[0-9]+|[0-9]+(?:,[0-9]+){3}-[0-9]*x?[0-9]+|[0-9]+x[0-9]+|n(?:one)?)\/[^/]+\/|s\/+(?:crop|width|height|resizeinbox|resizenp|cdn|fit)\/+[0-9]*(?:x[0-9]*)?\/+)((?:[a-z]+:\/\/)?[^/]+\/.*?)$/, "$1");
			if (newsrc !== src)
				return get_orig_cloudimg_url(newsrc) || src;
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+v7\/+(.*?)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return get_orig_cloudimg_url(newsrc) || src;
		}
		if (domain === "1.f.ix.de") return src.replace(/^[a-z]+:\/\/[^/]+\/+scale\/.*?\/q[0-9]+\/+/, "https://www.heise.de/");
		if (domain_nowww === "cloudphoto.io" || domain === "cdn.cloudphoto.io") {
			return src.replace(/^[a-z]+:\/\/[^/]+\/+[^/]+\/+(?:width|height|crop|cover|fit|bound|none)\/+[0-9]+(?:x[0-9]+)?\/+[^/]+\/+(https?:\/\/)/, "$1");
		}
		if (domain_nowww === "kinataka.ru") return src.replace(/\/photos\/[0-9]+\/([^/]*)$/, "/photos/$1");
		if (domain === "easttouch.my-magazine.me") return src.replace(/(\/upload\/photoalbum\/)thumbnail(\/[0-9a-f]+\/[0-9a-f]+\.[^/.]*)$/, "$1original$2");
		if (domain === "tvdaily.asiae.co.kr") return src.replace(/\/upimages\/+photoda\//, "/upimages/gisaimg/");
		if (domain === "img.thefactjp.com" ||
			domain === "img.thefact.tv") {
			return src.replace(/(\/service\/[a-z]+\/[0-9]+\/[0-9]+\/[0-9]+\/)(?:[0-9]+|thumb)\/([0-9a-f]+\.[^/.]*)$/, "$1$2");
		}
		if (domain === "rlv.zcache.co.nz" ||
			domain === "rlv.zcache.ca" ||
			domain === "rlv.zcache.com.br") {
			return src.replace(/(-r[0-9a-f]+(?:_[_0-9a-z]+)?)_[0-9]+(\.[^/.?]*)(?:\?.*?)?$/, "$1_999999999$2?rvtype=content");
		}
		if (domain_nowww === "empireposter.de") return src.replace(/\/bilder\/bilder_[a-z]\//, "/bilder/bilder_l/");
		if (domain === "dg31sz3gwrwan.cloudfront.net") return src.replace(/(\/[0-9]+\/[0-9]+)_[a-z]+(?:-optimized-[0-9]*)?(\.[^/.]*)$/, "$1$2");
		if (domain === "img.mach-shiko.net") return src.replace(/(\/images\/[0-9]+\/[0-9]+\/)[a-z]\/([0-9]+\.[^/.]*)$/, "$1$2");
		if (domain === "img.onvshen.com") return src.replace(/(\/gallery\/+[0-9]+\/+[0-9]+\/+)[a-z]\/+([0-9]+\.[^/.]*)$/, "$1$2");
		if (domain === "img.geinou-img.com") return src.replace(/(\/[_0-9]+\/)[a-z]\/([0-9]+\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "showbiz.cz" ||
			domain === "fotky.showbiz.cz") {
			return src.replace(/(?:\/public)?(\/+files\/+gallery\/+)thumb\/+([0-9a-f]+\/[0-9a-f]+)(?:_[a-z]+)?(\.[^/.]*)$/, "$1$2$3");
		}
		if (domain === "images.nudereviews.com") return src.replace(/(\/data\/media\/image\/)[a-z]+\//, "$1original/");
		if (domain_nowww === "thefamouspeople.com") return src.replace(/\/profiles\/thumbs\//, "/profiles/images/");
		if (domain === "i.trust.ua") return src.replace(/\/files\/photo\/[0-9]+\//, "/files/photo/source/");
		if (domain === "media.beritagar.id") return src.replace(/\/(?:lme-)?([0-9]{4}-[0-9]{2}\/)(?:[a-z]+_[0-9]+\/)?(?:wd\/+)?((?:[0-9a-f]+|[^/]*_[0-9]{5,}))(?:_imresized)?(\.[^/.]*)(?:[?#].*)?$/, "/$1$2$3");
		if (domain === "imgs.ckcdn.com" ||
			domain === "i.imgscc.com") {
			return {
				url: src.replace(/\?.*$/, ""), //src.replace(/\?.*$/, "?_w=9999999999999"),
				headers: {
					Origin: null,
					Referer: null
				},
				can_head: false
			};
		}
		if (domain === "im.mtv.fi" ||
			domain_nowww === "mz-web.de" ||
			domain === "im.mtvuutiset.fi" ||
			domain_nowww === "swissinfo.ch") {
			return src.replace(/\/image(\/[0-9]+\/)(?:(?:portrait|landscape[^/]*|3x2|max)\/[0-9]+\/[0-9]+\/)?([0-9a-f]+\/)[a-zA-Z0-9]{2}\/([^/.]+)(\.[^/.]*)$/, "/blob$1$2$3-data$4");
		}
		if (domain_nowww === "katsomo.fi") return src.replace(/^.*\/static\/+[a-z]vod\/+(?:stripe_)?images\/+(image)-([0-9]+)-(portrait|landscape[^-/]*|3x2|max)-([0-9]+)-([0-9]+)-([0-9a-f]+)-([a-zA-Z0-9]{2})-([^/]+)$/, "https://im.mtv.fi/$1/$2/$3/$4/$5/$6/$7/$8");
		if (domain_nowww === "imageweb.ws" ||
			domain_nowww === "pezporn.com" ||
			domain_nowww === "hardcoreluv.com" ||
			domain_nowww === "wildpictures.net" ||
			domain_nosub === "pussyspot.net") {
			newsrc = src.replace(/(:\/\/)cdn[0-9]*\.([^/]*\/+media\/+images)/, "$1www.$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/media\/+images_[0-9]+\//, "/media/images/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "t.imageweb.ws" ||
			domain_nowww === "pezporn.com" ||
			domain_nosub === "pussyspot.net") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+[^/]+\/+([0-9]+)\.html(?:[?#].*)?$/,
				query_for_id: "http://www." + domain_nosub + "/a/${id}.html",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/href="(\/media\/images\/[^"]*)"/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done(urljoin(resp.finalUrl, match[1], true).replace(/\?.*/, ""), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
			match = src.match(/\/media\/+[^/]*\/+[0-9]+\/+[0-9]+\/+([0-9]+)\.[^/.]*/);
			if (match) {
				var queryurl = "http://www." + domain_nosub + "/a/" + match[1] + ".html";
				return {
					url: queryurl,
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "vcg.com" &&
			domain.match(/goss[0-9]*\.vcg/)) {
			return src.replace(/\/editorial\/vcg\/[0-9]+\//, "/editorial/vcg/nowarter800/");
		}
		if (domain_nosub === "renault-dacia.com.ua") {
			newsrc = urljoin("http://www.renault-dacia.com.ua/", decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/im\.php.*?[?&]image=([^&]*).*?$/, "$1")), true);
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\/pictgen\/[0-9]+\//, "/topicsfoto/");
		}
		if (domain_nowww === "numberoneturk.com.tr" ||
			domain_nowww === "fashionone.com.tr") {
			return src.replace(/(\/plog-content\/+)thumbs(\/+.*\/+)[a-z]+\/+[0-9]+-([^/]*)$/, "$1images$2$3");
		}
		if (domain === "prsize.allviki.com") return src.replace(/:\/\/[^/]*\/resize_[0-9]+(?:x[0-9]+)?\//, "://pic.allviki.com/");
		if (domain_nowww === "celebritygalls.com") return src.replace(/\/cache\/(.*)_[0-9]+_cw[0-9]+_ch[0-9]+_thumb(\.[^/.]*)$/, "/albums/$1$2");
		if (domain_nowww === "instantfap.com") return src.replace(/:\/\/[^/]*\/image\/([^/]*)$/, "://i.imgur.com/$1");
		if (domain_nowww === "agensite.com" ||
			domain === "cdn.agensite.online" ||
			domain === "cdn.conexaohost.com.br") {
			return {
				url: src
					.replace(/\/img\/[0-9]+x[0-9]+\//, "/img/original/")
					.replace(/\/temp\/img\/([0-9a-z]+)_([0-9]+)_([0-9a-z]+)_([0-9a-z]+)_([0-9]+)_([a-z]+)_[^/]*$/, "/img/original/0/0/png/$1/$2/$3/$4/$5.$6")
					.replace(/\/imagizer_export\.php\?([^,]*).*/, "/img/original/0/0/png/$1"),
				redirects: true
			};
		}
		if (domain === "images.mtvnn.com") return src.replace(/(:\/\/[^/]*\/[0-9a-f]+\/)[0-9]+(?:x[0-9]+)?_?(\.[^/.?]*)?(?:[?#].*)?$/, "$1original$2");
		if (domain === "assets.deutschlandfunk.de") return src.replace(/(\/[-0-9a-f]{20,}\/+)[0-9]+x[0-9]+\./, "$1original.");
		if (domain_nowww === "hipernoticias.com.br" ||
			domain_nowww === "noticiamax.com.br") {
			return src.replace(/(\/storage\/+webdisco\/+[0-9]+\/+[0-9]+\/+[0-9]+\/).*(\/[0-9a-f]+\.[^/.]*)$/, "$1original$2");
		}
		if (domain_nowww === "bd-journal.com") {
			match = src.match(/\/image-contents\/[0-9]+x[0-9]+x[0-9]+\/news-photos\/((?:[0-9]+\/){2,})([-0-9a-zA-Z_=+]+)(?:[?#].*)?$/);
			if (match) {
				return src.replace(/(:\/\/[^/]*\/).*/, "$1") + "assets/news_photos/" + match[1] + base64_decode(match[2]);
			}
		}
		if (domain_nowww === "myidol.com.vn") return src.replace(/\/pictures\/pic[a-z]+(\/[0-9]+\/[0-9]+\/[0-9]+\/)[0-9]+\/([a-z]+[0-9]+\.[^/.]*)$/, "/pictures/picfullsizes/$1$2");
		if (domain_nowww === "dw.com") return src.replace(/(:\/\/[^/]*\/image\/[0-9]+_)[0-9]+(\.[^/.]*)$/, "$17$2");
		if (domain_nowww === "finds.ir") return src.replace(/\/img\/tu\//, "/img/");
		if ((domain_nosub === "xuk.mobi" ||
			domain_nosub === "xuk.one" ||
			domain_nosub === "xuk.life" ||
			domain_nosub === "xuk.ooo") &&
			domain.match(/^img[0-9]*\./) &&
			string_indexof(src, "/images/photos/") >= 0) {
			return src.replace(/\/(?:thumb|big|mini)\/+([0-9a-f]+\.[^/.]*)$/, "/origin/$1");
		}
		if (domain === "s.filmsextv.com") return src.replace(/(\/[0-9a-f]+\/)thumbs\/([0-9a-f]+\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "lanita.ru" &&
			string_indexof(src, "/images/offer/") >= 0) {
			return src.replace(/(\/[0-9]+)-thumb(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "backalleypics.net") return src.replace(/(\/images\/(?:[0-9]+-[0-9]+-[0-9]+|photoshoots)\/)thumbs\/([^/]*)$/, "$1$2");
		if (domain_nowww === "turboimagehost.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+p\/+([0-9]+)\/+([^/?#]+\.html)(?:[?#].*)?$/,
				query_for_id: "https://www.turboimagehost.com/p/${1}/${2}",
				process: function(done, resp, cache_key) {
					var image = get_meta(resp.responseText, "og:image");
					if (!image) {
						console_error(cache_key, "Unable to find og:image from", resp);
						return done(null, false);
					}
					return done({
						url: image,
						is_original: true,
						extra: {
							page: resp.finalUrl
						}
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "turboimg.net" ||
			domain_nosub === "turboimagehost.com") {
			match = src.match(/\/t[0-9]*\/+([0-9]+)_([^/?#]+)(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://www.turboimagehost.com/p/" + match[1] + "/" + match[2] + ".html",
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "arhivach.cf" ||
			domain_nowww === "arhivach.ng") {
			return src.replace(/(\/storage[0-9]*\/)t\/([0-9a-f])([0-9a-f]{2})([0-9a-f]+\.[^/.]*)$/, "$1$2/$3/$2$3$4");
		}
		if (domain === "content.wafflegirl.com" ||
			domain_nosub === "youx.xxx" ||
			domain_nosub === "xxxwaffle.com" ||
			domain === "cdn.pornpictureshq.com") {
			return {
				url: src.replace(/\/gthumb\/(.*)(?:__x[0-9]+|_[0-9]+x(?:[0-9]+)?_?)(\.[^/.]*)$/, "/content/$1$2"),
				can_head: false // youx.xxx returns 404
			};
		}
		if (domain_nowww === "anawalls.com") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/repic\/image\.php.*?[?&]src=([^&]*).*?$/, "$1"));
		}
		if (domain === "d3ofq03apmfb8c.cloudfront.net" ||
			domain_nowww === "lipstickalley.com" ||
			(domain_nosub === "mandatory.com" && domain.match(/^cdn[0-9]*-hfboards\./)) ||
			domain === "forum.purseblog.com" ||
			(domain_nowww === "behindbigbrother.com" && string_indexof(src, "/forums/data/") >= 0) ||
			domain_nowww === "simsettlements.com" ||
			domain_nowww === "resetera.com" ||
			domain === "data.voz.vn" ||
			domain === "forums.mangadex.org" ||
			/\/avatars\/+[smlh]\/+[0-9]+\/+[0-9]+\.jpg\?[0-9]{10}$/.test(src)) {
			regex = /(\/avatar(?:s|\/+[0-9]{5,}))\/+[a-z]\/+([0-9]+\/+[0-9]+\.[^/.]*)$/;
			if (regex.test(src)) {
				return [
					src.replace(regex, "$1/o/$2"),
					src.replace(regex, "$1/l/$2")
				];
			}
		}
		if (/\/data\/+attachments\/+[0-9]+\/+[0-9]+-[0-9a-f]{20,}\.[^/.]+(?:[?#].*)?$/.test(src) && options.element) {
			if (options.element.parentElement && options.element.parentElement.tagName === "A") {
				var parent = options.element.parentElement;
				if (parent.classList.contains("js-lbImage") && /\/attachments\/+[-0-9a-f]{20,}-(?:jpeg|png)\.[0-9]+\/*(?:[?#].*)?$/.test(parent.href)) {
					return parent.href;
				}
			}
		}
		if (domain === "img-cache.cdn.gaiaonline.com") {
			return src.replace(/^[a-z]+:\/\/[^/]*\/[0-9a-f]+\//, "");
		}
		if (domain === "y.zdmimg.com") return src.replace(/(\/[0-9a-f]+\.[^/._]*)_[a-z][0-9]+\.[^/.]*$/, "$1");
		if (domain_nosub === "oboi.ws") return src.replace(/\/wallpapers\/(?:[0-9]+|[a-z])_([0-9]+_[^/]*)(?:_[0-9]+x[0-9]+)?(\.[^/.]*)$/, "/originals/original_$1$2");
		if (domain_nowww === "wallpaperscraft.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:download|wallpaper)\/+((?:[^/]*_)?[0-9]+)(?:\/+[0-9]+x[0-9]+)?(?:[?#].*)?$/,
				query_for_id: "https://wallpaperscraft.com/wallpaper/${id}",
				process: function(done, resp, cache_key, match) {
					var id = match[1];
					match = resp.responseText.match(/<a[^>]*\/download\/[^>]*>\s*Original Resolution: *([0-9]+x[0-9]+)/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done("https://images.wallpaperscraft.com/image/" + id + "_" + match[1] + ".jpg", 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "images.wallpaperscraft.com") {
			id = src.replace(/.*\/([^/]*)_[0-9]+x[0-9]+\.[^/.]*$/, "$1");
			if (id !== src) {
				return {
					url: "https://wallpaperscraft.com/wallpaper/" + id,
					is_pagelink: true
				};
			}
		}
		if (domain === "cdn.eso.org" ||
			domain_nowww === "eso.org") {
			return src.replace(/(\/images\/|\/archives\/postcards\/)[^/]*\/([^/.]*\.[^/.]*)$/, "$1large/$2");
		}
		if (domain_nowww === "galex.caltech.edu") {
			return src
				.replace(/(_img[0-9]*)_(?:Sm|small)(\.[^/.]*)$/, "$1$2")
				.replace(/(_vid[0-9]*)_tn(\.[^/.]*)$/, "$1_shot$2");
		}
		if (domain_nowww === "astro-austral.cl") return src.replace(/(\/imagenes\/galaxies\/[^/]*\/)[a-z]+(\.[^/.]*)$/, "$1max$2");
		if (domain_nowww === "buddhistdoor.net") return src.replace(/(\/upload\/file\/[0-9]+\/[0-9]+\/[0-9a-f]+)_[0-9]+(?:__[0-9]+)?(\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "agraroldal.hu") {
			return add_extensions(src.replace(/\/[^/]*\/[0-9]+x[0-9]+\/([0-9]+\.[^/.]*)$/, "/upload/upimages/$1"));
		}
		if (domain === "media.lamsao.com") return src.replace(/\/Thumbnail\/Cache\/*Data\/(.*)_[0-9]+_[0-9]+(\.[^/.]*)$/, "/Data/$1$2");
		if (domain === "tupian.aladd.net") return src.replace(/(\.[^-/.]*)-[0-9]+(?:[?#]*)?$/, "$1");
		if (domain === "uploadfile.huiyi8.com" ||
			domain === "i.hexuexiao.cn" ||
			(domain_nowww === "popwindshop.com" && string_indexof(src, "/pics/") >= 0)) {
			return src.replace(/(\.[^/.]*)\.[0-9]+\.[^/.?#]*([?#].*)?$/, "$1$2");
		}
		if ((domain_nosub === "redocn.com" && domain.match(/^img[0-9]*\./)) ||
			domain === "image.tupian114.com") {
			return {
				url: src.replace(/(\/[^/]*\.[^/.]*)\.[0-9]+\.[^/.]*$/, "$1"),
				problems: {
					watermark: true
				}
			};
		}
		if (domain_nosub === "mangadex.org" && /\/covers\/+[-0-9a-f]{20,}\/+[-0-9a-f]{20,}[^/]+(?:[?#].*)?$/.test(src)) {
			return {
				url: src.replace(/(\.[^/.]*)\.[0-9]+\.[^/.?#]*([?#].*)?$/, "$1$2"),
				can_head: false // 404
			};
		}
		if (domain === "media.alienwarearena.com") return src.replace(/\/thumb(?:nail)?_[0-9]+x[0-9]+\/+([0-9a-f]{10,}\.[^/.]*)$/, "/media/$1");
		if (domain_nowww === "6asian.com") return src.replace(/(\/imglink\/[a-z]+)-thumb[0-9]+x[0-9]+\//, "$1/");
		if (domain === "music.fetnet.net") return src.replace(/(\/img\/album\/[0-9]+)-[0-9]+(\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "wallpaperscave.ru") return src.replace(/\/images\/thumbs\/[^/]*\/[0-9]+x[0-9]+\//, "/images/original/");
		if (domain_nowww === "lilit.lv") return src.replace(/\/[0-9]+px_([0-9]+_[0-9a-f]+\.[^/.]*)$/, "/full_$1");
		if (domain === "img.kurocore.com") return src.replace(/(:\/\/[^/]*\/)thumbnail\/p\//, "$1p/");
		if (domain_nowww === "mocah.org") return src.replace(/(:\/\/[^/]*\/)thumbs\/([0-9]+-[^/]*)$/, "$1uploads/posts/$2");
		if (domain_nowww === "anime-zone.ru") return src.replace(/(\/inc\/goods_[a-z]+\/[^/]*\/)[a-z]+\/([^/]*)$/, "$1$2");
		if (domain_nowww === "99px.ru") return src.replace(/:\/\/[^/]*\/sstorage\/[0-9]+\/[0-9]+\/[0-9]+\/[a-z]+_([0-9]+)_[0-9]+\.[^/.]*$/, "://wallpapers.99px.ru/cms/mhost.php?tid=53&act=getimage&id=$1");
		if (domain_nowww === "wall2born.com") return src.replace(/\/file\/download\/[0-9]+x[0-9]+\/([0-9]+\/[^/]*)-[0-9]+x[0-9]+(\.[^/.]*)$/, "/data/out/$1$2");
		if (domain_nowww === "wallpapersexpert.com") return src.replace(/\/images\/+file\/+([0-9]+\/+)[0-9]+x[0-9]+-([0-9]+-)/, "/data/out/$1$2");
		if (amazon_container === "desktop-backgrounds-org") {
			return src.replace(/\/(?:[^-/]*-)?[0-9]+x[0-9]+\/([^/]*\.[^/.]*)$/, "/$1");
		}
		if (domain_nowww === "oboi.cc" ||
			domain_nowww === "oboik.ru") {
			return src.replace(/\/(?:[-0-9]+)?uploads(?:_full)?(\/[0-9]+_[0-9]+_[0-9]+\/)[a-z]+(\/[0-9]+\/[^/]*)$/, "/uploads$1view$2");
		}
		if (domain === "img.getbg.net") return src.replace(/\/upload\/[a-z]+\/([0-9]*\/)(?:thumbnail_)?([^/]*)$/, "/upload/full/$1$2");
		if ((domain_nosub === "fichub.com" ||
			domain === "scontent.ccdn.cloud")
			&& string_indexof(src, "/image/") >= 0) {
			return src.replace(/(\/image\/+[^/]+\/+[-0-9a-f]{30,}\/+[^/]+?)(?:-(?:maxw-[0-9]+|[0-9]+x[0-9]+))?(?:\/+[0-9]+x[0-9]+)?(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "nishinippon.co.jp" && string_indexof(src, "/import/") >= 0) {
			return src.replace(/(\/[0-9]+\/[0-9]+_[0-9]+)_s(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "nishinippon.co.jp") return src.replace(/(\/uploads\/+image\/+[0-9]+\/+)[a-z]+_([0-9a-f]{6,}(?:_org)?\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "resource.shuud.mn") return src.replace(/(\/[0-9]+)_t(\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "anime-fresh.ru") return src.replace(/(\/upload\/[a-z]+\/)thumbs\/([^/]*)$/, "$1$2");
		if (domain === "imgfiles.plaync.com") return src.replace(/\/download_thumbnail\/([^/]*)$/, "/download/$1");
		if (domain_nowww === "jjdao.com") return src.replace(/(\/wiki\/uploads\/[0-9]+\/[0-9+][0-9a-zA-Z]+)_[a-z](\.[^/.]*)$/, "$1$2");
		if (domain === "t.huv.kr") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/thumb_crop_resize\.php.*?[?&]url=([^&?]*).*?$/, "$1"));
		}
		if (domain === "down.humoruniv.org") {
			return {
				url: src,
				headers: {
					Referer: ""
				}
			};
		}
		if (domain_nosub === "pocoimg.cn" &&
			domain.match(/^img[0-9]*\./)) {
			return src.replace(/_[WH][0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "qcmt.bid") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/upload\/.*?[?&]src=([^&]*).*?$/, "$1"));
		}
		if (domain === "pic.xiao4j.com") return src.replace(/(\/[0-9]+\.[^/._]*)_[0-9]+_[0-9]+\.[^/.]*$/, "$1");
		if (domain === "img.mm29.com") return src.replace(/(\/[0-9]+\.[^/.]*)\/[0-9]+\.[^/.]*$/, "$1");
		if (domain_nosub === "2chmatome2.jp" &&
			domain.match(/^image[0-9]*\./)) {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/v2\/thumb\/app\/[0-9]+\/[0-9]+\/.*?[?&]url=([^&]*).*?$/, "$1"));
		}
		if (domain === "file.2chmatome2.jp") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/(http)/, "$1");
			if (newsrc !== src) {
				return decodeURIComponent(decodeURIComponent(newsrc));
			}
		}
		if (domain_nowww === "wnacg.net") return src.replace(/\/data\/thumb\//, "/data/");
		if (domain === "rs.n1info.com") return src.replace(/\/Thumbnail(\/[0-9]+\/)/, "/Picture$1");
		if (domain_nowww === "adevarul.ro" && string_indexof(src, "/MRImage/") >= 0) {
			return src.replace(/\/[0-9]+x[0-9]+(\.[^/.]*)$/, "/orig$1");
		}
		if (domain_nowww === "eva.bg") return src.replace(/\/media_cache\/[^/]*\/media\//, "/media/");
		if (domain === "data.kontrakty.ua") return src.replace(/(\/cache\/[a-z]+\/)[0-9]+\//, "$1orig/");
		if (domain === "d3t543lkaz1xy.cloudfront.net") return src.replace(/(\/photo\/[0-9a-f]+)_[a-z](?:[?#].*)?$/, "$1");
		if (domain_nowww === "merokhabar.net") return src.replace(/\/thumbnail\/thumb([^/]*)$/, "/original/ori$1");
		if (domain_nosub === "ali213.net" &&
			domain.match(/^img[0-9]*\./)) {
			return src.replace(/\/[0-9]+_([0-9]+\.[^/.]*)$/, "/$1");
		}
		if (domain === "cdn.magzter.com" ||
			amazon_container === "magztertemp") {
			newsrc = src.replace(/\/images\/+thumb\/+thumb_([0-9]+\.[^/.]+)(?:[?#].*)?$/, "/images/original/large_$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "reseuro.magzter.com" ||
			domain === "rse.magzter.com") {
			return src
				.replace(/:\/\/[^/]*\/[0-9]+x[0-9]+\/articles\//, "://magarticles.magzter.com/articles/")
				.replace(/:\/\/rse\.[^/]*\/[0-9]+x[0-9]+\//, "://cdn.magzter.com/");
		}
		if (domain === "dev.magzter.com") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/dynimage\/thumb_news\.php.*?[?&]src=([^&]*).*$/, "$1"));
		}
		if (domain === "content.haycdn.com" ||
			domain === "images.hayneedle.com") {
			return src
				.replace(/\/dynimage\.ms\?(?:.*&)?img=([^&]+).*?$/, "/$1")
				.replace(/\?is=.*/, "");
		}
		if (domain === "img.bulawayo24.com") return src.replace(/\/articles\/thumbs\/[0-9]+x[0-9]+\//, "/articles/");
		if (domain === "static.eva.ro") return src.replace(/\/img\/auto_resized\/db\/(.*)-[0-9]+x[0-9]+(?:-.-[0-9a-f]+)?(\.[^/.]*)$/, "/img/db/$1$2");
		if (domain === "s-image.hnol.net") return src.replace(/^[a-z]+:\/\/[^/]*\/x\/[0-9]+x[0-9]+\/auto\/(https?):\/\/?/, "$1://");
		if (domain === "cdn.tower.jp") return src.replace(/(:\/\/[^/]*\/za\/)[a-z]\//, "$1o/");
		if (domain_nowww === "gamers-onlineshop.jp" ||
			domain_nowww === "animate-onlineshop.jp" ||
			domain_nowww === "acoop-onlineshop.jp" ||
			domain === "cdn.melonbooks.co.jp" ||
			domain_nowww === "melonbooks.co.jp" ||
			domain === "jpstore.dwango.jp" ||
			domain_nowww === "gamers.co.jp" ||
			(domain_nosub === "techorus-cdn.com" && /^tc-/.test(domain)) ||
			domain === "melonbooks.akamaized.net") {
			return src.replace(/(:\/\/[^/]*\/)(?:(?:user_data\/packages|resize_image)\/)?resize_image\.php.*?[?&]image=([^&]*).*$/, "$1upload/save_image/$2");
		}
		if (domain_nowww === "hmv.com.hk") return src.replace(/\/data\/upload\/[0-9]+\//, "/data/upload/");
		if (domain === "img.hmv.co.jp") {
			if (/\/image\/+backimage\.gif(?:[?#].*)?$/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain_nowww === "buysmartjapan.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/images\/[0-9a-f]+.*?[?&]original=([^&]*).*$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain_nowww === "sonymusic.co.jp") return src.replace(/(\/adm_image\/common\/.*)__[0-9]+_[0-9]+_[0-9]+(\.[^/.]*)$/, "$1$2");
		if (domain_nosub === "imageban.ru" &&
			domain.match(/^i[0-9]*\./)) {
			return src.replace(/(:\/\/[^/]*\/)thumbs\/([0-9]+)\.([0-9]+)\.([0-9]+)\/([0-9a-f]+\.[^/.]*)$/, "$1out/$2/$3/$4/$5");
		}
		if (domain === "image.hackadoll.com") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/thumbs.*?[?&]u=([^&]*).*$/, "$1"));
		}
		if (domain === "images.niooz.fr") {
			return urljoin(src, decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/safe_image\.php.*?[?&]i=([^&]*).*$/, "$1")), true);
		}
		if (domain_nowww === "mengchongzhi.com") return src.replace(/\/uploadfile\/thumb\//, "/uploadfile/");
		if (domain_nowww === "playground33.com") return src.replace(/(\/uploads\/(?:[0-9]\/){4}[0-9]+\/[0-9]+)(\.[^/.]*)$/, "$1_orig$2");
		if (domain_nosub === "trends.com.cn" &&
			domain.match(/^cdn[0-9]*\./)) {
			return src.replace(/-tweb\.[a-z]+(?:\.[^/.]*)?(?:[?#].*)?$/, "");
		}
		if (domain_nowww === "la-soubrette.fr") {
			return src
				.replace(/\/photo-ps\/+([^/]*)-([0-9]+)\./, "/photo-ps-grande/$2-$1.")
				.replace(/\/thumbs-photo-nue\//, "/photo-ps-nue/");
		}
		if (domain === "static.feber.se" && string_indexof(src, "/article_images/") >= 0) {
			return src.replace(/(\/[0-9]+)_[0-9]+(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "previiew.com" ||
			domain_nowww === "lfi-online.de" ||
			domain_nowww === "s-magazine.photography" ||
			domain_nowww === "m-magazine.photography" ||
			domain_nowww === "l-mount.com" ||
			domain_nowww === "bettinaschoenbach.com" ||
			domain_nowww === "portrix-ls.de" ||
			domain_nowww === "glocon.eu" ||
			domain_nosub === "olympus.eu") {
			return {
				url: src.replace(/(\/webfile\/+img\/+[0-9]+)(?:\/+[xy]=[0-9]+)*(?:\/+[a-zA-Z0-9=]{10,})?(\/[^/]+\.[^/.?]+)?(?:[?#].*)?$/, "$1$2"),
				can_head: false
			};
		}
		if (domain === "d2e7nuz2r6mjca.cloudfront.net") return src.replace(/-[0-9]+[wh](\.[^/.]*)$/, "$1");
		if (domain_nowww === "vplate.ru" ||
			domain_nowww === "wlooks.ru") {
			return src.replace(/\/images\/article\/cropped\/[0-9]+-[0-9]+\//, "/images/article/orig/");
		}
		if (domain === "media.vogue.com") return src.replace(/(:\/\/[^/]*\/)r\/[a-z]_[0-9]+(?:(?:,|%2C)[a-z]_[0-9]+)*\//, "$1r/original/");
		if (domain_nosub === "efu.com.cn" &&
			domain.match(/^img[0-9]*\./)) {
			return src.replace(/(\/upfile\/[^/]*\/photo\/)[a-z]+\/([0-9]+\/[0-9]+\.[^/.]*)$/, "$1$2");
		}
		if (domain === "static.stopgame.ru") {
			if (/\/video\/blank\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "images.stopgame.ru" ||
			domain_nowww === "stopga.me") {
			return src
				.replace(/(\/(?:articles|images\/+video)\/[0-9]+\/[0-9]+\/[0-9]+\/)c[0-9]+x[0-9]+\/[0-9a-zA-Z]+\/([^/]*)$/, "$1$2")
				.replace(/(\/articles\/[0-9]+\/[0-9]+\/[0-9]+\/[^/]*-[0-9]+)-s(\.[^/.]*)$/, "$1$2")
				.replace(/(\/uploads\/images\/[0-9]+\/[a-z]+\/[0-9]+\/[0-9]+\/[0-9]+\/)[a-z]+_([0-9]+\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "pure-nude-celebs.com" ||
			domain_nowww === "celebsandstarsnude.com" ||
			domain_nowww === "celebsking.com") {
			return src.replace(/\/pic-([^/]*)$/, "/$1");
		}
		if (domain_nowww === "pincelebs.net") return src.replace(/\/thumbs(\/(?:[0-9a-f]\/){3}[0-9a-f]+\.[^/.]*)$/, "/images$1");
		if (domain === "img.new2005.com") return src.replace(/(\/[0-9a-f]+\.[^/._]+)_old(?:[?#].*)?$/, "$1");
		if (domain === "s.libertaddigital.com") {
			return src
				.replace(/(:\/\/[^/]*\/(?:(?:fotos\/+(?:galerias\/+[^/]*|[a-z]+))|(?:[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}))\/+)[0-9]+\/+[0-9]+\/+(?:fit\/+)?([^/]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "imgstudio.org" ||
			domain_nowww === "imgadult.com" ||
			domain_nowww === "imageboom.net" ||
			domain_nowww === "acidimg.cc" ||
			domain_nowww === "imagedecode.com" ||
			domain_nowww === "damimage.com" ||
			domain_nosub === "imgcredit.xyz" ||
			domain_nowww === "imgwallet.com" ||
			domain_nowww === "imgdrive.net" ||
			domain_nowww === "imgaws.com" ||
			domain_nowww === "imgtaxi.com") {
			if (/\/css\/+img\/+showcase\.img\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			if (domain_nowww === "imgaws.com") {
				newsrc = website_query({
					website_regex: /^[a-z]+:\/\/[^/]+\/+img-([0-9a-f]{5,})\.html(?:[?#].*)?$/,
					query_for_id: function(id) {
						return {
							method: "POST",
							url: "https://" + domain + "/img-" + id + ".html",
							imu_mode: "document",
							headers: {
								"content-type": "application/x-www-form-urlencoded",
								origin: "https://" + domain,
								Referer: "https://" + domain + "/img-" + id + ".html"
							},
							data: "imgContinue=Continue+to+image..."
						};
					},
					process: function(done, resp, cache_key) {
						var match = resp.responseText.match(/<a href='(https?:\/\/[^"']+\/upload\/+big\/+[^"']+)'/);
						if (!match) {
							console_error(cache_key, "Unable to find match for", resp);
							return done(null, false);
						}
						var url = decode_entities(match[1]);
						return done({
							url: url,
							extra: {
								page: resp.finalUrl
							}
						}, 6 * 60 * 60);
					}
				});
				if (newsrc)
					return newsrc;
			} else {
				newsrc = website_query({
					website_regex: /^[a-z]+:\/\/[^/]+\/+img-([0-9a-f]+)\.html(?:[?#].*)?$/,
					query_for_id: "https://" + domain + "/img-${id}.html",
					process: function(done, resp, cache_key) {
						var image = get_meta(resp.responseText, "og:image");
						return done(image, 6 * 60 * 60);
					}
				});
				if (newsrc)
					return newsrc;
			}
			return {
				url: src.replace(/\/(images|upload)\/+small(?:-medium)?\/+/, "/$1/big/"),
				headers: {
					Referer: "https://" + domain + "/"
				},
				referer_ok: {
					same_domain_nosub: true
				}
			};
		}
		if (domain === "i.acidimg.cc") return src.replace(/(:\/\/[^/]*\/)[a-z]+\//, "$1big/");
		if (domain === "img.depo.ua") return src.replace(/(:\/\/[^/]*\/)[0-9X]+x[0-9X]+\//, "$1original/");
		if ((domain_nowww === "elfagr.com" ||
			domain_nowww === "arabmubasher.com" ||
			domain_nowww === "elbalad.news" ||
			domain_nowww === "elmwatin.com" ||
			domain_nowww === "dostor.org" ||
			domain_nowww === "studio-dostor.org" ||
			domain_nowww === "albawabhnews.com") &&
			/\/upload\/+photo\//.test(src)) {
			return src.replace(/\/+[0-9]+x[0-9]+[a-z]?\/+([^/]*?)(?:[?#].*)?$/, "/$1");
		}
		if (domain_nowww === "cdnimpuls.com") return src.replace(/\/-[0-9]+-[0-9]+-([0-9a-f]+(?:_[^/]*)?\.[^/.]*)$/, "/$1");
		if (domain_nowww === "mshreqnews.net" ||
			(domain_nowww === "mykentfamily.co.uk" && string_indexof(src, "/_media/") >= 0) ||
			domain_nowww === "pdfkul.com") {
			newsrc = src.replace(/\/img\/+[0-9]+x[0-9]+\/+([^/]*)(?:[?#].*)?$/, "/img/$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "choisirunfilm.fr") return src.replace(/\/persons\/small\/([0-9]+\.[^/.]*)$/, "/persons/$1");
		if (domain_nosub === "gazetaexpress.com" ||
			domain === "old.fishmedia.info") {
			return src.replace(/(\/public\/+uploads\/+image\/+[0-9]+\/+[0-9]+\/+)[0-9]+x[0-9]+\/+([^/]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "kosovapress.com") return src.replace(/(\/public\/+uploads\/+image\/+)[0-9]+x[0-9]+\/+/, "$1");
		if (domain_nowww === "haynews.am") return src.replace(/\/thumbs\/[0-9]+x(?:[0-9]+)?\//, "/images/");
		if (domain_nowww === "emlakkulisi.com") return src.replace(/\/resim\/[a-z]+\//, "/resim/orjinal/");
		if (domain_nowww === "aquarellefm.md" && string_indexof(src, "/storage/") >= 0) {
			return src.replace(/_Fit_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "joy.hu" ||
			domain === "static.marquardmedia.hu") {
			return src.replace(/(\/data\/[^/]*\/[0-9]+\/[0-9]+)(?:-[^/.]*)?\.(?:[0-9]+(?:x[0-9]+)?|layer|w)(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "ivoirematin.com") return src.replace(/(\/images\/[0-9]+-[0-9]+\/)fb_([0-9a-f]+\.[^/.]*)$/, "$1$2");
		if (domain === "img.theqoo.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/proxy\.php.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc === src) {
				newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/proxy\/(.*)$/, "$1");
			}
			if (newsrc !== src) {
				if (!newsrc.match(/^[a-z]+:\/\//))
					newsrc = "http://" + newsrc;
				return newsrc;
			}
		}
		if (domain_nowww === "gpslifetime.com.br" && string_indexof(src, "/uploads/") >= 0) {
			return src.replace(/\/image\/thumbs\//, "/image/");
		}
		if (domain_nowww === "lasillarota.com" ||
			domain === "lasillarotarm.blob.core.windows.net.optimalcdn.com" ||
			domain === "info7rm.blob.core.windows.net.optimalcdn.com") {
			return src
				.replace(/:\/\/[^/]*lasillarota\.com\/images\/tnfocus\/(?:[0-9]+\/){4}([0-9]+\/[0-9]+\/[0-9]+\/[^/]*)$/, "://lasillarotarm.blob.core.windows.net.optimalcdn.com/images/$1")
				.replace(/(\/images\/[0-9]+\/[0-9]+\/[0-9]+\/[^/]*)-focus(?:-[0-9]+){4}(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "znaj.ua" ||
			domain_nowww === "akcenty.com.ua") {
			return src.replace(/\/crops\/+[a-z0-9]+\/+[0-9]+x[0-9]+\/+[0-9]+\/+[0-9]+\/+([0-9]+\/+[0-9]+\/+[0-9]+\/+[^/]*)$/, "/images/$1");
		}
		if (domain_nowww === "raragente.com.br") return src.replace(/\/imagem\/noticia\/[0-9]+\/[0-9]+\//, "/images/materias/");
		if (domain_nowww === "pastefs.com") return src.replace(/\/resource\/[a-z]+\//, "/resource/files/");
		if (domain_nowww === "sigmalive.com") return src.replace(/\/application\/cache\/[^/]*\/(images\/[^/]*\/)[0-9]+x[0-9]+\//, "/uploads/$1");
		if (domain_nowww === "luna.ovh") return src.replace(/\/imgw\/[0-9]+px\//, "/imgw/");
		if (domain_nowww === "shalala.ru") return src.replace(/(\/upload\/artists\/[0-9]+\/)[a-z]+\/([0-9]+_[0-9]+\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "fay3.com") return src.replace(/\/assets\/uploads\/(?:images_)?thumbs\//, "/assets/uploads/images/");
		if (domain_nowww === "vijesti.ba" ||
			domain_nosub === "novi.ba") {
			return src.replace(/(\/storage\/[0-9]+\/[0-9]+\/[0-9]+\/)thumbs\/([^/]*)-(?:preview(?:Org)?|[0-9]+x[0-9]+)(\.[^/.]*)$/, "$1$2$3");
		}
		if (domain === "m.smedata.sk") return src.replace(/(\/api-media\/media\/image\/.*)_[0-9]+x[0-9]*(\.[^/.]*)$/, "$1$2");
		if ((domain_nosub === "diariolibre.com" && domain.match(/estatico[0-9]*\.diariolibre\.com/)) ||
			domain_nowww === "expreso.ec" ||
			domain_nowww === "vanguardia.com" ||
			domain_nowww === "thesundaily.my" ||
			domain_nowww === "canarias7.es") {
			return src.replace(/\/binrepository\/[0-9]+x[0-9]+\/.*(\/[^/]*)(?:[?#].*)?$/, "/binrepository$1");
		}
		if (domain_nowww === "modelisto.com") return src.replace(/(-[0-9]+)@[0-9]+(\.[^/.]*)$/, "$1$2");
		if (domain === "media.kg-portal.ru") return src.replace(/(_[0-9]+)[st](\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "desktopwallpaperhd.net") return src.replace(/(:\/\/[^/]*\/)thumbs\//, "$1wallpapers/");
		if (domain_nowww === "wallpaperplay.com") return src.replace(/\/walls\/[^/]*\//, "/walls/full/");
		if (domain_nosub === "pics.vc" &&
			domain.match(/^s[0-9]*\./)) {
			return src.replace(/(:\/\/[^/]*\/pics\/)[a-z]\//, "$1o/");
		}
		if ((domain_nosub === "imageshack.us" ||
			domain_nosub === "imageshack.com") &&
			domain.match(/^imagizer/)) {
			return src.replace(/(:\/\/[^/]*\/v2\/)[^/]*\//, "$1x/");
		}
		if (domain_nowww === "girlofthehour.com") return src.replace(/\/IMG\/poster_resized\//, "/IMG/poster/");
		if (domain === "hwcdn.ddstatic.com") {
			regex = /(-gal-)[0-9]+(-[a-z]+\/[^/]*)$/;
			return [
				src.replace(regex, "$11600$2"),
				src.replace(regex, "$11024$2")
			];
		}
		if (domain_nowww === "wallpaperbackgrounds.com") return src.replace(/(\/Content\/wallpapers\/.*\/)thumb-([0-9]+-[0-9]+\.[^/.]*)$/, "$1$2");
		if (domain_nosub === "barelist.com" && /^img[0-9]*\./.test(domain)) {
			return src
				.replace(/(\/images\/+hosted\/+[^/]*\/+[^/]*\/+)thumbs\//, "$1pics/")
				.replace(/\/images\/+gallery_[0-9]+_[0-9]+\//, "/images/gallery/");
		}
		if (domain === "proxy.imgsmail.ru") {
			return add_http(decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/.*?[?&]url[0-9]*=([^&]*).*?$/, "$1")));
		}
		if (domain_nosub === "imgsmail.ru" &&
			domain.match(/^filapp[0-9]*\./)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+pic.*?[?^]url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nosub === "imgsmail.ru" && /^my[0-9]*\./.test(domain)) {
			if (/\/mail\/+ru\/+images\/+my\/+compass\/+static\//.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain === "go.imgsmail.ru") {
			if (/\/imgpreview\?/.test(src)) {
				return remove_queries(src, ["h", "w"]);
			}
		}
		if (domain_nowww === "pornoonline.com.pl") return src.replace(/(\/images\/galerie\/[0-9]+\/)[a-z]+\/[a-z]+_([0-9a-f]+\.[^/.]*)$/, "$1$2");
		if (domain === "img.cdn.pornzone.com") return src.replace(/(\/galerie\/+[0-9]+\/+[0-9]+\/+)small_([0-9a-f]{20,}\.)/, "$1big_$2");
		if (domain_nowww === "photo-erotique.org") return src.replace(/(\/girls\/[0-9]+\/)thumb_([0-9]+\.[^/.]*)$/, "$1$2");
		if (domain === "s.mediasole.ru") return src.replace(/:\/\/[^/]*\/cache\/preview\/data\//, "://mediasole.ru/data/");
		if ((domain_nosub === "godsartnudes.com" ||
			domain_nosub === "godsartglam.com") &&
			domain.match(/^pics[0-9]*\./)) {
			return src.replace(/(-[0-9]+_[0-9]+)(?:_thumb)?(\.[^/.]*)$/, "$1_big$2");
		}
		if (domain_nowww === "gotgalleries.com") return src.replace(/th([0-9]*\.[^/.]*)$/, "$1");
		if ((domain_nosub === "perfectnaked.com" ||
			domain === "cdn.erocurves.com")
			&& string_indexof(src, "/galleries/") >= 0) {
			return src.replace(/(\/[0-9]+)_tn(\.[^/.]*)$/, "$1_big$2");
		}
		if (domain_nowww === "facefuckingporn.com") return src.replace(/(\/galleries\/+[^/]+\/+[^/]+)_tn(\.[^/.]+)(?:[?#].*)?$/, "$1_big$2");
		if (domain_nowww === "eroticbeauties.net" ||
			domain === "blog.pinkworld.com") {
			var eb_info = {
				regex: /^[a-z]+:\/\/[^/]+\/+pics\/+[^/]*-([0-9]+)\.html(?:[?#].*)?$/,
				qfi: "https://" + domain + "/pics/-${id}.html",
				image_regex: /<img class='img-thumbnail\s+img-responsive\s+sharpen' src='(https?:\/\/[^/]+\/+content\/[^']+)'/,
				video_regex: /(<video id="fluidPlayer">[\s\S]+<\/video>)/
			};
			var pw_info = {
				regex: /^[a-z]+:\/\/[^/]+\/+[^/]*-([0-9]+)\.html(?:[?#].*)?$/,
				qfi: "https://" + domain + "/-${id}.html",
				image_regex: /<figure\s+class='gallery-thumb[^"']*'>\s*<a\s+(?:[^>]+\s+)?href='(https?:\/\/[^/]+\/+(?:[^"']+\/+)?content\/[^'"]+\/full\/[^'"]+)'/,
				video_regex: /(<video id="pinkworld_video"[\s\S]+<\/video>)/
			};
			var our_info = domain_nosub === "eroticbeauties.net" ? eb_info : pw_info;
			newsrc = website_query({
				website_regex: our_info.regex,
				query_for_id: our_info.qfi,
				override_cb: function(cb, data) {
					var id = "1";
					var imu_id = src.match(/#imu-id=(.*)/);
					if (imu_id)
						id = imu_id[1];
					common_functions["update_album_info_links"](data, function(x) {
						var x_id = x.replace(/.*\/(?:[^/?#.]+_)?([0-9]+\.)[a-z0-9]{3,4}(?:[?#].*)?$/i, "$1");
						return x_id === id;
					});
					cb(data);
				},
				process: function(done, resp, cache_key) {
					var matches = match_all(resp.responseText, our_info.image_regex);
					if (!matches) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var images = [];
					var video_match = resp.responseText.match(our_info.video_regex);
					if (video_match) {
						var videosources = common_functions["get_videotag_sources"](video_match[1]);
						if (videosources && videosources.video.length) {
							for (var _i = 0, _a = videosources.video; _i < _a.length; _i++) {
								var video = _a[_i];
								images.push({
									url: video.url,
									headers: {
										Referer: "https://" + domain + "/"
									},
									video: true,
									is_current: false
								});
								break;
							}
						}
					}
					for (var i_5 = 0; i_5 < matches.length; i_5++) {
						images.push({
							url: decode_entities(matches[i_5][1]),
							is_current: i_5 === 0
						});
					}
					return done({
						url: images[0].url,
						album_info: {
							type: "links",
							links: images
						},
						is_private: true
					}, 200); // pinkworld = 255 seconds?
				}
			});
			if (newsrc)
				return newsrc;
		}
		if ((host_domain_nowww === "eroticbeauties.net" ||
			host_domain === "blog.pinkworld.com") && options.element) {
			var fullimg = null;
			newsrc = common_functions["get_pagelink_host_el_matching"](options, {
				url_match: /^[a-z]+:\/\/[^/]+\/+(?:pics\/+)?[^/]*-[0-9]+\.html(?:[?#].*)?$/,
				el_match: function(x) {
					if ((x.tagName !== "IMG" || !x.classList.contains("img-responsive")) &&
						(x.tagName !== "SOURCE" && (!x.parentElement || x.parentElement.tagName !== "PICTURE")))
						return false;
					var current = x;
					while (current = current.parentElement) {
						if (current.tagName === "FIGURE" ||
							(current.tagName === "A" && current.classList.contains("pswp_open"))) {
							var alink = current;
							if (current.tagName !== "A")
								alink = current.querySelector("a");
							fullimg = alink.href;
							return true;
						}
					}
					return false;
				}
			});
			if (newsrc) {
				var urls = [];
				urls.push({
					url: options.host_url.replace(/[?#].*/, "") + "#imu-id=" + src.replace(/.*\/(?:[^/?#.]+_)?([0-9]+\.)[a-z0-9]{3,4}(?:[?#].*)?$/i, "$1"),
					is_pagelink: true
				});
				if (fullimg)
					urls.push(fullimg);
				if (urls.length)
					return urls;
			}
		}
		if (domain_nosub === "eroticbeauties.net" ||
			domain_nosub === "hometownnudes.com" ||
			domain_nosub === "eroticmetart.com"
		) {
			var baseobj_5 = {
				headers: {
					Referer: "http://" + domain_nosub + "/"
				},
				referer_ok: {
					same_domain_nosub: true
				}
			};
			newsrc = src.replace(/\.webp([?#].*)?$/, ".jpg$1");
			if (newsrc !== src) {
				baseobj_5.url = newsrc;
				return baseobj_5;
			}
			newsrc = src.replace(/(\/content\/+[^/]*\/+)(?:[^/]*\/+[^/]*\/+)?(?:tn@[^/]*|[0-9]+|main)\/+((?:[^/.]+_)?[0-9]+\.[^/.]*)$/, "$1full/$2");
			if (newsrc !== src) {
				baseobj_5.url = newsrc;
				return baseobj_5;
			}
		}
		if (domain_nowww === "barahla.net") return src.replace(/(\/images\/photo\/[0-9]+\/[0-9]+\/[0-9]+\/)(?:[a-z]+\/)?([0-9]+)(?:_[a-z]+)?(\.[^/.]*)$/, "$1big/$2_big$3");
		if (domain === "i.pipec.info") return src.replace(/\/[0-9]+px\/([^/]*)$/, "/$1");
		if (domain_nosub === "hothag.com" && domain.match(/^cdn[0-9]*\./)) {
			newsrc = src.replace(/(\/media\/+(?:galleries|images))_[0-9]+\//, "$1/");
			if (newsrc !== src)
				return add_full_extensions(newsrc);
			return src.replace(/(\/media\/+gifs)_[0-9]+(\/+[0-9/]+)\.[^/.]*(?:[?#].*)?$/, "$1/$2.gif");
		}
		if ((domain_nosub === "1zoom.ru" ||
			domain_nosub === "1zoom.me") &&
			domain.match(/^s[0-9]*\./)) {
			return src
				.replace(/(:\/\/[^/]*\/)prev2\//, "$1prev/")
				.replace(/(:\/\/[^/]*\/)big[0-9]*\//, "$1big3/");
		}
		if (domain === "st-gdefon.gallery.world" ||
			domain === "st.gde-fon.com") {
			return src.replace(/\/wallpapers_[a-z]+(\/[0-9]+_[^/]*)$/, "/wallpapers_original$1");
		}
		if (domain_nowww === "boorp.com") return src.replace(/\/miniature(\/[^/]*)$/, "$1");
		if (domain === "d2pptc4exyus09.cloudfront.net" ||
			domain === "static.puzzlefactory.pl") {
			return src.replace(/(\/puzzle\/[0-9]+\/[0-9]+\/)[a-z]+(\.[^/.]*)$/, "$1original$2");
		}
		if (domain_nowww === "sfondo.info") return src.replace(/\/i\/[a-z]+\//, "/i/original/");
		if (domain_nosub === "yiihuu.com" &&
			domain.match(/^img[0-9]*\./)) {
			return src
				.replace(/\/[0-9]+X[0-9]+\/upimg\//, "/upimg/")
				.replace(/\?.*/, "");
		}
		if (domain_nowww === "superwall.us" ||
			domain_nowww === "rex-fox.com") {
			return src.replace(/(:\/\/[^/]*\/)thumbnail\//, "$1wallpaper/");
		}
		if (domain_nosub === "mangadrawing.net") return src.replace(/\/imagecache\/display\/image\//, "/image/");
		if (domain_nosub === "ucoz.ru" ||
			domain_nowww === "intoclassics.net" ||
			domain_nowww === "zonemod.com" ||
			domain_nosub === "ucoz.net") {
			newsrc = src
				.replace(/(\/_ph\/+[0-9]+\/+)[0-9]+\/+([0-9]+\.[^/.]*)$/, "$1$2")
				.replace(/(\/_(?:nw|pu)\/+[0-9]+\/+)s([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return add_extensions_jpeg(newsrc);
		}
		if (domain_nowww === "wallpapersdig.com") return src.replace(/\/images\/[a-z]+(?:\/.*)?(\/[^/]*-[0-9]+\.[^/.]*)$/, "/images/original$1");
		if (domain === "img.hebus.com") return src.replace(/\/[a-z]+\/[a-z]?([0-9]+_[0-9]+\.[^/.]*)$/, "/$1");
		if (domain === "content.eroo.pl") return src.replace(/(\/[0-9]+)_[a-z]+(\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "timdir.com") return src.replace(/\.tn(\.[^/.]*)$/, "$1");
		if (domain_nowww === "live-stats.me") return src.replace(/\/pics\/+thumbs\//, "/pics/images/");
		if (domain_nowww === "plekoflady.ga") return src.replace(/\/media\/+thumbs\/+/, "/media/images/");
		if (domain_nowww === "celebcafe.net") {
			newsrc = src.replace(/\/blog\/thumbs\//, "/blog/pics/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "z-celebs.com" ||
			domain_nowww === "celebcafe.net" ||
			domain_nowww === "neocelebs.com" ||
			domain_nowww === "starsmaster.com" ||
			domain_nowww === "starzhunter.com" ||
			domain_nowww === "easycelebritys.com") {
			return src.replace(/\/pics\/+thumbs\/+/, "/pics/");
		}
		if (domain === "cdn.xpics.me" ||
			domain === "cdn.pornpic.xxx" ||
			domain === "cdn.pornpictures.today" ||
			domain === "cdn.xnxxpics.top" ||
			domain === "cdn.hdpornpics.net" ||
			domain === "cdn.pussy-porn-pics.com") {
			return src.replace(/(:\/\/[^/]*\/)[0-9]\//, "$10/");
		}
		if (domain_nowww === "nehuha.net" && string_indexof(src, "/data/photo/") >= 0) {
			return src.replace(/\/thumb\.([^/]*)$/, "/$1");
		}
		if (domain_nowww === "pornrice.com" ||
			domain_nowww === "monocdn.com" ||
			domain === "media.jpegworld.com" ||
			domain_nowww === "tokyoteenies.com" ||
			domain === "cdn.smutie.com" ||
			domain_nowww === "sexthread.com" ||
			domain_nowww === "sugarnips.com" ||
			domain_nowww === "galleryportal.com") {
			newsrc = src.replace(/(:\/\/[^/]*|\/media)\/+thumbs\/+((?:[0-9a-f]\/){5}[0-9a-f]+\/)[0-9]+x[0-9]+\//, "$1/galleries/$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "tokyoteenies.com") return src.replace(/(\/content\/+[^/]*\/+)thumbs_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1image_$2");
		if (domain === "wallpapers.jami.lt") return src.replace(/_big(\.[^/.]*)$/, "$1");
		if (domain === "y.yarn.co") {
			if (/\/site\/+assets\/+images\/+black\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
			obj = {
				url: src
			};
			match = src.match(/:\/\/[^/]*\/([-0-9a-f]+)(?:_.*?)(?:[?#].*)?$/);
			if (match) {
				obj.extra = { page: "https://yarn.co/yarn-clip/" + match[1] };
			}
			newsrc = src.replace(/(:\/\/[^/]*\/[-0-9a-f]+)_thumb(\.[^/.]*)$/, "$1_screenshot$2");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			newsrc = src.replace(/(:\/\/[^/]*\/[-0-9a-f]+)_[0-9]+_[wh]_[0-9]+\.gif(?:[?#].*)?$/, "$1.mp4");
			if (newsrc !== src) {
				obj.url = newsrc;
				obj.video = true;
				return obj;
			}
		}
		if (domain === "images.genius.com") return src.replace(/\/avatars\/[a-z]+\/([0-9a-f]+)(?:[?#].*)?$/, "/avatars/original/$1");
		if (domain_nosub === "smcloud.net" &&
			domain.match(/^cdn[0-9]*\.thumbs\.common\./)) {
			return src.replace(/:\/\/[^/]*\/common\/.\/.\/s\/([^/]*\.[^/.]*)\/.*/, "://static.common.smcloud.net/s/$1");
		}
		if (domain_nowww === "recordeli.com") return src.replace(/(\/items\/[0-9]+\/image_)[a-z]+(?:[?#].*)?$/, "$1big");
		if (domain_nosub === "liveinternet.ru" &&
			domain.match(/^img[0-9]*\./)) {
			return src.replace(/(\/[0-9]+)_[a-z]+(_+[0-9A-Za-z]+\.[^/.]*)$/, "$1$2");
		}
		if (domain === "assets.heart.co.uk" ||
			domain === "assets.popbuzz.com") {
			return src.replace(/(-[0-9]+)-(?:view|herowidev[0-9]*)-[0-9]+(\.[^/.]*)$/, "$1$2");
		}
		if (domain === "kms.yawmiyati.com") return src.replace(/\/Images\/[0-9io]+x[0-9io]+x[0-9io]+\//, "/content/uploads/Article/");
		if (domain === "pic.chinasspp.com") return src.replace(/_s_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1");
		if (domain_nowww === "eveningecho.ie") return src.replace(/(\/portalsuite\/image\/+[-0-9a-f]+)\/+[^/]*(\.[^/.]*)$/, "$1/mainMediaSize=FILE__image$2");
		if (domain_nowww === "drunkenstepfather.com") return src.replace(/\/cms\/ul\/t-/, "/cms/ul/");
		if (domain_nowww === "fraufluger.ru") return src.replace(/(\/files\/images\/html_gallerys\/[^/]*\/[0-9a-f]+)_[0-9]+(\.[^/.]*)$/, "$1_origin$2");
		if (domain_nowww === "alfacdn.com") return src.replace(/(\/[0-9]+)h?(\.[^/.]*)/, "$1m$2");
		if (domain === "s.img.mix.sina.com.cn") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/auto\/resize.*?[?&]img=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain === "albums.timg.co.il") return src.replace(/(\/userFolders\/[0-9]+\/[0-9]+\/)[a-z]+\/([0-9]+\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "aljanh.net") return src.replace(/(\/data\/archive\/)[a-z]+\/(img\/[0-9]+\.[^/.]*)$/, "$1$2");
		if (amazon_container === "files.d20.io") {
			return src.replace(/(\/images\/[0-9]+\/[^/]*\/)[a-z]+(\.[^/.?]*)(?:[?#].*)?$/, "$1max$2");
		}
		if (domain_nowww === "wallpaperdx.com") return src.replace(/\/photo(\/[^/]*)-[0-9]+-[0-9]+(\.[^/.]*)$/, "/images$1$2");
		if (domain_nowww === "patrasevents.gr") return src.replace(/(\/imgsrv\/+.\/+)[0-9]+x(?:[0-9]+)?\/+/, "$1full/");
		if (domain_nowww === "alazmenah.com" ||
			domain_nowww === "syria-in.com") {
			return src.replace(/\/thumb_photo\//, "/photo/");
		}
		if (domain === "images.alwatanvoice.com") return src.replace(/\/news\/thumbs\//, "/news/large/");
		if (domain_nowww === "ammanalyoum.com") {
			return {
				url: src.replace(/(\/images\/upload\/[^/]*\.[^/.]*)\/[0-9]+\/[0-9]+\/[0-9]+(?:[?#].*)?$/, "$1"),
				can_head: false // 403
			};
		}
		if (domain_nowww === "shitpostbot.com") {
			newsrc = src.replace(/(:\/\/[^/]*\/)resize\/[0-9]+\/[0-9]+.*?[?&]img=([^&]*).*?$/, "$1$2");
			if (newsrc !== src) {
				return decodeURIComponent(newsrc).replace(/(:\/\/[^/]*)\/+/, "$1/");
			}
		}
		if (domain_nowww === "extremnews.com") return src.replace(/\/images\/[a-z_]+-([0-9a-f]+\.[^/.]*)$/, "/images/full-$1");
		if (domain === "contestimg.wish.com") {
			return {
				url: src.replace(/(\/api\/webimage\/[0-9a-f]+(?:-[0-9]+)?)-[a-z]+(\.[^/.?]*)(?:[?#].*)?$/, "$1-original$2"),
				head_wrong_contenttype: true
			};
		}
		if (domain === "image.phimmoi.net") return src.replace(/(\/profile\/[0-9]+\/)[a-z]+(\.[^/.]*)$/, "$1full$2");
		if (domain_nosub === "static-bluray.com" &&
			domain.match(/^images[0-9]*\./)) {
			return src
				.replace(/(\/reviews\/+[0-9]+_[0-9]+)(?:_tn)?(\.[^/.]*)$/, "$1_large$2")
				.replace(/(\/htgallery\/+[0-9]+)_tn(\.[^/.]*)$/, "$1$2")
				.replace(/(\/products\/+[0-9]+\/+[0-9]+_[0-9]+_)[a-z]+(\.[^/.]*)$/, "$1original$2")
				.replace(/(\/movies\/+(?:ma|uv)?covers\/+[0-9]+_)(?:small|medium|large)\./, "$1front.");
		}
		if (domain_nowww === "titus.kz" ||
			domain_nowww === "shymkent.kz") {
			return src.replace(/(\/load_theme\/files\/[0-9a-f]+)\.[^/]*(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "mfoxes.net") {
			return src
				.replace(/\/[a-z],[0-9]+,[^/]*\/gal\//, "/gal/")
				.replace(/\/castimagethumb-([0-9]+\.[^/.]*)$/, "/castimage-$1");
		}
		if (domain === "i.ucrazy.ru") return src.replace(/(\/files\/+(?:i|pics)\/+[0-9]{4}\.[0-9]{1,2}(?:\.[0-9]{1,2})?\/)thumbs\//, "$1");
		if (domain_nowww === "athinorama.gr") return src.replace(/(\/articles\/[0-9]+\/[^/.]*\.[^/.]*)\.ashx\?.*$/, "$1");
		if (domain_nosub === "spiiky.com" && domain.match(/^img[0-9]*\./)) {
			return src.replace(/\.ashx\?.*/, "");
		}
		if (domain_nowww === "murekkephaber.com") return src.replace(/(\/images\/[^/]*\/[0-9]+\/[0-9]+\/[^/]*)_t(\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "egehaber.com") return src.replace(/\/images\/+haberler\/+thumbs\/+/, "/images/haberler/");
		if (domain_nowww === "dienvienvietnam.vn" &&
			string_indexof(src, "/assets/img/") >= 0) {
			return src.replace(/(_[0-9]+)_[a-z]+(\.[^/.]*)$/, "$1_grande$2");
		}
		if (amazon_container === "s3bucketvn") {
			return src.replace(/\/images\/thumbs\/[a-z]+\/([0-9a-f]+\.[^/.]*)$/, "/images/$1");
		}
		if (domain_nosub === "gazeta.ua" &&
			domain.match(/^static[0-9]*\./)) {
			return src.replace(/(\/img2?\/+)[a-z]+\/+([a-z]+\/+[0-9]+\/+[0-9]+(?:_[0-9]+)?)_[^/]*(\.[^/.]*)$/, "$1original/$2$3");
		}
		if (domain_nowww === "gazzettadiparma.it" ||
			domain === "img.liberoquotidiano.it" ||
			domain_nowww === "dundalkdemocrat.ie" ||
			domain_nowww === "donegaldemocrat.ie" ||
			domain_nowww === "liberoquotidiano.it") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/resizer_ext\/[-0-9]+\/[-0-9]+\/[a-z]+\/(http)/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc).replace(/--(\.[^/.]*)$/, "");
			newsrc = src.replace(/\/resizer\/[-0-9]+\/[-0-9]+\/[a-z]+\/([0-9]+(?:_[0-9]+)?\.[^-/.]+)--.*/, "/upload/$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/resizer\/+[-0-9]+\/+[-0-9]+\/+[a-z]+\//, "/resizer/-1/-1/true/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "media.defense.gov") return src.replace(/\/[0-9]+\/+[0-9]+\/+[^/]+\/+([^/]+)(?:[?#].*)?$/, "/-1/-1/0/$1");
		if (domain === "multimidia.correiodopovo.com.br") return src.replace(/(:\/\/[^/]*\/)thumb\.aspx.*?Caminho=([^&]*).*?$/, "$1$2");
		if (domain_nosub === "diziler.com" &&
			domain.match(/^s[0-9]*\./)) {
			return src.replace(/(:\/\/[^/]*\/)img\/[0-9]+x[0-9]+\//, "$1original/");
		}
		if (domain === "g.denik.cz") return src.replace(/_sip-[0-9]+up(\.[^/.]*)$/, "$1");
		if (domain_nowww === "imperiodefamosas.com") return src.replace(/(:\/\/[^/]*\/)image_cache\.php.*?[?&]file=([^&]*).*?$/, "$1$2");
		if (domain_nowww === "lostfilm.info") return src.replace(/\/images\/+[0-9]+(photo|poster)/, "/images/$1");
		if (domain_nowww === "hinhnenso1.com") return src.replace(/(\/images\/blogs\/[0-9]+\/[0-9]+\/)[a-z]+\//, "$1original/");
		if (domain_nowww === "avatarko.ru") return src.replace(/(:\/\/[^/]*\/img\/)[a-z]+\//, "$1kartinka/");
		if (domain_nowww === "ppe.pl") return src.replace(/(\/upload\/news\/(?:[0-9]+\/){3})[a-z]+_([0-9]+\.[^/.]*)$/, "$1$2");
		if (domain === "storge.pic2.me") return src.replace(/\/cm?\/[0-9]+x[0-9]+\//, "/upload/");
		if (domain_nowww === "serey.io") return src.replace(/^[a-z]+:\/\/[^/]*\/imageproxy\/[0-9]+x[0-9]+\/(https?:\/\/)/, "$1");
		if (domain === "static.pjmedia.com") return src.replace(/\.sized-[0-9t]+x[0-9t]+x[0-9t]+(\.[^/.]*)$/, "$1");
		if (domain === "file.nxing.cn" ||
			domain === "upload.nxing.cn") {
			return {
				url: src.replace(/(\/uploads\/uploads\/[0-9]+\/[0-9]+\/[0-9]+\/[0-9]+\/[0-9a-f]+)-size[0-9]+x[0-9]+(?:_[^/]*)?(\.[^/.]*)$/, "$1$2"),
				headers: {
					Referer: ""
				}
			};
		}
		if (amazon_container === "kateryan" ||
			amazon_container === "totalworld" ||
			amazon_container === "lkbkspro" ||
			amazon_container === "clmlkbks" ||
			amazon_container === "defacto" ||
			amazon_container === "apostrophelookbooks" ||
			amazon_container === "thegardenparty" ||
			amazon_container === "exposureny" ||
			amazon_container === "atomo-management" ||
			amazon_container === "traceymattingly" ||
			amazon_container === "jmireps" ||
			(domain_nosub === "lookbookspro.com" && domain.match(/assets\.lookbookspro\.com$/))) {
			if (/\/[a-z]+_[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\.[^/.]+(?:[?#].*)?$/) {
				return src
					.replace(/\/(?:lg|g(?:[sm]|x?l))_([-0-9a-f]{20,}\.)/, "/gxxl_$1")
					.replace(/\/hd_([-0-9a-f]{20,}\.)/, "/fullhd_$1")
					.replace(/\/video_([-0-9a-f]{20,}\.)/, "/hd_$1");
			}
		}
		if (domain_nowww === "havepussy.com") return src.replace(/\/uploads\/photos\/previews\/([0-9]+_[^/]*)$/, "/0-0/$1");
		if (domain === "news.walkerplus.com") {
			return {
				url: src.replace(/(\/article\/[0-9]+\/[0-9]+)_[0-9]+(\.[^/.]*)$/, "$1$2"),
				can_head: false // 404
			};
		}
		if (domain === "movie.walkerplus.com" ||
			domain_nowww === "moviewalker.jp") {
			newsrc = src.replace(/(\/api\/+resizeimage\/.*?)(?:[?#].*)?$/, "$1?w=");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/:\/\/[^/]+\/+api\/+resizeimage\/+news\/+(.*?)(?:[?#].*)?$/, "://news.walkerplus.com/$1.jpg");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (domain === "img.jj20.com") return src.replace(/(\/[0-9A-Z]+-[0-9]+)-[a-z]+(\.[^/.]*)$/, "$1$2");
		if (domain === "i.iplsc.com") return src.replace(/(\/[0-9A-Z]+)-C[0-9]+(?:-F[0-9]+)?(\.[^/.]*)$/, "$1-C0$2");
		if (domain === "s3.viva.pl") return src.replace(/-GALLERY_[0-9]+(\.[^/.]*)$/, "-GALLERY_BIG$1");
		if ((domain_nosub === "vogue.com.tr" && domain.match(/^cdn[0-9]*\./)) ||
			(domain_nosub === "gq.com.tr" && domain.match(/^cdn[0-9]*\./)) ||
			domain === "wr3mii5n.rocketcdn.com" ||
			domain === "voguecdn.blob.core.windows.net") {
			return src.replace(/\/files\/img\/[^/]*\//, "/files/original/");
		}
		if (domain_nosub === "clients-cdnnow.ru" ||
			domain === "s.properm.ru") {
			return src
				.replace(/(\/[a-z]+Storage\/(?:(?:post|news)\/)?(?:[0-9a-f]{2}\/){1,}[0-9a-f]+)_resizedScaled_[0-9]+to[0-9]+(\.[^/.]*)$/, "$1$2")
				.replace(/(:\/\/[^/]*\/)[a-z]+Storage\/+/, "$1originalStorage/");
		}
		if (domain_nowww === "hollywoodtuna.com") return src.replace(/\/images([0-9])\/([^/]*)$/, "/images$1/bigimages$1/$2");
		if (domain_nosub === "soupcdn.com" &&
			domain.match(/^asset-.\./)) {
			return src.replace(/(\/asset\/[0-9]+\/[0-9]+_[0-9a-z]+)_[0-9]+(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nosub === "qqmofasi.com" &&
			domain.match(/^pic[0-9]*\./)) {
			return src.replace(/_crop(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "download-rooz.com" ||
			domain_nowww === "day-download.com") {
			return src.replace(/\/img\/+[0-9]+-[0-9]+\//, "/img/");
		}
		if (domain_nowww === "know.cf") return src.replace(/\/imgw\/[0-9]+px\/([^/]*)$/, "/imgw/$1");
		if (amazon_container === "timely-api-public") {
			return src.replace(/(\/timely-api-public[^/]*\/[0-9]+_[0-9a-zA-Z]+)_[a-z]+(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "image-share.com") return src.replace(/(\/upload\/[0-9]+\/[0-9]+)m(\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "amando.it") return src.replace(/\/imagesdyn\/gallery_plus\/(?:[0-9]+x[0-9]+|orig_[0-9]+)\//, "/imagesdyn/gallery_plus/orig/");
		if (domain_nowww === "textureking.com") {
			return add_extensions_upper(src.replace(/\/content\/img\/stock\/([^/]*)$/, "/content/img/stock/big/$1"));
		}
		if (domain_nowww === "textures.com") {
			if (src.match(/\/system\/+gallery\/+photos\/+[^/]*\/+(?:[^/]*\/+)?[0-9]+\/+[^/]+(?:[?#].*)?$/)) {
				return {
					url: src.replace(/(\/[0-9]+\/+)([^/]*_)(?:download)?[0-9]+(\.[^/.]*)$/, "$1hotlink-ok/$2shared$3"),
					problems: {
						watermark: true
					}
				};
			}
		}
		if ((domain_nosub === "gmbox.ru" ||
			domain_nosub === "vestifinance.ru") &&
			domain.match(/^[a-z][0-9]*\./)) {
			return src.replace(/(\/c\/[0-9]+)\.[0-9]+x[0-9p]+(?:c[0-9]+)?(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nosub === "game2day.ru") return src.replace(/\/images\/made\/[0-9a-f]+\/([0-9]+-[0-9]+)_[0-9]+_[0-9]+_(?:s_)?c[0-9]+(\.[^/.]*)$/, "/uploads/userfiles/images/$1$2");
		if (domain_nowww === "topcrochetpatterns.com") return src.replace(/\/images\/+made\/+(images\/+uploads\/+blog\/+[^/]*?)_[0-9]+_[0-9]+_[0-9]+_c[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain_nowww === "dangerousminds.net") return src.replace(/\/content\/+uploads\/+images\/+made\/+(content\/+uploads\/+images\/+[^/]+)_[0-9]+_[0-9]+_int(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain_nosub === "nupics.pro" ||
			domain_nowww === "epicsoid.com" ||
			domain_nowww === "xwetpics.com" ||
			domain_nowww === "xsexpics.com" ||
			domain_nowww === "picsninja.club" ||
			domain_nowww === "hotnupics.com" ||
			domain_nowww === "ehotpics.com" ||
			domain_nowww === "picsegg.com" ||
			domain_nowww === "upicsz.com" ||
			domain_nowww === "xpicse.com" ||
			domain_nowww === "hdpicsx.com" ||
			domain_nowww === "picsninja.com" ||
			domain_nowww === "nuslut.com" ||
			domain_nowww === "repicsx.com") {
			return src.replace(/(\/pics\/+[0-9]+\/+)_([^/]*)$/, "$1$2");
		}
		if (domain_nowww === "pornstarapex.com") return src.replace(/(\/pics\/+[0-9a-f]+\/+)th_([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "cloud.it" &&
			domain.match(/^ldm[0-9]*\.r1-it\.storage\./)) {
			return src
				.replace(/(\/img\/.*\/)big\/([0-9]+_[0-9a-f]+\.[0-9]+\.[^/.]*)$/, "$1$2")
				.replace(/(\/(?:av|logo)\/.*\/)thumbs\/([0-9a-f]+\.[^/.]*)$/, "$1$2");
		}
		if (domain_nosub === "cfimg.com" &&
			domain.match(/^i[0-9]*\./)) {
			return src.replace(/(:\/\/[^/]*\/[0-9]+\/[0-9a-f]+)s(\.[^/.]*)$/, "$1$2");
		}
		if (domain === "i.chzbgr.com") {
			newsrc = src.replace(/(:\/\/[^/]*\/+)(?:thumb[0-9]*|full)\/+/, "$1original/");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/imagestore\/+[0-9]{4}\/+[0-9]+\/+[0-9]+\/+)th_/, "$1");
		}
		if (domain === "img.memecdn.com") {
			return add_full_extensions(src.replace(/(:\/\/[^/]*\/[^/]*_)[a-z]+(_[0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1o$2"));
		}
		if (domain === "p.memecdn.com") return src.replace(/\/avatars\/+[a-z]+_([0-9]+_[0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "/avatars/$1");
		if (domain_nosub === "123rf.com") {
			if (!src.match(/:\/\/[a-z]+cdn\./) &&
				src.match(/:\/\/[^/]*\/(?:images|[0-9]+wm)\//)) {
				var full = src.replace(/:\/\/[^/]*\/[^/]*\//, "://previews.123rf.com/images/");
				var small = src.replace(/:\/\/[^/]*\/[^/]*\//, "://us.123rf.com/450wm/");
				var urls = [
					{
						url: full,
						problems: {
							watermark: true
						}
					},
					{
						url: small,
						problems: {
							smaller: true
						}
					},
					src
				];
				var baseobj_6 = {};
				var match = src.match(/\/([0-9]+)-[^/]+\.[^/.]+(?:[?#].*)?$/);
				if (match) {
					id = match[1];
					baseobj_6.extra = {
						page: "https://www.123rf.com/photo_" + id + ".html"
					};
					if (options.do_request && options.cb) {
						api_query("123rf:" + id, {
							url: "https://www.123rf.com/photo_" + id + ".html",
						}, function(data) {
							if (data) {
								baseobj_6 = data;
							}
							return options.cb(fillobj_urls(urls, baseobj_6));
						}, function(done, resp, cache_key) {
							var match = resp.responseText.match(/dataLayer\.push\({[\s\S]+?["']product_name["']:\s*["'](.*?)["'],/);
							baseobj_6.extra.page = resp.finalUrl;
							if (match) {
								baseobj_6.extra.caption = match[1];
							} else {
								console_warn(cache_key, "Unable to find match in", resp);
							}
							done(baseobj_6, 24 * 60 * 60);
						});
						return {
							waiting: true
						};
					}
				}
				return fillobj_urls(urls, baseobj_6);
			}
		}
		if (domain_nowww === "chenderroad.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/image\.php.*?[?&]src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain_nosub === "estranky.cz" ||
			domain_nosub === "estranky.sk") {
			if (domain !== "s3a.estranky.sk") {
				return src
					.replace(/(:\/\/[^/]*\/img\/)[a-z]+\//, "$1original/")
					.replace(/(:\/\/[^/]*\/img\/original\/[0-9]+)(\.[^/.]*)/, "$1/image$2");
			}
		}
		if (domain_nowww === "stagelook.ru") return src.replace(/\/images\/tumbs\//, "/images/");
		if (domain === "media.taaze.tw") return src.replace(/\/showProdImageByPK\.html.*?[?&]pid=([0-9]+).*?$/, "/showTakeLook/$1.jpg");
		if (domain === "st.cdjapan.co.jp") return src.replace(/\/pictures\/s\//, "/pictures/l/");
		if (domain === "image.blozoo.info") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/v2\/thumb\/[0-9]+\/[0-9]+\/.*?[?&]url=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain === "img.suilengea.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/img\.php.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return add_http(decodeURIComponent(newsrc));
		}
		if (domain === "files.sirclocdn.xyz") return src.replace(/(\/products\/_[0-9]+_[^/._]*)(?:_[a-z]+)?(\.[^/.]*)$/, "$1_ori$2");
		if (domain === "s.tvp.pl") return src.replace(/(\/images2?\/(?:[0-9a-f]\/){3})[-_a-zA-Z0-9]*(uid_[0-9a-f]+)[^/.]*?(\.[^/.]*)$/, "$1$2_width_9999999999999$3");
		if (domain === "sf.be.com") return src.replace(/(\/photo\/[0-9]+\/[0-9a-z]+\/[^/]*-)[a-z][0-9]+(\.[^/.]*)$/, "$1img$2");
		if (domain_nowww === "fitwell.bg") return src.replace(/(\/pictures\/[0-9]+)_[0-9]+_*(\.[^/.]*)$/, "$1$2");
		if (domain === "bilder.bild.de") return src.replace(/\/fotos-skaliert(\/[^/]*\/)([0-9]+),[^/.]*(\.bild\.[^/.]*)$/, "/fotos$1Bild/$2$3");
		if (domain === "galeria.cdn.divany.hu") return src.replace(/(\/[0-9]+_[0-9a-f]+)_[a-z](\.[^/.]*)$/, "$1$2");
		if (domain === "img.cncenter.cz") return src.replace(/(\/img\/[0-9]+\/)[a-z]+(\/[^/]*)$/, "$1full$2");
		if (domain_nowww === "cosmopolitan.de") return src.replace(/\/bilder\/[0-9]+(?:x[0-9]+)?\//, "/assets/");
		if (domain === "d1o73ibskzeirn.cloudfront.net") return src.replace(/(:\/\/[^/]*\/)[0-9]+x[0-9]+\/content\//, "$10x0/content/");
		if (domain_nowww === "elle.co.za" ||
			domain_nowww === "xgn.nl" ||
			domain_nowww === "sandinyoureye.co.uk" ||
			domain_nowww === "skitguys.com" ||
			domain === "cache.wizardworld.com") {
			return src.replace(/\/+_[0-9AUTO]+x[0-9AUTO]+_(?:crop|fit)_[^/]+\/+/, "/");
		}
		if (domain === "assets-c3.propublica.org") return src.replace(/\/images\/+articles\/+_[^/]+\/+/, "/images/articles/");
		if (domain_nowww === "kartinnay-galerey.ru") return src.replace(/\/uploads\/posts\/news_thumb\//, "/uploads/posts/");
		if (domain_nowww === "imhomir.com") return src.replace(/(\/uploads\/[a-z]+\/preview\/.*)_[0-9]+(\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "mumsnet.com") return src.replace(/(\/uploads\/talk\/[0-9]+\/)[a-z]+-([0-9]+-[^/]*)$/, "$1$2");
		if (domain === "static.stylemagazin.hu") return src.replace(/(\/medias\/[0-9]+\/)[0-9]+x[0-9]+\//, "$1");
		if (domain === "img.thoibao.today") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/home\/fetch.*?[?&]u=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (amazon_container === "photo.elcinema.com" ||
			(domain_nosub === "elcinema.com" && /^media[0-9]*\./.test(domain))) {
			return src.replace(/\/uploads\/_[0-9]+x(?:[0-9]+)?_([0-9a-f]+\.[^/.]*)$/, "/uploads/$1");
		}
		if (domain_nowww === "colors.life") return src.replace(/(\/upload\/blogs\/[0-9a-f]{2}\/[0-9a-f]{2}\/[0-9a-f]+)_RSZ_[0-9]+(\.[^/.]*)$/, "$1$2");
		if (domain_nosub === "tnews.ir" && domain.match(/^i[0-9]*\./)) {
			return src.replace(/(\/[0-9]+\/[0-9]+\/[0-9]+\/)Thumbnail\//, "$1");
		}
		if (domain === "multimedia.mmc.com.do") return src.replace(/(\/multimedia\/[0-9]+\/[0-9]+\/[0-9]+\/[0-9a-f]+)_max.?_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1$2");
		if (domain === "img.europapress.es") return src.replace(/(\/fotoweb\/[a-z]+_(?:[0-9]+-)?[0-9]+)(?:_[0-9]+)?(\.[^/.]*)$/, "$1_9999$2");
		if (domain === "img.estadao.com.br") return src.replace(/\/thumbs\/[0-9]+\/resources\//, "/resources/");
		if (domain_nosub === "asianews.cc" &&
			domain.match(/^s[0-9]*\./)) {
			return src.replace(/(\/[0-9]+\/[0-9a-f]+)_[a-z]+(\.[^/.]*)$/, "$1_orgn$2");
		}
		if (domain_nosub === "wallpapermix.club" ||
			domain_nosub === "wallpaper-planet.com") {
			return src.replace(/(\/doc\/wallpaper\/img\/)[a-z]\//, "$1l/");
		}
		if (domain_nosub === "utaten.com" && string_indexof(src, "/uploads/images/") >= 0) {
			return src
				.replace(/\/thumbnail\/+[0-9]+x[0-9]+\/+/, "/")
				.replace(/_(?:[a-z]|[0-9]+x[0-9]+)(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "frostsnow.com") {
			return add_extensions_with_jpeg(src
				.replace(/\/x([^/.]*\.[^/.]*)\.pagespeed\.[^/]*$/, "/$1")
				.replace(/\/[0-9]+x[0-9]+\/([^/]*)$/, "/$1"));
		}
		if (domain_nowww === "mewch.net" ||
			domain_nowww === "kohlchan.net" ||
			domain_nowww === "anonib.al" ||
			domain === "lynx.farted.net" ||
			domain === "cdn.incel.shop" ||
			domain_nowww === "endchan.net" ||
			/:\/\/[^/]+\/+\.(?:media\/+t_[0-9a-f]{32,64}(?:-image[a-z]+)?|static\/+images\/+404-[0-9]+\.png)(?:[?#].*)?$/) {
			if (/\/\.static\/+images\/+404-/.test(src))
				return {
					url: src,
					bad: "true"
				};
			newsrc = src
				.replace(/\/\.media\/+t_([0-9a-f]+-imagejpeg)(?:[?#].*)?$/, "/.media/$1.jpg")
				.replace(/\/\.media\/+t_([0-9a-f]+-imagepng)(?:[?#].*)?$/, "/.media/$1.png");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/\.media\/+t_([0-9a-f]{20,})(?:[?#].*)?$/, "/.media/$1.jpg");
			if (newsrc !== src) {
				return add_full_extensions2(newsrc, { extensions: ["jpg", "png", "mp4", "gif"] });
			}
		}
		if (domain === "media.mehrnews.com") return src.replace(/\/old\/[^/]*\/([0-9]+\/)/, "/old/Original/$1");
		if (domain_nowww === "barking-moonbat.com") return src.replace(/(\/images\/uploads\/[^/]*)_thumb(\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "deseretnews.com") return src.replace(/\/images\/article\/[a-z]+res\//, "/images/article/hires/");
		if (domain_nowww === "orsm.net") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+v\/+(update[0-9]+\/+[^/]+\.[^/.?#]+)(?:[?#].*)?$/,
				query_for_id: "https://www.orsm.net/v/${id}",
				run: function(cb, match) {
					return cb({
						url: "https://grab.orsm.net/" + match[1],
						video: true
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "orsm.net") return src.replace(/(\/i\/galleries\/[^/]*\/)thumbnails\//, "$1");
		if (domain_nowww === "niklife.com.ua") return src.replace(/(:\/\/[^/]*\/)[0-9]+x[0-9]+[A-Z]?\/images\//, "$1images/");
		if (domain === "img.ef43.com.cn") return src.replace(/(\/newsImages\/[0-9]+\/[0-9]+\/[0-9]+)small(\.[^/.]*)$/, "$1$2");
		if (domain === "st.clopotel.t1.ro") return src.replace(/(\/_files\/datafiles\/.*\/)thumbs\/([0-9]+\.[^/.]*)$/, "$1$2");
		if (domain_nosub === "akamaized.net" &&
			domain.match(/^cdn[0-9]*-production-images-kly\./)) {
			return src.replace(/:\/\/[^/]*\/.*?\/kly-media-production\/([a-z]+\/[0-9]+\/)/, "://cdn-production-assets-kly.akamaized.net/$1");
		}
		if ((domain_nosub === "akamaized.net" && domain.match(/^cdn[0-9]*-production-assets-kly\./)) ||
			domain_nosub === "static6.com") {
			return src.replace(/(\/medias\/+[0-9]+\/+)[^/]*\/+/, "$1original/");
		}
		if (domain === "cdn.xn--cumpleaosdefamosos-t0b.com") return src.replace(/(\/gallery\/[0-9]+\/[0-9]+\/[^/]*\/[^/]*)_thumb(\.[^/.]*)$/, "$1$2");
		if (domain === "up.zhuoku.org" ||
			domain === "up.padtu.com" ||
			domain === "up.deskbus.com" ||
			domain === "up.bizhitupian.com" ||
			domain === "up.8desk.com") {
			return src.replace(/\/pic_[0-9]+\//, "/pic/");
		}
		if (domain_nowww === "apherald.com" && string_indexof(src, "/ImageStore/images/") >= 0) {
			return src.replace(/\/tn-([^/]*)$/, "/$1");
		}
		if (domain_nowww === "luxo.co.za") return src.replace(/\/system-files\/[a-z]+\//, "/system-files/");
		if (domain_nowww === "longroom.com") return src.replace(/\/uploads\/stock\/[a-z]+_([0-9]+\.[^/.]*)$/, "/uploads/stock/$1");
		if ((domain_nosub === "cennoticias.com" ||
			domain_nosub === "baca.co.id") &&
			domain.match(/^img\.cdn\./)) {
			return src.replace(/:\/\/img\.([^/]*)\/([-0-9a-f]+)(?:_thumbnail)?(?:[?#].*)?$/, "://raw.$1/$2");
		}
		if (domain === "cdn-tehran.wisgoon.com") return src.replace(/\/dlir-s3\/([0-9]+)?[0-9]{3}x[0-9]{3}_([0-9]+\.[^/.]*)$/, "/dlir-s3/$1$2");
		if (domain === "s.stylemode.com") return src.replace(/(\/uploads\/(?:(?:article|blog|album|recommend)(?:_desc|detail)?)\/)(?:[0-9]+x[0-9]+|deal)\//, "$1origin/");
		if (domain_nosub === "akairan.com" && domain.match(/^cdn[0-9]*\./) &&
			string_indexof(src, "/files/images/") >= 0) {
			return src.replace(/waterM(\.[^/.]*)$/, "$1");
		}
		if (domain === "cdn.idntimes.com" && string_indexof(src, "/content-images/") >= 0) {
			return src.replace(/_[0-9auto]+x[0-9auto]+(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "comicsblog.fr") return src.replace(/\/images\/galerie\/[a-z]+image\/(?:small_)?/, "/images/galerie/bigimage/");
		if (domain === "ent.sina.com.cn" ||
			domain === "auto.sina.com.cn") {
			return src.replace(/^[a-z]+:\/\/[^/]*\/([^/]*\.sinaimg\.cn\/)/, "http://$1");
		}
		if (domain_nowww === "analisadaily.com") return src.replace(/\/assets\/image\/news\/small\//, "/assets/image/news/big/");
		if (domain === "fi.realself.com") return src.replace(/(:\/\/[^/]*\/)[a-z]+(\/[0-9a-f]+\/)/, "$1full$2");
		if (domain_nosub === "babeimpact.com" && domain.match(/^content[0-9]*\./)) {
			return src.replace(/_tn(_[0-9]+\.[^/.]*)$/, "$1");
		}
		if (domain === "i.widelec.org") return src.replace(/_[a-z](\.[^/.]*)$/, "$1");
		if (domain === "image.kurier.at" ||
			domain === "image.film.at") {
			return src.replace(/\/images\/+[^/]*\/+([0-9]+\/)/, "/images/original/$1");
		}
		if (domain === "media.game8.vn") {
			newsrc = src.replace(/\.[0-9]+\.(?:[0-9]+\.)?cache(?:[?#].*)?$/, "");
			if (newsrc !== src)
				return newsrc;
			if (string_indexof(src, "/srv_thumb.ashx") >= 0) {
				var queries = get_queries(src);
				var ext = queries.w || "jpg";
				return urljoin("http://media.game8.vn/", queries.f, true) + "." + ext;
			}
		}
		if (domain_nosub === "xiongyan.tv" &&
			domain.match(/^img[0-9]*\./)) {
			return src.replace(/\/[a-z]+_([0-9a-f]+[0-9A-Za-z]+\.[^/.]*)$/, "/origin_$1");
		}
		if (domain_nowww === "coffelt.me") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/image.*?[?&]q=([^&]*)$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain === "kiev.segodnya.ua") return src.replace(/(\/img\/gallery\/[0-9]+\/[0-9]+\/[0-9]+)_[a-z]+(\.[^/.]*)$/, "$1_main$2");
		if (domain === "image.jjang0u.service.concdn.com" ||
			domain === "pic.doctorteen.com" ||
			domain === "pic.freeporn.hu" ||
			(domain_nowww === "hotxxxgirls.org" && /\/images\/+galleries\/+/.test(src)) ||
			domain === "content.brazz-girls.com" ||
			domain === "pic.fineartteens.com" ||
			(domain_nowww === "simplemetart.com" && /\/images\/+galleries\//.test(src)) ||
			(domain_nowww === "picsftv.com" && /\/images\/+galleries\//.test(src)) ||
			(domain_nowww === "metartdb.com" && string_indexof(src, "/images/galleries/") >= 0)) {
			newsrc = src.replace(/\/t_([0-9]+\.[^/.]*)$/, "/$1");
			if (newsrc !== src) {
				return newsrc;
			}
		}
		if (domain === "image.jjang0u.service.concdn.com") {
			return {
				url: src,
				headers: {
					Referer: "http://fun.jjang0u.com/"
				}
			};
		}
		if (domain_nowww === "fotoshoots.be") return src.replace(/(\/images\/fotografen\/[0-9]+\/)thumbs\//, "$1");
		if (domain_nosub === "tapatalk.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/groups\/[^/]*\/imageproxy\.php.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain === "dl.backbook.me") return src.replace(/(:\/\/[^/]*\/)[a-z_]+(\/[0-9a-f]+\.[^/.]*)$/, "$1full$2");
		if (domain_nosub === "backbook.me" && /^[a-z]\./.test(domain)) {
			return src
				.replace(/(\/file\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]{2}\/+)[a-z_]+_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1full_$2");
		}
		if (domain === "nthumb.cyworld.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/thumb.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain === "e.porosenka.net") return src.replace(/(\/uploads\/[0-9a-f]\/[0-9a-f]+\/[0-9a-f]+)_[a-z]+(\.[^/.]*)$/, "$1$2");
		if ((domain_nosub === "qhimg.com" ||
			domain_nosub === "qhmsg.com") &&
			domain.match(/^p[0-9]*\./)) {
			return src.replace(/(:\/\/[^/]*\/+)[a-z]+\/+[0-9]+_[0-9]+_\/+/, "$1");
		}
		if (domain_nosub === "gamersky.com" && domain.match(/^img[0-9]*\./)) {
			return {
				url: src
					.replace(/(\/upimg\/pic\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/[0-9]+)_[a-z]+(\.[^/.]*)$/, "$1$2")
					.replace(/(\/upimg\/users\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/)[a-z]+_([^/]*)$/, "$1origin_$2")
					.replace(/(\/image[0-9]{4}\/+[0-9]{2}\/+[0-9]{8}_[a-z]{2}_[0-9]+_[0-9]+\/+[^/_.]*)_[A-Z](\.[^/.]*)(?:[?#].*)?$/, "$1$2"),
				headers: {
					Referer: ""
				},
				referer_ok: {
					same_domain_nosub: true
				}
			};
		}
		if (domain_nosub === "game234.com" && domain.match(/^webimg[0-9]*\./) ||
			domain_nowww === "reho.st") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+((?:[a-z]+:\/\/)?[^/]+\.[^/.]+\/+)/, "$1");
			if (newsrc !== src)
				return add_http(newsrc);
		}
		if (domain === "img.izismile.com" ||
			domain_nowww === "izismile.com") {
			return src
				.replace(/(\/img[0-9]*\/+[0-9]{8}\/+)640\/+([^/]*_)640_(?:high_)?([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$11000/$2$3")
				.replace(/(\/img[0-9]*\/+[0-9]{8}\/+[^/]*)_l(_[0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "cdn.snsimg.carview.co.jp") return src.replace(/(\/blog\/(?:[0-9]+\/){5}[^/]*)[sm](\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "wallpapersontheweb.net") {
			regex = /\/wallpapers\/[a-z]\/(?:(?:[0-9]+x[0-9]+)?\/)?(?:(?:[a-z]|[0-9]+x[0-9]+)-)?([^/]*)-([0-9]+)(\.[^/.]*)$/;
			return {
				url: src.replace(regex, "/wallpapers/l/$1-$2$3"),
				headers: {
					Referer: src.replace(regex, "/$2-$1/")
				}
			};
		}
		if (domain_nosub === "funon.cc" && domain.match(/^s[0-9]*\./)) {
			return src.replace(/(\/img\/)[a-z]+(\/[0-9]+\/)/, "$1orig$2");
		}
		if (domain === "img.joemonster.org") return src.replace(/(\/upload\/[^/]*\/)[a-z]_([0-9a-f]+[0-9a-z]+\.[^/.]*)$/, "$1$2");
		if (domain === "mobimg.b-cdn.net") return src.replace(/\/pic\/v2\/gallery\/[^/]*\//, "/pic/v2/gallery/real/");
		if (domain === "img.wanduorou.com") return src.replace(/^[a-z]+:\/\/[^/]*\/imgs\/([^/.]*\.[^/]*\/)/, "http://$1");
		if (domain === "i.gbc.tw") return src.replace(/(\/gb_img\/[0-9]+)[a-z](\.[^/.]*)$/, "$1$2");
		if ((domain_nosub === "xuehuaimg.com" && domain.match(/^pic[0-9]*\./)) ||
			(domain_nosub === "11street.my" && domain.match(/^cdn[0-9]*\./))) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/proxy\/+(?:[a-z]+\/+)?([a-z]+:\/\/)/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "img.tgchengzi.com") return src.replace(/(\/Uploads\/ueditor\/php\/upload\/image\/[0-9]+\/[0-9]+)_[a-z](\.[^/.]*)$/, "$1$2");
		if (domain_nosub === "doyo.cn" &&
			domain.match(/^s[0-9]*\./)) {
			return src.replace(/(\/img\/(?:[0-9a-f]{2}\/){2}[0-9a-f]+\.[^/._]*)_[a-z]+(?:[?#].*)?$/, "$1");
		}
		if (domain === "newsimg.hankookilbo.com" ||
			domain === "image.hankookilbo.com" ||
			domain === "betaimage.hankookilbo.com") {
			var extra = {};
			match = src.match(/^[a-z]+:\/\/[^/]*\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}([0-9]{8,})_[0-9]+(?:_[a-z])?\.[^/.]*(?:[?#].*)?$/);
			if (match) {
				extra.page = "http://star.hankookilbo.com/News/Read/" + match[1];
			}
			return {
				url: src.replace(/(\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/(?:[0-9]+_[0-9]+|[-0-9a-f]+))_[a-z](\.[^/.]*)$/, "$1$2"),
				extra: extra
			};
		}
		if (domain === "dispatch.cdnser.be") return src.replace(/(\/[0-9]+[^-/_.]*_)T[0-9]*(_[0-9]+\.[^/.]*)$/, "$1T5$2");
		if (domain === "cms.artandarchaeology.princeton.edu") return src.replace(/\/media\/thumbnails\/([^/?]*)\?.*$/, "/media/files/$1");
		if (domain_nowww === "pronto.com.ar" ||
			domain_nowww === "atalayar.com") {
			return src.replace(/\/asset\/+thumbnail[,%][^/]*\/+media\//, "/media/");
		}
		if (domain === "cdn.thebest.gr") return src.replace(/\/media\/images\/[^/]*\//, "/media/images/original/");
		if (domain_nowww === "glow.gr" ||
			domain === "omegalive-sf.cdn.edgeport.net" ||
			domain_nowww === "omegalive.com.cy") {
			return src.replace(/(:\/\/[^/]*\/)(?:image|[a-z]+-img)\/+[^/]+(\/+[0-9]+\/+[^/]*\.[^/.?#]*)(?:[?#].*)?$/, "$1image/original$2");
		}
		if (domain_nowww === "scifi-forum.de" ||
			domain_nowww === "phica.net") {
			return src.replace(/\/filedata\/fetch.*?[?&](id=[0-9]+).*?$/, "/filedata/fetch?$1");
		}
		if (domain === "cache.net-a-porter.com") return src.replace(/^[a-z]+:\/\/[^/]*\/content\/images\/(story-[^/]*\.[^/.]*)\/[^/]*$/, "https://assets.ynap-content.com/$1");
		if (domain_nowww === "celluloidportraits.com" && string_indexof(src, "/img/") >= 0) {
			return src.replace(/(_[0-9]+_)[A-Z](\.[^/.]*)$/, "$1L$2");
		}
		if (domain_nowww === "nowtoronto.com") return src.replace(/(\/downloads\/[0-9]+\/download\/[^/?#]*)(?:.*?[?&](cb=[0-9a-f]+).*?)?$/, "$1?$2");
		if (domain === "cde.peru.com") return src.replace(/(\/ima\/(?:[0-9]\/){5}(?:[0-9]+\/)?)(?:[0-9]+x[0-9]+|thumb)\/([^/]*)$/, "$1$2");
		if (domain === "cd.cinescape.com.pe") {
			match = src.match(/^[a-z]+:\/\/[^/]*\/cinescape-[0-9]+x[0-9]+-([0-9]+)(\.[^/.]*)(?:[?#].*)?$/);
			if (match) {
				var digits = match[1].replace(/[0-9]{3}$/, "");
				var length = digits.length;
				for (i = length; i < 5; i++) {
					digits = "0" + digits;
				}
				return "http://e.cinescape.americadigital.pe/ima/"
					+ digits[0] + "/" + digits[1] + "/" + digits[2] + "/" + digits[3] + "/" + digits[4] + "/" + match[1] + match[2];
			}
		}
		if (domain_nowww === "celebritytalent.net") return src.replace(/\/photos\/[a-z]+\/([0-9]+\.[^/.]*)$/, "/photos/lg/$1");
		if (domain === "img-ovh-cloud.zszywka.pl") return src.replace(/\/thb_([0-9]+\.[^/.]*)$/, "/$1");
		if (domain_nosub === "clickthecity.com" && domain.match(/^cdn[0-9]*\./)) {
			return src.replace(/\/profiles\/[0-9]+(\/[0-9]+(?:_[0-9]+)?\.[^/.]*)$/, "/profiles$1");
		}
		if (domain_nowww === "lafactoriadelshow.com") return src.replace(/\/[a-z]+_([0-9a-f]+_[0-9]+\.[^/.]*)$/, "/full_$1");
		if (domain_nowww === "elintra.com.ar" ||
			domain_nowww === "diariorepublica.com.ar" ||
			domain_nosub === "minutoneuquen.com" ||
			domain_nowww === "abcdiario.com.ar" ||
			domain_nowww === "gamesbras.com" ||
			domain_nowww === "paginasiete.bo" ||
			domain_nowww === "diariolaprovinciasj.com" ||
			domain_nowww === "elintransigente.com" ||
			/^[a-z]+:\/\/[^/]+\/+u\/+fotografias\/+m\/[0-9]{4}\/+[0-9]{1,2}\/+[0-9]{1,2}\/+f[0-9]+x[0-9]+-[0-9]+_/.test(src)) {
			return src.replace(/\/fotografias\/m\/([0-9]{4}\/[0-9]+\/[0-9]+\/)f[0-9]+x[0-9]+-([0-9]+)_[0-9]+[^/]*(\.[^/.]*)$/, "/fotografias/fotosnoticias/$1$2$3");
		}
		if (domain === "f.aukro.cz" ||
			domain === "cdn.aukro.cz") {
			return src.replace(/(\/images\/+sk[0-9]+\/+)[0-9]+x[0-9]+\/+/, "$1");
		}
		if (domain_nowww === "wallpapershome.com" ||
			domain_nowww === "wallpapershome.ru") {
			return src.replace(/(\/images\/+pages\/+)ico_([hv]\/)/, "$1pic_$2");
		}
		if (domain === "envivoblog.estrellatv.com" ||
			domain_nowww === "gamegrin.com" ||
			domain === "cdn.okjeok.hr") {
			return src.replace(/\/_resampled\/(?:Set(?:Width|Height)|resizedimage)[0-9]+-([^/]*)$/, "/$1");
		}
		if (domain_nowww === "haltadefinizione.com") return src.replace(/\/_resampled\/+Scale(?:Width|Height)[^/]+\/+/, "/");
		if (domain === "images.sex.com") {
			match = src.match(/(\/images\/pinporn\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/)[0-9]+(?:x[0-9]+)?\/([0-9]+\.[^/.?#]+)(?:[?#],*)?$/);
			if (match) {
				return "https://cdn.sex.com" + match[1] + match[2];
			}
			return {
				url: src.replace(/(\/images\/pinporn\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/)(?:300|460|126x126)\//, "$1620/"),
				headers: {
					Referer: "https://www.sex.com/" // no referer doesn't work
				},
				referer_ok: {
					same_domain_nosub: true
				}
			};
		}
		if (domain === "cdn.sex.com") {
			return {
				url: src.replace(/\?.*/, ""),
				headers: {
					Referer: "https://www.sex.com/" // no referer doesn't work
				}
			};
		}
		if (domain === "fotografias.antena3.com" ||
			domain === "image.europafm.com" ||
			src.match(/^[a-z]+:\/\/[^/]*\/clipping\/cmsimages[0-9]*\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/[-0-9A-F]+\/[^/]*\.[^/.]*$/)) {
			newsrc = src.replace(/(\/clipping\/cmsimages[0-9]*\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/[-0-9A-F]+\/)[^/]*(\.[^/.]*)$/, "$1default$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "nickiswift.com" && domain.match(/^img[0-9]*\./)) {
			return src.replace(/-[0-9]+x[0-9]+(?:_rev[0-9]*)?(\.[^/.]*)$/, "$1");
		}
		if (amazon_container === "sphm-female-site-production") {
			return src.replace(/-[0-9]+px(\.[^/.]*)$/, "$1");
		}
		if (domain_nowww === "maxpapendieck.com") return src.replace(/(\/app\/webroot\/upload\/[0-9]+\/[^/]*)-(?:large|medium|thumb)(\.[^/.]*)$/, "$1$2");
		if (domain === "i.mdel.net") {
			if (/\/i\/+db\/+(?:play-[0-9]+|transBack)\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src.replace(/(\/i\/db\/[0-9]+\/[0-9]+\/[0-9]+\/[0-9]+)-[0-9]+[a-z]n?(\.[^/.]*)$/, "$1-orig$2");
		}
		if (domain === "cdn-img.fimfiction.net") {
			return src
				.replace(/(\/story\/[^-/]*-[0-9]+-[0-9]+-)[a-z]+([?#].*)?$/, "$1full$2")
				.replace(/(\/user\/[^-/]*-[0-9]+-[0-9]+-)[0-9]+([?#].*)?$/, "$1512$2");
		}
		if (domain_nosub === "tv-happening.com" && domain.match(/^img(?:-[a-z]+)?[0-9]*\./)) {
			return src.replace(/\/[a-z]\/([0-9]+\.[^/.]*)$/, "/b/$1");
		}
		if (domain_nowww === "kbbs.jp" ||
			domain_nowww === "ibbs.info") {
			return src.replace(/\/fitimg\/cache\/([^/]*)\/[0-9]+\/[^/_.]*_([^/]*)(?:[?#].*)?$/, "/data/$1/img/$2");
		}
		if (domain_nowww === "pzy.be") return src.replace(/(:\/\/[^/]*\/)t(\/[0-9]+\/[^/]*)$/, "$1i$2");
		if ((domain_nosub === "blick.ch" && domain.match(/^f[0-9]*\./)) ||
			domain === "static.pulse.ng" ||
			domain === "static.pulselive.co.ke" ||
			(domain_nosub === "focus.de" && domain.match(/^p[0-9]*\./)) ||
			domain === "static.pulse.com.gh") {
			return src.replace(/\/img\/[a-z]+\/(?:origs|crop)([0-9]*)\/[0-9]+(?:-[^/]*)?\/([^/?#]*\.[^/.?#]*)(?:[?#].*)?$/, "/media/$1/$2");
		}
		if (domain === "img.blick.ch") return src.replace(/\?.*/, "?ratio=FREE&x=0&y=0");
		if (domain_nowww === "mixnews.lv") return src.replace(/(\/uploads\/media\/image\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/[^/]*)_medium\.png(?:[?#].*)?$/, "$1.jpg");
		if (domain_nosub === "promiflash.de" &&
			domain.match(/^content[0-9]*\./)) {
			return src.replace(/\/article-images\/+gallery1024\//, "/article-images/gallery2048/");
		}
		if (domain_nowww === "mycharm.ru") return src.replace(/(\/data\/cache\/[0-9]{4}[a-z]+\/.*)thumb[0-9]+(\.[^/.]*)$/, "$1$2");
		if (domain === "images.worthpoint.com") return src.replace(/(\/files\/[^/]*\/)tn\//, "$1");
		if (domain_nowww === "benishop.co" ||
			domain === "cdn.benishop.co" ||
			domain_nowww === "awanshop.co") {
			return src.replace(/^[a-z]+:\/\/[^/]*\/imgcdn\/[0-9]+\/([a-z]+)\/(.*)_\.[^/.]*$/, "$1://$2");
		}
		if (domain === "img.auctiva.com") return src.replace(/(\/[0-9]+_)[a-z]+(\.[^/.]*)$/, "$1o$2");
		if (domain === "img.networthpost.com") return src.replace(/\/thumbs\/([0-9]+_)/, "/images/$1");
		if (domain === "img.static.butygirls.com") return src.replace(/\/resize\/[0-9]+\/[0-9]+\/[0-9]+(\/[0-9a-f]+\.[^/.]*)$/, "$1");
		if (domain_nowww === "wallpapersmug.com" ||
			domain_nowww === "picstatio.com") {
			return src.replace(/\/(?:download\/+[0-9]+x[0-9]+|(?:thumb|large))\/+([-0-9a-z]+\/+[^/]*)(?:[?#].*)?$/, "/u/$1");
		}
		if (domain === "cp12.nevsepic.com.ua") return src.replace(/(\/[0-9]+\/)thumbs\/([0-9]+-[0-9]+-[^/]*)$/, "$1$2");
		if (domain === "itn.dmarge.com") return src.replace(/:\/\/[^/]*\/[0-9]+x[0-9]+\//, "://i.dmarge.com/");
		if (domain_nosub === "idnes.cz" && domain.match(/^img[0-9]*\./)) {
			return src.replace(/\/thumb\//, "/images/");
		}
		if (domain_nowww === "funsubstance.com") return src.replace(/\/uploads\/[a-z]+\//, "/uploads/original/");
		if (domain === "global.unitednations.entermediadb.net") {
			return src
				.replace(/(\/downloads\/+preset\/+[^/]+\/+[^/]+\/+[^/]+\.[a-zA-Z]{3,4}\/+)image[0-9]+x[0-9]+(?:cropped)?(\.[^/.]*)$/, "$1image3000x3000$2")
				.replace(/(\/downloads\/+preset\/+assets\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]+\/+)image[0-9]+x[0-9]+(?:cropped)?(\.[^/.]*)$/, "$1image$2");
		}
		if (domain === "rimg.bookwalker.jp") return src.replace(/:\/\/[^/]+\/+([0-9a-f]{30,}\/+)(?:BM2j7K0aiKyzud2kfkni6g__|eUnObgIVNjRTJtVUNQrbaQ__|OWWPXNVne2Og5o9nA6tp3Q__|WYSt3oZAsOZeWLNOG6XDcw__)\./, "://c.bookwalker.jp/$1t_700x780.");
		if (domain === "c.bookwalker.jp") {
			match = src.match(/:\/\/[^/]*\/([0-9]+)\/[^/]*(?:[?#].*)?$/);
			if (match) {
				var number = match[1];
				var reversed_number = parseInt(reverse_str(number)) - 1;
				return "https://c.bookwalker.jp/coverImage_" + reversed_number + src.replace(/.*(\.[^/.?#]*)(?:[?#].*)?$/, "$1");
			}
		}
		if (domain === "taiwan-image.bookwalker.com.tw") return src.replace(/(\/product\/+[0-9]+\/+[0-9]+)_[0-9]+(?:_mask)?\./, "$1.");
		if (domain === "images.cdn.circlesix.co") return src.replace(/\/image\/(?:[0-9]+\/){3}uploads\//, "/image/uploads/");
		if (domain === "static.japanhdv.com") return src.replace(/(:\/\/[^/]*\/)cache\/(.*)\.[0-9]+x[0-9]+(\.[^/.]*)$/, "$1$2$3");
		if (domain === "image.gala.de") {
			return src
				.replace(/(:\/\/[^/]*\/v[0-9]*\/cms\/[^/]*\/[^/]*_[0-9]+-)[a-z]+[-_][^/]*(\.[^/.]*)$/, "$1original-lightbox$2")
				.replace(/:\/\/[^/]*\/+([0-9]+)\/+(?:[a-z]+)?(?:uncropped|[0-9]+x[0-9]+)-[0-9]+-[0-9]+\/([0-9a-f]{20,})\/+[^/]*\/+([^/]*)(\.[^/.]*)(?:[?#].*)?$/, "://www.gala.de/resource/blob/$1/$2/$3-data$4")
				.replace(/:\/\/[^/]+\/+([0-9]+)\/+.*?\/+([0-9a-f]{10,}|-)\/+([^/.?#]+)(\.[^/]+)(?:[?#].*)?$/, "://www.gala.de/resource/blob/$1/$2/$3-data$4");
		}
		if (domain_nosub === "fashionwelike.com" &&
			domain.match(/^static[0-9]*\./)) {
			return src.replace(/\/photos\/thumbnail\//, "/photos/original/");
		}
		if (domain === "images.metmuseum.org") return src.replace(/(\/CRDImages\/+[^/]*\/+)[^/]*\/+/, "$1original/");
		if (domain === "images-assets.nasa.gov") return src.replace(/~[a-z]+(\.[^/.]*)$/, "~orig$1");
		if (domain_nowww === "jpl.nasa.gov") return src.replace(/:\/\/[^/]+\/+spaceimages\/+images\/+[^/]+\/+(PIA[0-9]+)(?:_[^/]+|-[0-9]+(?:x[0-9]+|[wh]))(\.(?:jpg|jpeg|JPG|JPEG))(?:[?#].*)?$/, "://photojournal.jpl.nasa.gov/jpeg/$1$2");
		if (domain === "imagecache.jpl.nasa.gov") {
			match = src.match(/:\/\/[^/]+\/+images\/+[0-9]+x[0-9]+\/+(?:pia|PIA)([0-9]+)-[0-9]+-[0-9]+x[0-9]+\./);
			if (match) {
				return "https://photojournal.jpl.nasa.gov/jpeg/PIA" + match[1] + ".jpg";
			}
		}
		if (domain === "solarsystem.nasa.gov") return src.replace(/:\/\/[^/]+\/+system\/+(?:resources|news_items)\/+(?:detail_files|(?:list|main)_images)\/+[0-9]+_(?:pia|PIA)([0-9]+)(?:_[a-z]+)?(?:\.[^/.]+_[^/]+|[-_][^/]+)?\.[^/.]+(?:[?#].*)?$/, "://photojournal.jpl.nasa.gov/jpeg/PIA$1.jpg");
		if (domain === "photojournal.jpl.nasa.gov") {
			obj = { url: src };
			id = src.replace(/.*\/(PIA[0-9]+)(?:_[^/]+)?\.[^/.]+(?:[?#].*)?$/, "$1");
			if (id !== src) {
				obj.extra = {
					page: "https://www.jpl.nasa.gov/spaceimages/details.php?id=" + id
				};
			}
			newsrc = src.replace(/(:\/\/[^/]+\/+)jpegMod\/+([^/]+)_modest\./, "$1jpeg/$2.");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			newsrc = src.replace(/(:\/\/[^/]+\/+)(?:browse|thumb)\/+/, "$1jpeg/");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			return obj;
		}
		if (domain === "nssdc.gsfc.nasa.gov") {
			obj = { url: src };
			id = src.match(/\/imgcat\/+[^/]+res\/+(vg[0-9]*_p[0-9]+)\./);
			if (id) {
				obj.extra = { page: "https://nssdc.gsfc.nasa.gov/imgcat/html/object_page/" + id[1] + ".html" };
			}
			newsrc = src.replace(/(\/imgcat\/+)midres\/+/, "$1hires/");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			return obj;
		}
		if (amazon_container === "attachments.readmedia.com") {
			return src.replace(/(\/+files\/+[0-9]+\/+)[a-z]+\/+([^/]*)(?:[?#].*)?$/, "$1original/$2");
		}
		if (domain === "files.sexyandfunny.com") return src.replace(/\/(?:img|gallery)_[a-z]+\//, "/img_orig/");
		if (domain === "mb.cision.com") return src.replace(/(\/Public\/+[0-9]+\/+[0-9]+\/+[0-9a-f]+)_[^/_]*(\.[^/.]*)$/, "$1_org$2");
		if (domain_nowww === "ftvmagic.com") {
			return src
				.replace(/(\/+grand-media\/+image\/+)thumb\//, "$1")
				.replace(/-[0-9]+x[0-9]+(\.[^/.]*)$/, "$1")
				.replace(/(\/post_pics\/+[0-9]+\/+[0-9]+\/+[0-9]+)_thumb(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "wdb.space" ||
			domain_nowww === "onlythere.com") {
			return src.replace(/(\/media\/[^/]*\/[^/]*)_scale_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "iphone8wallpapers.com" && string_indexof(src, "/media/uploads/") >= 0) {
			return {
				url: src.replace(/-[0-9]+x[0-9]+(\.[^/.]*)$/, "$1"),
				headers: {
					Referer: src.replace(/(:\/\/[^/]*\/).*/, "$1") // works without, but adds a "click here full resolution, no hotlinking" watermark
				}
			};
		}
		if (domain === "upload.sanqin.com" ||
			domain === "upload.mnw.cn") {
			return src.replace(/\/thumb_[0-9]+__([^/]*)(?:[?#]*.*)?$/, "/$1");
		}
		if (domain_nosub === "best-wallpaper.net") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([^/?#]+)_wallpapers\.html(?:[?#].*)?$/,
				query_for_id: "https://best-wallpaper.net/${id}_wallpapers.html",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<img ID="viewImg"[^>]*data-src="([^">]*)"/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					done(urljoin(src, match[1], true), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "best-wallpaper.net") {
			match = src.match(/\/wallpaper\/+[^/]+\/[0-9]+\/([^/]*)_[^-_/.]+\.[^/.]*$/);
			if (match) {
				return {
					url: "https://best-wallpaper.net/" + match[1] + "_wallpapers.html",
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "trueart.com" &&
			domain.match(/^s[0-9]*\./)) {
			return src.replace(/(\/[0-9]+)_[0-9]+(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "atkfan.com") return src.replace(/\/thumbs(\/[^/]*)_[0-9]+(\.[^/.]*)$/, "/set$1$2");
		if (domain === "imbbsfile.imbc.com") return src.replace(/\/thnb_([^/]*\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "hdwall.us") {
			return {
				url: src.replace(/(:\/\/[^/]*\/+)(?:wallpaper|thumbnail)[^/]*\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1wallpaper/$2"),
				problems: {
					watermark: true
				}
			};
		}
		if (domain === "thmbs.baklol.com") return src.replace(/:\/\/thmbs\./, "://images.");
		if (domain_nowww === "svtstatic.se") {
			return {
				url: src.replace(/\/image\/+[^/]*\/+[^/]*\/+([0-9]+\/+[0-9]+)(?:\.[^/?#]*)?(?:[?#].*)?$/, "/image/original/unscaled/$1.png"),
				head_wrong_contentlength: true
			};
		}
		if (domain === "thmb.inkfrog.com" ||
			amazon_container === "thmb.inkfrog.com") {
			return src
				.replace(/^[a-z]+:\/\/.*\/+thumb[^/]*\/+([^/]*\/+[^/]*\.[^/.=]*)(?:=[0-9]+)?(?:[?#].*)?$/, "https://imgs.inkfrog.com/pix/$1")
				.replace(/^[a-z]+:\/\/.*\/+pix\/+([^/]*\/+[^/]*\.[^/.]*)\/+[0-9]+\/+[0-9]+(?:[?#].*)?$/, "https://imgs.inkfrog.com/pix/$1");
		}
		if (domain_nosub === "xnostars.com" &&
			domain.match(/^img[0-9]*\./)) {
			return src.replace(/(\/fotos\/+[^/]*)\/+thumbs\/+/, "$1/");
		}
		if (domain_nowww === "mobilmusic.ru") return src.replace(/(\/mfile\/+[0-9a-f]{2}\/+[0-9a-f]{2}\/+[0-9a-f]{2}\/+[0-9]+)-[0-9]+(\.[^/.]*)$/, "$1$2");
		if (domain === "pics.definebabe.com") return src.replace(/\/thumbs\/+thumb_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nosub === "definebabe.com" &&
			domain.match(/^cdn-i[0-9]+\./)) {
			return src.replace(/(\/+[0-9a-f]+\/+)[a-z]?[0-9]+\/+((?:[^/]*-)?[0-9]+\.[^/.]*)$/, "$1$2");
		}
		if (amazon_container === "everipedia-storage") {
			return add_extensions_upper(src.replace(/(\/NewlinkFiles\/+[0-9]+\/+(?:[^/]*\/+)?[^/]+)_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2"));
		}
		if (domain_nowww === "w-dog.pw" ||
			domain_nowww === "w-dog.net") {
			if (/:\/\/[^/]+\/+img\/+[0-9]+x[0-9]+.[^/.]+(?:[?#].*)?$/.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src.replace(/(\/(?:android-)?wallpapers\/+[0-9]+\/+[0-9]+)\/+[a-z]+(\/[0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nosub === "wsimg.com" && /^i(?:mg[0-9]*|steam)\./.test(domain)) {
			return src.replace(/(\/+ip\/+[-0-9a-f]+\/+(?:ols\/+)?[^/]*|\/isteam\/+stock\/+[a-zA-Z0-9]+)(?:\/+:\/+.*)?(?:[?#].*)?$/, "$1");
		}
		if (domain === "img.lovpho.com") return src.replace(/\/+anh\/+(?:width|height)[0-9]+\//, "/anh/");
		if (domain_nowww === "divnil.com") return src.replace(/(\/wallpaper\/.*_[0-9a-f]+_)[a-z]+(\.[^/.]*)$/, "$1raw$2");
		if (domain === "images.dbnaked.com") return src.replace(/\/thumb_(?:[0-9]+x[0-9]+_)?([0-9]+\.[^/.]*)$/, "/$1");
		if (domain === "img.iseephoto.com") return src.replace(/(\/+files\/+[^/]*\/+)thumes\/+/, "$1");
		if (domain === "media.elle.gr") return src.replace(/.*\/engine\/[^/]*?_([0-9]+)_([0-9]+)(?:_type[0-9]+)?\.[^/.]*(?:[?#].*)?$/, "http://engine.numatek.netuse.gr/?imgid=$2&srcid=$1&type=2");
		if (domain === "engine.numatek.netuse.gr") {
			var queries = get_queries(src);
			if (queries.imgid && queries.srcid) {
				return "http://engine.numatek.netuse.gr/?imgid=" + queries.imgid + "&srcid=" + queries.srcid + "&type=2";
			}
		}
		if (domain === "actualite.benchmark.fr") return src.replace(/_diaporama_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain_nowww === "showstudio.com") return src.replace(/(\/+img\/+images\/+[0-9]+-[0-9]+\/+[0-9]+)_[^/]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "static.trendme.net") {
			newsrc = src.replace(/\/showThumb\.php.*?[?&]src=([^&]*).*?$/, "/showThumb.php?src=$1&h=99999999&height=99999999&zc=3");
			if (newsrc !== src)
				return newsrc;
			return src
				.replace(/\/+temp\/+thumbs\/+[0-9]+-[0-9]+-[0-9]+-[0-9]+\/+/, "/pictures/items/")
				.replace(/\/showThumb\.php.*?[?&]src=([^&]*).*?$/, "/pictures/items/$1");
		}
		if (domain_nowww === "ifairer.com") return src.replace(/\/+article_image\/+[a-z]+[0-9]+\/+/, "/article_image/");
		if (amazon_container === "khaskhabar") {
			return src.replace(/\/+khaskhabarimages\/+[a-z]+img\/+img[0-9]+\/+/, "/khaskhabarimages/img500/");
		}
		if (domain === "i.infospesial.net") return src.replace(/:\/\/[^/]*\/+[0-9]+x(?:[0-9]+)?\/+p\/+/, "://media.infospesial.net/image/p/");
		if (domain === "nik.bot.nu") return src.replace(/(:\/\/[^/]*\/+)[a-z]([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1o$2");
		if (domain_nosub === "eyeem.com" &&
			domain.match(/^cdn[0-9]*\./)) {
			return {
				url: src.replace(/(\/+thumb\/+[0-9a-f]+-[0-9]+\/+).*$/, "$1full"),
				problems: {
					watermark: true
				}
			};
		}
		if (domain === "3c1703fe8d.site.internapcdn.net" ||
			domain_nowww === "phys.org") {
			newsrc = src.replace(/\/newman\/+csz\/+([^/]*)\/+[^/]*\/+([0-9]{4}\/+[^/]*)(?:[?#].*)?$/, "/newman/gfx/$1/$2");
			if (newsrc !== src)
				return newsrc;
			return newsrc.replace(/\/+newman\/+gfx\/+([^/]*)\/+([0-9]{4}\/+[^/]*)(?:[?#].*)?$/, "/newman/gfx/$1/hires/$2");
		}
		if (domain_nowww === "sott.net") return src.replace(/(\/+image\/+s[0-9]+\/+[0-9]+\/+)[a-z]+\//, "$1full/");
		if (domain_nowww === "fimgs.net") return src.replace(/\/(?:images|mdimg)\/+([^/]*)\/+[^/.]*\.([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/images/$1/o.$2");
		if ((domain_nosub === "ndsstatic.com" ||
			domain_nosub === "ohmymag.com" ||
			domain_nosub === "gentside.co.uk") &&
			domain.match(/^img[0-9]*\./)) {
			return src.replace(/(:\/\/[^/]*\/+)article\/+[0-9]+\/+/, "$1article/");
		}
		if (domain_nowww === "stickpng.com") return src.replace(/\/+assets\/+[a-z]+\/+([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "/assets/images/$1");
		if (domain === "media.bizj.us") return src.replace(/(\/view\/img\/[0-9]+\/[^/*]*)(?:\*|%2A)[^/.]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "assets.becomegorgeous.com") return src.replace(/:\/\/[^/]*\/+assets\/+(static\.becomegorgeous\.com\/)/, "://$1");
		if (domain === "static.becomegorgeous.com") return src.replace(/\/+gallery\/+thumbs\/+thumb_/, "/gallery/pictures/");
		if (domain_nowww === "styleslum.com") return src.replace(/\/+main_image_thumbs\/+([^/]*\.[^/.]*)\.thumb_[^/.]*\.[^/.]*(?:[?#].*)?$/, "/main_image/$1");
		if (domain_nowww === "sideshowtoy.com") return src.replace(/(\/+assets\/+products\/+[0-9]+-[^/]*\/+)[a-z]+\/+/, "$1lg/");
		if (domain_nowww === "suwalls.com") {
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+([^/]+\/+[^/]+)\/*(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+([0-9]+)(?:[?#].*)?$/
				],
				query_for_id: "https://suwalls.com/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<a[^>]* href="(https?:\/\/cdn\.suwalls\.com\/+wallpapers\/+[^">]*)"[^>]*>\s*<img/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done(match[1], 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "cdn.suwalls.com") {
			if (/\/_media\/+styles\/+default[0-9]*\/+images\/+star[0-9]*\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			newsrc = src.replace(/\/+_media\/+users_[0-9]+x[0-9]+\/+/, "/_media/users/");
			if (false && newsrc !== src)
				return newsrc;
			match = src.match(/.*\/+wallpapers\/+[^/]+\/+[^/]*-([0-9]+)-[0-9]+x[0-9]+\.[^/.]*(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://suwalls.com/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "japanator.com") return src.replace(/(\/+ul\/+[0-9]+-\/+[0-9]+)-[0-9]+x(?:[0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "cs.mg.co.za") return src.replace(/\/+crop\/+(content\/+images\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[^/]*\.[^/.]*)\/+[0-9]+x[0-9]+\/*(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "drytickets.com.au") return src.replace(/\/+assets\/+upload\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+/, "/assets/upload/");
		if (domain_nosub === "filmibeat.com") {
			newsrc = src
				.replace(/\/ph-[^/]*\/+/, "/ph-big/")
				.replace(/\/+img[hm]\/+[0-9]+x[0-9]+\/+/, "/ph-big/")
				.replace(/\/img\/+[0-9]+x[0-9]+(?:x[0-9]*)?\//, "/img/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "g.ahan.in") return src.replace(/\/+thumbnails\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "behindwoods.com") {
			newsrc = src.replace(/\/+thumbnails\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "/$1");
			if (newsrc !== src) {
				return {
					url: newsrc,
					problems: {
						watermark: true
					}
				};
			}
		}
		if (domain === "gallery.123telugu.com") return src.replace(/\/+thumbs\/+tn_([^/]*)(?:[?#].*)?$/, "/images/$1");
		if (domain === "images.gludy.com") return src.replace(/(\/+photos\/+[0-9]+\/+[^/]*)_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "static.az-cdn.ch") return src.replace(/\/n-[^/]*(?:[?#].*)?$/, "/teaser-goldbach");
		if (domain_nowww === "starchive.ru") return src.replace(/\/+thumbnails_foto\/+thumb_/, "/foto/");
		if (domain === "pre.aichi.jp") return src.replace(/\/+archive\/+storage\/+thumb\/+/, "/archive/storage/");
		if (domain === "img.kaikai.ch" ||
			domain === "bbs.animanch.com") {
			return src.replace(/\/thumb(?:_[a-z]+)\//, "/img/");
		}
		if (domain_nowww === "4fzone.com") return src.replace(/(\/+uploads\/+images\/+clip_[0-9]+_[0-9]+)_[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1_poster$2");
		if ((domain_nosub === "s1sf.com" ||
			domain_nosub === "isanook.com") &&
			domain.match(/^(?:s|p[0-9]+)\./)) {
			newsrc = src.replace(/\/+rp\/+r\/+[wh][0-9]+\/+/, "/rp/r/w9999999/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/.*\/(aHR0c[^?#/.]+)\.[^/.]+(?:[?#].)?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain_nosub === "caping.co.id" &&
			domain.match(/^image[0-9]*\./)) {
			return src.replace(/(\.[^/._]+)_[0-9A-Z]+(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "zozchat.com") return src.replace(/\/+thumb-news\/+[0-9]+\/+[0-9]+\/+/, "/images/uploads/images/");
		if (domain === "media.tintuc.vn") return src.replace(/(\/+uploads\/+medias\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+)[0-9]+x[0-9]+\//, "$1");
		if (domain_nosub === "gigacircle.com") return src.replace(/\/+media\/+[0-9]+x[0-9]+_/, "/media/");
		if (domain_nowww === "ckywf.com") {
			return {
				url: src.replace(/(\/+data\/+[^/]*\/+[0-9]{4}\/+[0-9]{2}\/[0-9a-f]+)_thumb(\.[^/.]*)$/, "$1$2"),
				head_wrong_contenttype: true
			};
		}
		if (domain_nowww === "hao.news") return src.replace(/(\/+Uploads\/+Picture\/+[0-9]{4}-[0-9]{2}-[0-9]{2}\/+[0-9a-f]+)_[0-9]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "img.joinfo.ua") return src.replace(/(\/+g\/+[0-9]{4}\/+[0-9]{2}\/+)[0-9]+x[0-9]+\/+/, "$1");
		if (domain_nosub === "hebeilong.com" &&
			domain.match(/^img/)) {
			return src.replace(/^[a-z]+:\/\/[^/]*\/+img\.php\?(http.*)$/, "$1");
		}
		if (domain === "cdn.blogimage2.crooz.jp") return src.replace(/\/smp_thum_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nosub === "lockerdome.com" && domain.match(/^cdn[0-9]*\./)) {
			return src.replace(/(\/+uploads\/+[0-9a-f]+)_:?[_a-z]+(?:[?#].*)?$/, "$1_:original");
		}
		if (domain === "images.headlines.pw") return src.replace(/(\/[0-9a-f]+)_[0-9]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "harianbernas.com") return src.replace(/\/image_news_[0-9]+\//, "/image_news/");
		if (domain === "static.weloveshopping.com") return src.replace(/(\/[^/_.]*)_[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "heykorean.com" &&
			domain.match(/^store[0-9]*\./)) {
			return src.replace(/(\/+board\/+[0-9]+\/+[0-9]+\/+)thumb\//, "$1");
		}
		if (domain_nowww === "searx.info") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+image_proxy.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain_nosub === "nocutnews.co.kr" && domain.match(/^file[0-9]*\./)) {
			return src.replace(/(\/[0-9]+)_preview(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nosub === "flixcart.com") return src.replace(/(:\/\/[^/]*\/+image)\/+[0-9]+\/+[0-9]+\/+([0-9a-z]+\/+(?:[^/]*\/+)?.\/+.\/+.\/+[^/]*\.[^/.?]*)(?:[?#].*)?$/, "$1/$2");
		if (domain === "conteudo.imguol.com.br") {
			return src
				.replace(/(-[0-9]{5,}_v2)_([0-9]+)x\2\./, "$1_1x1.")
				.replace(/(\/[^/]*\.[^/.?#]*)x(?:[?#].*)?$/, "$1");
		}
		if (domain === "images.gog.com") return src.replace(/(:\/\/[^/]*\/+[0-9a-f]+)_[^/]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "imx.to") {
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+img-([0-9a-f]{5,})\.html(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+i\/+([0-9a-z]{5,})(?:[?#].*)?$/,
				],
				query_for_id: function(id, match) {
					var url = "https://imx.to/img-" + id + ".html";
					if (/:\/\/[^/]+\/+i\//.test(match[0]))
						url = "https://imx.to/i/" + id;
					return {
						method: "POST",
						url: url,
						imu_mode: "document",
						headers: {
							"content-type": "application/x-www-form-urlencoded",
							origin: "https://imx.to",
							Referer: url
						},
						data: "imgContinue=Continue+to+your+image..."
					};
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<a href="(https?:\/\/imx\.to\/+u\/+i\/+[^"]+)" title="([^"]+)"[^>]*><img class="[^"]+" src="https?:\/\/imx\.to\/+u\/+i\/+/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var url = decode_entities(match[1]);
					var caption = decode_entities(match[2]);
					return done({
						url: url,
						extra: {
							page: resp.finalUrl,
							caption: caption
						}
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "imx.to") {
			newsrc = src
				.replace(/(:\/\/[^/]+\/+u\/+)t\/+/, "$1i/")
				.replace(/(:\/\/[^/]+\/+)upload\/+[a-z]+\/+/, "$1u/i/");
			if (newsrc !== src)
				return newsrc;
			return src
				.replace(/:\/\/[^/]*\/u\/t\//, "://imx.to/t/")
				.replace(/:\/\/[^/]*\/upload\/+[a-z]+\/+/, "://x001.imx.to/i/");
		}
		if (domain === "t.imx.to") return src.replace(/:\/\/[^/]*\/t\//, "://i.imx.to/i/");
		if (domain_nosub === "imx.to" && domain.match(/^[xi][0-9]+\./)) {
			return src.replace(/:\/\/[^/]*\/t\//, "://imx.to/u/i/");
		}
		if (domain_nowww === "sisajb.com" ||
			domain === "image.kbsm.net") {
			newsrc = src.replace(/\/data\/newsThumb\/([0-9]+(?:&&)?).*?$/, "/data/newsData/$1.jpg");
			if (newsrc !== src)
				return add_extensions_upper(newsrc);
		}
		if (domain === "assets.cdn.moviepilot.de") {
			return {
				url: src.replace(/(\/+files\/+[0-9a-f]+)\/+(?:limit|fill)\/+[0-9]+\/+[0-9]+\/+/, "$1/"),
				head_wrong_contentlength: true
			};
		}
		if (domain === "img.xuehi.cn") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+(?:[0-9]\/+){3}([^/]*%2F.*?\.[^%]+?)[.!]([0-9]+\.)?[0-9]+x[0-9]+\.auto\.[^/.]+(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return add_http(decodeURIComponent(newsrc));
		}
		if (domain_nowww === "infectedbyart.com" && string_indexof(src, "/Images/") >= 0) {
			return {
				url: src.replace(/\/+thumbs\/+/, "/"),
				problems: {
					watermark: true
				}
			};
		}
		if (domain === "static.doramatv.me") return src.replace(/(\/uploads\/+pics\/+.*\/[0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "$1_o$2");
		if (domain === "chi.gomtv.com") return src.replace(/\/imgview\.cgi.*?[?&]nid=([0-9]+).*?$/, "/imgview.cgi?nid=$1&type=0");
		if (domain === "static-thechristianpost.netdna-ssl.com" ||
			domain === "cdn.christianpost.com") {
			return src
				.replace(/\/files\/+cache\/+(image|thumbnail)\/+([0-9]{1,2}\/+[0-9]{1,2}\/+[0-9]+)_(?:[wh]_[0-9]+(?:_[0-9]+)?|(?:a(?:_[0-9]+){2,4}))(\.[^/.]*)(?:[?#].*)?$/, "/files/original/$1/$2$3")
				.replace(/(\/(?:image|thumbnail)\/+[^/]*\.[^/.?#]+)(?:[?#].*)?$/, "$1");
		}
		if (domain === "prnewswire2-a.akamaihd.net") return src.replace(/(\/+entry_id\/+[0-9a-z]+_[0-9a-z]+\/+).*$/, "$1def_height/0/def_width/0");
		if (domain_nosub === "eldarioncloud.com" &&
			domain.match(/^radiocms-images\./)) {
			return src.replace(/^[a-z]+:\/\/[^/]*\/+resize\/+[0-9]+\/+(https?:)/, "$1");
		}
		if (domain === "media.ntslive.co.uk") return src.replace(/\/(?:crop|resize)\/+[0-9]+x[0-9]+\/+/, "/images/");
		if (domain === "icdn.ensonhaber.com") return src.replace(/\/(?:crop|resize)\/+[0-9]+x[0-9]+(?:-[0-9]+)?\/+resimler\/+/, "/resimler/");
		if (domain_nosub === "tedsby.com" && domain.match(/^cdn[0-9]*\./)) {
			return src.replace(/\/tb\/+[a-z]+\/+storage\//, "/storage/");
		}
		if (domain_nosub === "cumicumi.com") return src.replace(/(\/uploads\/+public\/+(?:[0-9a-f]+\/+){3})th_[0-9]+x[0-9]+_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "kanal247.com") return src.replace(/\/images\/+media\/+[0-9]+x[0-9]+\/+/, "/images/media/photo/");
		if (domain_nowww === "sportuvai.bg") return src.replace(/(\/pictures\/+[0-9]+_{1,2})[0-9]+(_+(?:[0-9]+)?)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		if ((domain_nosub === "thetimes.co.uk" ||
			domain_nosub === "thetimes.com") && /\/imageserver\/+image\//.test(src)) {
			return {
				url: src.replace(/(?:\?.*)?$/, "?resize=999999999"),
				head_wrong_contentlength: true
			};
		}
		if (domain === "cdn.celebyolo.com") return src.replace(/\/+(?:thumbnails\/+)?([^/]*-[0-9]+)-[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain_nowww === "voice.fi" ||
			domain_nowww === "radionova.fi") {
			return src.replace(/(\/+files\/+media\/+image\/+(?:[0-9]{4}\/+[0-9]{2}\/+[0-9]{4}_[0-9]{2}_[0-9]{2}_[0-9a-f]+|[0-9a-z]{4}\/+[0-9a-z]{2}\/+[0-9a-z]+|[0-9]+\/+_r\/+[0-9]+_retinaarticle))_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "funtime.ge") {
			return src
				.replace(/\/+img\/+[0-9]+\/+uploaded\/+/, "/uploaded/")
				.replace(/(\/+uploaded\/+[a-z]+\/+[0-9]{4}-[0-9]{2}\/+[0-9]+)_[a-z]+(\.[^/.]*)$/, "$1$2");
		}
		if (domain === "t.nhentai.net" ||
			(domain_nosub === "hentaifox.com" && /^i[0-9]*\./.test(domain)) ||
			domain === "images.asmhentai.com" ||
			domain === "t.nyahentai.net") {
			newsrc = src.replace(/(:\/\/[^/]+\/+(?:galleries|[0-9]+)\/+[0-9]+\/+[0-9]+)t(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc.replace(/:\/\/t\./, "://i.");
			return src.replace(/(:\/\/[^/]+\/+(?:galleries|[0-9]+)\/+[0-9]+\/)thumb(\.[^/.]*)(?:[?#].*)?$/, "$1cover$2");
		}
		if (domain_nosub === "hitomi.la") {
			newsrc = src.replace(/:\/\/([a-z])tn\.hitomi\.la\/+(?:small|big)tn\/+([0-9a-f]\/+[0-9a-f]{2}\/+[0-9a-f]{20,})\.[^/.]+(?:[?#].*)?$/, "://$1a.hitomi.la/webp/$2.webp");
			if (newsrc !== src)
				return newsrc;
			regex = /:\/\/[a-z]?tn\.hitomi\.la\/+[a-z]+\/+([0-9]+\/+p?[0-9]+\.[^/.]*)\.[^/.]*(?:[?#].*)?$/;
			if (src.match(regex)) {
				return [
					src.replace(regex, "://aa.hitomi.la/galleries/$1"),
					src.replace(regex, "://ba.hitomi.la/galleries/$1"),
				];
			} else {
				var pageid = src.replace(/^[a-z]+:\/\/[^/]*\/+[a-z]+\/+([0-9]+)\/+.*/, "$1");
				if (src !== pageid) {
					var page = "https://hitomi.la/galleries/" + pageid + ".html";
					return {
						url: src,
						extra: { page: page }
					};
				}
			}
		}
		if (domain === "img.insight.co.kr") return src.replace(/(\/static\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+)[0-9]+\/+([0-9a-z]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "express.de") return src.replace(/\/+image\/+([0-9]+)\/+[0-9]+x[0-9]+\/+[0-9]+\/+[0-9]+\/+([0-9a-f]+)\/+..\/+([^/.]*)(\.[^/]*)(?:[?#].*)?$/, "/blob/$1/$2/$3-data$4");
		if (domain === "media.news.de") return src.replace(/:\/\/[^/]*\/(?:images\/+[0-9]+|resources)\/+images\/+([0-9a-f]{2}\/+[0-9a-f]{2}\/+)([0-9a-f]+)\/+.*(\.[^/.]*)(?:[?#].*)?$/, "://media.news.de/resources/images/$1$2$3");
		if (domain === "store.live.ksmobile.net") return src.replace(/(:\/\/[^/]*\/)[a-z]+\/+liveme\/+/, "$1liveme/");
		if (domain === "c.fantia.jp") return src.replace(/(\/uploads\/.*\/)[a-z]+_((?:[0-9a-f]+-){4}[0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "ehgt.org") {
			if (/\/g\/+blank\.gif(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "e-hentai.org") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:lofi\/+)?(s\/+[0-9a-f]+\/+[0-9]+-[0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://e-hentai.org/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<img id="(?:sm|img)" src="(https?:\/\/[^"]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find regular image match for", resp);
						return done(null, false);
					}
					var mainimage = match[1];
					match = null;
					if (options.rule_specific && options.rule_specific.ehentai_full_image)
						match = resp.responseText.match(/href=["'](https?:\/\/(?:www\.)?e-hentai\.org\/fullimg\.php.*?)["']/);
					if (match) {
						return done([decode_entities(match[1]), mainimage], 60 * 60);
					} else {
						return done(mainimage, 60 * 60);
					}
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "e-hentai.org" && /:\/\/[^/]+\/+s\//.test(options.host_url) &&
			options.element && options.document &&
			options.rule_specific && options.rule_specific.ehentai_full_image) {
			if (options.element.tagName === "IMG" && options.element.id === "img" && options.element.src === src) {
				var els = options.document.getElementsByTagName("a");
				for (var i_6 = 0; i_6 < els.length; i_6++) {
					var el = els[i_6];
					if (!/^https?:\/\/(?:www\.)?e-hentai\.org\/fullimg\.php/.test(els[i_6].href))
						continue;
					return els[i_6].href;
				}
			}
		}
		if (host_domain_nowww === "e-hentai.org" && /:\/\/[^/]+\/+lofi\/+s\//.test(options.host_url) && options.element &&
			options.rule_specific && options.rule_specific.ehentai_full_image) {
			if (options.element.tagName === "IMG" && options.element.id === "sm" && options.element.src === src) {
				return {
					url: options.host_url,
					is_pagelink: true
				};
			}
		}
		if (host_domain_nowww === "e-hentai.org" && /:\/\/[^/]*\/+(?:lofi\/+)?g\//.test(options.host_url) && options.element) {
			newsrc = common_functions["get_pagelink_el_matching"](options.element, /^[a-z]+:\/\/[^/]+\/+(?:lofi\/+)?s\/+/);
			if (newsrc)
				return newsrc;
			if (options.element.tagName === "DIV" && options.element.children.length === 1 && options.element.children[0].tagName === "A") {
				var childel = options.element.children[0];
				if (/^[a-z]+:\/\/[^/]+\/+(?:lofi\/+)?s\/+/.test(childel.href)) {
					return {
						url: childel.href,
						is_pagelink: true
					};
				}
			}
		}
		if (domain === "cdn.zenfolio.net" ||
			domain_nosub === "zenfolio.com") {
			if (/\/zf\/+img\/+null\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if ((domain === "cdn.zenfolio.net" ||
			domain_nosub === "zenfolio.com") && /:\/\/[^/]+\/+cdn[0-9]*\/+pub\//.test(src)) {
			return src.replace(/:\/\/[^/]*\/+cdn[0-9]*\/+pub\/+(?:[^?#]*?)(\/(?:s[0-9]*\/+)?[^/]*\/+p[0-9]+-[0-9]+\.[^/.?#]*)(?:[?#].*)?$/, "://www.zenfolio.com/img$1");
		}
		if (domain_nosub === "zenfolio.com") {
			regex = /(\/img\/+(?:s[0-9]*\/+)?v-?[0-9]+\/+p[0-9]+)-[0-9]+(\.[^/.?#]*)(?:[?#].*)?$/;
			return fillobj_urls([
				src.replace(regex, "$1$2"),
				src.replace(regex, "$1-7$2"),
				src.replace(regex, "$1-6$2"),
				src.replace(regex, "$1-5$2"),
				src.replace(regex, "$1-4$2"),
				src.replace(regex, "$1-3$2")
			], {
				bad_if: [{
						headers: {
							"content-length": "3446",
							"content-type": "image/png"
						}
					}],
				can_head: false // head only works sometimes, and returns odd last-modified
			});
		}
		if (domain === "gallery.greatandhra.com") return src.replace(/(\/upload\/+[0-9]+\/+)[a-z]+\/+/, "$1images/");
		if (domain_nowww === "fortstore.net" ||
			domain_nowww === "imgfrost.net" ||
			domain_nowww === "imgblaze.net" ||
			domain_nowww === "imgair.net" ||
			domain_nowww === "iceimg.net" ||
			domain_nowww === "vestimage.site" ||
			domain_nowww === "chaosimg.site" ||
			domain_nowww === "imgweng.xyz" ||
			domain_nowww === "imgkes.xyz" ||
			domain_nowww === "venpix.xyz" ||
			domain_nowww === "imgwew.xyz" ||
			domain_nowww === "imgvivo.xyz" ||
			domain_nowww === "imgkr.xyz" ||
			domain_nowww === "imgkoi.xyz" ||
			domain_nowww === "imgtigr.xyz" ||
			domain_nowww === "imgbird.xyz" ||
			domain_nowww === "imglin.xyz" ||
			domain_nowww === "pickjsn.cfd" ||
			domain_nowww === "imgcdfd.sbs" ||
			domain_nosub === "imgopaleno.site" ||
			domain_nowww === "pixsera.net" ||
			domain_nowww === "cloudgallery.net" ||
			domain_nosub === "imgbig.xyz" ||
			domain_nosub === "fiyar.live") {
			newsrc = src.replace(/(\/data_server_(?:[0-9]+|new)\/+[0-9]+\/+)[a-z]+\/+[a-z]+_([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1big/$2");
			if (newsrc !== src)
				return newsrc;
			regex = /\/themes\/+latest\/+ssd\/+small\/+([0-9]+)\/+small-/;
			if (regex.test(src)) {
				return [
					src.replace(regex, "/themes/latest/uploads4/pixsense/big/$1/"),
					src.replace(regex, "/themes/latest/uploads3/pixsense/big/$1/"),
					src.replace(regex, "/themes/latest/uploads2/pixsense/big/$1/")
				];
			}
			newsrc = src.replace(/\/themes\/+latest\/+ssd\/+small\/+small-/, "/themes/default/big/");
			if (newsrc !== src)
				return newsrc;
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([a-z0-9]{3,}|site\/+v\/+[0-9]+)(?:[?#].*)?$/,
				query_for_id: "http://" + domain + "/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/document\.location\.href="(https?:\/\/[^/]+\/+(?:data_server[^/]*\/+[0-9]+\/+big\/+|themes\/+latest\/+uploads[0-9]*\/+pixsense\/+big\/+[0-9]+\/+|themes\/+default\/+big\/+)[^"]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done(match[1], 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "static.jpg.pl") return src.replace(/(\/static\/+photos\/+[0-9a-f]+\/+[0-9a-f]+\/+[0-9a-f]+)_[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1_original$2");
		if ((domain_nosub === "nevsepic.com.ua" ||
			domain_nosub === "nevseoboi.com.ua") &&
			domain.match(/^c[po][0-9]*\./)) {
			return src.replace(/(\/[0-9]{3}\/+[0-9]+\/+)thumbs\//, "$1");
		}
		if (domain === "static.pulsk.com" ||
			domain_nowww === "pulsk.com") {
			return src.replace(/(\/images\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+)thumb_[0-9]+_([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "pornchampion.com") return src.replace(/\/images\/+[^/]*\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/)/, "/images/big_images/$1");
		if (domain === "cdn.vthumbs.com") return src.replace(/:\/\/[^/]*\/thumbs\/[0-9]+px\/content\//, "://content.pornpics.com/");
		if (domain === "content.pornpics.com" ||
			domain === "img.pornpics.com") {
			var folder = "pics";
			if (domain === "img.pornpics.com")
				folder = "pics1";
			return src.replace(/:\/\/[^/]*\/+(?:[0-9]+\/+)?([0-9]{4}-[0-9]{2}-[0-9]{2}\/+[0-9]+_[0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "://cdn.pornpics.com/" + folder + "/$1big$2");
		}
		if (domain === "images.pornpics.com" ||
			domain === "cdni.shavedpics.com" ||
			domain === "cdni.hotnudegirls.net" ||
			domain === "cdni.pornpics.com") {
			obj = {
				url: src
			};
			match = src.match(/\/([0-9]{5,})\/\1_[0-9]{3}_[0-9a-f]+\./);
			if (false && match) {
				obj.extra = {
					page: "https://www.pornpics.com/galleries/" + match[1] + "/"
				};
			}
			newsrc = src.replace(/(:\/\/[^/]*\/)(?:300|460)\/+/, "$11280/");
			if (newsrc !== src)
				obj.url = newsrc;
			return obj;
		}
		if (domain_nowww === "vipissy.com" ||
			domain === "media.fistertwister.com" ||
			domain_nowww === "peeonher.com" ||
			domain === "media.wetandpissy.com" ||
			domain === "media.puffynetwork.com") {
			return src.replace(/(\/fhg\/+[0-9a-f]+\/+)thumbs\//, "$1files/");
		}
		if (domain_nosub === "explicithd.com" && /^static-cdn/.test(domain)) {
			return src.replace(/(\/content\/+[^/]*\/+[0-9a-f]{20,}\/+)thumbs\/+/, "$1files/");
		}
		if (domain === "images.porninspector.com") return src.replace(/\/tmb_([^/]*)(?:[?#].*)?$/, "/$1");
		if (domain_nosub === "zoznam.sk") {
			newsrc = src.replace(/:\/\/([^/.]*)\.[^/]*\/cacheImg\/[^/]*\/([0-9]+px)\/(?:[^/.]*-)?([0-9]+[^/]*)(?:[?#].*)?$/, "://static.$1.zoznam.sk/$2/$3");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "gamesite.zoznam.sk") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+images\/+thumb\.php\?(?:.*?&)?src=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			return {
				url: src,
				headers: {
					Referer: ""
				}
			};
		}
		if (domain_nosub === "zoznam.sk") return src.replace(/(:\/\/[^/]*\/)[0-9]+px\//, "$1original/");
		if (domain_nowww === "wallhalla.com" &&
			options && options.cb && options.do_request) {
			id = src.replace(/.*\/thumbs\/.*\/([^/.]*)[^/]*(?:[?#].*)?$/, "$1");
			if (id !== src) {
				options.do_request({
					url: "https://wallhalla.com/wallpaper/" + id,
					method: "GET",
					onload: function(resp) {
						if (resp.readyState === 4) {
							var match = resp.responseText.match(/ data-wallurl=["']([^"']*)["']/);
							if (match) {
								options.cb(urljoin(src, match[1], true));
							} else {
								options.cb(null);
							}
						}
					}
				});
				return {
					waiting: true
				};
			}
		}
		if (domain_nowww === "artfile.ru") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+i\.php\?(?:.*&)?i=([0-9]+)(?:[&#].*)?$/,
				query_for_id: "https://www.artfile.ru/i.php?i=${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/top.location.href *= *["'](https?:\/\/i\.artfile\.ru\/[^"']*)["']/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					done({
						url: urljoin(src, match[1], true),
						extra: {
							page: resp.finalUrl
						}
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "i.artfile.ru") {
			id = src.replace(/^[a-z]+:\/\/[^/]*\/[0-9]+x[0-9]+_([0-9]+)_.*$/, "$1");
			if (id === src) {
				id = src.replace(/^[a-z]+:\/\/[^/]*\/s\/+([0-9]+)_[0-9]+_[^/]*(?:[?#].*)?$/, "$1");
			}
			if (id !== src) {
				return {
					url: "http://www.artfile.ru/i.php?i=" + id,
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "relook.ru" ||
			domain === "st.relook.ru") {
			return src.replace(/(\/data\/+cache\/+.*)(?:nothumb[0-9]+|-[0-9]+x[0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "izhevsk.ru") return src.replace(/(\/forum_pictures\/+[^/]*\/+)thm\//, "$1");
		if (domain === "img.navodayatimes.in") return src.replace(/^[a-z]+:\/\/[^/]*\/default\.aspx.*?[?&]img=([^&]*).*?$/, "$1");
		if (domain_nowww === "wallmachine.pl") return src.replace(/(\/media\/+ecommerce\/+products\/+product[0-9]+\/+)[0-9]+x[0-9]+_(?:true|false)_/, "$1");
		if (domain === "ds393qgzrxwzn.cloudfront.net") return src.replace(/\/resize\/m[0-9]+x[0-9]+\//, "/");
		if (domain_nowww === "religionpeace.ru" ||
			domain_nowww === "eurikacosmetics.ru") {
			return src.replace(/^[a-z]+:\/\/[^/]*\/[0-9]+\/+[0-9]+\/+(https?)\/(.*)$/, "$1://$2");
		}
		if (domain_nowww === "fb.ru") {
			return src
				.replace(/\/misc\/+i\/+thumb\/+[^/]*\/+/, "/media/i/")
				.replace(/(\/media\/+i\/+(?:[0-9]+\/+){1,}i\/+[0-9]+)_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "specialone.co.kr") return src.replace(/(\/alldata\/+[^/]*\/+)thum_([^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "static.mellbimbo.eu") {
			return {
				url: src.replace(/(:\/\/[^/]*\/+)thumb\//, "$1files/"),
				headers: {
					Origin: "http://mellbimbo.eu",
					Referer: "http://mellbimbo.eu"
				}
			};
		}
		if (domain_nowww === "8xxx.net") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+pictures\/+([0-9]+)(?:-[^/]+)?(?:\.html)?(?:[?#].*)?$/,
				query_for_id: "http://8xxx.net/pictures/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<p><a href=["'](.*?)["']>https?:\/\//);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done(match[1], 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "8xxx.net") {
			id = src.replace(/^[a-z]+:\/\/[^/]*\/preview\/+[0-9]\/+[0-9]+\/+([0-9]+)\.[^/.]*(?:[?#].*)?$/, "$1");
			if (id !== src) {
				return {
					url: "http://8xxx.net/pictures/" + id,
					is_pagelink: true
				};
			}
		}
		if (domain === "i.frg.im") return src.replace(/_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain_nowww === "thehshq.com") {
			regex = /\/d\/+([0-9]+)(-[0-9]+\/+[^/]*)(?:[?#].*)?$/;
			match = src.match(regex);
			if (match) {
				var parsed_3 = parseInt(match[1]);
				return [
					{
						url: src.replace(regex, "/d/" + (parsed_3 - 2) + "$2"),
						norecurse: true
					},
					{
						url: src.replace(regex, "/d/" + (parsed_3 - 1) + "$2"),
						norecurse: true
					}
				];
			}
		}
		if (domain_nosub === "11alive.com" ||
			domain_nosub === "12news.com" ||
			domain_nosub === "12newsnow.com" ||
			domain_nosub === "13newsnow.com" ||
			domain_nosub === "13wmaz.com" ||
			domain_nosub === "9news.com" ||
			domain_nosub === "abc10.com" ||
			domain_nosub === "cbs8.com" ||
			domain_nosub === "cbs19.tv" ||
			domain_nosub === "firstcoastnews.com" ||
			domain_nosub === "kagstv.com" ||
			domain_nosub === "kare11.com" ||
			domain_nosub === "kcentv.com" ||
			domain_nosub === "kens5.com" ||
			domain_nosub === "kgw.com" ||
			domain_nosub === "khou.com" ||
			domain_nosub === "kiiitv.com" ||
			domain_nosub === "king5.com" ||
			domain_nosub === "krem.com" ||
			domain_nosub === "ksdk.com" ||
			domain_nosub === "ktvb.com" ||
			domain_nosub === "kvue.com" ||
			domain_nosub === "myfoxzone.com" ||
			domain_nosub === "newscentermaine.com" ||
			domain_nosub === "thv11.com" ||
			domain_nosub === "wbir.com" ||
			domain_nosub === "wcnc.com" ||
			domain_nosub === "wfaa.com" ||
			domain_nosub === "wfmynews2.com" ||
			domain_nosub === "wgrz.com" ||
			domain_nosub === "whas11.com" ||
			domain_nosub === "wltx.com" ||
			domain_nosub === "wtsp.com" ||
			domain_nosub === "wusa9.com" ||
			domain_nosub === "wwltv.com" ||
			domain_nosub === "wzzm13.com") {
			if (/^media\./.test(domain)) {
				return src.replace(/(\/assets\/+[A-Z]+\/+images\/+[-0-9a-f]{20,}\/+[-0-9a-f]{20,})_[0-9]+x[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			}
			if (domain_nowww === domain_nosub) {
				newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+img\/+resize\/+([^/]*\.[^/]*\/.*?)(?:[?#].*)?$/, "$1");
				if (newsrc !== src)
					return add_http(newsrc);
			}
		}
		if (domain_nowww === "celeb6free.com" ||
			domain_nowww === "celeb-for-free.com") {
			newsrc = src.replace(/\/pics\/+tn_([^/]*)(?:[?#].*)?$/, "/pics/$1");
			if (newsrc !== src) {
				return {
					url: newsrc,
					extra: {
						page: newsrc.replace(/\/pics\/[^/]*$/, "/")
					}
				};
			}
		}
		if (domain === "images.poms.omroep.nl") return src.replace(/\/image\/+(?:s[0-9]+(?:x[0-9]+)?|c[0-9]+(?:x[0-9]+)?)\/+/, "/image/");
		if (domain_nosub === "tvbuzer.com" &&
			domain.match(/^static[0-9]*\./)) {
			return src.replace(/(\/images\/+[a-z]+\/+)([0-9a-f]+\/+[0-9a-f]+-[0-9]+)-[0-9]+-[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1sources/$2$3");
		}
		if (domain_nosub === "mrskincdn.com" &&
			domain.match(/^assets[0-9]*\./)) {
			return src.replace(/(\/[^/]*-[0-9a-f]+)_[a-z_]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nosub === "spankbang.com" &&
			domain.match(/^cdnthumb[0-9]*\./)) {
			return src.replace(/(:\/\/[^/]*\/)[0-9]+\/+([0-9]\/+[0-9]\/+[0-9]+-t)/, "$10/$2");
		}
		if (domain === "static.spankbang.com") return src.replace(/(\/pornstarimg\/+f\/+[0-9]+)-[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "sb-cd.com" && /^tb[0-9]*\./.test(domain)) {
			newsrc = src
				.replace(/(\/[0-9]+-t[0-9]+)-(?:s|enh)\/+/, "$1/")
				.replace(/(:\/\/[^/]+\/+)w:[0-9]+\/+/, "$1w:0/");
			if (newsrc !== src)
				return newsrc;
		}
		if ((domain_nosub === "sb-cd.com" && /^tbv?[0-9]*\./.test(domain)) ||
			(domain_nosub === "spankbang.com" && /^vcdn-[^-]+(?:-[0-9]+)?\./.test(domain))) {
			match = src.match(/:\/\/[^/]+\/+(?:w:[0-9]+\/+)?[0-9]\/+[0-9]\/+([0-9]+)-/);
			var vidid_numeric, vidid;
			if (match) {
				vidid_numeric = parseInt(match[1]);
				vidid = vidid_numeric.toString(36);
				obj = {
					url: src,
					extra: { page: "https://spankbang.com/" + vidid + "/video/" }
				};
			}
			if (options.cb && options.do_request && match) {
				var get_streamkey_for_vidid = function(vidid, cb) {
					var cache_key = "spankbang_streamkey:" + vidid;
					api_cache.fetch(cache_key, cb, function(done) {
						options.do_request({
							method: "GET",
							url: "https://spankbang.com/" + vidid + "/video/",
							onload: function(resp) {
								if (resp.readyState !== 4)
									return;
								if (resp.status !== 200) {
									console_error(resp);
									return done(null, false);
								}
								match = resp.responseText.match(/data-videoid=["'][0-9]+["']\s+data-streamkey=["']([^"']+)["']/);
								if (match) {
									return done(match[1], 24 * 60 * 60);
								} else {
									console_warn("Unable to find match", resp);
									return done(null, false);
								}
							}
						});
					});
				};
				var get_streamdata = function(streamkey, cb) {
					var cache_key = "spankbang_streamdata:" + streamkey;
					api_cache.fetch(cache_key, cb, function(done) {
						options.do_request({
							method: "POST",
							url: "https://spankbang.com/api/videos/stream",
							data: "id=" + streamkey + "&data=0",
							headers: {
								"Origin": "https://spankbang.com",
								"Referer": "https://spankbang.com/", // add /.../video?
								"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
								"X-Requested-With": "XMLHttpRequest"
							},
							onload: function(resp) {
								if (resp.readyState !== 4)
									return;
								if (resp.status !== 200) {
									console_error(resp);
									return done(null, false);
								}
								try {
									var response = JSON_parse(resp.responseText);
									return done(response, 6 * 60 * 60);
								} catch (e) {
									console_error(e, resp);
									return done(null, false);
								}
							}
						});
					});
				};
				var find_largest_from_streamdata = function(streamdata) {
					var sizes = [
						"4k",
						"1080p",
						"720p",
						"480p",
						"360p",
						"320p",
						"240p",
						"144p"
					];
					var largestsize = 100;
					for (var key in streamdata) {
						if (!streamdata[key] || streamdata[key].length === 0)
							continue;
						var ourindex = array_indexof(sizes, key);
						if (ourindex >= 0 && ourindex < largestsize)
							largestsize = ourindex;
					}
					if (largestsize < sizes.length) {
						return streamdata[sizes[largestsize]][0];
					}
					return null;
				};
				var get_norm_sb_url = function(url) {
					return url.replace(/.*\/([0-9]+-[0-9]+[a-z]+\.[^/.?]+)(?:[?#].*)?$/, "$1");
				};
				get_streamkey_for_vidid(vidid, function(streamkey) {
					if (!streamkey)
						return options.cb(obj);
					get_streamdata(streamkey, function(streamdata) {
						if (!streamdata)
							return options.cb(obj);
						var largest = find_largest_from_streamdata(streamdata);
						if (get_norm_sb_url(largest) !== get_norm_sb_url(src)) {
							obj.url = largest;
						}
						options.cb(obj);
					});
				});
				return {
					waiting: true
				};
			} else if (match) {
				return options.cb(obj);
			}
		}
		if (domain_nowww === "kosova-sot.info" ||
			domain_nowww === "botasot.info" ||
			domain_nowww === "syri.net") {
			return src.replace(/(\/(?:uploads|media)\/+(?:[^/]+\/+)?images\/+[0-9]{4}\/+[A-Z][a-z]+\/+[0-9]+\/+)(?:auto|thumb|thumbauto|[0-9]+x[0-9]+)_([^/]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "img.mako.co.il") return src.replace(/(:\/\/[^/]*\/[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[^/]*)_(?:[a-z]|reduced)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "okeinfo.net" &&
			domain.match(/^img(?:-[^.]*)?\./)) {
			return src.replace(/(:\/\/[^/]*\/)okz\/+[0-9]+\/+([a-z]+\/)/, "$1$2");
		}
		if (domain_nowww === "freexcafe.com" ||
			domain_nowww === "foxyporn.com") {
			return src
				.replace(/\/img\/([0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "/pics/pics$1$2")
				.replace(/\/img\/([0-9a-f]+)-thumb[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/pics/$1$2");
		}
		if (domain === "cdn-webimages.wimages.net") return src.replace(/(:\/\/[^/]*\/[0-9a-f]+)(?:-(?:[a-z]+|v[0-9]+)){1,}(\.[^/.]*)$/, "$1$2");
		if (domain === "portal-images.azureedge.net") return src.replace(/\/images\/([-0-9a-f]+\.[^/.]*?)(?:[?#].*)?$/, "/images/$1");
		if (domain === "img.goldlive.co.kr") return src.replace(/\/resize_[0-9]+x[0-9]+\//, "/");
		if (domain_nowww === "nicegirl.io" ||
			domain_nowww === "sexypic.org") {
			return src.replace(/(\/album_[0-9]+\/+)t_(i_[^/]*)(?:[?#].*)?$/, "$1$2");
		}
		if ((domain_nosub === "35photo.ru" ||
			domain_nosub === "35photo.pro") &&
			src.match(/:\/\/[^/]*\/photos_/)) {
			newsrc = src
				.replace(/:\/\/m[0-9]*\.35photo[^/]*\//, "://35photo.pro/")
				.replace(/\/photos_(?:col|temp)\/+(?:r[0-9]|sizes)\/+([0-9]+\/[0-9]+)(?:_[^/.]*)?(\.[^/.]*)(?:[?#].*)?$/, "/photos_main/$1$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/:\/\/[^/]+\/+photos_main\/+[0-9]+\/+([0-9]+)\./);
			if (match) {
				return {
					url: src,
					extra: { page: "https://35photo.pro/photo_" + match[1] + "/" }
				};
			}
		}
		if (domain_nowww === "artfile.me") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+wallpaper\/+((?:[^/?#]+-)?[0-9]+)\.[^/.]+(?:[?#].*)?$/,
				query_for_id: "https://artfile.me/wallpaper/${id}.html",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<a href="\/download\/[^/]+\/([0-9]+x[0-9]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var size = match[1];
					var image = get_meta(resp.responseText, "og:image");
					if (!image) {
						console_error(cache_key, "Unable to find image from", resp);
						return done(null, false);
					}
					image = urljoin(resp.finalUrl, image, true);
					image = image.replace(/\/[0-9]+x[0-9]+\//, "/" + size + "/")
						.replace(/:\/\/pw\.artfile/, "://i.artfile");
					return done({
						url: image,
						extra: {
							page: resp.finalUrl
						}
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "pw.artfile.me" || domain === "i.artfile.me") {
			id = src.replace(/.*\/wallpaper\/+[0-9]+-[0-9]+-[0-9]{4}\/+[0-9]+x[0-9]+\/+([^/.?#]*).*?$/, "$1");
			if (id !== src) {
				return {
					url: "https://artfile.me/wallpaper/" + id + ".html",
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "fotokto.ru" && domain.match(/^s[0-9]*\./)) {
			return src.replace(/\/photo\/+[a-z]+\//, "/photo/full/");
		}
		if (domain_nowww === "500px.com") {
			/*
			PHOTO_GRID_IMAGE_SIZES: ["1", "2", "32", "31", "33", "34", "35", "36", "2048", "4", "14"],
			PHOTO_SIZES: {
				S3_IMG_SIZE_70: 1,
				S3_IMG_SIZE_140: 2,
				S3_IMG_GRID_300: 32,
				S3_IMG_GRID_450: 31,
				S3_IMG_GRID_600: 33,
				S3_IMG_WEB_1000: 34,
				S3_IMG_WEB_1500: 35,
				S3_IMG_WEB_2000: 36,
				S3_IMG_SIZE_XLARGE: 2048,
				S3_IMG_STORE_900: 14
			},
			*/
			var query_500px_api_1 = function(url, cb) {
				var query_obj = {
					url: url,
					json: true
				};
				var do_query = function() {
					api_query("500px_api:" + url, query_obj, cb, function(done, resp, cache_key) {
						if (!resp) {
							return done(null, false);
						} else {
							return done(resp, 60 * 60);
						}
					});
				};
				if (options.get_cookies) {
					options.get_cookies(url, function(cookies) {
						if (cookies) {
							var cookies_dict = headers_list_to_dict(cookies);
							if (cookies_dict && cookies_dict["x-csrf-token"]) {
								query_obj.headers = {
									"x-csrf-token": cookies_dict["x-csrf-token"]
								};
							}
						}
						do_query();
					});
				} else {
					do_query();
				}
			};
			var query_500px_photo_1 = function(id, cb) {
				var page = "https://500px.com/photo/" + id + "/";
				var query_url = "https://api.500px.com/v1/photos?image_size%5B%5D=1&image_size%5B%5D=2&image_size%5B%5D=32&image_size%5B%5D=31&image_size%5B%5D=33&image_size%5B%5D=34&image_size%5B%5D=35&image_size%5B%5D=36&image_size%5B%5D=2048&image_size%5B%5D=4096&image_size%5B%5D=4&image_size%5B%5D=14&expanded_user_info=true&include_tags=true&include_geo=true&include_equipment_info=true&vendor_photos=true&include_licensing=true&include_releases=true&liked_by=1&following_sample=100&ids=" + id;
				query_500px_api_1(query_url, function(data) {
					var obj = {
						url: src,
						extra: {
							page: page
						}
					};
					var sizelist = [0, 1, 2, 32, 31, 33, 14, 34, 35, 36, 2048, 4096];
					var comparesizes = function(a, b) {
						var a_index = array_indexof(sizelist, a);
						if (a_index < 0)
							return false;
						var b_index = array_indexof(sizelist, b);
						if (b_index < 0)
							return false;
						return b_index > a_index;
					};
					try {
						var images = data.photos[id].images;
						page = urljoin(page, data.photos[id].url, true);
						obj.extra.page = page;
						obj.extra.caption = data.photos[id].name || data.photos[id].description;
						var largestsize = 0;
						var largesturl = null;
						for (var i = 0; i < images.length; i++) {
							if (comparesizes(largestsize, images[i].size)) {
								largestsize = images[i].size;
								largesturl = images[i].https_url;
							}
						}
						if (largesturl !== null)
							obj.url = largesturl;
					} catch (e) {
						console_error(e);
						return cb(null);
					}
					return cb(obj);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+photo\/+([0-9]+)(?:\/+[^/]*\/*)?(?:[?#].*)?$/,
				run: function(cb, match) {
					query_500px_photo_1(match[1], cb);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "drscdn.500px.org") {
			id = src.replace(/^[a-z]+:\/\/[^/]*\/photo\/+([0-9]+)\/.*$/, "$1");
			if (id !== src) {
				return {
					url: "https://500px.com/photo/" + id + "/",
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "xportsnews.com" ||
			domain === "image.xportsnews.com") {
			return src.replace(/(\/contents\/+images\/+upload\/+.*\/)thm_/, "$1");
		}
		if (domain === "contents.innolife.net") return src.replace(/(\/mobile\/img\/item\/[0-9]+_)[a-z]+(\.[^/.]*)$/, "$1l$2");
		if (domain === "mnews.imaeil.com" ||
			domain === "news.imaeil.com") {
			return src.replace(/(\/photos\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]{5,})_[sm](\.[^/.]*)(?:[?#].*)?$/, "$1_l$2");
		}
		if (domain_nowww === "blognews.am") return src.replace(/\/static\/+news\/+[a-z]\/+/, "/static/news/b/");
		if (domain_nowww === "sasisa.ru") return src.replace(/(\/blog\/+content\/+[0-9]+\/+[0-9a-f]+)_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "i.photographers.ua" ||
			domain_nowww === "photographers.ua") {
			return src.replace(/\/thumbnails\/+((?:pictures|users)\/+[0-9]+)\/+[0-9]+x([^/.]*\.[^/.]*)(?:[?#].*)?$/, "/images/$1/$2");
		}
		if (domain_nowww === "copia-di-arte.com" &&
			string_indexof(src, "/kunst/") >= 0) {
			return src.replace(/_lo(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "kino-teatr.ru") return src.replace(/(\/movie\/+kadr\/+[0-9]+\/+)pv_([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "photosight.ru" &&
			domain.match(/^prv-[0-9]{4}-[0-9]+\./)) {
			return src.replace(/:\/\/prv(-.*\/)pv_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "://img$1$2");
		}
		if (domain === "cdn.photosight.ru") {
			newsrc = src.replace(/(\/img\/+[0-9a-f]\/+[0-9a-f]{3}\/+[0-9]+)_(?:thumb|large|mini)(\.[^/.]+)(?:[?#].*)?$/, "$1_xlarge$2");
			match = src.match(/\/img\/+[0-9a-f]\/+[0-9a-f]{3}\/+([0-9]+)(?:_[a-z]+)?\./);
			if (match) {
				return {
					url: newsrc,
					extra: { page: "https://photosight.ru/photos/" + match[1] + "/" }
				};
			} else {
				return newsrc;
			}
		}
		if (domain === "rs.kantie.org") return src.replace(/^[a-z]+:\/\/[^/]*\/it\/(https?:)/, "$1");
		if (domain_nowww === "zmut.com") return src.replace(/\/uploads\/cache\/(pins\/+[0-9]{4}\/+[0-9]{2}\/+[^/]*)-[0-9]+x(\.[^/.]*)(?:[?#].*)?$/, "/uploads/$1$2");
		if (domain_nosub === "2photo.ru" &&
			domain.match(/^i[0-9]*\./)) {
			return src.replace(/(:\/\/[^/]*)\/[a-z]+\/+(.\/+.\/+[0-9]+\.)/, "$1/$2");
		}
		if (domain === "m.salon24.pl") return src.replace(/(:\/\/[^/]*\/[0-9a-f]+)(?:,[0-9]+){4}(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "cdn.fishki.net" ||
			domain === "cdn-tn.fishki.net") {
			return src
				.replace(/(\/upload\/+post\/+[0-9]{6}\/+[0-9]{2}\/+[0-9]+\/+)tn\/+/, "$1")
				.replace(/(\/upload\/+post\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+\/+(?:gallery\/+)?)tn\/+/, "$1")
				.replace(/:\/\/cdn-tn\.([^/]*\/)(?:[0-9]+\/+)?upload\//, "://cdn.$1upload/");
		}
		if (domain_nowww === "ravshaniya.com") return src.replace(/\/uploads\/+photos\/+thumbs\/+[0-9]+\/+/, "/uploads/photos/");
		if (domain_nowww === "onlyhdwallpapers.com" ||
			domain_nowww === "hdwallpapers.cat") {
			var cookie = null;
			var watermark = true;
			if (options.document && options.document.cookie) {
				cookie = options.document.cookie;
				watermark = false;
			}
			return {
				url: src.replace(/(:\/\/[^/]*\/)thumbnail(?:_[a-z]+)?\/+/, "$1wallpaper/"),
				headers: {
					Origin: "https://" + domain,
					Referer: src,
					Cookie: cookie
				},
				problems: {
					watermark: true
				}
			};
		}
		if (domain === "cdn.slushe.com") {
			newsrc = src.replace(/\/thumbs\/+((?:[0-9a-f]\/+){5}[0-9a-f]+\.mp4)\/+[^/]+(?:[?#].*)?$/, "/videos/$1");
			if (newsrc !== src) {
				return newsrc.replace(/:\/\/cdn\./, "://vcdn.");
			}
		}
		if (domain_nowww === "bestpornbabes.com" ||
			domain === "cdn.shesfreaky.com" ||
			domain === "media.ruleporn.com" ||
			domain_nowww === "teenplanet.org" ||
			domain_nowww === "goodsexporn.org" ||
			domain === "cdn.slushe.com" ||
			domain === "media.theync.com" ||
			domain === "media.babesource.com") {
			return src.replace(/(\/+galleries\/+(?:[0-9a-f]+|[0-9a-zA-Z]+)\/+)thumbs\/+(?:[0-9]+x[0-9]+\/+)?/, "$1");
		}
		if (domain === "cdn.brdmedia.com") return src.replace(/(\/galleries\/.*\/)thumbs\/+/, "$1");
		if (domain === "staticpopopics.popopics.com") return src.replace(/\/uploads\/(?:thumb|display)\//, "/uploads/original/");
		if (domain_nowww === "stopga.me") return src.replace(/(\/images\/+(?:uploads\/+images|news)\/+[0-9]+\/+.*\/)normal_([^/]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "foap.com" && domain.match(/^cdn[0-9]*\./)) {
			return src.replace(/(\/images\/+[-0-9a-f]+\/+)[wh][0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		}
		if (domain_nosub === "foap.com" && domain.match(/^images[0-9]*\./)) {
			return src.replace(/:\/\/images[0-9]*(\.foap\.com\/images\/+[-0-9a-f]+\/+)[^/.]*(\.[^/.?#]*)(?:[?#].*)?$/, "://cdn2$1original$2");
		}
		if (domain_nowww === "themepack.me") return src.replace(/\/i\/+c\/+[0-9]+x[0-9]+\/+media\/+/, "/media/");
		if (domain === "static.mycuteasian.com") return src.replace(/\/cache\/+(content\/+pictures\/+.*)\.[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain_nowww === "jiji.com") return src.replace(/(\/v[0-9]*_photos\/.*)_[sm](\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "storage.mantan-web.jp" ||
			domain === "storage.mainichikirei.jp") {
			regex = /(\/[^/]*)_(?:size[0-9]*|thumb[0-9]*)(\.[^/.]*)(?:[?#].*)?$/;
			if (regex.test(src)) {
				return fillobj_urls(replace_sizes(src, [
					src.replace(regex, "$1_size10$2"),
					src.replace(regex, "$1_size9$2"),
					src.replace(regex, "$1_size8$2"),
					src.replace(regex, "$1_size7$2"),
					src.replace(regex, "$1_size6$2")
				]), {
					headers: {
						Accept: '*/*'
					}
				});
			}
		}
		if (domain_nowww === "cinra.net") return src.replace(/(\/uploads\/+img\/+.*)_[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1_full$2");
		if ((domain_nosub === "uecdn.es" && /^e00-[a-z]+\./.test(domain)) ||
			domain === "estaticos.telva.com") {
			return src.replace(/_(?:inc|movil|m|[0-9]+x[0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain === "fs.kinomania.ru") return src.replace(/\/image(\/+file\/.*\/[0-9a-f]+)\.[0-9]+\.[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "notigape.com") return src.replace(/\/thumburl\/+thumbnail\/+[0-9]+x[0-9]+\/+outbound\/+uploads\/+/, "/uploads/");
		if (domain_nowww === "prdelinky.cz") return src.replace(/\/uploaded\/+gallery\/+thumb_/, "/uploaded/gallery/");
		if (domain_nosub === "selfimg.com.cn" &&
			domain.match(/^img[0-9]*\./)) {
			return src
				.replace(/(:\/\/[^/]*\/)gq[0-9]+[^/]*\/+/i, "$1uedgqcms/")
				.replace(/(:\/\/[^/]*\/)vogue[^/]*\//i, "$1uedvoguecms/");
		}
		if (domain === "hp.funrahi.com") return src.replace(/(:\/\/[^/]*\/[0-9]{4}\/+[0-9]{2}\/+[^/]*\/+[^/]*)_(?:t|[0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "img.007shoes.com") return src.replace(/^[a-z]+:\/\/[^/]*\/\?img_url=(https?:)/, "$1");
		if (domain_nowww === "cineol.net") return src.replace(/\/fotos\/+thumb[0-9]+_/, "/fotos/");
		if (domain_nowww === "nosolocine.es") return src.replace(/\/images\/+galeria\/+thumbs\/+/, "/images/galeria/");
		if (domain === "pics.filmaffinity.com") {
			return src
				.replace(/-nm_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "-nm_large$1")
				.replace(/-(?:s[0-9]*|m(?:small|med|tiny)|small|main)(\.[^/.]*)(?:[?#].*)?$/, "-large$1");
		}
		if (domain === "fitsnews.files.wordpress.com") {
			newsrc = src.replace(/\.thumbnail(\.[^/.]*)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "data.okinny.heypo.net") {
			return {
				url: src.replace(/\/image\/+thumb\/+([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "/image/large/$1"),
				headers: {
					Referer: "https://okinny.heypo.net/image/12345"
				}
			};
		}
		if (domain_nosub === "mgstage.com" &&
			domain.match(/^(?:spimg[0-9]*|image)\./)) {
			return src.replace(/(\/[^/_]*_)[^/_]*(_[^/]*)(?:[?#].*)?$/, "$1e$2");
		}
		if (domain_nosub === "gettextbooks.com" &&
			domain.match(/^img[0-9]*\./)) {
			return src.replace(/(\/pi\/+[0-9]+\/+)[-0-9]+\/+[-0-9]+(?:\/+)?(?:[?#].*)?$/, "$1999999999/999999999");
		}
		if ((domain_nosub === "y3600.cn" ||
			domain_nosub === "y3600.cz") && /^img[0-9]*\./.test(domain)) {
			newsrc = src.replace(/\/z(?:resize|crop)?\/+[0-9]+\/+[0-9]+\//, "/zresize/999999999999/999999999999/");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/:\/\/img[0-9]*\.([^/]+\/)z(?:resize|crop)\/+[0-9]+\/+[0-9]+\/+d\/+/, "://img.$1d/");
		}
		if (domain_nowww === "life.tw" ||
			domain === "amazon.life.com.tw") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/proxy\.php\?url=([^&]*).*?$/, "$1");
			if (newsrc !== src) {
				return decodeURIComponent(newsrc);
			}
		}
		if (domain === "public.onlyfans.com") {
			newsrc = src.replace(/\/files\/+thumbs\/+[wc][0-9]+\/+/, "/files/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "thumbs.onlyfans.com") {
			newsrc = src.replace(/:\/\/[^/]+\/+public\/+files\/+thumbs\/+[wc][0-9]+\/+/, "://public.onlyfans.com/files/");
			if (newsrc !== src)
				return newsrc;
		}
		if (host_domain_nosub === "onlyfans.com" &&
			(domain_nosub === "onlyfans.com" ||
				domain === "media.onlyfans.com" ||
				amazon_container === "of2media") && options && options.element && options.do_request && options.cb) {
			var get_appkey = function(cb) {
				return cb(base64_decode("Lj0zM2Q1N2FkZThjMDJkYmM1YTMzM2RiOTlmZjlhZTI2YQ==").substr(2));
			};
			var onlyfans_api_call = function(url, querystring, referer, cb) {
				get_appkey(function(appkey) {
					if (!appkey)
						return cb(null);
					url = urljoin("https://onlyfans.com/api2/v2", url, false);
					if (querystring) {
						url += "?" + querystring + "&app-token=" + appkey;
					} else {
						url += "?app-token=" + appkey;
					}
					options.do_request({
						url: url,
						method: "GET",
						headers: {
							Referer: referer,
							"Sec-Fetch-Site": "same-origin",
							"Accept": "application/json, text/plain, */*"
						},
						onload: function(result) {
							if (result.readyState !== 4)
								return;
							if (result.status !== 200) {
								console_error(result);
								return cb(null);
							}
							try {
								var json = JSON_parse(result.responseText);
								cb(json);
							} catch (e) {
								console_error(e, result);
								cb(null);
							}
						}
					});
				});
			};
			var get_user = function(username, cb) {
				api_cache.fetch("onlyfans_user:" + username, cb, function(done) {
					onlyfans_api_call("/users/" + username, null, "https://onlyfans.com/" + username, function(data) {
						if (data) {
							return done(data, 1 * 60 * 60);
						} else {
							return done(null, false);
						}
					});
				});
			};
			var get_avatar = function(username, cb) {
				get_user(username, function(data) {
					if (data) {
						return cb(data.avatar);
					} else {
						return cb(null);
					}
				});
			};
			var get_avatar_from_a = function(el, cb) {
				var match = el.href.match(/^https?:\/\/[^/]+\/+([^/]+)\/*(?:[?#].*)?$/);
				if (match) {
					get_avatar(match[1], cb);
					return true;
				}
				return false;
			};
			if (options.element.parentElement &&
				(options.element.parentElement.classList.contains("b-avatar") ||
					options.element.parentElement.classList.contains("g-avatar"))) {
				var dparent = options.element.parentElement.parentElement;
				if (dparent.tagName === "A") {
					if (get_avatar_from_a(dparent, options.cb)) {
						return {
							waiting: true
						};
					}
				} else if (dparent.tagName === "DIV" && dparent.classList.contains("b-profile__user")) {
					var link = dparent.querySelector("a.g-user-realname__wrapper");
					if (link && get_avatar_from_a(link, options.cb)) {
						return {
							waiting: true
						};
					}
				}
			}
		}
		if (domain === "img.mfcimg.com") return src.replace(/(\/photos2\/+[0-9]+\/+[0-9]+\/+[-0-9]+)\.[0-9x]+(\.[^/.]*)$/, "$1$2");
		if (domain_nowww === "webnewtype.com") {
			return {
				url: src
					.replace(/(\/media\/+[0-9]+\/+[0-9]+\/+)(?:_?(?:mode|[wh])[0-9]*)+-/, "$1")
					.replace(/(\/rsz\/+S[0-9]*\/+[0-9]+\/+[^/.]*\.[^/.?#]*)(?:\/[wh][0-9]+.*)?(?:[?#].*)?$/, "$1"),
				can_head: false // returns 404
			};
		}
		if (domain === "cdn.themis-media.com") return src.replace(/\/media\/+global\/+images\/+galleries\/+[a-z]+\/+/, "/media/global/images/galleries/full/");
		if (domain === "tn.nozomi.la") {
			newsrc = src.replace(/:\/\/tn\.([^/]*\/[0-9a-f]+\/+[0-9a-f]+\/+[0-9a-f]+)(\.[^/.]*)(?:\.[^/.]*)(?:[?#].*)?$/, "://i.$1$2");
			if (newsrc !== src) {
				return {
					url: newsrc,
					headers: {
						Referer: "https://nozomi.la/"
					}
				};
			}
		}
		if (domain === "pic.baike.soso.com") return src.replace(/(\/baikepic[0-9]*\/+[^/]*\/+[^/]*\/+)[0-9]+(?:[?#].*)?$/, "$10");
		if (domain_nosub === "jpopasia.com" && domain.match(/^i[0-9]*\./)) {
			return add_extensions(src.replace(/(\/(?:assets|news|albums)\/+[0-9]+\/+[^/]*)-t(\.[^/.]*)(?:[?#].*)?$/, "$1$2"));
		}
		if (domain_nowww === "jpgravure.com" ||
			domain_nowww === "tiedvirgins.com" ||
			domain_nowww === "hqjpporn.com" ||
			domain_nowww === "thethaigirls.com") {
			return src.replace(/(\/galleries\/.*\/)tn([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "highasianporn.com") return src.replace(/(\/g\/.*\/)tn([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "asianxxxpics.com" ||
			domain_nowww === "japanfetishpics.com" ||
			domain_nowww === "asianfuckpics.com" ||
			domain_nowww === "asianteenpics.com" ||
			domain_nowww === "nudejapangirls.com" ||
			domain_nowww === "japaneseidols.org" ||
			domain === "promo.spunkyangels.com") {
			return src.replace(/\/tn([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		}
		if (domain_nowww === "vintage-flash.com") {
			return {
				url: src.replace(/(\/vfg\/+[^/]*\/+)tn([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$10$2"),
				headers: {
					Referer: ""
				}
			};
		}
		if (domain_nowww === "1pondo.tv") {
			return src
				.replace(/(\/assets\/+sample\/+[0-9]+_[0-9]+\/+[^/]*)_s(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/assets\/+sample\/+[0-9]+_[0-9]+\/+)thum_[0-9]+(\/+[0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1popu$2");
		}
		if (host_domain_nosub === "javhd.com" && options.element) {
			if (options.element.tagName === "I" && options.element.classList.contains("border")) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
		}
		if (domain_nosub === "javhd.com" ||
			domain_nosub === "pussyav.com" ||
			domain_nosub === "ferame.com" ||
			domain_nosub === "shiofuky.com" ||
			domain_nosub === "av69.tv" ||
			domain_nosub === "lingerieav.com") {
			if (/\/images\/+th2-border\.gif/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			return src.replace(/(\/[0-9]+\/+[0-9]+)t(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "galleries.allgravure.com") return src.replace(/(\/[0-9]+\/+[^/]*\/+[0-9]+)t(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "bravoerotica.com") return src.replace(/(\/[0-9]+)t(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "japanesepussyclub.com" ||
			domain_nowww === "kabukicho-girls.com") {
			return {
				url: src.replace(/(\/+[^/]*\/+)thumbnails\/+([^/]*)_tn(\.[^/.]*)(?:[?#].*)?$/, "$1images/$2$3"),
				headers: {
					Referer: "http://" + domain
				}
			};
		}
		if (domain_nowww === "asianthumbs.org") return src.replace(/(\/gallery\/+.*\/+)tn\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "pics.r18.com" ||
			domain === "pics.dmm.co.jp" ||
			domain === "pics.avdmm.top") {
			newsrc = src.replace(/(\/digital\/+video\/+[0-9a-z_]+[0-9]+\/+[0-9a-z_]+[0-9]+)(-[0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1jp$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/digital\/+video\/+[0-9a-z_]+[0-9]+\/+[0-9a-z_]+[0-9]+p)[ts](\.[^/.]+)(?:[?#].*)?$/, "$1l$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "pics.dmm.com" ||
			domain === "pics.dmm.co.jp") {
			return src.replace(/s(\.[^/.]*)$/, "l$1");
		}
		if (domain === "images.anilos.com" ||
			domain === "images.nubiles.net") {
			return src.replace(/\/tn\/+([^/]*)(?:[?#].*)?$/, "/$1");
		}
		if (domain_nosub === "cre.ma" && domain.match(/^assets[0-9]*\./)) {
			return src.replace(/(\/image[0-9]*\/+)thumbnail_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "cdn.megacountry.livenation.com") return src.replace(/(\/production\/+[^/]*-photo\/+[0-9]+\/+)[a-z]+_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "annangelxxx.com") return src.replace(/(\/tgp\/+[^/]*\/+[0-9]+\/+)thumbnails\/+tn([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1originalimages/$2");
		if (domain_nosub === "coedcherry.com" && /^content[0-9]*\./.test(domain)) {
			return src
				.replace(/\/th[0-9]+x[0-9]+_(w_[0-9A-F]{10,}\.[^/.]+)(?:[?#].*)?$/, "/$1")
				.replace(/\/th[0-9]+x[0-9]+_(?:a_)?([^/]*?)(?:[?#].*)?$/, "/$1");
		}
		if (domain_nowww === "nicsgalleries.com") return src.replace(/(\/g\/.*\/[0-9a-f]+\/+)thumbs\/+thumb_([^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "classypussy.com" ||
			domain_nowww === "onlyhcore.com" ||
			domain_nosub === "skankypussy.com") {
			return src.replace(/\/thumbs\/+thumbs_/, "/");
		}
		if (domain_nowww === "airlinerphotos.com") {
			newsrc = src.replace(/(:\/\/[^/]+\/+gallery\/+[^/]+\/+)thumbs\/+thumbs_/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "hiqqu.xxx" ||
			domain_nowww === "hiqqu.com") {
			return src.replace(/\/files\/+[0-9]+x[0-9]+\/+/, "/files/");
		}
		if (domain === "img.chan4chan.com") {
			return {
				url: src.replace(/(\/img\/+[0-9]{4}-[0-9]{2}-[0-9]{2}\/+)tn_([^/]*)(?:[?#].*)?$/, "$1$2"),
				can_head: false // 404
			};
		}
		if (domain_nowww === "pissblog.com") return src.replace(/(\/img\/+[^/]+\/+)tn([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "haxprofiles.com") return src.replace(/(\/gallery\/+[^/]+\/+)tn([^/]*)_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		if (domain_nowww === "drago99.com") return src.replace(/\/tn([^/]*\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain === "img.indexxx.com") {
			return {
				url: src.replace(/\/images\/+thumbs\/+[0-9]+x[0-9]+\/+/, "/images/"),
				headers: {
					Referer: "https://www.indexxx.com/"
				}
			};
		}
		if (domain_nosub === "ero.today" ||
			domain_nosub === "oldax.com") {
			newsrc = src.replace(/\/p\/+[0-9]+x[0-9]+_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/m$1");
			if (newsrc !== src) {
				return {
					url: newsrc,
					headers: {
						Referer: "http://www." + domain_nosub + "/"
					}
				};
			}
		}
		if (domain_nosub === "dreamercdn.com") return src.replace(/(\/media\/+[0-9]+\/+[0-9]+\/+)[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		if (amazon_container === "images.charitybuzz.com" ||
			domain === "images.charitybuzz.com") {
			return src.replace(/(\/images\/+[0-9]+\/+)[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		}
		if (domain === "media.movieassets.com") return src.replace(/(\/static\/+images\/+.*\/)[0-9]+\/+[0-9]+\/+(?:[^/]*-)?([0-9a-f]{20,}\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (digitalocean_container === "movieassetsdigital") {
			return src.replace(/\/thumb\/+([0-9a-f]{20,})(?:[?#].*)?$/, "/original/$1");
		}
		if (domain_nosub === "happyhair.sk") return src.replace(/\/celebrity_img\/+thumbs[^/]*\/+/, "/celebrity_img/");
		if (domain_nosub === "wn.com" &&
			domain.match(/^e?cdn[0-9]*\./)) {
			return src.replace(/(\/[0-9a-f]{20,}[-_])(?:small|medium|grande)(\.[^/.]*)(?:[?#].*)?$/, "$1large$2");
		}
		if (domain_nowww === "atoananet.com.br") return src.replace(/(\/links\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[^/]*)_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "img.ifcdn.com") {
			regex = /(\/images\/+[0-9a-f]+_)[0-9]+(\.[^/.]*)(?:[?#].*)?$/;
			return [
				src.replace(regex, "$13$2"),
				{
					url: src.replace(regex, "$11$2"),
					problems: {
						watermark: true
					}
				}
			];
		}
		if (domain_nowww === "babeprofiles.com") return src.replace(/(\/media\/+models\/.*\/)[0-9]+x[0-9]+\/+([^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "meetmecdna.com") return src.replace(/\/thumb_userimages(\/+.*\/)thm_/, "/userimages$1");
		if (domain === "images.spicyadulttools.com") return src.replace(/\/images\/+thumb\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/images/full/$1");
		if (domain_nosub === "trafficdeposit.com" &&
			domain.match(/^[sb][0-9]*\./)) {
			var baseobj_7 = {
				url: src,
				extra: {}
			};
			urls = [];
			match = src.match(/^[a-z]+:\/\/[^/]+\/+blog\/+(?:[0-9]+\/+[0-9]+\/+)?(?:vid|img)\/+(?:[0-9a-f]+|porn-collection)\/+([0-9a-f]{10,})\/+[^/]+$/);
			if (match) {
				id = match[1];
				baseobj_7.extra.page = "https://sxyprn.com/post/" + id + ".html";
				urls.push({
					url: baseobj_7.extra.page,
					is_pagelink: true
				});
			}
			newsrc = src.replace(/(\/vid\/+[0-9a-f]+\/+[0-9a-f]+\/+)[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1full$2");
			if (newsrc !== src) {
				urls.push(newsrc);
			}
			urls.push(src);
			return fillobj_urls(urls, baseobj_7);
		}
		if (domain_nosub === "sxyprn.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+post\/+([0-9a-f]{10,})\.html/);
			if (match) {
				id = match[1];
				var get_url_from_sxyprn_vid = function(vid) {
					return "https://sxyprn.com/post/" + vid + ".html";
				};
				var query_sxyprn = function(vid, cb) {
					api_query("sxyprn:" + vid, {
						url: get_url_from_sxyprn_vid(vid)
					}, cb, function(done, resp, cache_key) {
						var match = resp.responseText.match(/data-vnfo='({"[0-9a-f]{10,}":"[^"}]+"})'>/);
						if (!match) {
							console_error(cache_key, "Unable to find match for", resp);
							return done(null, false);
						}
						var json_text = decode_entities(match[1]);
						var json = JSON_parse(json_text);
						if (!(vid in json)) {
							console_warn(cache_key, "Unable to find", vid, "in", json);
							vid = Object.keys(json)[0];
						}
						var get_added_num = function(str) {
							str = str.replace(/[^0-9]/g, "");
							var n = 0;
							for (var i = 0; i < str.length; i++) {
								n += parseInt(str[i]);
							}
							return n;
						};
						var splitted = json[vid].split("/");
						splitted[1] += "8"; // cdn8
						splitted[5] -= parseInt(get_added_num(splitted[6])) + parseInt(get_added_num(splitted[7]));
						var url = urljoin(resp.finalUrl, splitted.join("/"), true);
						return done({
							url: url,
							video: true,
							extra: {
								page: get_url_from_sxyprn_vid(vid)
							},
							headers: {
								Referer: resp.finalUrl
							}
						}, 60 * 60);
					});
				};
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				if (options.do_request && options.cb) {
					query_sxyprn(id, function(data) {
						if (!data)
							return options.cb(page_nullobj);
						return options.cb(data);
					});
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if (host_domain_nosub === "sxyprn.com" && options.element) {
			if (options.element.tagName === "SPAN" && options.element.classList.contains("player_icon")) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "fullporner.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+watch\/+([0-9a-f]{10,})(?:[?#].*)?$/,
				query_for_id: "https://fullporner.com/watch/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<iframe[^>]*src="(\/\/[^/]+\/+videox\/+[0-9a-f]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done({ url: "https:" + match[1], is_pagelink: true }, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "xiaoshenke.net") {
			match = src.match(/\/videox\/+([0-9a-f]{10,})(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://sxyprn.com/post/" + match[1] + ".html",
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "babepedia.com") {
			return src
				.replace(/\/galleries-thumbs\/+/, "/galleries/")
				.replace(/(\/pics\/+[^/]+)_thumb[0-9]*\./, "$1.");
		}
		if (domain_nowww === "yourdailygirls.com" ||
			domain_nowww === "girlsfordays.com" ||
			domain_nowww === "girlznation.com") {
			return src.replace(/(\/galleries\/.*\/[^/]*)-tn(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "static.ftvgirls.com" ||
			domain === "static.ftvmilfs.com" ||
			domain === "promo.ftvgirls.com") {
			return src
				.replace(/(\/galleries\/.*\/[0-9]+)-thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/\/thumbnails\/+[0-9]+x[0-9]+_/, "/pictures/content_");
		}
		if (domain_nosub === "femjoy.com" && /^n[0-9]*\./.test(domain)) {
			return src.replace(/(\/free\/+[^/]+\/+)thumbs\/+([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1pics/$2");
		}
		if (domain_nowww === "candidsplash.com") return src.replace(/(\/candid-galleries-[0-9]+\/+[^/]+\/+)thumbs\/+([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1pics/$2");
		if (domain === "image.istyle24.com") return src.replace(/(\/upload\/+ProductImage\/+[0-9]+\/+[0-9]+\/+[0-9]+_(?:[0-9]+_)?)[a-zA-Z]+(\.[^/.]*)(?:[?#].*)?$/, "$1L$2");
		if (domain === "zine.istyle24.com") {
			if (/\/App_Themes\/.*\/images\/+common\//.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src.replace(/(\/FileUpload\/+Content\/+[0-9]{10,})_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "bbstar.kr") return src.replace(/(\/model\/+[^/]*[0-9]+)s(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "asn.im" && domain.match(/^i[0-9]*\./)) {
			return src.replace(/(:\/\/[^/]*\/[^/]*)-[a-z](\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "bebzol.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/thumbs.*?[?&]i=([^&]*).*?$/, "$1");
			if (newsrc !== src) {
				return urljoin(src, "/" + decodeURIComponent(newsrc), true);
			}
		}
		if (domain_nowww === "thecandidforum.com") return src.replace(/(\/attachments\/+[0-9a-f]+)t(-[^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "hottystop.com" ||
			domain === "d3m3u5a3.ssl.hwcdn.net" ||
			domain_nowww === "nextdoortease.com" ||
			domain_nowww === "foxhq.com" ||
			domain_nosub === "bunnylust.com" ||
			domain === "f2h3f6e6.ssl.hwcdn.net" ||
			domain === "a2w8r2x2.ssl.hwcdn.net") {
			newsrc = src.replace(/\/smallimage([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "img.highviral.news") return src.replace(/(:\/\/[^/]*\/)[0-9]+x[0-9]+\/+([0-9]+_[0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "mondrian.mashable.com") {
			newsrc = src.replace(/(:\/\/[^/]*\/[^/?]*%252F[^/?]*)\?.*$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(decodeURIComponent(newsrc));
			newsrc = src.replace(/:\/\/[^/]*\/(wp-content\/+.*?\/[^/]*\.[^/.]*)\/[^/]*\.[^/.]*(?:[?#].*)?$/, "://admin.mashable.com/$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "helios-i.mashable.com") return src.replace(/(\/imagery\/+[^/]+\/+[^/]+\/+[^/.]+\.)(?:(?:fill|(?:size_|v)[^/.?#]+)\.)*/, "$1");
		if (domain === "image.wisetrail.com" ||
			amazon_container === "image.wisetrail.com") {
			return src.replace(/(\/bookmark[0-9]+\/+[^/]*)_small(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "internationallovescout.com") {
			return src
				.replace(/(\/entries\/+[0-9]+\/+)thumb_/, "$1")
				.replace(/(\/images\/+uploads\/.*)-[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain.match(/^images\.locanto\./)) {
			return src.replace(/(:\/\/[^/]*\/[^/]*\/+)[a-z]+_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "dailytravelphotos.com") return src.replace(/(\/images\/+[0-9]+)t(\/[^/]*)_th(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "galleries.grooby.com") return src.replace(/\/tn-([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if ((domain_nosub === "adult-empire.com" ||
			domain_nosub === "gigapron.com" ||
			domain_nosub === "bulkjerk.com" ||
			domain_nosub === "cozyxxx.com") &&
			domain.match(/^pbs(?:-[0-9]+)?\./)) {
			newsrc = src
				.replace(/\/tns\/+tn([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1")
				.replace(/\/thumb\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/pics/$1")
				.replace(/\/pic\/+t(?:n[0-9]*\/+)?([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/pic/$1")
				.replace(/\/(?:thumbnails|tm)\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1")
				.replace(/\/thumbs\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/pics/$1")
				.replace(/\/t\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/p/$1")
				.replace(/\/tumb\/+tumb([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/pics/$1")
				.replace(/\/pics\/+thumbs\/+p([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/pics/p$1")
				.replace(/(\/[0-9]+)xxx(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/\/th\/+thumbnails\/+tn([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1")
				.replace(/(\/[0-9]+)_resize(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/\/tn(chicksandbeasts\.com-[0-9]+\.[^/.]*)(?:[?#].*)?$/, "/www.$1")
				.replace(/\/th([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1")
				.replace(/(\/[0-9]+)a(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/\/thumbs\/+thumb([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/pics/pic$1")
				.replace(/(\/[0-9]+\/+[0-9]+\/+p[0-9]+\/+)tn_([^/]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/[0-9]+\/+[0-9]+\/+)thumbnails\/+tn([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1images/$2")
				.replace(/(\/[0-9]+\/+[0-9]+\/+cg_[0-9]+_[0-9]+\/+)thumbs\/+tn_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(:\/\/[^/]*\/[^/]*\/+[^/]*\/+[^/]*\/+)tn([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(:\/\/[^/]*\/+[0-9]{3}\/+[0-9]+\/+[0-9]+\/+)t([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1i$2");
			if (newsrc !== src)
				return newsrc;
			regex = /\/thumbnails\/+tn([0-9]+\.[^/.]*)(?:[?#].*)?$/;
			if (src.match(regex)) {
				return [
					src.replace(regex, "/images/$1"),
					src.replace(regex, "/$1")
				];
			}
		}
		if (domain_nowww === "exl.io") return src.replace(/(\/[0-9a-f]{20,}\/+)tmd([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "idols69.net") return src.replace(/(\/pictures\/+[^/]*\/+)t([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "fhg.mycuteasian.com" ||
			domain === "fhg.avidolz.com") {
			return src.replace(/(\/picture\/+[^/._]*_)t([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "teenfilipina.net") {
			return src
				.replace(/\/thumbs\//, "/")
				.replace(/(-[0-9]+)thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "rexxx.co") return src.replace(/(:\/\/[^/]*\/[0-9]+\/[0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "$1f$2");
		if (domain_nosub === "mobile9.com") return src.replace(/\/download\/+thumb\/+([0-9]+)\/+[0-9]+\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "/download/media/$1/$2");
		if (domain === "s.fap5.com" ||
			domain === "s.mycosplayclub.com") {
			return src.replace(/(\/[0-9a-f]{15,}\/+)thumbs\/+([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "coolspotters.com") return src.replace(/(\/files\/+photos\/+[0-9]+\/+[^/]*)-(?:small|large|medium|micro|popover|gallery)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "celebsdump.com" ||
			domain_nowww === "nakedcelebs.top") {
			regex = /(\/posts\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]+\/+)(?:thumbs|featured|images)\/+/;
			return [
				src.replace(regex, "$1originals/"),
				src.replace(regex, "$1images/")
			];
		}
		if (domain === "photos.laineygossip.com") return src.replace(/\/thumbs\/+tmb_[0-9]+x[0-9]+_/, "/articles/");
		if (domain_nowww === "laineygossip.com") {
			return urljoin(src, src
				.replace(/^[a-z]+:\/\/[^/]*\/Thumbnail\.axd.*?[?&]p=([^&]*).*?$/, "$1")
				.replace(/[+]/g, "%20"), true);
		}
		if (domain === "images.successstory.com") return src.replace(/(\/img_[a-z]+\/+[^/]*\/+)[0-9]+X[0-9]+\/+/, "$1");
		if (domain_nosub === "flixster.com" &&
			domain.match(/^content[0-9]*\./)) {
			return src
				.replace(/(\/(?:poll|question)\/+(?:[0-9]+\/+){1,3}[0-9]+_)tmb(\.[^/.]*)(?:[?#].*)?$/, "$1std$2")
				.replace(/(\/(?:photo|(?:rt)?movie|rtactor|editorial|site|tv|quiz|critic|personality)\/+(?:[0-9]+\/+){1,3}[0-9]+_)(?:[a-z]+|[0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "$1ori$2");
		}
		if (domain === "resizing.flixster.com") {
			var match = src.match(/^[a-z]+:\/\/resizing\.flixster\.com\/.*\/v1\.([^-_/?#.]+)(?:[?#].*)?$/);
			if (match) {
				try {
					var decoded = base64_decode(match[1]);
					var newmatch = decoded.match(/^(?:.*?;)?([chmprst]);([0-9]+)/);
					if (newmatch) {
						var cat = newmatch[1];
						var id = newmatch[2];
						var folder = "";
						var cats = {
							"m": "movie",
							"p": "photo",
							"h": "rtmovie",
							"r": "rtactor",
							"c": "critic",
							"s": "site",
							"t": "tv"
						};
						folder = cats[cat];
						var base_1 = "https://content9.flixster.com/" + folder + "/" + id.slice(0, 2);
						if (id.length > 4) {
							base_1 += "/" + id.slice(2, 4);
						}
						if (id.length > 6) {
							base_1 += "/" + id.slice(4, 6);
						}
						return base_1 + "/" + id + "_ori.jpg";
					}
				} catch (e) {
					console_error(e);
				}
			}
		}
		if (domain_nosub === "tmsimg.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+(https?:\/\/)/, "$1");
			if (newsrc !== src)
				return newsrc;
			if (false) {
				var urls = [];
				match = src.match(/^([a-z]+:\/\/[^/]+\/+assets\/+p[0-9]+_[a-z]_[vh])([0-9]+)(_.*)$/);
				if (match) {
					var num_1 = parseInt(match[2]);
					for (var i_7 = num_1 + 1; i_7 <= 12; i_7++) {
						if (i_7 === 9)
							continue;
						urls.push(match[1] + i_7 + match[3]);
					}
					if (urls.length)
						return urls;
				}
			}
		}
		if (host_domain_nowww === "rottentomatoes.com" && options.element && domain === "resizing.flixster.com") {
			var get_thumborid_for_flixster = function(url) {
				if (url.match(/^v1\.[^/?#.]+$/)) {
					return url;
				}
				var match = url.match(/^[a-z]+:\/\/resizing\.flixster\.com\/.*\/(v1\.[^/?#]+)(?:[?#].*)?$/);
				if (!match)
					return null;
				return match[1];
			};
			var get_pictures_json = function() {
				var pictures_json = document.getElementById("pictures-json");
				if (!pictures_json)
					return null;
				try {
					var json = JSON_parse(pictures_json.innerHTML);
					return parse_pictures_json(json);
				} catch (e) {
					console_error(e);
					return null;
				}
			};
			var parse_pictures_json = function(json) {
				var images = [];
				for (var i = 0; i < json.length; i++) {
					var image = {};
					image.full = json[i].srcFull;
					image.id = get_thumborid_for_flixster(image.full);
					image.caption = json[i].caption || null;
					images.push(image);
				}
				return images;
			};
			var get_imagesjson = function() {
				var scripts = document.getElementsByTagName("script");
				for (var i = 0; i < scripts.length; i++) {
					var script_text = scripts[i].innerHTML;
					var match = script_text.match(/root\.RottenTomatoes\.context\.imagesJson\s*=\s*(\[.*?]);/);
					if (!match) {
						continue;
					}
					try {
						var json = JSON_parse(match[1]);
						return parse_imagesjson(json);
					} catch (e) {
						console_error(e);
						return null;
					}
				}
				return null;
			};
			var parse_imagesjson = function(json) {
				var images = [];
				for (var i = 0; i < json.length; i++) {
					var image = {};
					image.id = json[i].thumborId;
					image.full = json[i].urls.fullscreen;
					image.caption = json[i].caption || json[i].alt || null;
					images.push(image);
				}
				return images;
			};
			var get_full_flixster = function(url) {
				var id = get_thumborid_for_flixster(url);
				var cache_key = "flixster:" + id;
				if (api_cache.has(cache_key)) {
					return api_cache.get(cache_key);
				}
				var imagesjson = get_imagesjson();
				if (!imagesjson) {
					imagesjson = get_pictures_json();
				}
				if (!imagesjson) {
					return null;
				}
				for (var i = 0; i < imagesjson.length; i++) {
					api_cache.set("flixster:" + imagesjson[i].id, imagesjson[i], 24 * 60 * 60);
				}
				return api_cache.get(cache_key);
			};
			var full_picture = get_full_flixster(src);
			if (full_picture) {
				return {
					url: full_picture.full,
					extra: {
						caption: full_picture.caption
					}
				};
			}
		}
		if (amazon_container === "focusmicrosites") {
			return src.replace(/(\/assets\/+uploads\/+)_tmp\/+([^/]*)-[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		}
		if (domain === "i.digiguide.tv") return src.replace(/(\/p\/+[0-9]+\/+)tn-/, "$1");
		if (domain_nowww === "azquotes.com") return src.replace(/(\/public\/+pictures\/+.*\/)c_([0-9a-f]+[^/]*)_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		if (domain_nowww === "newsarama.com" ||
			domain === "i.newsarama.com") {
			return src.replace(/(\/images\/+i\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+)i[0-9]+\/+/, "$1original/");
		}
		if (domain_nowww === "moly.hu") {
			newsrc = src.replace(/(\/system\/+authors\/+[0-9]+\/+image_)[a-z]+\./, "$1original.");
			if (newsrc !== src)
				return newsrc;
			regex = /(\/system\/+[^/]*\/+)[a-z]+(\/+[a-z]+_[0-9]+\.)/;
			newsrc = src.replace(regex, "$1original$2");
			if (newsrc !== src)
				return [newsrc, src.replace(regex, "$1big$2")];
		}
		if (domain_nowww === "arasale.com") return src.replace(/(\/photo[0-9]*\/.*)_small[0-9]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "imgth.com") return src.replace(/\/thumbs\/+/, "/images/");
		if (domain_nowww === "about.me") return src.replace(/^[a-z]+:\/\/[^/]+\/+cdn-cgi\/+image\/+[^/]+\/+(https?:\/\/)/, "$1");
		if (domain_nowww === "intimatecelebs.com") return src.replace(/(\.[^/.]*)\.icthumb\.[^/.]*(?:[?#].*)?$/, "$1");
		if (domain_nowww === "celebriot.com") return src.replace(/(\.[^/.]*)\.thumb_[0-9]+x[0-9]+\.[^/.]*(?:[?#].*)?$/, "$1");
		if (domain_nosub === "paheal.net" && options.do_request && options.cb) {
			newsrc = src.replace(/(:\/\/[^/]*\/+)_thumbs\//, "$1_images/");
			if (string_indexof(src, "/_thumbs/") >= 0 && newsrc !== src) {
				common_functions["get_file_signature"](api_cache, options, newsrc, function(sig) {
					if (!sig) {
						return options.cb(newsrc);
					}
					var newfilename = newsrc.replace(/(\/[0-9a-f]{10,}\/+[^/]*?)(?:[.?#].*)?$/, "$1." + sig);
					if (sig === "mp4" || sig === "webm") {
						return options.cb({
							url: newfilename,
							video: true
						});
					} else {
						return options.cb(newfilename);
					}
				});
				return {
					waiting: true
				};
			}
		}
		if (domain_nowww === "rule34hentai.net") {
			return {
				url: src.replace(/(:\/\/[^/]*\/)_thumbs\//, "$1_images/"),
				head_wrong_contenttype: true,
				can_head: false
			};
		}
		if (domain_nosub === "lovethispic.com") return src.replace(/\/uploaded_images\/+thumbs\/+/, "/uploaded_images/");
		if (domain_nowww === "zwz.cz" &&
			options && options.do_request && options.cb) {
			id = src.replace(/^[a-z]+:\/\/[^/]*\/o[^/]*\.zwz\/+([A-Z0-9]+)\.[^/.]*(?:[?#].*)?$/, "$1");
			if (id !== src) {
				options.do_request({
					url: "http://zwz.cz/f/" + id,
					method: "GET",
					headers: {
						Referer: "http://zwz.cz/",
						Cookie: "agree=yes"
					},
					onload: function(result) {
						if (result.readyState === 4) {
							if (result.status !== 200) {
								console_log(result);
								options.cb(null);
								return;
							}
							var match = result.responseText.match(/<img *id=['"]?pic["']? *class[^>]*?src=["']([^'"]*)['"]/);
							if (match) {
								options.cb({
									url: urljoin(src, match[1], true),
									headers: {
										Referer: "http://zwz.cz/",
										Cookie: "agree=yes"
									}
								});
							} else {
								options.cb(null);
							}
						}
					}
				});
				return {
					waiting: true
				};
			}
		}
		if (domain_nowww === "hockeygods.com") return src.replace(/(\/system\/+gallery_images\/+[0-9]+\/+)[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		if (domain === "galleries.cosmid.net") return src.replace(/(:\/\/[^/]*\/[0-9]+)\/+thumbs\/+/, "$1/");
		if (domain_nowww === "porn-star.com" ||
			(domain_nosub === "ptclassic.com" && /^galleries[0-9]*\./.test(domain))) {
			newsrc = src.replace(/\/thumbs\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "suburbanamateurs.com") {
			return {
				url: src.replace(/(\/galleries\/+[^/]*\/+)thumbs\/+/, "$1highres/"),
				headers: {
					Referer: "http://www.suburbanamateurs.com/"
				}
			};
		}
		if (domain === "video.soloteengirls.net") return src.replace(/\/materials\/+thumbs\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/materials/$1");
		if (domain_nosub === "fantasti.cc" &&
			domain.match(/^cdn(?:-[a-z]+)?\./)) {
			return src.replace(/\/thumb\/+([^/]*)(?:[?#].*)?$/, "/$1");
		}
		if (domain === "images.larepubliquedespyrenees.fr") return src.replace(/(\/[0-9a-f]{20,}\/+)golden\/+[0-9]+x[0-9]+\/+/, "$1");
		if (domain === "img.aws.la-croix.com") return src.replace(/_[0-9]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain === "i.la-croix.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+.*?(\/[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]{5,}\/+.*)/, "https://img.aws.la-croix.com$1");
		if (domain_nowww === "getty.edu") return src.replace(/\/media\/+images\/+web\/+[^/]*\/+/, "/media/images/web/download/");
		if (domain_nosub === "yelpcdn.com") return src.replace(/(\/b?photo\/+[^/]*\/+)(?:[0-9]+s|[a-z]+)(\.[^/.]*)(?:[?#].*)?$/, "$1o$2");
		if (domain_nosub === "rtbf.be" &&
			domain.match(/^(?:[^/]*\.)?static\./)) {
			return src
				.replace(/\/article\/+image\/+[0-9]+x[0-9]+\/+/, "/article/image/original/")
				.replace(/(\/pictureGallery\/+album\/+[0-9]+\/+)(?:thumb|big)\/+/, "$1");
		}
		if (domain === "d5xydlzdo08s0.cloudfront.net") return src.replace(/(\/media\/+[^/]*\/+[0-9]+\/+(?:[^/]*\/)?[^/]*)(?:__[A-Z]|_[0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "photos.geni.com") return src.replace(/_[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "_original$1");
		if (domain === "cdn.hipwallpaper.com") return src.replace(/(:\/\/[^/]*\/)m\/+/, "$1i/");
		if (domain === "photos.bandsintown.com" ||
			amazon_container === "bit-photos") {
			return src.replace(/\/thumb\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/large/$1");
		}
		if (domain === "d1dojdv0rym6r6.cloudfront.net") return src.replace(/\/imgs\/+[a-z]+\/+([0-9]+_pic[0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "/imgs/large/$1");
		if (domain_nowww === "mynetsit.ir") return src.replace(/(:\/\/[^/]*\/).*?[?&]dt=([^/&]*).*?$/, "$1?di=$2");
		if (domain === "cf.kizlarsoruyor.com" ||
			domain === "cf.girlsaskguys.com") {
			return src.replace(/(\/[a-z][0-9]+\/+[0-9a-f]+-[-0-9a-f]+)-m(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "static.framar.bg") return src.replace(/\/thumbs\/+[0-9]+\/+lifestyle\/+/, "/snimki/lstyle/");
		if (domain === "life.tert.am" ||
			domain_nowww === "tert.am" ||
			domain_nowww === "xochuanime.online") {
			return add_full_extensions(src.replace(/(:\/\/[^/]*\/)(?:[^/]*\/+)?cache_image\/+(.*)[-_][0-9]+x[0-9]+(?:_[0-9]+[a-z]*)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3"));
		}
		if (domain_nowww === "woman.at") {
			return src
				.replace(/\/storage\/+[^/]*\/+file\/+/, "/storage/master/file/") // this doesn't seem to do any difference
				.replace(/(\/file\/+[0-9]+\/+)download\/+/, "$1"); // removes force-downloading
		}
		if (domain === "files.elfann.com") return src.replace(/\/imagine\/+pictures_[0-9]+(?:_[0-9]+)?\/+/, "/pictures/");
		if (domain === "cdn.axar.az") return src.replace(/(:\/\/[^/]*\/[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+)[0-9]+\/+([^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "media.milovana.com") return src.replace(/(\/timg\/+(?:[0-9]+\/+[0-9]+\/+)?)tb_[a-z]+\/+/, "$1tb_l/");
		if (domain === "uploads.spiritfanfiction.com") return src.replace(/\/fanfics\/+thumbs\/+/, "/fanfics/historias/");
		if (domain === "pic.homepornbay.com") return src.replace(/(\/[0-9]+)s(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "cdn.funpic.us") return src.replace(/(-[0-9]+)-[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "themanwiththehat.de") return src.replace(/\/files\/+attachments\/+[0-9]+\/+/, "/files/attachments/");
		if (domain_nosub === "motorsport.com" &&
			domain.match(/^cdn(?:-[0-9]*)?\./)) {
			return src.replace(/(\/images\/+[^/]*\/+[^/]*\/+)s[5897]\/+/, "$1s10/");
		}
		if (domain_nowww === "epicwallpapers.com" ||
			domain_nowww === "freshwallpapers.net" ||
			domain_nowww === "alliswall.com") {
			return src
				.replace(/\/imagecache\/+thumbnails\/+([0-9]+)\/+[0-9]+x[0-9]+\.[^/.]*(?:[?#].*)?$/, "/file/$1/0x0/crop/")
				.replace(/(\/file\/+[0-9]+)\/+[0-9]+x[0-9]+\/+(?:crop|[0-9]+:[0-9]+)\/+/, "$1/0x0/crop/");
		}
		if (domain === "kookbang.dema.mil.kr") return src.replace(/(\/upload\/+[0-9]{8}\/+)thumb[0-9]*\/+/, "$1");
		if (domain === "dyaaf063c1cms.cloudfront.net") return src.replace(/(:\/\/[^/]*\/[0-9a-f]+\/)(?:sq[0-9]+|medium)_/, "$1large_");
		if (domain_nowww === "specialfruit.com" ||
			domain_nowww === "studio100.com" ||
			(domain_nosub === "schellywood.be" && /^images-[0-9]*\./.test(domain))) {
			return src
				.replace(/\/thumbnail\/+product[^/]*\/+/, "/thumbnail/productFull/")
				.replace(/\/thumbnail\/+(?:inline|character|book-image|gallery|poster|badge|hero-slider-[a-z]+|thumbnail|(?:visual|eyecatcher|square|tile)-[^/]+)\/+/, "/thumbnail/full/");
		}
		if (domain === "static.planetminecraft.com") {
			return src
				.replace(/(\/files\/+image\/.*)_[sml](\.[^/.]+)(?:[?#].*)?$/, "$1_xl$2")
				.replace(/(\/files\/.*_[0-9]+)_[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "games.renpy.org") return src.replace(/\/media\/+screenshot\/+small\/+/, "/media/screenshot/");
		if (domain_nowww === "700016.xyz") return src.replace(/(\/files\/.*)_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "mytinyphone.com") return src.replace(/(\/uploads\/.*\/)sm[0-9]*\/([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "wallcoo.net") return src.replace(/\/s\/+([^/]*_[0-9]+)s(\.[^/.]*)(?:[?#].*)?$/, "/images/$1$2");
		if (domain_nowww === "absfreepic.com") return src.replace(/\/[a-z]+_photos\/+([^/]*)(?:[?#].*)?$/, "/original_photos/$1");
		if (domain_nowww === "gif-favicon.com") return src.replace(/\/images\/+download\.php.*?[?&]image=([^&]*).*?$/, "/images/$1");
		if (domain_nowww === "ametart.com") return src.replace(/\/thumbs\/+([0-9]+\/+[0-9]+\/+)[0-9]+x_([^/]*)(?:[?#].*)?$/, "/photos/$1$2");
		if (domain_nowww === "nicepornphotos.com" ||
			domain_nowww === "suzisporn.com" ||
			domain_nowww === "youngporno.com" ||
			domain_nowww === "hoodtube.com" ||
			domain_nosub === "swapsmut.com" ||
			domain_nosub === "asianpornmovies.com") {
			return src.replace(/(\/galleries\/+[0-9]+\/+[0-9]+\/+[0-9a-f]{10,})-t(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "hostave2.net") return src.replace(/(\/photo\/+[^/]*\/+[^/]*\/+)th\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "i.penisbot.com") return src.replace(/\/tmb_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "erowall.com") {
			newsrc = src
				.replace(/\/download_img\.php.*?[?&]dimg=([0-9]+).*?$/, "/wallpapers/original/$1.jpg")
				.replace(/\/wallpapers\/+[a-z]+\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/wallpapers/original/$1");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/wallpapers\/+[a-z]+\/+([0-9]+)\.[^/.]+(?:[?#].*)?$/);
			if (match)
				return {
					url: src,
					extra: {
						page: "https://erowall.com/w/" + match[1]
					}
				};
		}
		if (domain === "promo.mattsmodels.com" ||
			domain_nowww === "nextdoortease.com" ||
			domain_nowww === "amateurindex.com") {
			return src.replace(/(\/galleries\/+[^/]*\/+[^/]*\/+)thumbs\/+/, "$1");
		}
		if (domain === "ww3.aziani.com" ||
			domain_nowww === "clubglamour.net") {
			return src.replace(/(\/galleries\/+[^/]+\/+)thumbs\/+/, "$1");
		}
		if (domain === "galleries.allover30.com") {
			return src
				.replace(/(\/[^/]+-[0-9]+\/+[^/]+[0-9]+)-thumb(\.[^/.]+)(?:[?#].*)?$/, "$1$2")
				.replace(/\/Z[0-9]+\/+([^/]*)(?:[?#].*)?$/, "/$1");
		}
		if (domain === "images.sxx.com" ||
			domain === "images.blazingmovies.com") {
			return src.replace(/\/thumbs\/+([^/]*)_tb(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		}
		if (domain === "ww2.aziani.com") return src.replace(/\/t_([^/]*-[0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain === "fhg.karupsow.com" ||
			domain === "fhg.karupsha.com") {
			return src.replace(/\/images\/+thumbs(-[^/]*\/)/, "/images/pics$1");
		}
		if (domain_nowww === "stockingvideos.com") return src.replace(/\/images\/thumbs\/thumb([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/images/full/full$1");
		if (domain === "media.virbcdn.com") return src.replace(/\/cdn_images\/+resize_[0-9]+x[0-9]+\/+/, "/images/");
		if (domain === "images.yuku.com") return src.replace(/(\/image\/+[^/]*\/+[0-9a-f]+(?:\.[0-9]+)?)_[^/.]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (host_domain_nosub === "kpopping.com" && domain_nowww === "kpopping.com" && options.element) {
			if (/\/uploads\/+documents\//.test(src)) {
				if (options.element.tagName === "IMG" && options.element.classList.contains("img-fluid")) {
					if (options.element.parentElement.tagName === "A" && options.element.parentElement.href && /\/uploads\/+documents\//.test(options.element.parentElement.href)) {
						return options.element.parentElement.href;
					}
				}
			}
		}
		if (domain_nowww === "kpopping.com") {
			if (/\/bundles\/+app\/+img\//.test(src))
				return {
					url: src,
					bad: "mask"
				};
			/*
			  seems like they changed something, again.
			  every time i update this script, it seems like a few days later, something changes in the way their site works, breaking the fix i did for this site.
			  they're aware of this script (they linked to it at one point), so it could very well be intentional on their part.
			*/
			if (false) {
				return src
					.replace(/\/uploads\/+documents\/+[^/]+\/+(?:[0-9]*x){0,2}([^/]+?)(?:,[0-9]+){0,}(\.[^/]+?)(?:\.(?:keep|crop)\..*)?(?:[?#].*)?$/, "/uploads/documents/$1$2");
			}
			return src
				.replace(/\/uploads\/+documents\/+[^/]+\/+(?:[0-9]*x){0,2}([^/]+?)(\.[^/]+?)(?:\.(?:keep|crop)\..*)?(?:[?#].*)?$/, "/uploads/documents/$1$2");
		}
		if (domain_nosub === "tin247.com" &&
			domain.match(/^image[0-9]*\./)) {
			return src.replace(/\/picsmall\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+)[0-9]+\/+/, "/$1");
		}
		if (domain === "assets.blogr.xxx" ||
			domain === "assets-old.blogr.xxx") {
			return src.replace(/\/posts\/+[^/]*\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+)/, "/posts/large/$1");
		}
		if (domain_nowww === "internationalcelebrityfeet.com") return src.replace(/\/thumbs\/([^/]*)thumb(\.[^/.]*)(?:[?#].*)?$/, "/pics/$1$2");
		if (domain === "content.gulte.com") return src.replace(/(\/content\/+[0-9]{4}\/+[0-9]{2}\/+photos\/+events\/+[^/]*\/+)thumb\/+([^/]*)(?:[?#].*)?$/, "$1normal/$2");
		if (domain_nowww === "moda.ru") return src.replace(/(\/files\/+user\/+(?:[0-9]{2}\/+){3}content\/+[0-9]+\/+)[0-9]+x[0-9]+x[0-9]+_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "sodonsolution.org" &&
			domain.match(/^resource[0-9]*\./)) {
			return src.replace(/(\/images\/[0-9]{4}\/+[0-9]+\/+[0-9a-f]+\/+[0-9a-z]+)_[a-z](\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "youmediafanpage.akamaized.net") return src.replace(/(\/gallery\/+[0-9a-f]+_[0-9a-f]+_)p[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1o$2");
		if (domain_nosub === "hayatapp.com" &&
			domain.match(/^cdn-media-[0-9]+\./)) {
			return src.replace(/(\/uploads\/+backend_wysiwyg_asset\/+asset\/+)[a-z]+_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "static.klix.ba") {
			newsrc = src.replace(/(\/media\/+images\/+vijesti\/+)m[0-9]+_([0-9]{8,}\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc != src)
				return newsrc;
			regex = /(\/media\/+images\/+vijesti\/+[0-9]+\.[0-9]+)(\.[^/.]+)(?:[?#].*)?$/;
			if (regex.test(src)) {
				return [
					src.replace(regex, "$1_xl$2"),
					src.replace(regex, "$1_mn$2")
				];
			}
			regex = /(\/media\/+images\/+vijesti\/+[0-9]+\.[0-9]+_)[a-z]+(\.[^/.]+)(?:[?#].*)?$/;
			if (options.do_request && options.cb && regex.test(src)) {
				var images = [];
				array_foreach(["mn", "xxl", "xl"], function(size) {
					images.push(src.replace(regex, "$1" + size + "$2"));
				});
				common_functions["find_actual_largest_image"](src, images, options.cb, {
					check_length: true,
					api_cache: api_cache,
					do_request: options.do_request
				});
				return {
					waiting: true
				};
			}
			return src.replace(/(\/media\/+images\/+[^/]+\/+)(?:s[0-9]+|b)_([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (host_domain_nowww === "klix.ba" && options.element) {
			if (!src && options.element.tagName === "DIV" && options.element.classList.contains("galleria-thumbnails-container")) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
		}
		if (domain === "img.nga.178.com") {
			return {
				url: src.replace(/(\/attachments\/+[^/]*_[0-9]{6}\/+[0-9]+\/+[^/]*)\.(?:thumb|medium)(?:_[a-z])?\.[^/.]*(?:[?#].*)?$/, "$1"),
				headers: {
					Referer: null
				},
				referer_ok: {
					same_domain_nosub: true
				}
			};
		}
		if (domain_nowww === "livesport.ru" ||
			domain === "cdn.livesport.ru") {
			return src.replace(/\/picture--[0-9]+(\.[^/.]*)(?:[?#].*)$/, "/picture$1");
		}
		if (domain_nowww === "vseprosport.ru") return src.replace(/(\/images\/+uploads[0-9]+\/+)thumbs\/+[0-9]+x[0-9]+\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "evrimagaci.org") return src.replace(/\/public\/+content_media\/+[0-9]+\/+/, "/public/content_media/");
		if (domain_nowww === "jagranimages.com") return src.replace(/(\/images\/+[0-9]{2}_[0-9]{2}_[0-9]{4}-[^-/_]+)_[a-z](\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "cdn.doctailieu.com") return src.replace(/(\/images\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[^/]*)-rs[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "cdn-redfin.com") return src.replace(/(\/photo\/+[0-9]+\/+)[^/]*\/+([0-9]+\/+)[^/.]*\.((?:[0-9A-Z]+-)?[0-9A-Z]+_[0-9A-Z]+(?:_[0-9A-Z]+)?\.[^/.]*)(?:[?#].*)?$/, "$1bigphoto/$2$3");
		if (domain === "images.estately.net") return src.replace(/_[0-9]+x[0-9]+[a-z]?(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain_nowww === "mjolbybillack.se") return src.replace(/\/img\/+media\/+[sl]_/, "/img/media/");
		if (domain_nowww === "mathworks.com") return src.replace(/\/responsive_image\/+(?:[0-9]+\/+){5}cache\/+/, "/");
		if (domain === "images.kz.prom.st") return src.replace(/(:\/\/[^/]*\/[0-9]+)(?:_[wh][0-9]+){1,}(_[^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "treesale.sccd.org") {
			newsrc = urljoin(src, src.replace(/^[a-z]+:\/\/[^/]*\/thumbnail\.asp.*?[?&]file=([^&]*).*?$/, "$1"), true);
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/assets\/+images\/+[^/]+)_thumbnail(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "zive.cz") return src.replace(/\/GetThumbNail\.aspx.*?[?&](id_file=[0-9]+).*?$/, "/GetFile.aspx?$1");
		if (domain === "hasbrouck.asu.edu") {
			regex = /(\/imglib\/+.*)_[a-z]+(\.[^/.]*)(?:[?#].*)?$/;
			return [
				src.replace(regex, "$1_lg$2"),
				src.replace(regex, "$1_web$2")
			];
		}
		if (domain_nowww === "parsstock.ir") {
			return {
				url: src.replace(/(:\/\/[^/]*\/)thumbs\/+([0-9]+\/)/, "$1photos/$2"),
				problems: {
					watermark: true
				}
			};
		}
		if (domain === "img.pixers.pics") {
			return src
				.replace(/:\/\/[^/]*\/pho_wat[(]s3:([^,)]*).*/, "://s3.pixers.pics/pixers/$1")
				.replace(/:\/\/[^/]*\/pho_wat[(]cms:([^,)]*).*/, "://s3.pixers.pics/cms/$1");
		}
		if (domain === "d7hftxdivxxvm.cloudfront.net") {
			return decodeURIComponent(src.replace(/^[a-z]+:\/\/[^/]*\/.*?[?&]src=([^&]*).*?$/, "$1"));
		}
		if (domain === "d32dm0rphc51dk.cloudfront.net") {
			return src
				.replace(/\/larger(\.[^/.]*)(?:[?#].*)?$/, "/normalized$1")
				.replace(/\/(?:small|medium|large)(\.[^/.]*)(?:[?#].*)?$/, "/larger$1");
		}
		if (domain_nowww === "royalparks.org.uk") return src.replace(/(\/_gallery\/+[^/]*\.[^/.]*)\/+[^/]*\.[^/.]*(?:[?#].*)?$/, "$1");
		if (domain === "cdn.downtoearth.org.in") return src.replace(/\/library\/+[a-z]+\/+([0-9]{4}-[0-9]{2}-[0-9]{2}\/)/, "/library/original/$1");
		if (domain_nowww === "arborday.org") return src.replace(/(\/images\/+hero\/+)[a-z]+\/+/, "$1");
		if (domain === "assets.publishing.service.gov.uk") return src.replace(/(\/image_data\/+file\/+[0-9]+\/+)s[0-9]+_([^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "media.swncdn.com") return src.replace(/\.[0-9]+[wh]\.tn(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain === "media.wnyc.org") return src.replace(/(:\/\/[^/]*\/i)\/+[0-9]+\/+[0-9]+\/+(?:[cl]\/[0-9]+\/)?/, "$1/raw/");
		if (domain_nowww === "tagbrand.com") return src.replace(/(\/uploads\/+[0-9]+\/+[0-9a-f]+)_[a-z](\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "7sur7.be" &&
			domain.match(/^static[0-9]*\./)) {
			return src.replace(/\/media_[a-z]+_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/crop_$1");
		}
		if (domain_nowww === "suryaa.com") return src.replace(/\/thumbnail[0-9]*\/+([^/]*)(?:[?#].*)?$/, "/$1");
		if (domain === "phapluatdansinh.phapluatxahoi.vn") return src.replace(/\/upload\/+zoom\/+[0-9]+_[0-9]+\/+/, "/upload/");
		if (domain === "assets.sport.ro") {
			return src
				.replace(/\/t_size[0-9]*\/+thumb_/, "/")
				.replace(/_size[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "diarioarapiraca.com.br" ||
			domain_nowww === "todosegundo.com.br") {
			return urljoin(src, decodeuri_ifneeded(src.replace(/^[a-z]+:\/\/[^/]*\/thumbs\.php.*?[?&]imagem=([^&]*).*?$/, "$1")), true);
		}
		if (domain === "static.ilike.com.vn") return src.replace(/\/thumb\/+s[0-9]+\//, "/thumb/origin/");
		if (domain === "b.njus.me") return src.replace(/\/[a-z]_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "wallpaperstream.com") return src.replace(/\/thumbnails\/(.*)_thumb(\.[^/.]*)(?:[?#].*)?$/, "/full/$1$2");
		if (domain_nowww === "wallpapersite.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+[a-z]+\/+[^/.?#]*-([0-9]+)\.html(?:[?#].*)?$/,
				query_for_id: "https://wallpapersite.com/anime/-${id}.html",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<a\s+href=["'](\/images\/wallpapers\/[^'"]*)["']\s+class=["']?original/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done(urljoin(src, match[1], true), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "wallpapersite.com" &&
			options && options.cb && options.do_request) {
			id = src.replace(/.*\/images\/+pages\/+[^/]*\/+([0-9]+)\.[^/.]*(?:[?#].*)?$/, "$1");
			if (id !== src) {
				return {
					url: "https://wallpapersite.com/anime/-" + id + ".html",
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "record.pt" ||
			domain_nosub === "flash.pt" ||
			domain_nosub === "cmjornal.pt" ||
			domain_nosub === "destakjornal.com.br" ||
			domain_nosub === "maxima.pt" ||
			src.match(/^[a-z]+:\/\/cdn[0-9]*\.[^/]*\/+images\/+[0-9]{4}-[0-9]{2}\/+img_[0-9]+x[0-9]+\$[0-9]{4}(?:_[0-9]{2}){5}_[0-9]+\.[^/.]*(?:[?#].*)?$/)) {
			return src.replace(/(\/images\/+[0-9]{4}-[0-9]{2}\/+)img_[0-9]+x[0-9]+[$]/, "$1OriginalSize$");
		}
		if (domain_nowww === "latestwall.com") {
			newsrc = src
				.replace(/\/imagecache\/+thumb[a-z]+\/+/, "/images/wallpaper/")
				.replace(/\/main-image\/+cache\/+([^/]*)\/+[0-9]+(?:\/+[0-9]+)(?:[?#].*)?$/, "/images/wallpaper/$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/download\/+[0-9]+~[0-9]+~([^/]*)(?:[?#].*)?$/, "/images/wallpaper/$1.jpg");
			if (newsrc !== src)
				return add_full_extensions(newsrc);
		}
		if (domain_nosub === "hdxwallpaper.com" && domain.match(/^orig[0-9]*\./)) {
			return {
				url: src.replace(/-[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1"),
				headers: {
					Referer: "https://hdxwallpaper.com"
				}
			};
		}
		if (domain === "cacheimg.bonsante.fr") {
			return decodeuri_ifneeded(src.replace(/^[a-z]+:\/\/[^/]*\/i\.php.*?[?&]img=([^&]*).*?$/, "$1"));
		}
		if (domain_nowww === "generations.fr") return src.replace(/\/thumb\/+[0-9]+x[0-9]+_([^/]*)(?:[?#].*)?$/, "/$1");
		if (domain === "images.gsp.ro") return src.replace(/\/thumbs\/+thumb_[0-9]+_x_[0-9]+\//, "/imagini/");
		if (domain === "cacheimg.gsp.ro") return src.replace(/(\/autocrop\/+.*?)(?:[?#].*)?$/, "$1?width=0&height=0");
		if (domain === "tt.inf.ua") return src.replace(/(\/files\/+upload\/+(?:[0-9a-f]{2}\/+){3}[0-9a-f]+)\.[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "ckm.pl") return src.replace(/(\/files\/+[0-9]{4}_[0-9]{2}\/+)\.thumbnails\/+[0-9X]+x[0-9X]+\/+/, "$1");
		if (domain_nowww === "zurnal.mk" ||
			domain_nowww === "harpersbazaar.rs" ||
			domain_nowww === "moviegoers.me") {
			return urljoin(src, decodeuri_ifneeded(src.replace(/^[a-z]+:\/\/[^/]*\/(?:images\/+thumbs\/+)?image\.php\/+[^/]*\?(?:.*?&)?image=([^&]*).*?$/, "$1")), true);
		}
		if (domain === "cde.laprensa.e3.pe") return src.replace(/(\/ima\/+(?:[0-9]\/+){5}[0-9]+)\/+[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "myclip.vn" && domain.match(/^static[0-9]*\./)) {
			return src.replace(/(\/image[0-9]*\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9a-f]+\/+[-0-9a-f]+)_[0-9]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "elsalvadortimes.com") return src.replace(/\/asset\/+[^/]*\/+media\/+/, "/media/");
		if (domain === "assets.media-platform.com") return src.replace(/(\/images\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]{8}_[^/]*)-[wh][0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "noticiastudoaqui.com") {
			return decodeuri_ifneeded(src.replace(/^[a-z]+:\/\/[^/]*\/tim\.php.*?[?&]src=([^&]*).*?$/, "$1"));
		}
		if (domain === "images.buzzerie.com") return src.replace(/_[0-9]+x[0-9wh]+(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain_nowww === "cocacolabrasil.com.br") return src.replace(/\.rendition\.[0-9]+\.[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain === "img.uodoo.com") {
			return src.replace(/;,.*/, "");
		}
		if (domain_nowww === "bumm.sk") return src.replace(/(\/uploads\/+news\/+[0-9]+\/+[0-9]+\/+)[0-9]+x[0-9]+\/+/, "$1");
		if (domain === "multimedia.larepublica.pe" ||
			domain === "prod.media.larepublica.pe" ||
			domain === "prod.presets.larepublica.pe") {
			return src.replace(/(:\/\/[^/]*\/)(?:[0-9]+)?x(?:[0-9]+)?\//, "$1x/");
		}
		if (domain_nowww === "wallpaperfm.com") return src.replace(/\/img\/+[a-z]+\/+/, "/img/original/");
		if (domain === "dux7id0k7hacn.cloudfront.net") return src.replace(/(\/cmi\/+(?:[0-9]\/+){4}[0-9]+\/+[^/]*\.[^/.]*)\/.*$/, "$1");
		if (domain_nowww === "printel.biz" ||
			domain_nowww === "steklozerkalo116.ru" ||
			domain_nowww === "studio-14.ru") {
			return src.replace(/\/thumb\/.*(\/d\/+[^/]*\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "10wallpaper.com" &&
			options && options.cb && options.do_request) {
			var id = src.replace(/.*\/wallpaper\/+[^/]*\/+[0-9]+\/+([^/]*)_[^./_]+\.[^/.]*(?:[?#].*)?$/, "$1");
			if (id !== src) {
				options.do_request({
					url: "https://www.10wallpaper.com/view/" + id + ".html",
					method: "GET",
					onload: function(resp) {
						if (resp.readyState === 4) {
							var match = resp.responseText.match(/>Original Resolution: <a\s+href=["'](\/wallpaper\/[^'"]+)/);
							if (match) {
								options.cb(urljoin(src, match[1], true));
							} else {
								options.cb(null);
							}
						}
					}
				});
				return {
					waiting: true
				};
			}
		}
		if (domain_nosub === "wallpapersok.com" && domain.match(/^cdn[0-9]*\./)) {
			return src.replace(/\/(?:crop\/+)?(uploads\/+picture\/+[0-9]{3}\/+[0-9]{3}\/+[0-9]+\/+)(?:thumbs_)?([^/?]*)(?:[?#].*)?$/, "/$1$2");
		}
		if (domain_nowww === "woweiquan.com") {
			return decodeuri_ifneeded(src.replace(/^[a-z]+:\/\/[^/]*\/Service\/+Img\/+wx.*?[?&]url=([^&].*)?.*?$/, "$1"));
		}
		if (domain === "s.kaskus.id") {
			return {
				url: src.replace(/(:\/\/[^/]*\/+)[rc][0-9]+x[0-9]+\/+/, "$1"),
				headers: {
					Referer: "https://www.kaskus.co.id"
				}
			};
		}
		if (domain === "dl.kaskus.id") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+([^/]*\.[^/]*\/)/, "$1");
			if (newsrc !== src)
				return add_http(newsrc);
			return {
				url: src,
				headers: {
					Referer: ""
				}
			};
		}
		if (domain_nowww === "shofona.net") return src.replace(/\/cached_uploads\/+resize\/+[0-9]+\/+[0-9]+\/+/, "/cached_uploads/full/");
		if (domain_nowww === "bayanbox.ir") return src.replace(/\/preview\/+([0-9]+)\/+/, "/view/$1/");
		if (domain_nowww === "guiadasemana.com.br") {
			return src
				.replace(/(\/contentFiles\/+image\/+)opt_[^/]*\/+/, "$1")
				.replace(/(\/contentFiles\/+system\/+pictures\/+[0-9]{4}\/+[0-9]+\/+[0-9]+\/+)[a-z]+\/+/, "$1original/");
		}
		if (domain === "img.arabstoday.net") return src.replace(/(\/[0-9]{4}\/+[0-9]{2}\/+)[a-z]+\/+/, "$1normal/");
		if (domain_nowww === "nodud.com") return src.replace(/\/sized\/+(source\/+.*\/[0-9a-z]+)-[^/]*(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain === "g.acdn.no") {
			newsrc = src.replace(/.*?\/API\/+dynamic\/+r1\/+external\/+[^/]*\/+[^/]*\/+(https?.*?)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain_nowww === "pensorosa.com") return src.replace(/\/upload\/+[a-z]+\/+/, "/upload/images/");
		if (domain === "smlycdn.akamaized.net") return src.replace(/\/products\/+[^/]*\/+[0-9a-f]+\/+([0-9a-f]+)(\.[^/.]*)(?:[?#].*)?$/, "/data/product2/2/$1_l$2");
		if (domain === "cdn.aizel.ru") return src.replace(/\/i\/+[0-9]+x[0-9]+\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/i/$1");
		if (domain_nowww === "trelisecooperonline.com") return src.replace(/\/user\/+images\/+([0-9]+)_[0-9]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/user/images/$1$2");
		if (domain_nowww === "thairomances.com") return src.replace(/(\/userfiles\/+[^/]*\/+[0-9]+\/+[0-9]+-)[0-9]+x[0-9]+\./, "$1full_size.");
		if (domain === "cn.opendesktop.org" ||
			domain === "cdn.pling.com") {
			return src.replace(/\/cache\/+[0-9]+x[0-9]+(?:-[a-z0-9]+)?\/+img\/+/, "/img/");
		}
		if (domain === "cdn.ren.tv") return src.replace(/\/cache\/+[0-9]+x[0-9]+\/+media\/+/, "/media/");
		if (domain_nowww === "3dnews.ru") {
			return src
				.replace(/(\/assets\/.*\/)[a-z]+\.([0-9A-Z]+)\.[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3")
				.replace(/\/z\/.*?\/([0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9a-f]+\/+[0-9a-fA-Z]+\.[^/.]*)(?:\/+[0-9]+)?(?:[?#].*)?$/, "/assets/external/galleries/$1");
		}
		if (domain === "mix.tn.kz" ||
			domain === "tengrinews.kz") {
			return src.replace(/\/thumb_[a-z]+\/+(photo_[0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		}
		if (domain_nowww === "overclockers.ru") {
			return src.replace(/:\/\/[^/]+\/+st\/+(.*)$/, "://st." + domain_nosub + "/$1");
		}
		if (domain === "st.overclockers.ru") {
			return src
				.replace(/(:\/\/[^/]+\/+images\/+lab\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9]+\/+[0-9]+)\./, "$1_big.")
				.replace(/\/(?:c\/+[0-9]+\/+[0-9]+|r\/+[-0-9]+\/+[-0-9]+)\/+images\//, "/images/");
		}
		if (domain_nosub === "kpcdn.net" && /^s[0-9]*\.stc\.[a-z]+\./.test(domain)) {
			return src.replace(/^[a-z]+:\/\/[^/]*\/(share\/+i\/+[0-9]+\/+[0-9]+)\/+(?:[^/]*\.[^/.]*)?(?:[?#].*)?$/, "https://kp.ru/$1");
		}
		if (domain_nowww === "kp.ru") return src.replace(/^[a-z]+:\/\/[^/]*\/(share\/+i\/+[0-9]+\/+[0-9]+)\/+(?:[^/]*\.[^/.]*)?(?:[?#].*)?$/, "https://kp.ru/$1");
		if (domain_nowww === "oplace.ru") return src.replace(/\/images\/+photos\/+[a-z]+\/+([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "/images/photos/$1");
		if (domain_nosub === "rightinthebox.com" && domain.match(/^[ml]i/)) {
			regex = /(:\/\/[^/]*\/images\/+)(?:[0-9]+x[0-9]+|[a-z])\//;
			if (regex.test(src)) {
				src = remove_queries(src, ["fmt"]);
				return fillobj_urls([
					src.replace(regex, "$11500x1500/"),
					src.replace(regex, "$1x/")
				], {
					headers: {
						Origin: "https://www.lightinthebox.com",
						Referer: "https://www.lightinthebox.com/"
					},
					can_head: false // 403
				});
			}
		}
		if (domain === "img.esportnews.gg") return src.replace(/(\/pictures\/+content\/+[0-9]+\/+[0-9]+)_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "img.tyt.by") return src.replace(/(:\/\/[^/]*\/)[0-9]+x[0-9]+[a-z]\/+/, "$1");
		if (domain === "vi.ill.in.ua") return src.replace(/(:\/\/[^/]*\/[a-z]\/+)[0-9]+x[0-9]+\/+/, "$10x0/");
		if (domain_nowww === "vsco.co") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+[^/]+\/+media\/+([0-9a-f]{10,})(?:[?#].*)?$/,
				query_for_id: "https://vsco.co/vsco/media/${id}",
				process: function(done, resp, cache_key, match) {
					var id = match[1];
					var obj = {
						extra: {
							page: resp.finalUrl
						}
					};
					var match = resp.responseText.match(/window\.__PRELOADED_STATE__\s*=\s*({.*?});?\s*<\/script/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					var media = json.medias.byId[id].media;
					obj.extra.caption = media.description;
					obj.extra.created_date = media.uploadDate;
					obj.extra.updated_date = media.lastUpdated;
					obj.extra.author_username = media.permaSubdomain; // or gridName
					var urls = [];
					if (media.videoUrl)
						urls.push({
							url: force_https(add_http(media.videoUrl)),
							video: true
						});
					urls.push(force_https(add_http(media.responsiveUrl)));
					return done(fillobj_urls(urls, obj), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "vsco.co" && domain.match(/^image(?:-aws)?.*/) ||
			domain === "im.vsco.co") {
			newsrc = src
				.replace(/(vsco_?[0-9a-f]+\.[^/.?#]*)(?:[?#].*)?$/, "$1")
				.replace(/(\/[0-9a-f]{20,}\/+)[0-9]+x[0-9]+\/+(?:[0-9a-f]+\/+)?(vsco_?[0-9a-f]+\.[^/.?#]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return {
					url: newsrc,
					can_head: false
				};
			match = src.match(/\/derivative\/+(?:[0-9a-f]+\/+[0-9]+\/+)?([0-9a-f]{20,})/);
			if (options.do_request && options.cb && match) {
				common_functions["get_redirect_url"](api_cache, options, "https://vsco.co/i/" + match[1], function(url) {
					options.cb({
						url: url,
						can_head: false
					});
				});
				return {
					waiting: true
				};
			}
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:(?:aws-[^/]+\/+)?[0-9a-f]{6}\/+[0-9]+|[0-9]+\/+[0-9a-f]{10,})\/+([0-9a-f]{20,})\/+/);
			if (match && options.force_page) {
				return {
					url: "https://vsco.co/vsco/media/" + match[1],
					can_head: false,
					is_pagelink: true
				};
			}
		}
		if (domain === "i.vsco.co" && options.do_request && options.cb) {
			if (/\/i\/+[0-9a-f]+$/.test(src)) {
				common_functions["get_redirect_url"](api_cache, options, {
					url: src,
					headers: {
						Referer: "https://vsco.co"
					}
				}, function(url) {
					options.cb({
						url: url,
						can_head: false
					});
				});
			}
		}
		if (domain_nowww === "screenbeauty.com") return src.replace(/\/image\/+compress\/+/, "/image/wallpapers/");
		if (domain === "e.radio-studio92.io") return src.replace(/(:\/\/[^/]*\/)[a-z]+\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9]+(?:_[0-9]+)?\.[^/.]*)(?:[?#].*)?$/, "$1xlarge/$2");
		if (amazon_container === "topdesk") {
			return src.replace(/\/((?:[0-9]{3}\/+){3})[a-z]+\/+([^/]*)(?:[?#].*)?$/, "/$1original/$2");
		}
		if (domain === "static.hdw.eweb4.com") return src.replace(/\/media\/+wp_[0-9]+\/+/, "/media/wallpapers/");
		if (domain_nowww === "sitioandino.com.ar") return src.replace(/(\/files\/+image\/+[0-9]+\/+[0-9]+\/+[0-9a-f]+)_[0-9]+_[0-9]+!(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "demo.brainymore.com") return src.replace(/\/thumbs\/+([0-9]+)_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain_nosub === "1freewallpapers.com" && domain.match(/^data[0-9]*\./)) {
			return src
				.replace(/(:\/\/[^/]*\/)download\/+([^/]+)-[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1original/$2$3")
				.replace(/(:\/\/[^/]*\/)[a-z]+\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1original/$2");
		}
		if (domain_nowww === "downloadwallpapers.info") return src.replace(/(:\/\/[^/]*\/)(?:thumbs|preview|dl\/+[^/]*)\/+([0-9]{4})\/+/, "$1dl/o/$2/");
		if (domain_nowww === "miyanali.com") return src.replace(/(:\/\/[^/]*\/)patch2image\.php.*?[?&]patch=(usr\/[^&]*).*?$/, "$1$2");
		if (domain_nowww === "all4desktop.com") return src.replace(/\/data_images\/+[0-9]+(?:%20|\s)*x(?:%20|\s)*[0-9]+\/+/, "/data_images/original/");
		if (amazon_container === "hsdreams1") {
			return src.replace(/(\/[0-9]{4}\/+[0-9]{2}\/+)[a-z]+(\/+[0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1big$2");
		}
		if (domain === "cdn.quotesgram.com") return src.replace(/(:\/\/[^/]*\/)[a-z]+\/+/, "$1img/");
		if (domain_nowww === "razdachi.net" ||
			domain_nowww === "wallpaperfuel.com") {
			return src.replace(/(:\/\/[^/]*\/)thumbnail\/+/, "$1wallpaper/");
		}
		if (domain_nowww === "zazzybabes.com") return src.replace(/\/(girls)\/+([^/]*\/+)thumb-([^/]*\.[^/.]*)(?:[?#].*)?$/, "/$1/$2$3");
		if (domain_nosub === "mtime.cn" && domain.match(/^img[0-9]*\./)) {
			return {
				url: src.replace(/(\.[0-9]+)(?:_[0-9]+(?:X[0-9]+){0,2})?(\.[^/.]*)(?:[?#].*)?$/, "$1_0$2"),
				head_wrong_contenttype: true
			};
		}
		if (domain === "images.gutefrage.net") return src.replace(/(\/bilder\/+[^/]*\/+[0-9]+_)[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		if (domain === "v.angel-porns.com" ||
			domain_nowww === "sexgirlspics.com") {
			return src.replace(/\/tnx?(sn[0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		}
		if (domain === "cdn15764270.ahacdn.me" ||
			domain_nowww === "pornopicshub.com" ||
			domain === "cdn.pornopicshub.com" ||
			domain === "cdn26375495.ahacdn.me") {
			return src.replace(/(\/galleries\/+[^/]*\/+[0-9a-f]+\/+)[0-9]+x[0-9]+(\/+[^/]*\.[^/.]*)(?:[?#].*)?$/, "$1origin$2");
		}
		if (domain === "images.nubilefilms.com") return src.replace(/\/photos\/+tn\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/photos/$1");
		if (domain === "g.bnrslks.com" ||
			domain === "g.dombnrs.com" ||
			domain === "g.misslk.com" ||
			domain === "gallery.virtuagirl.com" ||
			domain === "gallery.virtuagirlhd.com") {
			return src.replace(/\/tn\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "/full/$1");
		}
		if (domain_nosub === "joymii.com" && domain.match(/^n[0-9]*\./)) {
			return src.replace(/\/thumbs-[0-9]+x[0-9]+\//, "/fhg/");
		}
		if (domain_nowww === "famechain.com") return src.replace(/\/images\/+resized-image\/+[^/]*\/+([0-9]+)(?:[?#].*)?$/, "/images/image/$1");
		if (domain_nosub === "autoevolution.com" &&
			domain.match(/^s[0-9]*\.cdn\./)) {
			return src.replace(/\/images\/+news-gallery-[0-9]+x\/+([^/]*)-thumbnail(_[0-9]+\.[^/.]*)(?:[?#].*)?$/, "/images/news/gallery/$1$2");
		}
		if (domain === "pics.haircutshairstyles.com") return src.replace(/\/img\/+photos\/+thumbs\/+([0-9]{4}-[0-9]{2})\/+thumb_/, "/img/photos/full/$1/");
		if (domain === "clzmovies.r.sizr.io") return src.replace(/(:\/\/[^/]*\/core\/+[a-z]+\/+)[a-z]+(\/+[0-9a-f]{2}\/+[0-9a-f]{2}_[^/]*)(?:[?#].*)?$/, "$1original$2");
		if (domain === "images.firstpost.com") return src.replace(/\/fpimages\/+[0-9]+x[0-9]+\/+[a-z]+\/+[a-z]+\/+([0-9]{4}\/+[0-9]{2}\/+)/, "/wp-content/uploads/$1");
		if ((domain_nowww === "hustlebunny.com" && string_indexof(src, "/content/") >= 0) ||
			(domain === "24.p3k.hu" && string_indexof(src, "/uploads/") >= 0) ||
			(domain === "static.soltana.ma" && string_indexof(src, "/uploads/") >= 0) ||
			(domain_nowww === "cosmopolitan.hu" && src.match(/\/app\/+uploads\//)) ||
			(domain === "static.hollywoodreporter.com" && /(?:\/wp-content\/+uploads\/|\/sites\/+default\/+files\/)/.test(src)) ||
			(domain_nowww === "destroylonely.net" && string_indexof(src, "/files/") >= 0) ||
			(domain_nowww === "pedestrian.tv" && string_indexof(src, "/content/") >= 0)) {
			return src
				.replace(/_wm(\.[^/.]*)(?:[?#].*)?$/, "$1")
				.replace(/-[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1")
				.replace(/-e[0-9]{8,}(\.[^/.]*)(?:[?#].*)?$/, "$1")
				.replace(/-compressed(\.[^/.]+)(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "vanishingtattoo.com") return src.replace(/_thumbnails\/+([^/]*)_th(_[0-9]+\.[^/.]*)(?:[?#].*)?$/, "_large/$1$2");
		if (domain_nowww === "wallpaperama.com") return src.replace(/(\/post-images\/+wallpapers\/+[a-z]+\/+[^/]*)-t[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "hashtaglegend.com") return src.replace(/(\/storage\/+app\/+media\/+)cropped-images\/+([^/]*)(?:-[0-9]+){4}-[0-9]{8,}(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		if (domain_nowww === "anime-planet.com") return src.replace(/(\/images\/+[a-z]+\/+(?:[a-z]+\/+)?)thumbs\/+/, "$1");
		if (domain === "di2ponv0v5otw.cloudfront.net" ||
			domain === "dtpmhvbsmffsz.cloudfront.net") {
			newsrc = src.replace(/(\/[a-z]+\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9a-f]+\/+)[a-z]_(?:wp_)?([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if ((domain_nosub === "freeasianpics.net" && domain.match(/^cdn[0-9]*\./)) ||
			domain === "th.sexhotpictures.net") {
			return src.replace(/\/(?:_[a-z]_|n)([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		}
		if (amazon_container === "nudiez-production" ||
			domain === "d2c4tvdc1w38dj.cloudfront.net") {
			return src.replace(/(\/photos\/(?:[-0-9a-f]{3}\/+){3})[a-z]+\/+([^/?]+)(?:[?#].*)?$/, "$1original/$2");
		}
		if (domain_nosub === "avdbs.com" && /^i[0-9]*\./.test(domain)) {
			return src.replace(/^[a-z]+:\/\/[^/]*\//, "https://s3.ap-northeast-2.amazonaws.com/img.avdbs.com/");
		}
		if (amazon_container === "img.avdbs.com" ||
			domain === "img.avdbs.com" ||
			(domain_nosub === "avdbs.com" && /^i[0-9]*\./.test(domain))) {
			regex = /(\/[0-9]+_[0-9]+_)[sr](\.[^/.]*)(?:[?#].*)?$/;
			return [
				src.replace(regex, "$1o$2"),
				src.replace(regex, "$1r$2")
			];
		}
		if (domain === "cdn.lengmenjun.com") return src.replace(/!lengmenjun-[0-9]+(?:[?#].*)?$/, "!lengmenjun");
		if (amazon_container === "gallerist" ||
			domain === "assets.boomkat.com" ||
			domain_nowww === "fireflowergames.com") {
			return src.replace(/(\/products\/+[0-9]+\/+)[a-z]+\/+([^/]*)(?:[?#].*)?$/, "$1original/$2");
		}
		if (domain === "dingo.care2.com") return src.replace(/(\/pictures\/+.*\/[0-9]+-[0-9]+-)[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1orig$2");
		if (domain === "newsinteractives.cbc.ca") return src.replace(/(\/images\/+[^/]*\/+)_[a-z]+\/+/, "$1");
		if (domain_nowww === "clipartmax.com") return src.replace(/(:\/\/[^/]*\/(?:png|jpg|jpeg|gif)\/+)[a-z]+\/+/, "$1full/");
		if (domain_nowww === "createphotocalendars.com") {
			return src.replace(/(\/studio\/+generated[a-zA-Z]+\/+[^/]*\/+)thumbs\/+/i, "$1/");
		}
		if (domain_nowww === "larutadelsorigens.cat") return src.replace(/\/filelook\/+[a-z]+\/+/, "/filelook/full/");
		if (domain === "wwcdn.weddingwire.com") return src.replace(/(\/wedding\/+[0-9]+_[0-9]+\/+[0-9]+\/+)thumbnails\/+[0-9]+x[0-9]+_/, "$1");
		if (domain_nowww === "weddingandpartynetwork.com") return src.replace(/\/gallery\/+photos\/+thumb\/+([0-9]+)(?:[?#].*)?$/, "/gallery/photos/$1");
		if (domain_nowww === "foto4ka.com") return src.replace(/(:\/\/[^/]*\/)thumbnails\/+([0-9]+\/+)/, "$1wallpapers/$2");
		if (domain_nowww === "showwallpaper.com") return src.replace(/(\/wallpaper\/+[0-9]+\/+)tn_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "cduniverse.ws" && domain.match(/^c[0-9]*\./)) {
			return src.replace(/(\/resized[a-z]*\/+)[0-9]+x[0-9]+\/+/, "$19000x9000/");
		}
		if (domain === "img.mandarake.co.jp") return src.replace(/(\/webshopimg\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+)[a-z]_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "d2adpaynhf6x63.cloudfront.net") return src.replace(/\/image\/+thumbs\/+thumb[0-9]+_/, "/image/");
		if (domain === "static-cdn.jtvnw.net") {
			newsrc = src.replace(/-300x300(\.[^/.]+)(?:[?#].*)?$/, "-600x600$1");
			if (newsrc !== src) {
				return {
					url: newsrc,
					problems: {
						possibly_upscaled: true
					}
				};
			}
			newsrc = src.replace(/-(?:50x50|70x70)(\.[^/.]+)(?:[?#].*)?$/, "-300x300$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/emoticons\/+v1\/+[0-9]+\/+)[012][0-9.]*(?:[?#].*)?$/, "$13.0");
			if (newsrc !== src)
				return newsrc;
			regex = /(\/emoticons\/+v2\/+(?:[0-9]+|emotesv2_[0-9a-f]{10,})\/+[^/]+\/+[a-z]+\/+)[0-4][0-9.]*(?:[?#].*)?$/;
			if (regex.test(src)) {
				return [
					src.replace(regex, "$15.0"),
					src.replace(regex, "$14.0"),
					src.replace(regex, "$13.0")
				];
			}
			newsrc = src.replace(/(\/thumb\/+thumb[0-9]*-)[0-9]+x[0-9]+(\.[a-z]+)(?:[?#].*)?$/, "$10x0$2");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/-[0-9]+x[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "patch.com") {
			newsrc = src.replace(/(\/img\/+cdn[0-9]*\/+.*\/+(?:[0-9]{4}\/+[0-9]{2}|[0-9]{8}\/+[0-9]+)\/+)(?:T[0-9]+x[0-9]+\/+)?((?:styles\/+[^/]+\/+public\/+[^/]+\/+)?[^/]*?)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/img\/+cdn\/+users\/+[0-9]+\/+[0-9]{4}\/+[0-9]{2}\/+)([^/]*)(?:[?#].*)?$/, "$1raw/$2");
		}
		if (domain_nowww === "wsws.org") return src.replace(/(\/asset\/+[-0-9a-f]+[A-Z]?\/+[^/]*?)(?:[?#].*)?$/, "$1");
		if (domain === "media.apnarm.net.au") return src.replace(/(\/media\/+images\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[^/]*)_f?c?t[0-9]+(?:x[0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "images.forwardcdn.com") return src.replace(/\/image\/+[0-9]+x(?:[0-9]+)?\/+[a-z]+\/+(?:[a-z]+\/+)?images\/+(?:cropped\/+)?/, "/image/images/");
		if (domain_nowww === "goodnet.org") return src.replace(/\/photos\/+[0-9]+x[0-9]+\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/photos/$1");
		if (domain_nowww === "pinknews.co.uk") return src.replace(/(\/images\/+[0-9]{4}\/+[0-9]{2}\/+[^/]*)[-_][0-9]+x[0-9]+(?:_[^/]*?)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "static-sothebys-production-2.gtsstatic.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/images\/+v_[0-9_]+\/+localimagereader\.ashx.*?[?&]imageurl=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "img.gtsstatic.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+reno\/+imagereader\.aspx\?(?:.*&)?imageurl=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "lc-imageresizer-live-s.legocdn.com") {
			newsrc = src.replace(/.*\/resize\/+[^/]*\?(?:.*&)?imageUrl=(http[^&]+)(?:[&#].)?$/, "$1");
			if (newsrc !== src)
				return {
					url: decodeuri_ifneeded(newsrc),
					head_wrong_contentlength: true
				};
		}
		if (domain_nosub === "boltdns.net" && domain.match(/^cf-images\./)) {
			return {
				url: src, //.replace(/\/[-0-9]+x[-0-9]+\/+match\/+/, "/-1x-1/match/"),
				can_head: false // 405, method not allowed
			};
		}
		if (domain === "players.brightcove.net") {
			var query_brightcove_video_api = function(account_id, video_id, pk, cb) {
				api_query("brightcove_video_api:" + account_id + "/" + video_id, {
					url: "https://edge.api.brightcove.com/playback/v1/accounts/" + account_id + "/videos/" + video_id,
					headers: {
						"Accept": "application/json;pk=" + pk,
						Referer: "https://players.brightcove.net/"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					return done(resp, 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^([a-z]+:\/\/[^/]+\/+([0-9]+)\/+[^/]+\/+index\.html\?(?:.*&)?videoId=([0-9]+)(?:&.*)?)(?:#.*)?$/,
				query_for_id: "${id}",
				process: function(done, resp, cache_key, match) {
					var account_id = match[2];
					var video_id = match[3];
					var imuhash = common_functions["parse_imu_hash"](src);
					var pk = null;
					if (imuhash && imuhash.pk)
						pk = imuhash.pk;
					var match = resp.responseText.match(/,policyKey:("[^"]+")}},/);
					if (!match) {
						if (!pk) {
							console_error(cache_key, "Unable to find policyKey match for", resp);
							return done(null, false);
						}
					} else {
						pk = JSON_parse(match[1]);
					}
					query_brightcove_video_api(account_id, video_id, pk, function(data) {
						var caption = data.name || data.description || data.long_description;
						var image = data.poster || data.thumbnail;
						var urls = [];
						array_foreach(data.sources, function(source) {
							if (/^http:\/\//.test(source.src))
								return;
							var video = true;
							if (source.type === "application/x-mpegURL")
								video = "hls";
							else if (source.type === "application/dash+xml")
								video = "dash";
							urls.push({
								url: source.src,
								video: video
							});
						});
						if (image)
							urls.push(image);
						var obj = {};
						if (caption)
							obj.extra = { caption: caption };
						return done(fillobj_urls(urls, obj), 60 * 60);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "expo.advance.net") return src.replace(/(\/img\/[0-9a-f]+\/+)(?:(?:height|width)[0-9]+\/+)?([a-z0-9]{3}_[^/.]+\.[^/.]*)(?:[?#].*)?$/, "$1orig/$2");
		if (domain === "media.resources.festicket.com") return src.replace(/\/image\/+.*?\/+www\/+/, "/image/www/");
		if (domain === "static.getindiebill.com") return src.replace(/(:\/\/[^/]*\/)[^/]*=\/[0-9]+x[0-9]+\/+(?:smart\/+)?([-0-9a-f]{10,}\/+)/, "$1$2");
		if (domain_nowww === "seatgeek.com") return src.replace(/(\/images\/+performers-landscape\/+[^/]*-[0-9a-f]+\/+[0-9]+\/+)[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$10x0$2");
		if (domain === "vid.alarabiya.net") return src.replace(/(\/images\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[-0-9a-f]+\/+[-0-9a-f]+)_[^/]*_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (((domain === "cdn.onebauer.media" ||
			domain === "media.planetradio.co.uk" ||
			domain === "cdn.graziadaily.co.uk" ||
			domain === "cdn.closeronline.co.uk" ||
			domain === "cdn.planetradio.co.uk" ||
			domain === "cdn.heatworld.com") &&
			src.match(/^[a-z]+:\/\/[^/]*\/+one\//)) ||
			domain === "images.bauerhosting.com") {
			return src.replace(/(\/[^/?]*)(?:\?.*)?$/, "$1?resize=atrophy");
		}
		if (domain === "assets.planetradio.co.uk") return src.replace(/\/track\/+[0-9]+x[0-9]+\/+/, "/track/");
		if (domain_nowww === "realestate.com.au") return src.replace(/\/blog\/+images\/+[^/]*\/+([0-9]{4})\/+/, "/blog/wp-content/uploads/$1/");
		if (domain_nowww === "kanke365.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/[^/]*\/+imgBridge\.php.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "i.obozrevatel.com") return src.replace(/(:\/\/[^/]*\/)([0-9]{4}\/+[0-9]{1,2}\/+[0-9]{1,2}\/+[^/?]*)(?:[?#].*)?$/, "$1gallery/$2");
		if (domain_nowww === "stuttgarter-nachrichten.de" ||
			domain_nowww === "esslinger-zeitung.de" ||
			domain_nowww === "schwarzwaelder-bote.de") {
			return src.replace(/(:\/\/[^/]*\/media\.media\.[-0-9a-f]+\.)(?:[^/]*\.)?([^/.]*)(?:[?#].*)?$/, "$1original.$2");
		}
		if (domain_nosub === "360buyimg.com" &&
			domain.match(/^(?:img[0-9]*|m)\./)) {
			return src
				.replace(/(:\/\/[^/]*\/)(?:[a-z0-9]+\/+s[0-9]+x[0-9]+_jfs|popWaterMark\/+jfs)\//, "$1imgzone/jfs/")
				.replace(/![^/]*(?:[?#].*)?$/, "");
		}
		if (domain === "c.actve.net") return src.replace(/(:\/\/[^/]*\/)([0-9])([0-9])([0-9])([0-9]+)(?:\/[^/]*)?(?:[?#].*)?$/, "$1original/$2/$3/$4/$2$3$4$5.jpg");
		if (domain === "resources.wimpmusic.com") return src.replace(/(\/images\/.*\/)[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1origin$2");
		if (domain === "improxy.starmakerstudios.com") return src.replace(/\/tools\/+im\/+[0-9]+\/+/, "/tools/im/0/");
		if (domain === "pl.scdn.co") return src.replace(/:\/\/[^/]*\/images\/+pl\/+default\/+([0-9a-f]+)(?:[?#].*)?$/, "://i.scdn.co/image/$1");
		if (domain === "dice-i-scdn-co.imgix.net") return src.replace(/^[a-z]+:\/\/[^/]+\/+image\/+([0-9a-f]{10,})(?:[?#].*)?$/, "https://i.scdn.co/image/$1");
		if (domain === "i.scdn.co") {
			return src
				.replace(/(\/image\/+ab67616d0000)(?:b273|d452)/, "$182c1")
				.replace(/(\/image\/+ab67616d0000)(?:1e02|f848|4851|745c|aa54|75a0|a426|e1a3|ab87|2d53|11eb|90d5|54be)/, "$1b273")
				.replace(/(\/image\/+ab6761610000)(?:5174|8ef1|86f7|939b|918b|101f|102f)/, "$1e5eb")
				.replace(/(\/image\/+ab6761610000)f178/, "$15174")
				.replace(/(\/image\/+ab6761860000)(?:6fba|660e|c09f|0194|d7b3|9d80|3e24|eab1)/, "$11016")
				.replace(/(\/image\/+ab6761670000)(?:e30a|d8f8|ecd4|e911|81f9|ea36|de4a|1217|6054)/, "$182e8");
		}
		if (domain === "mosaic.scdn.co") return src.replace(/(:\/\/[^/]+\/+)(?:300|60)\/+/, "$1640/");
		if (domain === "s.mxmcdn.net") return src.replace(/(\/images-storage\/.*\/[0-9]+_)[0-7][0-9][0-9]_[0-7][0-9][0-9](\.[^/.]*)(?:[?#].*)?$/, "$1800_800$2");
		if (domain_nowww === "radiopotok.ru") return src.replace(/\/article\/+s_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/article/$1");
		if (domain_nowww === "becteroradio.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/resizeimage\/+index\.php.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "electronicamx.net") return src.replace(/(\/images\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[^/]*)_medium(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "tophit.ru") return src.replace(/\/i\/+[0-9]+x[0-9]+\/+/, "/i/");
		if (domain_nosub === "zvooq.com" && domain.match(/^cdn[0-9]*\./) &&
			src.match(/:\/\/[^/]*\/pic\?/)) {
			return src.replace(/([?&]size=)[0-9]+x[0-9]+/, "$10x0");
		}
		if (domain === "d3us2i0tqwa7m7.cloudfront.net") return src.replace(/(\/[0-9]+_res_)[^/._]*(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		if (domain_nowww === "theaudiodb.com" && string_indexof(src, "/images/") >= 0) {
			return src.replace(/(\/[a-z0-9]+[0-9]{5,}\.[^/.]+)(?:\/[a-z]+)(?:[?#].*)?$/, "$1");
		}
		if (domain_nosub === "gaoshouyou.com" && domain.match(/^rs\.[0-9]*\./)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/gsy\.php.*?[?&]img=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "mirrormedia.com.tw") return src.replace(/(\/assets\/+images\/+[0-9]+-[0-9a-f]+)-mobile(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "twpriceget.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/img-[^/]*.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "bestchinanews.com" ||
			domain_nowww === "zhaizou.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/url\.php.*?[?&]p=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "img.com.link") return src.replace(/(\/[0-9a-f]+_)[0-9]+[a-z]?(\.[^/.]*)(?:[?#].*)?$/, "$1l$2");
		if (domain_nowww === "europaplus.ru") return src.replace(/\/upload\/+thumb\/+[^/]*\/+images\/+/, "/images/");
		if (domain_nosub === "ozone.ru" && /^(?:cdn[0-9]*|ir(?:-[0-9]+)?)\./.test(domain)) {
			return src.replace(/(\/multimedia(?:-[^/]+)?\/+)w?c[0-9]+\/+/, "$1");
		}
		if (domain === "img.tsn.ua") return src.replace(/(\/cached\/+[0-9]+\/+tsn-[0-9a-f]+\/+thumbs\/+)[0-9X]*x[0-9X]*\/+/, "$1x/");
		if (domain_nowww === "ivi.ru") return src.replace(/(\/uploads\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9a-f]+\.[^/.]+)\/+[0-9]+x[0-9]+(?:[?#].*)?$/, "$1");
		if (domain === "aisvip-a.akamaihd.net" ||
			domain === "ais-akamai.rtl.de") {
			return {
				url: src.replace(/(\/[0-9]+\/+)[0-9]+x[0-9]+\/+([^/]*)(?:[?#].*)?$/, "$1$2"),
				head_wrong_contentlength: true
			};
		}
		if (domain_nowww === "my-hit.org") {
			regex = /(\/storage\/+[0-9]+_)[0-9]+x[0-9]+x[0-9]+(?:x[0-9]+)?(\.[^/.]*)(?:[?#].*)?$/;
			newsrc = src.replace(regex, "$199999x99999x99999$2");
			return {
				url: newsrc,
				can_head: false // otherwise it hangs (apparently due to different content-length from HEAD and GET)
			};
		}
		if (domain_nosub === "censor.net.ua" && domain.match(/^storage[0-9]*\./)) {
			return {
				url: src.replace(/(\/images\/+(?:[0-9a-f]\/+){4}[0-9a-f]+\/+)[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1original$2"),
				can_head: false // 503
			};
		}
		if (domain_nowww === "vokrug.tv") return src.replace(/(\/pic\/+[^/]*\/+(?:.\/+){4})[a-z]+_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "mucche.mu") return src.replace(/(:\/\/[^/]*\/)t\/+([^/.]*)(?:[?#].*)?$/, "$1i/$2");
		if (domain_nowww === "nudography.com") return src.replace(/(\/photos\/+[^/]*\/+[0-9]{4}_[0-9]{1,2}\/+)[a-z]+\/+/, "$1original/");
		if (domain_nowww === "celebs-porno.com") return src.replace(/(:\/\/[^/]*\/[^/]*\/+)[a-z]{2}_([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "famousnipple.com" ||
			domain_nowww === "fuckingtattoos.com" ||
			domain_nowww === "pornwithtext.com" ||
			domain_nowww === "porngipfy.com" ||
			domain_nowww === "femjoybabes.com" ||
			domain_nowww === "russianpuss.com" ||
			domain_nowww === "gfycatporntube.com" ||
			domain_nowww === "hardfacefuck.com" ||
			domain_nowww === "filmnudes.com" ||
			domain_nowww === "porngfy.com" ||
			domain_nowww === "vanillababes.com" ||
			domain_nowww === "brazzersbabes.com" ||
			domain_nowww === "pussyexe.com" ||
			domain_nowww === "rubberxxx.com" ||
			domain_nowww === "pornartpics.com" ||
			domain_nowww === "porn15s.com" ||
			domain_nowww === "analsexgifs.com" ||
			domain_nowww === "freakydeakygifs.com" ||
			domain_nowww === "holyasshole.com" ||
			domain_nowww === "xpornzo.com" ||
			domain_nowww === "nsfwgify.com" ||
			domain_nowww === "sexyfitbabes.com" ||
			domain_nowww === "mlfrgs.com" ||
			domain_nowww === "milfdp.com" ||
			domain_nowww === "lesboluvin.com" ||
			domain_nowww === "gingerbabes.com" ||
			domain_nowww === "cosplayboobies.com") {
			var norm_fn_thumb = function(thumb) {
				return thumb.replace(/.*\//, "").replace(/-[0-9]{13}([0-9]+)\..*$/, "-$1.");
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:\?(?:.*&)?p=|[-a-z0-9]+-)([0-9]+)(?:[/&#].*)?$/,
				query_for_id: "http://" + domain_nosub + "/?p=${id}",
				process: function(done, resp, cache_key, match, options) {
					var images = [];
					var main_image = 0;
					var extra = {
						page: resp.finalUrl
					};
					var imgmatch = resp.responseText.match(/<img src="https?:\/\/[^/]+\/+content\/+[0-9]{4}\/+[0-9]{2}\/.*>/g);
					if (!imgmatch || !imgmatch.length) {
						console_warn(cache_key, "Unable to find img match for", resp);
						imgmatch = null;
					}
					var thumburl = null;
					var thumbmatch = options.url.match(/#imu-thumb=(.*)$/);
					if (thumbmatch)
						thumburl = norm_fn_thumb(thumbmatch[1]);
					if (imgmatch) {
						array_foreach(imgmatch, function(imagetag) {
							var parsed = parse_tag_def(imagetag);
							if (!parsed.args.src) {
								console_warn(cache_key, "Unable to find src for", parsed, "in", resp);
								return;
							}
							if (parsed.args["data-pin-url"])
								extra.page = parsed.args["data-pin-url"];
							if (parsed.args.alt)
								extra.caption = parsed.args.alt;
							images.push(parsed.args.src);
						});
					}
					var videomatch = resp.responseText.match(/(?:<div (?:class="video-holder"|class="single-video" id="single-video")>\s*<video|<video class="single-video" )[\s\S]+?<\/video>/);
					if (videomatch) {
						var videosources = common_functions["get_videotag_sources"](videomatch[0]);
						if (videosources && videosources.video.length) {
							images.push(videosources.video[0].url);
						}
					}
					videomatch = resp.responseText.match(/<div class="video-holder">\s*(<iframe.*?>)<\/iframe>/);
					if (videomatch) {
						var parsed = parse_tag_def(videomatch[1]);
						images.push(parsed.args.src);
					}
					var simages_match = resp.responseText.match(/<div class="single-(?:images|gif)">\s*((?:<div class="single-image">\s*<a[\s\S]+?<\/a>\s*<\/div>|<a[\s\S]+?<\/a>)\s*)<\/div>/);
					if (simages_match) {
						var simages_matches = match_all(simages_match[1], /<a href="(https?:\/\/[^/]+\/+wp-content\/+uploads\/+[^"]+)"[^>]*>\s*<img src="(https?:\/\/[^/]+\/+(?:images|wp-content)\/+[^"]+)"/);
						if (simages_matches) {
							array_foreach(simages_matches, function(match) {
								var orig = decode_entities(match[1]);
								var thumb = decode_entities(match[2]);
								array_upush(images, orig);
								if (norm_fn_thumb(thumb) === thumburl) {
									main_image = array_indexof(images, orig);
								}
							});
						} else {
							console_warn(cache_key, "Unable to find single images in", resp);
						}
					}
					var gallery_items_match = resp.responseText.match(/<figure class="(?:[^"]+ )?gallery-item[\s\S]+?<\/figure>/g);
					if (gallery_items_match) {
						array_foreach(gallery_items_match, function(figure) {
							var a_match = figure.match(/<a (?:class="[^"]*" )?href="(https?:\/\/[^/]+\/content\/+[^"]+)"/);
							if (!a_match) {
								console_warn(cache_key, "Unable to find link match in gallery-item for", { figure: figure, resp: resp });
								return;
							}
							var link = decode_entities(a_match[1]);
							array_upush(images, link);
							if (!thumburl)
								return;
							var thumb_match = figure.match(/<img src="(https?:\/\/[^/]+\/+images\/+[^"]+)"/);
							if (!thumb_match) {
								console_warn(cache_key, "Unable to find thumbnail match for", { figure: figure, resp: resp });
								return;
							}
							var our_thumburl = decode_entities(thumb_match[1]);
							our_thumburl = norm_fn_thumb(our_thumburl);
							if (thumburl === our_thumburl) {
								main_image = array_indexof(images, link);
							}
						});
					}
					if (!images.length) {
						console_error(cache_key, "Unable to find images in", resp);
						return done(null, false);
					}
					var obj = {
						url: images[main_image],
						extra: extra,
						headers: {
							Referer: extra.page
						}
					};
					if (images.length > 1) {
						obj.album_info = {
							type: "links",
							links: []
						};
						array_foreach(images, function(image, i) {
							obj.album_info.links.push({
								url: image,
								is_current: i === main_image
							});
						});
					}
					return done(obj, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+images\/+([0-9]+x[0-9]+)\/+[^/]+-([0-9]+)\./);
			if (match) {
				var size = match[1].replace(/x/, "");
				var num = match[2].substr(7 + size.length);
				id = parseInt(num);
				if (domain_nowww !== "brazzersbabes.com") {
					id--;
				}
				return {
					url: "http://" + domain_nosub + "/?p=" + id + "#imu-thumb=" + src,
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "forumkinopoisk.ru" ||
			domain === "forums.drom.ru" ||
			domain_nowww === "mexat.com") {
			return src.replace(/\/attachment\.php.*?[?&](attachmentid=[0-9]+).*?$/, "/attachment.php?$1");
		}
		if (domain_nowww === "chat1102.com") return src.replace(/\/cache-img\/+(?:[0-9]+\/+){3}/, "/images/uploads/images/");
		if (domain_nowww === "sobaka.ru") return src.replace(/(\/images\/+(?:image|post)\/+(?:[0-9]{2}\/+){4})_(?:normal|huge|origin)(\.[^/.]*)(?:[?#].*)?$/, "$1_zoom$2");
		if (domain_nowww === "ziaruldeiasi.ro") return src.replace(/(\/gethumb(?:\.details)?\.php).*?[?&](id=[0-9]+).*?$/, "$1?$2&w=99999&h=99999");
		if (domain_nowww === "jyii.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/showyixia\.php.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "ishow.gr") return src.replace(/(^[a-z]+:\/\/[^/]*\/)Thumbnail\.ashx.*?[?&]url=([^&]*).*?$/, "$1$2");
		if (domain_nowww === "scienceleadership.org") return src.replace(/\/thumbnail\/+([0-9]+)\/+[0-9]+x[0-9]+(?:[?#].*)?$/, "/media/open/$1");
		if (domain === "cdn.toomar.net") return src.replace(/\/thumbs\/+([0-9]+)_x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain_nowww === "looti.net") return src.replace(/\/shared_files\/+uploaded\/+([0-9]+)\/+([0-9]+)_([0-9]+)\.[^/.]*(?:[?#].*)?$/, "/index.php?action=downloadfile&topic=$1&upfile=$2&sub=$3");
		if (domain === "i.fokzine.net") return src.replace(/(\/upload\/+(?:[0-9]{2}\/+){2}[^/]*)_[0-9]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "tr-osdcp.qunarzz.com") return src.replace(/(\/img\/+[0-9a-f]+\.[^/._]*)(?:_r)?_[0-9]+x[0-9]+x[0-9]+_[0-9a-f]+\.[^/.]*(?:[?#].*)?$/, "$1");
		if (domain === "file.newswire.co.kr") return src.replace(/(\/data\/+datafile[0-9]+\/+)thumb_[0-9]+\/+/, "$1data/");
		if (domain === "m.gadzetomania.pl") return src.replace(/(-[0-9a-f]+)(?:,[0-9]+){4}(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "mklr.pl") return src.replace(/(\/uimages\/+services\/+.*\/+[0-9]{6}\/+[^/]*)_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "filmpro.ru" && domain.match(/^b[0-9]*\./)) {
			return src.replace(/(\/c\/[0-9]+)\.[0-9]+x[0-9a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "static.leiphone.com") return src.replace(/\/uploads\/+new\/+article\/+[0-9]+_[0-9]+\/+/, "/uploads/new/article/pic/");
		if (domain_nowww === "tolknews.ru") {
			newsrc = src.replace(/(\/uploads\/+galleries_images\/+(?:[0-9]+\/+){2})[a-z]+(\.[^/.]*)(?:{?#].*)?$/, "$1original$2");
			if (newsrc !== src)
				return newsrc;
			return src
				.replace(/(\/picture\/+[0-9]+\/+0x\.)webp/, "$1jpg")
				.replace(/(\/picture\/+[0-9]+\/+)[0-9]*x[0-9]*\./, "$10x.");
		}
		if (domain === "s3.friday-magazine.ch") return src.replace(/(:\/\/[^/]*\/[^/]*\/+)_[^/]+\/+([^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "m.tuniucdn.com") return src.replace(/(\/[^/_.]*)(?:_[a-z][0-9]+){1,}(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "stat.mozi24.hu") return src.replace(/(\/images\/+.*\/+[0-9]+_)[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$10x0$2");
		if (domain_nosub === "autokopen.nl" && domain.match(/^media[0-9]*\./)) {
			return src.replace(/(\/[0-9]+)-[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1-original$2");
		}
		if (domain === "vbmspic.video.friday.tw") return src.replace(/(\/[0-9]+_[0-9]+)_[A-Z](\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "hardware.fi" && domain.match(/^cdn[0-9]+[a-z]?\./)) {
			return src.replace(/\/storage\/+pictures\/+[0-9]+\/+/, "/storage/pictures/");
		}
		if (domain_nowww === "kinofuxy.tv") return src.replace(/\/thumbs\/+(uploads\/+posts\/+[0-9]{4}-[0-9]{2}\/+)[0-9]+_(?:no|y)_(?:no|y)_/, "/$1");
		if (domain_nosub === "web.de" && domain.match(/^i[0-9]*\./)) {
			return src
				.replace(/(\/image\/+[0-9]+\/+[0-9]+)[^/]*?((?:,|%2[cC])pd=[0-9]+)[^/]*(\/+.*)?$/, "$1$2$3")
				.replace(/(\/image\/+[0-9]+\/[^/]+)$/, "$1/a.png");
		}
		if (domain === "img.culturacolectiva.com" ||
			domain_nowww === "daz3d.com" ||
			domain === "images.dailycaller.com" ||
			domain_nosub === "envato.com" ||
			domain === "contents.oricon.co.jp" ||
			domain === "img.i-scmp.com" ||
			domain_nosub === "fashionnetwork.com" ||
			domain_nowww === "notion.so" ||
			domain_nowww === "kanopy.com" ||
			domain === "images.vestiairecollective.com" ||
			domain === "assets-cms.vestiairecollective.com" ||
			domain === "image.static.bstage.in" ||
			domain === "cdn.myfonts.net" ||
			domain_nowww === "theplan.it" ||
			domain_nowww === "economist.com" ||
			domain === "img.mylibrary.digital" ||
			domain === "images.psmcdn.net" ||
			/^[a-z]+:\/\/[^/]+\/+cdn-cgi\/+image\/+[^/]*=[^/]*\//.test(src)) {
			newsrc = src.replace(/^([a-z]+:\/\/[^/]+\/+(?:cdn-cgi\/+)?image\/+[^/]*=[^/]*),(https?:\/\/)/, "$1/$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = urljoin("https://" + domain + "/", src.replace(/^[a-z]+:\/\/[^/]+\/+(?:cdn-cgi\/+)?image\/+[^/]*=[^/]*\/+/, ""), true);
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "d3ls91xgksobn.cloudfront.net") return src.replace(/(:\/\/[^/]+\/+)[^/]+\/+([^/]+\/+images\/)/, "$1q100/$2");
		if (domain === "storage.yandexcloud.net") {
			newsrc = src.replace(/(\/imagesspletnikru\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[^/]+\/+)[^/]+(\.[a-z]+)(?:[?#].*)?$/, "$1original$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/imagesspletnikru\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[^/]+\/+)original\.webp(?:[?#].*)?$/, "$1original.jpeg");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "cara.app") {
			var get_cara_imageid_1 = function(url) {
				return url.replace(/.*\/posts\/+[-0-9a-f]{20,}\/[^-/.?#]+-([^-/.?#]+)-[^/]+(?:[?#].*)?$/, "$1");
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+post\/+([-0-9a-f]{20,})(?:[?#].*)?$/,
				query_for_id: {
					url: "https://cara.app/api/posts/${id}",
					headers: {
						"Accept": "application/json, text/plain, */*"
					},
					json: true,
					imu_mode: "xhr"
				},
				override_cb: function(cb, data) {
					if (!data)
						return cb(data);
					var queries = common_functions["parse_imu_hash"](src);
					var imageid = null;
					var found_imageid = -1;
					if (queries && queries.url) {
						imageid = get_cara_imageid_1(decodeuri_ifneeded(queries.url));
					}
					for (var _i = 0, _a = data.album_info.links; _i < _a.length; _i++) {
						var link_1 = _a[_i];
						link_1.is_current = false;
					}
					var found = false;
					for (var _b = 0, _c = data.album_info.links; _b < _c.length; _b++) {
						var link_2 = _c[_b];
						var link_id = get_cara_imageid_1(link_2.url);
						if (link_id === imageid) {
							found = true;
							link_2.is_current = true;
							data.url = link_2.url;
							break;
						}
					}
					if (!found) {
						data.url = data.album_info.links[0].url;
						data.album_info.links[0].is_current = true;
					}
					cb(data);
				},
				process: function(done, resp, cache_key) {
					var obj = {
						album_info: {
							type: "links",
							links: []
						},
						extra: {
							created_date: new Date(resp.data.createdAt).getTime(),
							caption: resp.data.title,
							author_username: resp.data.slug,
							page: "https://cara.app/post/" + resp.data.id
						}
					};
					for (var _i = 0, _a = resp.data.images; _i < _a.length; _i++) {
						var image = _a[_i];
						if (image.isCoverImg)
							continue;
						obj.album_info.links.push({
							url: "https://cdn.cara.app/" + image.src,
							is_current: false
						});
					}
					done(obj, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "cdn.cara.app") {
			match = src.match(/\/production\/+posts\/+([-0-9a-f]{20,})\/+/);
			if (match) {
				return {
					url: "https://cara.app/post/" + match[1] + "#imu-url=" + encodeURIComponent(src),
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "fashionnetwork.com" && /^(?:[a-z]+\.)?media\./.test(domain)) {
			return src.replace(/(\/[a-f0-9]+\/+)[0-9]+x[0-9]+(?:\.[0-9]+)?\/+([a-f0-9]+\.[^/.]*)$/, "$1$2");
		}
		if (domain_nosub === "fashionnetwork.com") {
			if (/\/img\/+common\/+icons\/+star-[0-9.]+\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain_nowww === "movierj.com") {
			return src
				.replace(/\/cdn-cgi\/+image\/+(?:.*?,)?f=[^/]*\/+(upmovies\/+[^,]*).*?$/, "/$1")
				.replace(/(\/upmovies\/+upload\/+[^/]*)-min(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "contents.oricon.co.jp") {
			newsrc = src.replace(/\/images\/+([^/]+\/+[^/]+\/+[^/?#]+)-w[0-9]+_h[0-9]+(\.[^/.?#]+)(?:[?#].*)?$/, "/upimg/$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "wegotthiscovered.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/wp-content\/+themes\/+wgtc_v2\/+resizer\/+resizer\.php.*?[?&]file=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return urljoin(src, decodeuri_ifneeded(newsrc).replace(/^uploads\//, "/wp-content/uploads/"), true);
		}
		if (domain_nowww === "extra.cz") return src.replace(/\/images\/+thumbs\/+((?:[0-9a-f]{2}\/+){2}[^/]+)-[0-9]+x[0-9]+-(?:shrink|fit)(\.[^/.]*)(?:[?#].*)?$/, "/images/original/$1$2");
		if (domain === "media.services.cinergy.ch") return src.replace(/\/media\/+[^/]*\/+/, "/media/raw/");
		if (domain === "m.s1ar.cc") return src.replace(/^[a-z]+:\/\/[^/]*\/+file\/+(https?:\/\/)/, "$1");
		if (domain === "i.joylada.net") return src.replace(/(\.[^/.]+)\/+thumbnail(?:[?#].*)?$/, "$1");
		if (domain_nowww === "etoland.co.kr") {
			return {
				url: src.replace(/(\/data\/+daumeditor[0-9]*\/+[0-9]+\/+)thumbnail[0-9]*\/+/, "$1"),
				headers: {
					Referer: ""
				},
				can_head: false // 403
			};
		}
		if (domain_nowww === "bomb01.com") return src.replace(/(\/upload\/+news(?:_cover)?\/+)[0-9]+x[0-9]+\/+/, "$1original/");
		if (domain_nosub === "jfcdns.com") return src.replace(/\/thumb\/+((?:up\/+)?[0-9]{4}-[0-9]{2}\/+[0-9]+)_[0-9]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain_nosub === "mysnap.top" && domain.match(/^sv[0-9]*\./)) {
			return src.replace(/:\/\/sv[0-9]*\.([^/]*\/)thumb\.php.*?[?&]src=([^&]*).*?$/, "://sv2.$1thumb.php?src=$2");
		}
		if (domain_nowww === "gttourkorea.com") return src.replace(/(\/data\/+goods\/+[0-9]\/+[0-9]+\/+[^/]*)\.list(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "media.karousell.com") return src.replace(/(\/media\/+photos\/+products\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[^/]*?)(?:_progressive)?_thumbnail(\.[^/.]*)?(?:[?#].*)?$/, "$1$2");
		if (domain === "media.matamata.com") return src.replace(/\/thumbs\/+([0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+-[^/]*)\/+[^/]*(\.[^/.]*)(?:[?#].*)?$/, "/images/$1$2");
		if (domain === "img.haihanxeng.com" ||
			domain === "img.gurugamer.com") {
			return src.replace(/(:\/\/[^/]*\/)resize\/+[-0-9]+x[-0-9]+\/+/, "$1");
		}
		if (domain === "static.appledaily.hk") return src.replace(/(\/images\/+[^/]*\/+[0-9]{8}\/+)[a-z]+\/+/, "$1large/");
		if (domain_nowww === "jk6.cc") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/api\.php.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "meduza.io") return src.replace(/(\/images\/+(?:[0-9]{3}\/+){3})[a-z]+\/+/, "$1original/");
		if (domain_nowww === "popgun.ru") return src.replace(/(\/files\/+[^/]*\/+[0-9]+\/+)[a-z]+\/+/, "$1orig/");
		if (domain_nowww === "rosphoto.com") return src.replace(/\/rimg\/+[0-9]+-[0-9]+(?:-[a-z])?\/+images\/+/, "/images/");
		if (domain_nowww === "thevoicemag.ru") {
			newsrc = src.replace(/(\/upload\/+[^/]+\/+[0-9]+\/+[0-9a-f]{10,})_[a-z]+\./, "$1.");
			if (newsrc !== src)
				return newsrc;
		}
		if ((domain_nosub === "popmeh.ru" && /^images[0-9]*\./.test(domain)) ||
			domain_nowww === "thesymbol.ru" ||
			domain_nowww === "pravilamag.ru" ||
			domain_nosub === "thevoicemag.ru" /*||
		domain_nosub === "graziamagazine.ru" ||
		domain_nosub === "bazaar.ru"*/) {
			return src
				.replace(/(\/upload\/+img_cache\/+[0-9a-f]{3}\/+[0-9a-f]+(?:_[^/_]+_[0-9]+x[0-9]+x[0-9]+x[0-9]+)?)_(?:cropped|fitted)_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/upload\/+img_cache\/.*)\.webp(?:[?#].*)?$/, "$1.jpg");
		}
		if (domain_nowww === "erohd.net") {
			if (/\/plugins\/+content\/+jw_sig\/+jw_sig\/+tmpl\/+Classic\/+images\//.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src.replace(/(\/images\/+news\/+[0-9]{4}\/+[0-9]{2}\/+([^/]+)\/+)img_cache\/+img_cache_[^/.?#]+_-_photo_/, "$1$2_-_Photo_");
		}
		if (domain_nowww === "decoder.ru") return src.replace(/\/media\/+pic_[a-z]+\/+/, "/media/pic_full/");
		if (domain_nowww === "fotogora.ru") return src.replace(/\/img\/+blog\/+[a-z]+\/+/, "/img/blog/or/");
		if (domain_nowww === "photosynthesis.bg") return src.replace(/\/images\/+imagecache\/+[0-9]+_[0-9]+_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "/uploads/article_icons/$1");
		if (amazon_container === "hobbydb-production") {
			return src.replace(/(\/image\/+[0-9]+\/+[0-9]+-[0-9]+-[0-9]+\/+[^/]*)_large(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "d1kls9wq53whe1.cloudfront.net") return src.replace(/(\/articles\/+[0-9]+\/+)[0-9]+x[0-9]+\/+/, "$1ORG/");
		if (domain === "images.animageplus.jp" ||
			domain === "images.rollingstonejapan.com" ||
			domain === "images.entamenext.com") {
			return src.replace(/(\/articles(?:_photos)?\/+[0-9]+\/+[0-9]+\/+)[0-9]+x[0-9]+\/+/, "$1ORG/");
		}
		if (domain === "2019.images.forbesjapan.media") return src.replace(/(\/articles\/+[0-9]+\/+[0-9]+\/+photos\/+)[^/]+\/+/, "$1ORG/");
		if (domain === "images.vrt.be") return src.replace(/(:\/\/[^/]+\/+)[^/]+\/+([0-9]{4}\/+)/, "$1orig/$2");
		if (domain_nowww === "gramerkagoj.com") return src.replace(/(\/[0-9]+)_th(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "img.bisnis.com") return src.replace(/\/thumb(\/+posts\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+\/+[^/?#]*).*?$/, "$1");
		if (domain_nosub === "news18.com" && domain.match(/^images\./)) {
			newsrc = src.replace(/(:\/\/[^/]*\/+[^/]*\/+)uploads\/+[0-9]+x[0-9]+\/+[^/]*\/+([0-9]{4}\/+[0-9]{2}\/+)/, "$1uploads/$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "dainikbhaskar.com" &&
			domain.match(/^i[0-9]*\./)) {
			return src.replace(/(:\/\/[^/]*\/)thumbnails\/+[0-9]+x[0-9]+\/+/, "$1");
		}
		if (domain_nowww === "baocantho.com.vn") return src.replace(/(\/image\/+news\/+[0-9]{4}\/+[0-9]{8}\/+)thumbnail\/+[0-9]+x[0-9]+\/+/, "$1fckimage/");
		if (domain_nowww === "akhbarus.com") return src.replace(/\/thumbnaile\/+[a-z]+\/+[0-9]+\/+[0-9]+\/+news\/+/, "/uploads/files/news/");
		if (domain === "cdn-stylehaus-jp.akamaized.net") return src.replace(/(\/article(?:s|_[a-z]+)\/+[0-9]+\/+[0-9]+_)[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		if (domain_nowww === "primetime.ge") return src.replace(/(\/uploads\/+[^/]+\/+[0-9]{2}-[0-9]{4}\/+[0-9a-f]{10,})_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "bnt.bg" && domain.match(/^nws[0-9]*\./)) {
			return src.replace(/-[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "-original$1");
		}
		if (domain === "storage.face.ba" ||
			domain === "storage.bljesak.info" ||
			domain === "storage.radiosarajevo.ba") {
			return {
				url: src.replace(/(\/(?:article|image)\/+[0-9]+\/+)[0-9]+x[0-9]+\/+/, "$1original/"),
				headers: {
					Referer: src
				}
			};
		}
		if (domain === "ii.cdn.tf") return src.replace(/\/r[0-9]+x[0-9]+\//, "/original/");
		if (domain_nowww === "blaxup.in") return src.replace(/(\/upload\/+img\/+[0-9]{4}\/+[0-9]{2}\/+[^/]*)(?:_[WH][0-9]+){1,}(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "harryweb.net") return src.replace(/(\/plupload\/+uploads\/+[0-9]+\/+)[a-z]+_([0-9a-z]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "m.baishixi.com") {
			return add_http(src.replace(/^[a-z]+:\/\/[^/]*\/p\/+([^/]*\.[^/]*\/)/, "$1"));
		}
		if (amazon_container === "otw-ao3-icons") {
			return src.replace(/(\/icons\/+[0-9]+\/+)[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		}
		if (domain === "media.outnow.ch") return src.replace(/(\/Bilder\/+[0-9]{4}\/+[^/]*\/+(?:[^/]*\/+)?[0-9]+)_[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "pics.kinokadr.ru") return src.replace(/\/gallery\/+thumb\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/gallery/$1");
		if (domain_nosub === "creativecirclemedia.com" && domain.match(/^cdn[0-9]*\./)) {
			return src.replace(/\/[a-z]+\/+([0-9]{8}-[0-9]+-[0-9]+\.[^/.]*)(?:[?#].*)?$/, "/original/$1");
		}
		if (domain_nowww === "middleburgfilm.org") return src.replace(/\/img\/+upload\/+[a-z]+\/+/, "/img/upload/original/");
		if (domain_nowww === "gonet.cz") return src.replace(/\/[0-9]+(\/+[0-9a-f]\/+[0-9a-f]{10,}\.[^/.]*)(?:[?#].*)?$/, "/full$1");
		if (domain === "media.port.hu") return src.replace(/(\/images\/+(?:[0-9]{3}\/+){2})[0-9]+x[0-9]+\/+/, "$1");
		if (domain_nowww === "edb.co.il") return src.replace(/(\/photos\/+[0-9]+(?:_[^/.]*?)?)(?:\.[^/.]*)?(\.[^/.]*)(?:[?#].*)?$/, "$1.full$2");
		if (domain_nowww === "silenzioinsala.com" ||
			domain_nowww === "olharalerta.com.br" ||
			domain_nowww === "wikiquicky.com" ||
			domain_nowww === "dmbtattoo.com" ||
			domain_nowww === "liveatc.net" ||
			domain_nowww === "joinsmediacanada.com") {
			newsrc = src.replace(/.*\/+phpThumb\.php\?(?:.*?&)?src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return urljoin(src.replace(/\/+phpThumb\.php.*/, "/"), decodeURIComponent(newsrc), true);
		}
		if (domain === "img.fdb.cz") {
			return src
				.replace(/(\/galerie)_[a-z]+(\/+[0-9a-f]\/+[0-9a-f]{10,}\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/obrazky)_ikony(\/+[0-9a-f]{10,}\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if ((domain_nosub === "wuaki.tv" ||
			domain_nosub === "rakuten.tv") &&
			/^images(?:-[0-9]*)\./.test(domain)) {
			return {
				url: src.replace(/(?:-(?:width|height|quality)[0-9]+){1,}(\.[^/.]*)(?:[?#].*)?$/, "$1"),
				can_head: false // 415
			};
		}
		if (domain_nosub === "bebee.com" && domain.match(/^std[0-9]*\./)) {
			return src.replace(/\/br(\/+pb\/+[0-9]+\/+[0-9a-f]+)\/+[0-9]+(?:[?#].*)?$/, "/bg$1");
		}
		if (domain_nowww === "mosaically.com") return src.replace(/\/photo\/+[0-9]+\/+([0-9]{4}\/+)/, "/photo/full/$1");
		if (domain === "img.ecartelera.com") return src.replace(/(\/[0-9]+)(?:-[a-z0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1-m$2");
		if (domain === "cdn.releases.com") return src.replace(/(\/img\/+postattachments\/+[0-9]+)\/+[0-9]+(?:[?#].*)?$/, "$1");
		if (domain_nowww === "4words.ru") return src.replace(/\/gallery\/+thumbs\/+[0-9]+\/+/, "/gallery/");
		if (domain_nosub === "myheimat.de" && domain.match(/^media[0-9]*\./)) {
			return src.replace(/(\/[0-9]+)_[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1_orig$2");
		}
		if (domain_nowww === "cumonprintedpics.com") return src.replace(/\/download\/+file\.php.*?[?&](id=[0-9]+).*?$/, "/download/file.php?$1");
		if (domain === "aws.revistavanityfair.es" ||
			domain === "aws.glamour.es" ||
			domain === "aws.glamour.mx") {
			return src.replace(/\/assets\/+[0-9]+x[0-9]+\/+/, "/assets/original/");
		}
		if (domain === "sticker.bahuma.org") return src.replace(/^[a-z]+:\/\/[^/]*\/thumbnail\/+[0-9]+\/+gallery\/+[-A-Za-z0-9]+:(https?:\/\/.*?)\.[^/.]*?$/, "$1");
		if (domain_nowww === "quizizz.com") return src.replace(/(\/_media\/+[^/]*\/+[-0-9a-f]+)_[0-9]+_[0-9]+(?:[?#].*)?$/, "$1");
		if (domain === "news.cube-soft.jp") {
			return src
				.replace(/\/thumb\/+([0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "/image/$1_0$2")
				.replace(/\/thumb\/+(JI[0-9]{10,}\.[^/.]*)(?:[?#].*)?$/, "/image/$1");
		}
		if (domain_nowww === "boutreview.com") return src.replace(/\/media\/+thumbnail\/+([a-z]+)_([0-9]{6})/, "/media/$1/$2");
		if (domain_nowww === "bg.gg" ||
			domain_nowww === "bgm.gg") {
			return {
				url: src.replace(/(:\/\/[^/]*\/i\/[0-9a-f]+)\/+resize(?:_[a-z]+)?(?:[?#].*)?$/, "$1"),
				headers: {
					Referer: "https://te31.com/bggg.php"
				}
			};
		}
		if (domain === "my.evilmilk.com") return src.replace(/(:\/\/[^/]*\/p)\/+.\/+.\/+([^/]*)_t[0-9]*(\.[^/.]*)(?:[?#].*)?$/, "$1/$2$3");
		if (domain_nowww === "bonnassesworld.com") return src.replace(/\/[a-z]+_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/full_$1");
		if (domain === "img.oppaisan.com" ||
			domain_nowww === "megamich.com" ||
			(domain_nosub === "fightingirl.com" && /^img[0-9]*\./.test(domain))) {
			newsrc = src.replace(/(\/lib\/+(?:bbs_)?thumb[0-9]+\.php).*?[?&](p=[^&]*).*?$/, "$1?$2&w=-1");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]*\/+(?:[^/]+\/+)?lib\/+(?:bbs_)?thumb[0-9]+\.php\?(?:.*&)?p=([^&]+)/);
			if (match) {
				var path = base64_decode(match[1]);
				var newpath = path.replace(/.*\/public_html\/+_[^/]+\/+/, "/");
				if (newpath !== path) {
					return urljoin(src, newpath, true);
				}
			}
		}
		if (domain_nowww === "517japan.com") return src.replace(/\/rimg_[0-9]+x[0-9]+\/+attachments\/+/, "/attachments/");
		if (domain === "mpic.haiwainet.cn") {
			newsrc = src.replace(/:\/\/[^/]*\/thumb\/+.\/+uploadfile\/+([0-9]{4}\/*[0-9]{4}\/+[0-9]+)(?:,[wh]_[0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, "://images.haiwainet.cn/$1$2");
			return {
				url: newsrc,
				headers: {
					Referer: "http://m.haiwainet.cn/"
				}
			};
		}
		if (domain === "images.haiwainet.cn") {
			return {
				url: src,
				headers: {
					Referer: "http://news.haiwainet.cn/"
				}
			};
		}
		if (domain_nowww === "fotostate.ru") return src.replace(/^[a-z]+:\/\/[^/]*\/redirect\.php.*?[?&]url=(https?:\/\/[^&]*).*?$/, "$1");
		if (domain === "static.apple.nextmedia.com") return src.replace(/(\/[0-9]{8}\/+)small\/+/, "$1large/");
		if (domain_nowww === "share-ero.pics" ||
			domain === "45.33.110.172" ||
			domain_nowww === "panchira-news.net" ||
			domain_nowww === "idol-gazoum.net") {
			return src.replace(/(\/uploads\/+[^/]*\/+image\/+(?:[0-9]+\/+)?[0-9]+\/+)[a-z]+_(?:resize|thumb)_/, "$1");
		}
		if (domain === "att2.citysbs.com") return src.replace(/(\/image[0-9]*\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]+-[0-9]+\/+)[a-z]+_([0-9]{8}_[0-9a-f]+[^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "d2l930y2yx77uc.cloudfront.net" ||
			domain === "assets.st-note.com") {
			return src
				.replace(/(:\/\/[^/]+\/+img\/+[0-9]+-[0-9a-zA-Z]+\.[a-z]+)(?:[?#].*)?$/, "$1")
				.replace(/(\/production\/+uploads\/+images\/+[0-9]+\/+)(?:[^/]*_)?([0-9a-f]+\.[^/.]*?)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "d1jo5b1m9v3ic.cloudfront.net") return src.replace(/(\/(?:item|profile)\/+[a-z][0-9]+\/+[a-z]?[0-9a-f]+)-[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1-large$2");
		if (domain === "oshiete.xgoo.jp") return src.replace(/(\/images\/+[^/]*\/+[0-9a-z]+\/+[0-9]+_[0-9a-f]+\/+)[A-Z]+(\.[^/.]*)(?:[?#].*)?$/, "$1ORG$2");
		if (domain === "p.mamastar.jp") return src.replace(/(:\/\/[^/]*\/)[a-z]\/+([0-9]{4}-[0-9]{2}\/+)/, "$1$2");
		if (domain === "image.gamechosun.co.kr") return src.replace(/(\/dataroom\/+[^/]*\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2})thumb\/+/, "$1");
		if (domain_nowww === "ascii.jp") {
			return src
				.replace(/(\/img\/.*\/)[a-z]\/+([0-9a-f]+\.)/, "$1o/$2")
				.replace(/(_[0-9]+x[0-9]+)_[0-9]+x(?:[0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "yscore.co.kr" ||
			domain === "data.bepick.net") {
			return src.replace(/(\/bbs\/+[0-9]{4}\/+[0-9]{2}\/+)thumb\/+/, "$1");
		}
		if (domain === "img.tf.co.kr") return src.replace(/\/thumb(\/+(?:[0-9]+_)?[0-9a-f]{5,})_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "my.cdn.tokyo-hot.com") {
			return src
				.replace(/(\/media\/+(?:[-0-9a-z]+|[A-Z]+-[0-9]+)\/+(?:[sv]cap|list_image)\/+[^/]*)\/+[^/]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "tvdeav.com") {
			return src
				.replace(/(\/media\/+banner\/+top\/+[0-9]{10,})\/+[^/]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/media\/+product\/+(?:[a-z]?[0-9]+|[A-Z]+-[0-9]+)\/+(?:[sv]cap|list_image)\/+[^/]*)\/+[^/]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/media\/+product\/+[a-z]?[0-9]+\/+[sv]cap\/+[0-9]+\.)[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1origi$2");
		}
		if (domain_nosub === "bakusai.com" && domain.match(/^img[0-9]*\./)) {
			return src.replace(/(\/imagebbs\/+_nosync\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+)[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1org$2");
		}
		if (domain === "storage.oxii.vn") {
			return src
				.replace(/\/Cache\/+(Sites\/+.*?\/)[0-9]+x[0-9]+\/+/, "/$1")
				.replace(/\/thumbnail\/([^-/]+)-[0-9]+(?:-[0-9]+)?-([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})\/+/, "/Sites/$1/Storage/Images/$2/$3/$4/");
		}
		if (domain_nowww === "edna.cz") return src.replace(/\/runtime\/+cache\/+images\/+[^/]*\/+/, "/runtime/userfiles/");
		if (domain_nowww === "dramaqueen.com.tw") return src.replace(/\/images\/+news\/+[a-z]+\/+/, "/images/news/");
		if (domain_nowww === "smobserved.com") return src.replace(/\/\.TEMP\/+([^/]*?)TEMP[0-9]+x[0-9]+-[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "naftemporiki.gr" ||
			domain === "ctrl.naftemporiki.gr") {
			newsrc = src.replace(/\/fu\/+t\/+([0-9]+)\/+/, "/fu/p/$1/");
			if (false && newsrc !== src)
				return newsrc;
			return {
				url: src.replace(/(\/fu\/+p\/+[0-9]+\/+)(?:[0-9]+|original)\/+(?:[0-9]+|original)\/+/, "$1original/original/"),
				headers: {
					Referer: ""
				}
			};
		}
		if (domain === "cdn.moar.exchange" ||
			domain === "cdn.viral.porn" ||
			domain === "cdn.moar.network" ||
			domain === "cdn.nsfw.exchange") {
			return add_full_extensions(src.replace(/(\/media\/+[0-9]+-[0-9]+\/+)conversions\/+([0-9a-zA-Z]+)-[^-/.]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3"));
		}
		if (domain_nowww === "echosrecordbar.co.za" ||
			amazon_container === "echosrecordbar") {
			return src.replace(/(\/[0-9]+\/+)conversions\/+([0-9]+)-[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		}
		if (domain === "m.blog.hu") return src.replace(/(\/image\/+[^/]*\/+[^/]*\/+)(?:smnxs-([^/]*)|([0-9]+)sm)(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3$4");
		if (domain_nowww === "gosee.de") {
			return src
				.replace(/\/prev\/+[0-9]+x(?:[0-9]+)?\/+images\/+/, "/images/")
				.replace(/\/images\/+preview\/+[0-9a-f]+\/+[0-9]+x(?:[0-9]+)?-/, "/images/content2/");
		}
		if (domain_nowww === "uploadbeta.com" ||
			domain_nowww === "rot47.net") {
			return src.replace(/(\/_s\/+upload\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]+\.[a-zA-Z]+)[0-9]+\.[^/.]*(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "onlyasianpictures.com" ||
			domain_nowww === "avidolpics.com") {
			return src.replace(/(\/galleries\/+[0-9]{4}\/+[0-9]{2}\/+[^/]*\/+)thumbs\/+/, "$1");
		}
		if (domain_nowww === "caribbeancompr.com" ||
			domain_nowww === "caribbeancom.com") {
			return {
				url: src.replace(/\/images\/+s\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/images/l/$1"),
				headers: {
					Referer: "https://" + domain + "/"
				},
				referer_ok: {
					same_domain_nosub: true
				}
			};
		}
		if (domain_nowww === "ai-av.com") return src.replace(/(\/[0-9]{4}\/+[0-9]+-[0-9]+\/+[0-9]+)s(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "blovcdn.com" && domain.match(/^cdn[0-9]*\./)) {
			newsrc = src.replace(/([?&]format=)[^&]*/, "$1s");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+bloglovin\/+(aHR0c[^?#/.]+)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(base64_decode(newsrc));
		}
		if (domain === "img.nimo.tv" ||
			domain === "img-service.nimo.tv") {
			return src.replace(/(:\/\/[^/]*\/t\/+[^/]*.[^/.]*)\/+[^/]*\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1/full/$2");
		}
		if (domain === "wspicsa.vod.nimo.tv") return src.replace(/\/live\/+[0-9]+[*][0-9]+\/+/, "/live/");
		if (domain === "cdn.lesilla.filoblu.com") return src.replace(/\/([a-z]+)\/+content\/+resized\/+[0-9]+x(?:[0-9]+)?\/+\1\/+/, "/$1/");
		if (domain === "mimg.koreatimes.com") return src.replace(/:\/\/[^/]*\/[0-9]+\/+[0-9]+\/+article\/+/, "://image.koreatimes.com/article/");
		if (domain === "d2360iq24ihnyn.cloudfront.net") return src.replace(/(\/image_[0-9a-f]{10,})_small(\.[^/.]*)(?:[?#].*)?$/, "$1_large$2");
		if (domain === "dingyue.ws.126.net") return src.replace(/compressflag(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain === "times.hinet.net") return src.replace(/\/s_([0-9a-f]+(?:-[0-9a-f]+){3,}\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "kpopdaily.co.kr" ||
			domain_nowww === "ujnews.co.kr" ||
			domain_nosub === "segyelocalnews.com" ||
			domain_nowww === "upinews.kr" ||
			domain_nowww === "thedrive.co.kr" ||
			domain_nowww === "k-odyssey.com" ||
			domain === "idsncdn.iwinv.biz" ||
			domain_nowww === "newswiz.kr") {
			regex = /(\/news\/+data\/+[0-9]{8}\/+[a-z]*[0-9]+_[0-9]+)_(?:h[0-9]*|thum)(\.[^/.]*)(?:[?#].*)?$/;
			var extra = {};
			match = src.match(/\/news\/+data\/+[0-9]+\/+p([0-9]{10,})_/);
			if (match) {
				extra = {
					page: "http://www." + domain_nosub + "/news/newsview.php?ncode=" + match[1]
				};
			}
			var urls = [src];
			if (regex.test(src)) {
				urls.unshift(src.replace(regex, "$1_h2$2"));
				urls.unshift(src.replace(regex, "$1_thum$2"));
				urls.unshift(src.replace(regex, "$1_h3$2"));
				urls.unshift(src.replace(regex, "$1$2"));
			}
			return fillobj_urls(urls, { extra: extra });
		}
		if (domain === "image.newstomato.com") return src.replace(/\/thum(?:_[a-z])?_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if ((domain_nosub === "nijie.info" ||
			domain_nosub === "nijie.net") && domain.match(/^pic[0-9]*\./)) {
			return src.replace(/\/__rs_[a-z]*[0-9]+x[0-9]+\/+/, "/");
		}
		if (domain === "cdn-img.jamendo.com" ||
			domain === "images.jamendo.com") {
			return src.replace(/(\/s[0-9]+\/+[0-9]+\/+[a-z]+\/+[0-9]+\.)[0-9]+\./, "$10.");
		}
		if (domain === "usercontent.jamendo.com") return src.replace(/(\?(?:.*&)?width=)[0-9]+([&#].*)?$/, "$10$2");
		if (domain_nowww === "cdbaby.name") return src.replace(/(\/[0-9a-z]+)(?:_[a-z]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1_large$2");
		if (domain_nowww === "livingelectro.com") return src.replace(/(\/files\/+images\/+[^/]*\/+[0-9]+\/+[^/]*)_small(\.[^/.]*)(?:[?#].*)?$/, "$1_large$2");
		if (domain_nosub === "archive.org" && domain.match(/^ia[0-9]*\./)) {
			newsrc = src.replace(/(\/items\/+mbid-[-0-9a-f]+\/+mbid-[-0-9a-f]+)_(?:thumb[0-9]+|itemimage)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src) {
				return add_extensions({
					url: newsrc,
					can_head: false
				});
			}
		}
		if (domain_nowww === "coverartarchive.org") return src.replace(/(\/[0-9]+)-[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "45cat.com") return src.replace(/:\/\/[^/]*\/image\/+[0-9]+\/+thumb\/+([^/]*)-t(\.[^/.]*)(?:[?#].*)?$/, "://images.45cat.com/$1$2");
		if (domain === "images.45cat.com") return src.replace(/-s(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain === "images.45worlds.com" ||
			domain === "images.45spaces.com") {
			return src.replace(/(:\/\/[^/]+\/+)[st]\/+([0-9a-z]{2,3}\/+[^/]+-[0-9a-z]{2,3})-[st](\.[^/.]+)(?:[?#].*)?$/, "$1f/$2$3");
		}
		if (domain === "d16klsh1z1xre7.cloudfront.net") return src.replace(/-size(?:-[a-z]+)?-[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "-size-original$1");
		if (domain_nosub === "magnatune.com") return src.replace(/(\/cover)_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "fast.ilicensemusic.com") return src.replace(/:\/\/[^/]*\/music\//, "://magnatune.com/music/");
		if (domain === "img.1ting.com") {
			return {
				url: src.replace(/\/s[0-9]+_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "/$1"),
				headers: {
					Referer: ""
				}
			};
		}
		if (domain === "omusic.friday.tw") return src.replace(/(\/img\/+album\/+[0-9]+)-[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "rocklyric.jp") return src.replace(/_thum(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain === "spice.eplus.jp") return src.replace(/(\/images\/+[a-zA-Z0-9]{10,})(?:\/+[a-z]+)?(?:[?#].*)?$/, "$1/original");
		if (domain_nowww === "earone.it") return src.replace(/(\.[^/._]+)___th_[0-9]+_[0-9]+\.[^/.]*(?:[?#].*)?$/, "$1");
		if (domain === "n11scdn.akamaized.net") return src.replace(/(\/a1\/+)[0-9]+\/+/, "$1org/");
		if (domain_nowww === "wmg.jp") return src.replace(/\/images\/+(?:pi_[0-9]+x[0-9]+_)?([a-z]+[0-9]+)_LL?\./, "/images/$1_LLL.");
		if (domain_nowww === "bontonland.cz") return src.replace(/\/image\.php.*?[?&]image=([^&]*).*?$/, "/image.php?image=$1");
		if (domain === "s12emagst.akamaized.net") return src.replace(/(\/images\/+res_[0-9a-f]{10,})_[0-9]+x[0-9]+(?:_[a-z]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (amazon_container === "img.iluria.com") {
			return src.replace(/\/[0-9N]+x[0-9N]+(\.[^/.]*)(?:[?#].*)?$/, "/original$1");
		}
		if (domain_nosub === "m24.ru") return src.replace(/(\/[0-9]+)\.[0-9p]+x[0-9p]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "amoeba.com") return src.replace(/\/sized-images\/+[a-z]+\/+(?:[0-9]+\/+){2}uploads\/+/, "/admin/uploads/");
		if (amazon_container === "groundctrl") {
			return src.replace(/(\/media\/+[0-9]+\/+[0-9]+\/+(?:images\/+assets\/+)?)[a-z]+\.([0-9a-zA-Z_]+\.[^/.]*)(?:[?#].*)?$/, "$1original.$2");
		}
		if (domain === "img.manoramaonline.com" ||
			domain_nowww === "theman.in") {
			return src.replace(/\.image\.[0-9]+\.[0-9]+\.[^/.]*(?:[?#].*)?$/, "");
		}
		if (domain_nowww === "washwasha.org") return src.replace(/(\/upload\/+photo\/+gallery\/+[0-9]+\/+[0-9]+\/+)[0-9]+x[0-9]+\/+/, "$1");
		if (domain === "images.mimint.co.kr") return src.replace(/(\/[0-9]{4}\/+(?:[0-9]{2}\/+){2}S[0-9]{10,})[a-z](\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "mimint.co.kr") {
			newsrc = src.replace(/.*\/article\/+thumbnail\.asp\?(?:.*?&)?thumb=([^&]+).*?$/, "$1");
			if (newsrc !== src) {
				return decodeuri_ifneeded(newsrc);
			}
		}
		if (domain_nowww === "hrising.com") {
			return src
				.replace(/\/img\/.*?[?&]p=([^&]*).*?$/, "/data/$1")
				.replace(/(\/data\/+[^/]*\/+)thumbnail\/+attach\/+/, "$1attach/");
		}
		if (domain === "freight.cargo.site" ||
			domain === "cortex.persona.co") {
			return src.replace(/(?:\/(?:[wh](?:\/+[0-9]+)?|t\/+[a-z]+))?\/+i\/+/, "/t/original/i/");
		}
		if (domain === "i.inswave.net" ||
			domain === "f.xza.co.kr") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/(?:img_s|f_img)\.php\?(?:.*?&)?[up]=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "daejonilbo.com") return src.replace(/\/news_photo\/+[a-z]Img\/+/, "/news_photo/oImg/");
		if (domain_nowww === "staraz.co.kr") return src.replace(/(\/Files\/+[0-9]+\/+Images\/+[0-9]{6}\/+[0-9]+(?:_[0-9]+){2})_[a-z](\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "dy6g3i6a1660s.cloudfront.net") {
			return src
				.replace(/(:\/\/[^/]*\/[^/]{15,}\/+)[_a-z0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1orig$2")
				.replace(/(:\/\/[^/]*\/[^/]{15,}\/+)([_a-z0-9]+)(?:-[^/]*)?\/.*(\.[^/.]*)$/, "$1$2$3");
		}
		if (domain === "d3pxmkp5ez9u31.cloudfront.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/sticker\/+(http)/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "dontlinkthis.net") return src.replace(/\/thumbnails\//, "/images/");
		if (domain_nowww === "reho.st") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/thumb\/([^/]*\.[^/]*)/, "$1");
			if (newsrc !== src)
				return add_http(newsrc);
		}
		if (domain_nowww === "funny-anekdot.ru") return src.replace(/\/photos\/+thumb_(p[0-9]+\.[^/.]*)(?:[?#].*)?$/, "/photos/$1");
		if (domain === "imagenes.montevideo.com.uy") return src.replace(/\/_[WH][0-9]+\//, "/");
		if (domain_nowww === "stars-photos.com") return src.replace(/\/resize\.php.*?[?&](id=[0-9]+).*?$/, "/image.php?$1");
		if (domain_nosub === "at.ua") {
			regex = /(\/_ph\/+[0-9]\/+)[0-9]+\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/;
			if (regex.test(src)) {
				return [
					src.replace(regex, "$1$2"),
					src.replace(regex, "$12/$2")
				];
			}
		}
		if (domain_nowww === "missero.ru") return src.replace(/\/images\/+/, "/photo_full/");
		if (domain_nosub === "oneniceapp.com" && domain.match(/^img[0-9]*\./)) {
			return src.replace(/\.half(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "expofashionmagazine.com") return src.replace(/(\/uploads\/+[^/]*\/+(?:[0-9]{4}\/+[0-9]{2}\/+)?)[wh][0-9]+px_/, "$1");
		if (domain_nowww === "maminka.cz") return src.replace(/\/getthumbnail\.aspx.*?[?&](id_file=[0-9]+).*?$/, "/getthumbnail.aspx?w=100000&h=100000&q=100&$1");
		if (domain_nosub === "digitaltrends.com" && domain.match(/^icdn[0-9]*\./)) {
			return src.replace(/-[0-9]+x[0-9]+(?:-c-ar[0-9.]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain === "d26oc3sg82pgk3.cloudfront.net") return src.replace(/(\/image\/+[0-9]+\/+)[^/.]*(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		if (domain_nowww === "glow.pl") return src.replace(/(\/site_media\/+[^/]*\/+)cache\/+([^/]*)_[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		if (domain_nosub === "qhimgs4.com" && domain.match(/^p[0-9]*\./)) {
			return src.replace(/\/bdr\/+[0-9]+__\/+/, "/");
		}
		if (domain_nosub === "publicbroadcasting.net") {
			return {
				url: src.replace(/\/styles\/+[^/]*\/+[^/]*\/+([0-9]{6})\/+/, "/$1/"),
				head_wrong_contentlength: true
			};
		}
		if (domain_nowww === "rabstol.net" ||
			domain_nowww === "vgtimes.ru" ||
			domain_nowww === "youloveit.ru") {
			return src.replace(/(\/uploads\/+gallery\/+)[a-z]+(\/+[0-9]+\/+)/, "$1main$2");
		}
		if (amazon_container === "reacho") {
			return src.replace(/(\/httpimages\/+[0-9]+\/+)[0-9]+\/+(img_[0-9]+[0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "famavip.com") return src.replace(/(:\/\/[^/]*\/)(?:n|lg)\/+/, "$1xl/");
		if (domain_nowww === "notifeed.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/thumb.*?[?&]u=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "atmag-static-timeout.netdna-ssl.com") return src.replace(/(\/media\/+[0-9]{4}\/+[0-9]{2}\/+)sizes\/+([^/]*?)_wo_[0-9]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		if (domain_nowww === "bliasak.bg") return src.replace(/-[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "-original$1");
		if (domain === "news.data.bg") return src.replace(/(\/storage\/+news\/+[0-9]{4}(?:-[0-9]{2}){2}\/+[0-9]+)_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "blogcu.com" && domain.match(/^img[0-9]*\./)) {
			return src.replace(/\/v2\/+images\/+[a-z]+\/+/, "/v2/images/orj/");
		}
		if (domain === "img.a9vg.com") return src.replace(/\/s_([0-9a-f]{20,}\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nosub === "waikeung.info" && string_indexof(src, "id=ror_grab_ttkzm") >= 0) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/.*?[?&]url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "tn.pooh.pw") return src.replace(/^[a-z]+:\/\/[^/]*\/\?(http)/, "$1");
		if (domain_nosub === "animeanime.jp") return src.replace(/\/imgs\/+(?:[^/]*|p\/+(?:jtKDOVlKAvjRrNw8SXAVejagI61Nrq|ypfYP8UGHHv1ocFz1cgmQGihmaytrq|qC3cX52_w9YJ28j7VPltKcSgI60Yrq|GAauWYP2lbxlzgJRQBgLncSmE68prq|F0wY7sTvXbM-zUyY3Ct0qjajM6ytrq|rQC-FVStleeQ4uCDm4cdn6GgF60oy6)_oqaqr)\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/imgs/p/sQnw7oxGTTu4umdJ9vPIDqGgI6ytrq_oqaqr/$1");
		if (domain_nosub === "response.jp" ||
			domain_nosub === "inside-games.jp" ||
			domain_nosub === "gamebusiness.jp" ||
			domain_nosub === "rbbtoday.com" ||
			domain_nosub === "cyclestyle.net" ||
			domain_nosub === "resemom.jp" ||
			domain_nosub === "cinemacafe.net" ||
			domain_nosub === "gamespark.jp" ||
			domain_nowww === "cho-animedia.jp" ||
			domain_nosub === "spyder7.com") {
			var orig = null;
			if (domain_nosub === "response.jp")
				orig = "zkztXxppQllf4-RUXYhKtU1Mz0BBQkNERUZH";
			else if (domain_nosub === "spyder7.com")
				orig = "X4UiqBKWADm8lT-ssAf7B9LTUN-e3dzb2tnY";
			else if (domain_nosub === "inside-games.jp")
				orig = "1UNSdyJKsYSbpw0t-zkIAAoLiAcGBQQDAgEA";
			else if (domain_nosub === "gamebusiness.jp")
				orig = "bo91TFR6ywNB2t2bceYnWYiJCoWEh4aBgIOC";
			else if (domain_nosub === "rbbtoday.com")
				orig = "O24ii8l5s579T1Z71xNOb0xNzkFAQ0JFREdG";
			else if (domain_nosub === "cyclestyle.net")
				orig = "SG6XwypJr-L-0cc0vCoMDigpqiUkJyYhICMi";
			else if (domain_nosub === "resemom.jp")
				orig = "iznZhtjPh4xcpFmdtjU2rkRFxklIS0pNTE9O";
			else if (domain_nosub === "cinemacafe.net")
				orig = "JgD9AR1Ir8Z47f6Bz3cIbgIDgA8ODQwLCgkI";
			else if (domain_nosub === "gamespark.jp")
				orig = "PseAHU_gq3GEwRLM5htwMwoLvAaDYAQDAgEA";
			else if (domain_nosub === "cho-animedia.jp")
				orig = "Dybu1wcglzgN6YILHHa9fs3Ml8DBwsPExcbH";
			return src.replace(/\/imgs\/+(?:[^/]*|p\/+[^/]{30,})\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/imgs/p/" + orig + "/$1");
		}
		if (domain_nowww === "pixsell.hr") {
			newsrc = src.replace(/\/scripts\/+get_image\.php.*?[?&](image_id=[0-9]+).*?$/, "/scripts/get_image.php?$1");
			if (newsrc !== src)
				return newsrc;
			if (src.match(/\/scripts\/+get_image\.php\?image_id=[0-9]+$/)) {
				return {
					url: src,
					filename: src.replace(/.*image_id=([0-9]+)$/, "$1")
				};
			}
		}
		if (domain_nowww === "sharecg.com") {
			return src
				.replace(/\/images\/+[a-z]+\/+([0-9]+\.[^/.]+)(?:[?#].*)?$/, "/images/original/$1")
				.replace(/\/get_image\.php\?(?:.*&)?upload_image_id=([0-9]+).*?$/, "/images/original/$1.jpg");
		}
		if (domain_nowww === "softline.com.bd" ||
			domain_nowww === "softline.uz") {
			return src.replace(/\/uploads\/+resizer\/+i\/+((?:[0-9a-f]{2}\/+){8,}origin)_([a-z]+)-[^/]*(?:[?#].*)?$/, "/uploads/i/$1.$2");
		}
		if (googlestorage_container === "wzukusers") {
			return src.replace(/(\/images\/+[0-9a-zA-Z]+\/+[^/]*)_d[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "mindmaps.ai-pharma.dka.global") return src.replace(/(\/storage\/+[^/]*)_[0-9]+px\/+/, "$1/");
		if (domain_nowww === "ibusiness.de") return src.replace(/\/cgi-bin\/+resize\/+(upload\/+bilder\/+[^/]*?)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "picadilist.fr") return src.replace(/\/mini\/+img_[0-9]+_[0-9]+\/+/, "/images/upload_gen/");
		if (domain_nowww === "mirrorlessreports.com" ||
			domain_nowww === "canonnews.com") {
			return src.replace(/\/[^-/.]*?(img-[^/]*\.[^/.]*)(?:[?#].*)?$/, "/$1");
		}
		if (domain === "d9j5qtehtodpj.cloudfront.net") return src.replace(/\/thumbnail\/.*?[?&]image=([0-9a-f]+).*?$/, "/media/$1/image");
		if (domain === "cdn.46graus.com") return src.replace(/(\/files\/+portfolio\/+[^/]*\/+[-0-9a-f]+\/+)[^/]*_([-0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1original_$2");
		if (domain_nowww === "spirig-schulungscenter.ch") return src.replace(/(\/uploads\/+[^/]*\/+)[0-9]+x[0-9]+_[0-9]+x[0-9]+\/+/, "$1");
		if (domain === "static.caravan.kz") return src.replace(/\/image\/+[0-9]+\/+[0-9]+\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/image/$1");
		if (domain_nosub === "crhoy.net" && domain.match(/^icdn[0-9]*\./)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/(?:[whq]\/+[0-9]+\/+){1,}[a-z]+\/+[0-9]+\/+c\/+[0-9]+\/+s\/+([^/]*\.[^/]*\/+)/, "$1");
			if (newsrc !== src)
				return add_http(newsrc);
		}
		if (domain_nosub === "ppstatic.pl") return src.replace(/(\/[^/.,]*)(?:,(?:size|[whq]),[^/,.]*){1,}(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "uzone.id" && domain.match(/^cdn[0-9]*\./)) {
			return src.replace(/(\/assets\/+uploads\/+.*?)\/+[0-9]+(?:[?#].*)?$/, "$1");
		}
		if (amazon_container === "fuckin.news") {
			return src.replace(/(\/posts\/+images\/+(?:[0-9]{3}\/+){3})[a-z]+\/+/, "$1original/");
		}
		if (domain_nowww === "dengekionline.com") return src.replace(/(\/images\/+.*?)_main(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "hypnoweb.net") return src.replace(/(\/photo\/+[0-9]+\/+[^/]*\/+)mini\/+/, "$1ok/");
		if (domain_nowww === "allbox.tv") return src.replace(/(\/[0-9a-f]+)_small(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "api.superguidatv.it") {
			return {
				url: src.replace(/\?.*/, ""),
				redirects: true
			};
		}
		if (domain === "cloud.filmfed.com") return src.replace(/\/[a-z]_([0-9a-f]+(?:-[0-9a-f]+){2,}\.[^/.]*)(?:[?#].*)?$/, "/o_$1");
		if (domain === "images.hi67.cn") {
			return {
				url: src,
				headers: {
					Referer: "",
					Origin: ""
				}
			};
		}
		if (domain === "midiastm.gazetaonline.com.br" ||
			domain === "static.gazetaonline.com.br") {
			return src.replace(/\/[0-9]+x[0-9]+\/+[0-9]+_([^/]*)(?:[?#].*)?$/, "/$1");
		}
		if (domain_nosub === "gifposter.com" && string_indexof(src, "/images/") >= 0) {
			return src.replace(/\/[a-z](_[0-9]+\.[^/.]*?)(?:_[a-z]+)?(?:[?#].*)?$/, "/p$1");
		}
		if (domain_nowww === "xiuren.org") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+cover\.php\?(?:.*?&)?src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			return src.replace(/\/Thum\/+Thum-/, "/");
		}
		if (domain_nowww === "haipic.com") return src.replace(/(\/icon\/+)[a-z]_[0-9]{3}([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "photo.l99.com") return src.replace(/(:\/\/[^/]*\/)[a-z]+\/+/, "$1source/");
		if (domain_nowww === "cinemapassion.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/miniature2\.php.*?[?&]pic=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (amazon_container === "abandomedia") {
			return src
				.replace(/(\/db\/+)thumb\/+/, "$1foto/")
				.replace(/(\/db\/+[a-z]+)_thumb\/+/, "$1/");
		}
		if (domain_nowww === "arlingtonhotelgroup.com") return src.replace(/\/[0-9]+@[0-9]+\./, "/@.");
		if (domain_nowww === "cine-vox.com" ||
			domain_nowww === "cinemorvan.fr") {
			return src.replace(/(:\/\/[^/]*\/+[^/]*\/+)[0-9]+x[0-9]+\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "cdnscreenshot.xyz") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/retail\.php.*?[?&]src=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "comic.systems") return src.replace(/(\/images\/.*?)-thumb(?:[?#].*)?$/, "$1");
		if (domain_nosub === "gittigidiyor.net") return src.replace(/(\/[0-9]+\/+)tn[0-9]+\/+([0-9]+)_tn[0-9]+(_[0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		if (domain_nowww === "impawards.com") {
			return {
				url: src
					.replace(/(\/(?:20|19)[0-9]{2}\/+)thumbs\/+/, "$1posters/")
					.replace(/\/med_([^/]*)(?:[?#].*)?$/, "/$1")
					.replace(/(?:_xx?lg)?(\.[^/.]*)(?:[?#].*)?$/, "_xxlg$1"),
				headers: {
					Referer: "",
					Origin: ""
				}
			};
		}
		if (domain_nowww === "lescinemasaixois.com") return src.replace(/(\/affiche\/+affiche_[0-9]+\.[^/.?&#]*).*?$/, "$1");
		if (domain_nowww === "sortiesdvd.com") return src.replace(/\/+affichethumb\/+/, "/affiche/");
		if (domain_nowww === "cineswellington.com") return src.replace(/\/zoom\/+zoom_/, "/");
		if (domain === "img.seriebox.com") return src.replace(/\/_thumbs\/+[0-9]+_[0-9]+\/+/, "/");
		if (domain === "d3ewd3ysu1dfsj.cloudfront.net") return src.replace(/(\/images\/+stories\/+)[a-z]+\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1original/$2");
		if (domain_nowww === "mairiedesamoens.fr") return src.replace(/\/iso_upload\/+([0-9]+)\/+t_[0-9]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/imageProvider.aspx?resource=$1&fn=$1$2");
		if (domain_nowww === "citizenkid.com") return src.replace(/\/uploads\/+medias\/+cache\/+[^/]*\/+[^/]*\/+[^/]*\/+uploads\/+medias\/+/, "/uploads/medias/");
		if (amazon_container === "weclap-prodcluster") {
			return src.replace(/(\/images\/+[0-9]+\/+)[a-z]+\/+([0-9a-f]+\/+)/, "$1original/$2");
		}
		if (domain_nosub === "sogou.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/net\/+.\/+[0-9]+\/+link.*?[?&]url=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nosub === "sogoucdn.com" && /^img[0-9]*\./.test(domain)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+v2\/+thumb\/+.*?\?(?:.*&)?url=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "cinemapalace.ch") return src.replace(/\/uploads\/+[0-9]+_[0-9]+_/, "/uploads/");
		if (domain === "cdn.simplesite.com") {
			return {
				url: src.replace(/\._sz(?:[wh][0-9]+){1,}_(\.[^/.]*)(?:[?#].*)?$/, "$1"),
				can_head: false // 404
			};
		}
		if (domain_nowww === "inews.bg") {
			return src
				.replace(/(\/pictures\/+[0-9]+)_[0-9]*_[0-9]*(?:_[0-9]+x[0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/pictures\/+[0-9]+)_[0-9]*_[0-9]*_([0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "$1___$2$3");
		}
		if (domain_nosub === "starofservice.com" && domain.match(/^cdn-uploads[0-9]*\./)) {
			return src.replace(/(\/uploads\/+pj\/+)thumbs(?:-[a-z]+)?\/+/, "$1");
		}
		if (domain_nowww === "hayabusa.io" ||
			domain === "abm.hayabusa.media") {
			var queries = get_queries(src);
			var basename = src.replace(/.*\/([^/?#]+)(?:[?#].*)?$/, "$1");
			var splitted = basename.split(".");
			var newsplitted = [];
			array_foreach(splitted, function(x, i) {
				if (i === 0) {
					newsplitted.push(x);
					return;
				}
				if (i === splitted.length - 1) {
					if (/^(jpe?g|png|gif|webp|auto)$/.test(x)) {
						newsplitted.push(x);
						return;
					}
				}
				var kv = x.match(/^(width|height|quality|ttl|headercache|fit|background|format|[hwqv])-?([0-9a-z]+)$/);
				if (!kv) {
					newsplitted.push(x);
					return;
				}
				var key = kv[1];
				var value = kv[2];
				if (!(key in queries))
					queries[key] = value;
			});
			queries.q = 100;
			queries.quality = 100;
			if (queries.format === "webp")
				delete queries.format;
			newsrc = keep_queries(add_queries(src.replace(/\/[^/]+(?:[?#].*)?$/, "/" + newsplitted.join(".")), queries), ["q", "quality", "format"]);
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "d13krdvwknzmgv.cloudfront.net" ||
			domain === "times.abema.tv") {
			if (/\/files\/+user\/+images\/+design\/+(?:video-icon|play)\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			return src.replace(/(\/files\/+(?:temp\/+)?)rcms_conv_webp\/+(?:files\/+)?(.*?)(?:\.jpg)?_[0-9]{5,}\.webp(?:[?#].*)?$/, "$1$2.jpg");
		}
		if (domain === "s.dou.ua") return src.replace(/(\/img\/+avatars\/+)[0-9]+x[0-9]+_/, "$1");
		if (domain === "d3kq2xhl2rew87.cloudfront.net" ||
			amazon_container === "gfinity-img") {
			return src.replace(/(\/user\/+image\/+(?:[0-9]\/+){3})[0-9]+x[0-9]+(?:-[a-z]+)?\/+/, "$1");
		}
		if (domain_nosub === "tokopedia.net") return src.replace(/\/img\/+cache\/+[0-9]+(?:x[0-9]+)?(?:-[a-z]+)?\/+(.*?)(?:(\.[^/.]+)?\.webp)?(?:[?#].*)?$/, "/img/$1$2");
		if (domain === "icdn.2cda.pl") {
			newsrc = src.replace(/\/thumbs\/+([0-9a-f]+(?:-[0-9]+)?\.[^/._]*)(?:_[^/]*)?(?:[?#].*)?$/, "/oryginalne/$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "cda.pl") {
			var remove_cda_url_artifacts = function(str) {
				return str.replace(/_(?:XDDD|CDA|ADC|CXD|QWE|Q5|IKSDE)/g, "");
			};
			var decipher_cda1 = function(str) {
				var out = "";
				for (var i = 0; i < str.length; i++) {
					var code = str.charCodeAt(i);
					var z;
					if (code >= 97 && code <= 122) {
						z = 122;
					} else if (code >= 65 && code <= 90) {
						z = 90;
					} else {
						out += str[i];
						continue;
					}
					if (z >= (code + 13)) {
						out += string_fromcharcode(code + 13);
					} else {
						out += string_fromcharcode(code - 13);
					}
				}
				return out;
			};
			var decipher_cda2 = function(str) {
				var out = "";
				for (var i = 0; i < str.length; i++) {
					var code = str.charCodeAt(i);
					if (code >= 33 && code <= 126) {
						out += string_fromcharcode(33 + (code + 14) % 94);
					} else {
						out += str[i];
					}
				}
				return out;
			};
			var fixup_cda_url = function(url) {
				url = url
					.replace(".cda.mp4", "")
					.replace(".2cda.pl", ".cda.pl")
					.replace(".3cda.pl", ".cda.pl");
				if (string_indexof(url, "/upstream") >= 0) {
					return "https://" + url.replace("/upstream", ".mp4/upstream");
				} else {
					return "https://" + url + ".mp4";
				}
			};
			var decipher_cda = function(url) {
				url = remove_cda_url_artifacts(url);
				url = decodeURIComponent(url);
				url = decipher_cda2(url);
				return fixup_cda_url(url);
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([0-9]+[a-z]*)(?:\/+[^/]*)?(?:[?#].*)?$/,
				query_for_id: "https://www.cda.pl/video/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<div id="mediaplayer[0-9a-z]+" player_data='({[^']+})'/);
					if (!match) {
						console_error(cache_key, "Unable to find player_data from", resp);
						return done(null, false);
					}
					var json = JSON_parse(decode_entities(match[1]));
					var video = json.video;
					var decoded_file = decipher_cda(video.file);
					var title = decodeURIComponent(video.title);
					var thumb = urljoin(resp.finalUrl, video.thumb, true);
					var urls = [];
					urls.push({
						url: decoded_file,
						video: true
					});
					urls.push(thumb);
					return done(fillobj_urls(urls, {
						extra: {
							page: resp.finalUrl,
							caption: title
						}
					}), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "cda.pl" && options.element) {
			newsrc = common_functions["get_pagelink_el_matching"](options.element, /^[a-z]+:\/\/(?:www\.)?cda\.pl\/+video\/+([0-9]+[a-z]*)(?:\/+[^/]*)?(?:[?#].*)?$/);
			if (newsrc)
				return newsrc;
		}
		if (domain === "i.imagesup.co") return src.replace(/\/sz\/+[-0-9]+x[-0-9]+\/+images\/+/, "/images/");
		if (domain_nosub === "kgimg.com" ||
			domain === "imgessl.kugou.com") {
			return src.replace(/(\/[a-z]+\/+)[0-9]+\/+([0-9]{8}\/+[0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "s.starladder.com") return src.replace(/(\/uploads\/.*\/)thumb_[0-9]+_([0-9a-f]{10,}\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "cilacila.com") return src.replace(/\/uploads\/+thumb(\/+[0-9]{8}\/+[0-9]+\/+[^/]*?)(?:_[0-9]+){3}(\.[^/.]*)(?:[?#].*)?$/, "/uploads/$1$2");
		if (domain === "vip.img.cdn.keeng.vn" ||
			domain === "image.keeng.com.kh") {
			regex = /\/images\/+images_thumb\/+(?:[^/]+\/+)?([^/]+\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[^/]+)_[0-9]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/;
			return [
				src.replace(regex, "/$1$2"),
				src.replace(regex, "/images/$1$2")
			];
		}
		if (domain_nowww === "highresaudio.com") return src.replace(/(\/imgcache\/+[0-9a-f]{20,}\/+[^/]*?)_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "d1wtzzt4oxg683.cloudfront.net") return src.replace(/\/images\/+covers\/+[a-z]+\/+/, "/images/covers/");
		if (domain_nowww === "nnmassets.cf") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/forum\/+image\.php\?(?:.*?&)?link=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain_nosub === "jpc.de" && domain.match(/^media[0-9]*\./)) {
			return {
				url: src.replace(/\/image\/+[wh][0-9]+\/+(?:[a-z]+\/+)?/, "/image/w999999/"),
				can_head: false // 0
			};
		}
		if (domain_nowww === "mall.cz" ||
			domain === "i.cdn.nrholding.net") {
			return src.replace(/(:\/\/[^/]*\/(?:i\/+)?[0-9]+)\/+[0-9]+(?:\/+[0-9]+)?\/*(?:[?#].*)?$/, "$1");
		}
		if (domain === "eshop.fayaque.com.tw") return src.replace(/\/img\/+[0-9]+x[0-9]+\/+/, "/img/original/");
		if (domain === "img.shoplineapp.com") return src.replace(/(\/media\/+[^/]*\/+[0-9a-f]{8,}\/+)[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		if (domain === "media.blogto.com") return src.replace(/\?.*/, "?w=-1");
		if (domain === "hbb.afl.rakuten.co.jp") {
			if (src.match(/^[a-z]+:\/\/[^/]*\/hgp\/+\?/)) {
				var queries = get_queries(src);
				newsrc = queries.pc || queries.m;
				if (newsrc)
					return decodeuri_ifneeded(newsrc);
			}
		}
		if (amazon_container === "broadtime_thumbnails") {
			return src.replace(/(:\/\/broadtime_|\.amazonaws\.com\/broadtime_)thumbnails([^/]*\.amazonaws\.com)?\/[0-9]+\/+([0-9]+)\/+[0-9]+(?:%3A|:)[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1photo$2/$3");
		}
		if (domain === "knihy.abz.cz") return src.replace(/(\/imgs\/+[^/]*\/+img_[0-9]+_)[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1orig$2");
		if (domain_nowww === "readdork.com") return src.replace(/\/images\/+_crop[0-9]+x[0-9]+\/+/, "/images/");
		if (domain_nosub === "sueddeutsche.de") return src.replace(/(\/image\/+sz\.[0-9]+\.[0-9]+)\/+.*$/, "$1");
		if (domain_nowww === "swensonhomesolutions.com"
		) {
			return src.replace(/\/images\/+covers\/+/, "/images/realsize/");
		}
		if (domain === "media.arkansasonline.com") return src.replace(/(\/img\/+photos\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[^/]*)__t[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "jintiankansha.me" && domain.match(/^img[0-9]*\./)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/get\?(?:.*?&)?src=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "cdjournal.com") return src.replace(/\/image\/+jacket\/+[0-9]+\/+/, "/image/jacket/large/");
		if (domain_nowww === "redwallpapers.com") return src.replace(/\/public\/+redwallpapers-[^/]*\//, "/download/original/");
		if (domain_nowww === "show-biz.by") return src.replace(/(\/(?:(?:gallery|blog)_image|upimg_file)\/+[0-9]+\/+)[^/]+(\/+_v=[0-9a-f]+)?(?:[?#].*)?$/, "$1original$2");
		if (domain_nowww === "songtexte.co") return src.replace(/(\/Images\/+[^/]+\/+)Thumbs\/+/, "$1");
		if (domain === "d2h1pu99sxkfvn.cloudfront.net") {
			newsrc = src.replace(/\/([PU])[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/$10$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (host_domain_nowww === "depop.com") {
			return {
				url: src,
				need_blob: true
			};
		}
		if (domain === "img.joomcdn.net") return src.replace(/(\/[0-9a-f]{20,})_[0-9]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1_original$2");
		if (domain_nowww === "fashionbay.gr") return src.replace(/\/thumber\.php\?(?:.*?&)?img=([^&]*).*?$/, "/$1");
		if (domain_nowww === "ft.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/__origami\/+service\/+image\/+v2\/+images\/+[^/]*\/+(https?.*?)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			match = src.match(/\/ftcms(?::|%3A)([-0-9a-f]{10,})/);
			if (match) {
				return "https://d1e00ek4ebabms.cloudfront.net/production/" + match[1] + ".jpg";
			}
		}
		if (domain === "cdnimg.rg.ru") return src.replace(/(\/img\/+content\/+.*)_t_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "files.der-farang.com") return src.replace(/\/cache\/+[0-9]+x[0-9]+\/+[0-9]+\/+[0-9]+\/+files\/+/, "/files/");
		if (domain_nosub === "cdnvideo.ru" && domain.match(/^phototass[0-9]*\./)) {
			return src.replace(/\/(?:width|height)\/+[0-9]+_[0-9a-f]+\/+tass\/+/, "/tass/");
		}
		if (domain_nosub === "cdnvideo.ru" && /^img[0-9]*tv\./.test(domain)) {
			return src.replace(/\/webp\/+shared\//, "/shared/");
		}
		if (domain_nowww === "duonao.tv") return src.replace(/(\/upload\/+[^/]*\/+[0-9]{8,})s(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "independent.bbvms.com") return src.replace(/\/pthumbnail\/+[0-9]+\/+[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/pthumbnail/0/0$1");
		if (domain === "media-manager.starsinsider.com") return src.replace(/\/gallery\/+[0-9]+\/+/, "/gallery/0/");
		if (domain === "images.madame.de") {
			if (src.match(/^[a-z]+:\/\/[^/]*\/[^/.,]*(?:,[a-z]+=(?:[^,]+|[0-9.,]+)){1,}(?:\.[^/.]*)?(?:[?#].*)?$/)) {
				var filename = src.replace(/^[a-z]+:\/\/[^/]*\/+([^/.,]*).*?$/, "$1");
				var id = src.replace(/.*?,(id=[0-9a-z]+).*?$/, "$1");
				var brand = src.replace(/.*?,(b=[0-9a-z]+).*?$/, "$1");
				var ext = src.replace(/.*?(\.[^/.]*)(?:[?#].*)?$/, "$1");
				if (ext === src)
					ext = "";
				if (id !== src && brand !== src) {
					return {
						url: "https://images.madame.de/" + filename + "," + id + "," + brand + ",rm=sk" + ext,
						filename: filename + ext
					};
				}
			}
		}
		if (domain_nowww === "tportal.hr") return src.replace(/\/media\/+thumbnail\/+[0-9]+x[0-9]+\/+/, "/media/thumbnail/w1000/");
		if (domain_nowww === "nudecelebs.world" ||
			domain_nowww === "nudevideovixens.com" ||
			domain_nowww === "hollywoodnude.club" ||
			domain_nowww === "nakedebonycelebs.com" ||
			domain_nowww === "famousandnude.com" ||
			domain_nowww === "famousandnude.net" ||
			domain_nowww === "selenagomeznude.club" ||
			domain_nowww === "nude-scene.net" ||
			domain_nowww === "nudecelebrities.mobi" ||
			domain_nowww === "nudeasiancelebs.com" ||
			domain_nowww === "bigtitscelebrities.com" ||
			domain_nowww === "famousbombshells.com" ||
			domain_nowww === "latinacelebrities.com" ||
			domain_nowww === "selenagomeznude.club" ||
			domain_nowww === "xxxcelebscenes.com" ||
			domain_nowww === "nicolekidmannudes.com") {
			return src.replace(/(\/(?:g|gals|xhc)\/[0-9]{5,}-[^/]*\/[^/]*-[0-9]+)-(?:[0-9][0-9]+|tn)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "kino.search.ch") return src.replace(/(\/images\/+..\/+[^/]*)_m(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "teluguone.com") return src.replace(/(\/uploadsExt\/+uploads\/+.*)_small(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "blog-news.it") return src.replace(/(\/images\/+[^/]*\/+)tmb\/+/, "$1big/");
		if (domain_nowww === "polecamfilm.pl") return src.replace(/\/min(\/+[0-9]+_[a-z][0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain_nosub === "ltmcdn.com" && domain.match(/^t[0-9]*\.salir\./)) {
			return src.replace(/_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "_orig$1");
		}
		if (domain === "images.curved.de") return src.replace(/\/article_teaser_md\/+/, "/article_detail_xl/");
		if (domain === "ocio.diariodeibiza.es") return src.replace(/__[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain === "img.movist.com") {
			newsrc = src.replace(/(:\/\/[^/]*\/)\?(?:.*?&)?img=([^&]*).*?$/, "$1data/imgroot$2");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain_nosub === "c-ctrip.com" && domain.match(/^youimg[0-9]*\./)) {
			return src.replace(/(\/target\/+[0-9a-z]+)(?:_[A-Z0-9]+){1,}(\.[^/.?#]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nosub === "china.com.cn") return src.replace(/((?:\/img[0-9]*\/+[0-9]{4}(?:_[0-9]{2}){2}|nimg\/+[0-9]{8})\/+[0-9]+\/+(?:img_)?[0-9a-f]{20,})(?:_[0-9]+){2}(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "assets.jalantikus.com") return src.replace(/\/assets\/+cache\/+[0-9]+\/+[0-9]+\/+userfiles\/+/, "/assets/cache/0/0/userfiles/");
		if (domain === "res.idollook.cn") return src.replace(/(\/[0-9]+\/+)(?:thumb_)?([0-9a-f]{20,}\.[^/.!?#]*)(?:[?#!].*)?$/, "$1$2");
		if (domain_nosub === "altervista.org" ||
			(domain_nowww === "3xcelebs.com" && string_indexof(src, "/cache/") >= 0)) {
			newsrc = src.replace(/\/cache\/+(.*?)_[0-9]+(?:_c[wh][0-9]+)*(?:_thumb)?(\.[^/.]*)(?:[?#].*)?$/, "/albums/$1$2");
			if (newsrc !== src)
				return add_full_extensions(newsrc);
		}
		if (domain_nowww === "haberkonseyi.com") return src.replace(/\/news_t\/+/, "/news/");
		if (domain_nowww === "snimai.com") {
			return src
				.replace(/(\/photos\/+[0-9]{8}\/+[0-9a-z]+\/+)thumbs\/+/, "$1")
				.replace(/(\/photos\/+[0-9]{8}\/+[0-9a-f]+)_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "fem-img.herokuapp.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/[0-9a-f]{20,}\/\?(?:.*&)?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nosub === "qunliao.info" && domain.match(/^img[0-9]*\./)) {
			return src.replace(/\/[-0-9]+x[-0-9]+\/+/, "/-x-/");
		}
		if (domain_nosub === "phnx.pics") return src.replace(/-[a-z_]+_[0-9]+(?:X[a-z_]+_[0-9]+)*(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain === "condenast-media.gcdn.co") return src.replace(/\/[wht][-0-9]+(?:x[-0-9]+)?(?:[?#].*)?$/, "/w9999999999");
		if (domain_nowww === "quvnoq.com") return src.replace(/\/post\/+[a-z]+\/+/, "/post/original/");
		if (domain_nosub === "kontraband.com" && domain.match(/^cdn[0-9]*\./)) {
			return src.replace(/(\/uploads\/+image\/+[0-9]{4}\/+(?:[0-9]{1,2}\/+){2})[a-z]+_([0-9a-z]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nosub === "52shijing.com" && domain.match(/^pic[0-9]*\./)) {
			return src.replace(/(\/file\/+[0-9]{8}\/+[0-9a-f]+)(?:_[0-9]+){2}(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nosub === "qmde.de" && domain.match(/^pix[0-9]*\./)) {
			return src.replace(/(\/pics\/+gallery\/+[^/]*)__w[0-9]+xh[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "nujhrcqkiwag1408085.cdn.ntruss.com") return src.replace(/(\/static\/+upload\/+[^/]*\/+)[0-9]+x[0-9]+\/+/, "$1");
		if (domain_nowww === "chisholm-poster.com") return src.replace(/(:\/\/[^/]*\/)small\/+/, "$1large/");
		if (domain_nowww === "doublage.qc.ca") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/pi\.php\?(?:.*?&)?img=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return urljoin(urljoin(src, "/files", true), decodeURIComponent(newsrc));
		}
		if (domain === "s3.bukalapak.com") return src.replace(/(\/img\/+[0-9]+\/+)[wh]-[0-9]+\/+/, "$1original/");
		if (amazon_container === "mz-prod") {
			return src.replace(/(\/uploads\/+photo\/+file\/+[0-9]+\/+)[a-z]+_([0-9a-f]{20,}[^/]*\.[^/.]*)(?:{?#].*)?$/, "$1$2");
		}
		if (domain === "capebreton.lokol.me") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/remote\.jpg\.ashx\?(?:.*?&)?urlb64=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain === "i.moveek.com") return src.replace(/\/media\/+resized\/+[^/]*\/+/, "/media/");
		if (domain === "i.ryt9.com" ||
			domain === "ip.kolonmall.com" ||
			domain === "imageproxy.haaartland.com") {
			return src.replace(/^[a-z]+:\/\/[^/]*\/[0-9]*x[0-9]*\/+http/, "http");
		}
		if (domain === "cinemas.nos.pt") return src.replace(/\/RenderImage\.ashx\?(?:.*?&)?file=([^&]*).*?$/, "/RenderImage.ashx?file=$1");
		if (domain === "img.pooq.co.kr") {
			return {
				url: src.replace(/(\/movieImg\/+.*?)_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2"),
				can_head: false // 400
			};
		}
		if (domain === "i.toynewsi.com") return src.replace(/\/g\/+generated\/+(.*?)__scaled_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/g/albums/$1$2");
		if (domain_nowww === "piletimaailm.com") return src.replace(/(\/pictures\/+[0-9]+)\/+[a-z]+(?:[?#].*)?$/, "$1");
		if (domain_nowww === "meowg.com") return src.replace(/(\.[a-z]+)-[0-9]+\.[^/.]*(?:[?#].*)?$/, "$1");
		if (domain === "photos-epg.media-press.tv") return src.replace(/(:\/\/[^/]*\/)(?:width|height)[0-9]+\/+/, "$1original/");
		if (domain === "blog.jinbo.net") return src.replace(/\/thumbnail\/+([0-9]+\/+[^/]*)\.w[0-9]+-h[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/attach/$1$2");
		if (domain === "cdnpuc.sinchew.com.my") return src.replace(/\/t[0-9]*_[(][0-9X]+[)]([-0-9a-f]{30,}\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "lebanonfiles.com") return src.replace(/\/files\/+thumbs\/+/, "/files/images/");
		if (domain_nowww === "tahrirnews.com" ||
			domain === "img.eltahrer.com") {
			return src.replace(/(\/Content\/+Upload\/+)(?:med|slider)\/+/i, "$1large/");
		}
		if (domain === "images.f2fcdn.net") return src.replace(/\/thumb\/+(.*?)(?:[?#].*)?$/, "/files/$1");
		if (domain === "f.i.uol.com.br") return src.replace(/(\/fotografia\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]+_[0-9]+_[0-9]+x[0-9]+)_(?:xs|sm|md|lg|xl)(\.[^/.]*)(?:[?#].*)?$/, "$1_rt$2");
		if (domain === "image.thmeythmey.com") return src.replace(/(\/pictures\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2})thumb[0-9]*\/+/, "$1");
		if (domain_nowww === "galdump.com") {
			return {
				url: src.replace(/(\/images\/+websites\/+[0-9]+\/+[0-9]+\/+)thumb[0-9]*\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2"),
				headers: {
					Referer: "http://galdump.com/"
				}
			};
		}
		if (domain === "drp-images.nettavisen.no") return src.replace(/(\/images\/+article\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+\/+[0-9]+\/)[^/]*\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1/$2");
		if (domain === "media.malaymail.com") return src.replace(/\/resize_cache\/+(uploads\/+.*)-(?:small|seo)(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain === "betassist.obs.ru-moscow-1.hc.sbercloud.ru") return src.replace(/(\/uploads\/+news\/+image\/.*)-(?:thumb|seo)(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "alaraby.co.uk" ||
			domain_nowww === "almodon.com") {
			return {
				url: src.replace(/\/File\/+GetImageCustom\/+([-0-9a-f]{20,})\/+[0-9]+(?:\/+[0-9]+)?(?:[?#].*)?$/i, "/File/Get/$1"),
				can_head: false // 403
			};
		}
		if (domain === "media.doisonghonnhan.vn") return src.replace(/\/resize_[0-9]*x[0-9]*x[0-9]*\/+files\/+/, "/files/");
		if (domain_nowww === "from-ua.com") return src.replace(/(\/upload\/+articles\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2})[a-z]+\/+/, "$1original/");
		if (domain_nosub === "onedio.com" && /^img/.test(domain)) {
			return src
				.replace(/:\/\/[^/]*\/id-([0-9a-f]+)\/.*?(\.[^/.]*)(?:[?#].*)?$/, "://img-3.onedio.com/img/$1$2")
				.replace(/\/img\/+(?:[0-9]+\/+bound\/+)?[0-9]*r[0-9]\/+/, "/img/");
		}
		if (domain_nowww === "sn.at") return src.replace(/\/[0-9]*x[0-9]*(\/+[0-9]+\.[0-9]+\.[0-9]+)(?:[?#].*)?$/, "$1");
		if (domain_nowww === "meninafm.com.br") return src.replace(/\/thumb_indice_noticias\.php\?(?:.*&)?img=([^&]*).*?$/, "/$1");
		if (domain === "img.lemde.fr") return src.replace(/(:\/\/[^/]*\/[0-9]{4}\/+(?:[0-9]{2}\/+){2})(?:[0-9]+\/+){8}([0-9a-f]+_[0-9]+-[^/.?#]+\.[^/.]*)(?:[?#].*)?$/, "$10/0/0/0/0/0/0/0/$2");
		if (domain_nowww === "christian-dogma.com") return src.replace(/\/im[0-9]+photos\/+([0-9]{8}\/+[0-9a-f]+\.[^/.?&#]*).*?$/, "/photos/$1");
		if (domain_nosub === "feedme.id" && domain.match(/^cdn[0-9]*\./)) {
			return src.replace(/\/media\/+post\/+[a-z]+\/+/, "/media/post/");
		}
		if (domain_nowww === "businessinsider.in") return src.replace(/\/thumb\/+([0-9]+\/+[^/?#]*)(?:[?#].*)?$/, "/photo/$1");
		if (domain_nowww === "ucatx.cat") return src.replace(/\/wallpic\/+[a-z]+\/+/, "/wallpic/full/");
		if (domain === "img.sosanhgia.com") return src.replace(/\/images\/+[0-9]+x[0-9]+\/+/, "/images/");
		if (domain_nosub === "slatic.net") return src.replace(/(\/p\/+[0-9a-f]+\.[^/._]*)_[^/]*(?:[?#].*)?$/, "$1");
		if (domain === "nrt.ysc123.com.cn") return src.replace(/(\/uploadImg\/+[0-9]{4}\/+[0-9]+\/+[0-9]+)_[0-9]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "kpopnews.vn") return src.replace(/(\/images\/+[0-9]{4}\/+(?:[0-9]{1,2}\/+){2}[0-9a-f]{15,}\/+)[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1default$2");
		if (domain === "t.ylilauta.org") return src.replace(/:\/\/t(\.[^/]*\/)/, "://i$1");
		if (domain === "static.esea.net") return src.replace(/(\/images\/+[^/]*\/+[0-9]+\.[0-9]+)_t(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "cdn.shazoo.ru") return src.replace(/(:\/\/[^/]*\/)c[0-9]+x[0-9]+\/+/, "$1");
		if (domain_nowww === "adultnode.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/thumb\.php\?(?:.*?&)?src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "en.luxuretv.com") return src.replace(/(\/media\/+[^/]*\/+)thumb-([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "image.bada.tv") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/files\/+crawling\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}imgur\/+([^/?#^]*)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return "https://i.imgur.com/" + newsrc;
		}
		if (domain_nowww === "fappenist.com") return src.replace(/(\/Uploads\/+Media\/+[^/]*\/+[^/]*\/+[0-9]+\/+)[a-z]_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "hitek.fr") return src.replace(/(\/img\/+products\/+.*?\/+photos\/+)w_([^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "cdn.dribbble.com") {
			newsrc = src.replace(/\?.*/, "");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/users\/+[0-9]+\/+screenshots\/+[0-9]+\/+[^/]+)_(?:[0-9]+x|teaser)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			obj = {
				url: newsrc
			};
			match = src.match(/\/screenshots\/+([0-9]+)\/+/);
			if (match) {
				obj.extra = { page: "https://dribbble.com/shots/" + match[1] };
			}
			return obj;
		}
		if (domain === "s.tmimgcdn.com") {
			newsrc = src.replace(/[?#].*/, "");
			if (newsrc !== src)
				return newsrc;
			return src
				.replace(/(\/scr\/+[0-9]+\/+(?:[^/]*_)?[0-9]+)-big(\.[^/.]*)$/, "$1-original$2")
				.replace(/(\/scr\/+[0-9]+\/+[0-9]+-)1300(_[0-9]+\.[^/.]*)(?:[?#].*)?$/, "$12560$2");
		}
		if (domain === "images.all-free-download.com") {
			newsrc = src.replace(/\/images\/+((?:templates|footage)_|graphic)(?:medium|large|thumb?)\/+/, "/images/$1original/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/images\/+wallpapers_[a-z]+\/+/, "http://files.all-free-download.com/downloadfiles/wallpapers/original/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "files.all-free-download.com") {
			return {
				url: src.replace(/\/downloadfiles\/+wallpapers\/+[^/]*\/+/, "/downloadfiles/wallpapers/original/"),
				headers: {
					Referer: "https://all-free-download.com/"
				}
			};
		}
		if (domain === "images.themevault.net") {
			return add_extensions(src.replace(/\/images\/+[a-z]+(-[0-9]+\.[^/.]*)(?:[?#].*)?$/, "/images/full$1"));
		}
		if (domain_nowww === "templatemo.com") {
			newsrc = src.replace(/\/thumbnails-[0-9]+\/+tm-([0-9]+-[^/]*)(?:[?#].*)?$/, "/screenshots/templatemo_$1");
			if (newsrc !== src)
				return newsrc.replace(/-/g, "_");
		}
		if (domain === "cdn.pocket-lint.com") return src.replace(/\/r\/+s\/+[0-9]*x[0-9]*\/+assets\/+/, "/assets/");
		if (domain === "image.isu.pub") return src.replace(/(:\/\/[^/]*\/[0-9]+-[0-9a-f]{20,}\/+[^/]*\/+page_[0-9]+)_[_a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "static.techspot.com") return src.replace(/(\/articles-info\/+[0-9]+\/+images\/+)T_([^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "mweb.co.za") {
			if (/\/MediaHandler\.ashx\?/.test(src)) {
				return keep_queries(src, ["portalid", "moduleid", "mediaid"], { required: ["portalid", "mediaid"] });
			}
		}
		if (domain_nowww === "gaminglives.com" ||
			domain_nowww === "dipsahaf.com") {
			return src.replace(/\/wp-content\/+plugins\/+dynpicwatermark\/+DynPicWaterMark_ImageViewer\.php\?(?:.*?&)?path=([^&]*).*?$/, "/wp-content/uploads/$1");
		}
		if (domain === "addons.cdn.mozilla.net") return src.replace(/(\/user-media\/+previews\/+)[a-z]+\/+/, "$1full/");
		if (domain_nosub === "zopix.net") return src.replace(/\/image_upload\/+thumb\/+(?:[0-9]+[wh]_)?/, "/image_upload/");
		if (domain_nowww === "jooinn.com") return src.replace(/\/images[0-9]*_[0-9]*\/+/, "/images/");
		if (domain === "prt.iza.ne.jp") return src.replace(/(\/images\/+[0-9]{6}\/+ent[0-9]{10,}-)[a-z]([0-9]\.[^/.]*)(?:[?#].*)?$/, "$1m$2");
		if (domain_nosub === "plus613.net") {
			newsrc = src.replace(/\/images\/+thumbs\/+/, "/images/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/page\/+hotlink\?(?:.*?&)?action=([^&]*).*?$/, "/images/$1");
			if (newsrc !== src)
				return newsrc;
			return {
				url: src,
				headers: {
					Referer: "http://www.plus613.net/"
				}
			};
		}
		if (domain === "img.milanuncios.com") return src.replace(/(:\/\/[^/]*\/)fp\/+/, "$1fg/");
		if (domain === "ssmscdn.yp.ca") return src.replace(/\/image\/+resize\/+([-0-9a-f]{20,})\/+[^/]*\/+([^/]*)(?:[?#].*)?$/, "/image/original/$1/$2");
		if (amazon_container === "oblok") {
			return src.replace(/(\/gallery_items\/+[0-9]+\/+)[^/]*\/+/, "$1original/");
		}
		if (domain_nowww === "salonfloris.ru") return src.replace(/\/thumb\/+[^/]*\/+[0-9]+r[0-9]+\/+([0-9]+\/+)/, "/d/$1d/");
		if (domain_nowww === "kmarket43.ru") {
			return src
				.replace(/\/media\/+cache\/+[0-9]+x[0-9]+\/+offers\/+/, "/media/offers/")
				.replace(/(\.[^/.]+)\.[^/.]+\.[^/.]+(?:[?#].*)?$/, "$1");
		}
		if (domain === "assets.perfecte.ro") {
			return src
				.replace(/(\/image_galleries\/+[0-9]+\/+[^/]*)_size[0-9]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/image_galleries\/+[0-9]+\/+)t_size[0-9]*\/+thumb_/, "$1");
		}
		if ((domain_nosub === "cuore.es" ||
			domain_nosub === "stilo.es" ||
			domain_nosub === "woman.es")
			&& domain.match(/^img[0-9]*\./)) {
			return src.replace(/(\/(?:[0-9a-f]{2}\/+){3}[^/]*)-[0-9]+(?:x[0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "100posto.hr") return src.replace(/\/datastore\/+imagestore\/+[0-9]+x[0-9]+\/+[0-9]+x[0-9]+_/, "/datastore/imagestore/original/");
		if (domain_nowww === "hot-celebs.co") return src.replace(/(\/image\/+[0-9]+)\/+[^/]*(?:[?#].*)?$/, "$1");
		if (domain_nowww === "findnudecelebs.com" ||
			domain_nowww === "searchcelebrityhd.com" ||
			domain_nowww === "pluscelebs.com" ||
			domain_nowww === "imgtrend.com" ||
			domain_nowww === "chopris.com" ||
			domain_nowww === "leadceleb.com" ||
			domain_nowww === "ultraceleb.com" ||
			domain_nowww === "freshfappening.com" ||
			domain_nowww === "allcelebs.club") {
			newsrc = src.replace(/\/(small)\/+\1-([^/]+\.[^/.]*)(?:[?#].*)?$/, "/$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "celebritying.com") {
			return src
				.replace(/(\/pictures\/+[^/]*\/+[^/]*)-tn(-[0-9]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3")
				.replace(/(\/images\/+[^/]*)-tn(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "daily-celebvideos.com") return src.replace(/00([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain_nowww === "nitrovideo.com") return src.replace(/\/thumbs\/+tn_/, "/pictures/");
		if (domain_nowww === "isecretarylegs.com" ||
			domain_nowww === "pussynclit.com" ||
			domain_nowww === "ulingerie.com" ||
			domain_nowww === "digitalminx.com" ||
			domain_nowww === "vaginavulva.com") {
			return src.replace(/\/thumbs\/+tn_([^/]+)(?:[?#].*)?$/, "/$1");
		}
		if (domain_nowww === "celebact.com") return src.replace(/\/celebrity-thump-/, "/naked-celebrity-");
		if (domain_nowww === "nudecelebs-a-z.com") return src.replace(/(:\/\/[^/]*\/[^/]*\/+)tn_/, "$1");
		if (domain_nowww === "nudecelebspics.net") return src.replace(/\/preview\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "thephuketnews.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/image-[.0-9]+\/+image\.php\?(?:.*?&)?image=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nosub === "naharnet.com" && domain.match(/^images[0-9]*\./)) {
			return src.replace(/(\/images\/+[0-9]+\/+)[wh][0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		}
		if (domain === "img.beritasatu.com") return src.replace(/\/cache\/+([^/]*)\/+[0-9]+x[0-9]+-[0-9]+\/+/, "/$1/");
		if (domain === "nnimgt-a.akamaihd.net" ||
			domain_nowww === "illawarramercury.com.au" ||
			domain_nowww === "thesenior.com.au" ||
			domain_nowww === "canberratimes.com.au" ||
			domain_nowww === "northerndailyleader.com.au" ||
			domain_nowww === "hawkesburygazette.com.au" ||
			domain_nowww === "theleader.com.au" ||
			domain_nowww === "examiner.com.au" ||
			domain_nowww === "northweststar.com.au") {
			return src.replace(/\/transform\/+v1\/+[a-z]+\/+(frm\/+[^/]*\/+[^/]*\.[^/.]*)\/+[^/]*?(\.[^/.]*)?(?:[?#].*)?$/, "/transform/v1/resize/$1/w0_h0_fscale$2");
		}
		if (domain_nosub === "productserve.com" && domain.match(/^images[0-9]*\./)) {
			match = src.match(/^[a-z]+:\/\/[^/]*\/\?(?:.*?&)url=([^&]*).*?$/);
			if (match) {
				newsrc = match[1];
				match = newsrc.match(/^ssl(?::|%3[Aa])(.*)/);
				if (match) {
					return "https://" + decodeURIComponent(match[1]);
				} else {
					return add_http(decodeURIComponent(newsrc));
				}
			}
		}
		if (domain_nowww === "sunhome.ru" ||
			domain === "i.sunhome.ru") {
			return src.replace(/(\/wallpapers\/+[0-9]+\/+[^/]*)\.(?:[0-9]+x[0-9]+|[a-z])(\.[^/.]*)(?:[?#].*)?$/, "$1.orig$2");
		}
		if (domain_nowww === "i-gency.ru") return src.replace(/(\/[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+\/+)first_([0-9a-f]{15,}\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "photos.stories-porno.net") return src.replace(/(:\/\/[^/]*\/)preview\/+/, "$1photos/");
		if (domain_nowww === "bazos.sk") return src.replace(/(\/img\/+[0-9]+)t\/+/, "$1/");
		if (domain_nowww === "pegitboard.com") return src.replace(/(\/pics\/+)(?:[^/]*\/+)?(?:[a-z]-)?([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "media.tio.ch") return src.replace(/\/images\/+thumb\/+/, "/images/");
		if (domain === "cdn-images.oovvuu.com") return src.replace(/(:\/\/[^/]*\/)[0-9]+x[0-9]+\/+/, "$10x0/");
		if (domain_nowww === "noihirek.hu") {
			return src
				.replace(/(:\/\/[^/]*\/)kep\.php\?(?:.*?&)?kep=([^&]*).*?$/, "$1$2")
				.replace(/(:\/\/[^/]*\/)thumb_pictures\/+/, "$1pictures/");
		}
		if (domain_nosub === "worldsex.com" && domain.match(/^cdn[0-9]*/)) {
			return src.replace(/_[0-9]+x(?:@[0-9]+x)?(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "famitsu.com") {
			newsrc = src.replace(/(\/image\/+[0-9]+\/+)s[0-9]+_([^/.?#_]{10,}\.)/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			regex = /(\/images\/+(?:[0-9]{3}\/+){3})(?:[stlyz]_)?([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/;
			var get_larger_famitsu = function(src) {
				return [
					src.replace(regex, "$1z_$2"),
					src.replace(regex, "$1y_$2"),
					src.replace(regex, "$1l_$2")
				];
			};
			if (regex.test(src)) {
				var larger_urls = get_larger_famitsu(src);
				if (options.do_request && options.cb) {
					larger_urls.unshift(src.replace(regex, "$1$2"));
					common_functions["find_actual_largest_image"](src, larger_urls, options.cb, {
						check_length: true,
						api_cache: api_cache,
						do_request: options.do_request
					});
					return {
						waiting: true
					};
				} else {
					return get_larger_famitsu(src);
				}
			}
			return src.replace(/(\/images\/+s[0-9]{6,})s(\.[^/.]*)(?:[?#].*)?$/, "$1o$2");
		}
		if (domain_nowww === "sexiestpicture.com") return src.replace(/(\/upload\/+Pictures\/+)thumbs\/+([^/]+)_[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1storage/$2$3");
		if (domain_nowww === "woman-project.com") return src.replace(/(\/uploads\/+[0-9]+\/+)thumb\/+/, "$1");
		if (domain_nowww === "hamaraphotos.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(photo_-[0-9]+\.html)(?:[?#].*)?$/,
				query_for_id: "https://hamaraphotos.com/${id}",
				process: function(done, resp, cache_key) {
					var image = get_meta(resp.responseText, "og:image");
					if (!image) {
						console_error(cache_key, "Unable to find og:image from", resp);
						return done(null, false);
					}
					return done(image, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
			newsrc = src.replace(/(\/albums300\/+wpw-[0-9]+\/+)thumb_/, "$1fullsize_");
			if (newsrc !== src)
				return newsrc;
		}
		if (host_domain_nowww === "hamaraphotos.com" && options.element) {
			if (options.element.tagName === "IMG") {
				var parent_2 = common_functions["get_parent_el_matching"](options.element, function(x) { return x.tagName === "A" && /\/photo[^/]+-[0-9]+\.html/.test(x.href); });
				if (parent_2) {
					return {
						url: parent_2.href,
						is_pagelink: true
					};
				}
			}
		}
		if (domain_nosub === "vetton.ru" && domain.match(/^img[0-9]*\./)) {
			return src.replace(/(\/upl\/+[0-9]+\/+[0-9]+\/+)[0-9]+\/+/, "$1");
		}
		if (domain === "edu.glogster.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/proxy\?(?:.*?&)?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "images.toofab.com" ||
			domain === "imagez.tmz.com") {
			return src.replace(/(\/image\/+[0-9a-f]{2}\/+)(?:o|[0-9]+by[0-9]+)(\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]{10,})(?:_[a-z]{2})?(\.[^/.]+)(?:[?#].*)?$/, "$1o$2$3");
		}
		if (domain_nosub === "offnews.bg" && domain.match(/^i[0-9]*\./)) {
			return src.replace(/(\/[^/._]+)_[*0-9]+x[*0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "slender-model.com") return src.replace(/(\/images\/+[^/]*\/+[^/]*[0-9]+)s(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "24eropixel.net") return src.replace(/(\/uploads\/+images\/+(?:[0-9]+\/+){3,})(?:[0-9]+x[0-9]+|desktop_thumbs)\/+/, "$1original/");
		if (domain_nowww === "xoxodigital.com") return src.replace(/(\/content\/+post\/+[0-9]+\/+)thumbs\/+/, "$1");
		if (domain_nosub === "xdn.vn" && /^[0-9]+\.mm\.baomoi\./.test(domain)) {
			return src.replace(/(:\/\/[^/]*\/)[wh][0-9]+_r[0-9]*\/+/, "$1");
		}
		if (domain === "photo-resize-zmp3.zmdcdn.me") return src.replace(/:\/\/([^/]+)-resize(-[^/]+\.zmdcdn\.me\/+)[^/]+\/+/, "://$1$2");
		if (domain_nosub === "meinbezirk.at" && /^media[0-9]*\./.test(domain)) {
			return src.replace(/(\/article\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+\/+[0-9]+)_[A-Z]+(\.[^/.]*)(?:[?#].*)?$/, "$1_NATIVE$2");
		}
		if (domain_nowww === "elporvenir.mx") {
			newsrc = src.replace(/(\/imagenes\/+noticias\/+)thumb\/+((?:[0-9]{2}\/+){3})[a-z]+_([0-9]{6}_)/, "$1original/$2$3");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\/imagenes\/+noticias\/+portada\/+/, "/imagenes/noticias/original/");
		}
		if (domain_nowww === "newsbeast.gr") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/resizeme\.php\?(?:.*?&)?src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "s.nbst.gr") return src.replace(/(\/files\/.*)\.thumbnail(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "image.newsis.com") return src.replace(/(:\/\/[^/]*\/[0-9]{4}\/+(?:[0-9]{2}\/+){2}NISI[0-9]+_[0-9]+_)thm(\.[^/.]*)(?:[?#].*)?$/, "$1web$2");
		if (domain_nowww === "techpowerup.com" ||
			domain_nowww === "tpucdn.com") {
			return src
				.replace(/(\/images\/+[^/.]+)@1x(\.[^/.]+)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/(?:img|images)\/+[^/]+)_(?:thm|small)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "plaza.jp.rakuten-static.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/api\/+Proxy\.php\?(?:.*?&)?a=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "5true.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/img-prx\.php\?(?:.*?&)?u=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain === "musicglue-images-prod.global.ssl.fastly.net") {
			newsrc = remove_queries(src, ["width", "mode"]);
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/.*[?&]u=(aHR0c[^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain === "imb.veooz.com") return src.replace(/-small(\.[^/.]*)(?:[?#].*)?$/, "-large$1");
		if (domain_nowww === "criturk.com") return src.replace(/(\/image\/+upload\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[a-z]+_[0-9a-f]{20,})-[0-9]+X[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "cdn.20m.es") return src.replace(/\/recortes\/+([0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+)(?:-[0-9]+){1,2}(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain === "tgp.inthecrack.com" ||
			domain_nowww === "crack-assets.com") {
			return {
				url: src.replace(/\/assets\/+images\/+hosted\/+galleries\/+([-0-9a-f]{20,})/, "/assets/images/hosted/galleries/full/$1"),
			};
		}
		if (domain === "content.pornstarplatinum.com") return src.replace(/\/images\/+thumb([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/images/pic$1");
		if (domain === "t.auntmia.com" ||
			domain === "t.sexywhitepussy.com") {
			return src.replace(/(\/[0-9]+_[0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "$1b$2");
		}
		if (domain_nowww === "giveawayoftheday.com") return src.replace(/(\/wp-content\/+uploads\/+[0-9]{4}\/+[0-9]{2}\/+[0-9a-f]{20,})_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "nato.int") {
			newsrc = src.replace(/(\/assets\/+pictures\/+[^/]*\/+[^/]*)_rdax_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/sfor\/+indexinf\/+[0-9]+\/+(?:[^/]+\/+)?)s([^/]+?)(?:[?#].*)?$/i, "$1b$2");
		}
		if (domain_nowww === "pbase.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+image\/+([0-9]+)(?:\/+.*)(?:[?#].*)?$/,
				query_for_id: "https://pbase.com/image/${id}/original",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<img\s+(?:oncontextmenu="[^"]+"\s+)?class=["']display\s*(?:[-\sa-z]+)?["']\s+src=["'](.*?)["']/i);
					if (!match) {
						console_error(cache_key, "Unable to find img match for", resp);
						return done(null, false);
					}
					return done(decode_entities(match[1]), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "pbase.com" && /^a[0-9]*\./.test(domain)) {
			var id = src.replace(/^[a-z]+:\/\/[^/]*\/[a-np-z][0-9]+\/+.*\/+([0-9]+)\.[^/.]+\.(?:[^/.]*\.)?[^/.]*(?:[?#].*)?$/, "$1");
			if (id !== src) {
				return {
					url: "https://pbase.com/image/" + id + "/original",
					is_pagelink: true
				};
			}
		}
		if (amazon_container === "photo-net-production-images" ||
			domain === "d6d2h4gfvy8t8.cloudfront.net") {
			return src.replace(/(\/[0-9]+)-[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1-orig$2");
		}
		if (domain_nowww === "thoimoi.vn" ||
			domain_nowww === "vir.com.vn" ||
			domain_nowww === "petrotimes.vn") {
			return src.replace(/(\/stores\/+news_dataimages\/+[^/]*\/+[0-9]{6}\/+[0-9]+\/+[0-9]+\/+)[a-z_]+\/+/, "$1");
		}
		if (domain_nosub === "energyfm.ru" && domain.match(/^(?:cdn[0-9]*|www)\./)) {
			if (/\/proxy\/+vardata\//.test(src)) {
				return src.replace(/:\/\/[^/]*\/proxy\/+vardata\/+(.*?)(?:[?#].*)?$/, "://www.energyfm.ru/vardata/$1");
			}
			return src.replace(/(\/files\/+[0-9]+\/+[0-9]+\/+[^/]*?)\?.*/, "$1?w=-");
		}
		if (domain_nowww === "chacuncherchesonfilm.fr") return src.replace(/(\/storage\/+[^/]*\/+[0-9a-f]{2}\/+[0-9a-f]+)-[0-9_]+x[0-9_]+(\.[^/.]*(?:[?#].*)?)$/, "$1$2");
		if (domain === "structurecms-staging-psyclone.netdna-ssl.com") return src.replace(/(\/media\/+picture\/+(?:[0-9a-f]{4}\/+){6})[a-z]+_/, "$1original_");
		if (domain_nowww === "reforma.com" ||
			domain_nowww === "mural.com" ||
			domain_nowww === "cancha.com" ||
			domain_nowww === "elnorte.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/aplicacioneslibre\/+compartir\/+ImageTransformer.aspx\?(?:.*?&)?img=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "madtv.com.cy") return src.replace(/(\/assets\/+modules\/+wnp\/+articles\/+[0-9]{6}\/+[0-9]+\/+images\/+)[ms]_([^/]*)(?:[?#].*)?$/, "$1b_$2");
		if (domain === "d15hng3vemx011.cloudfront.net") {
			if (src.match(/\/attachment\/+[^/.]*\.[a-z]+/)) {
				return [
					src.replace(/(\/attachment\/+[^/.]*)\.[a-z]+/, "$1"),
					src.replace(/(\/attachment\/+[^/.]*)\.[a-z]+/, "$1.large"),
				];
			}
		}
		if (domain === "static.flaixfm.cat") return src.replace(/([./])(?:pw-(?:640|480)|cwh-(?:320-320|160-160))\1/, "$1pwh-2560-1440$1");
		if (domain_nowww === "music.hu") return src.replace(/(\/pictures\/+[0-9]+\/+)resized\/+([^/]*?)(?:_[wh][0-9]+)+(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		if (domain === "dspvdh6gst59b.cloudfront.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/(http.*?)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "factnews.mn") return src.replace(/\/images\/+news\/+crop[0-9]+\/+/, "/images/news/");
		if (domain_nowww === "videos-de-celebrites.com") return src.replace(/\/tn\/+tn_/, "/");
		if (domain_nowww === "friends.kz") return src.replace(/\/uploads\/+posts\/+thumbs\/+/, "/uploads/posts/");
		if (domain_nowww === "sama-sama-sama.ru") return src.replace(/(\/starimp\/+[^/]*\/+)p(s[0-9]+\.[^/.]*)/, "$1$2");
		if (domain === "img.index.hu") return src.replace(/(\/imgfrm\/+(?:.\/+){4})(?:THM|BIG|MED)_/, "$1IMG_");
		if (domain_nowww === "eventpixx.org") return src.replace(/(\/image\/+[0-9a-f]+)_[0-9]*x[0-9]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "images.hgmsites.net") return src.replace(/\/sml\/+([^/]*)_s(\.[^/.]*)(?:[?#].*)?$/, "/hug/$1_h$2");
		if (domain === "cdn.lifebuzz.com") return src.replace(/(\/images\/+[0-9]+\/+lifebuzz-[0-9a-f]{20,})-[a-z]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1-original$2");
		if (domain === "jurnalul.antena3.ro") return src.replace(/\/thumbs\/+[^/]*\/+([0-9]{4}\/+(?:[0-9]{2}\/+){2})[^/]*-([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/pictures/$1$2");
		if (domain_nowww === "anime1.com") return src.replace(/(\/img\/+content\/+[^/]*\/+[^/]*)-[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "animetoon.org") return src.replace(/(\/images\/+[^/]*\/+)small\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1big/$2");
		if (domain_nowww === "anime-tourism.jp") return src.replace(/\/title_th\/+/, "/title_image/");
		if ((domain_nosub === "filmweb.pl" && /^(?:ssl-)?gfx\./.test(domain)) ||
			domain_nosub === "fwcdn.pl") {
			return src
				.replace(/(\.\$\.)webp$/, "$1jpg")
				.replace(/(\/[0-9]+(?:_[0-9]+)?\.)[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$$$2");
		}
		if (domain_nowww === "fantlab.ru") return src.replace(/(\/blogfiles\/+b[0-9]+\/+img\/+[0-9]+)_sm(?:[?#].*)?$/, "$1");
		if (domain_nowww === "animeyt.org") return src.replace(/(\/uploads\/+[^/]*\/+)optimized\/+(?:thumb\/+)?/, "$1");
		if (domain_nowww === "otakotaku.com") return src.replace(/(\/asset\/+img\/+[^/]*\/+)thumb\/+[0-9]+x[0-9]+\/+/, "$1");
		if (domain === "img.topddl.net") return src.replace(/(\/images\/+[0-9a-f]{10,})\.th(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "monoschinos.com") return src.replace(/\/image\/+imagen\/+[0-9]+\/+[0-9]+\/+/, "/assets/img/serie/imagen/");
		if (domain === "a.atcdn.org") return src.replace(/\/c\/+[a-z]+_([^/.]*\.[^/.]*)(?:[?#].*)?$/, "/c/$1");
		if (domain === "m.atcdn.co.uk") return src.replace(/\/a\/media\/+(?:[wh][0-9]+|p[0-9a-f]{6}){1,}\/+/, "/a/media/");
		if (domain_nowww === "you-anime.ru") return src.replace(/\/anime-images\/+posters\/+preview\/+/, "/anime-images/posters/");
		if (domain_nowww === "tapcuoi.com") return src.replace(/(\/wp-content\/+anime\/+cover\/+)tbn\/+([0-9]+_[0-9]+)_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		if (domain_nowww === "komyulife.com") return src.replace(/(\/media\/+[^/]*\/+[^/]*\/+)[0-9]+x[0-9]+\/+/, "$1");
		if (domain_nowww === "animeon.pl") return src.replace(/(\/img\/+[^/]*\/+[0-9]+\/+)thumbs\/+/, "$1");
		if (domain_nowww === "4icdn.com") {
			newsrc = src.replace(/^([a-z]+:\/\/[^/]*\/)\?(?:.*&)?src=([^&]*).*?$/, "$2");
			if (newsrc !== src)
				return urljoin(src, decodeuri_ifneeded(newsrc), true);
		}
		if (domain === "cdn.handjobjapan.com") {
			newsrc = src.replace(/(\/preview\/+[0-9a-z]+\/+[0-9]+)s(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "cdn.legsjapan.com" ||
			domain === "cdn.tokyofacefuck.com" ||
			domain === "cdn.spermmania.com" ||
			domain === "cdn.handjobjapan.com" ||
			domain === "cdn.fellatiojapan.com" ||
			domain === "cdn.uralesbian.com") {
			return src.replace(/(\/(?:photo|fhg|preview)(?:\/+data)?\/+[^/]*\/+[^/]*-[0-9]+)s(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "lbfmaddiction.com" ||
			domain_nowww === "barfine2cash.com") {
			return src.replace(/(\/fhg\/+[^/]*\/+[^/]*\/+[^/]*)_small(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "thaicuties.net") {
			return {
				url: src.replace(/\/images\/+tn_([^/]*)_([a-zA-Z]+)\.[^/.]*(?:[?#].*)?$/, "/images/$1.$2"),
				head_wrong_contenttype: true
			};
		}
		if (domain === "fhg.propertysex.com") return src.replace(/(:\/\/[^/]*\/+[^/]*\/+)t([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "cutegirlporn.com") return src.replace(/(\/upload\/+gallery\/+.*\/)t([0-9]+\.)/, "$1$2");
		if (domain_nowww === "manga-news.com") {
			newsrc = src.replace(/(\/public\/+images\/+[^/]+\/+[^./?#][^/]+)\.webp(?:[?#].*)?/, "$1.jpg");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/public\/+images\/+(?:events|vols)\/+)\.([^/]*?)_(?:small|large|[sm])(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		}
		if (domain_nowww === "filmsomniac.com") return src.replace(/(\/images\/+covers\/+films-new\/+)[0-9]+\/+([0-9]+\/+[0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "film-download.club") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+uploads\/+(https?-dk-.*?)\.[^/]*(?:[?#].*)?$/, "$1");
			if (newsrc !== src) {
				return newsrc
					.replace(/-dk-/g, ":")
					.replace(/-sl-/g, "/")
					.replace(/-kr-/g, ".");
			}
		}
		if (domain_nowww === "thaishop.in.th") return src.replace(/(:\/\/[^/]*\/+)thumb\.php\?(?:.*?&)?(id=[0-9]+).*?$/, "$1image.php?$2");
		if (domain_nowww === "animes-portal.info") return src.replace(/\/thumbs\/+[0-9]+\/+/, "/resources/");
		if (domain === "cdn.staticaly.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+img\/+([^/]*\.[^/]*\/+)/, "$1");
			if (newsrc !== src)
				return add_http(newsrc);
		}
		if (domain === "assets.fireside.fm") return src.replace(/(\/images\/+[0-9a-f]\/+[-0-9a-f]{20,}\/+(?:[^/]*\/+[0-9a-f]\/+[-0-9a-f]{20,}\/+)?[^/]*)_(?:thumb|small|medium)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "disk.mediaindonesia.com") return src.replace(/\/thumbs\/+[-0-9]+x[-0-9]+\/+/, "/files/");
		if (domain === "images.lindependant.fr") return src.replace(/(\/api\/+v[0-9]+\/+images\/+view\/+[0-9a-f]{15,}\/+)[^/]*\/+/, "$1");
		if (domain_nowww === "kurir.rs") return src.replace(/(\/data\/+images\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+\/+[^/]*)_[a-z]{2}(?:-[a-z]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "reunion.orange.fr") return src.replace(/\/images\/+[0-9]+x[0-9]+\/+actu\/+/, "/IMG/");
		if (domain === "cdn.sahafahn.net" ||
			domain === "cdn.pressbee.net" ||
			domain === "cdn.24press.net") {
			match = src.match(/^[a-z]+:\/\/[^/]*\/img(?:-|\/+)[0-9]+-[0-9]+\/([^/]{10,})\.[^/.]*(?:[?#].*)?$/);
			if (match) {
				var str = base64_decode(match[1]);
				newsrc = str.replace(/.*?\"(https?:[^"]*).*?$/, "$1");
				if (newsrc !== str) {
					return newsrc;
				}
			}
		}
		if (domain_nosub === "keponews.com" && domain.match(/^scdn/)) {
			match = src.match(/^[a-z]+:\/\/[^/]*\/scontent\/+([^/.]{15,})(?:[?#].*)?$/);
			if (match) {
				var str = base64_decode(match[1]);
				newsrc = str.replace(/^[0-9]+\/+(https?:.*)$/, "$1");
				if (newsrc !== str) {
					return newsrc;
				}
			}
		}
		if (domain === "media.kleinezeitung.at" ||
			domain === "media.diepresse.com") {
			return src.replace(/\/images\/+uploads_[a-z]?[0-9]+\/+/, "/images/uploads/");
		}
		if (domain === "republic-imagekit.azureedge.net") return src.replace(/(\/republic-prod\/+stories\/+[^/]*\/+)[^/]*\/+tr:[^/]*\/+/, "$1");
		if (domain_nowww === "newsstandhub.com") return src.replace(/(\/files\/+[^/]*\/+images\/+[^/]*\/+)hdpi\/+/, "$1");
		if (domain_nowww === "urbanhit.fr" ||
			domain_nowww === "xplicitkontemp.com") {
			return src.replace(/(\/upload\/+[^/]*\/+)(?:normal|mini|main)\/+/, "$1original/");
		}
		if (domain_nowww === "choualbox.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+mini\.php\?(?:.*?&)?src=([^&]*).*?$/, "$1");
			if (newsrc !== src) {
				return urljoin(src, decodeURIComponent(newsrc), true);
			}
		}
		if (domain === "im.milliyet.com.tr") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+[0-9]+\/+[0-9]+\/+([^/]*)\.[^/.]*(?:[?#].*)?$/, "$1");
			if (newsrc !== src) {
				return add_http(newsrc.replace(/-\.-/g, "/"));
			}
		}
		if (domain_nosub === "indiatvnews.com" && /^resize[0-9]*\./.test(domain)) {
			return src
				.replace(/\/resize\/+((?:new|old)bucket)\/+[-0-9]+_[0-9]*-?\/+/, "/$1/")
				.replace(/\/resize\/+gallery\//, "/resize/newbucket/");
		}
		if (domain === "girabsas.demo.vincolo.com") {
			newsrc = src.replace(/.*\/tools\/+image\.php\?(?:.*?&)?p=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return urljoin(src, decodeURIComponent(newsrc), true);
			return src.replace(/(\/files\/+image\/+[0-9a-f]\/+[0-9a-f]+\/+[^/.]*)_[0-9]+_[0-9]+!(\.[^/.?#]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "seffafgazete.com") return src.replace(/\/uploads\/+sized\/+([0-9]{4}\/+[0-9]{2}\/+[0-9a-f]+)-[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/uploads/o/$1$2");
		if (domain === "cdn.posh24.se") return src.replace(/\/images\/+:[a-z]+\/+/, "/images/:original/");
		if (domain_nowww === "kinoafisha.ua") {
			match = src.match(/(\/upload\/+[0-9]{4}\/+[0-9]{2}\/+[^/]*\/+[0-9]+\/+fotos\/+)/);
			if (match) {
				newsrc = src.replace(/(\/+fotos\/+)[a-z]+\/+([^/]*)(?:[?#].*)?$/, "$1$2");
				if (newsrc !== src)
					return newsrc;
				if (!/\/src_[^/]*(?:[?#].*)?$/.test(src))
					return src.replace(/(\/fotos\/+)([^/]*)(?:[?#].*)?$/, "$1src_$2");
			}
		}
		if ((domain_nosub === "akamaized.net" && /^cache[0-9]*-ebookjapan\./.test(domain)) ||
			domain === "haishin.ebookjapan.jp") {
			return src.replace(/\/contents\/+thumb\/+[ms]\/+/, "/contents/thumb/l/");
		}
		if (domain === "aws-cf.imdoc.fr" ||
			domain === "aws-cf.caradisiac.com") {
			return src.replace(/(\/prod\/+photos\/+(?:[0-9]+\/+){5})(?:tns[0-9]*|img)-/, "$1big-");
		}
		if (domain === "asobokey.x.fc2.com") return src.replace(/(\/image\/+[0-9]{4,})_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "hbox.jp") return src.replace(/(\/image[0-9]*\/+content\/+[0-9]+\/+)sp_thumbnail_/, "$1");
		if (domain === "storage.ws.pho.to") return src.replace(/(\/[0-9a-f]{20,})_[a-z](\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "freakolla.com") return src.replace(/\/THG\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/IMG/$1");
		if (domain_nosub === "breath-takers.com" ||
			domain === "galleries.sophiassexylegwear.com" ||
			domain_nosub === "girlfolio.com") {
			return src.replace(/(\/assets\/+images\/+.*\/)(?:small|medium|large)\/+/, "$1orig/");
		}
		if (domain_nosub === "thepluginz.com" && /^img\./.test(domain)) {
			return src.replace(/(\/photos\/+[^/]*\/+)tn_/, "$1");
		}
		if (domain === "galleries.gloryhole-initiations.com" ||
			domain === "galleries.blacksonblondes.com" ||
			domain === "galleries.zebragirls.com") {
			return src.replace(/\/pics\/+tn\/+/, "/pics/pic/");
		}
		if (domain === "g.misslk.com") return src.replace(/\/tn\/+/, "/full/");
		if (domain_nosub === "radgalleries.com") return src.replace(/\/thumbnails\/+t([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain === "img.maximummedia.ie" ||
			domain === "img.resized.co") {
			match = src.match(/^[a-z]+:\/\/[^/]*\/[^/]*\/+([^/]{50,})(?:\/+[^/]*)?(?:[?#].*)?$/);
			if (match) {
				var splitted = match[1].split("_");
				var json_text = [];
				array_foreach(splitted, function(x) {
					json_text.push(base64_decode(x));
				});
				var json = JSON_parse(json_text.join("?"));
				if (json.data) {
					var data = JSON_parse(json.data);
					if (data.url)
						return data.url;
				}
			}
		}
		if (domain === "imagevars.gulfnews.com") return src.replace(/(_[0-9a-f]{6,})_[-a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1_original-ratio$2");
		if (domain === "az743702.vo.msecnd.net" ||
			domain === "storage.ko-fi.com" ||
			domain === "cdn.ko-fi.com") {
			newsrc = src.replace(/\/useruploads\/+post\/+/, "/useruploads/display/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/useruploads\/+)((?:[a-z_]+_(?:KoFi_)?)?[-0-9a-f]{20,}(?:[^/.]+)?)_post(\.[^/.]*)(?:[?#].*)?$/, "$1$2_display$3");
			if (newsrc !== src)
				return add_extensions_jpeg(newsrc);
			return src.replace(/(\/useruploads\/+)(?:[a-z]+_)?([-0-9a-f]{20,}(?:[a-z]+)?)(?:_[a-z]+)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		}
		if (domain_nowww === "silviomessina.pw" ||
			domain_nowww === "bevilacqua.me" ||
			domain_nowww === "geodomehome.org" ||
			domain_nowww === "soamasterclass.com" ||
			domain_nowww === "royal-city.com" ||
			domain_nowww === "ulsterscotsacademy.org" ||
			domain_nowww === "newkunci.co" ||
			domain_nowww === "xianweizhu.com" ||
			domain === "www.edu.kustantiblogs.web.id") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+images\/+[^/]*__([^-/._]{30,})\.[^/.]*(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain_nowww === "xxxsexy.xyz" ||
			domain_nowww === "pornxxxbest.xyz") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+images\/+([^.]{50,})\.[^/.]*(?:[?#].*)?$/, "$1");
			if (newsrc !== src) {
				var splitted = newsrc.split("/");
				newsrc = base64_decode(splitted[0]);
				if (splitted.length > 1)
					newsrc += "?" + base64_decode(splitted[1]);
				return newsrc;
			}
		}
		if (domain_nosub === "soumeiwang.com" ||
			domain_nosub === "shianwang.com" ||
			domain_nosub === "baobaoyuer.com" ||
			domain_nosub === "daguaw.com" ||
			domain_nosub === "ditiw.com" ||
			domain_nosub === "chudaowang.com" ||
			domain_nosub === "desangw.com" ||
			domain_nowww === "hbmygm.com" ||
			domain_nosub === "dalangw.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+img\/+([^-/._]{30,})\.[^/.]*(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain_nowww === "kabelversand.info" ||
			domain_nowww === "teamupforkansaskids.com" ||
			domain_nowww === "gbracingpix.com" ||
			domain_nowww === "kickin.info" ||
			domain_nowww === "catmario.info" ||
			domain_nowww === "greateasternwallgallery.com" ||
			domain_nowww === "stepanakert.info" ||
			domain_nowww === "modellini.info" ||
			domain_nowww === "oboteen.com" ||
			domain_nowww === "carltonstaffing.info") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+pics\/+([^-/._]{30,})(?:\.[^/.]*)?(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain_nosub === "gaanacdn.com" && /^a[0-9]*\./.test(domain)) {
			return src.replace(/(\/artists\/+[^/]*\/+[^/]*\/+size_)[sm]_/, "$1l_");
		}
		if (domain_nosub === "baidu-img.cn" && /^cdn[0-9]*\./.test(domain)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/timg\?(?:.*?&)?src=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "pic.yupoo.com") return src.replace(/(:\/\/[^/]+\/+[^/]+\/+[0-9a-zA-Z]{6,}\/+)(?:small|medi(?:um|sh)|big)(\.[^/.]*)(?:[?#].*)?$/, "$1large$2");
		if (domain === "img.popnroll.tv" ||
			domain === "images.dappei.com") {
			return src.replace(/(\/uploads\/+[^/]*\/+image\/+[0-9]+\/+)(?:thumb|medium|large)_/, "$1");
		}
		if (domain_nosub === "adulttrade.net") return src.replace(/(_pics_galleries\/.*\/)tn_([^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "thepaysites.com") return src.replace(/(\/[0-9]+\/+[^/]+\/+)thumb_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "i.myass.ru") return src.replace(/(\/[0-9]{6}\/+[0-9]+\/+)[a-z]\/+([0-9]+[0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1f/$2");
		if (domain === "img.cactusboy.com" ||
			domain === "pictures.bigtittedteens.com" ||
			domain === "pictures.petitebabespics.com") {
			return src.replace(/(\/[0-9a-f]\/+[0-9a-f]{2}\/+[0-9a-f]{10,}\/+)tn_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "images.eastbabes.com" ||
			domain === "images.ebonygirls.sexy" ||
			domain === "images.nakedjapanesegirls.photos" ||
			domain === "images.nudejapanesemodels.sexy" ||
			domain === "images.asianporn.photos" ||
			domain === "images.latinababesfucking.com" ||
			domain === "images.blackporn.photos" ||
			domain === "images.nudeasians.pics" ||
			domain === "images.nakedblackbabes.pics") {
			return src.replace(/(\/p\/+[^/]*\/+)th\/+/, "$1");
		}
		if (domain_nowww === "erotikom.com") return src.replace(/(\/[0-9]{8}\/+)[^/.?#]+-([0-9]{8}-[0-9]+)-th(-[0-9]+\.)/, "$1$2$3");
		if (((domain_nowww === "simdunyasi.com" ||
			domain_nowww === "gateoverflow.in" ||
			domain_nowww === "fontid.co")
			&& src.match(/[?&]qa_blobid=[0-9]+/)) ||
			/[?&]qa_blobid=[0-9]{10,}(?:[&#].*)?$/.test(src)) {
			return src.replace(/\?(?:.*&)?(qa_blobid=[0-9]+).*?$/, "?qa=image&$1");
		}
		if (domain === "image.tophinhanh.me" ||
			domain === "image.buonchoai.club") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+rx\/+[0-9]*x[0-9]*\/+([^/]*\.[^/]*\/)/, "$1");
			if (newsrc !== src)
				return add_http(newsrc);
		}
		if (domain_nowww === "artspace712.com" ||
			domain_nowww === "dientumaytinh.com" ||
			domain_nowww === "aihara-company.com") {
			match = src.match(/^[a-z]+:\/\/[^/]*\/+uploads\/+[^/]*\/+([^/.]{60,})\/+.*(?:[?#].*)?$/);
			if (match) {
				return base64_decode(base64_decode(base64_decode(match[1])));
			}
		}
		if (domain_nosub === "lozi.vn") return src.replace(/(\/v1\/+[^/]*\/+)resized\/+([^/]*?)(?:[?#].*)?$/, "$1original/$2");
		if (domain_nosub === "ilikewallpaper.net") return src.replace(/(\/pic\/+[0-9]{6}\/+[^/]*?)[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "fatakat.com" && /^files[0-9]*\./.test(domain)) {
			return src.replace(/(\/[0-9]{4}\/+[0-9]{1,2}\/+(?:[^/]*\/+)?)small\/+/, "$1");
		}
		if (domain_nowww === "oir.mobi") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+src\.php\?(?:.*&)?src=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "tn.smilevideo.jp") {
			return {
				url: src.replace(/^([a-z]+:\/\/[^/]*\/+smile\?)(?:.*&)?(i=[0-9]+)(?:\.M)?(?:&.*)?$/, "$1$2.L"),
				can_head: false // 403
			};
		}
		if (domain_nowww === "wallpaperlayer.com") return src.replace(/(\/img\/+[0-9]{4}\/+[0-9]{2}\/+)thumb\/+([^/]*)-thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		if (domain === "str.your-pictionary.com") return src.replace(/\.md(\.[^/.]*)(?:[?#].*)?$/, "$1");
		if (domain_nowww === "rin-city.com" ||
			domain_nowww === "stylerotica.com") {
			return src.replace(/(\/images\/+previews\/+[^/]*\/+)thumb_/, "$1full_");
		}
		if (domain_nowww === "mypornstarbook.net" ||
			domain_nowww === "milf-pics.net") {
			return src.replace(/\/(?:images\/+)?thumbnails\/+tn([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/images/$1");
		}
		if (domain_nowww === "picgym.net") {
			match = src.match(/^[a-z]+:\/\/[^/]*\/+img\/+[^/?]*\?([^-/._]{30,})(?:#.*)?$/);
			if (match) {
				return base64_decode(match[1]);
			}
		}
		if (domain === "acgn-cdn.sunteorum.com") return src.replace(/(\.[A-Za-z0-9]+)_[0-9]+[wh]\.[^/.]*(?:[?#].*)?$/, "$1");
		if (domain === "pratilipi.s.llnwi.net" && /\/pratilipi\/+(?:content\/+image|cover)\?/.test(src)) {
			return keep_queries(src, ["pratilipiId", "name", "version"], { required: ["pratilipiId"] });
		}
		if (domain_nowww === "forumhentai.net") return src.replace(/\/imagehosting\/+thum_/, "/imagehosting/");
		if (domain_nowww === "mfqqx.com") return src.replace(/(\/d\/+file\/+[0-9]{4}\/+[0-9]{2}\/+)small([0-9a-f]{32})[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		if (domain_nowww === "between-legs.com") return src.replace(/(\/content\/+galleries\/+[0-9]+\/+[0-9]+\/+)thumbs\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1full/$2");
		if (domain_nowww === "babeunion.com") return src.replace(/(\/gallery\/+[^/]*\/+)thumbs\/+/, "$1");
		if (domain_nowww === "bustyparade.com") return src.replace(/\/thumbs\/+galls\//, "/galls/");
		if (domain === "assets.marthastewart.com") return src.replace(/(:\/\/[^/]*\/+)styles\/+[^/]*\/+/, "$1");
		if (domain === "images.plurk.com") {
			newsrc = src.replace(/(^[a-z]+:\/\/[^/]*\/+)mx_([^/.]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return add_full_extensions(newsrc, ["jpg", "png", "jpeg", "gif"]);
		}
		if (domain === "imgs.plurk.com") return src.replace(/(:\/\/[^/]*\/+[^/]{3}\/+[^/]{3}\/+[a-zA-Z0-9]{10,})_tn(\.[^/.]*)(?:[?#].*)?$/, "$1_lg$2");
		if (domain === "avatars.plurk.com") {
			newsrc = src.replace(/(\/[0-9]+-)(?:medium|small)([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1big$2");
			if (newsrc !== src)
				return add_full_extensions(newsrc);
		}
		if (domain === "cdnph.upi.com") return src.replace(/(:\/\/[^/]*\/+)(?:topic\/+ph\/+[0-9]+\/+upi\/+|ph\/+st\/+th\/+[0-9]+\/+[0-9]{4}\/+upi\/+|upi\/+)/, "$1pv/upi/");
		if (domain_nowww === "glamour.bg") return src.replace(/\/pictures\/+pic_small\/+/, "/pictures/pic_big/");
		if (domain === "adminhonna.elwatannews.com" ||
			domain === "honnaimg.elwatannews.com") {
			return src.replace(/\/image_archive\/+(?:original_lower_quality|[0-9]+x[0-9]+)\/+/, "/image_archive/original/");
		}
		if (domain_nowww === "yeswedding.com.br") return src.replace(/(\/[0-9]+)_big(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "adultempire.com" && /^imgs[0-9]*cdn\./.test(domain)) {
			return src.replace(/(\/galleries\/+[0-9]+\/+[0-9]{5,})_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1_9999$2");
		}
		if (domain_nowww === "mixmag.com.tr") return src.replace(/(\/assets\/+uploads\/+images\/+)_facebook\/+/, "$1");
		if (domain_nowww === "harpersbazaar.co.id") return src.replace(/(\/lkgallery\/+[^/]*\/+)resize\/+[0-9]+x[0-9]+\/+/, "$1");
		if (domain_nosub === "mobify.com" && /^ir[0-9]*\./.test(domain)) {
			return src.replace(/^[a-z]+:\/\/[^/]*\/+[0-9]+\/+http/, "http");
		}
		if (domain_nowww === "kanal24.az") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+photo\.php\?(?:.*&)?src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return urljoin(src, decodeuri_ifneeded(newsrc), true);
		}
		if (domain_nowww === "aquarelle.md") return src.replace(/\/uploads\/+cache\/+(news\/+[0-9]+\/+)[0-9]+X[0-9]+\/+/, "/uploads/$1");
		if (domain === "img.meta.kz") return src.replace(/(:\/\/[^/]*\/+\?)[0-9]+x/, "$1");
		if (domain === "img.rtvslo.si") return src.replace(/(\/upload\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+)_[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "i.stpl.gr") {
			match = src.match(/^[a-z]+:\/\/[^/]*\/+image\.ashx\?(?:.*&)?f=([^&]*).*?$/);
			if (match) {
				return urljoin(src, base64_decode(decodeURIComponent(match[1])), true);
			}
		}
		if (domain_nowww === "marecipe.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+image\.ashx\?(?:.*&)?u=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "cdn.akurat.co") return src.replace(/(\/images\/+uploads\/+images\/+)[a-z]+\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "static.vesti.rs") return src.replace(/(\/slike-[0-9]+\/+)tmb_/, "$1");
		if (domain_nowww === "al-mlab.com") return src.replace(/\/Thumbnails\/+([0-9]+\/+[0-9]+\/+)[0-9]+\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "/ArticleImages/$1$2");
		if (domain_nowww === "govastileto.gr") return src.replace(/\/assets\/+images\/+[0-9]*x[0-9]*\/+/, "/assets/images/");
		if (amazon_container === "dotemirates-media") {
			return src.replace(/(\/[0-9]{4}\/+[0-9]{2}\/+)[a-z]+-([0-9a-f]{20,}\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "grazia.rs") return src.replace(/\/uploads\/+imagecache\/+[0-9]+x[0-9]+\/+storage\/+/, "/storage/");
		if (domain_nowww === "asian-amatuer.com") return src.replace(/\/wp-content\/+vms_cache\/+images\/+(content\/+[^/]*\/+[^/]*)\.[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain_nowww === "xxx69.net") return src.replace(/\/tn_[0-9]+_[0-9]+_([^/.]*\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nosub === "milffox.com" && /^(?:s[0-9]*|cdn)\./.test(domain)) {
			return src.replace(/\/thumb([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/pic$1");
		}
		if (domain_nowww === "milffox.com") {
			var query_milffox_video = function(vid, cb) {
				api_query("milffox_video:" + vid, {
					url: "https://www.milffox.com/player/config.php?id=" + vid,
					imu_mode: "xhr",
					headers: {
						Referer: "https://www.milffox.com/"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					var urls = [];
					var video_urls = [resp.video_alt_url, resp.video_url]; // alt = hd, other is sd
					array_foreach(video_urls, function(url) {
						if (!url)
							return;
						urls.push({
							url: url,
							video: true,
							is_private: true, // linked to ip
							headers: {
								Referer: "https://www.milffox.com/"
							}
						});
					});
					if (resp.preview_url)
						urls.push(resp.preview_url);
					return done(urls, 6 * 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(porn-movies\/+[^/]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://www.milffox.com/${id}/",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<script[^>]*>get_player\(([0-9]+),/);
					if (!match) {
						console_error(cache_key, "Unable to find player ID match from", resp);
						return done(null, false);
					}
					query_milffox_video(match[1], function(data) {
						if (!data || !data.length) {
							return done(null, false);
						}
						return done(data, 60 * 60);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "milffox.com" && options.element) {
			newsrc = common_functions["get_pagelink_host_el_matching"](options, {
				url_match: /^[a-z]+:\/\/[^/]+\/+porn-movies\//,
				el_match: function(x) {
					return x.tagName === "DIV" && x.classList.contains("player");
				}
			});
			if (newsrc)
				return newsrc;
		}
		if ((domain_nosub === "footprint.net" && /^cdni-rt\./.test(domain)) ||
			domain === "cdnimages.absatz.media" ||
			domain === "cdni.rbth.com") {
			return src.replace(/(\/images\/+[0-9]{4}\.[0-9]{2}\/+)[a-z]+\/+(?:[0-9]+_)?([0-9a-f]{10,}\.)/, "$1original/$2");
		}
		if (domain_nowww === "tapchimypham.com.vn") return src.replace(/^([a-z]+:\/\/[^/]*\/+ImageHandler\.ashx\?)(?:.*?&)?(ThumbnailID=[0-9]+).*$/, "$1$2");
		if (domain === "cdn.lipscosme.com") return src.replace(/(\/user\/+user[0-9]+-[0-9]+)-(?:small|thumb)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "yesky.com" && /^[a-z]-pic-image\./.test(domain)) {
			return src.replace(/^([a-z]+:\/\/)[^/]*\/[-0-9]+x[-0-9]+\/+uploadImages\/+/, "$1pic-image.yesky.com/uploadImages/");
		}
		if (domain === "img.gifmagazine.net") return src.replace(/(\/images\/+[0-9]+\/+)[^/]*(\.gif)(?:[?#].*)?$/, "$1original$2");
		if (domain === "mediaprocessor.websimages.com") return src.replace(/^([a-z]+:\/\/[^/]*\/+)(?:(?:width|height|crop)\/+[^/]*\/+){0,}([^/]*\.[^/]*\/+)/, "$1$2");
		if (domain_nowww === "axtar.org") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+thumb\.php\?(?:.*&)?src=([^&]{50,}).*?$/, "$1");
			if (match) {
				var splitted = match[1].split("/");
				newsrc = base64_decode(splitted[0]);
				if (splitted[1]) {
					newsrc += "?" + base64_decode(splitted[1]);
				}
				return newsrc;
			}
		}
		if (domain_nosub === "popo8.com") {
			return src
				.replace(/(\/data\/+cimages\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}c_pic_[0-9]{8,}\.[^/._]*)_[a-z]\.[^/.]*(?:[?#].*)?$/, "$1")
				.replace(/(\/[0-9]{6}\/+[0-9]{2}\/+[0-9a-f]\/+(?:[0-9a-f]+|p[0-9]+_[0-9]+)\.[^/._]+)_[a-z]\.[^/.]*(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "navicdn.com") return src.replace(/\/nhacpro\/+[0-9]+x[0-9]+\/+images\/+/, "/nhacpro/images/");
		if (domain_nowww === "needradio.fr") return src.replace(/(\/upload\/+videos\/+)[a-z]+\/+/, "$1original/");
		if (domain === "assets.rebelmouse.io") {
			match = src.match(/^[a-z]+:\/\/[^/]*\/+[^-_/.]{20,}\.([^-_/.]{30,})\./);
			if (match) {
				var json = JSON_parse(base64_decode(match[1]));
				return json.image;
			}
		}
		if (domain_nowww === "issuedaily.com" ||
			domain === "img.issuedaily.com") {
			return src.replace(/\/thumb_image\/+(?:(?:new_)?main|thumb)_/, "/news_image/");
		}
		if (domain_nowww === "newsshare.co.kr") return src.replace(/\/data\/+([^/]+)\/+mainimages\/+([0-9]{6})\/+[0-9]{6}_/, "/imgdata/$1/$2/");
		if (domain_nowww === "dosugbook.nl") return src.replace(/(\/upfiles\/+photos\/+persons\/+[0-9]+\/+)thumbs[0-9]+\/+/, "$1");
		if (domain_nowww === "sexbahrain.club") {
			return {
				url: src.replace(/\/photos\/+[0-9]+_[0-9]+\/+/, "/photos/"),
				problems: {
					watermark: true
				}
			};
		}
		if (domain === "img.vphotos.cn") {
			newsrc = src.replace(/(:\/\/[^/]*\/+)download\/+([0-9A-F]{20,}\/+)/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/(postp|selected)\/+logo(large|double|small|1920|thumb)\/+/, "/$1/$2/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/(postp|selected)\/+thumbs\/+([^/]*)_thumb(\.[^/.]+)(?:[?#].*)?$/, "/$1/1920/$2_small$3");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/(postp|selected)\/+(?:logo)?(?:large|double|small|1920|thumb)\/+/, "/$1/large/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/[0-9A-F]{20,}\/+)selected\/+/, "$1postp/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "pauza.sk") return src.replace(/(\/web_object\/+[0-9]+)_[a-z](\.[^/.]*)(?:[?#].*)?$/, "$1_b$2");
		if (domain === "d26672rfe314dk.cloudfront.net") return src.replace(/(:\/\/[^/]*\/+[0-9]+\/+)[0-9]+\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "roleplayhaven.net") return src.replace(/\/gallery\/+thumb_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/gallery/$1");
		if (domain === "images.ladbible.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+thumbnail\?(?:.*&)?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "file.starnnews.com") {
			regex = /(\/[0-9]{8,}_[0-9a-f]+_)(?:10|1)(\.[^/.]*)(?:[?#].*)?$/;
			if (regex.test(src))
				return [
					src.replace(regex, "$12$2"),
					src.replace(regex, "$11$2")
				];
		}
		if (domain_nowww === "starjn.com") {
			newsrc = src.replace(/\/data\/+starjn_com\/+facebook\/+[0-9]+_([0-9]{6})([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/data/starjn_com/mainimages/$1/$1$2");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\/data\/+starjn_com\/+mainimages\/+/, "/imgdata/starjn_com/");
		}
		if (domain === "ipx.image-gmkt.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+imageproxy\/+\?(?:.*&)?src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "i.011st.com") return src.replace(/\/ex_t\/+R\/+[0-9]+x[0-9]+\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+src\/+/, "/ex_t/R/0x0/0/100/0/src/");
		if (domain === "cdn.mydaily.co.kr") {
			match = src.match(/\/FILES\/+[0-9]{6}\/+([0-9]+)_[0-9]+\.[^/.]*(?:[?#].*)?$/);
			var extra = {};
			if (match) {
				extra.page = "http://www.mydaily.co.kr/new_yk/html/read.php?newsid=" + match[1];
			}
			return {
				url: src,
				extra: extra
			};
		}
		if (domain_nosub === "iqiyipic.com") return src.replace(/(\/legopi_[0-9a-f]{20,}_)[0-9]+_x(\.[^/.]*)(?:[?#].*)?$/, "$1xxx$2");
		if (domain_nowww === "stevens-media.com" ||
			domain_nowww === "stecamsrl.it") {
			match = src.match(/\/(?:wp-content\/+wverrors\.php|page_id\.php)\?(?:.*&)?getimage=([^&]*).*?$/);
			if (match) {
				return base64_decode(match[1]);
			}
		}
		if (domain_nosub === "famtimes.co.kr" && /^img[0-9]*\./.test(domain)) {
			return src.replace(/(\/resources\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2})[sl]_([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "file.sportsseoul.com") return src.replace(/(\/cms\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[^/]+)_[A-Z][0-9](\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "hosted.foxes.com" ||
			domain === "hosted.dreamdolls.com" ||
			domain === "promo.foxes.com") {
			return src.replace(/(\/fhgs?\/+[^/]*\/+)t(?:_[0-9]+x[0-9]+)?\/+/, "$1o/");
		}
		if ((domain_nosub === "justjared.com" ||
			domain_nosub === "justjaredjr.com") && /^cdn[0-9]*\.cdn\./.test(domain)) {
			return src.replace(/(\/wp-content\/+uploads\/+[0-9]{4}\/+[0-9]{2}\/+[^/]*\/+)thumbs\/+/, "$1");
		}
		if (domain_nosub === "thesupermodelsgallery.com" && /^cdn[0-9]*\./.test(domain)) {
			return src.replace(/(\/[0-9]{4}\/+[0-9]{2}\/+[^/]*\/+)tn_([^/]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "celebritymoviezone.com") return src.replace(/\/thumbs\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "supermodels-online.com") return src.replace(/(\/photos\/+[^/]*\/+[^/]*)-sm(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "hentai-foundry.com") {
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+pictures\/+([0-9]+)\/*(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+pictures\/+user\/+[^/]+\/+([0-9]+)(?:\/+[^/]*)?(?:[?#].*)?$/
				],
				query_for_id: "https://www.hentai-foundry.com/pictures/${id}/?enterAgree=1",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<img[^>]*src=["']((?:https?:)?\/\/pictures\.hentai-foundry\.com\/[^'"]+).*?\/>/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var tagdef = parse_tag_def(match[0]);
					var obj = {
						url: urljoin(src, tagdef.args.src, true),
						extra: {
							page: resp.finalUrl,
							caption: tagdef.args.alt // todo: remove "by ...", and move that to author instead?
						}
					};
					return done(obj, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "thumbs.hentai-foundry.com") {
			match = src.match(/^[a-z]+:\/\/[^/]*\/+thumb\.php\?(?:.*&)?pid=([0-9]+)/);
			if (match) {
				return {
					url: "https://www.hentai-foundry.com/pictures/" + match[1] + "/",
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "boutiquefonts.com" ||
			domain === "cdn.elineupmall.com" ||
			domain === "cdn.nguyenkimmall.com" ||
			domain_nowww === "maxbhi.com" ||
			domain === "sklep.swiatkwiatow.pl" ||
			domain === "d166chel5lrjm5.cloudfront.net" ||
			domain_nowww === "animuk.co.uk" ||
			/\/images\/+thumbnails\/+[0-9]+\/+[0-9]+\/+detailed\/+[0-9]+\/+[^/]+\.[^/.]+(?:[?#].*)?$/.test(src)) {
			if (/\/design\/+themes\/+responsive\/+media\/+images\/+lazy_img\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src
				.replace(/\/images\/+thumbnails\/+[0-9]+\/+[0-9]+\/+detailed\/+/, "/images/detailed/")
				.replace(/\/images\/+thumbnails\/+([0-9]+)\/+[0-9]+\/+[0-9]+\/+([^/]+)(?:[?#].*)?$/, "/images/detailed/$1/$2");
		}
		if (domain === "cdn.shopclues.com") {
			return src
				.replace(/(\/images\/+)thumbnails\/+([0-9]+\/+)[0-9]+\/+[0-9]+\/+([0-9]+)([0-9])([0-9]{10})\./, "$1detailed/$2$3_$4_$5.")
				.replace(/\/images([0-9]*)\/+thumbnails\/+([0-9]+)\/+[0-9]+\/+[0-9]+\/+([^/]+)(?:[?#].*)?$/, "/images$1/detailed/$2/$3");
		}
		if (domain_nosub === "userapi.com") {
			newsrc = src.replace(/(:\/\/[^/]+\/+)imp[gf]\/+(.*?)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "vk.com") {
			if (/^[a-z]+:\/\/[^/]+\/+images\/+(?:icons\/+)?[a-z_]+\.png(?:[?#].*)?$/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain_nowww === "vk.com") {
			var vk_request_video = function(id, list, cb) {
				var cache_key = "vk_video:" + id;
				api_cache.fetch(cache_key, cb, function(done) {
					var listkey = "";
					if (list) {
						listkey = "&playlist_id=" + list;
					} else {
						listkey = "&playlist_id=" + id.replace(/_[0-9]+$/, "_-2");
					}
					options.do_request({
						method: "POST",
						url: "https://vk.com/al_video.php?act=show",
						data: "act=show&al=1&module=direct" + listkey + "&video=" + id,
						imu_mode: "xhr",
						headers: {
							"Content-Type": "application/x-www-form-urlencoded",
							"X-Requested-With": "XMLHttpRequest",
							"Referer": "https://vk.com/",
							"Origin": "https://vk.com"
						},
						onload: function(result) {
							if (result.readyState !== 4)
								return;
							try {
								var json = JSON_parse(result.responseText);
								var params = json.payload[1][4].player;
								return done(params, 3 * 60 * 60);
							} catch (e) {
								console_error("vk_video", e, result);
							}
							return done(null, false);
						}
					});
				});
			};
			var vk_process_video = function(player) {
				var params = player.params[0];
				if (player.type === "youtube") {
					if (params.extra_data) {
						return "https://i.ytimg.com/vi/" + params.extra_data + "/mqdefault.jpg";
					}
				}
				var urls = [];
				if (params.hls_raw) {
					var hlsurl = "data:application/vnd.apple.mpegurl," + encodeURIComponent(params.hls_raw);
					urls.push({
						url: hlsurl,
						video: "hls"
					});
				}
				var maxsize = 0;
				for (var key in params) {
					var match = key.match(/^url([0-9]+)$/);
					if (match) {
						var size = parseInt(match[1]);
						if (size > maxsize)
							maxsize = size;
					}
				}
				if (maxsize !== 0) {
					urls.push({
						url: params["url" + maxsize],
						video: true
					});
				}
				if (urls.length >= 0)
					return urls;
				console_log("Unable to find video for", deepcopy(params));
				return null;
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video(-?[0-9]+_[0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					var queries = common_functions["parse_imu_hash"](src);
					var list = null;
					if (queries)
						list = queries.playlist;
					vk_request_video(match[1], list, function(data) {
						if (!data)
							return cb(null);
						return cb(vk_process_video(data));
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "vk.com") {
			match = src.match(/:\/\/[^/]+\/+clips\/+[^/]+\?(?:.*&)?z=clip(-?[0-9]+_[0-9]+)(?:[&/%#].*)?$/);
			if (match) {
				return {
					url: "https://vk.com/video" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain === "m.vk.com") {
			match = src.match(/:\/\/[^/]+\/+video(-?[0-9]+_[0-9]+)(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://vk.com/video" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "userapi.com" &&
			host_domain_nosub === "vk.com" && options.element &&
			options.do_request && options.cb) {
			newsrc = (function() {
				var request_video = function(id, list, cb) {
					var cache_key = "vk_video:" + id;
					api_cache.fetch(cache_key, cb, function(done) {
						var listkey = "";
						if (list) {
							listkey = "&playlist_id=" + list;
						} else {
							listkey = "&playlist_id=" + id.replace(/_[0-9]+$/, "_-2");
						}
						options.do_request({
							method: "POST",
							url: "https://vk.com/al_video.php?act=show",
							data: "act=show&al=1&al=1&module=direct&video=" + id + listkey,
							headers: {
								"Content-Type": "application/x-www-form-urlencoded",
								"X-Requested-With": "XMLHttpRequest",
								"Referer": "https://vk.com/",
								"Origin": "https://vk.com"
							},
							onload: function(result) {
								if (result.readyState !== 4)
									return;
								try {
									var json = JSON_parse(result.responseText);
									var params = json.payload[1][4].player;
									return done(params, 3 * 60 * 60);
								} catch (e) {
									console_error("vk_video", e);
								}
								return done(null, false);
							}
						});
					});
				};
				function request_photo(id, list, cb) {
					var listkey = "";
					if (list)
						listkey = "&list=" + list;
					api_query("vk_photo:" + id, {
						method: "POST",
						url: "https://vk.com/al_photos.php?act=show",
						data: "act=show&al=1&photo=" + id + listkey,
						imu_mode: "xhr",
						headers: {
							"Content-Type": "application/x-www-form-urlencoded",
							"X-Requested-With": "XMLHttpRequest"
						},
						json: true
					}, cb, function(done, json, cache_key) {
						var jsonarray = json.payload[1][3];
						var jsonobj = null;
						for (var i = 0; i < jsonarray.length; i++) {
							if (!jsonarray[i].id)
								continue;
							api_cache.set("vk_photo:" + jsonarray[i].id, jsonarray[i], 3 * 60 * 60);
							if (jsonarray[i].id !== id)
								continue;
							jsonobj = jsonarray[i];
						}
						if (jsonobj !== null)
							done(jsonobj, 3 * 60 * 60);
						else
							done(null, false);
					});
				}
				function process_photo(jsonobj) {
					var maxsize = 0;
					var maxurl = null;
					for (var key in jsonobj) {
						if (/^[a-z]_$/.test(key) && (key + "src") in jsonobj &&
							is_array(jsonobj[key]) && jsonobj[key].length === 3) {
							var size = jsonobj[key][1] * jsonobj[key][2];
							if (size > maxsize) {
								maxsize = size;
								maxurl = jsonobj[key + "src"];
								if (false && typeof maxurl === "string")
									maxurl = maxurl.replace(/(:\/\/[^/]+\/+)impg\/+(.*?)(?:[?#].*)?$/, "$1$2");
							}
						}
					}
					if (!maxurl) {
						console_log("Unable to find photo for", deepcopy(jsonobj));
					}
					return maxurl;
				}
				function process_video(player) {
					var params = player.params[0];
					var maxsize = 0;
					for (var key in params) {
						var match = key.match(/^url([0-9]+)$/);
						if (match) {
							var size = parseInt(match[1]);
							if (size > maxsize)
								maxsize = size;
						}
					}
					if (maxsize !== 0) {
						return params["url" + maxsize];
					}
					if (player.type === "youtube") {
						if (params.extra_data) {
							return "https://i.ytimg.com/vi/" + params.extra_data + "/mqdefault.jpg";
						}
					}
					console_log("Unable to find video for", deepcopy(params));
					return null;
				}
				function process_el(current) {
					if (current.tagName === "A") {
						var is_photo = true;
						var match = current.href.match(/^[a-z]+:\/\/(?:[^/]+\.)?vk\.com\/+photo(-?[0-9]+_[0-9]+)\/*(?:[?#].*)?$/);
						if (!match) {
							var onclick = current.getAttribute("onclick");
							if (onclick) {
								match = onclick.match(/^return\s+showPhoto\(["'](-?[0-9]+_[0-9]+)["']\s*,\s*["']([^'"]+)["']/);
								if (!match) {
									match = onclick.match(/^return\s+showVideo\(["'](-?[0-9]+_[0-9]+)["']\s*,\s*["']([^'"]+)["']/);
									if (match) {
										is_photo = false;
									}
								}
							}
						}
						if (match) {
							if (is_photo) {
								request_photo(match[1], match[2], function(obj) {
									if (!obj) {
										options.cb(null);
									} else {
										options.cb(process_photo(obj));
									}
								});
							} else {
								request_video(match[1], match[2], function(obj) {
									if (!obj) {
										options.cb(null);
									} else {
										options.cb(process_video(obj));
									}
								});
							}
							return true;
						}
					}
					return false;
				}
				var current = options.element;
				if (current.children && current.children.length === 1) {
					if (process_el(current.children[0])) {
						return {
							waiting: true
						};
					}
				}
				while (current) {
					if (process_el(current)) {
						return {
							waiting: true
						};
					}
					current = current.parentElement;
				}
				return src;
			})();
			if (newsrc && newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "vkuservideo.net") {
			return {
				url: src,
				can_head: false,
				headers: {
					Origin: "https://vk.com",
					Referer: "https://vk.com",
					"Sec-Fetch-Site": "none",
					"Sec-Fetch-Dest": "document",
					"Sec-Fetch-Mode": "navigate",
					"Sec-Fetch-User": "?1",
					"Sec-Origin-Policy": "0"
				}
			};
		}
		if (domain_nowww === "free2music.com") return src.replace(/\/images\/+thumb\/+(.*\.[^/.,]+),[0-9]+(?:,[0-9]+)?\.[^/.]*(?:[?#].*)?$/, "/images/$1");
		if (domain === "cdn.muabannhanh.com") {
			return {
				url: src.replace(/\/img\/+gallery\/+thumbnail\/+/, "/img/gallery/"),
				problems: {
					watermark: true
				}
			};
		}
		if (domain_nosub === "eski.mobi") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+mobile\/+[^/]*\/+cache\/+img\/+q[0-9]+\/+[0-9]+\/+(https?%)/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain_nosub === "soccer365.ru" && /^st[0-9]*\./.test(domain)) {
			return src
				.replace(/(\/players\/+[0-9]+_[0-9]+_[0-9]+\/+[0-9]+)_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/images\/+[0-9]+_[0-9]+_[0-9]+\/+img_[^/._]+)_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "static.grouple.co") return src.replace(/(\/uploads\/+pics\/+[0-9]{2}\/+[0-9]{2}\/+[0-9]+)_p(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "vkpeople.ru") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+_\/+[^/?]+\?([^/]+\.userapi\.com\/+)/, "$1");
			if (newsrc !== src)
				return add_http(newsrc);
		}
		if (domain_nowww === "edchomes.com") {
			return src.replace(/\/CropUp\/+[-0-9]+x[-0-9]+\/+media\/+/i, "/media/");
		}
		if (domain === "turntable.kagiso.io") return src.replace(/(\/images\/+[^/]+)\.(?:width|height)-[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1.original$2");
		if (domain_nowww === "furaffinity.net") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:view|full)\/+([0-9]+)\/*(?:[?#].*)?$/,
				query_for_id: {
					url: "https://www.furaffinity.net/full/${id}/",
					headers: {
						"Referer": "",
						"Origin": ""
					}
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<a\s+href=["']([^'"]+)["']\s*>Download(?: Submission)?<\/a>/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done({
						url: urljoin(src, match[1], true),
						extra: {
							page: resp.finalUrl,
							caption: get_meta(resp.responseText, "og:title") // todo: remove "by ..." and move to author
						}
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "t.facdn.net" ||
			domain === "t.furaffinity.net") {
			match = src.match(/^[a-z]+:\/\/[^/]*\/+([0-9]+)@[0-9]+-[0-9]+\.[^/.]*(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://www.furaffinity.net/full/" + match[1] + "/",
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "aryion.com") {
			match = src.match(/\/(g[0-9]+)\/+(?:thumb|derivative)\/+([0-9]+)-[0-9]+/);
			if (match && options.do_request && options.cb) {
				var query_aryion = function(gn, id, cb) {
					api_query("aryion:" + gn + ":" + id, {
						url: "https://aryion.com/" + gn + "/view/" + id
					}, cb, function(done, resp, cache_key) {
						var match = resp.responseText.match(/var fullData\s*=\s*({.*?});/);
						if (!match) {
							console_error(cache_key, "Unable to find match for", resp);
							return done(null, false);
						}
						var json = JSON_parse(match[1]);
						if (!json.data_path) {
							console_error(cache_key, "Unable to find path in", json);
							return done(null, false);
						}
						var obj = {
							url: urljoin(resp.finalUrl, json.data_path, true),
							extra: {
								page: resp.finalUrl
							}
						};
						match = resp.responseText.match(/var itemTitle\s*=\s*(".*?");/);
						if (match) {
							try {
								obj.extra.caption = JSON_parse(match[1]);
							} catch (e) {
								console_error(cache_key, e);
							}
						}
						return done(obj, 24 * 60 * 60);
					});
				};
				query_aryion(match[1], match[2], options.cb);
				return {
					waiting: true
				};
			}
			newsrc = src.replace(/\/thumb\/+([0-9]+-[0-9]+)-thumb(?:\.[^/]*)?(\.[^/.]*)(\/+[^/]*)?(?:[?#].*)?$/, "/data/$1$2");
			if (newsrc !== src)
				return add_full_extensions(newsrc);
			match = src.match(/^[a-z]+:\/\/[^/]*\/+([^/]*)\/+(?:thumb|data\/+)([0-9]+)-/);
			if (match) {
				var obj_3 = {
					url: src,
					extra: {
						page: "https://aryion.com/" + match[1] + "/view/" + match[2]
					}
				};
				return obj_3;
			}
		}
		if (domain === "ano.lolcathost.org") return src.replace(/(:\/\/[^/]*\/+)thumbs\/+/, "$1pics/");
		if (domain_nowww === "okkisokuho.com") return src.replace(/(\/wp-content\/+picture\/+[0-9]{4}\/+[0-9]{6}\/+[^/]*\/+[^/]*_as[0-9]+)tn(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "pimg.togetter.com") {
			newsrc = src.replace(/(?:\?.*)?$/, "?w=o&h=o");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "simg.userboard.org" ||
			domain === "pimg.togetter.com") {
			match = src.match(/^[a-z]+:\/\/[^/]*\/+[0-9a-f]{20,}\/+([0-9a-f]{16,})/);
			if (match) {
				return hex_to_ascii(match[1]);
			}
		}
		if (domain === "twpl.togetter.com") return src.replace(/(\/show\/+)(?:thumb|large)\/+/, "$1orig/");
		if (domain_nowww === "hot.ag") {
			newsrc = src.replace(/\/([^/]+)\/+\1(?:%20| )Thumbnails\/+/, "/$1/");
			if (newsrc !== src)
				return add_full_extensions(newsrc);
		}
		if (domain_nowww === "finn-neo-admin.info" ||
			domain_nowww === "finn-neo.com") {
			return src.replace(/(\/newsimage\/+[0-9]+)_pc_[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "freeaddon.com") return src.replace(/\/thumb[0-9]+x[0-9]+-/, "/bg-");
		if (amazon_container === "classconnection") {
			return src.replace(/-thumb[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain === "pictures.topspeed.com") return src.replace(/(\/IMG\/+)crop\/+([0-9]{6}\/+[^/]+)_[0-9]+x[0-9]+[wh](\.[^/.]+)(?:[?#].*)?$/, "$1jpg/$2$3");
		if (domain === "monsite.woopic.com") return src.replace(/(:\/\/[^/]*\/+[0-9]+\/+)f\/+[0-9]*x[0-9]*\/+p\/+/, "$1p/");
		if (domain_nosub === "erome.com" && /^s[0-9]*\./.test(domain)) {
			return src.replace(/\/thumbs\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "/$1");
		}
		if (domain_nosub === "bdsmlr.com") return src.replace(/(\/uploads\/+photos\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]+\/+[^/]*-[0-9]+-[a-zA-Z0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "$1-og$2");
		if (domain_nowww === "sofurryfiles.com") {
			newsrc = src.replace(/\/std\/+(?:thumb|preview)\?/, "/std/content?");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/std\/+[a-z]+\?(?:.*&)?page=([0-9]+).*?$/);
			if (match) {
				obj = {
					url: src,
					extra: {
						page: "https://www.sofurry.com/view/" + match[1]
					}
				};
				return obj;
			}
		}
		if (amazon_container === "bw-1651cf0d2f737d7adeab84d339dbabd3-bcs") {
			return src.replace(/(\/product_[0-9]+\/+)Thumb([0-9]+_[0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "$1Full$2");
		}
		if (domain === "static.myfigurecollection.net") {
			newsrc = src.replace(/\/pics\/+figure\/+(?:big\/+)?([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/pics/figure/large/$1");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/pics\/+figure\/+(?:[a-z]+\/+)?([0-9]+)\.[^/.]+/);
			if (match) {
				return {
					url: src,
					extra: {
						page: "https://myfigurecollection.net/item/" + match[1]
					}
				};
			}
			newsrc = src.replace(/(\/pics\/+(?:encyclopedia|group)\/+)[0-9]+\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/pics\/+(encyclopedia|group)\/+(?:[0-9]+\/+)?([0-9]+)\.[^/.]+/);
			if (match) {
				var middle = "entry";
				if (match[1] === "group")
					middle = "club";
				return {
					url: src,
					extra: {
						page: "https://myfigurecollection.net/" + middle + "/" + match[2]
					}
				};
			}
			return src.replace(/\/image\/+thumbnails\/+/, "/image/");
		}
		if (domain_nowww === "8muses.com") return src.replace(/(:\/\/[^/]*\/+)image\/+th\/+/, "$1image/fl/");
		if (domain === "stored-edge.slickpic.com") {
			return {
				url: src.replace(/\/[0-9]+\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "/-/$1"),
				head_wrong_contentlength: true
			};
		}
		if (domain === "cdn.pururin.io") {
			newsrc = src.replace(/(\/assets\/+images\/+data\/+[0-9]+\/+[0-9]+)t(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/assets\/+images\/+data\/+([0-9]+)\/+([0-9]+|cover)t?\./);
			if (match) {
				var pageurl_1 = "https://pururin.io/read/" + match[1];
				if (match[2] === "cover") {
					pageurl_1 += "/a";
				} else {
					pageurl_1 += "/" + zpadnum(match[2], 2) + "/a";
				}
				return {
					url: src,
					extra: {
						page: pageurl_1
					}
				};
			}
		}
		if (domain === "image.newdaily.co.kr") {
			newsrc = src.replace(/(\/site\/+data\/+)thumb(\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]{10,}_[0-9]+)_thumb\./, "$1img$2.");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/site\/+data\/+img\/+([0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]{10,})_[0-9]+\./);
			if (match) {
				return {
					url: src,
					extra: {
						page: "http://www.newdaily.co.kr/site/data/html/" + match[1] + ".html"
					}
				};
			}
		}
		if (domain === "img.stoo.com") {
			match = src.match(/\/upimages\/+gisaimg\/+[0-9]{6}\/+(?:[0-9]{2}_)?([0-9]+)_([0-9]+)\./);
			if (match) {
				return {
					url: src,
					extra: {
						page: "http://stoo.asiae.co.kr/article.php?aid=" + match[1] + match[2]
					}
				};
			}
		}
		if (domain_nowww === "freeseximages.com") return src.replace(/\/static\/+thumbnail\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/static/source/$1");
		if (domain_nosub === "ravelrycache.com" && /^images[0-9]*/.test(domain)) {
			newsrc = src.replace(/(\/[0-9]+\/+)webp\/+([^/]*)\.webp([?#].*)?$/, "$1$2.jpg");
			if (newsrc !== src)
				return add_full_extensions(newsrc);
			newsrc = src.replace(/(\/flickr\/+(?:[0-9]\/+){3}[0-9]+\/+[0-9]+)(?:_n)?(\.[^/.]*)(?:[?#].*)?$/, "$1_b$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/flickr\/+(?:[0-9]\/+){3}[0-9]+\/+([0-9]+)(?:_[a-z])?\.[^/.]*(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://live.staticflickr.com/0000/" + match[1] + "_face_k.jpg",
					fake: true
				};
			}
			return src.replace(/(\/uploads\/+[^/]*\/+[0-9]+\/+[^/]*)_(?:small|medium|square)[0-9]*(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "fotorgia.com") return src.replace(/(\/wp-content\/+plugins\/+wp-o-matic\/+cache\/+[0-9a-f]+_[^/]+)-[0-9]-[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "bonjourlesmadames.fr") return src.replace(/(\/static\/+files\/+[0-9]{4}\/+[0-9]{4}-[0-9]{2}-[0-9]{2}\/+)[0-9]+_([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "img.blesk.cz") return src.replace(/(\/img\/+[0-9]+(?:\/+|-))[^/]*((?:\/+|-)[0-9]+[^0-9])/, "$1origin$2");
		if (domain === "img.ngfiles.com") {
			if (/\/icons\/+hovers\/+[a-z]+\.png/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "uimg.ngfiles.com") return src.replace(/(\/icons\/+[0-9]+\/+[0-9]+_)(?:small|medium)\./, "$1large.");
		if (domain_nowww === "newgrounds.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+content\/+share\/+([0-9]+)\/+([0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://www.newgrounds.com/content/share/${1}/${2}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<div\s+class=["']embed-link["'][\s\S]{10,100}<input\s+type="text"\s+value=["']([^"']+)/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done({
						url: decode_entities(match[1]),
						is_pagelink: true
					}, 12 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+art\/+view\/+([^/]+)\/+([^/?#]+)(?:[?#].*)?$/,
				query_for_id: "https://www.newgrounds.com/art/view/${1}/${2}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/PHP\.merge\(({.*?"full_image_text":.*?})\);/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var obj = {
						extra: {
							page: resp.finalUrl
						}
					};
					try {
						var json = JSON_parse(match[1]);
						var img = json.full_image_text;
						match = img.match(/src="([^"]+)"/);
						if (!match) {
							console_error(cache_key, "Unable to find img match for", img);
						} else {
							obj.url = decode_entities(match[1]);
							return done(obj, 12 * 60 * 60);
						}
					} catch (e) {
						console_error(cache_key, e);
					}
					return done(null, false);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "art.ngfiles.com") {
			newsrc = src.replace(/(\/thumbnails\/+[0-9]+\/+[0-9]+)\./, "$1_full.");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/(?:thumbnails|images)\/+[0-9]+\/+([0-9]+)/);
			if (match) {
				return {
					url: "https://www.newgrounds.com/content/share/" + match[1] + "/4",
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "pinimg.icu") return src.replace(/\/wall\/+[0-9]+x[0-9]+\/+/, "/wall/0x0/");
		if ((domain_nosub === "netnews.vn" && /\.media\./.test(domain)) ||
			domain === "mediaold.tiin.vn") {
			return src.replace(/(_[0-9]+)wap_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "d343xr8tqpm2fx.cloudfront.net") return src.replace(/(\/userfiles\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{10,})s([0-9]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "minkch.com" && /^imgs/.test(domain)) {
			return src.replace(/(\/imgs\/+[^/]+\/+i_[0-9]+)s(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "img.8kmm.com") return src.replace(/(\/[0-9]{4}\/+[0-9]{1,2}\/+[0-9]{8,})_S(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "kpopis.com" && /^cdn[0-9]*\./.test(domain)) {
			return src.replace(/(\/data\/+file\/+lib2\/+[0-9]+\/+[0-9]+_[0-9]+_[0-9]+\.[^/._]+)_SM\.[^/.]*(?:[?$].*)?$/, "$1");
		}
		if (domain_nosub === "vnecdn.net" && domain.match(/^(?:(?:vcdn|i)-[^.]*|(?:.*\.)?img)\./)) {
			return src.replace(/(?:_m)?_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain === "pocket.playxp.com") {
			return {
				url: src.replace(/(:\/\/[^/]+\/+)(?:thumbs\/+[0-9]*x[0-9]*|preview)\/+/, "$1download/"),
				head_wrong_contenttype: true,
				headers: {
					Referer: "https://www.playxp.com/community/funny/view.php?article_id=12345"
				}
			};
		}
		if (domain_nowww === "flash24.co.kr") {
			if (/\/g[0-9]*\/+m\/+thumb\.php\?/.test(src)) {
				return keep_queries(src, ["bo_table", "img"], { required: true });
			}
		}
		if ((domain_nowww === "imgbaron.com" ||
			domain_nowww === "kropic.com" ||
			domain_nowww === "kvador.com" ||
			domain_nowww === "imgsen.com" ||
			domain_nowww === "imgsto.com" ||
			domain_nowww === "fotokiz.com" ||
			domain_nowww === "silverpic.com" ||
			domain_nowww === "picdollar.com" ||
			domain_nowww === "pics4you.net" ||
			domain_nowww === "barbit.net" ||
			domain_nowww === "picbaron.com")
			&& options.do_request && options.cb) {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([a-z0-9]{5,})\/+[^/]*\.html(?:[?#].*)?$/,
				query_for_id: function(id) {
					return {
						method: "POST",
						url: "https://" + domain_nosub + "/" + id + "/.html",
						data: "op=view&id=" + id + "&pre=1&next=Continue+to+image...",
						headers: {
							Origin: "https://" + domain_nosub,
							Referer: pageurl,
							"Content-Type": "application/x-www-form-urlencoded"
						},
					};
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<img\s+src=["']((?:https?:)?\/\/[^/]+\/+img\/+[0-9a-z]{10,}\/+.*?)['"]\s+class=["']pic["']/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done({
						url: urljoin(url, match[1], true),
						is_original: true
					}, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
			match = src.match(/\/i\/+[0-9]+\/+([0-9a-z]+)_t\./);
			if (match) {
				return {
					url: "https://" + domain_nosub + "/" + match[1] + "/.html",
					is_pagelink: true
				};
			}
		}
		if (domain === "m.wdqyan.com") return src.replace(/\/static\/+upload\/+thumbs\/+/, "/static/upload/");
		if (domain === "kan.china.com") return src.replace(/(\/utuku\/+img[0-9]*\/+)[0-9]+x[0-9]+\/+/, "$10x0/");
		if (domain === "storage.enuri.info") {
			match = src.match(/\/pic_upload\/+knowbox_rss\/+([^/.?#]+)(?:[?#].*)?$/);
			if (match) {
				return base64_decode(match[1]);
			}
		}
		if (domain === "img.mediapen.com") {
			match = src.match(/\/news\/+[0-9]{6}\/+news_([0-9]+)_[0-9]+_[a-z]\./);
			if (match) {
				return {
					url: src,
					extra: {
						page: "http://www.mediapen.com/news/view/" + match[1]
					}
				};
			}
		}
		if (domain === "cdnimage.dailian.co.kr") {
			newsrc = src.replace(/\/news\/+icon\/+([0-9]{6}\/+news_[0-9]+_[0-9]+)_c(\.[^/.]*)(?:[?#].*)?$/, "/news/$1_m_1$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/news\/+(?:[a-z]+\/+)?[0-9]{6}\/+news_[0-9]+_([0-9]+)_[a-z](?:_[0-9]+)?\./);
			if (match) {
				return {
					url: src,
					extra: {
						page: "http://www.dailian.co.kr/news/view/" + match[1]
					}
				};
			}
		}
		if (domain_nowww === "teengirl-pics.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+([^/.]{50,})\.[^/.]*(?:[?#].*)?$/);
			if (match) {
				return base64_decode(decodeURIComponent(match[1]));
			}
		}
		if (domain === "static-fhg.metart.com" ||
			domain === "static-fhg.rylskyart.com" ||
			domain === "static-fhg.met-art.com" ||
			domain === "static-fhg.sexart.com" ||
			domain === "static-fhg.vivthomas.com" ||
			domain === "static-fhg.eternaldesire.com" ||
			domain === "static-fhg.eroticbeauty.com" ||
			domain === "static-fhg.alsscan.com") {
			newsrc = src.replace(/(\/media\/+[0-9A-F]{10,}\/+)wt_([0-9A-F]{10,}\.[^/.]+)(?:[?#].*)?$/, "$1w_$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "fhg.asiansexdiary.com" ||
			domain === "hosted.trikepatrol.com" ||
			domain_nowww === "trikepatrol.com") {
			return src.replace(/(\/(?:wp-content\/+uploads|assets\/+fhg)\/+[^/]+\/+[^/]+_)th_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nosub === "tuktukpatrol.com") return src.replace(/(\/(?:assets|content)\/+[^/]+\/+[^/]+_[0-9]+)_th(_[0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "lesarchive.com") return src.replace(/(\/pictures\/+[0-9]+\/+[^/]+\/+)thumbs\/+/, "$1pics/");
		if (domain === "images.hqseek.com" ||
			domain === "images.bigboobsbeauties.com") {
			return src.replace(/(\/pictures\/+[^/]+\/+)thumbs\/+/, "$1");
		}
		if (domain_nosub === "scoreuniverse.com") return src.replace(/(\/images_content\/+[^/]*\/+[0-9]+)_tn(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "sexgrace.com") {
			return {
				url: src.replace(/\/tr\/+/, "/pics/"),
				headers: {
					Referer: "http://www.sexgrace.com/"
				}
			};
		}
		if (domain_nowww === "idealbabes.net" ||
			domain_nowww === "purescans.com") {
			return src.replace(/_tr(\/+[^/]*\.[^/.]*)(?:[?#].*)?$/, "_pics$1");
		}
		if (domain === "imganuncios.mitula.net") return src.replace(/(:\/\/[^/]*\/+)[a-z]+\/+([^/]+_[0-9]{10,}\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "recbook.com") return src.replace(/\/storage\/+thumbs\/+/, "/storage/uploads/");
		if (domain_nosub === "jdmagicbox.com" && /^content[0-9]*\./.test(domain)) {
			return src.replace(/(\/catalogue\/+[^/?]*-[a-z0-9]{10,})(?:-[0-9]+)?(\.[^/.]*?)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "image.aladin.co.kr") {
			return src
				.replace(/(\/product\/+[0-9]+\/+[0-9]+\/+.*?)(?:[?#].*)?$/, "$1")
				.replace(/(\/product\/+[0-9]+\/+[0-9]+\/+)cover500\/+(k[0-9]+_)1\./, "$1letslook/$2fl.")
				.replace(/(\/product\/+[0-9]+\/+[0-9]+\/+)cover(?:sum|1[50]0|200)\/+/, "$1cover500/");
		}
		if (domain === "book.interpark.com" ||
			domain === "bimage.interpark.com") {
			return src.replace(/(\/goods_image\/+(?:[0-9]\/+){4}[0-9]+)[hoi](\.[^/.]*)(?:[?#].*)?$/, "$1g$2");
		}
		if (domain === "mobile.kyobobook.co.kr") {
			newsrc = src.replace(/.*\/common\/+image\/+resize\?(?:.*&)?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "image.kyobobook.co.kr") return src.replace(/\/images\/+book\/+large\/+([0-9]{3}\/+)l/, "/images/book/xlarge/$1x");
		if (domain === "cdn.011st.com") return src.replace(/\/+11dims\/.*?\/11src\/+/, "/");
		if (domain_nowww === "comiczone.co.kr") return src.replace(/\/data\/+goods\/+t\/+/, "/data/goods/");
		if (domain === "static.mangahub.ru") return src.replace(/\/uploads\/+media\/+manga_cover\/+thumbnail\/+small\/+/, "/uploads/media/manga_cover/thumbnail/big/");
		if (domain_nosub === "kn3.net" ||
			(domain_nosub === "poringa.net" && /^img-[0-9]+\./.test(domain))) {
			newsrc = src.replace(/(\/(?:posts|taringa)\/+(?:[A-Z0-9]\/+){6}(?:[0-9]+\/+)?[^/]+\/+)(?:c_)?[0-9]+x[0-9]+_([^/]+)(?:[?#].*)?$/, "$1$2");
			if (domain_nosub === "poringa.net") {
				return {
					url: newsrc,
					headers: {
						Referer: "https://www.poringa.net/"
					}
				};
			} else {
				return newsrc;
			}
		}
		if (domain === "media.taringa.net") return src.replace(/(:\/\/[^/]+\/+knn\/+)(?:fit|crop):[0-9]+(?:x[0-9]+)?\/+([^-/_.]+)(?:[?#].*)?$/, "$1identity/$2");
		if (domain_nowww === "warashi-asian-pornstars.fr") return src.replace(/(\/[^/]+-img\/+[^/]*\/+[0-9]+\/+[0-9]+\/+)mini\/+/, "$1large/");
		if (domain_nosub === "kinghost.com" && /^www[0-9]*\./.test(domain)) {
			return {
				url: src
					.replace(/\/thumbnails\/+tn([0-9]+\.(?:jpg|png))(?:[?#].*)?$/, "/images/$1")
					.replace(/\/(?:s|tn)([a-z]?[0-9]+(?:[a-z]{2})?\.(?:jpg|png))(?:[?#].*)?$/, "/$1"),
				headers: {
					Referer: "http://" + domain + "/asian/"
				},
				referer_ok: {
					same_domain: true
				}
			};
		}
		if (domain_nowww === "japanesegirl-4you.com") return src.replace(/(\/[0-9]{4}\/+[0-9]{4}\/+)thumbs\/+/, "$1");
		if (domain_nowww === "nsgalleries.com") return src.replace(/(\/hosted2\/+[^/]+\/+hrpics\/+[^/]+\/+)thumbs\/+([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "sexygirlcity.com") return src.replace(/(\/gal\/+[0-9]+\/+[0-9]+)_tumb[a-z]?(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "image.pornyl.com") return src.replace(/(\/content\/+[0-9]+-[0-9]+\/+)tn\/+/, "$1");
		if (/^gettyimages\./.test(domain_nosub) && domain_nowww === domain_nosub) {
			var basedomain_1 = "www.gettyimages.com";
			if (api_cache.has("gettyimages_domain"))
				basedomain_1 = api_cache.get("gettyimages_domain");
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+detail\/+[^/]+\/+[^/]+\/+([0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://" + basedomain_1 + "/detail/a/a/${id}",
				imu_mode: "document",
				process: function(done, resp, cache_key) {
					api_cache.set("gettyimages_domain", resp.finalUrl.replace(/^[a-z]+:\/\/([^/]+)\/+.*/, "$1"), 6 * 60 * 60);
					var obj = {
						extra: {
							page: resp.finalUrl.replace(/(:\/\/www\.gettyimages\.)[^/]+\//, "://www.gettyimages.com/")
						},
						head_wrong_contenttype: true,
						head_wrong_contentlength: true
					};
					var description = get_meta(resp.responseText, "og:description");
					if (description)
						obj.extra.caption = description;
					var urls = [];
					var assetinfomatch = resp.responseText.match(/<script type="application\/json" data-component='AssetDetail'>\s*({.*})\s*<\/script>/);
					if (!assetinfomatch) {
						console_warn(cache_key, "Unable to find asset detail match for", resp);
					} else {
						var json_1 = JSON_parse(assetinfomatch[1]);
						urls.push({
							url: json_1.asset.largeMainImageURL,
							problems: {
								watermark: true
							}
						});
						urls.push({
							url: json_1.asset.thumb612Url,
							problems: {
								smaller: true
							}
						});
					}
					if (false) {
						var baseurl = get_meta(resp.responseText, "og:image");
						if (!baseurl) {
							console_error(cache_key, "Unable to find base image URL for", resp);
							return done(null, false);
						}
						baseurl = common_functions["getty_transform_url"](baseurl);
						var largerurl = baseurl.replace(/(-id[0-9]+)(?:[?#].*)?$/, "$1?s=2048x2048&w=5");
						urls.push({
							url: largerurl,
							problems: {
								watermark: true
							}
						});
					}
					if (false) {
						var matched_urls = resp.responseText.match(/"(https?:\/\/media\.gettyimages\.com\/+[^"]+)"/g);
						if (matched_urls) {
							var processed_urls = [];
							for (var _i = 0, matched_urls_1 = matched_urls; _i < matched_urls_1.length; _i++) {
								var url_3 = matched_urls_1[_i];
								processed_urls.push(decode_entities(JSON_parse(url_3)));
							}
							console_log(processed_urls);
						}
					}
					var smallerurl = get_meta(resp.responseText, "thumbnailUrl");
					if (smallerurl && !/&w=/.test(smallerurl)) {
						urls.push({
							url: smallerurl,
							problems: {
								smaller: true
							}
						});
					}
					return done(fillobj_urls(urls, obj), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "istockphoto.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+[^?#]+-gm([0-9]{5,})-[0-9]+(?:[?#].*)?$/);
			if (match)
				return {
					url: "https://www.gettyimages.com/detail/a/a/" + match[1],
					is_pagelink: true
				};
		}
		if (domain === "media.gettyimages.com" ||
			domain === "media.istockphoto.com") {
			var imageinfo = common_functions["getty_image_info"](src);
			if (imageinfo) {
				if (false) {
					if (src.match(/\/(?:photos|vectors)\/+[^/?]*-id[0-9]+(?:[?#].*)?$/)) {
						var problems = undefined;
						if (!imageinfo["watermark"]) {
							problems = { watermark: true };
						}
						newsrc = src.replace(/(-id[0-9]+)(?:[?#].*)?$/, "$1?s=2048x2048&w=5");
						if (newsrc !== src) {
							return {
								url: newsrc,
								head_wrong_contenttype: true,
								head_wrong_contentlength: true,
								problems: problems
							};
						}
					}
					newsrc = common_functions["getty_transform_url"](src);
					if (newsrc !== src) {
						if (!imageinfo["watermark"]) {
							return {
								url: newsrc,
								problems: {
									watermark: true
								}
							};
						} else {
							return newsrc;
						}
					}
				}
				return {
					url: "https://www.gettyimages.com/detail/a/a/" + imageinfo["id"],
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "distrowatch.com") return src.replace(/(\/images\/+(?:screenshots|slinks)\/+[^/]*)-small(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "tengritravel.kz") return src.replace(/(\/userdata\/+images\/+u[0-9]+\/+)resized\/+/, "$1");
		if (domain === "tb.ziareromania.ro") return src.replace(/:\/\/tb\.([^/]*)\/+[^/]*\/+([0-9a-f]{15,})\/.*/, "://s1.$1/?mmid=$2");
		if (domain_nowww === "povarenok.ru") return src.replace(/(\/images\/+[^/]*\/+[0-9]{2}_[0-9]{2}_[0-9]{2}\/+)[a-z]+\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "i.servimg.com") return src.replace(/\/tm\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "ammonnews.net") return src.replace(/\/image\.php\?(?:.*?&)?token=([0-9a-f]+).*?$/, "/image.php?token=$1");
		if (domain === "f.mahmure.com") return src.replace(/(\/galeri2\/+galeri_[0-9]+\/+)thumbnail\/+[0-9]+x[0-9]+_([^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "img.eronrg.com" ||
			domain_nowww === "eronrg.com") {
			return src.replace(/(\/gallery\/+[0-9]+\/+)small\/+([^/]*_)thumb(_[0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "$1big/$2img$3$4");
		}
		if (domain_nowww === "boobz.dk") return src.replace(/\/th\/+([0-9]+)_[a-z]+\./, "/$1.");
		if (domain_nowww === "redbloodedthing.com") return src.replace(/\/galleries\/+thumbs\/+(oldgallery[0-9a-f]{20,}\/+)[0-9]+(?:-[a-z]+)?-([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/galleries/images/$1600-$2");
		if (domain_nowww === "b92.net") return src.replace(/(\/pics\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9]+[0-9a-f]+[0-9]+)_[wh][0-9]+\./, "$1_orig.");
		if (domain_nosub === "albumoftheyear.org" && /^cdn[0-9]*\./.test(domain)) {
			return src.replace(/(:\/\/[^/]+\/+)(?:[0-9]+x\/+)?([a-z]+\/+)(?:thumbs\/+)?/, "$1$2");
		}
		if (domain_nowww === "rap4ever.org") return src.replace(/(\/uploads\/+albums\/+[^/]*\/+[^/]*?)[0-9]+X[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "musicmeter.nl") return src.replace(/(\/images\/+cover\/+[0-9]+\/+[0-9]+\.)[0-9]+\.([^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "ecp.yusercontent.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+mail\?(?:.*?&)?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "foto.sondakika.com") return src.replace(/(\/haber\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[^/]*-[0-9]+_[0-9]+)_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1_osd$2");
		if (domain_nowww === "segre.to") return src.replace(/(\/shouts\/+[^/]*\/+[^/]*)_hq(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "img.fotodom.ru") {
			obj = [];
			regex = /(:\/\/[^/]*\/+[^/?]*)(?:\?size=[sml])?(?:\#.*)?$/;
			newsrc = src.replace(regex, "$1?size=l");
			if (newsrc !== src)
				obj.push({
					url: newsrc,
					problems: {
						watermark: true
					}
				});
			newsrc = src.replace(regex, "$1?size=m");
			if (newsrc !== src)
				obj.push({
					url: newsrc,
					problems: {
						smaller: true
					}
				});
			return obj;
		}
		if (domain === "d3m2o2bzrl719s.cloudfront.net") {
			obj = [];
			regex = /(:\/\/[^/]*\/+photos\/+[0-9]{4}\/+[0-9]{2}\/+[^/]+\/+)(?:gallery|lightbox)_([-0-9a-f]{20,}\.)/;
			newsrc = src.replace(regex, "$1lightbox_$2");
			if (false && newsrc !== src) // disabling because too many images get smaller
				obj.push({
					url: newsrc,
					problems: {
						watermark: true
					}
				});
			newsrc = src.replace(regex, "$1gallery_$2");
			if (newsrc !== src)
				obj.push({
					url: newsrc,
					problems: {
						smaller: true
					}
				});
			return obj;
		}
		if (domain_nowww === "secureservercdn.net") return src.replace(/^[a-z]+:\/\/[^/]*\/+(?:[0-9]+\.){3}[0-9]+\/+([^/]*\.[^/]*\/)/, "http://$1");
		if (domain === "cdn-yotpo-images-production.yotpo.com") {
			newsrc = src.replace(/\/low_resolution(\.[^/.]*)(?:[?#].*)?$/, "/standard_resolution$1");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/(?:Product|Review|Account)\/+[0-9]+\/+[0-9]+\/+)[a-z_]+(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		}
		if (domain_nowww === "maquillagecreation.ch") return src.replace(/(\/img\/+content\/+[^/]*\/+[^/]*\/+[^/]*?)(?:_m|[0-9]+x[0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "image.gamer.ne.jp") return src.replace(/(\/news\/+[0-9]{4}\/+[0-9]{8}\/+[0-9a-f]{20,}\/+)[a-z]\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1o/$2");
		if (domain_nowww === "moviemagik.in") return src.replace(/(\/files\/+[^/]*\/+[0-9]+\/+)thumb\/+/, "$1");
		if (domain_nowww === "itedou.com") return src.replace(/(\/Uploads\/+[^/]*\/+[0-9]+\/+[0-9]+)_s(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "img.cnread.news") return src.replace(/(\/uploads\/+[0-9]+\/+[0-9A-F]{2}\/+[0-9A-F]+w[0-9]+h[0-9]+)(?:_[0-9]+x[0-9]+)?(?:_s[0-9]*)?(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "filmitena.com") {
			return src
				.replace(/(\/img\/+Actor\/+)[a-zA-Z]+\/+([0-9]+)_[a-z]+(\.[^/.]*)(?:[?#].*)?$/i, "$1Original/$2_or$3")
				.replace(/(\/img\/+)Image(?:Tmb)?\/+([0-9]+)_[a-zA-Z]+(\.[^/.]*)(?:[?#].*)?$/i, "$1big/$2_bg$3");
		}
		if (domain_nowww === "fandimefilmu.cz") return src.replace(/(\/files\/+images\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2})[a-z_]+_([a-z0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "fetcher-cdn.nullmu.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+social(?:_preview)?\/+[0-9a-f]{20,}\.[^/.?]*\?(?:.*&)?u=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "bharatstudent.com") return src.replace(/\/gallery\/+thumb\/+events\/+/, "/gallery/normal/events/");
		if (domain === "mimgs.sulekha.com") {
			newsrc = src
				.replace(/\/(?:images\/+event-photos|events)\/+([^/]*\/+)spot[0-9]*\/+/, "/images/event-photos/$1")
				.replace(/\/images\/+stills\/+thumbnail\/+/, "/images/stills/");
			if (newsrc !== src)
				return {
					url: newsrc,
					problems: {
						watermark: true
					}
				};
		}
		if (domain_nowww === "i.indiglamour.com") return src.replace(/(\/photogallery\/+.*\/normal\/+[^/]*_[0-9]+)(?:thmb|rs)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "mom50.com") {
			return {
				url: src.replace(/(\/galleries\/+[^/]*\/+[0-9]{4}\/+[0-9]{2}\/+[^/]*\/+[0-9]+)(?:_[a-z]+){1,}(\.[^/.]*)(?:[?#].*)?$/, "$1$2"),
				headers: {
					Referer: ""
				}
			};
		}
		if (domain_nowww === "fastpics.eu") return src.replace(/\/tn_([^/]*\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "forbidden-dreams.com" ||
			domain_nowww === "porn-service.us") {
			return src.replace(/\/([0-9]+)_ci(\.[^/.]*)(?:[?#].*)?$/, "/ci_$1$2");
		}
		if (domain_nowww === "iie8.com" ||
			domain_nowww === "vq50.com" ||
			domain_nowww === "e1nn.com") {
			return src.replace(/(\/cdn\/+i\/+[0-9a-f]{10,}\/+)th-[0-9]*x[0-9]*\/+/, "$1");
		}
		if (domain_nowww === "lustfulmodels.com") return src.replace(/\/s_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "tannerbucks.com") return src.replace(/\/index_files\/+tn([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain === "galleries.imctrck.com") return src.replace(/\/tn\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/images/$1");
		if (domain_nowww === "boobgoddess.com") return src.replace(/\/thumbs([0-9]*)\/+tn_/, "/pics$1/");
		if (domain_nowww === "nextpicturez.com") return src.replace(/(\/gallery\/.*\/)thumbs\/+/, "$1");
		if (domain_nowww === "porngals4.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:[-a-z]+-)?([0-9]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://www.porngals4.com/a-${id}/",
				override_cb: function(cb, data) {
					if (!data)
						return cb(data);
					var imu_id = src.match(/#imu-id=([0-9]+-[0-9]+)$/);
					if (!imu_id)
						return cb(data);
					imu_id = imu_id[1];
					array_foreach(data.album_info.links, function(link) {
						var link_id = link.url.match(/-([0-9]+-[0-9]+)\./)[1];
						if (link_id === imu_id) {
							data.url = link.url;
							data.album_info.links[0].is_current = false;
							link.is_current = true;
							return false;
						}
					});
					cb(data);
				},
				process: function(done, resp, cache_key, match) {
					var obj = {
						extra: {
							page: resp.finalUrl,
							caption: get_meta(resp.responseText, "og:title")
						}
					};
					var id = match[1];
					var gal_info = resp.responseText.match(/<div class="hide" id="gp">({.*?})<\/div>/);
					if (!gal_info) {
						console_error(cache_key, "Unable to find info div from", resp);
						return done(null, false);
					}
					gal_info = JSON_parse(gal_info[1]);
					var imagelist = gal_info.imgl;
					var galleries_url = resp.responseText.match(/<a href="(https?:\/\/[a-z]\.[^/]+\/+media\/+galleries\/+)[0-9]+\/+[0-9]+\/+[0-9]+-[0-9]+\/+[^/]+-[0-9]+-[0-9]+\.[^/."]+?"/);
					if (!galleries_url) {
						console_error(cache_key, "Unable to find galleries URL from", resp);
						return done(null, false);
					}
					galleries_url = galleries_url[1];
					var images = [];
					array_foreach(imagelist, function(image) {
						images.push({
							url: galleries_url + image.gal.d1 + "/" + image.gal.d2 + "/" + image.gal_id + "-" + image.gal.serial + "/" + image.gal.url + "-" + image.image_id + "-" + image.serial + "." + image.ext,
							is_current: false
						});
					});
					images[0].is_current = true;
					return done({
						url: images[0].url,
						extra: obj.extra,
						album_info: {
							type: "links",
							links: images
						}
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "porngals4.com") {
			newsrc = src.replace(/\/media\/+galleries_[0-9]+(?:x[0-9]+)?\/+/, "/media/galleries/");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]*\/+media\/+(?:gals|galleries)(?:_[0-9]+(?:x[0-9]+)?)?\/+[0-9]+\/+[0-9]+\/+([0-9]+)-[0-9]+\/+(?:[-a-z]+)?([0-9]+-[0-9]+)\./);
			if (match) {
				return {
					url: "https://www.porngals4.com/" + match[1] + "/#imu-id=" + match[2],
					is_pagelink: true
				};
			}
			match = src.match(/^[a-z]+:\/\/[^/]*\/+media\/+gals_[0-9]+(?:x[0-9]+)?\/+[0-9]+\/+[0-9]+\/+([0-9]+)-[0-9]+\./);
			if (match) {
				return {
					url: "https://www.porngals4.com/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "archivegalleries.net") {
			return {
				url: src.replace(/(\/collection\/.*\/[0-9]+)_[a-z]+size(\.[^/.]*)(?:[?#].*)?$/, "$1$2"),
				headers: {
					Referer: ""
				}
			};
		}
		if (domain_nosub === "alsscan.com" && /^(?:s|adv)[0-9]*\./.test(domain)) {
			return src.replace(/\/([a-z]*sample[0-9]+)s(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		}
		if (domain_nowww === "mnvg.com") return src.replace(/(\/gallery\/+[0-9]+\/+[0-9]+)(\.[^/.]*)(?:[?#].*)?$/, "$1-full$2");
		if (domain_nowww === "pornpaw.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+showthumb\.php\?(?:.*?&)?thumblink=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nosub === "newstracklive.com") return src.replace(/(\/uploads\/+.*\/+[0-9]{1,2}\/+)[a-z]+_thumb\/+/, "$1big_thumb/");
		if (domain_nowww === "ap7am.com") return src.replace(/(\/backimages\/+telugu-news\/+)thumbs\/+(tnews-)/, "$1bigimages/$2");
		if (domain === "api.parkseason.ru") return src.replace(/\/images\/+styles\/+[^/]*\/+/, "/images/");
		if (domain === "s-cdn.sportbox.ru") return src.replace(/\/images\/+styles\/+[^/]+\/+/, "/images/styles/upload/");
		if (domain_nowww === "vgamuseum.info") return src.replace(/\/smart_thumbs\/+([^/]*?)_thumb_other[0-9]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain_nowww === "metager.org") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+meta\/+picture\?(?:.*&)?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "i.swisscows.ch") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+\?link=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "cdn.swisscows.ch") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+(https?:)/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "mithaaprilia.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+image\?(?:.*?&)?q=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "proprofs.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+games\/+puzzle\/+sliding\/+resize_image\.php\?(?:.*?&)?image=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "sweetgirl.org") return src.replace(/(\/files\/+sets\/+[0-9]+\/+[^/]*\/+)thumb\/+/, "$1");
		if (domain === "img.lady.ru") {
			newsrc = src.replace(/(\/data\/+aphoto\/.*\/)small\/+/, "$1large/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/data\/+users\/.*\/)small(\.[^/.]*)(?:[?#].*)?$/, "$1large$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "cfake.com" ||
			domain_nowww === "krishna24.ru" ||
			domain_nowww === "lovedat.ru") {
			return src.replace(/\/medias\/+(?:thumbs|photos)\/+/, "/medias/ophotos/");
		}
		if (domain === "images.galleries.pornpros.com" ||
			domain === "videos.galleries.pornpros.com") {
			return src
				.replace(/(\/htdocs\/+[^/]+\/+[^/]+\/+content\/+)thumbs\/+([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1full/$2")
				.replace(/(\/htdocs\/+[^/]+\/+[^/]+\/+)thumbnails\/+([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1full/$2")
				.replace(/(\/htdocs\/+[^/]+\/+[^/]+\/+)thumbs\/+([^/]+\/+[0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1content/$2");
		}
		if (domain_nosub === "pornpros.com" && /^images\.r[0-9]*\./.test(domain)) {
			return src.replace(/:\/\/[^/]+\/+[^/]+\/+[0-9]+x[0-9]+\/+center\/+middle\/+smart\/+(content\/+)/, "://images.galleries.pornpros.com/$1");
		}
		if (domain_nowww === "sks-52.ru" ||
			domain === "gals.kindgirls.com") {
			return src.replace(/(\/d[0-9]+\/+[^/]*\/+)m[0-9]+\/+/, "$1");
		}
		if (domain === "abc.2008php.com") return src.replace(/(\/[0-9]+_)smallimg\/+/, "$1Website_appreciate/");
		if (domain === "pro.imgcdn2.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+\?(?:.*&)?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return add_http(decodeuri_ifneeded(newsrc.replace(/z-z/g, ".")));
		}
		if (domain_nowww === "girlswithmuscle.com") {
			newsrc = src.replace(/\/images\/+thumbs\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/images/full/$1");
			if (newsrc !== src) {
				return add_full_extensions(newsrc, ["mp4", "jpg"], true);
			}
		}
		if (domain === "img.jiahes.com") return src.replace(/(\/upload\/+image\/+[^/]*\/+[0-9]+\/+)c_[0-9]{3}([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "img.peta2.jp") return src.replace(/(\/img\/+upload\/+th\/+[0-9]+-[0-9]+\/+[0-9]+\/+[^/]*_[0-9]+_[0-9]+)_(?:thumb)?[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1_org$2");
		if (domain_nowww === "fakty.ua") return src.replace(/(\/photos\/+articles\/+[0-9]{2}\/+[0-9]\/+[0-9]+)(?:[a-z][0-9]*){1,}(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "metrosport.gr") return src.replace(/\/images\/+thumbs_[a-z]+\/+/, "/images/");
		if (domain_nowww === "boobieblog.com") return src.replace(/(\/img[0-9]*\/+[^/]*)_small(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "wearehairy.com" && /^cdn[0-9]*\./.test(domain)) {
			return src.replace(/\/th\/+([^/]*\.[^/.]*)(?:[?#].*)?$/, "/img/$1");
		}
		if (domain === "cdn.picson.mobi") return src.replace(/(:\/\/[^/]*\/+)[0-9]+\/+([0-9]+\/+[0-9]+\/+[0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1original/$2");
		if (domain === "s.deviant.life" ||
			domain === "s.pornpics.today" ||
			domain === "s.hardcore.pink" ||
			domain === "s.brunette.site" ||
			domain === "s.nudepornpics.xyz" ||
			domain === "s.picsofporn.club" ||
			domain === "s.xpics.info" ||
			domain === "s.sexoic.com" ||
			domain === "s.pornphotos.space" ||
			domain === "s.pornpictures.space" ||
			domain === "s.teenpornpics.today" ||
			domain === "s.pornphotos.pw" ||
			domain === "s.pics.red" ||
			domain === "s.softcore.life") {
			return src.replace(/(\/img\/+(?:[0-9a-f]{2}\/+){4})[wh][0-9]+px\/+/, "$1");
		}
		if (domain === "d17c3xisf00oox.cloudfront.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+api\/+image-loader\.php\?(?:.*&)?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "darkmovie.info" ||
			domain_nowww === "mihanfilm.live" ||
			domain_nowww === "darkmovie.org") {
			return src.replace(/(\/upload\/+(?:cast|poster)\/+(?:nm|tt)[0-9]+)_[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "shutterstock.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+editorial\/+image-editorial\/+(?:[^/?#]+-)?([0-9]+[a-z]+)(?:[?#].*)?$/,
				query_for_id: "https://www.shutterstock.com/editorial/image-editorial/${id}",
				process: function(done, resp, cache_key) {
					var obj = {
						extra: {
							page: resp.finalUrl
						}
					};
					var urls = [];
					var ogimage = get_meta(resp.responseText, "og:image");
					if (ogimage) {
						urls.push({
							url: ogimage,
							problems: { watermark: true }
						});
					}
					var match = resp.responseText.match(/<script\s+type=["']application\/ld\+json["']>\s*(\[.*?\])\s*<\/script>/);
					if (match) {
						try {
							var json_obj = JSON_parse(match[1]);
							var thumbnail = json_obj[1].thumbnail;
							if (thumbnail) {
								urls.push({
									url: thumbnail,
									problems: { smaller: true }
								});
							}
							if (json_obj[1].name || json_obj[1].description) {
								obj.extra.caption = json_obj[1].name || json_obj[1].description;
							}
						} catch (e) {
							console_error(cache_key, e);
						}
					}
					if (!urls.length)
						return done(null, false);
					return done(fillobj_urls(urls, obj), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "shutterstock.com" && /^editorial[0-9]*\./.test(domain)) {
			id = src.replace(/^[a-z]+:\/\/[^/]*\/+[^/]*\/+([0-9]+[a-z])\/+.*/, "$1");
			if (id !== src) {
				return {
					url: "https://shutterstock.com/editorial/image-editorial/" + id,
					is_pagelink: true
				};
			}
		}
		if (domain === "images.vinted.net") return src.replace(/\/thumbs\/+(?:[0-9]+x[0-9]+|f[0-9]+)\/+/, "/thumbs/");
		if (domain_nowww === "celebnakedness.com") {
			return src
				.replace(/(\/gallery[0-9]*\/+tourgallery\/+)thumbnails\/+/, "$1")
				.replace(/(\/tour\/+)free\/+thumbs\/+[^/]+\/+/, "$1");
		}
		if (domain === "userimg.tellonym.me") {
			return {
				url: src.replace(/(:\/\/[^/]+\/+)(?:thumb|xs)\/+/, "$1lg/"),
				can_head: false // 403
			};
		}
		if (domain_nosub === "omni7.jp") {
			if (/\/common\/+images\/+material\/+noImage\./.test(src))
				return {
					url: src,
					bad: true
				};
			if (/\/common\/+images\/+zoomImage\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src
				.replace(/(\/product\/+[0-9]+\/+[0-9]+\/+image\/+[0-9]+(?:_[0-9]+)?)_(?:main|sub[0-9]*)_el(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/product\/+[0-9]+\/+[0-9]+\/+image\/+[0-9]+(?:_[0-9]+)?_(?:main|sub[0-9]*))_[sml](\.[^/.]*)(?:[?#].*)?$/, "$1_el$2");
		}
		if (domain === "d2jtsb989t238a.cloudfront.net") return src.replace(/(\/p\/+[0-9]+\/+[0-9]+\/+)small(?:[?#].*)?$/, "$1normal");
		if (domain === "ogre.natalie.mu" && string_indexof(src, "/media/") >= 0) {
			return src
				.replace(/(?:[?#].*)?$/, "?impolicy=pp_image")
				.replace(/(\/photo[0-9]+)s\./, "$1.");
		}
		if (domain === "cdnx.natalie.mu") {
			newsrc = src.replace(/(?:_fixw_(?:120|234)|_fit_120x120|_fixw_(?:640|730)_hq)\./, "_fixw_750_lt.");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/^[a-z]+:\/\/[^/]+\/+(media\/+(?:[^/]+\/+)?[^/]+\/+[0-9]{4}\/+[0-9]{4}\/+[^/]+)_(?:fix[a-z]|fit)_[^/.?#]+\./, "https://ogre.natalie.mu/$1.");
		}
		if (domain_nowww === "gohong01.com") return src.replace(/(\/img\/+[0-9]+\/+)mini(\.[^/.]*)(?:[?#].*)?$/, "$1t$2");
		if (domain === "static.mercdn.net") return src.replace(/\/thumb\/+([a-z]+)\/+/, "/item/detail/orig/$1/");
		if ((domain_nosub === "readthis.one" && /^s[0-9]*\./.test(domain))) {
			return src.replace(/(\/yimg\/+[^/]{50,}\.[^/._]+)_[0-9]+\.[^/.]*(?:[?#].*)?$/, "$1");
		}
		if (domain === "photos.fashiongroup.com") {
			newsrc = src.replace(/(\/[0-9]{4}-[0-9]{2}-[0-9]{2}\/+[0-9]+\/+)thumbs_([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/[0-9]{4}-[0-9]{2}-[0-9]{2}\/+[0-9]+\/+)([^/]*\.[^/.]*)(?:[?#].*)?$/, "$12048/$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "napiszar.com") return src.replace(/(\/uploads\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]{30,})_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1_origi$2");
		if (domain_nowww === "incontri-passionali.com" ||
			domain_nowww === "incontri-in-italia.com" ||
			domain_nowww === "incontri-bakeka.com" ||
			domain_nowww === "sesso-escort.com") {
			return src.replace(/(\/images\/+[^/]+\/+)med-([0-9]+-[0-9]+\.)/, "$1max-$2");
		}
		if (domain_nowww === "filmyerotyczne.tv") return src.replace(/(\/gallery\/+[^/]*\/+[0-9]+_[0-9]+\/+)medium\/+/, "$1large/");
		if (domain_nowww === "idposter.com") return src.replace(/\/img\/+smalls\/+([0-9]+\/+)s_id/, "/img/bigs/$1id");
		if (domain_nowww === "fappeningbook.com") return src.replace(/(\/photos\/+.\/+.\/+[^/]*\/+[0-9]+\/+[0-9]+)t(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "pics.hotsexygirls.eu" ||
			domain_nowww === "johnrossballetgallery.co.uk" ||
			domain_nowww === "chuchomerchan.com" ||
			domain_nowww === "hhogc.org" ||
			domain_nowww === "icann-online.org" ||
			domain_nowww === "stanleys-haven.com" ||
			domain_nowww === "tangovalley.com" ||
			domain_nowww === "huffnpuffsfa.com") {
			newsrc = src.replace(/\/cache\/+([^/]*\.[^/.]*)\.thumb(\.[^/.]+)(?:[?#].*)?$/, "/cache/$1.small$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/cache\/+([^/_]+)_([^/]*\.[^/.]*)\.[a-z]+\.[^/.]*(?:[?#].*)?$/);
			if (match) {
				return src.replace(/\/cache\/+[^/]+(?:[?#].*)?$/, "/image.php?twg_album=" + match[1] + "&twg_show=" + match[2]);
			}
			match = src.match(/\/image\.php\?(.*?&)?twg_album=/);
			if (match) {
				obj = {
					extra: {
						page: keep_queries(src, ["twg_album", "twg_show"]).replace(/\/image\.php\?/, "/index.php?"),
					}
				};
				newsrc = keep_queries(src, ["twg_album", "twg_show"], { required: true });
				if (newsrc !== src)
					return fillobj_urls([newsrc], obj);
				var queries = get_queries(src);
				if (queries.twg_album && queries.twg_show) {
					var twg_album = queries.twg_album.replace(/\+/g, " ");
					var twg_show = queries.twg_show.replace(/\+/g, " ");
					return fillobj_urls([src.replace(/\/image\.php\?.*/, "/pictures/" + twg_album + "/" + twg_show)], obj);
				}
			}
		}
		if (domain === "mygalleries.allpornmodels.com") return src.replace(/(:\/\/[^/]*\/+[^/]*\/+)small\/+/, "$1");
		if (domain === "forum.donanimhaber.com") {
			newsrc = src.replace(/.*?\/cache\/+ImageThumbnail2\.aspx\?(?:.*&)?path=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nosub === "newtumbl.com") {
			obj = {
				url: src,
				headers: {
					Referer: ""
				},
				bad_if: [{
						headers: {
							"content-type": "image/jpg",
							"content-length": "688362"
						}
					}],
				referer_ok: {
					same_domain_nosub: true
				},
				can_head: false // completely wrong output
			};
			newsrc = src.replace(/(\/img\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+nT_[0-9a-z]{10,})_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			regex = /(\/img\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+nT_[0-9a-z]{10,})\.[^/.]+(?:[?#].*)?$/;
			if (regex.test(src) && options && options.do_request && options.cb) {
				var cachelink = src.replace(regex, "$1");
				api_cache.fetch("newtumbl:" + cachelink, function(url) {
					if (url) {
						obj.url = url;
					}
					options.cb(obj);
				}, function(done) {
					var req;
					var do_test = function(ext) {
						loaded = false;
						loading_ext = ext;
						var loadfunc = function(resp) {
							onload(resp, ext);
						};
						req = options.do_request({
							url: src.replace(regex, "$1." + ext),
							method: "GET",
							headers: {
								Referer: ""
							},
							onprogress: loadfunc,
							onload: loadfunc
						});
					};
					var loaded = false;
					var loading_ext;
					var onload = function(resp, current_ext) {
						if (loading_ext !== current_ext || loaded) {
							req.abort();
							return;
						}
						if (resp.readyState === 4 || resp.responseHeaders) {
							loaded = true;
							req.abort();
						}
						if (!loaded)
							return;
						if (resp.status !== 200) {
							return done(null, false);
						}
						var headers_list = parse_headers(resp.responseHeaders);
						var headers = headers_list_to_dict(headers_list);
						var splitted = headers["content-type"].split("/");
						var mediatype = splitted[0];
						var ext = splitted[1];
						var newsrc = src.replace(regex, "$1." + ext);
						if (current_ext === "mp4") {
							if (mediatype === "video") {
								return done(newsrc, 24 * 60 * 60);
							} else {
								do_test("gif");
							}
						} else {
							return done(newsrc, 24 * 60 * 60);
						}
					};
					do_test("mp4");
				});
				return {
					waiting: true
				};
			}
			newsrc = src.replace(/(\/img\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+nT_[0-9a-z]{10,})\.(?:jpg|JPG|jpeg|JPEG|png|PNG|webp|WEBP)(?:[?#].*)?$/, "$1.mp4");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
		}
		if (domain === "img.ohpolly.com") return src.replace(/:\/\/[^/]*\/+[^/]*=\/+(?:.*?\/)?(catalog\/+product\/)/, "://www.ohpolly.com/media/$1");
		if (domain_nowww === "brightvibes.com") {
			newsrc = src.replace(/(\/file\/+[^/]*)\/+[0-9]+x[0-9]+(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/image-cache\/+[0-9]+x[0-9]+-([^/]*\.[^/.]*)(?:[?#].*)?$/, "/images/$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "cdn.webshopapp.com" ||
			domain === "cdn.shoplightspeed.com") {
			return src.replace(/(\/files\/+[0-9]+\/+)[0-9]+x[0-9]+(?:x[0-9])?\/+/, "$1");
		}
		if (domain_nowww === "hdnicewallpapers.com") {
			return src.replace(/(:\/\/[^/]*\/+)walls\/+[a-z]+\/+/i, "$1Walls/Big/");
		}
		if (domain === "img.theculturetrip.com") return src.replace(/\/[0-9]*x[0-9]*\/+wp-content\/+/, "/wp-content/");
		if (domain_nosub === "ning.com" && /^(?:st[0-9]*|storage)\./.test(domain)) {
			return src.replace(/(\/file\/+get\/+[0-9]+)\?.*$/, "$1?profile=original");
		}
		if (domain_nowww === "comedywildlifephoto.com") return src.replace(/(\/images\/+gallery\/+[0-9]+\/+[0-9]+)_t(\.[^/.]*)(?:[?#].*)?$/, "$1_p$2");
		if (domain_nowww === "islam.kz") return src.replace(/(\/uploads\/+images\/+(?:[^/]{3}\/+){2}[^/.]*)-(?:sm|md)(\.[^/.]*)(?:[?#].*)?$/, "$1-lg$2");
		if (domain_nowww === "todofondos.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+f\/+([0-9]+(?:\/+[0-9]+x[0-9]+)?)(?:[?#].*)?$/,
				query_for_id: "http://todofondos.com/f/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<a href="([^"']*\/bin\/descargas\/.*?)"/);
					if (match) {
						return done({
							url: decode_entities(match[1]),
							extra: {
								page: resp.finalUrl
							}
						}, 6 * 60 * 60);
					}
					var match = resp.responseText.match(/<button[^>]*onclick="\s*javascript:location.href='(https?:\/\/todofondos\.com\/+f\/+[0-9]+\/+[0-9]+x[0-9]+)'"[^>]*>\s*<span[^>]*>\s*<\/span>\s*resoluci.n\s+original/);
					if (match) {
						return done({
							url: decode_entities(match[1]),
							is_pagelink: true
						}, 6 * 60 * 60);
					}
					console_log(cache_key, "Unable to find download or index match for", resp);
					return done(null, false);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "todofondos.com") {
			id = src.replace(/.*\/bin\/+fondos\/+((?:[0-9]{2}\/+){2}[0-9]+)[a-z]\.[^/.]*(?:[?#].*)?$/, "$1");
			if (id !== src) {
				return {
					url: "http://todofondos.com/f/" + id.replace(/\/+/g, "").replace(/^0*/, ""),
					is_pagelink: true
				};
			}
		}
		if (domain === "d2w9rnfcy7mm78.cloudfront.net") return src.replace(/(\/[0-9]+\/+)[a-z]+_([0-9a-f]{20,}\.[^/.]*)(?:[?#].*)?$/, "$1original_$2");
		if (domain === "birkrdnawa.com") {
			return src.replace(/(\/content\/+siteimages\/+[a-z]+\/+)thumb\/+/i, "$1");
		}
		if (domain === "media.bernardinai.lt") return src.replace(/(\/o\/+[0-9a-f]{20,})_[_a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "econet.ru") return src.replace(/(\/media\/+video_covers\/+[0-9]+\/+)[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		if (domain_nowww === "displate.com") return src.replace(/\/displates\/+(?:[0-9]+\/+[a-z]+\/+)?([0-9]{4}-[0-9]{2}-[0-9]{2}\/+[^/]*?)(?:[?#].*)?$/, "/displates/$1");
		if (domain_nowww === "lens2print.co.uk") return src.replace(/(\/cms\/+upload_area\/+images\/+[0-9]+_processed\/+)(?:medium|crop)\/+/, "$1large/");
		if (domain_nowww === "iqna.ir" ||
			domain_nowww === "parsine.com") {
			return src.replace(/(\/files\/+[^/]*\/+news_albums\/+[0-9]+\/+[0-9]+\/+)thumbnails\/+thm_/, "$1resized/resized_");
		}
		if (domain_nowww === "az-deteto.bg") return src.replace(/(\/pic\/+article\/+)logo\/+/, "$1picture/");
		if (domain_nosub === "efreenews.com") return src.replace(/(\/storage\/+posts\/+[A-Za-z]+[0-9]{4}\/+[0-9a-f]{20,})-thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "iziva.com") {
			return {
				url: src.replace(/\/media\/+jact\/+[^/]*\/+images\/+/, "/images/"),
				headers: {
					Referer: ""
				},
				referer_ok: {
					same_domain: true
				}
			};
		}
		if ((domain_nosub === "viewbug.com" && /^cdnpt[0-9]*\./.test(domain)) ||
			amazon_container === "photo-viewbug") {
			return src.replace(/(\/media\/+mediafiles\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+)_widepreview400(\.[^/.]*)(?:[?#].*)?$/, "$1_large1300$2");
		}
		if (domain === "bilder.t-online.de") return src.replace(/(\/id_[0-9]+\/+)(?:[0-9]+(?:_[0-9]+)?[wh]?\/+)?(?:c_[^/]*\/+)?tid_da\/+/, "$1c_raw/tid_da/");
		if (domain_nowww === "khabarban.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+NewsImage\/+[0-9]+\/+([^/.]{50,})(?:[?#].*)?$/, "$1");
			if (newsrc !== src) {
				return base64_decode(newsrc);
			}
		}
		if ((domain_nosub === "imagecollect.com" && /^static[0-9]*\./.test(domain)) ||
			amazon_container === "live-imagecollect") {
			newsrc = src.replace(/\/thumbnail\/+([0-9]+\/+[0-9a-f]+)(?:[?#].*)?$/, "/preview/$1");
			if (newsrc !== src)
				return {
					url: newsrc,
					problems: {
						watermark: true
					}
				};
		}
		if (domain_nosub === "corriereobjects.it" && /^images[0-9]*\./.test(domain)) {
			return src.replace(/_MGZOOM(\.[^/.]*)(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "mojeek.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+image\?(?:.*&)?img=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "pic.templetons.com") return src.replace(/\/thumb\/+(img_[0-9]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain === "assets.yandycdn.com") return src.replace(/\/(?:t[0-9]*(?:-compressed)?|Products)\/+/, "/HiRez/");
		if (domain_nosub === "facciabuco.com" && /^cdn-img-[a-z]\./.test(domain)) {
			return src.replace(/_[ac](\.[^/.]*)(?:[?#].*)?$/, "_b$1");
		}
		if (domain_nowww === "uskinfo.ba") return src.replace(/(\/files\/+[^/]*\/+)thumbs\/+/, "$1");
		if (domain_nowww === "drago99.com") return src.replace(/(\/Drago99\/+[^/]*\/+)tn([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "galleries.justebonysex.com") return src.replace(/(\/[0-9]+\/+)t(p[0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "intim-photos.ru") return src.replace(/(\/photos\/+[0-9]+\/+[0-9]+\/+)thumb\/+/, "$1");
		if (domain === "hwnds.ddfstatic.com") return src.replace(/(\/content\/.*\/)thu\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1fulm/$2");
		if (domain_nosub === "mlo.me") {
			newsrc = src.replace(/(:\/\/[^/]*\/+upen\/+)[sm]\/+/, "$1l/");
			if (newsrc !== src) {
				return newsrc;
			}
			newsrc = src.replace(/(:\/\/[^/]+\/+upen\/+)l\/+/, "$1v/");
			if (newsrc !== src) {
				return {
					url: newsrc,
					problems: {
						watermark: true
					}
				};
			}
		}
		if (domain_nowww === "lilykoh.com") return src.replace(/(\/content\/+[^/]*\/+)[0-9]+tn([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "utporn.com" && /^pics[0-9]*\./.test(domain)) {
			return src.replace(/(\/albums\/+[0-9]+\/+[0-9]+-[^/]+\/+)[0-9]+(?:x[0-9]+)?\/+/, "$1");
		}
		if (domain_nowww === "girlsilove.net" ||
			domain_nowww === "tight-clothed.com" ||
			domain_nowww === "teen-angels.org" ||
			domain_nowww === "nude-beauty.net" ||
			domain_nowww === "rgsex.com") {
			return src.replace(/(\/galleries\/+[^/]*\/+[^/]*\/+(?:[^/]*\/+)?|\/archive\/+[^/]*\/+.\/+[^/]*\/+[0-9]+\/+)p-([^/]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "easyhotpics.com") {
			return src
				.replace(/(\/tgp\/+[^/]+\/+[0-9]+\/+)t([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1i$2")
				.replace(/(\/tgp\/+[^/]*\/+[^/]*\/+)t([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "cdn.pax6.com") return src.replace(/(\/galleries\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]{10,}\/+images\/+)t([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1i$2");
		if (domain === "promo.hollyrandall.com") return src.replace(/\/img\/+tn-([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/img/img-$1");
		if (domain_nowww === "bikinidream.net") return src.replace(/(\/gals\/+[^/]+\/+)th_([0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "cdnberry.com") return src.replace(/(\/posts\/+[^/]+\/+)th_([^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "nakedebonybabes.com") return src.replace(/(\/[0-9a-f]+\/+)th_([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "picua.org") return src.replace(/(:\/\/[^/]*\/+)thumbs\/+([0-9]{4}-[0-9]{2}\/+)/, "$1img/$2");
		if (domain_nowww === "mariuszlewandowski.pl" ||
			domain_nowww === "voiceshop.pl") {
			return src.replace(/\/environment\/+cache\/+images\/+[0-9]+_[0-9]+_productGfx_/, "/userdata/gfx/");
		}
		if (domain_nowww === "s5o.ru" ||
			domain === "s5o.sports.ru") {
			return src.replace(/(\/storage\/+simple\/.*\/[0-9a-z]+)\.[0-9]+\.[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "trunkarchive.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+A\.aspx\?(?:.*?&)?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return urljoin(src, decodeuri_ifneeded(newsrc), true);
		}
		if (domain === "img.mbjuan.com") return src.replace(/(\/content\/+media\/+thumbs\/+p[0-9]+)_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "ua.today") return src.replace(/\/resize_img\/+[0-9]+x[0-9]+\/+images\/+/, "/images/");
		if (domain_nowww === "nashaamerica.com") return src.replace(/(\/files\/+news\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+)[^/]*\/+([0-9a-f]{10,}\.[^/.]*)(?:[?#].*)?$/, "$1original/$2");
		if (domain_nowww === "bootysource.com") return src.replace(/(\/img2\/+[^/]*)_small(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "img.freshpopmusic.co") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+hsi\/+([^/.]{50,})\/+.*/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain_nosub === "lifo.gr") return src.replace(/\/icache\/+[0-9]+\/+[0-9]+\/+[0-9]\/+([0-9]+)_/, "/uploads/image/$1/");
		if (domain_nowww === "epicenter.bg") return src.replace(/(\/images\/+news\/+[0-9]+\/+)thumbs\/+[a-z]+_/, "$1pics/");
		if (domain_nosub === "yokacdn.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+a\.jpg\?(?:.*&)?imageurl=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (amazon_container === "stezor-img-res") {
			return src.replace(/\/[0-9]+x[0-9]+\/+([-0-9a-f]{20,})(?:[?#].*)?$/, "/$1");
		}
		if (domain === "cdn.letrasdemusicas.fm") return src.replace(/(\/production\/+images\/+[0-9]{4}\/+[0-9]{2}\/+)cover_([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "img.erogazou.gallery" ||
			domain_nosub === "erogazounosuke.com") {
			return src.replace(/(\/[a-z]+[0-9]*\/+[0-9]+\/+)s(\/+[0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1b$2");
		}
		if (domain === "screens.latestscreens.com") return src.replace(/(\/screenshots\/+[^/]+\/+)thumbs\/+/, "$1");
		if (domain_nowww === "perfect-girls-net.com") return src.replace(/\/thumbs\/+([^/]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "mobygames.com") return src.replace(/(\/images\/+(?:shots|covers)\/+)[st]\/+/, "$1l/");
		if (domain === "img.bhs4.com") return src.replace(/(\/[0-9a-f]{2}\/+[0-9a-f]\/+[0-9a-f]{20,})_[a-z]+(\.[^/.]*)(?:[?#].*)?$/, "$1_orig$2");
		if (domain === "pisces.bbystatic.com") return src.replace(/(\/images\/+products\/+[0-9]+\/+[0-9]+(?:_[^/.]*)\.[^/.;]+);.*/, "$1");
		if (domain_nowww === "celebs101.com") return src.replace(/(\/(?:gallery|screen-savers)\/+[^/]*\/+(?:[0-9]+\/+)?)tn_([^/]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "nnconnect.com") {
			newsrc = src.replace(/(:\/\/[^/]+\/[^/]+\/+[^/]+\/+)tn_([^/]+-[0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return {
					url: newsrc,
					extra: {
						page: src.replace(/(:\/\/[^/]+\/+[^/]+\/+[^/]+)\/.*$/, "$1.html")
					}
				};
		}
		if (domain_nowww === "hq-celebrity.com") {
			newsrc = src.replace(/(\/photos\/+[^/]*\/+)tn_([^/]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "hq-celebrity.com") {
			newsrc = src.replace(/\/wp-content\/+plugins\/+watermark-hotlinked-images\/+watermark\.php\?(?:.*&)?img=([^&]*).*?$/, "/$1");
			if (newsrc !== src)
				return newsrc;
			return {
				url: src,
				headers: {
					Referer: ""
				}
			};
		}
		if (domain === "d3bhdfps5qyllw.cloudfront.net") return src.replace(/(:\/\/[^/]*\/+)(?:sqr|thm)\/+/, "$1org/");
		if (domain_nowww === "imageocd.com") {
			return src
				.replace(/(\/images\/+[^/]+\/+[^/]+\/+)main\/+([^/]*?\.[^/.]*)\.thumb_[0-9]+_[a-z]+\.[^/.]*(?:[?#].*)?$/, "$1$2")
				.replace(/(\/u\/+[0-9]+\/+)m_[a-z]\/+([0-9]+\/+)[^/]*\/+([^/]*?\.[^/.]*)\.thumb_[0-9]+_[a-z]+\.[^/.]*(?:[?#].*)?$/, "$1i/$2$3");
		}
		if (domain_nowww === "kickasspays.com") return src.replace(/(\/galleries\/+[^/]*\/+[^/]*)_t(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "kickass.com") return src.replace(/(\/fhgs\/+pics\/+content\/+[0-9]+\/+[0-9]+\/+[0-9]+)_t(\.[^/.]+)(?:[?#].*)?$/, "$1_b$2");
		if (domain_nowww === "xnudehack.com") return src.replace(/\/imgwp\/+t_/, "/imgcache/");
		if (domain === "media.karups.com" ||
			domain === "media.boyfun.com") {
			newsrc = src.replace(/(\/lowres\/+)thumbs\/+([^/]*)\.thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\/lowres\/+([^/]*)_lowres(_[0-9]+\.[^/.]*)(?:[?#].*)?$/, "/highres/$1_highres$2");
		}
		if (domain_nowww === "freefeet4u.com") return src.replace(/(_[0-9]+)_t(\.[^/.]*)(?:[?#].*)?$/, "$1_b$2");
		if (domain === "content.atkingdom.com") return src.replace(/(\/models\/+[^/]*\/+[0-9]+\/+[0-9]+\/+[^/]*)_tn(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "atkingdom-network.com" && /^(?:cdn[0-9]*|content)\./.test(domain)) {
			return src.replace(/(\/secure\/+content\/+.\/+[^/]+\/+[0-9]+\/+)(?:thumbs\/+)?([^/?]+)(?:[?#].*)?$/, "$13000/$2");
		}
		if (domain === "bl.definefetish.com") return src.replace(/\/thumb\/+([^/]+\.[^/.]*)(?:[?#].*)?$/, "/$1");
		if (domain === "fileup.calobye.com") return src.replace(/\/m_[0-9]+\/+upload\/+/, "/upload/");
		if (domain_nowww === "chyoa.com") return src.replace(/\/data\/+covers\/+[sm]\/+/, "/data/covers/l/");
		if (domain_nowww === "m1sv.net") return src.replace(/(\/[0-9]+\/+)Resize\/+/, "$1");
		if (domain === "image.i-bbs.sijex.net") {
			return {
				url: src.replace(/(\/[0-9]{5,})[sm](\.[^/.]*)(?:[?#].*)?$/, "$1o$2"),
				headers: {
					Referer: ""
				}
			};
		}
		if (domain_nowww === "pic-b.com") return src.replace(/(\/photo\/+[0-9]+\/+[0-9]+\/+[-0-9]{20,})(\.[^/.]*)(?:[?#].*)?$/, "$1-pc$2");
		if (domain_nosub === "momogaki.com") return src.replace(/\/img2\/+([0-9]+\.[^/.]*)(?:[?#].*)?$/, "/img/$1");
		if (domain === "images.contentexchange.me") {
			newsrc = src.replace(/.*?(?:.*&)?url=(https?%[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "patreon.com") {
			var get_patreon_imagemeta = function(url) {
				var match = url.match(/\/patreon-media\/+p\/+post\/+([0-9]+)\/([0-9a-f]{20,})\/+([^/]+)\/+/);
				if (!match)
					return null;
				return {
					modifiers: match[3],
					postid: match[1],
					imagehash: match[2]
				};
			};
			var find_id_in_included = function(included, id) {
				for (var i = 0; i < included.length; i++) {
					if (included[i].id === id)
						return included[i];
				}
				return null;
			};
			var are_modifiers_original = function(modifiers) {
				try {
					var obj = JSON_parse(base64_decode(decodeURIComponent(modifiers)));
					var obj_string = JSON_stringify(obj);
					return obj_string === JSON_stringify({}) || obj_string === JSON_stringify({ "p": 1 });
				} catch (e) {
					console_log(modifiers);
					console_error(e);
					return false;
				}
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+posts\/+(?:[^/?#]+-)?([0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://www.patreon.com/posts/${id}",
				override_cb: function(cb, data) {
					if (!data)
						return cb(data);
					var imu_url = src.match(/#imu-url=(.*)$/);
					var imu_imgmeta = null;
					if (imu_url) {
						imu_url = imu_url[1];
						imu_imgmeta = get_patreon_imagemeta(imu_url);
					}
					if (!imu_imgmeta) {
						data.album_info.links[0].is_current = true;
					} else {
						array_foreach(data.album_info.links, function(link, i) {
							var link_imgmeta = get_patreon_imagemeta(link.url);
							if (!link_imgmeta) {
								console_warn("Invalid match for", link);
								return;
							}
							if (link_imgmeta.imagehash === imu_imgmeta.imagehash) {
								link.is_current = true;
								if (link_imgmeta.modifiers === imu_imgmeta.modifiers) {
									link.url = imu_url;
								}
								data.url = link.url;
								return false;
							}
						});
					}
					var dataurl_imgmeta = get_patreon_imagemeta(data.url);
					if (dataurl_imgmeta && are_modifiers_original(dataurl_imgmeta.modifiers)) {
						data.is_original = true;
					}
					cb(data);
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/window\.patreon\s*=\s*({.*?});\s/);
					if (!match) {
						match = resp.responseText.match(/<script id="__NEXT_DATA__" type="application\/json">({.*?})<\/script>/);
					}
					if (!match) {
						console_error(cache_key, "Unable to find bootstrap match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					if (json.props && json.props.pageProps) {
						json = json.props.pageProps.bootstrapEnvelope;
					}
					if (json.bootstrap)
						json = json.bootstrap;
					else if (json.pageBootstrap)
						json = json.pageBootstrap;
					else {
						console.warn(cache_key, "No boostrap in", json);
					}
					var post = json.post;
					var attributes = post.data.attributes;
					var metadata = attributes.post_metadata;
					var image_ids = [];
					if (metadata)
						image_ids = metadata.image_order;
					var included = post.included;
					var images = [];
					array_foreach(image_ids, function(image_id) {
						var image_data = find_id_in_included(included, image_id).attributes;
						var image_url;
						if (image_data.image_urls.original) {
							image_url = image_data.image_urls.original;
						} else if (image_data.download_url) {
							image_url = image_data.image_urls.download_url;
						} else if (image_data.image_urls.default) {
							image_url = image_data.image_urls.default;
						}
						if (!image_url) {
							console_warn(cache_key, "Unable to find image URL in", image_data);
							return;
						}
						images.push({
							url: image_url,
							is_current: false
						});
					});
					if (!images.length) {
						if (attributes.image) {
							var imageobj = attributes.image;
							var imageurl = imageobj.large_url || imageobj.url;
							var imagemeta = get_patreon_imagemeta(imageurl);
							if (attributes.post_file) {
								var post_url = attributes.post_file.url;
								var posturl_meta = get_patreon_imagemeta(post_url);
								if (posturl_meta.imagehash === imagemeta.imagehash)
									imageurl = post_url;
							}
							if (imageurl) {
								images.push({
									url: imageurl,
									is_current: false
								});
							}
						}
					}
					if (!images.length)
						return done(null, false);
					var obj = {
						url: images[0].url,
						extra: {
							page: attributes.url || resp.finalUrl,
							caption: attributes.title
						},
						album_info: {
							type: "links",
							links: images
						}
					};
					return done(obj, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "patreonusercontent.com") {
			match = src.match(/\/([^/]*)\/+patreon-media\/+p\/+post\/+([0-9]+)\/([0-9a-f]{20,})\/+/);
			if (match) {
				var posthash = match[3];
				var postid = match[2];
				return {
					url: "https://www.patreon.com/posts/" + postid + "#imu-url=" + src,
					is_pagelink: true
				};
			}
		}
		if (domain === "s3.dexerto.com") return src.replace(/\/thumbnails\/+_thumbnailSmall\/+/, "/thumbnails/_thumbnailLarge/");
		if (domain === "scp.indiegames.us") return src.replace(/(\/scn\/+[^/]*\/+[^/]+)_tn(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "content.ray-web.jp") {
			if (/\/photos\/+pictures\/+[0-9]+\/+original\/+[0-9a-f]{20,}\./.test(src))
				return {
					url: src,
					is_original: true
				};
		}
		if (domain_nowww === "ray-web.jp") {
			newsrc = website_query({
				website_regex: /^([a-z]+:\/\/[^/]+\/+[0-9]+\/+photos\/+[0-9]+)(?:[?#].*)?$/,
				query_for_id: "${id}",
				process: function(done, resp, cache_key) {
					var url = get_meta(resp.responseText, "og:image");
					if (!url) {
						console_error(cache_key, "Unable to find og:image from", resp);
						return done(null, false);
					}
					return done(url, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "ray-web.jp" && domain === "content.ray-web.jp" && options.element) {
			newsrc = common_functions["get_pagelink_el_matching"](options.element, /^[a-z]+:\/\/[^/]+\/+[0-9]+\/+photos\/+[0-9]+/);
			if (newsrc)
				return newsrc;
			if (options.element.tagName === "IMG" &&
				options.element.parentElement && options.element.parentElement.classList.contains("current_photo")) {
				var match = options.host_url.match(/\/([0-9]+)\/+photos\/+([0-9]+)/);
				if (match) {
					return {
						url: options.host_url,
						is_pagelink: true
					};
				}
			}
		}
		if (domain_nowww === "imgsrc.ru") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([^/]+\/+[0-9]+)\.html(?:[?#].*)?$/,
				query_for_id: {
					url: "https://imgsrc.ru/${id}.html",
					headers: {
						Referer: ""
					}
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<img class='big' src='(\/\/s[0-9]+\.[^'"]+)' alt='([^'"]+)'/);
					if (!match) {
						console_error(cache_key, "Unable to find image match for", resp);
						return done(null, false);
					}
					var imgsrc = urljoin(resp.finalUrl, decode_entities(match[1]), true);
					var caption = decode_entities(match[2]);
					match = resp.responseText.match(/<script(?:\s+type=["']text\/javascript["'])?>\s*?var\s+(\S+)\s*=\s*["'](.*?)["'][\s\S]*?["']\+(?:[a-z]\+)?((?:\1(?:\s*\.\s*charAt\s*\(\s*|\s*\[\s*)([0-9]+)\s*(?:\)|\])\s*\+\s*){1,})\s*['"][\s\S]*?<\/script>/);
					if (!match) {
						console_error(cache_key, "Unable to find cipher match for", resp);
						return done(null, false);
					}
					var splitted = match[3].split("+");
					var chars = "";
					for (var i = 0; i < splitted.length; i++) {
						var charid = splitted[i].replace(/.*(?:\[|\()\s*([0-9]+).*?$/, "$1");
						if (charid !== splitted[i])
							chars += string_charat(match[2], charid);
					}
					if (chars.length !== 3) {
						console_error(cache_key, "Invalid chars:", chars, resp);
						return done(null, false);
					}
					var newsrc = imgsrc.replace(/:\/\/s([0-9]+.*_[0-9]+)...(\.[^/.]*)(?:[?#].*)?$/, "://b$1" + chars + "$2");
					var obj = {
						extra: {
							page: resp.finalUrl,
							caption: caption
						}
					};
					var urls = [];
					if (newsrc)
						urls.push(newsrc);
					urls.push(imgsrc);
					console_log(urls);
					done(fillobj_urls(urls, obj), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "icdn.ru") {
			regex = /:\/\/s[0-9]+\.[^/]+\/+.\/+([^/]+)\/+[0-9]+\/+(?:imgsrc\.ru_)?([0-9]+)...(\.[^/.]*)(?:[?#].*)?$/;
			match = src.match(regex);
			if (match) {
				obj = {
					url: src,
					extra: {
						page: "https://imgsrc.ru/" + match[1] + "/" + match[2] + ".html"
					}
				};
				return [
					{
						url: obj.extra.page,
						is_pagelink: true
					},
					obj
				];
			}
		}
		if (domain === "rs.fairywigs.com") return src.replace(/(\/images\/.*\/[0-9]+\/+[0-9]+_[0-9]+)_s(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "epio.app" && /^cdn[0-9]*-images\./.test(domain)) {
			newsrc = src.replace(/.*?\/image\/+download\/+([^./]{40,})(?:\/+[0-9]+X[0-9]+)?(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain === "giga-images-makeshop-jp.akamaized.net") return src.replace(/(\/shopimages\/+[0-9]+\/+[0-9]+\/+)s([0-9]+_[0-9]+\.[^/.]*)(?:[?#].&)?$/, "$1$2");
		if (domain === "cdn-uploads.gameblog.fr") return src.replace(/(\/images\/+[^/]+\/+)tn\/+/, "$1");
		if (domain_nowww === "guru3d.com") return src.replace(/(\/index\.php\?(?:.*?&)?action=)thumb(&.*)?$/, "$1file$2");
		if (domain === "medialazy.vandalimg.com") return src.replace(/:\/\/[^/]+\/+/, "://media.vandal.net/");
		if (domain === "mediamaster.vandal.net" ||
			domain === "media.vandalsports.com" ||
			domain === "media.vandal.net") {
			return src.replace(/(:\/\/[^/]+\/+)(?:m|i\/+[0-9]+x[0-9]+)\/+/, "$1master/");
		}
		if (domain_nosub === "cgames.de" && /^[0-9]*images\./.test(domain)) {
			return src.replace(/(\/images\/+gamestar\/+)[0-9]+\/+/, "$14/");
		}
		if (domain === "assets.folhavitoria.com.br") return src.replace(/(\/images\/+[-0-9a-f]{30,})--(?:(?:[a-z][^-_/.]+_)*[a-z][^-_/.]+)(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "dnh0aphdpud22.cloudfront.net" ||
			domain === "d320y51nxi12gs.cloudfront.net") {
			return src.replace(/(\/sized\/+[0-9a-f]+-[A-Z]+[0-9]+\/+)med_thumbnail(\.[^/.]*)(?:[?#].*)?$/, "$1high_res$2");
		}
		if (domain_nowww === "iansphoto.in") return src.replace(/(\/photoimages_new\/+)[0-9]+\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+)/, "$1$2");
		if (domain_nowww === "mamby.com") return src.replace(/(\/images\/+[^/]*)_mediumres(\.[^/.]*)(?:[?#].*)?$/, "$1_maxres$2");
		if (domain_nowww === "pixelup.net") return src.replace(/(\/images\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]{20,}\/+)p(\.[^/.]*)(?:[?#].*)?$/, "$1r$2");
		if (domain_nowww === "tattoodaze.com") return src.replace(/(:\/\/[^/]+\/+)images\/+/, "$1tattoo-images/");
		if (domain_nowww === "ximg.pro") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+\?(?:.*&)?url=([^&/]{20,}).*?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain_nowww === "wallpapercave.com") {
			obj = {
				extra: {}
			};
			match = src.match(/\/wp([0-9]+)(?:\.[^/.]+)?(?:[?#].*)?$/);
			if (match)
				obj.extra.page = "https://wallpapercave.com/w/wp" + match[1];
			if (/:\/\/[^/]+\/+w\/+wp[0-9]+(?:[?#].*)?$/.test(src)) {
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				var urls = add_extensions(src.replace(/\/w\/+(wp[0-9]+)(?:[?#].*)?$/, "/wp/$1.jpg"));
				urls.push(page_nullobj);
				return fillobj_urls(urls, obj);
			}
			newsrc = src.replace(/\/(?:fwp|wpt)\/+(wp[0-9]+\.)/, "/wp/$1");
			obj.url = newsrc;
			return obj;
		}
		if (domain === "cdnimage.ebn.co.kr" ||
			domain === "file.ebn.co.kr") {
			newsrc = src.replace(/(\/news\/+[0-9]{6}\/+news_[0-9]+_[0-9]+)_thumbs(\.[^/.]*)(?:[?#].*)?$/, "$1_main1$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/news\/+[0-9]{6}\/+(?:news_[0-9]+|[0-9]{1,3})_([0-9]+)_/);
			if (match) {
				return {
					url: src,
					extra: {
						page: "https://www.ebn.co.kr/news/view/" + match[1]
					}
				};
			}
		}
		if (domain === "img.kbs.co.kr") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+kbs\/+[0-9]+\/+([^/]+\.[^/]+\/+)/, "$1");
			if (newsrc !== src)
				return add_http(newsrc);
		}
		if (domain_nowww === "kpop-today.com") return src.replace(/\/img-(?:small|large)\/+medias\/+/, "/medias/");
		if (domain_nowww === "popnable.com") {
			newsrc = src.replace(/(\/images\/+[a-z]+\/+)small\/+/, "$1large/");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/images\/+[a-z]+\/+)(?:small|large)\/+/, "$1original/");
		}
		if (domain === "media.distractify.com") {
			return {
				url: src.replace(/(\/brand-img\/+[^/]+\/+)[0-9]+x[0-9]+\/+/, "$10x0/"),
				can_head: false // 403
			};
		}
		if (domain_nosub === "unblocked-sites.pro" ||
			domain_nosub === "unblockweb.cc" ||
			domain_nosub === "unblock-sites.info" ||
			domain_nosub === "unblock.men" ||
			domain_nosub === "unblock.loan" ||
			domain_nosub === "unblock.science" ||
			domain_nosub === "unblock-sites.xyz" ||
			domain_nosub === "unblock-proxy.xyz" ||
			domain_nosub === "unblock.cricket" ||
			domain_nosub === "unblock.racing" ||
			domain_nosub === "unblocked.nl") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+\?(?:.*?&)?cdURL=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "cdn.btportail.0pb.org") {
			return {
				url: src.replace(/(\/[0-9a-f]{20,}\/+[0-9]+\/+)[0-9]+\/+[0-9]+\/+([^/]+\.[^/.]*)(?:[?#].*)?$/, "$10/0/$2"),
				head_wrong_contentlength: true
			};
		}
		if (domain_nowww === "cosmopolitan.hr" ||
			domain_nowww === "sensa.hr" ||
			domain_nowww === "lovesensa.rs" ||
			/^[a-z]+:\/\/[^/]+\/+repository\/+images\/+_variations\/+[0-9a-f]\/+[0-9a-f]+\/+[0-9a-f]{20,}(?:-[^/]*?)?_[^/]+(\.[^/.]*)(?:[?#].*)?$/.test(src)) {
			return src.replace(/(\/repository\/+images\/+)_variations\/+([0-9a-f]\/+[0-9a-f]\/+[0-9a-f]{20,}(?:-[^/]*?)?)_[^/]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3");
		}
		if (amazon_container === "blogadda") {
			return src.replace(/(\/images\/+posts\/+[^/]+-[0-9]+)-medium(\.[^/.]*)(?:[?#].*)?$/, "$1-large$2");
		}
		if (domain_nosub === "muzmob.org" ||
			domain_nosub === "muzmo.org") {
			return src.replace(/(\/news\/+i\/+[0-9]+)_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "static.zone-adulte.com") return src.replace(/(\/img\/+[0-9]+\/+)[0-9]+x[0-9]+\/+/, "$1");
		if (domain_nosub === "ujarani.com" && /^i[0-9]*\./.test(domain)) {
			return src.replace(/(:\/\/[^/]+\/+)4\//, "$13/");
		}
		if (domain === "media.loupak.fun") return src.replace(/\/obrazky_[tn]\//, "/obrazky/");
		if (domain_nowww === "megalyrics.ru") return src.replace(/(\/uploads\/+blog\/+cover\/+[0-9a-f]{2}\/+[0-9a-f]{10,}\/+)cs_crop_main_([0-9a-f]{20,}\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain === "uploads.bemparana.com.br") return src.replace(/(\/upload\/+image\/+noticia\/+)tb[0-9]*\/+/, "$1");
		if (domain_nowww === "beicon.ru") return src.replace(/(\/uploads\/+(?:[0-9a-f]{20,}|[0-9]{10,}))_(?:16_9_[0-9]+|[0-9]+_[0-9]+_[0-9]+_exact)(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "bigmenu.com.br") {
			newsrc = src.replace(/\/temp\/+img\/+(arquivos)_([0-9]+)_(conteudo)_(posts)_([0-9]+)_([a-z]+)_[0-9]+_[0-9]+_[0-9]+_[0-9]+__[a-z]+\.[^/.]*(?:[?#].*)?$/, "/$1/$2/$3/$4/$5.$6");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\/img\/+[0-9]+x[0-9]+\/+[0-90]+\/+[0-9]+\/+[a-z]+\/+arquivos\/+/, "/arquivos/");
		}
		if (domain_nowww === "pixaap.com") return src.replace(/\/images\/+items_thumb\/+M-/, "/images/items/");
		if (amazon_container === "theshonet-assets") {
			return src.replace(/\/filemanager\/+shared_[0-9]+\/+/, "/filemanager/shared/");
		}
		if (domain === "media.lelombrik.net") return src.replace(/\/t\/+([0-9a-f]{20,})\/+s\/+01(\.[^/.]*)(?:[?#].*)?$/, "/t/$1/f/$1$2");
		if (domain_nowww === "funnymasti.com") return src.replace(/\/files\/+resized\/+[^/]+\/+files\/+/, "/files/");
		if (domain === "proxy.zagon.pe") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+proxify\.php\?(?:.*?&)?q=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain_nowww === "wikizeroo.org") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+index\.php\?(?:.*&)?q=([^&]{20,}).*?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain === "cachedimages.podchaser.com") {
			match = src.match(/:\/\/[^/]+\/+[0-9]+x[0-9]+\/+([^/.]{30,})\/+/);
			if (match) {
				return base64_decode(decodeURIComponent(match[1]));
			}
		}
		if (domain === "ca.slack-edge.com") return src.replace(/^([a-z]+:\/\/[^/]+\/+[^/]+-[0-9a-f]{8,})-\d+(?:[?#].*)?$/, "$1-999999999999999");
		if (domain === "files.slack.com") return src.replace(/\/files-tmb\/+([A-Z0-9]+-[A-Z0-9]+)-[0-9a-f]+\/+([^/]+)_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/files-pri/$1/$2$3");
		if (domain_nowww === "chathour.com" ||
			domain_nowww === "chathourmobile.com") {
			return src.replace(/\/photos\/+thumb\//, "/photos/full/");
		}
		if (domain === "nimage.globaleconomic.co.kr") {
			newsrc = src.replace(/\/imagesphp\/+[0-9]+\/+([^/]+\.[^/.]*?)(?:[?#].*)?$/, "/phpwas/restmb_allidxmake.php?idx=999&simg=$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "photoresources.wtatennis.com") return src.replace(/\/photo-resources\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[-0-9a-f]{20,}\/+[^/]+\.[^/.?]*)(?:[?#].*)?$/, "/wta/photo/$1");
		if (domain_nowww === "brdteengal.com") return src.replace(/\/galleries\/+thumbs\/+((?:[0-9a-f]\/+){5}[0-9a-f]{10,}\/+)[0-9]+x[0-9]+\/+/, "/galleries/$1");
		if (domain_nowww === "destacamos.com") return src.replace(/(\/images\/+listings\/+[0-9]{4}-[0-9]{2}\/+)(?:bigThmb|thmb)\/+/, "$1");
		if (domain === "statici.behindthevoiceactors.com" ||
			domain_nowww === "behindthevoiceactors.com") {
			return {
				url: src.replace(/(\/_img\/+[^/]+\/+)thumbs\/+([^/]+)_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2$3"),
				headers: {
					Referer: "https://www.behindthevoiceactors.com/"
				}
			};
		}
		if (domain_nowww === "schokkendnieuws.nl") return src.replace(/\/images\/+multithumb_thumbs\/+b_[0-9]+_[0-9]+_[0-9]+_[0-9]+_images_stories_com_form2content_(p[0-9]+)_(f[0-9]+)_(?:thumbs_)?([^/]*)(?:[?#].*)?$/, "/images/stories/com_form2content/$1/$2/$3");
		if (domain_nowww === "biosagenda.nl") return src.replace(/(\/poster\/+[^/]+_[0-9]+)_[0-9]+_[0-9]+_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "primewire.li" ||
			domain === "primewire.unblocked.nu") {
			return src.replace(/\/poster\/+small\/+/, "/poster/medium/");
		}
		if (domain_nowww === "moviemistakes.com") return src.replace(/(\/images\/+titles\/+)[a-z]+\/+/, "$1full/");
		if (domain === "simg.chomikuj.pl") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+[0-9a-f]{20,}\?(?:.*&)?url=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nosub === "ccnxs.cn" && /^img[0-9]*\./.test(domain)) {
			return src.replace(/(\/uploadfile\/+.*\/[^/]*\.[^/.]+)_\/+fillcrop\/+[0-9]+x[0-9]+(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "puschkino.de") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+cms\/+thumbs\.php\?(?:.*&)?src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return urljoin(src, decodeuri_ifneeded(newsrc), true);
		}
		if (domain === "d3d8y6yhucfd29.cloudfront.net") return src.replace(/(\/1-t[0-9]+-)[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "prothinspo.com") return src.replace(/\/sitebuilder\/+(images\/+[^/]+)-[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain === "assets.yesstud.io") return src.replace(/\/cache\/+([a-z]+)-([0-9]+)(?:-[whqrbxy][a-z]?[0-9]*){1,}(\.[^/.]*)(?:[?#].*)?$/, "/image/$1_$2$3");
		if (domain === "light.sunphoto.ro") {
			newsrc = src.replace(/\/photos\/+thumb(?:_[a-z]+)?\/+/, "/photos/normal/");
			if (newsrc !== src)
				return newsrc;
			return {
				url: src,
				headers: {
					Referer: "https://sunphoto.ro/"
				},
				referer_ok: {
					same_domain_nosub: true
				}
			};
		}
		if (domain_nowww === "thesimsresource.com") {
			return {
				url: src.replace(/(\/scaled\/+[0-9]+\/+)[wh]-[0-9]+[hw]-[0-9]+-([0-9]+\.)/, "$1$2"),
				can_head: false // 403
			};
		}
		if (domain_nowww === "the-numbers.com") return src.replace(/(\/images\/+movies\/+.*)-Thumbnail(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "cinefish.bg") return src.replace(/(\/data\/+movies_images\/+[0-9]+\/+p_[0-9]+)_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "oneringtrailers.com") return src.replace(/(\/images\/+[a-z]+\/+)thumb_/, "$1");
		if (domain_nowww === "boxofficeturkiye.com") return src.replace(/(\/images\/+haberler\/+)[0-9]+x[0-9]+\/+([^/]+)_c_[0-9]+(\.[^/]*)(?:[?#].*)?$/, "$1buyuk/$2$3");
		if (amazon_container === "trello-avatars") {
			return src.replace(/(\/[0-9a-f]{20,}\/+)[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1original$2");
		}
		if (domain === "s.ebiografia.com") return src.replace(/(\/assets\/+img\/+authors\/+..\/+..\/+[^/]+)-[ml](\.[^/.]*)(?:[?#].*)?$/, "$1-o$2");
		if (domain === "rrdsoa.appspot.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+l\/+([^/.?&]{30,})(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain_nowww === "pinkfineart.com") return src.replace(/(\/galleries\/+.*\/)pthumbs\/+/, "$1full/");
		if (domain === "galleries.manojob.com") return src.replace(/(\/scenes\/+[^/]+\/+)tn\/+([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1full/$2");
		if (domain_nosub === "x69.biz") return src.replace(/(:\/\/[^/]+\/+)thumb(\/+fb\/+v\/+[0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1full$2");
		if (domain_nowww === "dudepins.com") return src.replace(/(\/images\/+socialpinboard\/+)thumbnails\/+/, "$1");
		if (domain_nosub === "s3c.es") return src.replace(/(\/imag\/+_v[0-9]+\/+[0-9]+x[0-9]+\/+(?:[0-9]\/+){3})[0-9]+x_/, "$1");
		if (domain_nowww === "playboyrussia.com") return src.replace(/(\/data\/+galleries\/+[0-9]+\/+[0-9]+)s(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "animaldiversity.org") {
			newsrc = src.replace(/(\/collections\/+contributors\/+(?:[^/]+\/+){2,4})(?:small|medium)(\.[^/.]*)(?:[?#].*)?$/, "$1large$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/collections\/+contributors\/+(?:[^/]+\/+){2,4}(?:small|medium|large)\.[^/.]*(?:[?#].*)?$/);
			if (match)
				return {
					url: src,
					extra: {
						page: src.replace(/\/[^/]+(?:[?#].*)?$/, "/")
					}
				};
		}
		if (domain === "api.creativecommons.engineering") return src.replace(/^[a-z]+:\/\/[^/]+\/+t\/+(https?:)/, "$1");
		if (domain === "capl.washjeff.edu") {
			newsrc = src.replace(/^([a-z]+:\/\/[^/]+\/+[0-9]+\/+)[sm](\/+[0-9]+\.[^/.]*)(?:[?#].*)?$/, "$1l$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+([0-9]+)\/+([sml])\/+([0-9]+)\.[^/.]*(?:[?#].*)?$/);
			if (match) {
				return {
					url: src,
					extra: {
						page: "http://capl.washjeff.edu/browseresults.php?langID=" + match[1] + "&photoID=" + match[3] + "&size=" + match[2]
					}
				};
			}
		}
		if (domain === "openaccess-cdn.clevelandart.org") {
			newsrc = src.replace(/(\/[0-9.a-z]+)_web(\.[^/.]*)(?:[?#].*)?$/, "$1_print$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+([0-9.a-z]+)\/+/);
			if (match) {
				return {
					url: src,
					extra: {
						page: "https://www.clevelandart.org/art/" + match[1]
					}
				};
			}
		}
		if (domain_nowww === "emovieposter.com") return src.replace(/(\/images\/+[^/]+\/+[A-Z0-9]+\/+)[0-9]+\/+([^/]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "dimu.org") return src.replace(/^([a-z]+:\/\/[^/]+\/+image\/+[^/]+?)(?:[?#].*)?$/, "$1?dimension=max");
		if (domain_nowww === "flora-on.pt") {
			newsrc = src.replace(/(:\/\/[^/]+\/+[^/]+?)(?:_(?:low|ori))?(_[a-zA-Z0-9]+)(\.jpg)(?:down)?(?:[?#].*)?$/, "$1_ori$2$3");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/:\/\/[^/]+\/+[^/]+?(?:_(?:low|ori))?_([a-zA-Z0-9]+)\.jpg(?:down)?(?:[?#].*)?$/);
			if (match) {
				return {
					url: src,
					extra: {
						page: "https://flora-on.pt/#/h" + match[1]
					}
				};
			}
		}
		if (domain_nosub === "geograph.org.uk" && /^s[0-9]*\./.test(domain)) {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+geophotos\/+(?:[0-9]{2}\/+){3}([0-9]+)_([0-9a-f]+)\./);
			if (match) {
				return {
					url: "https://www.geograph.org.uk/reuse.php?id=" + match[1] + "&download=" + match[2],
					extra: {
						page: "https://www.geograph.org.uk/photo/" + match[1]
					}
				};
			}
		}
		if (domain === "collections.museumvictoria.com.au") return src.replace(/(\/content\/+media\/+[^/]+\/+[0-9]+-)(?:thumbnail|medium)(\.[^/.]*)(?:[?#].*)?$/, "$1large$2");
		if (domain_nowww === "phylopic.org") {
			newsrc = src.replace(/(\/assets\/+images\/+submissions\/+[-0-9a-f]{20,})\.[0-9]+\.png(?:[?#].*)?$/, "$1.svg");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/assets\/+images\/+submissions\/+([-0-9a-f]{20,})\./);
			if (match) {
				return {
					url: src,
					extra: {
						page: "http://phylopic.org/image/" + match[1]
					}
				};
			}
		}
		if (domain_nowww === "svgsilh.com") {
			newsrc = src.replace(/\/png\/+([0-9]+)-([0-9a-f]+)\.png(?:[?#].*)?$/, "/svg/$1-$2.svg");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/:\/\/[^/]+\/+[a-z]+\/+([0-9]+)-([0-9a-f]+)\.[a-z]+(?:[?#].*)?$/);
			if (match) {
				return {
					url: src,
					extra: {
						page: "https://svgsilh.com/" + match[2] + "/image/" + match[1] + ".html"
					}
				};
			}
		}
		if (domain_nowww === "walldevil.co") return src.replace(/(\/wallpapers\/+w[0-9]+\/+)thumb\/+/, "$1");
		if (domain === "cdni.rt.com") return src.replace(/(\/files\/+[0-9]{4}\.[0-9]{2}\/+)[a-z]+\/+/, "$1original/");
		if (domain === "api.97bike.com" ||
			domain === "pic.qmglive.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+pic\.php\?(?:.*?&)?url=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "hxyy56.com" ||
			domain_nosub === "meijuxia.com" ||
			domain === "zy.itono.cn") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+tu\.php\?(?:.*&)?(?:url|pic)=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return add_http(decodeuri_ifneeded(newsrc));
		}
		if (domain_nowww === "process-safety-lab.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+imges\.php\?(?:.*&)?src=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "bvla.com") return src.replace(/(\/media\/+inventory\/+product\/+)alt(\/+[0-9]+_[0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1full$2");
		if (domain === "vangogh.teespring.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+static\.jpg\?(?:.*&)?image_url=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+opengraph\.jpg\?(?:.*&)?composition=([^&]+).*?$/, "$1");
			if (newsrc !== src) {
				try {
					var json = JSON_parse(decodeURIComponent(newsrc));
					return json.artwork.url;
				} catch (e) {
					console_error(e);
					return src;
				}
			}
			return src
				.replace(/(\/v3\/+image\/+[^/]{10,}\/+)[0-9]+\/+[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1999999/999999$2")
				.replace(/(\/shirt_pic\/+(?:[0-9]+\/+){4})[0-9]+x[0-9]+\/+([^/]+\.[^/.]+)(?:[?#].*)?$/, "$1999999x999999/$2");
		}
		if (domain_nosub === "lvme.me" && /^[a-z]\./.test(domain)) {
			newsrc = src.replace(/(:\/\/[^/]+\/+[a-z0-9]+)_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+([a-z0-9]+)\.[^/.]+(?:[?#].*)?$/);
			if (match)
				return {
					url: src,
					extra: {
						page: "https://www.livememe.com/" + match[1] + "/"
					}
				};
		}
		if (domain_nowww === "jmusicitalia.com" ||
			domain === "static.jmusicitalia.com") {
			return src.replace(/(\/artisti\/+[^/]+\/+album\/+[^/]+?)(?:-big)?(\.[^/.]+)(?:[?#].*)?$/, "$1-big$2");
		}
		if (domain_nowww === "cooltrack.co.kr") return src.replace(/(\/shopimages\/+cooltrack\/+[0-9]{12})[0-9](\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "rakuten.com" && /^images\./.test(domain)) {
			return src.replace(/(\/photo\/+[0-9]+)_[SML](\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "suruga-ya.jp" ||
			domain === "cdn.suruga-ya.jp") {
			return src.replace(/\/(?:database\/+)?pics(?:_(?:light|webp))?\/+(?:boxart_[a-z]+|game)\/+([a-z]*[0-9]+(?:_[0-9]+)?)[a-z]*\.[a-z]+(?:\.[a-z]+)?(?:[?#].*)?$/, "/database/pics/game/$1.jpg");
		}
		if (domain_nowww === "itsfun.com.tw") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+images\/+(?:[0-9a-f]{2}\/+){2}([^/.]{30,})\.[^/.]+(?:[?#].*)?$/, "$1");
			if (newsrc !== src) {
				return base64_decode(reverse_str(newsrc));
			}
		}
		if (domain_nowww === "hot-sex-photos.com") return src.replace(/\.thumb(\.[^/.]+)(?:[?#].*)?$/, "$1");
		if (domain === "s.io.ua") {
			return {
				url: src.replace(/:\/\/s(\.[^/]+\/+img_aa\/+)small(\/+[0-9]+\/+[0-9]+\/+[0-9]+)_0(\.[^/.]+)(?:[?#].*)?$/, "://g$1large$2$3"),
				headers: {
					Referer: ""
				},
				referer_ok: {
					same_domain_nosub: true
				}
			};
		}
		if (domain_nosub === "io.ua") {
			obj = {
				url: src,
				headers: {
					Referer: ""
				},
				referer_ok: {
					same_domain_nosub: true
				}
			};
			match = src.match(/\/img_aa\/+[a-z]+\/+[0-9]+\/+[0-9]+\/+([0-9]+)(?:_[0-9]+)?\./);
			if (match) {
				obj.extra = { page: "https://io.ua/" + match[1] };
			}
			return obj;
		}
		if (domain_nowww === "sexylabia.net") {
			return {
				url: src.replace(/\/uploads\/+thumbnails\/+FileUpload\/+/, "/uploads/FileUpload/"),
				headers: {
					Referer: ""
				},
				referer_ok: {
					same_domain_nosub: true
				}
			};
		}
		if (domain_nowww === "labsporno.com") return src.replace(/(\/images\/+[0-9]\/+[0-9]+)-t(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "astro.cz") return src.replace(/(\/apod_data\/+[0-9]{4}\/+[0-9]{2}\/+[^/]+)_detail(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "img.poliigon.com") return src.replace(/\/assets\/+small\/+([^/]+\.[^/.]+)(?:[?#].*)?$/, "/assets/large/$1");
		if (domain_nosub === "cgtrader.com" && /^img/.test(domain)) {
			return src.replace(/(\/items\/+[0-9]+\/+[0-9a-f]+\/+)thumb\/+/, "$1");
		}
		if (domain_nowww === "sketchuptextureclub.com") {
			if (/\/imgs\/+q\.png(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			newsrc = src.replace(/\/public\/+texture_m\/+([0-9]+-)/, "/public/texture/$1");
			if (newsrc !== src) {
				return {
					url: newsrc,
					problems: {
						watermark: true
					}
				};
			}
		}
		if (domain_nowww === "gamingonlinux.com" ||
			domain === "uploads.golmedia.net") {
			newsrc = src.replace(/(\/uploads\/+articles\/+article_media\/+)thumbs\/+/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (host_domain_nowww === "gamingonlinux.com" && options.element) {
			if (options.element.tagName === "IMG" && options.element.parentElement && options.element.parentElement.tagName === "DIV") {
				var videoid = options.element.parentElement.getAttribute("data-video-id");
				if (videoid) {
					return "https://i.ytimg.com/vi/" + videoid + "/mqdefault.jpg";
				}
			}
		}
		if (domain === "img.karaoketexty.sk") return src.replace(/(\/img\/+[^/]+\/+[0-9]+\/+(?:[0-9]+\/+)?)thumb\/+thumb-/, "$1");
		if (domain === "img.buymeacoffee.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+api\/+\?(?:.*?&)?url=([^&]{20,}).*?$/, "$1");
			if (newsrc !== src)
				return base64_decode(newsrc);
		}
		if (domain === "cdn.buymeacoffee.com") {
			return src.replace(/@[^/]+(?:[?#].*)?$/, "");
		}
		if (domain_nowww === "gfycat.com") {
			var get_gfycat_temp_token_v1_1 = function(site, cb) {
				var cache_key = site + ":access_token_v1";
				api_query(cache_key, {
					url: "https://weblogin." + site + ".com/oauth/webtoken",
					method: "POST",
					headers: {
						Origin: "https://www." + site + ".com",
						Referer: "",
						"Content-Type": "text/plain;charset=UTF-8",
						"Accept": "*/*"
					},
					data: base64_decode('IHsiYWNjZXNzX2tleSI6IkFucjk2dXVxdDlFZGFtU0N3SzR0eEtQak1zZjJNOTVSZmE1RkxMaFBGdWN1OEg1SFR6ZXV0eUFhIn0=').substr(1),
					json: true
				}, cb, function(done, json, cache_key) {
					if (json.access_token) {
						return done(json.access_token, 60 * 60);
					} else {
						console_error("Unable to get temporary token for", site);
						return done(null, false);
					}
				});
			};
			var query_gfycat_v1_1 = function(site, id, cb) {
				var cache_key = site + ":v1:" + id;
				get_gfycat_temp_token_v1_1(site, function(token) {
					if (!token)
						return cb(null);
					var id_lower = id.toLowerCase();
					var pagelink = "https://www." + site + ".com/watch/" + id_lower;
					api_query(cache_key, {
						url: "https://api." + site + ".com/v1/gfycats/" + id_lower,
						method: "GET",
						headers: {
							Origin: "https://" + site + ".com",
							Referer: "",
							Cookie: "",
							"authorization": "Bearer " + token,
							"Accept": "*/*",
							"Sec-Fetch-Site": "same-site"
						},
						json: true
					}, cb, function(done, json, cache_key) {
						if (!json || !json.gfyItem) {
							return done(null, false);
						}
						json.gfyItem._referer = "https://www." + site + ".com";
						json.gfyItem._pagelink = pagelink;
						return done(json.gfyItem, 25 * 60); // URLs expire in 30 minutes
					});
				});
			};
			var query_gfycat_api_1 = function(id, cb) {
				return query_gfycat_v1_1("gfycat", id, cb);
			};
			var query_gfycat_1 = function(id, cb) {
				query_gfycat_api_1(id, function(data) {
					if (!data)
						return cb(null);
					var page = "https://www.gfycat.com/" + data.gfyName;
					return cb(fillobj_urls([
						{
							url: data.mp4Url,
							headers: {
								Referer: page
							},
							video: true
						},
						{
							url: data.gifUrl,
							headers: {
								Referer: page
							}
						},
						{
							url: data.posterUrl
						}
					], {
						extra: {
							page: "https://www.gfycat.com/" + data.gfyName,
							caption: data.title || data.description
						}
					}));
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:(?:[a-z]{2}|ifr)\/+)?(?:watch\/+)?([a-zA-Z]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					query_gfycat_1(match[1], cb);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "redgifs.com") {
			var get_redgifs_token_localstorage_1 = function(cb) {
				if (!get_localstorage)
					return cb(null);
				get_localstorage("https://www.redgifs.com/", ["session_data"], function(data) {
					if (data && data["session_data"]) {
						var sessdata = data["session_data"];
						var parsed_4 = JSON_parse(sessdata);
						if (parsed_4 && parsed_4.token) {
							return cb(parsed_4.token);
						}
					}
					return cb(null);
				});
			};
			var get_gfycat_temp_token_v2_1 = function(site, cb) {
				var cache_key = site + ":access_token_v2";
				get_redgifs_token_localstorage_1(function(token) {
					if (token)
						return cb(token);
					api_query(cache_key, {
						url: "https://api." + site + ".com/v2/auth/temporary",
						method: "GET",
						headers: {
							Origin: "https://www." + site + ".com",
							Referer: "https://www." + site + ".com",
							"Content-Type": "application/json",
							"Accept": "application/json"
						},
						json: true
					}, cb, function(done, json, cache_key) {
						if (json.token) {
							return done(json.token, 60 * 60);
						} else {
							console_error("Unable to get temporary token for", site);
							return done(null, false);
						}
					});
				});
			};
			var query_gfycat_v2 = function(site, id, cb) {
				var cache_key = site + ":v2:" + id;
				get_gfycat_temp_token_v2_1(site, function(token) {
					if (!token)
						return cb(null);
					var id_lower = id.toLowerCase(); // API is now case-sensitive
					var pagelink = "https://www." + site + ".com/watch/" + id_lower;
					api_query(cache_key, {
						url: "https://api." + site + ".com/v2/gifs/" + id_lower,
						method: "GET",
						headers: {
							Origin: "https://www." + site + ".com",
							Referer: "https://www." + site + ".com",
							"Authorization": "Bearer " + token,
							"Content-Type": "application/json",
							"Accept": "application/json",
							"x-customheader": pagelink
						},
						json: true
					}, cb, function(done, json, cache_key) {
						if (!json || !json.gif) {
							console_error(cache_key, "Unable to find json from", json);
							return done(null, false);
						}
						json.gif._referer = "https://www." + site + ".com";
						json.gif._pagelink = pagelink;
						return done(json.gif, 25 * 60); // URLs expire in 30 minutes
					});
				});
			};
			var query_redgifs_api_1 = function(id, cb) {
				return query_gfycat_v2("redgifs", id, cb);
			};
			var query_redgifs_1 = function(id, cb) {
				query_redgifs_api_1(id, function(data) {
					if (!data)
						return cb(null);
					var tags = [];
					for (var _i = 0, _a = data.tags; _i < _a.length; _i++) {
						var tag = _a[_i];
						tags.push("#" + tag.replace(/\s+/g, "-"));
					}
					var is_video = data.duration !== null;
					return cb(fillobj_urls([
						{
							url: data.urls.hd,
							headers: {
								Referer: data._referer
							},
							can_head: false, // 403?
							private: true,
							video: is_video
						},
						{
							url: data.urls.sd, // sometimes hd doesn't work
							headers: {
								Referer: data._referer
							},
							can_head: false, // 403?
							private: true,
							video: is_video
						},
						{
							url: data.urls.thumbnail,
							private: true
						}
					], {
						extra: {
							page: data._pagelink,
							caption: tags.join(" ")
						}
					}));
				});
			};
			var query_gdn = function(id, cb) {
				var cache_key = "gifdeliverynetwork:" + id;
				api_cache.fetch(cache_key, cb, function(done) {
					options.do_request({
						url: "https://www.gifdeliverynetwork.com/" + id,
						method: "GET",
						headers: {
							Referer: ""
						},
						onload: function(resp) {
							if (resp.status !== 200) {
								console_error(cache_key, resp);
								return done(null, false);
							}
							console.log(resp);
							try {
								var match = resp.responseText.match(/<script type="application\/ld\+json">([[]{.*?}])<\/script>/);
								if (match) {
									var json = JSON_parse(match[1]);
									for (var i = 0; i < json.length; i++) {
										if (json[i].thumbnailUrl)
											return done(json[i].thumbnailUrl[0], 24 * 60 * 60);
									}
								} else {
									console_error("Unable to find match for", resp);
								}
							} catch (e) {
								console_error(e);
							}
							return done(null, false);
						}
					});
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:(?:[a-z]{2}|ifr)\/+)?(?:watch\/+)?([a-zA-Z]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					query_redgifs_1(match[1], cb);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "redgifs.com" && options.element && !src) {
			if (options.element.tagName === "VIDEO") {
				var parent_3 = common_functions["get_parent_el_matching"](options.element, function(x) { return (x.classList.contains("Video") || x.classList.contains("GifPreview")); });
				if (parent_3) {
					var poster = parent_3.querySelector("img.Video-Poster");
					if (!poster)
						poster = parent_3.querySelector("img.Player-Poster");
					if (poster) {
						return poster.src;
					}
				}
			}
		}
		if (domain_nowww === "gifdeliverynetwork.com") {
			return {
				url: src.replace(/:\/\/[^/]+\/+/, "://redgifs.com/"),
				is_pagelink: true
			};
		}
		if ((domain_nosub === "gfycat.com" || domain_nosub === "redgifs.com") && (/^(?:th(?:umbs|cf)[0-9]*|zippy|giant)\./.test(domain))) {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+([^-./]+)[-.]/);
			if (match) {
				var watch = "/";
				if (domain_nosub === "redgifs.com")
					watch = "/watch/";
				return {
					url: "https://" + domain_nosub + watch + match[1],
					is_pagelink: true
				};
			}
			newsrc = src
				.replace(/:\/\/zippy\.([^/]+\/+[^/]+)(?:-[^/.]+)?\.[^/.]+(?:[?#].*)?$/, "://giant.$1.mp4")
				.replace(/:\/\/th(?:umbs|cf)[0-9]*(\.gfycat\.[^/]+\/+[^-/]+)(?:[?#].*)?$/, "://zippy$1")
				.replace(/:\/\/(th(?:umbs|cf)[0-9]*\.[^/]+\/+[^/]+?)(?:-(?:(?:size_restricted|small)\.gif|mobile\.(?:webm|mp4)|(?:mobile|poster)\.jpg)|\.webp)(?:[?#].*)?$/, "://$1.mp4");
			obj = {
				url: newsrc
			};
			if (newsrc !== src) {
				obj.video = true;
			}
			match = src.match(/^[a-z]+:\/\/[^/]+\/+([^-./]+)[-.]/);
			if (match) {
				var watch = "/";
				if (domain_nosub === "redgifs.com")
					watch = "/watch/";
				obj.extra = { page: "https://" + domain_nosub + watch + match[1] };
			}
			return obj;
		}
		if (amazon_container === "blurbprod1000") {
			return src.replace(/(\/[0-9a-f]{20,}\/+[-0-9a-f]{20,}\/+)[A-Z](\.[^/.]*)(?:[?#].*)?$/, "$1O$2");
		}
		if (domain === "bookshow.blurb.com") return src.replace(/(\/bookshow\/+cache\/+[^/]+\/+)lw\/+/, "$1md/");
		if (domain === "contents.sixshop.com") return src.replace(/\/thumbnails\/+(uploadedFiles\/+[0-9]+\/+[^/]+\/+[^/]+)_[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/$1$2");
		if (domain_nosub === "gumroad.com" && /^static(?:-[0-9]+)\./.test(domain) ||
			domain === "public-files.gumroad.com") {
			newsrc = src.replace(/(:\/\/[^/]+\/+|\/gumroad-public-storage\/+)variants\/+([0-9a-z]{10,})\/+[0-9a-f]{30,}(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/res\/+gumroad\/+[0-9]+\/+asset_previews\/+[0-9a-f]{10,}\/+)[a-z]+\/+/, "$1original/");
		}
		if (domain === "cdn.sharesome.com" ||
			domain === "cache.sharesome.com") {
			regex = /(\/uploads\/+user-images\/+u[0-9]+\/+[^-/.]+-[^-/.]+)(?:-[smlp]|-(?:lg|xl))?(\.[^/.]+)(?:[?#].*)?$/;
			if (regex.test(src)) {
				return [
					src.replace(regex, "$1-o$2"),
					src.replace(regex, "$1-lg$2")
				];
			}
		}
		if (domain === "media.sharesome.com") {
			newsrc = src.replace(/\/thumb-((?:[0-9]+-[0-9]+-[0-9]+|[^-/.]+)\.(?:mp4|webm))\.[^/.]+(?:[?#].*)?$/, "/$1");
			if (newsrc !== src)
				return {
					url: newsrc,
					video: true
				};
		}
		if (domain_nowww === "nsfwalbum.com" && /\/pic\/+loading\.gif(?:[?#].*)?$/.test(src)) {
			return {
				url: src,
				bad: true
			};
		}
		if (domain_nowww === "luciecline.com") return src.replace(/(\/cdn-content\/+[0-9]+\/+[^/]+\/+[0-9]+\/+)thumbs\/+img/, "$1img");
		if (domain_nosub === "wankerson.com" && /^(?:thumbs|pics)\./.test(domain)) {
			newsrc = src.replace(/:\/\/thumbs\./, "://pics.");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(free-porn\/+.+-[0-9a-f]{10,}-[0-9]+\.)/);
			if (match) {
				return {
					url: src,
					extra: {
						page: "http://www.wankerson.com/porn/" + match[1] + "html"
					}
				};
			}
		}
		if (domain === "thumbs.oldgf.com" ||
			domain === "thumbs.jerkoffer.com") {
			return src.replace(/:\/\/[^/]+\/+/, "://pics." + domain_nosub + "/");
		}
		if (domain_nowww === "meituyuan.com") return src.replace(/(\/data\/+share\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]{10,})_[smb](\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "dto9r5vaiz7bu.cloudfront.net") return src.replace(/^([a-z]+:\/\/[^/]+\/+[0-9a-z]{10,}\/+)[_a-z]+(\.[^/.]+)(?:[?#].*)?$/, "$1source$2");
		if (domain_nowww === "robertsspaceindustries.com") {
			if (/^[a-z]+:\/\/[^/]+\/+rsi\/+static\/+images\/+/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			return src.replace(/(\/media\/+[0-9a-z]{10,}\/+)[_a-z]+\/+/, "$1source/");
		}
		if (domain === "d111vui60acwyt.cloudfront.net") {
			newsrc = src.replace(/(\/stores\/+avatars\/+[0-9]+\/+)[a-z]+\/+/, "$1original/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "fireworktv.com" && /^cdn[0-9]*\./.test(domain)) {
			return src.replace(/(\/medias\/+[0-9]{4}\/+(?:[0-9]{1,2}\/+){2}[^/]+\/+)[0-9]+_[0-9]+\/+/, "$1original/");
		}
		if (domain_nosub === "highwebmedia.com" && /^(?:ssl-)?ccstatic\./.test(domain) ||
			domain === "static-assets.highwebmedia.com") {
			if (/\/tsdefaultassets\/+locked_rectangle[0-9]*\./.test(src) ||
				/\/tsdefaultassets\/+[^/.]+\.gif/.test(src) ||
				/\/images\/+bg-body\.gif/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "roomimg.stream.highwebmedia.com") {
			match = src.match(/\/riw\/+([^/.?#]+)\.jpg/);
			if (match) {
				return {
					url: "https://cbjpeg.stream.highwebmedia.com/stream?room=" + match[1],
					can_head: false // 404
				};
			}
		}
		if (domain_nowww === "chaturbate.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([^/]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://chaturbate.com/${id}/",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/initialRoomDossier\s*=\s*("[^"]+");/);
					if (match) {
						var parsed_5 = JSON_parse(JSON_parse(match[1]));
						return done({
							url: parsed_5.hls_source,
							media_info: {
								type: "video",
								delivery: "hls",
								is_live: true
							}
						}, 60);
					}
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "extension.zone") return src.replace(/(\/wp-content\/+uploads\/+.*)-[0-9]+x[0-9]+@[0-9]+x(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "infcdn.net" && /^art/.test(domain)) {
			return src.replace(/(\/articles_uploads\/+[0-9]\/+[0-9]+\/+)thumb\/+([^/.]+)-[0-9]*x[0-9]*(\.[^/.]+)(?:[?#].*)?$/, "$1$2$3");
		}
		if (domain === "d2bq4ntp986cty.cloudfront.net") return src.replace(/(\/[0-9]{4}\/+[0-9]+\/+[^/]+\/+[^/]+\.(?:im|fb))\.(?:lg|ms)(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "freehostedpics.com") return src.replace(/\/thumbs\/+tnpics([0-9]+\.)/, "/pics$1");
		if (domain_nowww === "erotopper.nl") {
			newsrc = src.replace(/(\/images\/+[0-9]{4}\/+[0-9]+\/+)th-/, "$1");
			match = src.match(/:\/\/[^/]+\/+([^/]+)\/+images\/+[0-9]{4}\/+([0-9]+)\/+[^/]+\.[^/.]+(?:[?#].*)?$/);
			if (match) {
				return {
					url: newsrc,
					extra: {
						page: "http://erotopper.nl/" + match[1] + "/gallery.php?id=" + match[2]
					}
				};
			} else {
				return newsrc;
			}
		}
		if (domain_nosub === "litmind.com") {
			return src
				.replace(/(\/data\/+photos\/+(?:[0-9]\/+){3}[0-9]+)\.(?:thumbnail|profile(_non_retina)?|big|list_premium)\./, "$1.huge.")
				.replace(/(\/data\/+logos\/+(?:[0-9]\/+){3}[0-9]+)\.profile_non_retina\./, "$1.profile.");
		}
		if (domain_nowww === "kabe-uchiroom.com") {
			return src
				.replace(/\/upfile_image\/+([0-9]+)([0-9])(\/+[^/?]+\.[^/.?]+)$/, "/accounts/upfile/$2/$1$2/$3")
				.replace(/(\/upfile_image\/.*?)(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "mangadex.cc") {
			newsrc = src.replace(/(\/images\/+manga\/+[0-9]+)\.thumb(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return add_extensions_jpeg(newsrc);
			match = src.match(/\/images\/+manga\/+([0-9]+)\./);
			if (match) {
				return {
					url: src,
					extra: {
						page: "https://mangadex.cc/title/" + match[1] + "/"
					}
				};
			}
		}
		if (domain_nowww === "ipetgroup.com") return src.replace(/(\/photo\/+[0-9]+_[0-9]+)_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1_99999999$2");
		if (domain === "cdn.aarp.net") return src.replace(/\.imgcache\.rev[0-9a-f]{20,}\.web(?:\.[0-9]+\.[0-9]+)?(\.[^/.]+)(?:[?#].*)?$/, "$1");
		if (domain === "img.particlenews.com") {
			if (/\/image\.php\?/.test(src))
				return remove_queries(src, ["type"]);
		}
		if (domain_nowww === "joy.pl") return src.replace(/\/u\/+ic\/+T[0-9]+\/+u\/+/, "/u/");
		if (domain_nowww === "dynasty-scans.com") {
			if (/\/assets\/+(?:prev|next|clear)-[0-9a-f]{20,}\.(?:png|gif)/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "reader.kireicake.com" ||
			domain === "kobato.hologfx.com" ||
			domain_nowww === "sensescans.com" ||
			(domain_nosub === "world-three.org" && string_indexof(domain, "slide.") >= 0) ||
			domain_nowww === "jaiminisbox.com") {
			return src.replace(/(\/content\/+.*_[0-9a-f]{10,}\/)thumb_([^/]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "piczel.tv") {
			newsrc = src.replace(/(\/static\/+uploads\/+gallery_image\/+[0-9]+\/+image\/+[0-9]+\/+)thumb_/, "$1");
			obj = {
				url: newsrc
			};
			match = src.match(/\/gallery_image\/+[0-9]+\/image\/+([0-9]+)\/+[^/]+(?:[?#].*)?$/);
			if (match) {
				obj.extra = { page: "https://piczel.tv/gallery/image/" + match[1] };
			}
			return obj;
		}
		if (domain === "cdn.9hentai.com") {
			newsrc = src
				.replace(/(\/images\/+[0-9]+\/+)cover-small\./, "$1cover.")
				.replace(/(\/images\/+[0-9]+\/+)preview\/+([0-9]+)t(\.[^/.]+)(?:[?#].*)?$/, "$1$2$3");
			obj = {
				url: newsrc
			};
			match = src.match(/\/images\/+([0-9]+)\/+(?:cover|(?:preview\/+)?([0-9]+)t?\.)/);
			if (match) {
				obj.extra = { page: "https://9hentai.com/g/" + match[1] + "/" + (match[2] ? match[2] + "/" : "") };
			}
			return obj;
		}
		if (domain_nowww === "hentaishark.com") {
			newsrc = src.replace(/(\/uploads\/+manga\/+[0-9]+\/+chapters\/+[0-9]+\/+)thumb_/, "$1");
			obj = {
				url: newsrc
			};
			match = src.match(/\/uploads\/+(manga)\/+([0-9]+)\/+chapters\/+([0-9]+)\/+(?:thumb_)?([0-9]+)\./);
			if (match) {
				var type_2 = match[1];
				var typeid = match[2];
				var chapter = match[3];
				var page_2 = parseInt(match[4]);
				obj.extra = { page: "https://www.hentaishark.com/" + type_2 + "/" + typeid + "/" + chapter + "/" + page_2 };
			}
			return obj;
		}
		if (domain === "i.hentaihand.com") return src.replace(/(\/images\/+)([0-9]+)t(\.[^/.]+)(?:[?#].*)?$/, "$1full/$2$3");
		if (domain_nosub === "sh-cdn.com") return src.replace(/(\/images\/+(?:[0-9a-f]\/+){4}[0-9]+\/+)(?:giant_)?thumb_([0-9a-f]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "static.showit.co") return src.replace(/(:\/\/[^/]+\/+)[0-9]+(\/+[^/]+\/+[0-9]+\/+)/, "$199999999$2");
		if (domain === "d33veqcui7lu1w.cloudfront.net" ||
			domain_nowww === "wasabi-files.lbstatic.nu") {
			regex = /(\/files\/+[^/]+\/+)[a-z_]+\/+/;
			if (regex.test(src)) {
				return [
					src.replace(regex, "$1original/"),
					src.replace(regex, "$1large/")
				];
			}
		}
		if (domain_nosub === "ymcart.com" && string_indexof(domain, "imgcdn.") >= 0) {
			return src.replace(/\/([0-9]+)\/+thumb\/+[0-9]+x[0-9]+\/+/, "/$1/");
		}
		if (domain === "cdn.neow.in") return src.replace(/(\/images\/+uploaded\/+[0-9]{4}\/+[0-9]{2}\/+[^/]+)_(?:story|small)(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "gamereactor.no") return src.replace(/(\/media\/+[0-9]+\/+[^/]*_[0-9]+)(?:t|_[0-9]+x[0-9]+)(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "fullyimportant.ru") return src.replace(/\/thumbs\/+([0-9]+)_([0-9]+)(\.[^/.]+)(?:[?#].*)?$/, "/cdn/$2/$1$3");
		if (domain === "az879543.vo.msecnd.net") {
			newsrc = src.replace(/(:\/\/[^/]+\/+[a-z]+\/+[^/]+)_s(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(:\/\/[^/]+\/+[a-z]+\/+)(?:%ED%81%AC%EA%B8%B0%EB%B3%80%ED%99%98_|크기변환_)?([^/]+)_(?:\(1\))?(\.[^/.]+)(?:[?#].*)?$/, "$1$2$3");
			if (newsrc !== src)
				return add_extensions_upper(newsrc);
		}
		if (domain === "static-buyma-com.akamaized.net") return src.replace(/(\/imgdata\/+item\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+)[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1org$2");
		if (domain === "images.spoilertv.com") return src.replace(/(\/cache\/+.*\/[^/]+)_[0-9]+_cw[0-9]+_ch[0-9]+_thumb\./, "$1_FULL.");
		if (domain_nosub === "itc.cn" && string_indexof(domain, ".biz.") >= 0) {
			return src.replace(/(\/pic\/+[^/]+\/+)[sn](\/+(?:[0-9]{2}\/+){2}Img[0-9]+)_[sn](\.[^/.]+)(?:[?#].*)?$/, "$1f$2_f$3");
		}
		if (domain === "photo.isportskorea.com") {
			newsrc = src.replace(/(\/photo\/+)thumbnail(\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1images$2");
			obj = {
				url: newsrc
			};
			match = src.match(/\/photo\/+[^/]+\/+[0-9]{4}\/+[0-9]{2}\/+([0-9]+)\./);
			if (match) {
				obj.extra = { page: "http://www.isportskorea.com/mstory/?mode=view&no=" + match[1] };
			}
			return obj;
		}
		if (domain === "edc2.healthtap.com") {
			return src
				.replace(/(\/user_answer\/+[^/]+\/+[0-9]+\/+)topic_large(\/+[^/]+)\.jpeg(?:[?#].*)?$/, "$1original$2.jpg")
				.replace(/(\/user_answer\/+[^/]+\/+[0-9]+\/+)(?:(?:topic|xx?)_)?(?:medium|normal|large)(\/+[^/]+\.[^/.]+)(?:[?#].*)?$/, "$1topic_large$2");
		}
		if (domain_nowww === "bomz.org") return src.replace(/(\/i\/+[^/]+\/+)thumb_([^/]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "gtainside.com") {
			if (/\/includes\/+lightbox2\/+img\//.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src.replace(/(\/downloads\/+picr\/+[0-9]{4}-[0-9]{2}\/+)thb_/, "$1");
		}
		if (domain_nowww === "gta.cz") {
			if (/\/download\/+image\.php\?/.test(src)) {
				return remove_queries(src, ["thumb"]);
			}
		}
		if (domain_nowww === "feralinteractive.com") {
			if (/\/images\/+games\/+bottom-frame\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src.replace(/(\/screenshots\/+)thumbs\/+thumb([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1screen$2");
		}
		if (domain === "store.feralinteractive.com") {
			newsrc = src.replace(/(\/screenshots\/+[^/]+\/+)thumbs\/+(screen[0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/images\/+icons\/+)(?:100|140|165|180)\/+/, "$1360/");
		}
		if (domain_nosub === "nsimg.net") return src.replace(/(\/biopic\/+)(?:160x120|320x240|200x150|240x180)\/+/, "$1original4x3/");
		if (domain === "photo.naiadmmm.com") return src.replace(/(\/fast_photo\.php\?)(.*&)?type=thumbnail/, "$1$2type=photo");
		if (domain === "prodimage.images-bn.com") {
			newsrc = src.replace(/_s[0-9]{3}x[0-9]{3}\./, "_s1200x630.");
			if (newsrc !== src)
				return newsrc;
			return {
				url: src,
				headers: {
					Referer: ""
				},
				can_head: false // doesn't return errors
			};
		}
		if (domain_nowww === "twitpic.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([0-9a-z]+)(?:[?#].*)?$/,
				query_for_id: "https://twitpic.com/${id}",
				process: function(done, resp, cache_key) {
					var url = get_meta(resp.responseText, "twitter:image");
					if (!url) {
						console_error(cache_key, "Unable to find url for", resp);
					}
					var obj = {
						url: url,
						extra: {
							page: resp.finalUrl
						}
					};
					var title = get_meta(resp.responseText, "twitter:title");
					if (title) {
						obj.extra.caption = title;
					}
					return done(obj, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "dn3pm25xmtlyu.cloudfront.net") {
			match = src.match(/\/photos\/+[a-z]+\/+([0-9]+)\./);
			if (match) {
				var get_twitpic_page_from_id = function(id) {
					return "https://twitpic.com/" + parseInt(id).toString(36);
				};
				id = match[1];
				obj = {
					url: src,
					extra: { page: get_twitpic_page_from_id(id) },
				};
				return [{
						url: obj.extra.page,
						is_pagelink: true
					}, obj];
			}
		}
		if (domain === "media-ima002.globaltalentsystems.com") return src.replace(/^[a-z]+:\/\/([^/]+)\/+/, "https://s3.amazonaws.com/$1/");
		if (amazon_container === "media-ima002.globaltalentsystems.com") {
			return [
				src.replace(/.*\/media-ima002\.[^/]+\/+([0-9]+)\/+[0-9]+\/+([0-9]+_[^/]+\.[^/.]+)(?:[?#].*)?$/, "https://www.globaltalentsystems.com/main/$1/$2"),
				src.replace(/\/media-ima002\.([^/]+)\/+([0-9]+)\/+[0-9]+\/+([0-9]+_[^/]+\.[^/.]+)(?:[?#].*)?$/, "/media-joined000.$1/2/$2/$3")
			];
		}
		if (domain_nosub === "rbk.ru" && /^s[0-9]*\./.test(domain)) {
			return src.replace(/\/resized\/+[0-9W]+x[0-9H]+(?:_crop)?\/+media\/+/, "/media/");
		}
		if (domain_nowww === "kazanfirst.ru") return src.replace(/(\/storage\/+post\/+[^/]+\/+[^/]+)-watermark(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "vgtour.ro") {
			newsrc = src.replace(/(\/media\/+poze\/+[^/]+\/+[^/]+\/+)thumbs\/+/, "$1");
			if (newsrc !== src)
				return newsrc;
			if (/\/watermark\.php\?/.test(src)) {
				var queries = get_queries(src);
				return src.replace(/\/watermark\.php.*/, "/media/poze/" + queries.source + "/" + queries.id + "/" + queries.nume);
			}
		}
		if (domain_nowww === "maiolifruttiantichi.it") return src.replace(/(\/e-commerce\/+prodotti\/+img\/+)watermark\/+/, "$1");
		if (domain === "photo.jpnn.com") return src.replace(/\/arsip\/+watermark\/+/, "/arsip/normal/");
		if (domain_nowww === "posterswholesale.com") {
			return src.replace(/\/resize\/+(Shared\/+.*?)(?:[?#].*)?$/i, "/$1");
		}
		if (domain === "images.summitmedia-digital.com") return src.replace(/\/resize\/+[^/]+\/+(images\/+)/, "/$1");
		if ((domain_nosub === "hiclipart.com" ||
			domain_nosub === "pngwave.com" ||
			domain_nosub === "pngguru.com" ||
			domain_nosub === "pngfuel.com")
			&& /^[a-z][0-9]*\./.test(domain)) {
			return src.replace(/((?:\/preview\/+(?:[0-9]+\/+){3}|\/png\/+(?:[0-9]+\/+){2,3})[^/]+)-thumbnail(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "aerisdies.com") {
			newsrc = src.replace(/\/thumbnails(\/+categories\/+[0-9]+\/+[0-9]+\.)gif(?:[?#].*)?$/, "/images$1png");
			if (newsrc !== src)
				return add_extensions_gif(newsrc);
		}
		if (domain_nowww === "erofus.com") return src.replace(/\/thumb(\/+[0-9]+\/+[0-9a-f]+\.)/, "/medium$1");
		if (domain_nosub === "hentaicdn.com") {
			return src
				.replace(/\/thumbnails\/+(hcdn[0-9]+)tmb(\.[^/.]+)(?:[?#].*)?$/, "/$1$2")
				.replace(/\/cover\/+[0-9]+\/+_S/, "/cover/_S");
		}
		if (domain_nowww === "hentaidude.com") {
			if (/\/wp-content\/+themes\/+awp\/+images\//.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain_nowww === "theonemilano.com") {
			if (/\/wp-content\/+themes\/+[^/]+\/+images\/+/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain_nowww === "jabarchives.com") {
			obj = {
				url: src
			};
			match = src.match(/\/main\/+media\/+.*\/([A-Z0-9]{10,})1(?:_[a-z]+)\./);
			if (match)
				obj.extra = { page: "https://jabarchives.com/main/post/" + match[1] };
			newsrc = src.replace(/(\/main\/+media\/+.*)_(?:thumb|preview)\./, "$1_large.");
			if (newsrc !== src)
				obj.url = newsrc;
			return obj;
		}
		if (domain === "images.myhentaigrid.com") return src.replace(/(\/imagesgallery\/+images\/+[^/]+\/+)thumbnail\/+/, "$1original/");
		if (domain_nowww === "tsumino.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+Read\/+Index\/+([0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://www.tsumino.com/Read/Index/${id}",
				override_cb: function(cb, data) {
					var page = 1;
					var queries = get_queries(src);
					if (queries.page)
						page = queries.page;
					common_functions["update_album_info_links"](data, function(x) {
						var match = x.match(/\/[0-9]+\/+([0-9]+)\?/);
						if (!match) {
							console_warn("Unable to find page match");
							return false;
						}
						return match[1] == page;
					});
					cb(data);
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<div[^>]+data-cdn=["'](https:\/\/content\.tsumino[^'"]+\/\[PAGE\][^'"]+)["']/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var baseurl = decode_entities(match[1]);
					match = resp.responseText.match(/<h1[^>]*>\s*Page\s*<span.*?\/span>\s*of\s+([0-9]+)\s*<\/h1>/);
					if (!match) {
						console_error(cache_key, "Unable to find total pages from", resp);
						return done(null, false);
					}
					var pagecount = match[1];
					var album_info = {
						type: "links",
						links: []
					};
					for (var i = 0; i < pagecount; i++) {
						album_info.links.push({
							url: baseurl.replace("[PAGE]", i + 1),
							is_current: false
						});
					}
					done({
						url: album_info.links[0].url,
						album_info: album_info,
						headers: {
							Referer: resp.finalUrl
						},
						extra: {
							page: resp.finalUrl
						}
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "content.tsumino.com") {
			match = src.match(/\/(?:thumbs|parts)\/+([0-9]+)\/+([0-9]+)(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://www.tsumino.com/Read/Index/" + match[1] + "?page=" + match[2],
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "2dgalleries.com") return src.replace(/\/planches\/+[0-9]+[WH]\/+/, "/planches/");
		if (domain === "img.tamindir.com") return src.replace(/\/resize\/+[0-9]+x[0-9]+\/+([0-9]{4}\/+)/, "/$1");
		if (domain === "data.yiff.party") {
			newsrc = src.replace(/(\/avatars\/+[^/]+\/+)thumb\/+/, "$1full/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/patreon_inline\/+thumb\/+/, "/patreon_inline/");
			if (newsrc !== src)
				return add_extensions_gif(newsrc);
			if (/\/patreon_data\/+[0-9]+\/+[0-9]+\/+thumb\./.test(src) && options && options.element) {
				var current = options.element;
				if (current.classList.contains("lazyloaded")) {
					var link = current.parentElement.parentElement.querySelector(".card-action > a");
					if (link && string_indexof(link.href, "/patreon_data/") >= 0) {
						return link.href;
					}
				}
			}
		}
		if (domain_nosub === "dlivecdn.com" && /^images-sihv[0-9]*\./.test(domain)) {
			return src.replace(/:\/\/images-[^/.]+\.prd\.dlivecdn\.com\/+fit-in\/+[0-9]+x[0-9]+\/+filters:[^/]+\/+([-a-z]+\/+[^/]+)(?:[?#].*)?$/, "://images.prd.dlivecdn.com/$1");
		}
		if (domain_nowww === "bitchute.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:embed|video)\/+([a-zA-Z0-9]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://www.bitchute.com/video/${id}/",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<video id="player".*?>\s*<source src="(https?:\/\/seed[0-9]+\.bitchute\.com\/+[^/]+\/+[a-zA-Z0-9]+\.mp4)"/);
					if (!match) {
						console_error(cache_key, "Unable to find video player match for", resp);
						return done(null, false);
					}
					var videourl = match[1];
					var baseobj = {
						extra: {
							page: resp.finalUrl
						}
					};
					var og_description = get_meta(resp.responseText, "og:description");
					if (og_description) {
						baseobj.extra.caption = og_description;
					}
					baseobj.url = videourl;
					baseobj.video = true;
					return done(baseobj, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "bitchute.com" && /^static/.test(domain)) {
			newsrc = src.replace(/(\/live\/+channel_images\/+.*)_(?:small|medium)(\.[^/.]+)(?:[?#].*)?$/, "$1_large$2");
			if (newsrc !== src)
				return newsrc;
			regex = /(\/live\/+cover_images\/+.*_)([0-9]+x[0-9]+)(\.[^/.]+)(?:[?#].*)?$/;
			match = src.match(regex);
			if (match) {
				var baseobj_8 = { url: src };
				var idmatch = src.match(/\/live\/+cover_images\/+[^/]+\/+([^/_]{5,15})_/);
				if (idmatch) {
					baseobj_8.extra = { page: "https://www.bitchute.com/video/" + idmatch[1] + "/" };
				}
				var sizes = [
					"1280x720",
					"640x360",
					"320x180"
				];
				var sizetoint = function(size) {
					var match = size.match(/^([0-9]+)x([0-9]+)$/);
					return parseInt(match[1]) * parseInt(match[2]);
				};
				var urlsize = sizetoint(match[2]);
				var newurls = [];
				array_foreach(sizes, function(size) {
					if (urlsize < sizetoint(size)) {
						var obj = deepcopy(baseobj_8);
						obj.url = src.replace(regex, "$1" + size + "$3");
						newurls.push(obj);
					}
				});
				if (idmatch && baseobj_8.extra && baseobj_8.extra.page) {
					newurls.unshift({
						url: baseobj_8.extra.page,
						is_pagelink: true
					});
				}
				if (newurls.length > 0) {
					return newurls;
				}
				var videourl = src.replace(/^[a-z]+:\/\/static-([0-9])\.bitchute\.com\/+live\/+cover_images\/+([^/]+\/+[^/_]{5,15})_[0-9]+x[0-9]+\..*/, "https://seed$100.bitchute.com/$2.mp4");
				if (videourl !== src) {
					baseobj_8.url = videourl;
					return baseobj_8;
				}
			}
		}
		if (domain_nosub === "bitchute.com" && /^seed[0-9]*\./.test(domain)) {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+[^/]+\/+([^/.]+)\./);
			if (match) {
				return {
					url: src,
					extra: { page: "https://www.bitchute.com/video/" + match[1] + "/" }
				};
			}
		}
		if (domain_nowww === "bitchute.com") {
			if (/\/static\/+v[0-9]+\/+images\/+/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain_nowww === "platinum-celebs.com") return src.replace(/(\/news_pic\/+[0-9]+\/+)tn_/, "$1big_");
		if (domain === "video.like.video") {
			newsrc = src.replace(/(\/[-_0-9A-Za-z]+)_[0-9](\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "videosnap.like.video") {
			newsrc = remove_queries(src, ["resize", "dw", "wmk_sdk"]);
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/[0-9A-Za-z]+)_[12](\.[^/.]+)(?:[?#].*)?$/, "$1_4$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "likee.video" || domain_nosub === "likee.com") {
			var get_json_from_likee = function(resp, cache_key) {
				var match = resp.responseText.match(/<script>\s*window\.data\s*=\s*({.*?})\s*;\s*<\/script/);
				if (!match) {
					console_error(cache_key, "Unable to find match for", resp);
					return null;
				}
				try {
					var json = JSON_parse(match[1]);
					return json;
				} catch (e) {
					console_error(cache_key, e);
					return null;
				}
			};
			var query_likee = function(yyuid, post_id, cb) {
				api_query("likee_api:" + yyuid + "/" + post_id, {
					url: "https://likee.video/@" + yyuid + "/video/" + post_id
				}, cb, function(done, resp, cache_key) {
					var json = get_json_from_likee(resp, cache_key);
					if (!json) {
						done(null, false);
					} else {
						done(json, 60 * 60);
					}
				});
			};
			var likee_json_to_obj = function(resp, json) {
				var obj = {
					extra: {
						page: resp ? resp.finalUrl : null
					}
				};
				if (json.share_url) {
					if (!obj.extra.page)
						obj.extra.page = json.share_url;
				}
				if (json.post_yyuid && json.post_id) {
					obj.extra.page = "https://likee.com/@" + json.post_yyuid + "/video/" + json.post_id;
					var cache_key = "likee_api:" + json.post_yyuid + "/" + json.post_id;
					if (!api_cache.has(cache_key))
						api_cache.set(cache_key, json, 60 * 60);
				}
				if (json.msg_text)
					obj.extra.caption = json.msg_text;
				var urls = [];
				if (json.video_url) {
					urls.push({
						url: json.video_url.replace(/(\/[-_0-9A-Za-z]+)_[0-9](\.[^/.]+)(?:[?#].*)?$/, "$1$2"),
						video: true
					});
				}
				if (json.image2) {
					urls.push(json.image2.replace(/(\/[0-9A-Za-z]+)_[12](\.[^/.?#]+)(?:[?#].*)?$/, "$1_4$2"));
				}
				return fillobj_urls(urls, obj);
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([sv]\/+[0-9a-zA-Z]+)(?:[?#].*)?$/,
				cache_key: "likee_share_api",
				query_for_id: "https://likee.video/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<script>\s*window\.data\s*=\s*({.*?})\s*;\s*<\/script/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					var obj = likee_json_to_obj(resp, json);
					if (!obj) {
						return done(null, false);
					} else {
						return done(obj, 6 * 60 * 60);
					}
				}
			});
			if (newsrc)
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+@([^/]+)\/+video\/+([0-9]+)(?:[?#].*)?$/);
			if (match) {
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				if (options.do_request && options.cb) {
					query_likee(match[1], match[2], function(json) {
						if (!json) {
							return options.cb(page_nullobj);
						}
						var obj = likee_json_to_obj(null, json);
						if (!obj) {
							return options.cb(page_nullobj);
						} else {
							obj.push(page_nullobj);
							return options.cb(obj);
						}
					});
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if (host_domain_nowww === "likee.com" && options && options.element && options.do_request && options.cb && !options.exclude_videos) {
			if (options.element.tagName === "A" && /:\/\/[^/]+\/+s\/+[0-9A-Za-z]+$/.test(options.element.href)) {
				var cache_key = "likee:" + options.element.href.replace(/.*\/([^/]+)$/, "$1");
				api_cache.fetch(cache_key, options.cb, function(done) {
					options.do_request({
						url: options.element.href,
						method: "GET",
						onload: function(resp) {
							if (resp.readyState < 4)
								return;
							if (resp.status !== 200) {
								return done(null, false);
							}
							var match = resp.responseText.match(/<script>\s*window\.data\s*=\s*({.*?})\s*;\s*<\/script/);
							if (!match) {
								console_error("Unable to find match", resp);
								return done(null, false);
							}
							try {
								var json = JSON_parse(match[1]);
								return done(json.video_url, 12 * 60 * 60);
							} catch (e) {
								console_error(e);
								return done(null, false);
							}
						}
					});
				});
				return {
					waiting: true
				};
			}
		}
		if (domain_nowww === "roleplay.me") return src.replace(/(\/photos\/+(?:[0-9]+\/+){2})[ms]_([0-9]+\.)/, "$1$2");
		if (domain === "cdn.21buttons.com") {
			return src
				.replace(/(\/users\/+[0-9a-f]{20,})\.(?:small|medium|large)\./, "$1.")
				.replace(/\/posts\/+[0-9]+x[0-9]+\/+/, "/posts/");
		}
		if (domain === "cwh-cdn.21buttons.com") return src.replace(/(\/[0-9a-f]{20,}\.)(?:small|medium)\./, "$1smedium.");
		if (domain_nosub === "porngo.com" && /^img[0-9]*\./.test(domain)) {
			return src.replace(/\/(?:small|medium)(?:@2x)?\/+([0-9]+\.[^/.]+)(?:[?#].*)?$/, "/medium@2x/$1");
		}
		if (domain === "assets-jpcust.jwpsrv.com") {
			newsrc = src.replace(/(\/thumb(?:nail)?s\/+[^-./]+)-[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			match = src.match(/\/thumb(?:nail)?s\/+([a-zA-Z0-9]+)(?:-[0-9]+)?\./);
			if (match) {
				page = "https://content.jwplatform.com/players/" + match[1] + ".html";
				return [
					{
						url: page,
						is_pagelink: true
					},
					{
						url: newsrc,
						extra: {
							page: page
						}
					}
				];
			} else {
				return newsrc;
			}
		}
		if (domain === "videos-cloudflare.jwpsrv.com") {
			match = src.match(/\/content\/+conversions\/+[a-zA-Z0-9]+\/+videos\/+([a-zA-Z0-9]+)-[0-9]+\.mp4/);
			if (match) {
				return {
					url: "https://content.jwplatform.com/players/" + match[1] + ".html",
					is_pagelink: true
				};
			}
		}
		if (domain === "content.jwplatform.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:players|previews)\/+([a-zA-Z0-9]+)(?:-[a-zA-Z0-9]+)?(?:\.html)?(?:[?#].*)?$/,
				query_for_id: "https://content.jwplatform.com/players/${id}.html",
				process: function(done, resp, cache_key, match) {
					var id = match[1];
					var title = get_meta(resp.responseText, "og:title");
					var thumb = get_meta(resp.responseText, "og:image");
					var obj = {
						extra: {
							caption: title,
							page: resp.finalUrl
						}
					};
					var urls = [];
					urls.push({
						url: "https://content.jwplatform.com/manifests/" + id + ".m3u8",
						headers: {
							Referer: src
						},
						video: "hls"
					});
					var video = get_meta(resp.responseText, "og:video");
					if (video) {
						urls.push({
							url: video,
							video: true,
							can_head: false // otherwise 400
						});
					}
					if (thumb) {
						var newthumb = thumb.replace(/(\/thumb(?:nail)?s\/+[^-./]+)-[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
						if (newthumb !== thumb)
							urls.push(newthumb);
						urls.push(thumb);
					}
					return done(fillobj_urls(urls, obj), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "k2s.cc") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+file\/+([0-9a-f]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					api_query("keep2share:" + id, {
						url: "https://api.k2s.cc/v1/files/" + id,
						imu_mode: "xhr",
						headers: {
							Referer: "https://k2s.cc/file/" + id,
							Accept: "application/json, text/plain, */*"
						},
						json: true
					}, cb, function(done, json) {
						var obj = {
							extra: {
								page: "https://k2s.cc/file/" + id + "/" + json.name,
								caption: json.name
							}
						};
						var urls = [];
						if (json.videoPreview) {
							if (json.videoPreview.video) {
								urls.push({
									url: json.videoPreview.video,
									headers: {
										Referer: obj.extra.page
									},
									video: true
								});
							}
							if (json.videoPreview.cover) {
								urls.push(json.videoPreview.cover);
							}
						}
						if (json.thumbnails && json.thumbnails.length > 0) {
							urls.push(json.thumbnails[0]);
						}
						return done(fillobj_urls(urls, obj), 60 * 60);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "keep2share.cc" && /^prx-[0-9]+\./.test(domain)) {
			match = src.match(/\/video\/+[0-9a-f]+\/+[0-9a-f]+\/+alternative_resolution_[0-9a-f]+_.*\?(?:.*&)?uf=([0-9a-f]+)(?:&.*)?$/);
			if (match) {
				return {
					url: "https://k2s.cc/file/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "notion.so" ||
			domain_nosub === "notion.site") {
			if (/^[a-z]+:\/\/[^/]+\/+image\/+https?.*\?/) {
				newsrc = remove_queries(src, ["width", "height"]);
				if (newsrc !== src)
					return newsrc;
			}
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+image\/+(https?%3.*?)(?:[?#].*)?$/, "$1");
			if (newsrc !== src && !/secure\.notion-static\.com/.test(newsrc))
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "cdn.futura-sciences.com") return src.replace(/\/buildsv6\/+images\/+(?:(?:small|medium|midi)original|wide(?:640|1920|1440)|smallsquare|smallrectangle)\/+/, "/buildsv6/images/largeoriginal/");
		if (domain === "6d4be195623157e28848-7697ece4918e0a73861de0eb37d08968.ssl.cf1.rackcdn.com") return src.replace(/(:\/\/[^/]+\/+[0-9]+)_[0-9]+[wh](\.[^/.]+)(?:[?#].*)?$/, "$1_original$2");
		if (domain_nosub === "editmysite.com" && /^cdn[0-9]*\./.test(domain)) {
			if (/:\/\/[^/]+\/+images\/+blank\.gif(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain === "d1rw89lz12ur5s.cloudfront.net") return src.replace(/(\/photo\/+[^/]+\/+file\/+[0-9a-f]{20,}\/+)(?:thumb|medium|large)\/+/, "$1");
		if (domain_nowww === "howtogeek.com") return src.replace(/\/thumbcache\/+[0-9]+\/+[0-9]+\/+[0-9a-f]{20,}\/+/, "/");
		if (domain === "cdnu.porndoe.com") {
			newsrc = src.replace(/\/image\/+movie\/+crop\/+[0-9]+x[0-9]+\/+((?:[0-9]\/+){1,}[^/]+)\.(?:jpg|webp)(?:[?#].*)?$/, "/image/movie/$1.jpg");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "porndoe.com") {
			var query_porndoe_1 = function(id, vid, cb) {
				var cache_key = "porndoe:" + id;
				api_query(cache_key, {
					url: "https://porndoe.com/service/index?device=desktop&page=channel&id=" + id,
					imu_mode: "xhr",
					json: true,
					headers: {
						Referer: "https://porndoe.com/watch/" + vid
					}
				}, cb, function(done, resp, cache_key) {
					if (!resp) {
						return done(null, false);
					}
					if (!resp.payload.player) {
						console_error(cache_key, "Unable to find player key in", resp);
						return done(null, false);
					}
					return done(resp.payload.player, 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+watch\/+([0-9a-z]+)(?:[?#].*)?$/,
				query_for_id: "https://porndoe.com/watch/${id}",
				process: function(done, resp, cache_key, match) {
					var idmatch = resp.responseText.match(/"id":\s*"([0-9]+)"\s/);
					if (!idmatch) {
						console_error(cache_key, "Unable to find video ID in", resp);
						return done(null, false);
					}
					var urlid = match[1];
					query_porndoe_1(idmatch[1], urlid, function(result) {
						if (!result)
							return done(null, false);
						var urls = [];
						var urlmap = {};
						for (var type_3 in result.sources) {
							for (var _i = 0, _a = result.sources[type_3]; _i < _a.length; _i++) {
								var src_1 = _a[_i];
								var link_3 = src_1.link;
								if (/\/signup/.test(link_3))
									continue;
								urlmap[src_1.path] = src_1.link;
							}
						}
						var mp4s = result.sources.mp4.sort(function(a, b) { return b.bitrate - a.bitrate; });
						for (var _b = 0, mp4s_1 = mp4s; _b < mp4s_1.length; _b++) {
							var mp4 = mp4s_1[_b];
							if (mp4.path in urlmap) {
								urls.push({
									url: urlmap[mp4.path],
									video: true,
									is_private: true,
									headers: {
										Referer: "https://porndoe.com/"
									}
								});
							}
						}
						urls.push("https://porndoe.com/" + result.poster);
						return done(fillobj_urls(urls, {
							extra: {
								page: "https://porndoe.com/watch/" + urlid
							}
						}), 60 * 60);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "images.newsnowgr.com" ||
			domain === "images.newsnowgreece.com") {
			newsrc = src.replace(/:\/\/[^/]+\/+([0-9]{3}\/+[0-9]+\/+)[^/]+-([0-9]+)-[0-9]+x[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "://images.newsnowgreece.com/$1$2$3");
			obj = {
				url: newsrc
			};
			match = src.match(/:\/\/[^/]+\/+[0-9]{3}\/+([0-9]+)\/+(?:[^/]+-)?([0-9]+)(?:-[0-9]+x[0-9]+)?\.[^/.]+(?:[?#].*)?$/);
			if (match) {
				obj.extra = { page: "http://www.newsnowgr.com/photo/" + match[1] + "/" + match[2] + "/" };
			}
			return obj;
		}
		if (domain_nowww === "wallpapers.net") {
			newsrc = src.replace(/(\/web\/+wallpapers\/+[^/]+\/+thumbnail\/+)(?:xs|sm|md)\./, "$1lg.");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(:\/\/[^/]+\/+)([^/]+\/+)download\/+/, "$1web/wallpapers/$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/web\/+wallpapers\/+([^/]+)\/+(?:[0-9]+x[0-9]+|thumbnail)/);
			if (match && options && options.do_request && options.cb) {
				var page = "https://wallpapers.net/" + match[1];
				cache_key = "wallpapers.net:" + page;
				api_cache.fetch(cache_key, options.cb, function(done) {
					options.do_request({
						url: page,
						method: "GET",
						headers: {
							"Accept-Language": "en;q=0.9"
						},
						onload: function(resp) {
							if (resp.readyState < 4)
								return;
							if (resp.status !== 200) {
								return done(null, false);
							}
							var match = resp.responseText.match(/<p class="small">Resolution:\s*<a href="\/[^"]+"\s*>([0-9]+x[0-9]+)<\/a>/);
							if (!match) {
								console_error("Unable to find match", resp);
								return done(null, false);
							}
							return done({
								url: src.replace(/(\/web\/+wallpapers\/+[^/]+\/+).*?(\.[^/.]+)(?:[?#].*)?$/, "$1" + match[1] + "$2"),
								extra: {
									page: resp.finalUrl
								}
							}, 12 * 60 * 60);
						}
					});
				});
				return {
					waiting: true
				};
			}
		}
		if (domain_nowww === "youngjump.jp") return src.replace(/(\/images\/+)tn([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1photo$2");
		if (domain === "forums.auscelebs.net") return src.replace(/(\/[0-9]+\/+)thumbs\/+([^/]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "dyncdn2.com" ||
			domain_nowww === "dyncdn.me") {
			return src
				.replace(/(\/mimages\/+[0-9]+\/+)poster\./, "$1poster_opt.")
				.replace(/(\/mimages\/+[0-9]+\/+)over_opt\./, "$1poster_opt.");
		}
		if (domain_nosub === "1z2x1z.com") {
			if (/\/wp-content\/+plugins\/+use-your-drive\/+css\/+images\//.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain_nosub === "vercity.ru") return src.replace(/(\/gallery\/+img\/+.*\/)[0-9]+x[0-9]*\/+([^/]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "auto.sk") return src.replace(/(\/static\/+gallery\/+[0-9]{4}\/+[0-9]{2}\/+[0-9a-f]{5,}\/+[0-9a-f]{5,}\/+[0-9]+)-thumb(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "imgs.firmenwagen.co.at") return src.replace(/(:\/\/[^/]+\/+m\/+[0-9]+_[0-9]+)_[0-9]+-[0-9]+-[0-9]+_(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "s.car.info") return src.replace(/(\/image_files\/+)[0-9]+\/+/, "$1orig/");
		if (domain_nowww === "cryengine.com") return src.replace(/(\/files\/+[a-z]+\/+)[0-9]+\/+([0-9a-f]{10,}\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "cdn-l-cyberpunk.cdprojektred.com") return src.replace(/\/gallery\/+1080p\/+/, "/gallery/2160p/");
		if (domain_nowww === "romsmode.com" ||
			domain_nowww === "romsmania.cc") {
			return src.replace(/(\/statics\/+assets\/+covers\/+.*_[0-9]+)_mini(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "myabandonware.com") {
			newsrc = src.replace(/(\/media\/+screenshots\/.*\/)thumbs\/+/, "$1");
			if (newsrc !== src)
				return add_full_extensions(newsrc, ["png", "jpg", "gif"]);
		}
		if (domain_nowww === "d-gram.co.kr") return src.replace(/(\/data\/+dgram\/.*\/)small\/+([^/]+)(?:[?#].*)?$/, "$1big/$2");
		if (domain_nosub === "sz-search.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+t.html\?(?:.*&)?ph=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "sanet.pics") return src.replace(/(\/storage-[0-9]+\/+[0-9]+\/+)th_([^/]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "uploads.cdn.triller.co") {
			newsrc = src.replace(/(\/v1\/+avatars\/+[0-9]+\/+[0-9]+_avatar\.[^/.?#]+)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/v1\/+uploads\/+[0-9]+\/+[0-9]+)_thumbnail\.[^/.?#]+(?:[?#].*)?$/, "$1_video.mp4");
			if (newsrc !== src) {
				return {
					url: newsrc,
					video: true
				};
			}
		}
		if (domain === "v.triller.co") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([a-zA-Z0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://v.triller.co/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<video\s+class="no-js"\s+controls\s+preload="metadata"\s+poster="(\/\/[^"]+)"\s+src="(\/\/[^"]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var baseobj = {
						extra: {
							page: resp.finalUrl
						}
					};
					var poster = urljoin(resp.finalUrl, decode_entities(match[1]), true);
					var video = urljoin(resp.finalUrl, decode_entities(match[2]), true);
					var urls = [{ url: video, video: true }, poster];
					return done(fillobj_urls(urls, baseobj), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "triller.co") {
			var query_triller = function(id, cb) {
				api_query("triller_api:" + id, {
					url: "https://social.triller.co/v1.5/api/videos/" + id,
					imu_mode: "xhr",
					headers: {
						Origin: "https://triller.co"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					var video = resp.videos[0];
					var obj = {
						extra: {
							page: "https://triller.co/@" + video.user.username + "/video/" + video.id,
							created_date: new Date(video.timestamp).getTime(),
							caption: video.description,
							id: video.id,
							author_username: video.user.username,
						}
					};
					var urls = [];
					if (video.transcoded_url)
						urls.push({
							url: video.transcoded_url,
							video: "hls"
						});
					if (video.stream_url)
						urls.push({
							url: video.stream_url,
							video: true
						});
					if (video.og_sound && video.og_sound.sound_audio_url)
						urls.push({
							url: video.og_sound.sound_audio_url,
							media_info: {
								type: "audio"
							}
						});
					if (video.thumbnail_url)
						urls.push(video.thumbnail_url);
					return done(fillobj_urls(urls, obj), 6 * 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+@[^/]+\/+video\/+([0-9]+|[-0-9a-f]{20,})(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					query_triller(id, cb);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "triller.co") {
			newsrc = common_functions["get_pagelink_host_el_matching"](options, {
				url_match: /^[a-z]+:\/\/[^/]+\/+@[^/]+\/+video\/+([0-9]+|[-0-9a-f]{20,})(?:[?#].*)?$/,
				el_match: function(x) {
					return x.tagName.toLowerCase() === "halogen-ui-video-player";
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "kinolift.ru") return src.replace(/(\/media\/+users\/+[0-9]+\/+[0-9]+)_[sn](\.[^/.]+)(?:[?#].*)?$/, "$1_l$2");
		if ((domain_nosub === "dropbox.com" || domain_nosub === "dropboxusercontent.com") && /previews\.dropbox/.test(domain)) {
			if (/\/p\/+thumb\/+[^/]{50,}\/+[^/]+(?:[?#].*)?$/.test(src)) {
				return src.replace(/(\/[^?#]+)(?:[?#].*)?$/, "$1?fv_content=true&size_mode=5");
			}
		}
		if (domain_nosub === "ddimg.cn") {
			newsrc = src
				.replace(/(\/[0-9]{2}\/+[0-9]{2}\/+[0-9]+-[0-9]+)_[a-z]_([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1_o_$2")
				.replace(/(:\/\/[^/]+\/+[0-9]+)_[a-z](\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			return {
				url: newsrc,
				can_head: false
			};
		}
		if (domain === "image.bitautoimg.com") return src.replace(/\/appimage-[^/]+\/+mapi\/+media\/+/, "/mapi/media/");
		if (amazon_container === "miscellaneous-content" ||
			domain === "d2qm30jidfbm96.cloudfront.net") {
			regex = /(\/uploads\/+bfa\/+[0-9]+\/+([0-9]+)\/+)(?:thumb|large|wl|preview|original)_([0-9]+_[0-9]+\.[^/.]+)(?:[?#].*)?$/;
			match = src.match(regex);
			if (match) {
				page = "https://bfa.com/home/photo/" + match[2];
				obj = {
					url: src,
					extra: {
						page: page
					},
					headers: {
						Referer: page,
						"Sec-Fetch-Dest": "image",
						"Sec-Fetch-Mode": "same-origin",
						"Sec-Fetch-Site": "same-site"
					}
				};
				if (string_indexof(src, "/thumb_") >= 0 || string_indexof(src, "/large_") >= 0) {
					return fillobj_urls([
						src.replace(regex, "$1original_$3"),
						{
							url: src.replace(regex, "$1wl_$3"),
							problems: {
								watermark: true
							}
						},
						src.replace(regex, "$1large_$3")
					], obj);
				}
				if (string_indexof(src, "/wl_") >= 0 || string_indexof(src, "preview_") >= 0) {
					return fillobj_urls([
						src.replace(regex, "$1original_$3"),
						{
							url: src.replace(regex, "$1large_$3"),
							problems: {
								smaller: true
							}
						}
					], obj);
				}
				return obj;
			}
		}
		if (googlestorage_container === "inpock-link-media-storage") {
			return src.replace(/(\/media\/+images\/+[0-9]{4}\/+[0-9]+\/+[0-9]+\/+)thumb@[0-9]+_/, "$1");
		}
		if (domain_nowww === "24cos.com" ||
			domain === "imgs.diercun.com") {
			var referer_2 = "https://" + domain_nosub + "/";
			if (domain_nosub === "diercun.com") {
				referer_2 = "https://www.24mntp.com/";
			}
			return {
				url: src
					.replace(/:\/\/imgs(\.[^/]+\/+[^/]+\/+[0-9]{4}\/+[0-9]{4}\/+[0-9]+\/+)m(24[a-z]+_[0-9]+\.[^/.]+)(?:[?#].*)?$/, "://bimg$1$2")
					.replace(/(\/+[0-9]{4}\/+[0-9]{4}\/+[0-9]+\/+)m(24[a-z]+_[0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2"),
				headers: {
					Referer: referer_2
				}
			};
		}
		if (domain === "img.xda-cdn.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+[^/]{10,}\/+(https?.*)/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "img.itch.zone" && host_domain_nosub === "itch.io" && options && options.element) {
			if (options.element.classList.contains("screenshot")) {
				if (options.element.parentElement.tagName === "A" && string_indexof(options.element.parentElement.href, "://img.itch.zone/") >= 0) {
					return options.element.parentElement.href;
				}
			}
		}
		if (domain === "im.camjaxx.com") return src.replace(/:\/\/[^/]+\/+([0-9a-f]{10,})\/+preview\/+.*/, "://camjaxx.com/stream/$1");
		if (domain_nowww === "camjaxx.com") {
			if (/:\/\/[^/]+\/+stream\/+[0-9a-f]+\/*(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					video: true
				};
			}
		}
		if (domain === "ars.els-cdn.com") {
			newsrc = src.replace(/(\/content\/+image\/+[^/]+)\.sml(?:[?#].*)?$/, "$1.jpg");
			if (newsrc !== src)
				return add_extensions_gif(newsrc);
		}
		if (domain === "static.gearslutz.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+board\/+imgext\.php\?(?:.*&)?u=([^&]*).*?$/, "$1");
			if (newsrc !== src) {
				return decodeuri_ifneeded(newsrc);
			}
		}
		if ((domain_nosub === "hstatic.dk" ||
			domain_nosub === "smartweb-static.com") && string_indexof(src, "/upload_dir/") >= 0) {
			return src.replace(/(\/[^/]+?)(?:\.(?:[wh][0-9]+|fill)){1,}(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (amazon_container === "planetary") {
			return src.replace(/(\/assets\/+images\/+.*)_f[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "pastebin.com") {
			if (/^[a-z]+:\/\/[^/]+\/+i\/+t\.gif(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "davidrevoy.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+plugins\/+vignette\/+plxthumbnailer\.php\?(?:.*&)?src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "d2xkkdgjnsfvb0.cloudfront.net") return src.replace(/\/Vault\/+Thumb\?(?:.*&)?VaultID=([0-9]+).*$/, "/Vault/VaultOutput?ID=$1");
		if (domain_nowww === "albumartexchange.com") return src.replace(/(\/coverart\/+)_tn\/+/, "$1gallery/");
		if (amazon_container === "inteng-storage") {
			return src.replace(/\/sizes\/+([^/]+)_resize_[^/.]+(\.[^/.]+)(?:[?#].*)?$/, "/$1$2");
		}
		if (domain === "covers.vitalbook.com") return src.replace(/(\/vbid\/+[0-9]+)(?:\/+(?:height|width)\/+[0-9]+\/*)?(?:[?#].*)?$/, "$1");
		if (domain_nosub === "subirimagenes.com" && /^s[0-9]*\./.test(domain)) {
			return src.replace(/\/previo\/+thump_/, "/");
		}
		if (host_domain_nowww === "justfor.fans" && options && options.element) {
			if (options.element.parentElement && options.element.parentElement.classList.contains("video-thumbnail")) {
				var link = options.element.parentElement.parentElement;
				if (link.tagName === "A") {
					var match = link.href.match(/^javascript:MakeMovieHD\("[^"]+"\s*,\s*({.*?})\s*,/);
					if (match) {
						try {
							var json = JSON_parse(match[1]);
							var maxres = 0;
							var maxobj = null;
							for (var resolution in json) {
								var our_resolution = parseInt(resolution);
								if (our_resolution > maxres) {
									maxres = our_resolution;
									maxobj = json[resolution];
								}
							}
							if (maxobj) {
								return {
									url: maxobj,
									video: true,
									is_private: true // linked to ip
								};
							}
						} catch (e) {
							console_error(e);
						}
					}
				}
			}
		}
		if (domain === "d3373orltkomw3.cloudfront.net") {
			if (/\/[0-9]+\/+[0-9a-z]+\.mp4/.test(src)) {
				return {
					url: src,
					video: true
				};
			}
		}
		if (domain_nowww === "apclips.com") return src.replace(/(\/img\/+model\/+[^/]+\/+photo\/+[0-9a-f]{10,})_th(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "iwantclips.com") return src.replace(/(\/uploads\/+aboutme_previews\/+[0-9]+\/+)[0-9]+_/, "$1");
		if (domain === "s.bellesa.co") {
			newsrc = src.replace(/(\/v\/+[0-9a-f]{10,}\/+)(?:preview_[0-9]+)(\.[^/.]+)(?:[?#].*)?$/, "$1360$2");
			if (newsrc !== src)
				return newsrc;
			var sizes_1 = [2160, 1080, 720, 480, 360];
			regex = /(\/v\/+[0-9a-f]{10,}\/+)([0-9]+)(\.[^/.]+)(?:[?#].*)?$/;
			match = src.match(regex);
			if (match) {
				var obj_4 = [];
				for (var i_8 = 0; i_8 < sizes_1.length; i_8++) {
					if (sizes_1[i_8] <= match[1])
						break;
					obj_4.push(src.replace(regex, "$1" + sizes_1[i_8] + "$3"));
				}
				return obj_4;
			}
		}
		if (domain_nowww === "censored.tv") {
			if (/\/images\/+censored-bug\.png(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain === "imgs.ototoy.jp") {
			return src
				.replace(/(\/imgs\/+jacket\/+[0-9]+\/+[0-9]+\.[0-9]+\.[0-9]+)_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1orig$2")
				.replace(/(\/image\.php\/+[0-9]+\/+[^/?#]+)(?:[?#].*)?$/, "$1?width=999999");
		}
		if (domain === "gl.weburg.net") return src.replace(/(\/(?:albums|persons|movies|objectannounce|news)\/+[0-9]+\/+[0-9]+\/+)[^/]+\/+([0-9]+\.)/, "$1original/$2");
		if (domain_nowww === "vgmdownloads.com") return src.replace(/\/thumbs\/+([^/]+\.[^/.]+)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "linuxgamepublishing.com") {
			return src
				.replace(/(\/images\/+gamegraphics\/+[0-9]+\/+image)[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/images\/+gamegraphics\/+[0-9]+\/+)thumbnail([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1screenshot$2");
		}
		if (domain_nowww === "kino-teatr.ua") return src.replace(/(\/public\/+main\/+[^/]+\/+(?:[0-9]{4}-[0-9]{2}\/+)?)x[0-9]*_([a-z]+_[0-9a-f]{5,}\.)/, "$1$2");
		if (domain === "images.findagrave.com") {
			obj = {
				url: src.replace(/\/photo(?:Thumbnails|s[0-9]+)\/+photos\/+/, "/photos/"),
				head_wrong_contentlength: true
			};
			match = src.match(/\/photos\/+[0-9]{4}\/+[0-9]+\/+([0-9]+)_[0-9]+\./);
			if (match) {
				obj.extra = { page: "https://www.findagrave.com/memorial/" + match[1] };
			}
			return obj;
		}
		if (domain_nosub === "watson.de") return src.replace(/(\/imgdb\/+[0-9a-f]+\/+)[^/]+,[^/]+\/+([0-9]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "img.zvuqa.net") return src.replace(/\/artist[0-9]+x[0-9]+\/+/, "/artist-min/");
		if (domain_nowww === "xboxplay.games") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+imagenes\/+redimensionar2\.php\?(?:.*&)?imagen=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "owo.lewd.ninja") return src.replace(/(\/images\/+games\/+)(?:[a-z]_)?([0-9]+_[0-9a-f]{10,})(?:_thumb)?(\.[^/.]+)(?:[?#].*)?$/, "$1$2$3");
		if (domain_nowww === "kinogo.by") {
			match = src.match(/\/uploads\/+cache\/+(?:[0-9a-f]\/+){9}([0-9]+-[^/]+)-[0-9]+x[0-9]+(\.[^/.]+)(?:[?#].*)?$/);
			if (match) {
				obj = [];
				obj.push(src.replace(/\/uploads\/+.*/, "/uploads/posters/" + match[1] + match[2]));
				var match1 = match[1].match(/^([0-9]{10,})-[0-9]+-/);
				if (match1) {
					var date = new Date(parseInt(match1[1]) * 1000);
					obj.push(src.replace(/\/uploads\/.*/, "/uploads/posts/" + date.getUTCFullYear() + "-" + (date.getUTCMonth() + 1) + "/" + match[1] + match[2]));
				}
				return obj;
			}
		}
		if (domain === "ip.bitcointalk.org") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+\?(?:.*&)?u=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "cdn.minds.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+api\/+v2\/+media\/+proxy\?(?:.*&)?src=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain === "carbonmade-media.accelerator.net" ||
			domain === "carbon-media.accelerator.net") {
			return src.replace(/(:\/\/[^/]+\/+(?:[0-9]+\/+[^/.]+|[0-9]+));[0-9]*x[0-9]*(?:\/+[^/.]+)?(\.[^/.]+)(?:[?#].*)?$/, "$1;original$2");
		}
		if (domain_nowww === "streamja.com") {
			if (/\/img\/+play\.png(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain === "img.thedonald.win" && host_domain_nowww === "thedonald.win" && options && options.element) {
			if (options.element.parentElement && options.element.parentElement.tagName === "A") {
				var parent = options.element.parentElement;
				var dparent = parent.parentElement;
				if (dparent && dparent.tagName === "DIV" && dparent.classList.contains("thumb")) {
					return parent.href;
				}
			}
		}
		if (host_domain_nowww === "derstandard.at" && options.element) {
			if (options.element.tagName === "BUTTON" && options.element.classList.contains("figure-fullscreen-trigger")) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
			if (options.element.parentElement && options.element.parentElement.tagName === "PICTURE") {
				var fullscreen_img = options.element.parentElement.querySelector("img[data-fullscreen-src]");
				if (fullscreen_img) {
					return urljoin(src, fullscreen_img.getAttribute("data-fullscreen-src"), true);
				}
			}
		}
		if (domain === "cl.fame10.com") {
			return src
				.replace(/(\/image\/+upload\/+f10\/+.*)-[0-9]+x[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2")
				.replace(/\/image\/+upload\/+[^/]+\/+(f10\/+.*)$/, "/image/upload/$1");
		}
		if (domain_nowww === "photo-forum.net") {
			return src
				.replace(/\/imgs_(?:thumbs_(?:[0-9]+|[a-z]+)|medium)\/+/, "/imgs/")
				.replace(/(\/static\/+monthlytheme\/+id[0-9]+)_small(\.[^/.]+)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/static\/+media\/+[0-9]{4}\/+[^/]+)-[0-9]+px(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "photoforum.ru") return src.replace(/(\/f\/+(?:photo|portr))\.([^/]+)(\/+[0-9]{3}\/+[0-9]{3}\/+[0-9]+_[0-9]+)\.\2(\.[^/.]+)(?:[?#].*)?$/, "$1$3$4");
		if (domain_nowww === "clippituser.tv") {
			if (/\/static\/+[^/]+\/+images\/+small_play_btn\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain === "clips.clippit.tv") {
			obj = { url: src };
			id = null;
			match = src.match(/:\/\/[^/]+\/+([^/]+)\/+/);
			if (match) {
				id = match[1];
				obj.extra = { page: "https://www.clippituser.tv/c/" + id };
			}
			if (/\/360\.mp4(?:[?#].*)?$/.test(src)) {
				obj.url = src.replace(/\/[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "/720$1");
				return obj;
			}
			if (/\/thumbnail\.jpg(?:[?#].*)?$/.test(src)) {
				obj.url = src.replace(/\/thumbnail\.jpg(?:[?#].*)?$/, "/360.mp4");
				return obj;
			}
			return obj;
		}
		if (amazon_container === "clippit-prod") {
			return src.replace(/(\/media\/+profiles\/+[0-9]+\/+[0-9]+\.[^/.]+)(?:\.[^/]+\.[^/.]+)(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "porntrex.com" ||
			domain_nowww === "fapster.xxx" ||
			domain_nowww === "fapality.com" ||
			domain_nowww === "okporn.com" ||
			domain === "storage.hegre.com" ||
			domain_nowww === "pornalin.com" ||
			domain_nowww === "milffox.com" ||
			domain_nowww === "pornrewind.com") {
			if (/\/skin\/+img\/+play_/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "cf-st.sc-cdn.net") {
			match = src.match(/:\/\/[^/]+\/+aps\/+bolt(?:_web)?\/+(aHR0c[^/.]{20,})\.[^/.]+(?:[?#].*)?$/);
			if (match)
				return base64_decode(match[1]);
		}
		if (domain === "s.sc-cdn.net") {
			obj = {
				url: src
			};
			common_functions["snap_norm_obj"](obj);
			if (host_domain_nosub === "snapchat.com")
				obj.need_blob = true;
			var out_fn = "media";
			if (options.rule_specific && !options.rule_specific.snapchat_orig_media) {
				out_fn = "embedded";
			}
			newsrc = src.replace(/\/default\/+(?:embedded|media|preview(?:_overlay)?)\.(?:jpg|mp4)(?:[?#].*)?$/, "/default/" + out_fn + ".mp4");
			if (newsrc !== src) {
				var full = add_full_extensions(newsrc, ["mp4", "jpg"], true);
				return fillobj_urls(full, obj);
			}
			if (false && /\/default\/+overlay\.jpg(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			return obj;
		}
		if (host_domain_nosub === "snapchat.com" && options.do_request && options.cb && options.element) {
			var info = common_functions["get_snapchat_info_from_el"](options.element);
			if (info) {
				common_functions["get_obj_from_snap_info"](api_cache, options.do_request, info, options.cb);
				return {
					waiting: true
				};
			}
			if (!src && options.element.tagName === "VIDEO") {
				var source_els = options.element.querySelectorAll("source");
				var sources = [];
				for (var _a = 0, source_els_1 = source_els; _a < source_els_1.length; _a++) {
					var source = source_els_1[_a];
					array_upush(sources, source.getAttribute("src"));
				}
				if (sources[0]) {
					var is_hls = /\.m3u8/.test(sources[0]);
					return {
						url: sources[0],
						video: is_hls ? "hls" : true,
						need_blob: !is_hls
					};
				}
			}
			if (src && /\.mp4/.test(src)) {
				return {
					url: src,
					need_blob: true
				};
			} else {
				return null;
			}
		}
		if (domain === "soup.onerpm.com") return src.replace(/(\/web\/+user\/+(?:images|content)\/+.\/+..\/+[^/]+\.)[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1orig$2");
		if (domain_nosub === "crank-in.net") {
			newsrc = src.replace(/(\/img\/+db\/+[0-9]+)_(?:[0-9]{3}|1[01][0-9]{2})(\.[^/.]+)(?:[?#].*)?$/, "$1_1200$2");
			if (newsrc !== src) {
				return {
					url: newsrc,
					problems: {
						possibly_upscaled: true
					}
				};
			}
		}
		if (domain === "hs.mediadelivery.fi" ||
			domain === "is.mediadelivery.fi") {
			newsrc = src.replace(/(\/img\/+(?:square\/+)?)(?:[0-9]{3}|1[0-8][0-9]{2})\//, "$11920/");
			if (newsrc === src) {
				newsrc = src.replace(/(\.[a-z]+)\.webp(?:[?#].*)?$/, "$1");
			}
			if (newsrc !== src) {
				return {
					url: newsrc,
					problems: {
						possibly_upscaled: true
					}
				};
			}
		}
		if (domain === "cdn.cdkeys.com" ||
			domain === "media.sssports.com") {
			return src.replace(/(:\/\/[^/]+\/+)[0-9]+x[0-9]+\/+media\//, "$1media/");
		}
		if (domain_nowww === "impericon.com") return src.replace(/(:\/\/[^/]+\/+)[0-9]+x[0-9]+x[0-9]+\/+media\//, "$1media/");
		if (domain === "d1466nnw0ex81e.cloudfront.net") return src.replace(/\/n_ii\/+[0-9]+\/+/, "/n_ii/originalimage/");
		if (domain === "assets.upflix.pl") return src.replace(/(\/media\/.*)__[0-9]+_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "enfilme.com") return src.replace(/(\/img\/+content\/+[^/]+_[0-9a-f]+)_[0-9]+_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "koha.net") return src.replace(/(\/uploads\/+images\/+[0-9]{4}\/+[A-Za-z]+\/+[0-9]+\/+)[0-9]+x[0-9]+_/, "$1");
		if (domain_nowww === "nrwkino.de" ||
			domain_nowww === "biograph.de") {
			newsrc = src.replace(/.*\/img\.php\?(?:.*&)?src=([^&]+).*?$/, "$1");
			if (newsrc !== src) {
				return urljoin(src, decodeURIComponent(newsrc.replace(/\+/g, "%20")), true);
			}
			return src.replace(/\/img\/+[wh][0-9]+\/+upload\/+/, "/upload/");
		}
		if (domain === "img.lap.recochoku.jp") {
			newsrc = decodeURIComponent(src);
			if (/common\/+store(?:_[^/]+)?\/+[^/]+\.(?:gif|png)(?:[?#].*)?$/.test(src))
				return {
					url: src,
					bad: "mask"
				};
			if (/\/p1\/+imgkp\?/.test(src)) {
				var queries = get_queries(keep_queries(src, ["f", "FFh", "FFw", "p"]));
				for (var query in queries) {
					if (query === "FFh" || query === "FFw") {
						queries[query] = "999999999";
					}
				}
				if (queries) {
					newsrc = src.replace(/\?.*/, "") + "?" + stringify_queries(queries);
					if (newsrc !== src)
						return newsrc;
				}
			}
		}
		if (domain === "s.akb48.co.jp") return src.replace(/(:\/\/[^/]+\/+)sns[0-9]+\/+/, "$1sns/");
		if (domain_nowww === "16bit.pl") {
			newsrc = src.replace(/(\/download\/+games\/+screens\/+[^/]+\/+)t([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (domain_nowww === "beeg.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+([0-9]+)(?:[?#].*)?$/);
			if (match) {
				id = match[1];
				var get_params_from_beeg_url = function(url) {
					var match = url.match(/[?&]t=([0-9]+(?:-[0-9]+)?)/);
					if (!match) {
						return null;
					}
					splitted = match[1].split("-");
					params = {
						start: splitted[0],
						end: splitted[1]
					};
					return params;
				};
				var get_beeg_url = function(id, params) {
					var beeg_url = "https://beeg.com/" + id;
					if (params && params.start) {
						beeg_url += "?t=" + params.start;
						if (params.end) {
							beeg_url += "-" + params.end;
						}
					}
					return beeg_url;
				};
				var get_beeg_finalurl_for_src = function(src, cb) {
					api_query("beeg_finalurl:" + src, {
						url: src
					}, cb, function(done, resp, cache_key) {
						api_cache.set("beeg_finalurl:" + resp.finalUrl, resp.finalUrl, 6 * 60 * 60);
						done(resp.finalUrl, 6 * 60 * 60);
					});
				};
				var query_beeg_api = function(id, params, cb) {
					var api_url = "https://beeg.com/api/v6/" + Date.now() + "/video/" + id + "?v=2";
					var referer_url = get_beeg_url(id, params);
					var cache_key = "beeg:" + id;
					if (params && params.start) {
						api_url += "&s=" + params.start;
						cache_key += "-" + params.start;
						if (params.end) {
							api_url += "&e=" + params.end;
							cache_key += "-" + params.end;
						}
					}
					api_query(cache_key, {
						url: api_url,
						headers: {
							Accept: "*/*",
							Referer: referer_url,
							"X-Requested-With": "XMLHttpRequest"
						},
						json: true
					}, cb, function(done, resp, cache_key) {
						done(resp, 60 * 60);
					});
				};
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				var get_obj_from_beeg = function(data) {
					if (!data)
						return page_nullobj;
					var baseobj = {
						extra: {
							page: get_beeg_url(data.id, data),
							caption: data.title
						}
					};
					baseobj.headers = {
						Referer: baseobj.extra.page,
						"Sec-Fetch-Dest": "video"
					};
					var base_urls = [];
					var data_markers = "data=pc_US__" + data.bundle_version + "_";
					for (var key in data) {
						if (!data[key] || string_indexof(data[key], "video.beeg.com") < 0)
							continue;
						var keymatch = key.match(/^([0-9]+)p$/);
						if (keymatch) {
							base_urls.push({
								size: parseInt(keymatch[1]),
								url: urljoin("https://beeg.com/", data[key].replace("{DATA_MARKERS}", data_markers), true)
							});
						}
					}
					base_urls.sort(function(a, b) {
						return b.size - a.size;
					});
					var urls = [];
					for (var i = 0; i < base_urls.length; i++) {
						urls.push(base_urls[i].url);
					}
					urls.push(page_nullobj);
					return fillobj_urls(urls, baseobj);
				};
				if (options.do_request && options.cb) {
					get_beeg_finalurl_for_src(src, function(newsrc) {
						if (newsrc && newsrc !== src) {
							return options.cb({
								url: newsrc,
								is_pagelink: true
							});
						}
						query_beeg_api(id, null, function(data) {
							if (!data) {
								query_beeg_api(id, get_params_from_beeg_url(src), function(data) {
									return options.cb(get_obj_from_beeg(data));
								});
							} else {
								return options.cb(get_obj_from_beeg(data));
							}
						});
					});
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if (host_domain_nowww === "beeg.com" && domain === "img.beeg.com" && options.element) {
			newsrc = common_functions["get_pagelink_el_matching"](options.element, /^[a-z]+:\/\/(?:www\.)?beeg\.com\/+[0-9]+/);
			if (newsrc)
				return newsrc;
		}
		if (domain === "vp.beeg.com") {
			match = src.match(/:\/\/[^/]+\/+vp\/+[0-9]{2}\/+([0-9]+)_([0-9]+)_([0-9]+)\.mp4/);
			if (match) {
				id = match[1];
				var url = "https://www.beeg.com/" + match[1];
				if (match[2] !== "0") {
					url += "?t=" + match[2];
					if (match[3] !== "0") {
						url += "-" + match[3];
					}
				}
				return {
					url: url,
					is_pagelink: true
				};
			}
		}
		if (host_domain_nowww === "dogpile.com" && domain_nosub === "bing.net" && /^ts[^.]+\.mm\./.test(domain) && options && options.element) {
			if (options.element.tagName === "IMG" && options.element.parentElement && options.element.parentElement.tagName === "A") {
				if (options.element.parentElement.classList.contains("link")) {
					var parent = options.element.parentElement;
					if (parent.parentElement && parent.parentElement.classList.contains("image")) {
						if (parent.href !== src)
							return parent.href;
					}
				}
			}
		}
		if (host_domain_nowww === "yippy.com" && domain_nosub === "bing.net" && /^ts[^.]+\.mm\./.test(domain) && options && options.element) {
			if (options.element.tagName === "IMG" && options.element.parentElement && options.element.parentElement.tagName === "DIV") {
				var parent = options.element.parentElement;
				if (parent.classList.contains("media-box-thumbnail-container") && parent.parentElement) {
					var dparent = parent.parentElement;
					newsrc = dparent.getAttribute("data-mfp-src");
					if (newsrc && newsrc !== src) {
						return newsrc;
					}
				}
			}
		}
		if (host_domain_nowww === "gigablast.com" && options && options.element) {
			if (options.element.tagName === "IMG" && options.element.parentElement && options.element.parentElement.tagName === "A") {
				var parent = options.element.parentElement;
				var current = parent;
				while ((current = current.parentElement)) {
					if (current.tagName === "TABLE" && current.classList.contains("image")) {
						if (parent.href !== origsrc) {
							return parent.href;
						} else {
							break;
						}
					}
				}
			}
		}
		if (host_domain_nowww === "ecosia.org" && options && options.element) {
			if (options.element.tagName === "IMG" && options.element.parentElement && options.element.parentElement.tagName === "A") {
				var parent = options.element.parentElement;
				if (parent.classList.contains("image-result")) {
					if (parent.href !== src) {
						return parent.href;
					}
				}
			}
		}
		if (domain === "spapi.searchencrypt.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+image\?(?:.*&)?path=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "boardreader.com") {
			if (/\/img\/+placeholder\.gif/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "imgproxy.geocaching.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+[0-9a-f]{10,}\?(?:.*?&)?url=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "wolframcdn.com") return src.replace(/(\/waimage\/.*_v[0-9]+)s(\.[^/.]+)(?:[?#].*)?$/, "$1ms$2");
		if (domain_nowww === "allthetests.com") return src.replace(/\/picture_thumb\/+pic_/, "/picture/pic_");
		if (domain_nowww === "dicelacancion.com") return src.replace(/(\/static\/+img\/+[^/]+\/+.\/+[^/]+\/+[^/]+)_[lbm](\.[^/.]+)(?:[?#].*)?$/, "$1_o$2");
		if (domain === "static.pressfrom.info") return src.replace(/\/upload\/+images\/+small\/+/, "/upload/images/real/");
		if (domain_nowww === "shadestation.co.uk") return src.replace(/\/media\/+thumbs\/+[0-9]+x[0-9]+\/+(media\/+product_images\/+[^/]+)fw[0-9]+fh[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "/$1$2");
		if (domain === "image.ceneostatic.pl") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+offercandidates\/+([^/?#]{30,})(?:[?#].*)?$/, "$1");
			if (newsrc != src) {
				var decoded = base64_decode(decodeURIComponent(newsrc));
				newsrc = decoded.replace(/.*(https?:\/\/)/, "$1");
				if (newsrc.match(/^https?:\/\//)) {
					return newsrc;
				}
			}
		}
		if (domain === "img-cloud.megaksiazki.pl") return src.replace(/(:\/\/[^/]+\/+[0-9]+-)[a-z]+\/+([0-9a-f]{10,}\/+)/, "$1original/$2");
		if (domain_nowww === "e-onkyo.com") return src.replace(/\/image\/+jacket\/+s[1-5]\/+/, "/image/jacket/s0/");
		if (domain_nowww === "ubuy.qa") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+productimg\/+\?(?:.*&)?image=([^&.]+)(?:\.[^/.&]+)?.*?$/, "$1");
			if (newsrc !== src)
				return base64_decode(decodeURIComponent(newsrc));
		}
		if (domain === "web.rds.it") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+i\/+[^/]+\/+\?(?:.*&)?url=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "media.loot.co.za") return src.replace(/(:\/\/[^/]+\/+images\/+)x(?:40|80|120|200)\/+/, "$1x400/");
		if (domain === "img.ibs.it") return src.replace(/(:\/\/[^/]+\/+images\/+[0-9]{5,})(?:_[0-9]+){4}(\.[^/.]+)(?:[?#].*)?$/, "$1_0_0_0_0$2");
		if (domain_nowww === "melodycenter.hu") return src.replace(/(\/img\/+[0-9]+\/+[^/]+\/+)[0-9]+x[0-9]+(?:,[^/]+)?\/+/, "$1");
		if (domain === "images.music-story.com") return src.replace(/(\/img\/+artiste_[A-Z])_[0-9]+\/+/, "$1/");
		if (domain === "naslehiphop.com") return src.replace(/(\/files\/+uploads\/+[0-9]{4}\/+[0-9]+\/+[0-9]+)_thumbnail(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "pic.eslite.com") return src.replace(/(\/Upload\/+Product\/+[0-9]{6}\/+)[a-z]\/+/, "$1o/");
		if (domain_nosub === "vibbidi-vid.com") {
			newsrc = src.replace(/(\/vibbidi-[a-z]+\/+(?:albums|audio|videos)\/+(?:(?:img|audio|video)_[A-F0-9]{10,}|[0-9]+)(?:\.(?:[0-9]+|mp3)){0,})\.(?:[0-9]*x[0-9]*|small)(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/videos\/+video_[0-9A-F]{10,}\.mp4)(?:\..*)?(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return {
					url: newsrc,
					video: true
				};
			if (/\/videos\/+video_[0-9A-F]{10,}\.mp4$/.test(src)) {
				return {
					url: src,
					video: true
				};
			}
		}
		if (domain_nowww === "vibbidi.net") {
			if (/\/static\/+img\/+no_[0-9]+x[0-9]+\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (host_domain_nowww === "vibbidi.net" && options.element) {
			if (options.element.tagName.toLowerCase() === "svg") {
				if (options.element.classList.contains("IcoPlayMedium")) {
					return {
						url: origsrc,
						bad: "mask"
					};
				}
			}
		}
		if (domain_nowww === "puregrainaudio.com") return src.replace(/(\/images\/+blogimages\/+)[0-9]+s\/+/, "$1");
		if (domain_nowww === "mfmm.ru") return src.replace(/(\/_bd\/+[0-9]+\/+)s([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "mlstatic.com") return src.replace(/(:\/\/[^/]+\/+(?:[^/]+-)?D_[^/.]+)-[A-Z](\.[^/.]+)(?:-[A-Z]\.[^/.]+)?(?:[?#].*)?$/, "$1-F$2");
		if (domain === "angartwork.akamaized.net") {
			return {
				url: keep_queries(src, ["id"], { required: true }),
				head_wrong_contentlength: true
			};
		}
		if (domain === "pimg.awa.io") {
			return {
				url: src.replace(/(\/v2\/+[^/]+\/+[0-9a-f]{10,})(?:\.(?:[whv][0-9]+|fitcrop)){1,}(\.[^/.]+)(?:[?#].*)?$/, "$1.w9999999999$2"),
				can_head: false // 404
			};
		}
		if (domain_nosub === "hudobny.sk") return src.replace(/\/images\/+[a-z]+\/+([0-9]+\.[^/.]+)(?:[?#].*)?$/, "/images/original/$1");
		if (domain === "cdnimages01.azureedge.net") return src.replace(/(\/megahits\/+[^/]+[0-9a-f]{8})_square[a-z]*(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "media.becteroradio.com") return src.replace(/(\/pix\/+[^/]+\/+[0-9]+)_[a-z]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "saga-rian.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+common\/+image2\.php\?(?:.*&)?f=([^&]+).*?$/, "$1");
			if (newsrc !== src) {
				return decodeuri_ifneeded(newsrc);
			}
		}
		if (domain_nowww === "wigtypes.com") return src.replace(/(\/product_description\/+[^/]+\/+[^/]+)_175(\.[^/.]+)(?:[?#].*)?$/, "$1_600$2");
		if (domain_nowww === "beautyhill.com") return src.replace(/(\/img\/+[^/]+\/+[0-9]{4}\/+.*)_thumb(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "she12.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+wp-content\/+plugins\/+seo-alrp\/+php\/+thumb\.php\?(?:.*&)?src=([^&]+).*?$/, "$1");
			if (newsrc !== src) {
				return urljoin(src, decodeuri_ifneeded(newsrc), true);
			}
		}
		if (domain_nowww === "soemo.co.uk") return src.replace(/(:\/\/[^/]+\/+images\/+[^/]+)x(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "tasior.com") return src.replace(/(\/upload\/+foto\/+[0-9]+\/+)th([0-9]+\.)/, "$1$2");
		if (domain_nosub === "blogerka.cz") return src.replace(/(\/obrazky\/+[^/]+\/+[^/]+)\.tn\.[^/.]+(?:[?#].*)?$/, "$1");
		if (domain_nowww === "worldsmostunique.com") return src.replace(/\/images\/+thumbnails\/+([^/]+)_[a-z]+(\.[^/.]+)(?:[?#].*)?$/, "/images/images/$1$2");
		if (domain_nowww === "zarzarmodels.com") {
			return src.replace(/(\/images\/+models\/+[0-9]+\/+)thumb\/+/i, "$1");
		}
		if (domain === "d3ts7pb9ldoin4.cloudfront.net" ||
			amazon_container === "star-uploads") {
			return src.replace(/(\/uploads\/+users\/+[0-9]+\/+[^/]+\/+[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12})-[0-9]+x[0-9]+(?:_[0-9]+x[0-9]+){2}(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (amazon_container === "static.e-junkie.com") {
			return src.replace(/\/products\/+[a-z]+-images\/+/, "/products/images/");
		}
		if (domain === "api.europeana.eu") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+api\/+v2\/+thumbnail-by-url\.json\?(?:.*&)?uri=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "fanparty.ru") return src.replace(/(\/gallery\/+[0-9]+_[^/]+)_medium(\.[^/.]+)(?:[?#].*)?$/, "$1_pic$2");
		if (domain_nowww === "metlifestadium.com") return src.replace(/(\/images\/+.*)\.tmb-(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "fxinteractive.com") return src.replace(/(\/images\/+games\/+[^/]+\/+screenshots\/+[^/]+)_thumbnail_([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1_screenshot_$2");
		if (domain_nowww === "kinogallery.com") return src.replace(/(\/pimages\/+[0-9]+\/+[^-/]+-)pr-/, "$1");
		if (domain === "image.mux.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+([^/.]{30,})\/+thumbnail\.[^/.]+(?:[?#].*)?$/, "https://stream.mux.com/$1.m3u8");
			if (newsrc !== src) {
				return {
					url: newsrc,
					video: "hls"
				};
			}
		}
		if (domain === "stream.mux.com") {
			if (/\.m3u8(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					video: "hls"
				};
			}
		}
		if (domain === "thumbnails.pcgamingwiki.com") return src.replace(/:\/\/[^/]+\/+(.)\/+(..)\/+([^/]*)\/+[0-9]+px-.*?$/, "://images.pcgamingwiki.com/$1/$2/$3");
		if (domain_nowww === "filmix.co") return src.replace(/(\/uploads\/+frames\/+[0-9]+\/+[^/]+)_small(\.[^/.]+)(?:[?#].*)?$/, "$1_original$2");
		if (domain === "thumbs.filmix.co" ||
			domain === "thumbs.filmix.ac") {
			return src.replace(/\/thumbs\/+[wh][0-9]+\/+/, "/orig/");
		}
		if (domain === "img.filmix.ac" ||
			domain_nowww === "filmix.ac") {
			return src
				.replace(/(\/(?:posters|frames)\/+[0-9]+\/+[a-z][0-9]+-[^/]+)_small\./, "$1_original.")
				.replace(/(\/sliderPics\/+[^/]+)_thumb\./, "$1.");
		}
		if (domain_nowww === "5tv5.ru") {
			return src
				.replace(/\/smallposters\/+/, "/posters/")
				.replace(/(\/frames\/+[0-9]+\/+)s([0-9]+\.)/, "$1f$2");
		}
		if (domain === "thumbs.dfs.ivi.ru") return src.replace(/(\/contents\/+[0-9a-f]\/+[0-9a-f]\/+[0-9a-f]{10,}\.[^/.]+)(?:\/+[0-9]+x[0-9]+\/*)(?:[?#].*)?$/, "$1");
		if (domain_nowww === "2img.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+h\/+([^/]+\.[^/]+\/)/, "http://$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "postimg.cc" && /^(i|s)[0-9]*\./.test(domain)) {
			match = src.match(/:\/\/[^/]*\/+([^/]+)\/+/);
			if (match) {
				return {
					url: "https://pixxxels.cc/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "pixxxels.cc") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([0-9a-zA-Z]+)(?:[?#].*)?$/,
				query_for_id: {
					url: "https://pixxxels.cc/${id}",
					headers: {
						Referer: ""
					}
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<a[^>]+href=["'](https?:\/\/i\.[a-z]+\.cc\/+[^"']+\?dl=1)["']/);
					if (!match) {
						console_error(cache_key, "Unable to find download link for", resp);
						return done(null, false);
					}
					var dllink = decode_entities(match[1]).replace(/[?#].*$/, "");
					var referer = resp.finalUrl;
					match = resp.responseText.match(/<link rel="canonical" href="(https?:\/\/[a-z]+\.cc\/[^"]+)"/);
					if (match) {
						referer = decode_entities(match[1]);
					}
					var obj = {
						url: dllink,
						headers: {
							Referer: referer
						},
						extra: { page: referer }
					};
					return done(obj, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "i.pixxxels.cc") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+([^-_/.]+)\/+[^/]+(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://pixxxels.cc/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain === "t.meadd.net") return src.replace(/:\/\/[^/]+\/+photos\/+[0-9]+\/+([0-9]+\.[^/.]+)(?:[?#].*)?$/, "://cdn.meadd.net/photos/full/$1");
		if (domain === "s.uicdn.com") {
			return {
				url: src,
				bad: "mask"
			};
		}
		if (domain_nosub === "x-art.com" && /^(?:hosted|content[0-9]*)\./.test(domain)) {
			newsrc = src.replace(/(\/models\/+[^/]+\/+[^/]+)-tn(\.[^/.]+)(?:[/#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/^([a-z]+:\/\/[^/]+\/+galleries\/+[^/]+\/+[^/]+)-(l?tn|sml|med)(\.[^/.]+)(?:[?#].*)?$/);
			if (match) {
				var sizes = [
					"lrg",
					"med",
					"sml",
					"ltn",
					"tn"
				];
				var sizes_index = array_indexof(sizes, match[2]);
				var urls = [];
				if (sizes_index >= 0) {
					for (var i_9 = 0; i_9 < sizes_index; i_9++) {
						urls.push(match[1] + "-" + sizes[i_9] + match[3]);
					}
					return urls;
				}
			}
		}
		if (domain_nowww === "vkanketa.ru") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+file\.php\?(?:.*&)?img=(http[^&]+)(?:[#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "blob.freent.de") return src.replace(/\/image\/+([0-9]+)\/+[0-9]+x[0-9]+\/+[0-9]+\/+[0-9]+\/+[0-9a-f]{2}\/+[0-9a-f]{10,}\/+[^/]+\/+([^/]+)(?:[?#].*)?$/, "/contentblob/$1/original/$2");
		if (domain_nosub === "cdnsw.com" && /^mfs[0-9]*\./.test(domain)) {
			return src.replace(/\/fs\/+Root\/+[a-z]+\/+/, "/fs/Root/");
		}
		if (domain_nowww === "kupidon-rf.ru") return src.replace(/(\/uploads\/+[^/]+\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9]+\/+)[a-z]+-([0-9a-f]{5,}\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "fondecranmagique.com") return src.replace(/\/min\/+([0-9]+\.[^/.]+)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "photohost.ru") return src.replace(/\/t\/+[0-9]+\/+[0-9]+\/+/, "/pictures/");
		if ((domain_nosub === "sat1.de" ||
			domain_nosub === "7tv.de") && /^i[0-9]*-img\./.test(domain)) {
			return {
				url: src.replace(/\/profile:[^/]+(?:[?#].*)?$/, "/profile:original?source"),
				can_head: false // 403
			};
		}
		if (domain === "m.gjcdn.net") {
			newsrc = src
				.replace(/\/screenshot-thumbnail\/+[0-9]+x[0-9]+\/+/, "/screenshot-thumbnail/999999999x999999999/")
				.replace(/\/(game-(?:header|thumbnail|screenshot)|fireside-post-image|content)\/+[0-9]+\/+([0-9]+-)(?:crop[0-9]+(?:_[0-9]+){3}-)?/, "/$1/999999999/$2");
			return {
				url: newsrc,
				head_wrong_contenttype: true
			};
		}
		if (domain_nowww === "crosti.ru") return src.replace(/(\/patterns\/+(?:[0-9a-f]{2}\/+){3}[0-9a-f]{5,}\/+)thumbnail(\.[^/.]+)(?:[?#].*)?$/, "$1picture$2");
		if (domain === "cdn.carbuzz.com") return src.replace(/(\/(?:car-thumbnails|gallery-images)\/+)[0-9]+(?:x[0-9]+)?\/+/, "$1original/");
		if (domain_nosub === "slideserve.com" && /^(?:image|cdn)[0-9]*\./.test(domain)) {
			return src.replace(/(\/[0-9]+\/+[^/]+)-t(\.[^/.]+)(?:[?#].*)?$/, "$1-n$2");
		}
		if (domain === "resizer.mujerhoy.com") {
			if (/\/resizer\/+resizer\.php\?/.test(src)) {
				return remove_queries(src, ["nuevoancho", "nuevoalto", "crop"]);
			}
		}
		if (domain_nowww === "lahiguera.net") return src.replace(/(\/fotos\/+[0-9]+\/+[^/]+)-p(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "camo.envatousercontent.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+[0-9a-f]+\/+([0-9a-f]{10,})(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return hex_to_ascii(newsrc);
		}
		if (domain === "img.mnggo.net" ||
			domain === "img.lady-first.me") {
			return src.replace(/(:\/\/[^/]+\/+frimage\/+)md_\/+/, "$1");
		}
		if (domain_nowww === "hockeydb.com") return src.replace(/\/program_img_tn\.php\?/, "/program_img.php?");
		if (domain_nowww === "hahastop.com" ||
			domain_nowww === "evilmilk.com") {
			return src.replace(/\/thumbs\/+([^/]+)_s(\.[^/.]+)(?:[?#].*)?$/, "/pictures/$1$2");
		}
		if (domain_nowww === "celebshq.com") return src.replace(/(\/pics\/+[^/]+\/+[^/]+)_(?:small|big)thumb_(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "images-ssl.gotinder.com" ||
			domain === "preview.gotinder.com") {
			return src.replace(/(\/[-0-9a-f]{10,}\/+)(?:[0-9]+x[0-9]+_)?(?:[0-9]+_)?([0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12})\.[^/.]+(?:[?#].*)?$/, "$1original_$2.jpeg");
		}
		if (domain_nowww === "jpopsuki.eu") return src.replace(/(\/static\/+images\/+[a-z]+\/+[0-9]+)\.th(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "spacefucker.com") return src.replace(/\/data\/+xfmg\/+thumbnail\/+[0-9]+\/+([0-9]+)-[0-9a-f]{10,}\.[^/.]+(?:[?#].*)?$/, "/media/$1/full");
		if (domain_nowww === "vikv.net" ||
			domain_nowww === "gayles.tv" ||
			domain_nowww === "flixchimp.com") {
			if (/\/wp-content\/+themes\/+detube\/+images\//.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "milanparal.cz") return src.replace(/(\/static\/+_user\/+.*)_small(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "posterhd.ru") return src.replace(/(?:\/pictures\/+(?:thumb_)?|\/renderint\.php\?(?:.*&)?si=)([0-9]+\.[^/.?#&]+)(?:[?#&].*)?$/, "/pictures/$1&t=0");
		if (domain_nowww === "tapetus.pl") {
			if (/\/img\/+adblock\.png/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain_nosub === "ali213.net") {
			if (/\/zt\/+images\/+bg[0-9]+\./.test(src) ||
				/\/images\/+showbig_dt\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "images.ali213.net") return src.replace(/\/picfile\/+pic\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+)[0-9]+(?:X[0-9]+)?_/, "/picfile/pic/$1");
		if (domain_nosub === "yx7088.com") {
			if (/\/images\/+top\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "s.gamer-info.com") {
			if (/\/im\/+gameinfobgshadow-[a-z]+\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src.replace(/(\/vd\/+(?:[0-9]\/+){4}[0-9]+)_[^/.]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "iomoio.com") {
			if (/\/img\/+cover-bg\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src.replace(/\/covers\/+[0-9]+\/+/, "/covers/src/");
		}
		if (domain === "static.rogerebert.com") return src.replace(/(\/(?:uploads\/+blog_post|redactor_assets\/+pictures)\/.*\/)(?:thumb|content)_([^/]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "cdn.adltimgcdn.com") return src.replace(/\/user\/+[0-9]+\/+/, "/user/");
		if (domain_nowww === "ttgames.com" ||
			domain_nowww === "digitalwhiplash.com" ||
			domain === "blog.yellowoctopus.com.au") {
			return src.replace(/(\/wp-content\/+uploads\/.*)-thegem-[^/.]+\./, "$1.");
		}
		if (domain === "assets.infowarsmedia.com") return src.replace(/(\/images\/+[-0-9a-f]{10,})-large(\.[^/.]+)(?:[?#].*)?/, "$1$2");
		if (domain === "assets.infowars.com") return src.replace(/(:\/\/[^/]+\/+[0-9]{4}\/+[0-9]{2}\/+[^/]+)-[0-9]+x[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "wallpapername.com") return src.replace(/\/thumbnails\/+cover\/+/, "/thumbnails/detail/");
		if (domain === "c.puzzcore.com") {
			return {
				url: src.replace(/(\/img_pzl\/.*\/thumb)1(\.[^/.]+)(?:[?#].*)?$/, "$12$2"),
				headers: {
					Referer: "https://www.puzzcore.com/"
				}
			};
		}
		if (domain === "img.faxingzhan.com") return src.replace(/(\/[0-9]+\/+[0-9]+-[0-9A-Z]+)_[0-9]+_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "thumb.ex-cdn.com") {
			newsrc = src.replace(/^([a-z]+:\/\/[^/]+\/+EXP\/+[^/]+\/+)(?:resize|center)\/+[0-9]+x[0-9]+\/+/, "$1resize/99999999999x99999999999/");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/^[a-z]+:\/\/[^/]+\/+(EXP\/+[^/]+\/+)(?:resize|center)\/+[0-9]+x[0-9]+\/+/, "https://media.ex-cdn.com/$1");
		}
		if (domain_nowww === "sweetandtalented.com") return src.replace(/(\/images\/+[^/]+\/+[^/]+)_tm([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "scotsman.com" ||
			domain_nowww === "yorkshirepost.co.uk" ||
			domain_nowww === "wigantoday.net" ||
			domain_nowww === "lep.co.uk") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+(jp-ct\.co\.uk\/.*?)(?:[?#].*)?$/, "https://$1");
			if (false && newsrc !== src)
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+webimg\/+([^-_/.]+)(\.[^/.?#]+)?(?:[?#].*)?$/);
			if (match) {
				newsrc = src.replace(/[?#].*$/, "");
				if (newsrc !== src)
					return newsrc;
				try {
					var decoded = base64_decode(match[1]);
					if (/^onecms:([-0-9a-f]+:[-0-9a-f]+)$/.test(decoded))
						return "https://" + domain + "/jp-ct.co.uk/image/" + decoded + "/image" + (match[2] || ".jpg");
				} catch (e) {
					console_error(e);
				}
			}
			if (/\/(?:webimg|jp-ct\.co\.uk)\//.test(src)) {
				return {
					url: src,
					can_head: false // 404
				};
			}
		}
		if (domain === "nmbimg.fastmirror.org") return src.replace(/\/thumb\/+([0-9]{4}-[0-9]{2}-[0-9]{2}\/+[0-9a-f]+\.)/, "/image/$1");
		if (domain_nowww === "supraphonline.cz") {
			if (/\/assets\/+images\/+sexycover\/+/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "mp3va.com") {
			if (/\/img\/+cover-pt-[0-9]+\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain === "d27t0qkxhe4r68.cloudfront.net") {
			return src
				.replace(/\/sizedimages\/+([^/]+\/+)[0-9]+\/+/, "/images/$1");
		}
		if (domain === "d1iiivw74516uk.cloudfront.net" ||
			domain === "d27csu38upkiqd.cloudfront.net" ||
			domain === "images.are.na" ||
			domain === "images.ams-prd.blv.cloud") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+([^-_/.]{20,})(?:[?#].*)?$/);
			if (match) {
				try {
					var decoded = base64_decode(match[1]);
					var json = JSON_parse(decoded);
					delete json.edits;
					return "https://" + domain + "/" + base64_encode(JSON_stringify(json));
				} catch (e) {
					console_error(e);
				}
			}
		}
		if (domain === "imagery.zoogletools.com" ||
			amazon_container === "content.sitezoogle.com" ||
			domain === "content.sitezoogle.com" ||
			amazon_container === "zoogle-imager-production-2020") {
			return {
				url: src
					.replace(/(\/u\/+[0-9]+\/+[0-9a-f]{10,}\/+)[a-z]+(\/+[^/]+\.[^/.]+)(?:[?#].*)?$/, "$1original$2")
					.replace(/(\/u\/+[0-9]+\/+[0-9a-f]{10,}\/+[^/]+\/+[^/]+)\/+!!\/.*/, "$1"),
				can_head: false // 403
			};
		}
		if (domain === "cache.willhaben.at") return src.replace(/(\/mmo\/.*[0-9]+)_(?:hoved|large|thumb)(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "img-dpreview.com") {
			if (/\/resources\/+images\/+play-overlay-icon\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+files\/+w\/+[^/?]+\?(?:.*&)?url=([^&]+).*?$/, "$1");
			newsrc = src.replace(/(\/files\/g\/)TS\d+x\d+~(\d+\.)/, "$1$2");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			return src.replace(/(\/files\/+p\/+)(?:E~)?[^/~]+~([^/~]+\/+)/, "$1$2");
		}
		if (domain_nowww === "artsphere.fr") return src.replace(/(\/cache\/+media\/+[0-9]+\/+image\/+)[0-9]+x[0-9]+_/, "$1");
		if (domain === "p.zvezda.photo") return src.replace(/(\/contents\/+pics\/+[0-9]+\/+[0-9]+\/+)[0-9]+x[0-9]+\/+1(\.[^/.]+)(?:[?#].*)?$/, "$1preview$2");
		if (amazon_container === "speakerd") {
			return src.replace(/\/preview_(slide_[0-9]+\.[^/.]+)(?:[?#].*)?$/, "/$1");
		}
		if (domain === "peertube.linuxrocks.online" ||
			domain_nowww === "peertube.live" ||
			domain_nowww === "peertube.video" ||
			domain_nowww === "peertube.nocturlab.fr" ||
			domain === "peertube.debian.social" ||
			domain_nowww === "bittube.video" ||
			domain_nowww === "toobnix.org" ||
			domain === "pt.pube.tk" ||
			domain_nowww === "framatube.org" ||
			domain === "peertube.gegeweb.eu" ||
			domain === "peer.hostux.social" ||
			domain_nowww === "banneddata.me" ||
			domain === "tube.midov.pl" ||
			domain === "vault.mle.party" ||
			domain_nowww === "skeptikon.fr" ||
			domain_nowww === "peertube.parleur.net" ||
			domain_nowww === "open.tube" ||
			domain === "peertube.umeahackerspace.se" ||
			domain === "tube.rebellion.global" ||
			domain === "video.lewd.host" ||
			domain_nowww === "nocensoring.net" ||
			domain_nowww === "peertube.co.uk" ||
			domain === "tube.aquilenet.fr" ||
			domain === "peertube.datagueule.tv" ||
			domain === "video.antopie.org" ||
			domain === "pt.kircheneuenburg.de" ||
			domain === "devtube.dev-wiki.de" ||
			domain === "porntube.ddns.net" ||
			domain_nowww === "peertube.su" ||
			domain === "yt.is.nota.live" ||
			domain_nowww === "viid.ga" ||
			domain_nowww === "diode.zone" ||
			domain_nowww === "scitech.video" ||
			domain_nowww === "greatview.video" ||
			domain === "peertube.iriseden.eu" ||
			domain === "tube.govital.net" ||
			domain === "video.colibris-outilslibres.org" ||
			domain_nowww === "libre.tube" ||
			domain_nowww === "vidcommons.org" ||
			domain_nowww === "spacepub.space" ||
			domain === "video.gafamfree.party" ||
			domain_nowww === "troo.tube" ||
			domain === "video.ploud.fr" ||
			domain === "tube.ac-lyon.fr" ||
			domain === "peertube.librelabucm.org" ||
			domain === "video.writeas.org" ||
			domain_nowww === "conf.tube" ||
			domain === "peertube.anarchmusicall.net" ||
			domain_nowww === "lostpod.space" ||
			domain === "peertube.alter-nativ-voll.de" ||
			domain === "videos.ac-nancy-metz.fr" ||
			domain === "tube.fabrigli.fr" ||
			domain === "videos.domainepublic.net" ||
			domain === "videos.pueseso.club" ||
			domain === "tube.azbyka.ru" ||
			domain === "videos.pair2jeux.tube" ||
			domain_nowww === "yiny.org" ||
			domain_nowww === "pony.tube" ||
			domain === "peertube.dsmouse.net" ||
			domain === "tube-versailles.beta.education.fr" ||
			domain === "video.tedomum.net" ||
			domain === "peertube.lyceeconnecte.fr" ||
			domain_nowww === "xxxporn.co.uk" ||
			domain === "peertube.ricostrongxxx.com" ||
			domain === "videos.upr.fr" ||
			domain_nowww === "peertube.uno" ||
			domain_nowww === "alttube.fr" ||
			domain === "video.maga.host" ||
			domain === "video.hardlimit.com" ||
			domain === "peertube.cpy.re") {
			var query_peertube_api = function(api_url, referer_url, vidid, cb) {
				var cache_key = "peertube:" + vidid;
				api_query(cache_key, {
					url: urljoin(api_url, "/videos/" + vidid, false),
					headers: {
						Accept: "application/json, text/plain, */*",
						Referer: referer_url
					},
					json: true
				}, cb, function(done, json, cache_key) {
					var obj = {};
					obj.extra = {
						page: urljoin(api_url, json.embedPath, true),
						caption: json.name,
						created_date: new Date(json.createdAt).getTime(),
						updated_date: new Date(json.updatedAt).getTime()
					};
					var files = json.files;
					var urls = [];
					if (files.length === 0) {
						if ("streamingPlaylists" in json && json.streamingPlaylists.length > 0 && json.streamingPlaylists[0].files.length > 0) {
							files = json.streamingPlaylists[0].files;
							if (json.streamingPlaylists[0].playlistUrl) {
								urls.push({
									url: json.streamingPlaylists[0].playlistUrl,
									video: "hls"
								});
							}
						}
					}
					files.sort(function(a, b) {
						return b.size - a.size;
					});
					for (var _i = 0, files_1 = files; _i < files_1.length; _i++) {
						var file = files_1[_i];
						urls.push({
							url: file.fileUrl, // or fileDownloadUrl?
							video: true
						});
					}
					if (json.thumbnailPath)
						urls.push(urljoin(api_url.replace(/\/api\/+v1\//, "/"), json.thumbnailPath));
					console_log(urls);
					if (urls.length) {
						return done(fillobj_urls(urls, obj), 6 * 60 * 60);
					} else {
						console_warn(cache_key, "Unable to find files from", json);
					}
					return done(null, false);
				});
			};
			var get_peertube_urlinfo = function(url) {
				var pagelink = false;
				var match = url.match(/(.*)\/static\/+(?:previews|thumbnails|webseed)\/+([0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12})(?:-[0-9]+)?\.[^/.]+(?:[?#].*)?$/);
				if (!match) {
					match = url.match(/(.*)\/videos\/+watch\/+([0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12})(?:[?#].*)?$/);
					pagelink = true;
				}
				if (!match) {
					match = url.match(/(.*)\/w\/+([0-9a-zA-Z]{22})(?:[?#].*)?$/);
					pagelink = true;
				}
				if (!match)
					return null;
				return {
					id: match[2],
					referer: match[1],
					api: match[1] + "/api/v1/",
					pagelink: pagelink
				};
			};
			var info = get_peertube_urlinfo(src);
			if (info) {
				var cb = function(data) {
					if (!data)
						return options.cb(data);
					if (info.pagelink) {
						data.push({ url: src, is_pagelink: true });
					}
					return options.cb(data);
				};
				if (options.do_request && options.cb) {
					query_peertube_api(info.api, info.referer, info.id, cb);
					return {
						waiting: true
					};
				} else if (info.pagelink) {
					return {
						url: src,
						is_pagelink: true
					};
				}
			}
		}
		if (domain_nosub === "ftcdn.net") {
			match = src.match(/:\/\/[^/]+\/+(?:v2\/+)?[^/]+\/+(?:[0-9]{2}\/+){4}([0-9]+)_F_([0-9]+)_[^/_.]+\.[^/.]+(?:[?#].*)?$/);
			if (match) {
				id = match[2];
				regex = /(:\/\/[^/]+\/+(?:v2\/+)?[^/]+\/+(?:[0-9]{2}\/+){4})[0-9]+(_F_[0-9]+_[^/_.]+\.[^/.]+)(?:[?#].*)?$/;
				newsrc = src;
				if (match[1] === "160" || match[1] === "240") {
					newsrc = src.replace(regex, "$1360$2");
				} else if (match[1] === "500") {
					newsrc = src.replace(regex, "$11000$2");
				}
				return {
					url: newsrc,
					extra: {
						page: "https://stock.adobe.com/" + id
					}
				};
			}
		}
		if (domain_nowww === "popoholic.com") return src.replace(/(:\/\/[^/]+\/+)(images[0-9]+\/+)/, "$1big$2");
		if (domain === "pictures.abebooks.com") return src.replace(/(\/[^/]+\/+)md\/+md([0-9]+(?:_[0-9]+)?\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "content.ngv.vic.gov.au") {
			newsrc = src.replace(/\/col-images\/+([a-z]+)\/+([^/.]+)\.[^/.]+(?:[?#].*)?$/, "/col-images/api-talks/$2/$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/col-images\/+api(?:-talks)?\/+[^/]+)(?:\/+(?:1280|x{1,3}l|large|medium|small))?(?:[?#].*)?$/, "$1/1920");
			if (newsrc !== src)
				return newsrc;
			if (/^[a-z]+:\/\/[^/]+\/+retrieve.php\?/.test(src)) {
				var queries = get_queries(src);
				if (!queries.size || array_indexof(["1280", "xxxl", "xxl", "xl", "large", "medium", "small"], queries.size) >= 0)
					return add_queries(src, { "size": "1920" });
			}
		}
		if (domain_nowww === "ilmessaggero.it") return src.replace(/(\/(?:photogallery_img|photos)\/+)MED\/+/, "$1HIGH/");
		if (domain === "cdn.spinrilla.com") return src.replace(/(\/albums\/+[0-9]+\/+)[a-z]+\/+/, "$1original/");
		if (domain === "community.amd.com") return src.replace(/(\/servlet\/+JiveServlet\/+downloadImage\/+[-0-9]+\/+)[0-9]+-[0-9]+\/+/, "$1");
		if (domain === "logincdn.msauth.net") {
			if (/\/content\/+images\/+backgrounds\//.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "dreamstime.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+[-a-z]*([0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://www.dreamstime.com/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<script type="application\/ld\+json">({.*?})<\/script>/);
					if (!match) {
						console_error(cache_key, "Unable to find match in", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					var obj = {
						extra: {
							page: resp.finalUrl,
							caption: json.description || json.name
						}
					};
					var urls = [];
					if (json.contentUrl || json.url) {
						urls.push({
							url: json.contentUrl || json.url,
							problems: { watermark: true }
						});
					}
					if (json.thumbnail) {
						urls.push({
							url: json.thumbnail,
							problems: { smaller: true }
						});
					}
					done(fillobj_urls(urls, obj), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "thumbs.dreamstime.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+[a-z]\/+[^/]+-([0-9]+)\.[^/.]+(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://www.dreamstime.com/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "vgm.io" && /^(?:thumb|medium)-media\./.test(domain)) {
			return src.replace(/:\/\/[a-z]+-(media\.[^/]+\/+)/, "://$1");
		}
		if (domain_nowww === "vgmdb.net") {
			if (/\/db\/+img\/+vgmdbnav\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "old-games.ru") return src.replace(/\/thumbs\/+thumb_/, "/screenshots/");
		if (domain === "cdn-prod.scalefast.com") return src.replace(/(:\/\/[^/]+\/+)resize\/+[-0-9]+x[-0-9]+\/+(public\/+)/, "$1$2");
		if (domain === "cdn.mp3-lemon.ru" ||
			domain_nowww === "mp3cleo.ru") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:image|[0-9]+)\/+([^-_/.]{30,}?)\.[^/.]+(?:[?#].*)?$/);
			if (match) {
				try {
					newsrc = base64_decode(match[1]);
					newsrc = newsrc.replace(/(\/\/:s?ptth)[^/]{0,10}$/, "$1");
					return reverse_str(newsrc);
				} catch (e) {
					console_error(e);
				}
			}
		}
		if (domain_nowww === "banzaj.pl") return src.replace(/(\/pictures\/.*\/)THUMBS\/+THUMB_/, "$1");
		if (domain === "dyw7ncnq1en5l.cloudfront.net" ||
			(domain_nosub === "lesnumeriques.com" && /^img[0-9]*\./.test(domain))) {
			newsrc = src.replace(/\/optim\/+(article\/+[0-9/]+\/+[^/]+?)(?:_png)?__(?:w[0-9]+|[0-9]+_[0-9]+)(?:__overflow)?(\.[^/.]+)(?:[?#].*)?$/, "/$1$2");
			if (newsrc !== src)
				return add_full_extensions(newsrc);
		}
		if (domain === "dcg0nv7t7dovn.cloudfront.net" ||
			domain === "d6ijsqg8e9unz.cloudfront.net") {
			var parse_buybox_url = function(url) {
				var match = url.match(/\/userUploads\/+[^/]+\/+([^/]+)\/+(?:(?:[a-zA-Z]+Images|thumbnails)\/+)?(?:[a-z]_)?([0-9]{5,})-[^/.]+\.[^/.]+(?:[?#].*)?$/);
				if (match) {
					return {
						boxid: match[1],
						imgid: match[2] // incorrect
					};
				}
				return null;
			};
			var get_buybox_url_from_id = function(boxid) {
				return "https://bentbox.co/buybox_paysafe?" + boxid;
			};
			var query_bentbox_buybox = function(boxid, imgid, cb) {
				api_query("bentbox_buybox:" + boxid + ":" + imgid, {
					url: get_buybox_url_from_id(boxid)
				}, cb, function(done, resp, cache_key) {
					var match = resp.responseText.match(/<link rel="image_src" href="([^"]+)"/);
					if (match) {
						var newurl = match[1];
						var parsed = parse_buybox_url(newurl);
						if (parsed && parsed.boxid === boxid && parsed.imgid === imgid) {
							return done({
								url: newurl,
								extra: {
									page: resp.finalUrl
								}
							}, 60 * 60);
						} else {
							console_warn("Wrong image:", newurl);
						}
					} else {
						console_warn("Unable to find match for", resp);
					}
					return done(null, false);
				});
			};
			var parsed_url = parse_buybox_url(src);
			if (parsed_url) {
				if (false) {
					query_bentbox_buybox(parsed_url.boxid, parsed_url.imgid, options.cb);
					return {
						waiting: true
					};
				}
				return {
					url: src,
					extra: {
						page: get_buybox_url_from_id(parsed_url.boxid)
					}
				};
			}
		}
		if (host_domain_nowww === "nintendo.com" && options.element) {
			if (options.element.tagName.toLowerCase() === "svg" && options.element.classList.toString().match(/^icon-/)) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
		}
		if (domain_nosub === "vndb.org" && /^s[0-9]*\./.test(domain)) {
			return src.replace(/(:\/\/[^/]+\/+)st\/+/, "$1sf/");
		}
		if (domain_nowww === "gamefabrique.com") {
			return src
				.replace(/(\/images\/+video\/+)([^/]+)(?:[?#].*)?$/, "$1original/$2")
				.replace(/(:\/\/[^/]+\/+)(screenshots\/.*)\.jpg(?:[?#].*)?$/, "$1storage/$2.png");
		}
		if (domain_nowww === "rorax.com") {
			newsrc = src.replace(/(\/img\/+[0-9]+\/+)(?:small|medium)\/+/, "$1large/");
			if (newsrc !== src)
				return {
					url: newsrc,
					problems: {
						possibly_upscaled: true
					}
				};
		}
		if (domain === "img.5nd.com") {
			return src.replace(/(:\/\/[^/]+\/+)[0-9]+\/+photo\/+/i, "$1Photo/");
		}
		if (domain === "d1bm3dmew779uf.cloudfront.net") return src.replace(/(:\/\/[^/]+\/+)(?:small|medium|large)\/+/, "$1original/");
		if (domain === "cache.hkgolden.media") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+compress\/+(https?:\/\/)/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "hosted.mplstudios.com") {
			return [
				src.replace(/(\/galleries\/+[0-9]+\/+[^/]+\/+)(?:150|1024)\/+/, "$11200/"),
				src.replace(/(\/galleries\/+[0-9]+\/+[^/]+\/+)(?:150)\/+/, "$11024/")
			];
		}
		if (domain_nowww === "mplstudios.com") return src.replace(/(\/models\/+[0-9]+\/+samples\/+[0-9]+\/+sample\/+[0-9]+(?:v[0-9]+)?)_[1-2]?[0-9]{3}\./, "$1_3000.");
		if (domain_nowww === "alscash.com") return src.replace(/(\/FHGA\/+[^/]+\/+[^/]+[0-9]+)s(\.[^?#].*)?$/, "$1$2");
		if (domain_nowww === "x18.xxx") return src.replace(/\/media\/+photos\/+tmb(?:_new)?\/+/, "/media/photos/");
		if ((domain_nosub === "iceppsn.com" ||
			domain_nosub === "iceporn.com" ||
			domain_nosub === "nvdst.com" ||
			domain_nosub === "nuvid.com" ||
			domain_nosub === "tbnpsn.com" ||
			domain_nosub === "tubeon.com" ||
			domain_nosub === "drtst.com" ||
			domain_nowww === "drtuber.com" ||
			domain_nosub === "hdpsn21.com" ||
			domain_nowww === "hd21.com" ||
			domain_nosub === "wnppsn.com" ||
			domain_nowww === "winporn.com" ||
			domain_nosub === "pornlib.com" ||
			domain_nosub === "plibcdn.com" ||
			domain_nosub === "vptpsn.com" ||
			domain_nosub === "viptube.com") && options.do_request && options.cb) {
			newsrc = src.replace(/\/media\/+photos\/+tmb(?:_new)?\/+/, "/media/photos/");
			if (newsrc !== src)
				return newsrc;
			var query_iceporn_vid = function(domain, aid, id, cb) {
				api_query(domain + ":" + id, {
					url: "https://www." + domain + "/player_config_json/?vid=" + id + "&aid=" + aid + "&domain_id=0&embed=0&ref=null&check_speed=0",
					headers: {
						Referer: "https://www." + domain + "/"
					}
				}, cb, function(done, resp, cache_key) {
					try {
						var json = JSON_parse(resp.responseText);
						done(json, 60 * 60);
					} catch (e) {
						console_error(cache_key, e);
						done(null, false);
					}
				});
			};
			var get_obj_from_iceporn_vid = function(vidobj) {
				var baseobj = {
					headers: {
						Referer: vidobj.url || "https://www.iceporn.com/"
					},
					extra: {}
				};
				var urls = [];
				if (vidobj.title) {
					baseobj.extra.caption = vidobj.title;
				}
				if (vidobj.url) {
					baseobj.extra.page = vidobj.url;
				}
				if (vidobj.files) {
					if (vidobj.files.hq) {
						urls.push({
							url: vidobj.files.hq,
							video: true
						});
					} else if (vidobj.files.lq) {
						urls.push({
							url: vidobj.files.lq,
							video: true
						});
					}
				}
				if (vidobj.poster) {
					urls.push(vidobj.poster);
				}
				return fillobj_urls(urls, baseobj);
			};
			page_nullobj = null;
			var get_iceporn_id_from_url = function(url) {
				var match = url.match(/\/media\/+videos\/+tmb\/+([0-9]+)\/+/);
				if (match) {
					return match[1];
				}
				match = url.match(/^[a-z]+:\/\/[^/]+\/+(?:embed|video)\/+(?:[-a-z0-9]+-)?([0-9]+)(?:\/+[^/]*)?(?:[?#].*)?$/);
				if (match) {
					page_nullobj = {
						url: src,
						is_pagelink: true
					};
					return match[1];
				}
				return null;
			};
			var iceporn_domain, iceporn_aid;
			if (domain_nosub === "iceppsn.com" || domain_nosub === "iceporn.com") {
				iceporn_domain = "iceporn.com";
				iceporn_aid = 6;
			} else if (domain_nosub === "vptpsn.com" || domain_nosub === "viptube.com") {
				iceporn_domain = "viptube.com";
				iceporn_aid = 2;
			} else if (domain_nosub === "nvdst.com" || domain_nosub === "nuvid.com") {
				iceporn_domain = "nuvid.com";
				iceporn_aid = 2;
			} else if (domain_nosub === "tbnpsn.com" || domain_nosub === "tubeon.com") {
				iceporn_domain = "tubeon.com";
				iceporn_aid = 591;
			} else if (domain_nosub === "drtst.com" || domain_nosub === "drtuber.com") {
				iceporn_domain = "drtuber.com";
				iceporn_aid = 3029;
			} else if (domain_nosub === "hdpsn21.com" || domain_nosub === "hd21.com") {
				iceporn_domain = "hd21.com";
				iceporn_aid = 591;
			} else if (domain_nosub === "wnppsn.com" || domain_nosub === "winporn.com") {
				iceporn_domain = "winporn.com";
				iceporn_aid = 591;
			} else if (domain_nosub === "pornlib.com" || domain_nosub === "plibcdn.com") {
				iceporn_domain = "pornlib.com";
				iceporn_aid = 0;
			}
			id = get_iceporn_id_from_url(src);
			if (id) {
				query_iceporn_vid(iceporn_domain, iceporn_aid, id, function(data) {
					if (!data)
						return options.cb(page_nullobj);
					var obj = get_obj_from_iceporn_vid(data);
					if (!is_array(obj))
						obj = [obj];
					if (page_nullobj)
						obj.push(page_nullobj);
					return options.cb(obj);
				});
				return {
					waiting: true
				};
			}
		}
		if (domain_nowww === "anime789.com" ||
			domain_nowww === "javto.stream" ||
			domain_nowww === "javcl.me" ||
			domain_nowww === "cdn-myhdjav.info" ||
			domain_nowww === "ffem.club" ||
			domain_nowww === "javhub.pro" ||
			domain_nowww === "javlove.club" ||
			domain_nowww === "mm9841.com" ||
			domain_nowww === "iframejav.com" ||
			domain_nowww === "xvideosrss.com" ||
			domain_nowww === "fembed.com" ||
			domain_nowww === "femax20.com" ||
			domain === "thumb.fvs.io" ||
			domain_nowww === "feurl.com" ||
			domain_nowww === "luxubu.review" ||
			domain_nowww === "javlove.club" ||
			domain_nowww === "pelispng.online" ||
			domain_nowww === "sexhd.co" ||
			domain_nowww === "playvideo.best") {
			var base_domain = domain_nosub;
			if (domain_nowww === "fembed.com" ||
				domain === "thumb.fvs.io") {
				base_domain = "feurl.com";
			}
			var query_fvs_vid = function(id, cb) {
				api_query("fvs:" + id, {
					url: "https://" + base_domain + "/api/source/" + id,
					method: "POST",
					data: "r=&d=" + base_domain,
					headers: {
						Origin: "https://" + base_domain,
						Referer: "https://" + base_domain + "/"
					}
				}, cb, function(done, resp, cache_key) {
					try {
						var json = JSON_parse(resp.responseText);
						done(json, 60 * 60);
					} catch (e) {
						console_error(cache_key, e);
						done(null, false);
					}
				});
			};
			var get_obj_from_fvs = function(json) {
				if (!json || !json.data)
					return null;
				var max = 0;
				var maxobj = null;
				for (var i = 0; i < json.data.length; i++) {
					var ourdata = json.data[i];
					if (!ourdata.label || !ourdata.file)
						continue;
					var oursize = parseInt(ourdata.label);
					if (oursize > max) {
						max = oursize;
						maxobj = ourdata;
					}
				}
				if (maxobj) {
					return {
						url: maxobj.file,
						video: true,
						is_private: true // linked to ip range
					};
				} else {
					return null;
				}
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+v\/+([-_a-z0-9]{5,})(?:\.[^/.]+)?(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					query_fvs_vid(id, function(data) {
						cb(get_obj_from_fvs(data));
					});
				}
			});
			if (newsrc)
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+asset\/+userdata\/+[0-9]+\/+poster\/+[^/]\/+[^/]{2}\/+([-_a-z0-9]{5,})(?:\.[^/.]+)?(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://" + base_domain + "/v/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "dailymotion.com") {
			var query_dm_playermetadata = function(id, cb) {
				api_query("dailymotion:" + id, {
					url: "https://www.dailymotion.com/player/metadata/video/" + id,
					headers: {
						Referer: "https://www.dailymotion.com/video/" + id,
						Accept: "application/json, text/plain, */*"
					},
					json: true
				}, cb, function(done, resp) {
					return done(resp, 60 * 60);
				});
			};
			var get_obj_from_dm_playermeta = function(data) {
				if (!data)
					return page_nullobj;
				var obj = { extra: {} };
				var urls = [];
				if (data.title)
					obj.extra.caption = data.title;
				if (data.url)
					obj.extra.page = data.url;
				if (data.qualities && data.qualities.auto && data.qualities.auto[0] && data.qualities.auto[0].type === "application/x-mpegURL") {
					urls.push({
						url: data.qualities.auto[0].url,
						video: "hls",
						headers: {
							Referer: obj.extra.page
						}
					});
				}
				if (data.posters) {
					var max = 0;
					for (var size in data.posters) {
						if (size > max) {
							max = size;
						}
					}
					if (max in data.posters) {
						urls.push(data.posters[max]);
					}
				}
				return fillobj_urls(urls, obj);
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([a-z0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					id = match[1];
					query_dm_playermetadata(id, function(data) {
						cb(get_obj_from_dm_playermeta(data));
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "dmcdn.net" && options.element) {
			newsrc = common_functions["get_pagelink_el_matching"](options.element, /^https?:\/\/(?:www\.)?dailymotion\.com\/+video\/+([a-z0-9]+)(?:[?#].*)?$/);
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "dailymotion.com") {
			newsrc = common_functions["get_pagelink_host_el_matching"](options, {
				url_match: /^https?:\/\/(?:www\.)?dailymotion\.com\/+video\/+([a-z0-9]+)(?:[?#].*)?$/,
				el_match: function(x) {
					return x.id === "player-body";
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "img.vxdn.net") return src.replace(/(:\/\/[^/]+\/+[a-z]-max\/+)[0-9]+\/+/, "$10/");
		if (domain === "content.adultwork.com") return src.replace(/(:\/\/[^/]+\/+ci\/+)[ti]\/+/, "$1f/");
		if (domain_nowww === "tunestream.net") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+embed-([a-z0-9]{5,})\.html(?:[?#].*)?$/);
			if (match) {
				id = match[1];
				var query_jwplayer = function(url, cb) {
					api_query("jwplayer:" + url, {
						url: url
					}, cb, function(done, resp, cache_key) {
						var match = resp.responseText.match(/jwplayer\(.*?\)\.setup\({[\s\S]*?sources:\s*(\[.*?\]),/);
						if (!match) {
							console_error(cache_key, "Unable to find match for", resp);
							return done(null, false);
						}
						var json_text = match[1];
						json_text = json_text.replace(/([[{,])([a-z]+):/g, "$1\"$2\":");
						console_log(json_text);
						var json = JSON_parse(json_text);
						var urls = [];
						for (var i = 0; i < json.length; i++) {
							if (!json[i].file) {
								console_warn("Unable to process", json[i]);
								continue;
							}
							var our_obj = {
								url: json[i].file,
								headers: {
									Origin: "https://" + domain_nosub,
									Referer: url,
									"Sec-Fetch-Dest": "empty",
									"Sec-Fetch-Site": "same-site",
									"Sec-Fetch-Mode": "cors",
									"Accept": "*/*"
								}
							};
							if (json[i].label) {
								our_obj.size = parseInt(json[i].label) || 0;
							}
							if (/\.m3u8(?:[?#].*)?$/.test(json[i].file)) {
								our_obj.video = "hls";
							}
							urls.push(our_obj);
						}
						urls.sort(function(a, b) {
							if (a.size && b.size)
								return a.size - b.size;
							if (a.video === b.video)
								return 0;
							if (a.video === "hls")
								return 1;
							else if (b.video === "hls")
								return -1;
							return 0;
						});
						for (var i = 0; i < urls.length; i++) {
							delete urls[i].size;
						}
						urls.push({
							url: url,
							is_pagelink: true
						});
						done(urls, 60 * 60);
					});
				};
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				if (options.do_request && options.cb) {
					query_jwplayer(src, options.cb);
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if (domain_nowww === "mightyupload.com" ||
			domain_nowww === "upstream.to" ||
			domain_nowww === "clicknplay.to" ||
			domain_nowww === "streamsb.net") {
			if (/\/assets\/+images\/+bg-[0-9]+\.svg(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+embed-([a-z0-9]{12})(?:-[0-9]+x[0-9]+)?\.html(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+([a-z0-9]{12})(?:[?#].*)?$/,
				],
				query_for_id: "https://" + domain + "/embed-${id}.html",
				process: function(done, resp, cache_key) {
					var unpacked = common_functions["unpack_packer"](resp.responseText);
					if (!unpacked) {
						console_error(cache_key, "Unable to find packed data for", resp);
						return done(null, false);
					}
					var match = unpacked.match(/jwplayer\(.*?\)\.setup\({[\s\S]*?file:\s*"([^"]+)"[,}]/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp, unpacked);
						return done(null, false);
					}
					var videotype = true;
					var videourl = match[1];
					if (/\.m3u8/.test(videourl))
						videotype = "hls";
					return done({
						url: videourl,
						headers: {
							Origin: "https://" + domain,
							Referer: "https://" + domain + "/"
						},
						video: videotype
					}, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "upstreamcdn.co" && /^s[0-9]*\./.test(domain)) {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+i\/+[0-9]{2}\/+[0-9]+\/+([0-9a-z]{12})\./);
			if (match)
				return {
					url: "https://upstream.to/embed-" + match[1] + ".html",
					is_pagelink: true
				};
		}
		if (domain_nowww === "youdbox.net") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+embed-([0-9a-z]{12})(?:-[0-9]+x[0-9]+)?\.html(?:[?#].*)?$/,
				query_for_id: "https://youdbox.net/embed-${id}.html",
				process: function(done, resp, cache_key) {
					match = resp.responseText.match(/var [0-9a-zA-Z]+ *= *\[("\\x3b"(?:,"\\x[0-9a-f]{2}")+)\]/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var hex = match[1].replace(/[^0-9a-f]/g, "");
					var code = reverse_str(hex_to_ascii(hex));
					match = code.match(/<source src="([^"]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find source match for", { resp: resp, code: code });
						return done(null, false);
					}
					return done({
						url: match[1],
						video: true
					}, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "youdbox.net" && /^bin[0-9]*\./.test(domain)) {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+i\/+[0-9]+\/+([0-9a-z]{12})\./);
			if (match)
				return {
					url: "https://youdbox.net/embed-" + match[1] + ".html",
					is_pagelink: true
				};
		}
		if (domain_nowww === "videyo.net") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+embed-([0-9a-z]{12})\.html(?:[?#].*)?$/,
				query_for_id: "https://videyo.net/embed-${id}.html",
				process: function(done, resp, cache_key) {
					var unpacked = common_functions["unpack_packer"](resp.responseText);
					if (!unpacked) {
						console_error(cache_key, "Unable to find packed data for", resp);
						return done(null, false);
					}
					var hola_sources = common_functions["get_holaplayer_sources"](unpacked);
					if (!hola_sources) {
						console_error(cache_key, "Unable to find sources for", resp, unpacked);
						return done(null, false);
					}
					var obj = common_functions["get_obj_from_videosources"](resp.finalUrl, hola_sources);
					return done(obj, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "i.videyo.net") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+([a-z0-9]{12})[0-9]{4}\.[^/.]+(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://videyo.net/embed-" + match[1] + ".html",
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "gounlimited.to") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:embed-)?([0-9a-z]{5,})\.html(?:[?#].*)?$/,
				query_for_id: "https://gounlimited.to/embed-${id}.html",
				process: function(done, resp, cache_key) {
					var unpacked = common_functions["unpack_packer"](resp.responseText);
					if (!unpacked) {
						console_error(cache_key, "Unable to find packed data for", resp);
						return done(null, false);
					}
					var match = unpacked.match(/{player\.src\((\[{.*?}\])\)}/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp, unpacked);
						return done(null, false);
					}
					var json = JSON_parse(fixup_js_obj(match[1]));
					sort_by_key(json, "res");
					var baseobj = {
						headers: {
							Referer: resp.finalUrl
						}
					};
					var urls = [];
					for (var i = 0; i < json.length; i++) {
						urls.push({
							url: json[i].src,
							video: true
						});
					}
					return done(fillobj_urls(urls, baseobj), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "vidello.net") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:embed-)?([0-9a-z]{5,})\.html(?:[?#].*)?$/,
				query_for_id: {
					url: "https://" + domain + "/embed-${id}.html",
					headers: {
						"Referer": "https://dirtyships.net/",
						"Sec-Fetch-Dest": "iframe",
						"Sec-Fetch-Mode": "navigate",
						"Sec-Fetch-Site": "cross-site"
					},
					imu_mode: "document"
				},
				process: function(done, resp, cache_key) {
					var unpacked = common_functions["unpack_packer"](resp.responseText);
					if (!unpacked) {
						console_error(cache_key, "Unable to find packed data for", resp);
						return done(null, false);
					}
					var match = unpacked.match(/sources:\[{src:("[^"]+")/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp, unpacked);
						return done(null, false);
					}
					var videourl = JSON_parse(match[1]);
					return done({
						url: videourl,
						video: "hls"
					}, 50 * 60); // expiry time is 3600
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "static.kritikustomeg.org") return src.replace(/\/pix\/+tn[0-9]+x[0-9]+\/+/, "/pix/orig/");
		if (amazon_container === "kinorium-images") {
			if (/\/web\/+blank\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (host_domain_nowww === "jizzbunker.com" && options.element) {
			if (protocol === "data" && options.element.tagName === "A") {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "xxxdan.com" ||
			domain_nowww === "jizzbunker.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([A-Za-z0-9]+)\/+[^/]+\.html(?:[?#].*)?$/,
				query_for_id: "https://www." + domain_nowww + "/${id}/a.html",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/sources\.push\({(?:.*,)?\s*src:\s*["']([^'"]+)["']/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var url = match[1];
					var obj = {
						url: url,
						headers: {
							Referer: resp.finalUrl
						}
					};
					var our_regex = new RegExp("<a href=\"(https://[^/]+/+" + id + "/+[^/]+\\.html)\".*?title=\"([^\"]+)\"");
					var match1 = resp.responseText.match(our_regex);
					if (match1) {
						obj.extra = {
							page: match1[1],
							caption: match1[2]
						};
					}
					done(obj, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "cdn3x.com" && /^[tv][0-9]*\./.test(domain)) {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(xd|t)\/+(?:[0-9]+(?:x[0-9]+)?\/+)?([A-Za-z0-9]+)\/+[^/]+(?:[?#].*)?$/);
			if (match) {
				var site = match[1];
				id = match[2];
				var sites = {
					xd: "https://www.xxxdan.com/",
					t: "https://www.jizzbunker.com/"
				};
				return {
					url: sites[site] + id + "/a.html",
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "spankwire.com") {
			var query_spankwire = function(vid, cb) {
				api_query("spankwire:" + vid, {
					url: "https://www.spankwire.com/api/video/" + vid + ".json",
					headers: {
						"Accept": "application/json, text/plain, */*, image/webp",
						"Referer": "https://www.spankwire.com/EmbedPlayer.aspx/?ArticleId=" + vid + "&autostart=true"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					if (resp.HLS && resp.title && resp.videos)
						return done(resp, 60 * 60);
					console_log(cache_key, "Invalid json", resp);
					return done(null, false);
				});
			};
			var spankwire_to_obj = function(data) {
				if (!data) {
					return null;
				}
				var baseobj = {
					headers: {
						"Referer": "https://www.spankwire.com/"
					},
					extra: {}
				};
				if (data.url) {
					baseobj.extra.page = urljoin("https://www.spankwire.com/", data.url, true);
				}
				if (data.title) {
					baseobj.extra.caption = data.title;
				}
				var urls = [];
				if (data.HLS) {
					urls.push({
						url: data.HLS,
						video: "hls"
					});
				}
				if (data.videos) {
					var max = 0;
					var maxobj = null;
					for (var key in data.videos) {
						var key_match = key.match(/^quality_([0-9]+)p$/);
						if (!key_match)
							continue;
						var quality = parseInt(key_match[1]);
						if (quality > max) {
							max = quality;
							maxobj = data.videos[key];
						}
					}
					if (maxobj) {
						urls.push({
							url: maxobj,
							video: true
						});
					}
				}
				return fillobj_urls(urls, baseobj);
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+[^/]+\/+video([0-9]+)(?:\/.*)?(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					query_spankwire(id, function(data) {
						cb(spankwire_to_obj(data));
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "keezmovies.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+(?:[^/?#.]+-)?([0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://www.keezmovies.com/video/${id}",
				process: function(done, resp, cache_key) {
					var flashvars = resp.responseText.match(/window\.flashvars\s*=\s*({.*?});/);
					if (!flashvars) {
						console_error(cache_key, "Unable to find match", resp);
						return done(null, false);
					}
					var data = JSON_parse(flashvars[1]);
					var baseobj = {
						extra: {},
						headers: {
							"Referer": "https://www.keezmovies.com/"
						}
					};
					if (data.link_url) {
						baseobj.extra.page = data.link_url;
					}
					if (data.video_title) {
						baseobj.extra.caption = data.video_title;
					}
					var max = 0;
					var maxobj = null;
					for (var key in data) {
						var key_match = key.match(/^quality_([0-9]+)p$/);
						if (!key_match)
							continue;
						var quality = parseInt(key_match[1]);
						if (quality > max) {
							max = quality;
							maxobj = data[key];
						}
					}
					var urls = [];
					if (maxobj) {
						urls.push({
							url: maxobj,
							video: true
						});
					}
					if (data.image_url) {
						urls.push(data.image_url);
					}
					done(fillobj_urls(urls, baseobj), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "spankcdn.net") {
			match = src.match(/\/[0-9]{6}\/+[0-9]{1,2}\/+([0-9]+)\/+originals\/+/);
			if (!match) {
				match = src.match(/:\/\/[^/]+\/+[0-9]{6}\/+[0-9]{2}\/+([0-9]+)\/+preview_[0-9]+\./);
			}
			if (match) {
				id = match[1];
				newsrc = null;
				if (/keezmovies\./.test(domain)) {
					newsrc = "https://www.keezmovies.com/video/" + id;
				} else if (/spankwire\./.test(domain)) {
					newsrc = "https://www.spankwire.com/a/video" + id + "/";
				}
				if (newsrc) {
					return {
						url: newsrc,
						is_pagelink: true
					};
				}
			}
		}
		if (domain_nowww === "fapxl.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:view\/+movie\/+)?(?:embed|video)\/+([0-9]+)(?:\/+[^/]*)?(?:[?#].*)?$/,
				run: function(cb, match) {
					var vid = match[1];
					api_query("fapxl:" + vid, {
						url: "https://fapxl.com/view/movie/embedconfig/" + vid + "?ModPagespeed=off",
						headers: {
							Referer: "https://fapxl.com/"
						}
					}, cb, function(done, resp, cache_key) {
						var match = resp.responseText.match(/clip:\s*{\s*title:\s*("[^"]+"),\s*sources:\s*(\[[\s\S]+?\])\s*},/);
						if (!match) {
							console_error(cache_key, "Unable to find match for", resp);
							return done(null, false);
						}
						var title = JSON_parse(match[1]);
						var sources = match[2].replace(/\s([a-z]+)(:\s*")/g, " \"$1\"$2");
						var sources_json = JSON_parse(sources);
						done({
							url: sources_json[0].src,
							video: true,
							extra: {
								caption: title
							},
							headers: {
								Referer: "https://fapxl.com/"
							}
						}, 60 * 60);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "fapxl.com" && /^thumbs[0-9]*\./.test(domain)) {
			match = src.match(/\/media\/+(?:[0-9]\/+){1,5}([0-9]+)\/+/);
			if (match) {
				return {
					url: "https://fapxl.com/video/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "pornerbros.com" ||
			domain_nosub === "porntube.com" ||
			domain_nosub === "fux.com" ||
			domain_nosub === "4tube.com") {
			id = null;
			page_nullobj = null;
			var is_embed = false;
			match = src.match(/^[a-z]+:\/\/cdn[^/]+\/+((?:[0-9]\/+){2,})(?:[0-9]+x[0-9]+|preview)\/+/);
			if (match) {
				id = match[1].replace(/\/+/g, "");
			} else {
				match = src.match(/^[a-z]+:\/\/[^/]+\/+embed\/+([0-9]+)(?:[?#].*)?$/);
				if (match) {
					id = match[1];
					page_nullobj = {
						url: src,
						is_pagelink: true
					};
					is_embed = true;
				}
			}
			if (id) {
				var cache_prefix = domain_nosub + ":";
				var token_domain = "token." + domain_nosub;
				var query_pornerbros_embed = function(vid, cb) {
					api_query(cache_prefix + id + "_embed", {
						url: "https://www." + domain_nosub + "/embed/" + vid
					}, cb, function(done, resp, cache_key) {
						var match = resp.responseText.match(/window\.INITIALSTATE = '(.*?)';/);
						if (!match) {
							console_error(cache_key, "Unable to find initialstate match for", resp);
							return done(null, false);
						}
						var b64_decoded = base64_decode(match[1]);
						var decoded = decodeURIComponent(b64_decoded);
						var json_decoded = JSON_parse(decoded);
						return done(json_decoded, 60 * 60);
					});
				};
				var query_pornerbros_url = function(vid, cb) {
					api_query(cache_prefix + id, {
						url: "https://" + token_domain + "/" + vid + "/embeds/240+360+480+720+1080+1440+2160",
						method: "POST",
						headers: {
							"Accept": "application/json, text/plain, */*",
							"origin": "https://www." + domain_nosub,
							"referer": "https://www." + domain_nosub + "/",
							"Content-Length": "0",
							"Sec-Fetch-Site": "same-site"
						},
						json: true
					}, cb, function(done, resp, cache_key) {
						var urls = [];
						for (var key in resp) {
							var our_obj = resp[key];
							if (our_obj.status !== "success" || !our_obj.token)
								continue;
							var size = parseInt(key);
							if (!isNaN(size) && size > 0) {
								urls.push({
									url: our_obj.token,
									size: size
								});
							}
						}
						urls.sort(function(a, b) {
							return b.size - a.size;
						});
						for (var i = 0; i < urls.length; i++) {
							delete urls[i].size;
						}
						var baseobj = {
							headers: {
								Accept: "*/*",
								"Accept-Encoding": "identity;q=1, *;q=0",
								Referer: "https://www." + domain_nosub + "/",
								"Sec-Fetch-Dest": "video",
								"Sec-Fetch-Mode": "no-cors",
								"Sec-Fetch-Site": "same-site"
							},
							can_head: false
						};
						var newurls = fillobj_urls(urls, baseobj);
						if (page_nullobj)
							newurls.push(page_nullobj);
						return done(newurls, 60 * 60);
					});
				};
				if (options.do_request && options.cb) {
					if (is_embed) {
						query_pornerbros_embed(id, function(data) {
							if (data && data.video && data.video.mediaId) {
								id = data.video.mediaId;
							}
							query_pornerbros_url(id, options.cb);
						});
					} else {
						query_pornerbros_url(id, options.cb);
					}
					return {
						waiting: true
					};
				} else if (page_nullobj) {
					return page_nullobj;
				}
			}
		}
		if (domain_nosub === "eporner.com" && domain.match(/static-(?:[a-z]+-)?cdn\.eporner\.com/)) {
			newsrc = src
				.replace(/\/photos\/+([0-9]+)_[0-9]+x[0-9]+\./, "/photos/$1.")
				.replace(/\/photos\/+([0-9]+\/+[^/]+)-[0-9]+x[0-9]+\./, "/photos/$1.")
				.replace(/(\/gallery\/+(?:[^/]{2}\/+){2}[^/]+\/+[^/]+)_[0-9]+x[0-9]+\./, "$1.");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "eporner.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:(?:hd-porn|embed)\/+|video-)?([0-9a-zA-Z]+)(?:\/+.*)?(?:[?#].*)?$/);
			if (match) {
				id = match[1];
				var eporner_hash_mod = function(hash) {
					var output = "";
					for (var i = 0; i < 4; i++) {
						var section = hash.substring(i * 8, (i + 1) * 8);
						output += parseInt(section, 16).toString(36);
					}
					return output;
				};
				var query_eporner_api = function(data, cb) {
					if (!data) {
						return cb(page_nullobj);
					}
					api_query("eporner_api:" + data.vid, {
						url: "https://www.eporner.com/xhr/video/" + data.vid + "?hash=" + eporner_hash_mod(data.hash) + "&domain=www.eporner.com&fallback=false&embed=false&supportedFormats=dash,mp4",
						headers: {
							Referer: "https://www.eporner.com/",
							Accept: "*/*"
						},
						json: true
					}, cb, function(done, resp, cache_key) {
						if (resp.code !== 0 || resp.message) {
							console_error(cache_key, "Failed to load from eporner api", resp);
							return done(page_nullobj, false);
						}
						var baseobj = {
							headers: {
								Referer: "https://www.eporner.com/"
							}
						};
						urls = [];
						if (resp.sources.mp4) {
							var sources = resp.sources.mp4;
							var sources_urls = [];
							for (var key in sources) {
								if (!sources[key].src)
									continue;
								sources_urls.push({
									url: sources[key].src,
									quality: parseInt(key)
								});
							}
							sources_urls.sort(function(a, b) {
								return b.quality - a.quality;
							});
							for (var i = 0; i < sources_urls.length; i++) {
								delete sources_urls[i].quality;
								urls.push(sources_urls[i]);
							}
						}
						urls.push(page_nullobj);
						return done(fillobj_urls(urls, baseobj), 60 * 60);
					});
				};
				var query_eporner_site = function(vid, cb) {
					api_query("eporner_site:" + vid, {
						url: "https://www.eporner.com/hd-porn/" + vid + "/"
					}, cb, function(done, resp, cache_key) {
						var match = resp.responseText.match(/EP\.video\.player\.hash = '([0-9a-f]{10,})';/);
						if (!match) {
							console_error(cache_key, "Unable to find hash for", resp);
							return done(null, false);
						}
						var hash = match[1];
						return done({
							hash: hash,
							vid: vid
						}, 10 * 60);
					});
				};
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				if (options.do_request && options.cb) {
					query_eporner_site(id, function(data) {
						query_eporner_api(data, options.cb);
					});
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if (host_domain_nowww === "eporner.com" && options.element) {
			newsrc = common_functions["get_pagelink_host_el_matching"](options, {
				url_match: /^[a-z]+:\/\/[^/]+\/+(?:hd-porn|embed)\/+([0-9a-zA-Z]+)(?:\/+.*)?(?:[?#].*)?$/,
				el_match: function(x) {
					return x.tagName === "DIV" && x.id === "EPvideo";
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "samplerinfos.de") {
			newsrc = src
				.replace(/(\/covers\/+[0-9]+\/+|grafiken\/+(?:spezial\/+)?[^/]+\/+)([^/_.]+\.[^/.]+(?:[?#].*)?)$/, "$1big_$2")
				.replace(/(\/covers\/+[0-9]+\/+|grafiken\/+(?:spezial\/+)?[^/]+\/+)th_([^/_.]+\.[^/.]+(?:[?#].*)?)$/, "$1$2")
				.replace(/(\/online_images\/+artwork\/+artwork[0-9]+)_small(\.[^/.]+(?:[?#].*)?)$/, "$1$2");
			return {
				url: newsrc,
				can_head: false // 403
			};
		}
		if (domain_nosub === "litres.ru") return src.replace(/\/cover_[wh]?[0-9]+\/+/, "/cover/");
		if (domain === "d3el26csp1xekx.cloudfront.net" ||
			amazon_container === "starboard-media") {
			return src
				.replace(/(\/v\/+)(wm-[-_a-zA-Z0-9]+\.mp4)/, "$1no-$2")
				.replace(/(\/v\/+)(?:no-)?wm-thumb-([-_a-zA-Z0-9]+)-[0-9]+\.jpg(?:[?#].*)?$/, "$1no-wm-$2.mp4")
				.replace(/\/+thumbnails\/+(video-[^/]+-(?:no-)?wm)-thumbnail\.[0-9]+\.jpg(?:[?#].*)?$/, "/video/$1.mp4")
				.replace(/(\/video\/+video-[0-9a-f]{10,}-[0-9a-zA-Z]+-[0-9a-zA-Z]+)-wm(\.[^/.]+)(?:[?#].*)?$/, "$1-no-wm$2");
		}
		if (domain_nowww === "vidcloud9.com" ||
			domain_nowww === "vidnode.net") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:streaming|load)\.php\?(?:.*&)?id=([^&]+).*?$/);
			if (match) {
				id = match[1];
				var query_vidcloud9 = function(vid, cb) {
					api_query("vidcloud9:" + vid, {
						url: "https://vidcloud9.com/ajax.php?id=" + vid,
						headers: {
							Referer: "https://vidcloud9.com/",
							"X-Requested-With": "XMLHttpRequest"
						},
						json: true
					}, cb, function(done, resp, cache_key) {
						var urls = [];
						var baseobj = {
							headers: {
								Referer: "https://vidcloud9.com/"
							}
						};
						for (var i = 0; i < resp.source.length; i++) {
							if (resp.source[i].type !== "hls")
								continue;
							urls.push({
								url: resp.source[i].file,
								video: "hls"
							});
						}
						return done(fillobj_urls(urls, baseobj), 60 * 60);
					});
				};
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				if (options.cb && options.do_request) {
					query_vidcloud9(id, function(urls) {
						if (!urls) {
							return options.cb(page_nullobj);
						} else {
							urls.push(page_nullobj);
							return options.cb(urls);
						}
					});
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if (domain_nowww === "gcloud.live") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+v\/+([-a-z0-9]+)(?:[?#].*)?$/);
			if (match) {
				id = match[1];
				var query_gcloud_live = function(vid, cb) {
					api_query("gcloud_live:" + vid, {
						url: "https://gcloud.live/api/source/" + vid,
						method: "POST",
						data: "r=https%3A%2F%2Fgcloud.live%2F&d=gcloud.live",
						headers: {
							Origin: "https://gcloud.live",
							"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
							"Referer": "https://gcloud.live/v/" + vid,
							"x-requested-with": "XMLHttpRequest",
							"Accept": "*/*"
						},
						json: true
					}, cb, function(done, resp, cache_key) {
						var urls = [];
						var baseobj = {
							headers: {
								Referer: "https://gcloud.live.com/"
							}
						};
						for (var i = 0; i < resp.data.length; i++) {
							if (!resp.data[i].file || resp.data[i].type !== "mp4")
								continue;
							urls.push({ url: resp.data[i].file, quality: parseInt(resp.data[i].label) });
						}
						urls.sort(function(a, b) {
							return b.quality - a.quality;
						});
						for (var i = 0; i < urls.length; i++) {
							delete urls[i].quality;
						}
						return done(fillobj_urls(urls, baseobj), 60 * 60);
					});
				};
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				if (options.cb && options.do_request) {
					query_gcloud_live(id, function(urls) {
						if (!urls) {
							return options.cb(page_nullobj);
						} else {
							urls.push(page_nullobj);
							return options.cb(urls);
						}
					});
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if (domain_nowww === "streamvid.co") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+player\/+([A-Za-z0-9]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://streamvid.co/player/${id}/",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<div id="video_player">.*<script[^>]*>JuicyCodes\.Run\((\".*?\")\);<\/script>/);
					if (!match) {
						console_error(cache_key, "Unable to find JuicyCodes match for", resp);
						return done(null, false);
					}
					var encoded = match[1].replace(/[\s+"]/g, "");
					var decoded = base64_decode(encoded);
					var unpacked = common_functions["unpack_packer"](decoded);
					if (!unpacked) {
						console_error(cache_key, "Unable to unpack", decoded, "for", resp);
						return done(null, false);
					}
					match = unpacked.match(/sources:(\[{.*?}\]),/);
					if (!match) {
						console_error(cache_key, "Unable to find sources in", unpacked);
						return done(null, false);
					}
					var sources_json = JSON_parse(match[1]);
					for (var i = 0; i < sources_json.length; i++) {
						if (sources_json[i].type !== "application/x-mpegURL") {
							console_warn(cache_key, "Unknown type for", sources_json[i]);
							continue;
						}
						if (!sources_json[i].file) {
							continue;
						}
						return done([{
								url: sources_json[i].file,
								video: "hls",
								headers: {
									Origin: "https://streamvid.co",
									Referer: resp.finalUrl,
									Accept: "*/*"
								},
								can_head: false
							}], 60 * 60);
					}
					return done(null, false);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "blackporn.blacklust.com") return src.replace(/(:\/\/[^/]+\/+[0-9]+-[0-9]+\/+)images(\/+[0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1large$2");
		if (domain === "galleries.penthouse.com") return src.replace(/(\/galleries\/+[0-9]+\/+)([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1L/$2");
		if (domain_nowww === "letmejerk.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+play\/+([0-9]+)\/+[^/]+\.html(?:[?#].*)?$/);
			if (match) {
				id = match[1];
				var query_letmejerk = function(vid, cb) {
					api_query("letmejerk:" + vid, {
						url: "https://www.letmejerk.com/play/" + vid + "/a.html"
					}, cb, function(done, resp, cache_key) {
						var match = resp.responseText.match(/<script src="[^"]+\/jerkplayer\..*?<\/script>\s*<script type="text\/javascript">\s*var a\s*=\s*\['replace','(.*?)','(.*?)','split'\];.*?\(b\('0x1'\),(0x[0-9a-f]+),(0x[0-9a-f]+),/);
						if (!match) {
							console_error(cache_key, "Unable to find match for", resp);
							return done(null, false);
						}
						var format = match[1];
						var table = match[2];
						var base = parseInt(match[3]);
						var table_len = parseInt(match[4]);
						var replace_hex = function(str) {
							return str.replace(/\\x[0-9a-f]{2}/g, function(x) {
								return string_fromcharcode(parseInt("0x" + x.substr(2)));
							}).replace(/\\'/g, "'");
						};
						format = replace_hex(format);
						table = replace_hex(table).split("|");
						var unpacked = common_functions["static_unpack_packer"](format, base, table_len, table);
						if (!unpacked) {
							var info = {
								format: format,
								table: table,
								table_len: table_len,
								base: base
							};
							console_error(cache_key, "Unable to unpack part 1", resp, match, info);
							return done(null, false);
						}
						var unpacked2 = common_functions["unpack_packer"](unpacked);
						if (!unpacked2) {
							console_error(cache_key, "Unable to unpack part 2", resp, match, unpacked);
							return done(null, false);
						}
						match = unpacked2.match(/loadLetMeJerkVideoPlayer\(([0-9]+),'(.*?)'\);/);
						if (!match) {
							console_error(cache_key, "Unable to find player code in", resp, unpacked2);
							return done(null, false);
						}
						return done({
							vid: match[1],
							key: match[2],
							url: resp.finalUrl
						}, 60 * 60);
					});
				};
				var query_letmejerk_video = function(data, cb) {
					api_query("letmejerk_video:" + data.vid + ":" + data.key, {
						url: "https://www.letmejerk.com/load/video/" + data.key + "/",
						method: "POST",
						data: "id=" + data.vid,
						headers: {
							Referer: data.url,
							Origin: "https://www.letmejerk.com",
							"x-requested-with": "XMLHttpRequest",
							"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
						}
					}, cb, function(done, resp, cache_key) {
						var match = resp.responseText.match(/<source src=\"(https?:\/\/lmjvideocdn[^"]+)"/);
						if (!match) {
							console_error(cache_key, "Unable to find source for", resp, data);
							return done(null, false);
						}
						return done({
							url: decode_entities(match[1]),
							headers: {
								Referer: data.url
							},
							extra: {
								page: data.url
							}
						}, 60 * 60);
					});
				};
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				if (options.cb && options.do_request) {
					query_letmejerk(id, function(data) {
						if (!data) {
							return options.cb(page_nullobj);
						}
						query_letmejerk_video(data, function(obj) {
							if (!obj) {
								return options.cb(page_nullobj);
							}
							return options.cb([obj, page_nullobj]);
						});
					});
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if (domain === "thumbs.letmejerk.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+[0-9]+\/+([0-9]+)\.[^/.]+(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://www.letmejerk.com/play/" + match[1] + "/a.html",
					is_pagelink: true
				};
			}
		}
		if (domain === "cdn.nakedgirls.xxx" ||
			domain === "cdn.nudexxx.pics") {
			return src
				.replace(/(:\/\/[^/]+\/+content\/+galleries\/+[0-9]+\/+[0-9a-f]{20,}-[0-9]+)(\.[^/.]+)(?:[?#].*)?$/, "$1-full$2")
				.replace(/:\/\/cdn\.([^/]+)\/+(galleries\/+[0-9]+\/+[0-9a-f]{20,}-[0-9]+)(\.[^/.]+)(?:[?#].*)?$/, "://www.$1/content/$2-full$3");
		}
		if (domain === "proxy.topixcdn.com") return src.replace(/(\/ipicimg\/+[0-9A-Z]+)(?:-(?:cp|rsz)[0-9x]+){0,}(?:[?#].*)?$/, "$1");
		if (domain_nosub === "momapix.com" && /^d[0-9]*\./.test(domain)) {
			return src.replace(/(:\/\/[^/]+\/+[a-z]+\/+(?:[0-9a-f]{20,}\/+)?)Image([0-9]+\.[^/.?#]+)(\/+[^/?#]+)?(?:[?#].*)?$/, "$1Preview$2$3");
		}
		if (domain === "galleries.tease-pics.com") return src.replace(/(\/[0-9]+[a-z]-p\/+)images\/+/, "$1pics/");
		if (domain_nosub === "lodef.net" && /^img[0-9]*\./.test(domain)) {
			return src.replace(/(\/imgs\/+(?:[0-9a-f]\/+){1,}[0-9a-f]{10,})_s(\.[^/.]+)(?:[?#].*)?$/, "$1_f$2");
		}
		if (domain_nowww === "porn.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+out\/+[nt]\/+[^/]+\/+([^/]{30,})(?:\/+(?:[0-9]+|[^/]{30,})\/+(?:[0-9]+|[^/]{30,}))?(?:[?#].*)?$/);
			if (match) {
				var splitted = decodeURIComponent(match[1]).split("_");
				var splitted1 = [];
				for (var i_10 = 0; i_10 < splitted.length; i_10++) {
					splitted1.push(base64_decode(splitted[i_10]));
				}
				return {
					url: splitted1.join("?"),
					is_pagelink: true
				};
			}
		}
		if (host_domain_nowww === "porn.com" && domain_nosub === "porn.com" && /^media/.test(domain) && options.element) {
			newsrc = common_functions["get_pagelink_el_matching"](options.element, /porn\.com\/+out\//);
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "pandora.tv") {
			var query_pandora_site = function(uid, vid, cb) {
				api_query("pandora_site:" + uid + ":" + vid, {
					url: "http://www.pandora.tv/view/" + uid + "/" + vid
				}, cb, function(done, resp, cache_key) {
					var matches = match_all(resp.responseText, /var (str(?:ResolType|Fid|ChUserId|ResolArr)|n(?:PrgId|VodSvr|Info)|runtime)\s*= ([[0-9'].*?); *\r?\n/);
					if (!matches) {
						console_error(cache_key, "Unable to find vars for", resp);
						return done(null, false);
					}
					var vars = {
						"strResolArr": '["1","2","3","4","5"]',
						"strResolType": "'2'"
					};
					array_foreach(matches, function(match) {
						var varname = match[1];
						var varvalue = match[2];
						vars[varname] = varvalue.replace(/^'(.*)'$/, "$1");
					});
					return done(vars, 60 * 60);
				});
			};
			var query_pandora_vodurl = function(data, cb) {
				if (!data || !data.strFid || !data.strChUserId || !data.nPrgId || !data.nInfo) {
					console_error("Invalid data", data);
					return cb(null);
				}
				var resolutions = JSON_parse(data.nInfo);
				var resolution = resolutions.sort()[resolutions.length - 1];
				var queries = [
					"userId=" + data.strChUserId,
					"prgId=" + data.nPrgId,
					"fid=" + data.strFid,
					"resolType=" + data.strResolType,
					"resolArr=" + encodeURIComponent(data.strResolArr.replace(/[\]['"]/g, "")),
					"vodSvr=" + data.nVodSvr,
					"resol=" + resolution,
					"runtime=" + data.runtime,
					"tvbox=false",
					"defResol=false",
					"embed=false"
				];
				var referer = "http://www.pandora.tv/view/" + data.strChUserId + "/" + data.nPrgId;
				api_query("pandora_vodurl:" + data.strFid, {
					url: "http://www.pandora.tv/external/getExternalApi/getVodUrl/",
					method: "POST",
					headers: {
						"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
						Origin: "http://www.pandora.tv",
						Referer: referer
					},
					data: queries.join("&"),
					json: true
				}, cb, function(done, resp, cache_key) {
					if (!resp.src) {
						console_error(cache_key, "Unable to find src", resp);
						return done(null, false);
					}
					var obj = {
						url: resp.src,
						is_private: true
					};
					obj.extra = {
						page: referer
					};
					return done(obj, 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /\/view\/+([^/]+)\/+([0-9]+)\/*(?:[?#].*)?$/,
				run: function(cb, match) {
					query_pandora_site(match[1], match[2], function(data) {
						query_pandora_vodurl(data, cb);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "pandora.tv" && /^imguser[0-9]*\./.test(domain)) {
			newsrc = src.replace(/\/_channel_img_sm_temp\//, "/_channel_img_temp/");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/pandora\/+_channel_img_(?:sm_)?temp\/+.\/+.\/+([^/]+)\/+[0-9]+\/+vod_thumb_([0-9]+)\./);
			if (match) {
				return {
					url: "http://www.pandora.tv/view/" + match[1] + "/" + match[2],
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "imagefap.site" ||
			domain_nowww === "tube.bz" ||
			domain === "embed.mp4.center") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:player(?:\/+(?:xvideos|goto))?|embed\/+mp4)\/+\?(?:.*&)?u=([^&]+).*?$/);
			if (match) {
				return {
					url: decodeURIComponent(match[1]),
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "porndex.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:out\/+go|view_video)\.php\?(?:.*&)?go=([0-9]+).*?$/,
				query_for_id: "https://www.porndex.com/out/go.php?go=${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<meta\s+http-equiv="refresh"\s+content="[0-9]+;URL='([^'"]+)'"/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done({
						url: decode_entities(match[1]),
						is_pagelink: true
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "video.nudevista.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+video\/+([^-/.]{10,})(?:\/+([^-/.]{10,})(?:\/+([^-/.]{10,}))?)?(?:-[^/]+)\./);
			if (match) {
				try {
					var strings = [];
					var decoded = base64_decode(match[1]);
					strings.push(decoded);
					if (match[2]) {
						var decoded2 = base64_decode(match[2]);
						strings.push(decoded2);
					}
					if (match[3]) {
						var decoded2 = base64_decode(match[3]);
						strings.push(decoded2);
					}
					var found_1 = false;
					for (var i_11 = 0; i_11 < strings.length; i_11++) {
						strings[i_11] = strings[i_11].replace(/#/g, "-");
						var newsrc = strings[i_11].replace(/^.*?(https?:\/\/)/, "$1");
						if (newsrc !== strings[i_11]) {
							found_1 = true;
							strings[i_11] = newsrc;
							if (i_11 > 0) {
								strings.splice(0, i_11);
							}
							break;
						}
					}
					if (found_1 && strings.length > 0) {
						return {
							url: strings.join("?"),
							is_pagelink: true
						};
					}
				} catch (e) {
					console_error(e);
				}
			}
		}
		if (domain_nosub === "nudevista.com") {
			if (/\/_\/+curr\.gif/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain_nosub === "streamable.com") {
			page_nullobj = null;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:image|video\/+mp4(?:-mobile))\/+([a-z0-9]+)(?:_first)?\./);
			if (match) {
				id = match[1];
			} else {
				match = src.match(/^[a-z]+:\/\/(?:www\.)?streamable\.com\/+([a-z0-9]+)(?:[?#].*)?$/);
				if (match) {
					page_nullobj = {
						url: src,
						is_pagelink: true
					};
					id = match[1];
				}
			}
			if (id) {
				var baseobj_9 = {
					url: src,
					extra: {
						page: "https://www.streamable.com/" + id
					}
				};
				if (page_nullobj)
					page_nullobj.extra = baseobj_9.extra;
				var query_streamable = function(id, cb) {
					api_query("streamable:" + id, {
						url: "https://www.streamable.com/" + id
					}, cb, function(done, resp, cache_key) {
						var match = resp.responseText.match(/var videoObject\s*=\s*({.*?}); *\r?\n/);
						if (!match) {
							console_error(cache_key, "Unable to find match for", resp);
							return done(null, false);
						}
						var json = JSON_parse(match[1]);
						var title = json.title || json.reddit_title;
						if (title) {
							baseobj_9.extra.caption = title;
						}
						var urls = [];
						if (json.files) {
							var files = [];
							for (var key in json.files) {
								files.push(json.files[key]);
							}
							files.sort(function(a, b) {
								return b.bitrate - a.bitrate;
							});
							var src_noquery = src.replace(/[?#].*/, "");
							for (var i = 0; i < files.length; i++) {
								if (!files[i].url)
									continue;
								if (files[i].url.replace(/[?#].*/) === src_noquery) {
									files[i].url = src_noquery;
								}
								var videoobj = {
									url: urljoin(resp.finalUrl, files[i].url, true),
									headers: {
										Referer: resp.finalUrl
									},
									video: true
								};
								if (false && json.original_name) {
									videoobj.filename = json.original_name;
								}
								urls.push(videoobj);
							}
						}
						var thumbnails = [
							json.poster_url,
							json.thumbnail_url,
							json.dynamic_thumbnail_url
						];
						for (var i = 0; i < thumbnails.length; i++) {
							if (thumbnails[i]) {
								urls.push(urljoin(resp.finalUrl, thumbnails[i], true).replace(/[?#].*/, ""));
							}
						}
						return done(urls, 60 * 60);
					});
				};
				if (options.cb && options.do_request) {
					query_streamable(id, function(obj) {
						if (!obj) {
							return options.cb(page_nullobj || baseobj_9);
						}
						if (!is_array(obj)) {
							obj = [obj];
						}
						if (page_nullobj)
							obj.push(page_nullobj);
						return options.cb(fillobj_urls(obj, baseobj_9));
					});
					return {
						waiting: true
					};
				} else {
					return page_nullobj || baseobj_9;
				}
			}
		}
		if (domain_nowww === "jacquieetmicheltv.net" ||
			domain_nowww === "jacquieetmicheltv2.net" ||
			domain_nowww === "jacquieetmichelelite.com" ||
			domain_nowww === "desinhibition.com" ||
			domain_nowww === "lavideodujourjetm.net" ||
			domain_nowww === "tonpornodujour.com" ||
			domain_nowww === "tyjam.com" ||
			domain_nowww === "colmax.com" ||
			domain_nowww === "hotvideo.fr" ||
			domain_nowww === "pornovoisines.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:([a-z]{2})\/+)?(?:(?:videos\/+show|film-porno(?:\/+elite)?)\/+([0-9]+)(?:\/+[^/]*)|videos\/+([0-9]+)(?:-[^/]+)?)(?:[?#].*)?$/);
			if (match) {
				var lang = match[1] || null;
				id = match[2] || match[3];
				var basedomain = domain_nosub;
				var query_jacquieetmichel_json = function(jsonurl, cb) {
					var id = jsonurl.replace(/.*\/player\/([0-9a-f]{10,})\/\?.*/, "$1");
					if (id === jsonurl) {
						console_log("Unsupported URL", jsonurl);
						return cb(null);
					}
					api_query(basedomain + "_json:" + id, {
						url: jsonurl,
						headers: {
							Accept: "*/*",
							Origin: "https://www." + domain_nosub,
							Referer: "https://www." + domain_nosub + "/"
						},
						json: true
					}, cb, function(done, resp, cache_key) {
						var baseobj = {
							headers: {
								Referer: "https://www." + domain_nosub + "/"
							}
						};
						var urls = [];
						if (resp.sources.dash) {
							urls.push({
								url: resp.sources.dash,
								video: "dash"
							});
						}
						if (resp.sources.hls) {
							urls.push({
								url: resp.sources.hls,
								video: "hls"
							});
						}
						if (resp.sources.mp4) {
							resp.sources.mp4.sort(function(a, b) {
								return parseInt(b.label) - parseInt(a.label);
							});
							for (var i = 0; i < resp.sources.mp4.length; i++) {
								var ourlink = resp.sources.mp4[i];
								if (ourlink.file) {
									urls.push({
										url: ourlink.file,
										video: true
									});
								}
							}
						}
						return done(fillobj_urls(urls, baseobj), 60 * 60);
					});
				};
				var query_jacquieetmichel = function(id, cb) {
					var langurl = "";
					if (lang)
						langurl = lang + "/";
					if (domain_nosub === "tyjam.com" || domain_nosub === "colmax.com")
						langurl += "videos/";
					api_query(basedomain + ":" + id, {
						url: " https://www." + domain_nosub + "/" + langurl + "api/video/" + id + "/getplayerurl/",
						headers: {
							Referer: "https://www." + domain_nosub + "/",
							"Accept": "application/json, text/javascript, */*; q=0.01",
							"x-requested-with": "XMLHttpRequest"
						},
						json: true
					}, cb, function(done, resp, cache_key) {
						if (!resp.video_settings_url || !resp.video_settings_url.match(/^https?:\/\//)) {
							console_error(cache_key, "Unable to find video url in", resp);
							return done(null, false);
						}
						query_jacquieetmichel_json(resp.video_settings_url, function(data) {
							if (!data)
								return done(null, false);
							done(data, 60 * 60);
						});
					});
				};
				page_nullobj = {
					url: src,
					is_pagelink: true
				};
				if (options.do_request && options.cb) {
					query_jacquieetmichel(id, function(urls) {
						if (!urls) {
							return options.cb(page_nullobj);
						} else {
							urls.push(page_nullobj);
							return options.cb(urls);
						}
					});
					return {
						waiting: true
					};
				} else {
					return page_nullobj;
				}
			}
		}
		if (domain_nowww === "laracroftonline.com") return src.replace(/(\/media_gallery\/+image\/+.*\/[^/]+)-thumb(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "noble-caledonia.co.uk") {
			if (/\/thumb\.php\?/.test(src)) {
				var queries = get_queries(src);
				if (queries.action) {
					queries.action = "A";
				}
				return src.replace(/[?#].*/, "?" + stringify_queries(queries));
			}
		}
		if (domain === "fundraise.globalbrigades.org" ||
			domain_nowww === "hekkersmannen.nl" ||
			domain_nowww === "4lazylegs.com" ||
			domain_nowww === "hertoghendrik.com") {
			return src.replace(/(\/media_gallery\/+thumb\/+)[0-9]+\/+[0-9]+\/+/, "$10/0/");
		}
		if (domain === "media.nonktube.com") {
			match = src.match(/\/videos\/+tmb_[0-9]+\/+([0-9]+)\/+(?:thumb|default)\./);
			if (match) {
				id = match[1];
				return {
					url: "https://cdn.nonktube.com/" + id + ".mp4",
					headers: {
						Referer: "https://www.nonktube.com/"
					},
					video: true
				};
			}
		}
		if (domain_nowww === "nonktube.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+video\/+([0-9]+)(?:\/+[^/]*)?(?:[?#].*)?$/);
			if (match) {
				id = match[1];
				var page_nullobj_1 = {
					url: src,
					is_pagelink: true
				};
				return [{
						url: "https://cdn.nonktube.com/" + id + ".mp4",
						headers: {
							Referer: "https://www.nonktube.com/"
						},
						video: true
					}, page_nullobj_1];
			}
		}
		if (domain === "snusercontent.global.ssl.fastly.net") return src.replace(/(:\/\/[^/]+\/+)(?:member-(?:headshot-square(?:-large)?|profile-(?:featured|thumbnail)))\/+/, "$1member-profile-full/");
		if (domain_nowww === "gotporn.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+gvf\/+[^-_/.]{10,}\.([^-/.]{50,})\.$/);
			if (match) {
				try {
					var splitted = match[1].split("_");
					for (var i_12 = 0; i_12 < splitted.length; i_12++) {
						splitted[i_12] = base64_decode(splitted[i_12]);
					}
					var jsonstr = splitted.join("?");
					var json = JSON_parse(jsonstr);
					return {
						url: json.url,
						headers: {
							Referer: "https://www.gotporn.com/"
						},
						video: true
					};
				} catch (e) {
					console_error(e);
				}
			}
		}
		if (domain_nosub === "gotporn.com" && /^cdn[0-9]*-pic-cf\./.test(domain)) {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}([0-9]+)\./);
			if (match) {
				return {
					url: "https://www.gotporn.com/a/video-" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "gotporn.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+[^/]+\/+video-([0-9]+)(?:\/+[^/]*)?(?:[?#].*)?$/,
				query_for_id: function(id) {
					return {
						url: "https://www.gotporn.com/a/video-" + id
					};
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<div class="video-object-container">\s*<video.*?>\s<source\s*src="(https?:\/\/www\.gotporn\.com\/+gvf\/+[^"]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var baseobj = {
						headers: {
							Referer: "https://www.gotporn.com/"
						},
						extra: {}
					};
					var canonical = resp.responseText.match(/<link rel="canonical" href="([^"]+)">/);
					if (canonical) {
						baseobj.extra.page = decode_entities(canonical[1]);
						baseobj.headers.Referer = baseobj.extra.page;
					}
					var url = {
						url: decode_entities(match[1]),
						video: true
					};
					return done(fillobj_urls([url], baseobj), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "static.freedownloadmanager.org") {
			obj = {
				url: src,
				bad_if: [{
						headers: {
							"last-modified": "Fri, 24 Aug 2018 10:15:51 GMT",
							"content-length": "5743",
							"content-type": "image/jpeg"
						}
					}]
			};
			newsrc = src.replace(/(\/s\/+[0-9]+\/+[0-9]+_[0-9]+)_[0-9](\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src) {
				return fillobj_urls(add_extensions(newsrc), obj);
			} else {
				return obj;
			}
		}
		if (domain_nowww === "nastyvideotube.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+o\.php\?(?:.*)?u=([^-&?#]{10,})/);
			if (match) {
				newsrc = match[1].replace(/~/g, "=");
				try {
					newsrc = base64_decode(newsrc);
					return {
						url: newsrc,
						is_pagelink: true
					};
				} catch (e) {
					console_error(e);
				}
			}
		}
		if (domain === "gallery.armyofselenagomez.com") return src.replace(/\/cache\/+([^/]+\/+[^/]+\/+[^/]+)_[0-9]+(?:_[wh][0-9]+){0,2}(?:_thumb)?(\.[^/.]+)(?:[?#].*)?$/, "/albums/$1$2");
		if (domain === "d3rwyinxzcqr6y.cloudfront.net" ||
			domain === "d1flfk77wl2xk4.cloudfront.net") {
			if (/\/Assets\/+res\/+imgs\/+(?:button\/+)?[^/]+\.(?:gif|png)(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			newsrc = src.replace(/(\/Assets\/+(?:GalleryImage\/+)?[0-9]+\/+[0-9]+\/+)(?:S_)?([gp][0-9]+\.)/, "$1L_$2");
			if (newsrc !== src) {
				if (get_image_size && options.cb) {
					get_image_size(newsrc, function(x, y) {
						if (!x || !y)
							return options.cb(null);
						if (y === 720) {
							get_image_size(src, function(oldx, oldy) {
								if (oldx * oldy < x * y) {
									return options.cb(newsrc);
								} else {
									return options.cb(null);
								}
							});
						} else {
							return options.cb(newsrc);
						}
					});
					return {
						waiting: true
					};
				}
			}
		}
		if (domain_nowww === "youjizz.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+videos\/+[^/]*-([0-9]+)\.html(?:[?#].*)?$/,
				query_for_id: "https://www.youjizz.com/videos/-${id}.html",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/var dataEncodings\s*=\s*(\[{.*?}\]);\s*var encodings/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					sort_by_key(json, "quality");
					var baseobj = {
						extra: {},
						headers: {
							Referer: resp.finalUrl
						}
					};
					var url = get_meta(resp.responseText, "og:url");
					if (url)
						baseobj.extra.page = url;
					var title = get_meta(resp.responseText, "og:title");
					if (title)
						baseobj.extra.caption = title;
					var urls = [];
					for (var i = 0; i < json.length; i++) {
						var newurl = urljoin(resp.finalUrl, json[i].filename, true);
						var obj = { url: newurl, video: true };
						if (string_indexof(newurl, "_hls") >= 0) {
							obj.video = "hls";
						}
						urls.push(obj);
					}
					return done(fillobj_urls(urls, baseobj), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "youjizz.com" && domain_nosub === "youjizz.com" && /^cdne-(?:pics|mobile)\./.test(domain) && options.element) {
			newsrc = common_functions["get_pagelink_el_matching"](options.element, /^[a-z]+:\/\/[^/]+\/+videos\/+[^/]*-([0-9]+)\.html(?:[?#].*)?$/);
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "vporn.com" && /^vm[0-9]*\./.test(domain)) {
			newsrc = src.replace(/(\/t\/+[0-9]+\/+[0-9]+\/+)d([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1b$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/t\/+[0-9]+\/+([0-9]+)\/+/);
			if (match) {
				return {
					url: "https://pornone.com/machine/a/" + match[1] + "/",
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "dood.to" ||
			domain_nowww === "doods.pro" ||
			domain_nowww === "ds2play.com" ||
			domain_nowww === "do0od.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+[de]\/+([0-9a-z]{10,})\/*(?:[?#].*)?$/,
				query_for_id: function(id) {
					var url = "https://" + domain + "/e/" + id;
					return {
						url: url,
						headers: {
							Referer: url,
							"Sec-Fetch-Dest": "document",
							"Sec-Fetch-Mode": "navigate",
							"Sec-Fetch-Site": "same-origin"
						},
						imu_mode: "document"
					};
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/\$\.get\('(\/pass_md5\/[^']+)', function/);
					if (!match) {
						console_error(cache_key, "Unable to find pass_md5 match for", resp);
						return done(null, false);
					}
					var token = resp.responseText.match(/\?token=([0-9a-z]{10,})&expiry=/);
					if (!token) {
						console_error(cache_key, "Unable to find token for", resp);
						return done(null, false);
					} else {
						token = token[1];
					}
					var baseobj = {
						extra: {}
					};
					var title = get_meta(resp.responseText, "og:title");
					if (title) {
						baseobj.extra.caption = title;
					}
					baseobj.extra.page = resp.finalUrl;
					var md5_url = urljoin(resp.finalUrl, match[1], true);
					var get_videourl_from_md5url = function(md5url, cb) {
						api_query("dood.to_md5url:" + md5url, {
							url: md5url,
							headers: {
								Referer: resp.finalUrl,
								"x-requested-with": "XMLHttpRequest"
							}
						}, cb, function(done, resp, cache_key) {
							if (!resp.responseText.match(/^(https?:\/\/.*~)$/)) {
								console_error(cache_key, "Invalid URL for", resp);
								return done(null, false);
							}
							return done(resp.responseText, 60 * 60);
						});
					};
					get_videourl_from_md5url(md5_url, function(vidurl) {
						if (!vidurl) {
							return done(null, false);
						}
						var alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
						for (var i = 0; i < 10; i++) {
							vidurl += string_charat(alpha, Math_floor(Math_random() * alpha.length));
						}
						vidurl += "?token=" + token + "&expiry=" + Date.now();
						return done({
							url: vidurl,
							extra: baseobj.extra,
							headers: {
								Referer: vidurl.replace(/(:\/\/[^/]+\/+).*/, "$1"),
								"Accept": "*/*",
								"Accept-Encoding": "identity;q=1, *;q=0",
								"Sec-Fetch-Site": "cross-site",
								"Sec-Fetch-Mode": "no-cors",
								"Sec-Fetch-Dest": "video"
							},
							can_head: false,
							video: true
						}, 60 * 60);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "img.ivsky.com") {
			return src
				.replace(/\/img\/+([^/]+)\/+pre\/+([^?#]*)(?:[?#].*)?$/, "/img/$1/pic/$2?download")
				.replace(/\/img\/+([^/]+)\/+(?:[mt]|li|co|slides)\/+/, "/img/$1/pre/");
		}
		if (domain_nowww === "databasegdriveplayer.me" ||
			domain_nowww === "databasegdriveplayer.xyz" ||
			domain === "database.gdriveplayer.us") {
			newsrc = website_query({
				website_regex: /^([a-z]+:\/\/[^/]+\/+player\.php\?.*)$/,
				query_for_id: "${id}",
				process: function(done, resp, cache_key) {
					var unpacked1 = common_functions["unpack_packer"](resp.responseText);
					if (!unpacked1) {
						console_error(cache_key, "Unable to find packed data #1 for", resp);
						return done(null, false);
					}
					var data_match = unpacked1.match(/^var data='({.*?})';[[]'sojson\.v4'/);
					if (!data_match) {
						console_error(cache_key, "Unable to find data json for", resp, { unpacked1: unpacked1 });
						return done(null, false);
					}
					var data_json = data_match[1];
					var data = JSON_parse(data_json);
					data.ct = JSON_parse('"' + data.ct + '"');
					data_json = JSON_stringify(data);
					var sojson_payload = unpacked1.match(/[[]'sojson\.v4'\].*?\(null,'([0-9a-zA-Z]{100,})'[[]/);
					if (!sojson_payload) {
						console_error(cache_key, "Unable to find sojson packed data for", resp, { unpacked1: unpacked1 });
						return done(null, false);
					}
					var sojson_splitted = sojson_payload[1].split(/[a-zA-Z]{1,}/);
					var sojson_unpacked = string_fromcharcode.apply(null, sojson_splitted);
					var pass = sojson_unpacked.match(/var pass\s*=\s*"([^"]+)";/);
					if (!pass) {
						console_error(cache_key, "Unable to find AES key from", resp, { sojson_unpacked: sojson_unpacked });
						return done(null, false);
					} else {
						pass = pass[1];
					}
					get_library("cryptojs_aes", options, options.do_request, function(CryptoJS) {
						if (!CryptoJS) {
							console_error(cache_key, "Unable to fetch CryptoJS");
							return done(null, false);
						}
						var JsonFormatter = common_functions["get_jsonformatter_for_cryptojs"](CryptoJS);
						var decrypted_raw = CryptoJS.AES.decrypt(data_json, pass, { format: JsonFormatter });
						try {
							var decrypted = decrypted_raw.toString(CryptoJS.enc.Utf8);
						} catch (e) {
							console_error(cache_key, e, {
								decrypted_raw: decrypted_raw,
								data_json: data_json,
								pass: pass,
								format: JsonFormatter,
								CryptoJS: CryptoJS
							});
							return done(null, false);
						}
						var unpacked2 = common_functions["unpack_packer"](decrypted);
						if (!unpacked2) {
							console_error(cache_key, "Unable to find packed data #2 for", resp, {
								data_json: data_json,
								pass: pass,
								decrypted_raw: decrypted_raw,
								decrypted: decrypted,
								CryptoJS: CryptoJS,
								format: JsonFormatter
							});
							return done(null, false);
						}
						var sources_match = unpacked2.match(/{sources:(\[{.*?}\]),image:/);
						if (!sources_match) {
							console_error(cache_key, "Unable to find sources for", resp, { unpacked2: unpacked2 });
							return done(null, false);
						}
						var sources_json = JSON_parse('"' + sources_match[1] + '"');
						var sources = JSON_parse(sources_json);
						var sortorder = ["Original", "Default", "360p"];
						sources.sort(function(a, b) {
							var a_label = a.label;
							var b_label = b.label;
							var a_sortorder = array_indexof(sortorder, a_label);
							var b_sortorder = array_indexof(sortorder, b_label);
							if (a_sortorder >= 0) {
								if (b_sortorder >= 0) {
									return a_sortorder - b_sortorder;
								} else {
									return -1;
								}
							} else if (b_sortorder >= 0) {
								return 1;
							} else {
								return parseInt(b_label) - parseInt(a_label);
							}
						});
						var baseobj = {
							is_private: true,
							video: true
						};
						var urls = [];
						for (var i = 0; i < sources.length; i++) {
							urls.push(urljoin(resp.finalUrl, sources[i].file, true));
						}
						return done(fillobj_urls(urls, baseobj), 60 * 60);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "free.cherrypimps.com") return src.replace(/(\/[0-9]+\/+content\/+)th([0-9]+\.)/, "$1$2");
		if (domain_nosub === "ftvcash.com" && /^galleries[0-9]*\./.test(domain)) {
			return src.replace(/(_gals\/+[^/]+\/+[^/]+\/+)th([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nosub === "modelmanagement.com" && /^asset[0-9]*\./.test(domain)) {
			match = src.match(/:\/\/[^/]+\/+mm-((?:[^/.?#]{15,}\/+){1,}[^/.?#;]+);*\.[^/.]+(?:[?#].*)?$/);
			if (match) {
				var splitted = match[1].split(/\/+/g);
				var splitted_dec = [];
				try {
					for (var i_13 = 0; i_13 < splitted.length; i_13++) {
						splitted_dec[i_13] = base64_decode(splitted[i_13]);
					}
					var json = JSON_parse(splitted_dec.join(""));
					console_log(json);
					var newjson = { f: json.f, id: json.id, t: {} };
					var newjson_str = JSON_stringify(newjson);
					splitted = [];
					while (newjson_str.length >= 15) {
						splitted.push(base64_encode(newjson_str.substr(0, 15)).replace(/=/g, ""));
						newjson_str = newjson_str.substring(15);
					}
					if (newjson_str.length > 0)
						splitted.push(base64_encode(newjson_str).replace(/=/g, ""));
					return {
						url: urljoin(src, "/mm-" + splitted.join("/") + "." + json.f, true),
						head_wrong_contenttype: true // actually, it has no content-type, either for get or head
					};
				} catch (e) {
					console_error(e);
				}
			}
		}
		if (domain_nowww === "terragame.com") return src.replace(/\/thumb_([0-9]+)\.gif(?:[?#].*)?$/, "/screen_$1.jpg");
		if (domain_nowww === "oldgames.sk") return src.replace(/(\/images\/.*\/)\.thumbs\/+_gallery_/, "$1");
		if (domain === "static.gamersgate.com") return src.replace(/(\/media\/+products\/+product\/+[0-9]+\/+[^/]+)\/+[wh][0-9]+\/+(?:[?#].*)?$/, "$1");
		if (domain_nowww === "ai-love.com") return src.replace(/(\/photo\/+[0-9]+)s[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "static.namethatporn.com") {
			newsrc = src.replace(/\/media\/+tinies\/+/, "/media/displays/");
			if (newsrc !== src)
				return newsrc;
			return add_full_extensions(src, ["mp4", "webp"], true);
		}
		if (domain === "tn.squirtingclips.com") {
			if (/\/img\/+[0-9]+\/+all_bg\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain_nowww === "kimcartoon.to") {
			if (/\/images\/+body_bg.gif(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "asianpussyhub.com" ||
			domain_nowww === "wetjapaneseporn.com" ||
			domain_nowww === "okasianxxxtube.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:play|(?:hd|s).php)\?(?:.*&)?(?:video|movie|select)=([^&]+).*?$/);
			if (match) {
				try {
					newsrc = match[1];
					if (string_indexof(newsrc, "/") < 0)
						newsrc = base64_decode(newsrc);
					return [
						{
							url: urljoin(src, newsrc, true),
							is_pagelink: true
						},
						{
							url: src,
							is_pagelink: true
						}
					];
				} catch (e) {
					console_error(e);
				}
			}
			newsrc = website_query({
				website_regex: /^([a-z]+:\/\/[^/]+\/+(?:asian(?:vids|tube)|movie)\/+[^/.?#]+\.(?:html|php)(?:[?#].*)?)$/,
				query_for_id: "${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<div class="video-holder">\s*<div class="player">[\s\S]*?<iframe\s+(?:(?:width|height)="[0-9]+"\s+){0,}src="(https?:\/\/[^"]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find embed match for", resp);
						return done(null, false);
					}
					return done(decode_entities(match[1]), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "nakedsexyasians.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+hph.php\?(?:.*&)?naked=([^&]+).*?$/);
			if (match) {
				try {
					newsrc = decodeURIComponent(match[1]);
					return [
						{
							url: urljoin(src, newsrc, true),
							is_pagelink: true
						},
						{
							url: src,
							is_pagelink: true
						}
					];
				} catch (e) {
					console_error(e);
				}
			}
			newsrc = website_query({
				website_regex: /^([a-z]+:\/\/[^/]+\/+mov\/+[^/.?#]+\.php(?:[?#].*)?)$/,
				query_for_id: "${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<div class="wrap_player">\s*<iframe\s+(?:(?:width|height)="[0-9]+"\s+){0,}src="(https?:\/\/[^"]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find embed match for", resp);
						return done(null, false);
					}
					return done(decode_entities(match[1]), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "asiantubevid.com" ||
			domain_nowww === "alesbiansex.com" ||
			domain_nowww === "lezzietub.com" ||
			domain_nowww === "xxxfilm.pro") {
			newsrc = website_query({
				website_regex: /^([a-z]+:\/\/[^/]+\/+embed\/+[0-9a-z]+\?.*)$/,
				query_for_id: "${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<video [^>]+>\s*<source\s+src="(https?:\/\/[^"]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find video match for", resp);
						return done(null, false);
					}
					return done({
						url: decode_entities(match[1]),
						headers: {
							Referer: resp.finalUrl
						},
						video: true
					}, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
			newsrc = website_query({
				website_regex: /^([a-z]+:\/\/[^/]+\/+(?:[a-z]+\/+)?(?:[0-9a-zA-Z]+\?.*|\?(?:[^&]*&)?(?:video|content|watch)=[0-9a-zA-Z]+(?:&.*)?))$/,
				query_for_id: "${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<div class='asg-hover'\s*style='[^']+'>.*?<iframe src='(\/embed\/+[^']+)'/);
					if (!match) {
						console_error(cache_key, "Unable to find embed match for", resp);
						return done(null, false);
					}
					return done(urljoin(resp.finalUrl, decode_entities(match[1]), true), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "dirtyships.net") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([0-9]+)\/+/,
				query_for_id: "https://" + domain + "/video/${id}/",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<div class=.video-embedded.>\s*<iframe[^>]*src="(https?:\/\/[^"]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find iframe match for", resp);
						return done(null, false);
					}
					return done({
						url: decode_entities(match[1]),
						is_pagelink: true
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "cdn.17app.co") return src.replace(/(:\/\/[^/]+\/+)THUMBNAIL_/, "$1");
		if (domain_nowww === "porn-gif.net") return src.replace(/(\/img\/+[^/]+\/+[^/]+_[0-9]+)mini(?:ki)?(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "xofeed.com") return src.replace(/(\/content\/.*\/pictures\/.*\/)thumbs\/+/, "$1preview/");
		if (domain_nowww === "omny.fm") {
			var query_omny_api = function(showname, clipname, cb) {
				api_query("omny:" + showname + "/" + clipname, {
					url: "https://omny.fm/api/embed/shows/" + showname + "/clip/" + clipname,
					imu_mode: "xhr",
					headers: {
						Accept: "application/json, text/plain, */*",
						Referer: "https://omny.fm/shows/" + showname + "/" + clipname + "/embed?source=omnyfm&size=square&style=cover"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					done(resp, 6 * 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: {
					regex: /^[a-z]+:\/\/[^/]+\/+shows\/+([^/]+)\/+([^/?#.]+)(?:\/+embed)?(?:[?#].*)?$/,
					groups: ["showname", "clipname"]
				},
				run: function(cb, match) {
					query_omny_api(match.groups.showname, match.groups.clipname, function(data) {
						if (!data)
							return cb(null);
						var obj = {
							extra: {
								page: data.OmnyShareUrl,
								caption: data.Title
							}
						};
						var urls = [];
						urls.push({
							url: "https://traffic.omny.fm/d/clips/" + data.OrganizationId + "/" + data.ProgramId + "/" + data.Id + "/audio.mp3?requestSource=Widget&utm_source=OmnyFM&embeddedUrl=" + encodeURIComponent(src) + "&source=omnyfm",
							media_info: {
								type: "audio"
							}
						});
						urls.push(data.Images.Original);
						return cb(fillobj_urls(urls, obj));
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "omny.fm" ||
			domain_nowww === "omnycontent.com") {
			return src.replace(/([?&]size=)[^&]+/, "$1Original");
		}
		if (domain === "st.pussyspace.com") {
			if (/\/style\/+[0-9]+\/+img\/+bg\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain_nowww === "pussyspace.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+vid-([0-9]+)/,
				query_for_id: "https://www.pussyspace.com/vid-${id}",
				process: function(done, resp, cache_key) {
					var unpacked = common_functions["unpack_packer"](resp.responseText);
					if (!unpacked) {
						console_error(cache_key, "Unable to find packed data for", resp);
						return done(null, false);
					}
					var query_pussyspace = function(id, endpoint, cb) {
						var cache_key = "pussyspace:" + endpoint + ":" + id;
						api_query(cache_key, {
							url: "https://www.pussyspace.com/get/player/" + endpoint + "/",
							method: "POST",
							headers: {
								Accept: "*/*",
								"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
								Origin: "https://www.pussyspace.com",
								Referer: resp.finalUrl,
								"X-Requested-With": "XMLHttpRequest"
							},
							data: "id=" + id
						}, cb, function(done, resp, cache_key) {
							var match = resp.responseText.match(/pipi\['file'\]\s*=\s*'(https?%3A[^']+)';/);
							if (!match) {
								console_error(cache_key, "Unable to find match for", resp);
								return done(null, false);
							}
							return done(decodeURIComponent(match[1]), 60 * 60);
						});
					};
					var match = unpacked.match(/multiShowPlayer\('([^']+)','([^']+)'\);/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", { resp: resp, unpacked: unpacked });
						return done(null, false);
					}
					query_pussyspace(match[1], match[2], function(url) {
						if (!url) {
							return done(null, false);
						}
						return done({
							url: url,
							extra: {
								page: resp.finalUrl
							}
						});
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "unselfishporn.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+player\/+([0-9]+)\/+/,
				query_for_id: "http://www.unselfishporn.com/player/${id}/a/",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/var url_encoded\s*=\s*'([^']+)';/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done({
						url: base64_decode(match[1]),
						is_pagelink: true
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "pic.unselfishporn.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+thumbs\/+.\/+.{3}\/+([0-9]+)\.[^/.]+(?:[?#].*)?$/, "https://www.unselfishporn.com/player/$1/a/");
			if (newsrc !== src) {
				return {
					url: newsrc,
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "tgstat.ru" && /^static[0-9]*\./.test(domain)) {
			return src.replace(/\/channels\/+_[0-9]+\//, "/channels/_0/");
		}
		if (domain === "fhg.houseoftaboo.com" ||
			domain === "fhg.handsonhardcore.com" ||
			domain === "fhg.1by-day.com") {
			if (/\/images\/+show\.png(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nosub === "shbdn.com" && /^s[0-9]*\./.test(domain)) {
			if (/\/assets\/+images\/+[a-z]+-arrow:[0-9a-f]{10,}\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nosub === "shbdn.com" && /^i[0-9]*\./.test(domain)) {
			match = src.match(/^([a-z]+:\/\/[^/]+\/+photos\/+(?:[0-9]{2}\/+){3})(?:[a-z0-9]+_)?([0-9]{4,}[a-z0-9]{3}\.[^/.]+)(?:[?#].*)?$/);
			if (match) {
				return replace_sizes(src, [
					{ url: match[1] + "x16_" + match[2], problems: { watermark: true, possibly_upscaled: true } },
					{ url: match[1] + "big_" + match[2], problems: { watermark: true, possibly_upscaled: true } },
					{ url: match[1] + "x5_" + match[2], problems: { watermark: true, possibly_upscaled: true } },
					{ url: match[1] + match[2], problems: { watermark: true } },
					{ url: match[1] + "lthmb_" + match[2], problems: { smaller: true } },
					{ url: match[1] + "thmb_" + match[2], problems: { smaller: true } }
				]);
			}
		}
		if (amazon_container === "orebtvnsretjvneokqmefoiunm") {
			if (/\/uploads\/+img(?:-[a-z]+)?\/+(?:[0-9]+prc\/+)?community-(?:featured|article)-mask-v2/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			newsrc = src.replace(/(\/uploads\/+img)(?:-[a-z]+)?\/+(?:[0-9]+prc\/+)?/, "$1/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "asiansister.com") {
			obj = {
				extra: {}
			};
			match = src.match(/\/images\/+items\/+[0-9]+\/+([0-9]+)_([0-9]+)_[^/]+$/);
			if (match) {
				obj.extra.page = "https://asiansister.com/viewImg.php?code=" + match[1] + "&id=" + match[2];
			}
			var urls = [src];
			newsrc = src.replace(/(\/images\/+items\/+[0-9]+\/+[0-9]+_[0-9]+_[0-9a-zA-Z]+)_t(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				urls = add_extensions(newsrc);
			return fillobj_urls(urls, obj);
		}
		if (host_domain_nosub === "sankakucomplex.com" && options.element) {
			var el = common_functions["get_link_el_matching"](options.element, function(el) {
				if (/:\/\/[^/]+\/+(?:[a-z]+\/+)?post(?:\/+show|s)\/+[0-9a-f]+(?:[?#].*)?$/.test(el.href)) {
					return true;
				}
			});
			if (el && el.href !== src) {
				return {
					url: el.href,
					is_pagelink: true
				};
			}
			if (/\/data\/+sample\//.test(src) && options.element.tagName === "IMG") {
				el = common_functions["get_link_el_matching"](options.element, function(el) {
					if (/^(?:[a-z]+:)?\/\/[^/]+\/+data\/+[0-9a-f]{2}\/+/.test(el.href)) {
						return true;
					}
				});
				if (el) {
					return el.href;
				}
			}
		}
		if (domain === "is.sankakucomplex.com" ||
			domain === "s.sankakucomplex.com" ||
			domain === "v.sankakucomplex.com") {
			var base_2 = {
				url: src,
				headers: {
					Referer: "https://www.sankakucomplex.com/" // or ""
				}
			};
			match = src.match(/\/data\/+(?:preview|sample)\/+[0-9a-f]{2}\/+[0-9a-f]{2}\/+([0-9a-f]{10,})\./);
			if (match) {
				return [
					{
						url: "https://chan.sankakucomplex.com/posts/" + match[1],
						is_pagelink: true
					},
					base_2
				];
			} else {
				return base_2;
			}
		}
		if (domain_nosub === "sankakucomplex.com") {
			newsrc = website_query({
				website_regex: /^([a-z]+:\/\/[^/]+\/+(?:[a-z]+\/+)?post(?:\/+show|s)\/+[0-9a-f]+)(?:[?#].)?$/,
				query_for_id: "${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<a id=image-link class=sample href="(\/\/(?:[^/]+\.)?sankakucomplex\.com\/[^"]+)"/);
					if (!match) {
						match = resp.responseText.match(/<video id=image (?:(?:width|height)=[0-9]+\s+){0,}src="(\/\/(?:[^/]+\.)?sankakucomplex\.com\/[^"]+)"/);
					}
					if (!match) {
						match = resp.responseText.match(/<a id=image-link class=full>\s*<img[^>]+ src="(\/\/(?:[^/]+\.)?sankakucomplex\.com\/[^"]+)"/);
					}
					if (!match) {
						match = resp.responseText.match(/<a href="(\/\/(?:[^/]+\.)?sankakucomplex\.com\/[^"]+)" id=highres itemprop=contentUrl/);
					}
					if (!match) {
						match = resp.responseText.match(/<a id="highres" itemprop="contentUrl"[^>]* href="(\/\/(?:[^/]+\.)?sankakucomplex\.com\/[^"]+)"/);
					}
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var newsrc = urljoin(resp.finalUrl, decode_entities(match[1]), true);
					done({
						url: newsrc,
						extra: {
							page: resp.finalUrl
						},
						headers: {
							Referer: resp.finalUrl
						}
					}, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "vid.dobbyporn.com") {
			newsrc = src.replace(/:\/\/[^/]+\/+s\/+thumbs\/+[^/]\/+[^/]{3}\/+([0-9]+)\.[^/.]+(?:[?#].*)?$/, "://dobbyporn.com/video/$1.html");
			if (newsrc)
				return {
					url: newsrc,
					is_pagelink: true
				};
		}
		if (domain_nowww === "dobbyporn.com" ||
			domain_nowww === "colliderporn.com") {
			newsrc = src.replace(/^([a-z]+:\/\/[^/]+\/+)video\/+([0-9]+)\.html(?:[?&#].*)?$/, "$1best/babe/?video=$2");
			if (false && newsrc !== src) {
				return {
					url: newsrc,
					is_pagelink: true
				};
			}
			match = src.match(/^([a-z]+:\/\/[^/]+\/+video\/+[0-9]+\.html)(?:[?&#].*)?$/);
			if (false && match && !/[?&]rand=/.test(src)) {
				return {
					url: src.replace(/(\.html)(?:[?#].*)?$/, "$1&rand=" + get_random_text(10)),
					is_pagelink: true
				};
			}
			newsrc = website_query({
				website_regex: [
					/^([a-z]+:\/\/[^/]+\/+v\/+[0-9]+\.html)(?:[?#].*)?$/,
					/^([a-z]+:\/\/[^/]+\/+video\/+[0-9]+\.html(?:[?&#].*)?)$/
				],
				query_for_id: function(id) {
					return {
						url: id,
						imu_mode: "document",
						headers: {
							Referer: id
						}
					};
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/window\.open\("\/video\/[0-9]+\.html&rand=/);
					if (match && !/&rand=/.test(resp.finalUrl)) {
						return done({
							url: resp.finalUrl + "&rand=" + get_random_text(10),
							is_pagelink: true
						}, false);
					}
					match = resp.responseText.match(/window\.location\.href = "(\/[^"]+\?video=[0-9]+)";/);
					if (!match) {
						console_error(cache_key, "Unable to find redirect match for", resp);
						return done(null, false);
					}
					return done({
						url: urljoin(resp.finalUrl, match[1], true),
						is_pagelink: true
					}, 60);
				}
			});
			if (newsrc)
				return newsrc;
			newsrc = website_query({
				website_regex: [
					/^([a-z]+:\/\/[^/]+\/+[a-z]+\/+[a-z]+\/+\?(?:.*&)?video=[0-9]+.*?)$/
				],
				query_for_id: function(id) {
					return {
						url: id,
						imu_mode: "document",
						headers: {
							Referer: id
						}
					};
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<iframe id="extvidx" src="(?:javascript:window\.location\.replace\(')?(https?:\/\/[^"']+)(?:'\))?"/);
					if (!match) {
						console_error(cache_key, "Unable to find iframe match for", resp);
						return done(null, false);
					}
					return done({
						url: decode_entities(match[1]),
						is_pagelink: true
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "freedroid.org") return src.replace(/(\/images\/+screenshots\/+[^/]+)\.thumb_default_(?:[whq][0-9]+){1,}\./, "$1.");
		if (domain === "shop.new-art.nl") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+assets\/+image\.php\?(?:.*&)?image=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src) {
				return urljoin("https://shop.new-art.nl/", decodeURIComponent(newsrc), false);
			}
		}
		if (domain_nowww === "asianpussy.fun" ||
			domain_nowww === "teencumpot.com" ||
			domain_nowww === "babesxcam.com" ||
			domain_nowww === "collegehdsex.com" ||
			domain_nowww === "18girlssex.com" ||
			domain_nowww === "xxx-hd-tube.com" ||
			domain_nowww === "nakedteens.fun" ||
			domain_nowww === "xxx-porn.video" ||
			domain_nowww === "asianporn.life" ||
			domain_nowww === "teenporn19.com") {
			if (/^[a-z]+:\/\/[^/]+\/+d\/+[0-9a-z]{8}_gs\.png(?:[?#].*)?$/.test(src))
				return {
					url: src,
					bad: "mask"
				};
			newsrc = website_query({
				website_regex: /^([a-z]+:\/\/[^/]+\/+flplayer\.php\?id=[0-9]+)/,
				query_for_id: function(id) {
					return {
						url: id,
						headers: {
							"Sec-Fetch-Dest": "iframe",
							"Sec-Fetch-Mode": "navigate",
							"Sec-Fetch-Site": "cross-site",
							"Referer": "https://" + domain + "/"
						}
					};
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/document\.write\(atob\(atob\("([^"]+)"\)\)\);/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var decoded = base64_decode(base64_decode(match[1]));
					match = decoded.match(/<source src="([^"]+)" type="([^"]+)"/);
					if (!match) {
						console_error("Unable to find source match from", { resp: resp, decoded: decoded });
						return done(null, false);
					}
					var video;
					if (match[2] === "video/mp4") {
						video = true;
					} else if (match[2] === "application/x-mpegURL") {
						video = "hls";
					} else {
						console_error("Unknown video type", { resp: resp, decoded: decoded, match: match });
						return done(null, false);
					}
					return done({
						url: match[1],
						video: video
					}, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
			newsrc = website_query({
				website_regex: /^([a-z]+:\/\/[^/]+\/+(?:gallery|teen(?:video)?s|(?:hd)?videos?)\/+[^/.]*(?:\/+index)?\.html)(?:[?#].*)?$/,
				query_for_id: "${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/document\.write\(atob\([^)]+\)\.replace\('#+',\s*(?:'([0-9]+)'|(contentId))\)/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var content_id = match[1];
					if (!content_id && match[2]) {
						var varname = match[2];
						match = resp.responseText.match(new RegExp("var " + varname + " = ([0-9]+);"));
						if (!match) {
							console_error(cache_key, "Unable to find varname match for", { resp: resp, varname: varname });
							return done(null, false);
						}
						content_id = match[1];
					}
					var subdomain = domain;
					if (domain_nosub === "teenporn19.com" ||
						domain_nosub === "18girlssex.com" ||
						domain_nosub === "xxx-hd-tube.com" ||
						domain_nosub === "collegehdsex.com") {
						subdomain = "teencumpot.com";
					}
					return done({
						url: "https://" + subdomain + "/flplayer.php?id=" + content_id,
						is_pagelink: true
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "cdn.photos.sparkplatform.com") return src.replace(/(\/cbr\/+[0-9]{10,})(?:-t)?(\.[^/.]+)(?:[?#].*)?$/, "$1-o$2");
		if (domain === "cdn.resize.sparkplatform.com") return src.replace(/:\/\/[^/]+\/+cbr\/+[0-9]+x[0-9]+\/+[a-z]+\/+([0-9]{10,}(?:-[a-z])?\.[^/.]+)(?:[?#].*)?$/, "://cdn.photos.sparkplatform.com/cbr/$1");
		if (domain_nowww === "jetphotos.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+api\/+json\/+heroimg\.php\?(?:.*&)?src=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "cdn.jetphotos.com") return src.replace(/(:\/\/[^/]+\/+)[0-9]+(\/+[0-9]+\/+[0-9]+_[0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1full$2");
		if (domain === "cdn.airplane-pictures.net") return src.replace(/(\/images\/+uploaded-images\/+[0-9]{4}\/+(?:[0-9]{1,2}\/+){2}[0-9]+)[ms]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "airteamimages.com") return src.replace(/(\/pics\/+[0-9]+\/+[0-9]+)_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1_big$2");
		if (domain === "freighter.flyteam.jp") return src.replace(/(\/(?:news)?photo\/+[0-9]+\/+)(?:[0-9]+x[0-9]+|[wh][0-9]+)(\.[^/.]+)(?:[?#].*)?$/, "$1src$2");
		if (domain_nowww === "game-ost.com") return src.replace(/(\/static\/+[^/]+\/+[0-9]\/+[0-9]\/+[0-9]+_[0-9]+)_(?:thumb|small|medium)(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "imgdist.net") return src.replace(/(\/p\/+)w300\/+/, "$11280/");
		if (domain_nowww === "gamersgallery.com") return src.replace(/(\/gallery\/+data\/+[0-9]+\/+)thumbs\/+/, "$1");
		if (domain_nowww === "defunctgames.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+includes\/+shows\/+reviewimage\.php\?(?:.*&)?i=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return urljoin(src, decodeURIComponent(newsrc), true);
		}
		if (domain === "forum.donanimhaber.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+cache-v2\/+\?(?:.*&)?path=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "static-cdn.qmov.com") return src.replace(/\/photos_thumbs\//, "/photos/");
		if (domain === "m.sprashivalka.com") return src.replace(/(:\/\/[^/]+\/+)[0-9]+x[0-9]+(\/+(?:[0-9a-f]{3}\/+){3})/, "$1orig$2");
		if (domain_nowww === "babesjoy.com") return src.replace(/(\/galleries\/+[^/]+\/+thumbs\/+[^/]+\/+[0-9]+)th(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "izlesene.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+(?:[^/]+\/+)?([0-9]+).*$/,
				query_for_id: "https://www.izlesene.com/video/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/window\._videoObj = ({.*});/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					var levels = json.media.level;
					levels.sort(function(a, b) {
						return parseInt(b.value) - parseInt(a.value);
					});
					var obj = {
						extra: {}
					};
					if (json.videoTitle)
						obj.extra.caption = json.videoTitle;
					if (json.videoPageURL)
						obj.extra.page = json.videoPageURL;
					var urls = [];
					urls.push({
						url: levels[0].source,
						video: true,
						headers: {
							Referer: resp.finalUrl
						}
					});
					if (false && json.posterURL)
						urls.push(json.posterURL);
					return done(fillobj_urls(urls, obj), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "imgiz.com" && /^i[0-9]*\./.test(domain)) {
			newsrc = src.replace(/\/rshots\/+([0-9]+)\/+[^/]+_([0-9]+-[0-9]+)_[0-9]+x[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "/data/videoshots/$1/$2$3");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/rshots\/+[0-9]+\/+[^/]+_([0-9]+)-[0-9]+_[0-9]+x[0-9]+\.[^/.]+(?:[?#].*)?$/);
			if (!match)
				match = src.match(/\/data\/+videoshots\/+[0-9]+\/+([0-9]+)-[0-9]+\.[^/.]+(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://www.izlesene.com/video/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain === "cloudimagesstg.storyfire.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+\?(?:.*&)?url=([^&]+).*/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "s.ecrater.com") return src.replace(/(\/stores\/+[0-9]+\/+[0-9a-f]{5,}_[0-9]+)[a-z](\.[^/.]+)(?:[?#].*)?$/, "$1b$2");
		if (host_domain_nowww === "discogs.com" && options.element) {
			if (options.element.tagName === "IMG") {
				var current = options.element;
				while (current = current.parentElement) {
					if (current.tagName === "DIV" && current.hasAttribute("data-images")) {
						var images = JSON_parse(current.getAttribute("data-images"));
						var found_image = false;
						array_foreach(images, function(image) {
							if (!image.full)
								return;
							var full_basename = url_basename(image.full).replace(/\..*/, "");
							var src_basename = url_basename(src).replace(/\..*/, "");
							if (full_basename === src_basename) {
								found_image = image.full;
								return false;
							}
						});
						if (found_image && found_image !== src)
							return found_image;
					}
				}
			}
		}
		if (domain === "img.discogs.com") return src.replace(/^[a-z]+:\/\/[^/]+\/[^/]+=\/.*\/discogs-images\/([^/?#]+)\.[^/.]+(?:[?#].*)?$/, "https://www.discogs.com/image/$1");
		if (domain === "i.discogs.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+([-A-Z0-9]+\.[^/.?#]+)\?.*$/, "https://www.discogs.com/image/$1");
		if (domain_nowww === "discogs.com" && options.do_request && options.cb) {
			match = src.match(/\/image\/+([AR])-([0-9]+)-/);
			if (match) {
				var type = match[1];
				if (type === "A")
					type = "artist";
				else if (type === "R")
					type = "release";
				var discogs_id = match[2];
				common_functions["query_discogs_images"](options, type, discogs_id, function(images) {
					if (!images || !images.length)
						return options.cb(null);
					var found_image = null;
					array_foreach(images, function(image) {
						var image_basename = url_basename(image).replace(/\..*/, "");
						var src_basename = url_basename(src).replace(/\..*/, "");
						if (image_basename === src_basename) {
							found_image = image;
							return false;
						}
					});
					if (!found_image) {
						console_warn("Unable to find image from", images);
						return options.cb(null);
					}
					return options.cb([
						{ url: src },
						{ url: found_image }
					]);
				});
				return {
					waiting: true
				};
			}
		}
		if (domain === "geo-media.beatsource.com") return src.replace(/\/image_size\/+[0-9]+x[0-9]+\/+/, "/");
		if (domain_nowww === "meijer.com") return src.replace(/(\/content\/+dam\/+[^/]+\/+product\/+.*?\/[0-9]+_[0-9]+_[0-9A-Z]+_)(?:0[0-9]{3}|11[0-9]{2})\./, "$11200.");
		if (domain_nowww === "kroger.com") return src.replace(/(\/product\/+images\/+)(?:thumbnail|medium|small|large)(\/+[a-z]+\/+[0-9]+)(?:[?#].*)?$/, "$1xlarge$2");
		if (domain_nosub === "tn-cloud.net" && /^wpcdn\./.test(domain)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+([^/]+\.[^/]+\/+content\/+uploads\/)/, "https://$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "imago-images.de" ||
			domain === "cdn.imago-images.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+st\/+([0-9]+)(?:[?#].*)?$/);
			if (match) {
				return [
					"https://" + domain + "/bild/st/" + match[1] + "/s.jpg",
					{ url: src, is_pagelink: true }
				];
			}
			match = src.match(/^[a-z]+:\/\/[^/]+\/+bild\/+st\/+([0-9]+)\/+([slwmh])(\.[^/.?#]+)(?:#.*)?$/);
			if (match) {
				var prefix = "https://" + domain + "/bild/st/" + match[1] + "/";
				var ext = match[3];
				var oururl = prefix + match[2] + ext;
				var images = {
					smaller: [
						prefix + "s" + ext,
						prefix + "l" + ext
					],
					watermark: [
						prefix + "w" + ext,
						{ url: prefix + "m" + ext, hidden: true },
						{ url: prefix + "h" + ext, hidden: true }
					]
				};
				var objs = {};
				for (var key in images) {
					var our_images = images[key];
					var our_obj = [];
					var problemobj = {};
					problemobj[key] = true;
					array_foreach(our_images, function(image, i) {
						if (typeof image === "string") {
							our_images[i] = { url: image };
							image = our_images[i];
						}
						if (image.url === oururl) {
							for (var j = 0; j < i; j++) {
								if (!our_images[j].hidden)
									our_obj.push(our_images[j].url);
							}
							our_obj.push({
								url: our_images[i].url,
								problems: deepcopy(problemobj)
							});
							return false;
						}
					});
					if (our_obj.length === 0) {
						array_foreach(our_images, function(image) {
							if (!image.hidden) {
								our_obj.push({
									url: image.url,
									problems: deepcopy(problemobj)
								});
								return false;
							}
						});
					}
					objs[key] = our_obj;
				}
				var urls = [];
				array_extend(urls, objs.watermark);
				array_extend(urls, objs.smaller);
				var baseobj_10 = {
					extra: {
						page: "https://www.imago-images.de/st/" + match[1]
					}
				};
				return fillobj_urls(urls, baseobj_10);
			}
		}
		if (domain_nowww === "banned.video" ||
			domain === "api.banned.video") {
			var getvideo_query = "query GetVideo($id: String!) {\n  getVideo(id: $id) {\n    ...DisplayVideoFields\n    streamUrl\n    directUrl\n    audio\n    unlisted\n    live\n    tags {\n      _id\n      name\n      __typename\n    }\n    sale {\n      _id\n      text\n      __typename\n    }\n    __typename\n  }\n}\n\nfragment DisplayVideoFields on Video {\n  _id\n  title\n  summary\n  playCount\n  largeImage\n  embedUrl\n  published\n  videoDuration\n  channel {\n    _id\n    title\n    avatar\n    __typename\n  }\n  createdAt\n  __typename\n}\n";
			var getvideo_opname = "GetVideo";
			var query_banned_graphql = function(opname, query, vars, cb) {
				api_query("banned_graphql:" + opname + ":" + JSON_stringify(vars), {
					method: "POST",
					url: "https://api.banned.video/graphql",
					imu_mode: "xhr",
					headers: {
						"Content-Type": "application/json",
						"Origin": "https://banned.video",
						"Referer": "https://banned.video/",
						"apollographql-client-name": "banned-web",
						"apollographql-client-version": "1.3"
					},
					json: true,
					data: JSON_stringify({
						operationName: opname,
						query: query,
						variables: vars
					})
				}, cb, function(done, resp) {
					done(resp, 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+watch\?(?:.*&)?id=([0-9a-f]{10,})/,
					/^[a-z]+:\/\/[^/]+\/+embed\/+([0-9a-f]{10,})(?:[?#].*)?$/
				],
				run: function(cb, match) {
					var id = match[1];
					query_banned_graphql(getvideo_opname, getvideo_query, { id: id }, function(data) {
						if (!data) {
							return cb(null);
						}
						data = data.data.getVideo;
						var urls = [];
						if (data.streamUrl) {
							urls.push({
								url: data.streamUrl,
								video: "hls"
							});
						}
						if (data.directUrl) {
							urls.push({
								url: data.directUrl,
								video: true
							});
						}
						if (data.largeImage) {
							urls.push({
								url: data.largeImage
							});
						}
						var baseobj = {
							extra: {}
						};
						if (data.title || data.summary) {
							baseobj.extra.caption = data.tile || data.summary;
						}
						baseobj.extra.page = "https://banned.video/watch?id=" + id;
						return cb(fillobj_urls(urls, baseobj));
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "auntjudys.com") {
			return src
				.replace(/(\/tour\/+content\/+upload\/.*\/)thumbs\/+/, "$1fullwatermarked/")
				.replace(/(:\/\/[^/]+\/+content\/+[a-z]\/+[a-z]{3}[0-9]{3}\/+[0-9]+\/+[0-9]+)(\.[^/.]+)(?:[?#].*)?$/, "$1-large$2");
		}
		if (domain === "d2eehagpk5cl65.cloudfront.net" ||
			domain_nowww === "reason.com") {
			newsrc = src
				.replace(/(:\/\/[^/]+\/+wp-content\/+uploads\/.*?\.jpe?g)\.webp(?:[?#].*)?$/i, "$1")
				.replace(/(:\/\/[^/]+\/+)img\/+(?:-?(?:c[0-9]+x[0-9]+|[whq][0-9]+))+\/+uploads\/+/, "$1wp-content/uploads/");
			if (newsrc !== src)
				return newsrc;
		}
		if (amazon_container === "reasonmagazine-covers") {
			return src.replace(/(:\/\/[^/]+\/+[0-9]{4}-[0-9]{2}-[0-9]{2})_[a-z]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "d2d8wwwkmhfcva.cloudfront.net") {
			return add_http(src.replace(/^[a-z]+:\/\/[^/]+\/+[0-9]+x[0-9]*\/+(?:filters:[^/]+\/+)?([^/]+\.[^/]+\/+)/, "$1"));
		}
		if (domain === "d2lnr5mha7bycj.cloudfront.net") {
			newsrc = src.replace(/(\/product-image\/+file\/+)[a-z]+_/, "$1");
			return force_https(newsrc);
		}
		if (domain_nowww === "hizliresim.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([a-zA-Z]+)(?:[?#].*)?$/,
				query_for_id: "https://hizliresim.com/${id}",
				process: function(done, resp, cache_key) {
					var imagelink = resp.responseText.match(/<a class="fancybox"[\s\S]*?<img src="(https?:\/\/i\.hizliresim\.com\/[^"/]+\.[^/."]+)"/);
					if (!imagelink) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					imagelink = decode_entities(imagelink[1]);
					var obj = {
						url: imagelink,
						extra: {
							page: resp.finalUrl
						}
					};
					var caption = get_meta(resp.responseText, "description");
					if (caption)
						obj.extra.caption = caption;
					return done(obj, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "eksisozluk.com" ||
			domain_nowww === "eksisozluk1923.com" ||
			domain_nowww === "eksisozluk1999.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+img\/+([a-zA-Z0-9]+)(?:[?#].*)?$/,
				query_for_id: {
					url: "https://eksisozluk.com/img/${id}",
					non200_ok: true
				},
				process: function(done, resp, cache_key) {
					var imagelink = resp.responseText.match(/<a id="image-zoom"[^>]* href="(https?:\/\/cdn\.eksisozluk.com\/[^"]+)"/);
					if (!imagelink) {
						imagelink = get_meta(resp.responseText, "og:image");
						if (imagelink)
							imagelink = [null, imagelink]; // hack
					}
					if (!imagelink) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					imagelink = decode_entities(imagelink[1]);
					var obj = {
						url: imagelink,
						extra: {
							page: resp.finalUrl
						}
					};
					return done(obj, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "soz.lk") {
			match = src.match(/\/i\/+([0-9a-zA-Z]+)(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://eksisozluk1923.com/img/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "feet9.com") {
			var parse_source_from_ciphered_json = function(CryptoJS, json) {
				var JsonFormatter = common_functions["get_jsonformatter_for_cryptojs"](CryptoJS);
				json = JSON_parse(json);
				json.ct = reverse_str(json.ct);
				var stringified = JSON_stringify(json);
				var source = JSON_parse(CryptoJS.AES.decrypt(stringified, "0x23", {
					'format': JsonFormatter
				}).toString(CryptoJS.enc.Utf8));
				return source;
			};
			var get_source_from_ciphered_json = function(cache_key, json, cb) {
				get_library("cryptojs_aes", options, options.do_request, function(CryptoJS) {
					if (!CryptoJS) {
						console_error(cache_key, "Unable to fetch CryptoJS");
						return cb(null);
					}
					var source;
					try {
						source = parse_source_from_ciphered_json(CryptoJS, json);
					} catch (e) {
						console_error(cache_key, e);
						return cb(null);
					}
					return cb(source);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([0-9]+)(?:\/+(?:[^/]+\/*)?)?(?:[?#].*)?$/,
				query_for_id: "https://www.feet9.com/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/inivideo\('[0-9]+','({".*?"})',/);
					if (!match) {
						console_error(cache_key, "Unable to find inivideo match for", resp);
						return done(null, false);
					}
					var title = get_meta(resp.responseText, "og:title");
					get_source_from_ciphered_json(cache_key, match[1], function(source) {
						if (!source)
							return done(null, false);
						var obj = {
							url: source,
							extra: {
								page: resp.finalUrl
							},
							headers: {
								Accept: "*/*",
								Referer: "https://www." + domain_nosub + "/",
								"Sec-Fetch-Dest": "video",
								"Sec-Fetch-Mode": "no-cors",
								"Sec-Fetch-Site": "same-site"
							},
							video: true
						};
						if (title)
							obj.extra.caption = title;
						return done(obj, 60 * 60);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "10363-2.s.cdn13.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+media\/+videos\/+tmb\/+((?:[0-9]+\/+){3})/);
			if (match) {
				id = match[1].replace(/\//g, "");
				return { url: "https://www.feet9.com/" + id, is_pagelink: true };
			}
		}
		if (domain_nowww === "absolugirl.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video([0-9]*-[0-9a-zA-Z]+)\.html(?:[?#].*)?$/,
				query_for_id: "http://www.absolugirl.com/video${id}.html",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<script[\s\S]+?servervideo = '([^']+)';\s*path = '([^']+)';\s*repp = codage\('([^']+)'\);\s*filee = '([^']+)';/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var servervideo = match[1];
					var path = match[2];
					var repp = match[3];
					var filee = match[4];
					common_functions.get_md5(options, repp, function(repp) {
						if (!repp)
							return done(null, false);
						var obj = {
							url: servervideo + path + repp + filee,
							headers: {
								Referer: "http://www.absolugirl.com/"
							},
							video: true
						};
						return done(obj, 6 * 60 * 60);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "api.tipeee.com") return src.replace(/(\/cache\/+[0-9]+\/+media\/+)[0-9]+\/+[0-9]+\/+zoom\/+([0-9]+\/+[0-9a-f]{20,}\.)/, "$1$2");
		if (amazon_container === "games.med") {
			return src.replace(/(:\/\/(?:[^/]+\/+)?)games\.med([/.])/, "$1games.snapshot$2");
		}
		if (domain_nosub === "appleinsider.com" && /^photos[0-9]*\./.test(domain)) {
			return src.replace(/(\/gallery\/+[0-9]+-[0-9]+-[^/]+)-(?:[sml]|xl)(\.[^/.]+)(?:[?#].*)?$/, "$1-o$2");
		}
		if (domain === "file.veryzhun.com") return src.replace(/(\/buckets\/+[^/]+\/+keys\/+[0-9]{8}-[0-9]+-[a-zA-Z0-9]+\.[^/.!?#]+)(?:[!?#].*)?$/, "$1");
		if (domain === "attachments.f95zone.to") return src.replace(/(:\/\/[^/]+\/+[0-9]{4}\/+[0-9]{2}\/+)thumb\/+/, "$1");
		if (domain === "coubsecure-s.akamaihd.net" ||
			domain === "coub-attachments.akamaized.net" ||
			domain === "coub-anubis-a.akamaized.net") {
			return src.replace(/(\/cw_[^/]+\/+(?:[0-9a-f]{10,}\/+){1,2})(?:(?:[a-z]+|[0-9]+x)_){1,}([0-9]+_[^/]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "coub.com") {
			var query_coub_api = function(csrf, vid, cb) {
				api_query("coub_video:" + vid, {
					url: "https://coub.com/api/v2/coubs/" + vid,
					imu_mode: "xhr",
					headers: {
						Referer: "https://coub.com/view/" + vid,
						"X-Requested-With": "XMLHttpRequest",
						"X-CSRF-Token": csrf
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					return done(resp, 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+view\/+([0-9a-z]+)(?:[?#].*)?$/,
				query_for_id: "https://coub.com/view/${id}",
				process: function(done, resp, cache_key, match) {
					var csrf_token = get_meta(resp.responseText, "csrf-token");
					if (!csrf_token) {
						console_error(cache_key, "Unable to get CSRF token from", resp);
						return done(null, false);
					}
					var vid = match[1];
					query_coub_api(csrf_token, vid, function(data) {
						if (!data)
							return done(null, false);
						var obj = {
							extra: {
								page: "https://coub.com/view/" + vid,
								caption: data.title
							}
						};
						var urls = [];
						if (data.file_versions.share && data.file_versions.share.default)
							urls.push({
								url: data.file_versions.share.default,
								video: true
							});
						if (data.picture)
							urls.push(data.picture);
						if (data.file_versions.html5) {
							var dash = {
								duration: data.duration,
								audios: [],
								videos: []
							};
							var versions = data.file_versions.html5;
							var formats = [];
							for (var key in versions.audio) {
								formats.push({
									bandwidth: versions.audio[key].size,
									url: versions.audio[key].url,
									type: "audio",
									id: "audio_" + key
								});
							}
							for (var key in versions.video) {
								formats.push({
									bandwidth: versions.video[key].size,
									url: versions.video[key].url,
									type: "video",
									id: "video_" + key
								});
							}
							common_functions["process_formats"](api_cache, options, formats, function() {
								array_foreach(formats, function(format) {
									if (format.type === "video") {
										dash.videos.push(format);
									} else if (format.type === "audio") {
										dash.audios.push(format);
									}
								});
								var dash_stream = common_functions["create_dash_stream"](dash);
								urls.unshift({
									url: "data:application/dash+xml," + encodeURIComponent(dash_stream),
									video: "dash"
								});
								return done(fillobj_urls(urls, obj), 60 * 60);
							});
						} else {
							return done(fillobj_urls(urls, obj), 60 * 60);
						}
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "18qt.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+go\/+\?(?:.*&)?url=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return {
					url: decodeURIComponent(newsrc),
					is_pagelink: true
				};
		}
		if (host_domain_nowww === "18qt.com") {
			var newsrc = common_functions["get_pagelink_el_matching"](options.element, /^[a-z]+:\/\/(?:www\.)?18qt\.com\/+go\/+\?(?:.*&)?url=/);
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "neongalleries.com") {
			return {
				url: src.replace(/\/TN_([0-9]+\.[^/.]+)(?:[?#].*)?$/, "/$1"),
				headers: {
					Referer: ""
				},
				referer_ok: {
					same_domain_nosub: true
				}
			};
		}
		if (domain === "images.sexy-beauties.com" ||
			domain === "images.gorgeousbeauties.pics" ||
			domain === "images.sexynudeparadise.com" ||
			domain === "images.nakedbigtitspics.com") {
			return src.replace(/(\/pics\/+[^/]+\/+)thumbs\/+([0-9]+\.)/, "$1$2");
		}
		if (domain_nowww === "watch4beauty.com") {
			newsrc = src.replace(/(:\/\/[^/]+\/+api\/+[^/]+\/+[0-9]{8}-[^/.?#]+-[0-9]+-[0-9]{3})-(?:480|640|960|1280|1920)(\.[^/.?#]+)(?:[?#].*)?$/, "$1-2560$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (host_domain_nowww === "watch4beauty.com" && domain === "f3b4x6b2.ssl.hwcdn.net") {
			var get_preloaded_state = function() {
				var scripts = document.getElementsByTagName("script");
				var state = null;
				array_foreach(scripts, function(script) {
					var match = script.innerHTML.match(/^\s*window\.__PRELOADED_STATE__\s*=\s*({.*});\s*$/);
					if (!match)
						return;
					try {
						state = JSON_parse(match[1]);
					} catch (e) {
						console_error(e);
						return false;
					}
				});
				return state;
			};
			var get_album_id_from_state = function(state) {
				return state.watch.issues.currentIssueDetail.id;
			};
			var get_album_info = function(state, id) {
				return state.watch.issues.magazinesMergeTitle[id];
			};
			match = src.match(/^[a-z]+:\/\/[^/]+\/+production\/+([0-9]{8}-[^/.?#]+)-(?:480|640|960|1280|1920)(\.[^/.?#]+)(?:[?#].*)?$/);
			if (match) {
				obj = {
					headers: {
						Referer: "https://www.watch4beauty.com/"
					},
					redirects: true,
					can_head: false
				};
				var state = get_preloaded_state();
				if (state) {
					try {
						var album_id = get_album_id_from_state(state);
						var album_info = get_album_info(state, album_id);
						var album_size = zpadnum(album_info.issue_size, 3);
					} catch (e) {
						console_error(e, state);
					}
					obj.url = "https://www.watch4beauty.com/api" + base64_decode("LzRqR2RUR1kyMHZreVZjeC8=") + match[1] + "-" + album_size + "-2560" + match[2];
				}
			}
		}
		if (domain_nowww === "streamye.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([a-z0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://www.streamye.com/${id}",
				process: function(done, resp) {
					var sources = common_functions["get_videotag_sources"](resp.responseText);
					if (!sources)
						return done(null, false);
					return done({
						url: norm_url(urljoin(resp.finalUrl, sources.video[0].url, true)),
						extra: {
							page: resp.finalUrl
						},
						headers: {
							Referer: resp.finalUrl
						},
						video: true
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "galleries.cdn.homemoviestube.com") return src.replace(/(:\/\/[^/]+\/+[0-9a-f]{5,}\/+)thumbs\/+([0-9a-f]{5,}\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "homemoviestube.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+videos\/+([0-9]+)\/+[^/?#]*\.html/,
				query_for_id: "https://www.homemoviestube.com/videos/${id}/.html",
				process: function(done, resp) {
					var obj = common_functions["get_videotag_obj"](resp);
					done(obj, obj ? 60 * 60 : false);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "youramateurporn.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+[^/]+-([0-9]+)\.html/,
				query_for_id: "https://www.youramateurporn.com/video/a-${id}.html",
				process: function(done, resp) {
					var obj = common_functions["get_videotag_obj"](resp);
					done(obj, obj ? 60 * 60 : false);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "pornone.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+[a-z]+\/+[^/]+\/+([0-9]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://pornone.com/machine/a/${id}/",
				process: function(done, resp) {
					var obj = common_functions["get_videotag_obj"](resp);
					done(obj, obj ? 60 * 60 : false);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "perfectgirls.net") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+gal\/+([0-9]+)(?:\/+[^/]*\/*)?(?:[?#].*)?$/,
				query_for_id: "https://perfectgirls.net/gal/${id}",
				process: function(done, resp) {
					var obj = common_functions["get_videotag_obj"](resp);
					done(obj, obj ? 60 * 60 : false);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "perfectgirls.net" && /^cdn-[a-z][0-9]*\./.test(domain)) {
			match = src.match(/\/thumbs\/+([0-9]+)\/+([0-9]+)\/+thumb/);
			if (match) {
				id = match[1] + match[2];
				return {
					url: "https://perfectgirls.net/gal/" + id + "/",
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "perfectgirls.net" && /^(?:[a-f0-9]+-)?cloud\./.test(domain)) {
			match = src.match(/\/a\/+[^/]+\/+[0-9]+\/+[0-9]+\/+([0-9]+)-th\./);
			if (match) {
				return {
					url: "https://perfectgirls.net/gal/" + match[1] + "/",
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "lovehomeporn.com" ||
			domain_nowww === "fuqer.com") {
			var query_lovehomeporn_config = function(site, vid, cb) {
				var baseurl = "";
				if (site === "lovehomeporn.com")
					baseurl = "https://lovehomeporn.com/media/nuevo/config.php";
				else if (site === "fuqer.com")
					baseurl = "https://www.fuqer.com/nuevo/player/config5.php";
				api_query("lovehomeporn_video:" + vid, {
					url: baseurl + "?key=" + vid,
					imu_mode: "xhr",
					headers: {
						Referer: "https://www." + site + "/"
					}
				}, cb, function(done, resp, cache_key) {
					var get_xml = function(tag) {
						var regex = new RegExp("<" + tag + ">(.*?)</" + tag + ">");
						var match = resp.responseText.match(regex);
						if (!match)
							return null;
						return decode_entities(match[1]);
					};
					var file = get_xml("file");
					var filehd = get_xml("filehd");
					var title = decode_entities(get_xml("title"));
					var thumb = get_xml("thumb");
					var image = get_xml("image");
					var url = get_xml("url");
					if (!thumb)
						thumb = image;
					var urls = [];
					if (filehd) {
						urls.push({
							url: filehd,
							video: true
						});
					}
					if (file) {
						urls.push({
							url: file,
							video: true
						});
					}
					if (thumb) {
						urls.push(thumb);
					}
					var obj = {
						headers: {
							Referer: url
						},
						extra: {
							page: url,
							caption: title
						}
					};
					return done(fillobj_urls(urls, obj), 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+video\/+([0-9]+)(?:\/+[^/]+)?(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+videos\/+[^/?#.]+-([0-9]+)\.html(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+nuevo\/+player\/+embed\.php\?(?:.*&)?key=([0-9]+)/
				],
				run: function(cb, match) {
					query_lovehomeporn_config(domain_nosub, match[1], cb);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "fuqer.com") {
			if (/\/templates\/+default\/+images\/+/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "cdn.static.lovehomeporn.com" || domain_nowww === "lovehomeporn.com") {
			if (/\/templates\/+frontend\/+purple\/+new_images\//.test(src))
				return {
					url: src,
					bad: "mask"
				};
			match = src.match(/\/media\/+videos\/+(?:main_thumbs\/+[^/]+\/+[0-9]{2}|tmb)\/+([0-9]+)\/+[0-9]+\.[^/.]+(?:[?#].*)?$/);
			if (match)
				return {
					url: "https://www.lovehomeporn.com/video/" + match[1],
					is_pagelink: true
				};
		}
		if (domain_nowww === "wilddream.net") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+art\/+view\/+([0-9]+)(?:[?#].*)?$/i,
				query_for_id: "https://wilddream.net/art/view/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/onClick="fullview\('([0-9]+_[0-9]+\.[a-zA-Z0-9]+)'\);?"/i);
					if (!match) {
						console_error(cache_key, "Unable to find filename match for", resp);
						return done(null, false);
					}
					var filename = match[1];
					match = resp.responseText.match(/\s\.attr\("src", "(\/Public\/uploads\/artwork\/[0-9]+\/full\/)"/i);
					if (!match) {
						console_error(cache_key, "Unable to find path match for", resp);
						return done(null, false);
					}
					var path = match[1];
					var obj = {
						extra: {
							page: resp.finalUrl
						}
					};
					var description = get_meta(resp.responseText, "description");
					if (description)
						obj.extra.caption = description;
					var final = urljoin(urljoin(resp.finalUrl, path, true), filename);
					obj.url = final;
					return done(obj, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
			newsrc = src.replace(/\/Public\/+uploads\/+artwork\/+([0-9]+)\/+thumb\/+([0-9]+\.[^/.]+(?:[?#].*)?)$/i, "/Public/uploads/artwork/$1/preview/$2");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/Public\/+uploads\/+artwork\/+[0-9]+\/+(?:thumb|preview)\/+([0-9]+)\.[^/.]+(?:[?#].*)?$/i);
			if (match) {
				return {
					url: "http://wilddream.net/art/view/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain === "img.monaffy.jp") {
			var obj_5 = {
				url: src.replace(/(\/img\/+(?:picture_place|profile)\/+)[a-z]+\/+([0-9]+\.)/, "$1original/$2")
			};
			match = src.match(/\/img\/+picture_place\/+[a-z]+\/+([0-9]+)\./);
			if (match)
				obj_5.extra = { page: "https://monappy.jp/picture_places/view/" + match[1] };
			return obj_5;
		}
		if (domain === "i.iheart.com") {
			newsrc = src.replace(/(:\/\/[^/]+\/+v3\/+[^?#]*?)(?:[?#].*)?$/, "$1");
			if (newsrc !== src && !/[?&]sn=/.test(src))
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+v3\/+s?url\/+(aHR0[^?#]+)(?:[?#].*)?$/);
			if (match) {
				return decodeuri_ifneeded(base64_decode(match[1]));
			}
		}
		if (domain === "images.megaphone.fm") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+[^/]+\/+[^/]+\/+s3:\/\//, "https://s3.amazonaws.com/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "img.jvid.com") {
			newsrc = src
				.replace(/(:\/\/[^/]+\/+minify_image\/+)300(\/+[0-9]{5,}_[0-9]+\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]{30,}\.[^/.]+)(?:[?#].*)?$/, "$11600/3$2")
				.replace(/(:\/\/[^/]+\/+)rescale_([a-z]+\/+[0-9]{5,}_[0-9]+\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]{30,})_[a-z]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2$3")
				.replace(/(:\/\/[^/]+\/+video_thumbnail\/+[0-9]{5,}_[0-9]+\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2})[0-9]{2,5}\/+([0-9a-f]{30,}\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(:\/\/[^/]+\/+)video_thumbnail(\/+[0-9]{5,}_[0-9]+\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]{30,})\.[^/.]+(?:[?#].*)?$/, "$1marked_preview_video$2.mp4");
			if (newsrc !== src)
				return {
					url: newsrc,
					video: true
				};
		}
		if (domain_nowww === "mixdrop.co") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+e\/+([0-9a-z]{5,})(?:[?#].*)?$/,
				query_for_id: "https://mixdrop.co/e/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<script>\s*MDCore\.[\s\S]+?eval\(function\(p,.*\s*<\/script>\s*(?:<div class="title|<video)/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var unpacked = common_functions["unpack_packer"](match[0]);
					if (!unpacked) {
						console_error(cache_key, "Unable to unpack", match[0], "in", resp);
						return done(null, false);
					}
					var urls = [];
					match = unpacked.match(/MDCore\.wurl=("[^"]+");/);
					if (match) {
						urls.push({
							url: urljoin(resp.finalUrl, JSON_parse(match[1]), true),
							video: true,
							headers: {
								Origin: "https://mixdrop.co",
								Referer: "https://mixdrop.co/"
							}
						});
					}
					match = unpacked.match(/MDCore\.poster=("[^"]+");/);
					if (match) {
						urls.push(urljoin(resp.finalUrl, JSON_parse(match[1]), true));
					}
					if (!urls.length) {
						console_error(cache_key, "Unable to find urls in", unpacked, "from", resp);
						return done(null, false);
					}
					return done(urls, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "videobin.co" ||
			domain_nowww === "vidlox.me") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([0-9a-z]{10,})\.html(?:[?#].*)?$/,
				query_for_id: "https://" + domain_nosub + "/${id}.html",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/new Clappr\.Player\({\s*sources: (\[".*?"\]),\s*poster: ("https?:[^"]+"),/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var sources = JSON_parse(match[1]);
					var poster = JSON_parse(match[2]);
					var urls = [];
					array_foreach(sources, function(source) {
						var video = true;
						if (/\.m3u8/.test(source)) {
							video = "hls";
						}
						urls.push({
							url: source,
							video: video
						});
					});
					urls.push(poster);
					return done(urls, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if ((domain_nosub === "videobin.co" ||
			domain_nosub === "vidlox.me") && /^c[0-9]*\./.test(domain)) {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+i\/+[0-9]{2}\/+[0-9]{5}\/+([a-z0-9]{10,})_x?t\.[^/.]+(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://" + domain_nosub + "/" + match[1] + ".html",
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "vidoza.net" ||
			domain_nowww === "clipwatching.com" ||
			domain_nowww === "aparat.cam") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([0-9a-z]{10,})\.html(?:[?#].*)?$/,
				query_for_id: "https://" + domain_nosub + "/${id}.html",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/(?:window\.(?:pData = |hola_player\()| = videojs\('[a-z]+',\s*)({[\s\S]+?)<\/script>/);
					if (!match) {
						console_error(cache_key, "Unable to find object match for", resp);
						return done(null, false);
					}
					var objtext = match[1];
					match = objtext.match(/^{[\s\S]*?sources(?:Code)?: (\[{.*?}\]),/);
					if (!match) {
						console_error(cache_key, "Unable to find sources match for", resp);
						return done(null, false);
					}
					var sources = JSON_parse(fixup_js_obj(match[1]));
					var poster = null;
					match = objtext.match(/^{[\s\S]*?poster: ["'](https?:\/\/[^"']+)["'],/);
					if (!match) {
						console_warn(cache_key, "Unable to find poster match for", resp);
						return done(null, false);
					} else {
						poster = match[1];
					}
					var urls = [];
					array_foreach(sources, function(source) {
						var video = true;
						if (/\.m3u8/.test(source.src)) {
							video = "hls";
						}
						urls.push({
							url: source.src,
							video: video
						});
					});
					if (poster)
						urls.push(poster);
					return done(urls, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if ((domain_nosub === "vidoza.net" ||
			domain_nosub === "clipwatching.com" ||
			domain_nosub === "aparat.cam") && /^s(?:tr)?[0-9]*\./.test(domain)) {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+i\/+[0-9]{2}\/+[0-9]{5}\/+([a-z0-9]{10,})\.[^/.]+(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://" + domain_nosub + "/" + match[1] + ".html",
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "streamtape.com" ||
			domain_nowww === "streamtape.to") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+[ev]\/+([0-9a-zA-Z]{5,})\/*(?:[?#].*)?$/,
				query_for_id: "https://streamtape.com/e/${id}",
				process: function(done, resp, cache_key) {
					var baseobj = {
						extra: {
							page: resp.finalUrl
						}
					};
					var urls = [];
					var ogtitle = get_meta(resp.responseText, "og:title");
					var ogimage = get_meta(resp.responseText, "og:image");
					if (ogtitle)
						baseobj.extra.caption = ogtitle;
					var matches = match_all(resp.responseText, /document\.getElementById\('(.*?)'\)\.innerHTML *= *(["'](\/\/*s.*?));/);
					var match = null;
					if (matches) {
						for (var _i = 0, matches_3 = matches; _i < matches_3.length; _i++) {
							var m = matches_3[_i];
							if (m[1] === "botlink")
								match = m;
						}
					}
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp, matches);
					} else {
						var url1 = match[2].replace(/\('([^']+)'\)((?:\.substring\([0-9]+\))+)/, function(_, base, substrs) {
							var nums = match_all(substrs, /\(([0-9]+)\)/);
							for (var _i = 0, nums_1 = nums; _i < nums_1.length; _i++) {
								var num_2 = nums_1[_i];
								base = base.substring(num_2[1] | 0);
							}
							return "'" + base + "'";
						});
						while (true) {
							var newurl_1 = url1.replace(/(["'])\s*\+\s*'([^']+)'/g, "$2$1");
							if (newurl_1 === url1) {
								url1 = newurl_1;
								break;
							} else {
								url1 = newurl_1;
								continue;
							}
						}
						var url_4 = url1
							.replace(/['"+ ]/g, "")
							.replace(/^\/(stream)/, "//$1");
						url_4 = urljoin(resp.finalUrl, url_4 + "&stream=1", true);
						urls.push({
							url: url_4,
							video: true,
							headers: {
								Referer: "https://" + domain + "/",
								"Sec-Fetch-Dest": "video",
								"Sec-Fetch-Mode": "cors",
								"Sec-Fetch-Site": "cross-site"
							}
						});
					}
					if (ogimage)
						urls.push(ogimage);
					if (!urls.length)
						return done(null, false);
					return done(fillobj_urls(urls, baseobj), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "thumb.tapecontent.net") {
			match = src.match(/:\/\/[^/]+\/+thumb\/+([0-9a-zA-Z]{5,})\/+[^/]+\./);
			if (match)
				return {
					url: "https://streamtape.com/e/" + match[1],
					is_pagelink: true
				};
		}
		if (domain_nowww === "ninjastream.to") {
			var query_ninjastream = function(vid, xsrf, cb) {
				api_query("ninjastream:" + vid, {
					url: "https://ninjastream.to/api/video/get",
					method: "POST",
					imu_mode: "xhr",
					data: '{"id":"' + vid + '"}',
					headers: {
						"x-requested-with": "XMLHttpRequest",
						"referer": "https://ninjastream.to/watch/" + vid,
						"content-type": "application/json;charset=UTF-8",
						"accept": "application/json, text/plain, */*",
						"x-xsrf-token": xsrf,
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					if (!resp.result.playlist) {
						console_error(cache_key, "Unable to find playlist from", resp);
						return done(null, false);
					}
					return done({
						url: resp.result.playlist,
						video: "hls",
						headers: {
							Referer: "https://ninjastream.to/watch/" + vid
						}
					}, 60 * 60);
				});
			};
			var get_ninjastream_csrf = function(cb) {
				if (!options.get_cookies) {
					console_error("Cookies not enabled");
					return cb(null);
				}
				options.get_cookies("https://ninjastream.to/api/video/get", function(cookies) {
					if (!cookies) {
						console_error("Unable to get cookies for ninjastream");
						return cb(null);
					}
					cookies = headers_list_to_dict(cookies);
					if (!cookies["xsrf-token"]) {
						console_error("Unable to find xsrf-token cookie in", cookies);
						return cb(null);
					}
					return cb(cookies["xsrf-token"]);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/ninjastream\.to\/+watch\/+([0-9A-Za-z]{5,})(?:[?#].*)?$/,
				run: function(cb, match) {
					var vid = match[1];
					get_ninjastream_csrf(function(xsrf) {
						if (!xsrf)
							return cb(null);
						query_ninjastream(vid, xsrf, cb);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "streamz.ws") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+[a-z]([0-9a-f]{10,})(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					return cb({
						url: "https://streamz.ws/getlink-" + id + ".dll",
						video: true,
						headers: {
							Referer: "https://streamz.ws/"
						}
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "0dayporno.com" && /^s[0-9]*\./.test(domain)) {
			return src
				.replace(/(\/videos\/+[0-9]+)_vga(\.[^/.]+)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/(?:photos|video_images)\/+[0-9]+\/+[0-9]+)(?:_[0-9]+)?(\.[^/.]+)(?:[?#].*)?$/, "$1_o$2");
		}
		if (domain === "bigfishgames-a.akamaihd.net") return src.replace(/\/th_(screen[0-9]+\.[^/.]+)(?:[?#].*)?$/, "/$1");
		if (domain_nowww === "theplancollection.com") {
			return src.replace(/(\/upload\/+designers\/+[0-9]+\/+[0-9]+\/+[^/.]+_[0-9]{4}(?:_[0-9_]+)?)_(?:891_593|267_241|381_251|467_200)(\.[^/.]+)(?:[?#].*)?$/i, "$1$2");
		}
		if (domain === "assets.architecturaldesigns.com") return src.replace(/(\/plan_assets\/+[0-9]+\/+)[a-z]+\/+/, "$1original/");
		if (domain === "ajax.googleapis.com") {
			if (/\/ajax\/+libs\/+jqueryui\/+[^/]+\/+themes\/+base\/+images\/+ui-bg_flat_0_[a-z]+_[0-9]+x[0-9]+\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "camclips.to" ||
			domain_nowww === "camclips.cc") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([0-9a-zA-Z]+)(?:[?#].*)?$/,
				query_for_id: "https://" + domain + "/video/${id}",
				process: function(done, resp, cache_key) {
					var initialstate = resp.responseText.match(/window\.__INITIAL_STATE__=({.*?});\(function/);
					if (!initialstate) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(initialstate[1]);
					var ssrData = json.ssrData;
					var sources = ssrData.ssrVideoSources;
					sources = sort_by_key(sources, "size").reverse();
					var urls = [];
					array_foreach(sources, function(source) {
						urls.push(source.src);
					});
					var title = ssrData["Player-Video"].video.title;
					var obj = {
						extra: {
							caption: title,
							page: resp.finalUrl
						}
					};
					return done(fillobj_urls(urls, obj), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "imgproxy.camclips.to" ||
			domain === "imgproxy.camclips.cc") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+preset\/+[^/]+\/+([^-?#/.]+)(?:[?#].*)?$/, "$1");
			if (newsrc !== src) {
				return urljoin("https://img." + domain_nosub + "/", base64_decode(newsrc), true);
			}
		}
		if (domain === "img.camclips.to" ||
			domain === "img.camclips.cc") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:thumb\/+[A-Za-z0-9]{2}|preview)\/+([a-zA-Z0-9]+)\.[^/.]+/);
			if (match) {
				return {
					url: "https://" + domain_nosub + "/video/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain === "media.fstatic.com") {
			return urljoin("https://cdn.fstatic.com/", src.replace(/^[a-z]+:\/\/[^/]+\/+[^/]+=\/+.*?(\/media\/.*)$/, "$1"), true);
		}
		if (domain === "static.tvmaze.com") return src.replace(/(\/uploads\/+images\/+)[^/]+\/+([0-9]+\/+[0-9]+\.)/, "$1original_untouched/$2");
		if (domain_nosub === "allafrica.com" && /^cdn[0-9]*\./.test(domain)) {
			return src.replace(/(\/download\/+pic\/+main\/+main\/+csiid\/+[0-9]+:[0-9a-f]{10,}):[^/?#]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "toledoblade.com" ||
			domain === "liber.post-gazette.com") {
			return src.replace(/(\/image\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2})[^/]+\/+([^/]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "9b16f79ca967fd0708d1-2713572fef44aa49ec323e813b06d2d9.ssl.cf2.rackcdn.com") return src.replace(/\/[0-9]+x_[^/]+\/([^/]+)(?:[?#].*)?$/, "/1200x/$1");
		if (domain_nowww === "kstp.com") return src.replace(/(\/kstpImages\/+repository)Thumbs\/+/, "$1/");
		if (domain_nosub === "wallpapers76.com" && /^im[0-9]*\./.test(domain)) {
			return src.replace(/(\/wallpapers\/+[0-9]+\/+[0-9]+\/+)thumb\/+[0-9]+_/, "$1");
		}
		if (domain_nosub === "caricos.com" && /^img[0-9]*\./.test(domain)) {
			return src.replace(/^[a-z]+:\/\/[^/]+\/+(([0-9]+_(([a-z])[a-z]+)_[^/]+)_[0-9]+_([0-9]+x[0-9]+)\.[^/.]+)(?:[?#].*)?$/, "https://images.caricos.com/$4/$3/$2/images/$5/$1");
		}
		if (domain_nowww === "webcamrips.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+embed\/+\?(aHR.*)$/);
			if (match) {
				return {
					url: base64_decode(decodeURIComponent(match[1])),
					is_pagelink: true
				};
			}
		}
		if (domain === "img.srgcdn.com") {
			newsrc = src.replace(/(\/e\/+)[wh]:[0-9]+\/+/, "$1");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+e\/+([-_a-zA-Z0-9=]{10,})\.[^/.]+(?:[?#].*)?$/);
			if (match) {
				return "https://storage.googleapis.com/dystribute-media/" + base64_decode(match[1]);
			}
		}
		if (domain === "write-img.srgcdn.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+e\/+[^/]+\/+(https?.*)$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "r.testifier.nl") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+.*?\/(https?(?:%3A|:).*)$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "xcdn.next.co.uk") {
			return src
				.replace(/\/(?:shotview|minishot)(?:-[0-9]+x[0-9]+)?\/+([0-9]+\/+[0-9]+-[0-9]+(?:s[0-9]*)?\.)/i, "/shotzoom/$1")
				.replace(/(\/itemimages\/+search\/+)(?:224x336\/+)?([A-Z]?[0-9]+\.[^/.]+)(?:[?#].*)?$/i, "$1676/$2")
				.replace(/\/altitemshot\/+(?:[0-9]+x[0-9]+\/+)?([0-9]+(?:s[0-9]*)?\.)/i, "/AltItemZoom/$1");
		}
		if (domain === "ik.imagekit.io") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+[^/]+\/+(https?):\/\/?([^?#]+)(?:[?#].*)?$/, "$1://$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/ikmedia\/+.*?)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(:\/\/[^/]+\/+[^/]+\/+)tr:[^/]+\/+/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "twitch.tv") {
			var fetch_twitch_access_token = function(vid, cb) {
				api_query("twitch_access:" + vid, {
					url: "https://api.twitch.tv/api/vods/" + vid + "/access_token?oauth_token=undefined&need_https=true&platform=_&player_type=site&player_backend=mediaplayer",
					imu_mode: "xhr",
					headers: {
						"accept": "application/vnd.twitchtv.v5+json; charset=UTF-8",
						"client-id": base64_decode("IGtpbW5lNzhreDNuY3g2YnJnbzRtdjZ3a2k1aDFrbw==").substr(1),
						"content-type": "application/json; charset=UTF-8",
						origin: "https://www.twitch.tv",
						referer: "https://www.twitch.tv/",
						"x-requested-with": "XMLHttpRequest"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					if (!resp.sig && !resp.token) {
						console_error(cache_key, "Unexpected result", resp);
						return done(null, false);
					}
					done(resp, 60 * 60);
				});
			};
			var get_vod_url = function(vid, token) {
				return "https://usher.ttvnw.net/vod/" + vid + ".m3u8?" + stringify_queries({
					allow_source: "true",
					player_backend: "mediaplayer",
					playlist_include_framerate: "true",
					reassignments_supported: "true",
					sig: token.sig,
					token: encodeURIComponent(token.token)
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+videos\/+([0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					fetch_twitch_access_token(id, function(token) {
						if (!token)
							return cb(null);
						var page = "https://www.twitch.tv/videos/" + id;
						return cb({
							url: get_vod_url(id, token),
							headers: {
								Referer: page
							},
							extra: {
								page: page
							},
							video: "hls"
						});
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "simsday.com") return src.replace(/(\/media\/+[0-9a-f]{10,})_(?:[a-z]+)(?:[?#].*)?$/, "$1_original");
		if (domain_nowww === "avalon.red" ||
			domain_nowww === "profimedia.com") {
			var query_profimedia = function(id, domain, cb) {
				api_query("profimedia_" + domain + ":" + id, {
					url: "https://api.solwee.com/api/v1/product/" + id,
					imu_mode: "xhr",
					headers: {
						origin: "https://" + domain,
						referer: "https://" + domain + "/"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					if (resp.status && resp.status === "error") {
						console_log(cache_key, resp);
						return done(null, false);
					}
					return done(resp, 6 * 60 * 60);
				});
			};
			var profimedia_to_obj = function(data, domain) {
				var obj = {
					extra: {
						page: "https://" + domain + "/" + data.productID,
						caption: data.title
					},
					headers: {
						Referer: "https://" + domain + "/",
						Origin: "https://" + domain
					}
				};
				if (/\.{5,}$/.test(data.title)) {
					obj.extra.caption = data.description;
				}
				var urls = [];
				if (data.largeDownloadUrl || data.largePreviewPath) {
					var url = data.largeDownloadUrl || data.largePreviewPath;
					urls.push({
						url: url,
						problems: {
							watermark: true
						}
					});
				}
				if (data.thumbPath) {
					urls.push({
						url: data.thumbPath,
						problems: {
							smaller: true
						}
					});
				}
				return fillobj_urls(urls, obj);
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					query_profimedia(id, domain, function(data) {
						if (!data)
							return cb(null);
						cb(profimedia_to_obj(data, domain));
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "alternate.nl") return src.replace(/(:\/\/[^/]+\/+p\/+)[0-9]+x[0-9]+\/+/, "$1o/");
		if (domain_nosub === "pik.ba" && /^s[0-9]*\./.test(domain)) {
			return src.replace(/(\/galerija\/+[0-9]{4}-[0-9]{2}\/+(?:[0-9]{2}\/+){2}[a-z]+-[0-9]+-[0-9a-f]{10,})-(?:default|thumb)(\.[^/.]+)(?:[?#].*)?$/, "$1-velika$2");
		}
		if (domain_nowww === "olx.ba") {
			if (/\/common\/+dizajn\/+js\/+fancybox\/+source\/+blank\.gif(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if ((domain_nosub === "storenvy.com" && /^assets[0-9]*\./.test(domain)) ||
			domain === "d2a2wjuuf1c30f.cloudfront.net" ||
			domain === "dlp2gfjvaz867.cloudfront.net" ||
			domain === "d310a9hpolx59w.cloudfront.net" ||
			domain === "d111vui60acwyt.cloudfront.net" ||
			domain === "dzasv7x7a867v.cloudfront.net" ||
			domain === "dpegb9ebondhq.cloudfront.net" ||
			domain === "dpegb9ebondhq.cloudfront.net" ||
			domain === "d1nr5wevwcuzuv.cloudfront.net") {
			return src.replace(/(\/product_photos\/[0-9]+\/[^/]*)_(?:small|medium|large|[0-9]+(?:[wh]|sq))(\.[^/.]*)$/, "$1_original$2");
		}
		if (domain_nowww === "drivespark.com") return src.replace(/\/wallimg\/+[0-9]+x[0-9]+\/+photos\/+/, "/wallimg/photos/");
		if (domain_nowww === "favcars.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+tmp\/+resize\/+((?:images_)?([^/._]+)_([^/._]+)_[0-9]{4}(?:_pictures)?_[0-9]+)_b(?:_r)?(\.[^/.]+)(?:[?#].*)?$/, "https://img.favcars.com/$2/$3/$1$4");
		if (domain === "img.favcars.com") return src.replace(/(:\/\/[^/]+\/+[^/]+\/+[^/]+\/+[^/]+)_b(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "fextralife.com" && /\.wiki\./.test(domain)) {
			return src.replace(/(\/file\/+[^/]+\/+[^/]+-)small(\.[^/.]+)(?:[?#].*)?$/, "$1large$2");
		}
		if (domain === "upload.voxed.net") {
			newsrc = src.replace(/(:\/\/[^/]+\/+)thumb_([a-zA-Z0-9]+)(?:_r)?(\.[^/.]+)(?:[?#].*)?$/, "$1$2$3");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (domain_nowww === "vidlii.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:watch|embed)\?(?:.*&)?v=([^&]+)/,
				query_for_id: "https://www.vidlii.com/watch?v=${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/viValues\s*=\s*{([\s\S]*?)};\s*for/);
					if (!match) {
						console_error(cache_key, "Unable to find match in", resp);
						return done(null, false);
					}
					var jsobj = match[1];
					var matches = match_all(jsobj, /(?:hd)?src: "(https?:\/\/www\.vidlii\.com\/+usfi\/+v\/+[^"]+)",/);
					if (!matches) {
						console_error(cache_key, "Unable to find sources in", resp, jsobj);
						return done(null, false);
					}
					var urls = [];
					array_foreach(matches, function(match) {
						var url = match[1];
						var urlmatch = url.match(/\/([^/.?#]+)\.([^/.?#]+)\.(?:([0-9]+)\.)?[^/.]+(?:[?#].*)?$/);
						if (!urlmatch) {
							console_error(cache_key, "Unknown url", url);
							return false;
						}
						var quality = urlmatch[3];
						if (!quality) {
							quality = "360";
						}
						urls.push({
							url: url,
							quality: parseInt(quality),
							video: true
						});
					});
					urls = sort_by_key(urls, "quality").reverse();
					array_foreach(urls, function(url) {
						delete url.quality;
					});
					var img = get_meta(resp.responseText, "twitter:image");
					if (img) {
						urls.push(img);
					}
					var obj = {
						extra: {
							page: resp.finalUrl
						}
					};
					return done(fillobj_urls(urls, obj), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "vidlii.com") {
			match = src.match(/\/usfi\/+(?:thmp|prvw)\/+([^/.?#]+)\./);
			if (match) {
				return {
					url: "https://www.vidlii.com/watch?v=" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain === "cdn-contents-web.weverse.io") {
			return src
				.replace(/\/(user|admin)\/[0-9a-z]+x[0-9a-z]+\/(?:jpg|png|gif)\//, "/$1/")
				.replace(/[?#].*/, "");
		}
		if (domain_nowww === "efukt.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([0-9]+_[^/]+\.html)(?:[?#].*)?$/,
				query_for_id: "https://efukt.com/${id}",
				process: function(done, resp, cache_key) {
					var sources = common_functions["get_videotag_sources"](resp.responseText);
					if (!sources)
						return done(null, false);
					return done({
						url: sources.video[0].url,
						extra: {
							page: resp.finalUrl
						},
						headers: {
							Referer: resp.finalUrl
						},
						video: true
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "x17online.com") return src.replace(/(\/gallery\/+galleries\/+(?:[0-9]{4}\/+[0-9]{2}\/+)?[^/]+\/+)thumb\/+/, "$1full/");
		if (domain_nowww === "tonikawa.com") return src.replace(/(\/assets\/+images\/+common\/+story\/+ep[0-9]+\/+img_[0-9]+)(\.[^/.]+)(?:[?#].*)?$/, "$1_l$2");
		if (domain === "static.vaf.be") return src.replace(/(\/storage\/+files\/+[0-9]+\/+)(?:crop|resize)-[^/]+\/+/, "$1original/");
		if (domain_nowww === "cineuropa.org") {
			return src
				.replace(/\/imgcache\/+([0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+)_[0-9]+x[0-9]+_[0-9]+(?:x[0-9]+){3}_[0-9]+(\.[^/.]+)(?:[?#].*)?$/i, "/Files/$1$2")
				.replace(/(\/galleries\/+[0-9]+\/+[0-9]+\/+(?:poster[0-9]*(?:_[a-z]{2})?|photo[0-9]+))(\.[^/.]+)(?:[?#].*)?$/i, "$1_big$2");
		}
		if (domain === "staticimg.spicyonion.com") return src.replace(/\/cache(\/+images\/+.*?)-?[0-9]+x[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "images.mubicdn.net" ||
			domain === "assets.mubicdn.net") {
			newsrc = src.replace(/[?#].*$/, "");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/cache-[0-9]+-[0-9]+\//, "/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/images\/+(?:[^/]+\/+)?(?:[0-9]+\/+[^/]+|[^/]+\/+[0-9]+)\/+images?-)[wh][0-9]+(\.[^/.]+)$/, "$1original$2");
			if (newsrc !== src) {
				return fillobj_urls(add_extensions_jpeg(newsrc), {
					problems: { possibly_different: true }
				});
			}
		}
		if (domain === "d2t8nixuow17vt.cloudfront.net") {
			if (/\/web\/+blank\.png(?:[?#].*)?$/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain_nosub === "simkl.in") {
			if (/\/img_tv\/+tv_avatar_sun_blur\.png(?:[?#].*)?$/.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src.replace(/(\/posters\/+[0-9a-f]{2}\/+[0-9a-f]{10,})_[a-z]+\.(?:jpg|webp)(?:[?#].*)?$/, "$1_0.jpg");
		}
		if (host_domain_nosub === "simkl.ru" && options.element) {
			var current = options.element;
			do {
				if (current.classList.contains("SimklTVPosterImgLargeHover") ||
					current.classList.contains("SimklTVMovieDetailTrailerBorder")) {
					return {
						url: origsrc,
						bad: "mask"
					};
				}
			} while (current = current.parentElement);
		}
		if (domain_nowww === "skeb.jp") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(@[^/]+)\/+works\/+([0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://skeb.jp/${1}/works/${2}",
				process: function(done, resp, cache_key, match) {
					var match = resp.responseText.match(/<div class="image"[^>]+><img src="(https?:\/\/skeb\.imgix\.[^"]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find image match for", resp);
						return done(null, false);
					}
					var imgsrc = decode_entities(match[1]);
					var description = null;
					var ld_json = resp.responseText.match(/<script[^>]+ data-hid="ld\+json:Article" type="application\/ld\+json">\s*({.*?})\s*<\/script>/);
					if (ld_json) {
						var json = JSON_parse(ld_json[1]);
						description = json.headline;
					}
					var obj = {
						extra: {
							page: resp.finalUrl,
							caption: description || void 0
						},
						url: imgsrc
					};
					return done(obj, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "skeb.jp") {
			var newsrc = common_functions["get_pagelink_el_matching"](options.element, /^[a-z]+:\/\/(?:www\.)?skeb\.jp\/+@[^/]+\/+works\/+[0-9]+(?:[?#].*)?$/);
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "apprentus.com" && options.element) {
			if (!src && origsrc && options.element.tagName === "DIV" && options.element.classList.contains("photo-area-photo")) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "kinonews.ru") {
			return src
				.replace(/(\/insimgs\/+(?:[0-9]+\/+)?[a-z]+\/+)thumbs\/+([a-z]+[0-9]+)/, "$1$2")
				.replace(/(\/insimgs\/+(?:[0-9]+\/+)?[a-z]+\/+[a-z]+[0-9]+)p(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "hk.on.cc") return src.replace(/(\/photo\/+bkn-[0-9]{10,}-[0-9]+_[0-9]+_[0-9]+_[0-9]+)[sp](\.[^/.]+(?:[?#].*)?)$/, "$1b$2");
		if (domain === "thumb.pr0gramm.com" ||
			domain === "img.pr0gramm.com") {
			newsrc = src.replace(/^[a-z]+:\/\/thumb(\.[^/]+\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]{10,}\.[^/.]+)(?:[?#].*)?$/, "https://img$1");
			if (newsrc !== src)
				return add_extensions(newsrc);
			newsrc = src.replace(/^[a-z]+:\/\/img(\.[^/]+\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]{10,}\.[^/.]+)(?:[?#].*)?$/, "https://full$1");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (domain_nowww === "pr0gramm.com") {
			var query_pr0gramm = function(id, cb) {
				api_query("pr0gramm:" + id, {
					url: "https://pr0gramm.com/api/items/get?id=" + id + "&flags=1",
					imu_mode: "xhr",
					headers: {
						"Accept": "application/json, text/javascript, */*; q=0.01",
						"x-requested-with": "XMLHttpRequest",
						"Referer": "https://pr0gramm.com/new/" + id
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					var items = resp.items;
					var found = false;
					array_foreach(items, function(item) {
						if (item.id != id) {
							return;
						}
						var image = urljoin("https://img.pr0gramm.com/", item.image, true);
						done(image, 6 * 60 * 60);
						found = true;
						return false;
					});
					if (!found)
						return done(null, false);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:top|new)\/+([0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					query_pr0gramm(id, cb);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "i.jeded.com") return src.replace(/(\/i\/+[^/]+\.)[0-9]+-([0-9]+\.)/, "$1$2");
		if (domain === "blog.froggi.es" ||
			domain_nowww === "itsfoss.com" ||
			domain === "blog.emojipedia.org") {
			return src.replace(/(\/content\/+images\/+)(?:(?:size|format)\/+[^/]+\/+)+/, "$1");
		}
		if (domain === "em-content.zobj.net") return src.replace(/\/thumbs\/+[0-9]+\/+/, "/source/");
		if (domain_nowww === "indeed.com") return src.replace(/(\/cmp\/+_s\/+photos\/+[0-9a-f]+)-[stq]+-/, "$1-l-");
		if (domain === "data.pixiz.com") return src.replace(/(\/output\/+user\/+frame\/+preview\/+)[0-9]+x[0-9]+\/+/, "$1api/big/");
		if (domain === "embed.indavideo.hu") {
			var query_indavideo = function(id, cb) {
				var jqcb = common_functions["gen_jquery_callback"]();
				var now = Date.now() + 1;
				api_query("indavideo:" + id, {
					url: "https://amfphp.indavideo.hu/SYm0json.php/player.playerHandler.getVideoData/" + id + "/12////?directlink&callback=" + jqcb + "&_=" + now,
					headers: {
						Accept: "*/*",
						Referer: "https://embed.indavideo.hu/",
						"Sec-Fetch-Dest": "script",
						"Sec-Fetch-Mode": "no-cors",
						"Sec-Fetch-Site": "same-site"
					},
					jsonp: true
				}, cb, function(done, resp, cache_key) {
					console_log(resp);
					var data = resp.data;
					var videos = [];
					var resolutions = {};
					var maxresolution = 0;
					array_foreach(data.video_files, function(vid) {
						var resmatch = vid.match(/.*\/[^/]+\.([0-9]+)\.mp4(?:[?#].*)?$/, "$1");
						if (!resmatch) {
							console_error(cache_key, "Unable to find resolution for", vid);
							return;
						}
						var res = parseInt(resmatch[1]);
						if (!(res in data.filesh)) {
							console_error(cache_key, "Hash not found for resolution", res);
							return;
						}
						var newurl = vid + "&token=" + data.filesh[resmatch[1]];
						videos.push(newurl);
						resolutions[res] = newurl;
						if (res > maxresolution) {
							maxresolution = res;
						}
					});
					var baseobj = {
						extra: {
							page: urljoin("https://indavideo.hu/", data.video_url, true),
							caption: data.title
						}
					};
					var urls = [];
					var maxurl = resolutions[maxresolution];
					if (maxurl) {
						urls.push({
							url: maxurl,
							video: true
						});
					}
					if (data.video_img) {
						urls.push(data.video_img);
					}
					return done(fillobj_urls(urls, baseobj), 6 * 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+player\/+video\/+([0-9a-f]+)\/*(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					query_indavideo(id, cb);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "indavideo.hu") {
			if (/\/images\/+default\/+video_box\/+hungary\.jpg/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([^/.?#]+)(?:[?#].*)?$/,
				query_for_id: "https://" + domain + "/video/${id}",
				process: function(done, resp, cache_key) {
					var embedurl = get_meta(resp.responseText, "og:video:secure_url");
					if (!embedurl) {
						console_error(cache_key, "Unable to find embed URL for", resp);
						return done(null, false);
					}
					return done({
						url: embedurl,
						is_pagelink: true
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "a.simbi.com") {
			newsrc = src.replace(/(\/(?:images|users)\/+[0-9]+\/+(?:images|avatars)\/+)[a-z]+-([0-9a-f]{20,}\.[^/.]+)(?:[?#].*)?$/, "$1original-$2");
			if (newsrc !== src)
				return add_full_extensions(newsrc);
		}
		if (domain_nowww === "vlive.tv") {
			var vlive_token = base64_decode("IDhjNmNjN2I0NWQyNTY4ZmI2NjhiZTZlMDViNmU1YTNi").substr(1);
			var get_vlive_inkey = function(vid, cb) {
				api_query("vlive_inkey:" + vid, {
					url: "https://www.vlive.tv/globalv-web/vam-web/video/v1.0/vod/" + vid + "/inkey?appId=" + vlive_token + "&platformType=PC",
					imu_mode: "xhr",
					json: true,
					headers: {
						Accept: "application/json, text/plain, */*",
						Referer: "https://www.vlive.tv/video/" + vid
					}
				}, cb, function(done, resp, cache_key) {
					if (!resp.inkey) {
						console_error(cache_key, "Unable to find inkey for", vid);
						return done(null, false);
					}
					return done(resp.inkey, 60 * 60);
				});
			};
			var get_vlive_vodinfo = function(inkey, vid, cb) {
				var url = "https://apis.naver.com/rmcnmv/rmcnmv/vod/play/v2.0/";
				url += vid;
				url += "?key=" + inkey;
				url += "&ver=2.0&devt=html5_mo&doct=json&ptc=https&sptc=https&cpt=vtt";
				url += "&videoId=" + vid;
				api_query("vlive_inkey:" + vid, {
					url: url,
					imu_mode: "xhr",
					json: true,
					headers: {
						Accept: "*/*",
						Origin: "https://www.vlive.tv",
						Referer: "https://www.vlive.tv/",
						"sec-fetch-site": "cross-site"
					}
				}, cb, function(done, resp, cache_key) {
					var vids = resp.videos.list;
					vids.sort(function(a, b) {
						return b.bitrate.video - a.bitrate.video;
					});
					var urls = [];
					var obj = {
						extra: {
							page: resp.meta.url
						}
					};
					array_foreach(vids, function(vid) {
						urls.push({
							url: vid.source,
							height: vid.encodingOption.height,
							width: vid.encodingOption.width,
							video: true
						});
					});
					return done(fillobj_urls(urls, obj), 60 * 60);
				});
			};
			var get_vlive_vidinfo_from_url = function(url, cb) {
				api_query("vlive_vidinfo:" + url, {
					url: url,
					imu_mode: "document"
				}, cb, function(done, resp, cache_key) {
					var match = resp.responseText.match(/<script type="text\/javascript">window\.__PRELOADED_STATE__=({.*?})<\/script>/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					var vidinfo = json.postDetail.post.officialVideo;
					if (!vidinfo) {
						console_error(cache_key, "Unable to find video info in", json);
						return done(null, false);
					}
					return done(vidinfo, 60 * 60);
				});
			};
			var get_vlive_vodid_from_vid = function(vid, cb) {
				api_cache.fetch("vlive_vodid:" + vid, cb, function(done) {
					get_vlive_vidinfo_from_url("https://www.vlive.tv/video/" + vid, function(vidinfo) {
						var vodid = vidinfo.vodId;
						return done(vodid, 6 * 60 * 60);
					});
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					var vid = match[1];
					get_vlive_vodid_from_vid(vid, function(vodid) {
						if (!vodid)
							return cb(null);
						get_vlive_inkey(vid, function(key) {
							if (!key)
								return cb(null);
							get_vlive_vodinfo(key, vodid, cb);
						});
					});
				}
			});
			if (newsrc)
				return newsrc;
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+post\/+([0-9]+-[0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					var postid = match[1];
					get_vlive_vidinfo_from_url("https://www.vlive.tv/post/" + postid, function(vidinfo) {
						if (!vidinfo)
							return cb(null);
						var vid = vidinfo.videoSeq;
						var vodid = vidinfo.vodId;
						get_vlive_inkey(vid, function(key) {
							if (!key)
								return cb(null);
							get_vlive_vodinfo(key, vodid, cb);
						});
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "img.marieclairekorea.com") return src.replace(/(\/mck_[0-9a-f]+)-(?:[0-9]+x[0-9]+|scaled)(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "nrk.no" ||
			domain === "static.nrk.no") {
			var query_nrk = function(vid, cb) {
				api_query("nrk:" + vid, {
					url: "https://psapi.nrk.no/playback/manifest/clip/" + vid,
					imu_mode: "xhr",
					headers: {
						Accept: "application/vnd.nrk.psapi+json; version=9; ludo-client=true; psapi=snapshot",
						Referer: "https://www.nrk.no/"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					var asset = resp.playable.assets[0];
					if (asset.format !== "HLS") {
						console_error(cache_key, "Unknown format for", asset);
						return done(null, false);
					}
					return done({
						url: asset.url,
						video: "hls"
					}, 70 * 60);
				});
			};
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+video\/+(?:[a-z]+\/+)?(?:[^/.?#]+_)?([-0-9a-f]{20,}|[0-9]+)(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+[^/]+\/+[^/]+\/+video-embed\.html#(?:.*&)?id=([0-9]+)(?:&.*)?$/
				],
				run: function(cb, match) {
					query_nrk(match[1], cb);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "nrk.no" && options.element) {
			if (options.element.tagName === "VIDEO" && !src) {
				var current = options.element;
				while (current = current.parentElement) {
					if (current.tagName === "FIGURE" && current.hasAttribute("data-canonical-url")) {
						return {
							url: current.getAttribute("data-canonical-url"),
							is_pagelink: true
						};
					}
				}
				if (/^[a-z]+:\/\/[^/]+\/+video\/+(?:[a-z]+\/+)?(?:[^/.?#]+_)?([-0-9a-f]{20,}|[0-9]+)(?:[?#].*)?$/.test(options.host_url)) {
					return {
						url: options.host_url,
						is_pagelink: true
					};
				}
			}
			if (domain === "gfx.nrk.no" && options.element.tagName === "IMG") {
				regex = /^([0-9]+\.[0-9]+)\.[0-9a-f]+$/;
				var el = common_functions["get_parent_el_matching"](options.element, function(x) {
					return x.tagName === "FIGURE";
				});
				id = null;
				if (el) {
					while (el = el.previousSibling) {
						if (el.nodeName === "#comment") {
							var text = el.textContent;
							var match = text.match(/\/render\?(?:.*&amp;)?id=([0-9]+\.[0-9]+)/);
							if (match) {
								id = match[1];
								break;
							}
						}
					}
				}
				if (id && options.do_request && options.cb) {
					api_query("nrk:" + id, {
						url: "https://www.nrk.no/serum/api/imagecrop/" + id,
						method: "HEAD"
					}, options.cb, function(done, resp, cache_key) {
						return done(resp.finalUrl, 6 * 60 * 60);
					});
					return {
						waiting: true
					};
				}
			}
		}
		if (domain_nowww === "local12.com" ||
			(domain_nosub === "sinclairstoryline.com" && domain.match(/^static-[0-9]*\./)) ||
			domain_nowww === "nbc16.com" ||
			domain_nowww === "nbcmontana.com" ||
			domain_nowww === "bakersfieldnow.com") {
			newsrc = src
				.replace(/(\/resources\/+media\/+[-0-9a-f]{20,})-(?:large|medium|small|jumbo)(?:[0-9]+x[0-9]+|Blur|Scale)_/, "$1-")
				.replace(/\/resources\/+media2\/+.*?\/+([-0-9a-f]{10,}-[^/]+)(?:[?#].*)?$/, "/resources/media/$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (host_domain_nowww === "local12.com") {
			var get_info_from_local12_text = function(text) {
				var match = text.match(/\nsinclairDigital\.pageData = ({.*});\r?\n/);
				if (!match)
					return null;
				try {
					var json = JSON_parse(match[1]);
					return json;
				} catch (e) {
					console_error(e);
				}
				return null;
			};
			var get_info_from_local12_url = function(url, cb) {
				url = url.replace(/[?#].*/, "");
				api_cache.fetch("local12:" + url, cb, function(done) {
					if (url === options.host_url.replace(/[?#].*/, "")) {
						return done(get_info_from_local12_text(document.documentElement.innerHTML), 60 * 60);
					} else {
						options.do_request({
							url: url,
							method: "GET",
							imu_mode: "document",
							onload: function(resp) {
								if (resp.status !== 200) {
									console_error(cache_key, resp);
									return done(null, false);
								}
								return done(get_info_from_local12_text(resp.responseText), 60 * 60);
							}
						});
					}
				});
			};
			var get_id_from_local12_url = function(url) {
				var match = url.match(/\/resources\/+media\/+([0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12})-/);
				if (!match)
					return null;
				return match[1].toLowerCase();
			};
			var info_matches_local12_id = function(id, info) {
				var keys = ["brandUuid", "externalId", "uuid", "versionSetUuid"];
				var found = false;
				array_foreach(keys, function(key) {
					if (!(key in info))
						return;
					if (info[key].toLowerCase() === id) {
						found = true;
						return false;
					}
				});
				return found;
			};
			var get_id_in_local12_info = function(id, info) {
				var infos = [];
				if (info.story.images)
					array_extend(infos, info.story.images);
				if (info.story.videos)
					array_extend(infos, info.story.videos);
				var foundobj = null;
				array_foreach(infos, function(info) {
					if (info_matches_local12_id(id, info)) {
						foundobj = info;
						return false;
					}
				});
				return foundobj;
			};
			var get_obj_for_local12_info = function(info) {
				if (!info)
					return null;
				var urls = [];
				var baseobj = {
					extra: {}
				};
				if (info.created) {
					baseobj.extra.created_date = info.created;
				}
				baseobj.extra.caption = info.caption || info.title;
				baseobj.filename = info.alt || info.description;
				if (info.type === "Video") {
					if (info.url) {
						urls.push({
							url: info.url,
							video: "hls" // fixme?
						});
					}
					if (info.mp4Url) {
						urls.push({
							url: info.mp4Url,
							video: true
						});
					}
					if (info.thumbUrl) {
						urls.push(info.thumbUrl);
					}
				} else if (info.type === "Image") {
					if (info.originalUrl)
						urls.push(info.originalUrl);
				}
				return fillobj_urls(urls, baseobj);
			};
			if ((!src || host_domain_nowww === domain_nosub) && options.do_request && options.cb) {
				get_info_from_local12_url(options.host_url, function(our_info) {
					if (!our_info)
						return options.cb(null);
					var id = get_id_from_local12_url(src);
					if (id) {
						var info_obj = get_id_in_local12_info(id, our_info);
						if (info_obj) {
							return options.cb(get_obj_for_local12_info(info_obj));
						} else {
							return options.cb(null);
						}
					} else if (!src && options.element && options.element.tagName === "VIDEO") {
						return options.cb(get_obj_for_local12_info(our_info.story.videos[0]));
					}
				});
				return {
					waiting: true
				};
			}
		}
		if (domain_nowww === "scanpix.no") {
			if (/\/images\/+icons_[0-9]+\/+moreInfo/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+spWebApp\/+preview\/+editorial\/+([-_a-zA-Z0-9]+)(?:[?#].*)?$/,
				query_for_id: {
					url: "https://scanpix.no/spWebApp/preview/editorial/${id}?json=",
					imu_mode: "xhr",
					json: true,
					headers: {
						"X-Requested-With": "XMLHttpRequest",
						"X-SpAjaxRequest": "true"
					}
				},
				process: function(done, resp, cache_key) {
					var previewobj = {};
					array_foreach(resp.previewList, function(x) {
						previewobj[x.type] = x.url;
					});
					urls = [];
					if (previewobj.preview_big) {
						urls.push({
							url: previewobj.preview_big,
							problems: { watermark: true }
						});
					}
					if (resp.previewLocation) {
						urls.push(resp.previewLocation);
					}
					if (previewobj.preview) {
						urls.push({
							url: previewobj.preview,
							problems: { watermark: true }
						});
					}
					var obj = {
						extra: {
							caption: resp.headline || resp.caption
						}
					};
					return done(fillobj_urls(urls, obj), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "preview.sdl.no") {
			match = src.match(/\/v1\/+[^/]+\/+[^/]+\/+([-_a-zA-Z0-9]+)(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://scanpix.no/spWebApp/preview/editorial/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "celebritongue.com") return src.replace(/(\/album\/+[^/]+\/+)(?:thumbnail|medium-photo)\/+([^/]+-[0-9a-f]{10,})-(?:thumbnail|medium)(\.[^/.]+)(?:[?#].*)?$/, "$1photo/$2$3");
		if (domain === "extra-images.akamaized.net") return src.replace(/(\/[0-9a-f]{20,})_(?:md|lg)(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "ok.ru") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://ok.ru/video/${id}",
				process: function(done, resp, cache_key) {
					var vidmeta = resp.responseText.match(/<div data-module="OKVideo" data-options="({[^"]+?})"/);
					if (!vidmeta) {
						console_error(cache_key, "Unable to find video metadata for", resp);
						return done(null, false);
					}
					vidmeta = decode_entities(vidmeta[1]);
					var json = JSON_parse(vidmeta);
					var flmeta = JSON_parse(json.flashvars.metadata);
					var movie = flmeta.movie;
					var obj = {
						extra: {
							page: movie.url || resp.finalUrl,
							caption: movie.title
						},
						headers: {
							Referer: resp.finalUrl
						}
					};
					var urls = [];
					if (flmeta.hlsManifestUrl) {
						urls.push({
							url: flmeta.hlsManifestUrl,
							video: "hls",
							is_private: true // linked to ip
						});
					}
					var qualityindex = ["hd", "sd", "low", "lowest", "mobile"];
					sort_by_key(flmeta.videos, "name", function(x) {
						return array_indexof(qualityindex, x);
					});
					array_foreach(flmeta.videos, function(video) {
						urls.push({
							url: video.url,
							video: true,
							is_private: true // linked to ip
						});
					});
					if (movie.poster) {
						urls.push(movie.poster);
					}
					return done(fillobj_urls(urls, obj), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "ok.ru") {
			newsrc = common_functions["get_pagelink_host_el_matching"](options, {
				url_match: /^https?:\/\/(?:www\.)?ok\.ru\/+video\/+([0-9]+)(?:[?#].*)?$/,
				el_match: function(x) {
					return x.classList.contains("vp_video");
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "chartsinfrance.net") {
			match = src.match(/\/covers\/+(aHR0[^/.]+)\./);
			if (match) {
				return base64_decode(match[1]);
			}
		}
		if (domain_nowww === "laut.de") return src.replace(/\/bilder\/+__[0-9]+,[0-9]+\/+/, "/bilder/");
		if (domain === "d28hgpri8am2if.cloudfront.net") {
			return {
				url: src.replace(/(\/book_images\/+(?:onix\/+cvr[0-9]+\/+[^/.]+-[0-9]+|cvr[0-9]+_[0-9]+))(?:_(?:th|lg|xlg))?(\.[^/.]+)(?:[?#].*)?$/, "$1_hr$2"),
				head_wrong_contenttype: true // no content-type
			};
		}
		if (domain_nosub === "vgc.no") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+v2(\/+images\/+[-0-9a-f]{20,})(?:[?#].*)?$/, "https://premium.vgc.no/ap$1");
			if (newsrc !== src) {
				return {
					url: newsrc,
					head_wrong_contentlength: true
				};
			}
		}
		if (domain === "assets.website-files.com" ||
			domain === "assets-global.website-files.com") {
			return src.replace(/(\/[0-9a-f]{10,}\/+[^/]+)-p-[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "4gamer.net") return src.replace(/(\/[0-9]{8,}\/+)TN(\/+[0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1SS$2");
		if (domain_nowww === "bibliogram.art") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+imageproxy\?(?:.*&)?url=(http[^&#]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (host_domain_nowww === "biqle.com" && options.element) {
			if (!src && options.element.classList.contains("video-play")) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "biqle.com" ||
			domain_nowww === "daftsex.com") {
			if (/\/img\/+no-image\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+watch\/+(-?[0-9]+_[0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://" + domain_nosub + "/watch/${id}",
				process: function(done, resp, cache_key) {
					var iframeurl = null;
					var match = resp.responseText.match(/<iframe[^>]* src="(https:\/\/(?:dxb.to|daxab.com)\/+player\/+[^/".]+)"/);
					if (match) {
						iframeurl = decode_entities(match[1]);
					} else {
						match = resp.responseText.match(/\s+hash: "([^"]{20,})",/);
						if (match) {
							iframeurl = "https://daxab.com/player/" + match[1];
						}
					}
					if (!iframeurl) {
						console_error(cache_key, "Unable to find iframe url for", resp);
						return done(null, false);
					}
					return done({
						url: iframeurl + "#imu-referer=" + resp.finalUrl.replace(/(:\/\/[^/]+\/).*$/, "$1"),
						is_pagelink: true
					}, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "dxb.to" ||
			domain_nowww === "daxab.com") {
			var query_daxab = function(data, cb) {
				var server = data.server;
				var sub = server.replace(/\..*/, "");
				var fp = sub.replace(/-.*/, "");
				if (fp === "psv83" || fp === "psv84") {
					sub = "psv85-3";
				} else if (fp === "psv60") {
					sub = "psv69-4";
				} else if (fp === "psv138" || fp === "psv145") {
					sub = "psv134-1";
				}
				server = server.replace(/^[^.]+\./, sub + ".");
				api_query(domain_nowww + ":" + data.id, {
					url: "https://" + server + "/method/video.get/" + data.id + "?token=" + data.token + "&videos=" + data.id + "&ckey=" + data.ckey + "&credentials=" + data.credentials,
					imu_mode: "xhr",
					headers: {
						Accept: "application/json, text/javascript, */*; q=0.01",
						Origin: "https://" + domain_nowww,
						Referer: "https://" + domain_nowww + "/",
						Cookie: "",
						"sec-fetch-site": "same-site"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					var item = resp.response.items[0];
					var photos = {};
					var largest_photo = null;
					for (var key in item) {
						var match = key.match(/^photo_([0-9]+)$/);
						if (!match)
							continue;
						var our_size = parseInt(match[1]);
						if (!largest_photo || our_size > largest_photo)
							largest_photo = our_size;
						photos[our_size] = item[key];
					}
					var urls = [];
					var files = Object.keys(item.files);
					files.sort(function(a, b) {
						var a_match = a.match(/_([0-9]+)$/);
						var b_match = b.match(/_([0-9]+)$/);
						if (!a_match || !b_match)
							return 0;
						return b_match[1] - a_match[1];
					});
					array_foreach(files, function(key) {
						var file = item.files[key];
						file = file.replace(/:\/\/(vkvd[0-9]*\.mycdn\.me\/)/, "://" + server + "/$1");
						urls.push({
							url: file,
							video: true,
							can_head: false
						});
					});
					if (largest_photo) {
						urls.push(photos[largest_photo]);
					}
					return done(urls, 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+player\/+([^/.#]+)(?:#.*)?$/,
				query_for_id: function(id) {
					var referer = "https://biqle.com/";
					var queries = common_functions["parse_imu_hash"](src);
					if (queries && queries.referer)
						referer = queries.referer;
					return {
						url: "https://" + domain_nowww + "/player/" + id,
						imu_mode: "iframe",
						headers: {
							Referer: referer
						}
					};
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/window\.globParams\s*=\s*({[\s\S]+?});\s*<\/script>/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var fixedup = fixup_js_obj(match[1]);
					var urls = [];
					var json = JSON_parse(fixedup);
					var server = base64_decode(reverse_str(json.server));
					var id = json.video.cdn_id || json.video.id; // mp4 has both cdn_id and id (same?), hls only has id
					var waiting = false;
					if (json.video.cdn_files) {
						var splitted_id = id.split("_");
						var headpath = "https://" + server + "/videos/" + splitted_id[0] + "/" + splitted_id[1] + "/";
						var resolutions = [];
						var resolutions_map = {};
						obj_foreach(json.video.cdn_files, function(key, baseurl) {
							var splitted_key = key.split("_");
							var ext = splitted_key[0];
							var res = splitted_key[1];
							array_upush(resolutions, res);
							if (!(res in resolutions_map)) {
								resolutions_map[res] = [];
							}
							resolutions_map[res].push(key);
							baseurl = baseurl.replace(/\./, "." + ext + "?extra=");
							var url = headpath + baseurl;
							json.video.cdn_files[key] = url;
						});
						resolutions = resolutions.sort().reverse();
						array_foreach(resolutions, function(res) {
							array_foreach(resolutions_map[res], function(key) {
								urls.push({
									url: json.video.cdn_files[key],
									video: true
								});
							});
						});
					} else if (json.video.partial) { // partial isn't needed, it seems to be the same as cdn_files, but it's only on hls
						query_daxab({
							id: id,
							server: server,
							token: json.video.access_token,
							ckey: json.c_key,
							credentials: json.video.credentials
						}, function(urls) {
							final(urls);
						});
						waiting = true;
					}
					var final = function(urls) {
						if (!urls) {
							return done(null, false);
						}
						var baseobj = {
							headers: {
								"accept": "*/*",
								"accept-encoding": "identity;q=1, *;q=0",
								Referer: "https://" + domain_nowww + "/",
								"sec-fetch-dest": "video",
								"sec-fetch-mode": "no-cors",
								"sec-fetch-site": "same-site"
							}
						};
						console_log(urls, json);
						return done(fillobj_urls(urls, baseobj), 60 * 60);
					};
					if (!waiting) {
						if (json.video.thumb) {
							var thumb = urljoin(resp.finalUrl, base64_decode(json.video.thumb), true);
							urls.push(thumb);
						}
						final(urls);
					}
				}
			});
			if (newsrc)
				return newsrc;
		}
		if ((domain_nowww === "teddit.net" ||
			domain === "teddit.froth.zone" ||
			domain === "teddit.zaggy.nl" ||
			domain === "teddit.pussthecat.org" ||
			domain === "teddit.sethforprivacy.com" ||
			domain === "teddit.totaldarkness.net" ||
			domain === "teddit.adminforge.de" ||
			domain === "teddit.bus-hit.me" ||
			domain === "rdt.trom.tf" ||
			domain === "i.opnxng.com" ||
			domain === "teddit.garudalinux.org" ||
			domain === "tedd.it" ||
			domain === "teddit.privacytools.io" ||
			domain === "td.vern.cc" ||
			domain === "teddit.rawbit.ninja" ||
			domain === "teddit.artemislena.eu" ||
			domain === "teddit.manasiwibi.com" ||
			domain === "teddit.hostux.net" ||
			domain === "reddit.lurkmore.com")) {
			newsrc = src.replace(/(\/pics\/+)(?:thumbs\/+)?thumb_[wh]:[0-9]+_/, "$1w:null_");
			if (newsrc !== src)
				return newsrc;
			if (options.rule_specific && options.rule_specific.teddit_redirect_reddit) {
				newsrc = src
					.replace(/^[a-z]+:\/\/[^/]+\/+pics\/+(?:thumb_)?(?:[wh]:[^/._]+_)?([a-z0-9]{10,15}\.[^/.]+)(?:[?#].*)?$/, "https://i.redd.it/$1")
					.replace(/^[a-z]+:\/\/[^/]+\/+vids\/+([0-9a-z]{10,15}\.gif)\.mp4(?:[?#].*)?$/, "https://i.redd.it/$1");
				if (newsrc !== src) {
					if (host_domain_nowww === "teddit.net") {
						return {
							url: newsrc,
							need_data_url: true
						};
					} else {
						return newsrc;
					}
				}
			}
		}
		if ((host_domain_nowww === "teddit.net" ||
			host_domain === "teddit.froth.zone" ||
			host_domain === "teddit.zaggy.nl" ||
			host_domain === "teddit.pussthecat.org" ||
			host_domain === "teddit.sethforprivacy.com" ||
			host_domain === "teddit.totaldarkness.net" ||
			host_domain === "teddit.adminforge.de" ||
			host_domain === "teddit.bus-hit.me" ||
			host_domain === "rdt.trom.tf" ||
			host_domain === "i.opnxng.com" ||
			host_domain === "teddit.garudalinux.org" ||
			host_domain === "tedd.it" ||
			host_domain === "teddit.privacytools.io" ||
			host_domain === "td.vern.cc" ||
			host_domain === "teddit.rawbit.ninja" ||
			host_domain === "teddit.artemislena.eu" ||
			host_domain === "teddit.manasiwibi.com" ||
			host_domain === "teddit.hostux.net" ||
			host_domain === "reddit.lurkmore.com") && options.element && host_domain === domain) {
			var itemdiv = common_functions["get_parent_el_matching"](options.element, function(el) {
				return el.tagName === "DIV" && el.classList.contains("item");
			});
			if (itemdiv) {
				var sourcelink = itemdiv.querySelector("a.source-link[href]");
				if (sourcelink) {
					return sourcelink.href;
				}
			}
		}
		if ((host_domain_nowww === "teddit.net" ||
			host_domain === "teddit.froth.zone" ||
			host_domain === "teddit.zaggy.nl" ||
			host_domain === "teddit.pussthecat.org" ||
			host_domain === "teddit.sethforprivacy.com" ||
			host_domain === "teddit.totaldarkness.net" ||
			host_domain === "teddit.adminforge.de" ||
			host_domain === "teddit.bus-hit.me" ||
			host_domain === "rdt.trom.tf" ||
			host_domain === "i.opnxng.com" ||
			host_domain === "teddit.garudalinux.org" ||
			host_domain === "tedd.it" ||
			host_domain === "teddit.privacytools.io" ||
			host_domain === "td.vern.cc" ||
			host_domain === "teddit.rawbit.ninja" ||
			host_domain === "teddit.artemislena.eu" ||
			host_domain === "teddit.manasiwibi.com" ||
			host_domain === "teddit.hostux.net" ||
			host_domain === "reddit.lurkmore.com") && options.element && options.do_request && options.cb) {
			if (host_domain === domain && /\/pics\//.test(src)) {
				var linkdiv = common_functions["get_parent_el_matching"](options.element, function(el) {
					return el.tagName === "DIV" && el.classList.contains("link");
				});
				if (linkdiv) {
					var link = linkdiv.querySelector("div.links > a.comments");
					if (link) {
						api_query("teddit:" + link.href, {
							url: link.href,
							imu_mode: "document"
						}, function(url) { options.cb(url || src); }, function(done, resp, cache_key) {
							var match = resp.responseText.match(/<a href="(\/vids\/[^"/]+\.mp4)">\[media\]<\/a><\/div><div class="comments-info"/);
							if (!match) {
								return done(null, 60);
							}
							return done(urljoin(resp.finalUrl, match[1], true), 60);
						});
						return {
							waiting: true
						};
					}
				}
			}
		}
		if (domain_nowww === "rumble.com") {
			var get_rumble_page = function(url, cb) {
				api_query("rumble:" + url, {
					url: url,
					method: "GET",
					imu_mode: "document"
				}, cb, function(done, resp, cache_key) {
					return done(resp, 10 * 60);
				});
			};
			var get_rumble_embedjs_path = function(url, cb) {
				api_cache.fetch("rumble_embedjs", cb, function(done) {
					get_rumble_page(url, function(resp) {
						if (!resp) {
							return done(null, false);
						}
						var match = resp.responseText.match(/"(\/embedJS\/[a-z0-9]{2,})"[,;]/);
						if (!match) {
							console_error(cache_key, "Unable to find embedJS path from", resp);
							return done(null, false);
						}
						return done(urljoin("https://rumble.com/", match[1], true), 60 * 60);
					});
				});
			};
			var rumble_normalize_url = function(url) {
				var match = url.match(/^[a-z]+:\/\/[^/]+\/+([a-z0-9]+)-[^/?#.]*\.html(?:[?#].*)?$/);
				if (match) {
					return "https://rumble.com/" + match[1] + "-.html";
				}
				return url;
			};
			var rumble_url_to_videoid = function(url, cb) {
				var match = url.match(/^[a-z]+:\/\/[^/]+\/+embed\/+v([0-9a-z]+)\/*(?:[?#].*)?$/);
				if (match) {
					return cb(match[1]);
				}
				api_cache.fetch("rumble_url_videoid:" + url, cb, function(done) {
					get_rumble_page(url, function(resp) {
						if (!resp)
							return done(null, false);
						var match = resp.responseText.match(/Rumble\("play", {.*?"video":"v([0-9a-z]+)"/);
						if (!match) {
							console_error(cache_key, "Unable to find video id from", resp);
							return done(null, false);
						}
						return done(match[1], 6 * 60 * 60);
					});
				});
			};
			var query_rumble = function(vid, embedjs, cb) {
				api_query("rumble_api:" + vid, {
					url: embedjs + "/?request=video&v=v" + vid + "&ext=%7B%22ad_count%22%3Anull%7D",
					imu_mode: "xhr",
					referer: "https://rumble.com/embed/v" + vid + "/",
					json: true
				}, cb, function(done, resp, cache_key) {
					var obj = {
						extra: {
							page: "https://rumble.com/embed/v" + vid + "/"
						}
					};
					if (resp.l) {
						obj.extra.page = urljoin("https://rumble.com/", resp.l, true);
					}
					if (resp.title)
						obj.extra.caption = resp.title;
					if (resp.author)
						obj.extra.author_username = resp.author.name;
					if (resp.pubDate)
						obj.extra.created_date = new Date(resp.pubDate).getTime();
					var urls = [];
					var keys = Object.keys(resp.ua);
					keys.sort();
					array_foreach(keys, function(key) {
						urls.push({
							url: resp.ua[key][0],
							video: true,
						});
					});
					if (resp.i) {
						urls.push(resp.i);
					}
					return done(fillobj_urls(urls, obj), 6 * 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+([a-z0-9]+)-[^/?#.]*\.html(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+embed\/+v([0-9a-z]+)\/*(?:[?#].*)?$/
				],
				run: function(cb, match) {
					var vurl = rumble_normalize_url(src);
					rumble_url_to_videoid(vurl, function(vid) {
						if (!vid) {
							return cb(null);
						}
						get_rumble_embedjs_path(vurl, function(embedjs) {
							if (!embedjs) {
								return cb(null);
							}
							query_rumble(vid, embedjs, cb);
						});
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "images.parler.com") return src.replace(/^([a-z]+:\/\/[^/]+\/+[a-f0-9]{10,})_[0-9]+(?:[?#].*)?$/, "$1");
		if (domain_nowww === "blaqsbi.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+social\/+file\/+file\/+getremoteimage\/+url\/+(https?[^/]+)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			newsrc = src.replace(/(\/social\/+site\/+viewheaderimage\?(?:.*&)?filename=)([-a-z0-9]{20,})(\.[^/.?&#]+)/, "$1$2_org$3");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "imshopping.rediff.com") {
			return {
				url: src.replace(/\/imgshop\/+[0-9]*-[0-9]*\/+/, "/imgshop/-/"),
				head_wrong_contentlength: true
			};
		}
		if (domain_nowww === "neoprenesupplier.com") return src.replace(/(\/uploads\/+[0-9]{4,}\/+)small\/+/, "$1");
		if (domain_nowww === "bergen.kommune.no") return src.replace(/(\/publisering\/+api\/+bilder\/+[^?#]+)\?scaleWidth=.*$/, "$1");
		if ((domain_nosub === "infomaker.io" ||
			domain_nosub === "navigacloud.com") &&
			/^imengine(?:\.public)?\.prod/.test(domain)) {
			newsrc = add_queries(src, { "function": "original", "q": "100", "source": "true", "type": "primary" });
			newsrc = keep_queries(newsrc, ["uuid", "function", "type", "source", "q"]);
			return newsrc;
		}
		if (domain === "d3rm30gbu5aixc.cloudfront.net") {
			return src
				.replace(/(\/media\/+)(?:rc|l)\/+[0-9]+x[0-9]+\/+/, "$1")
				.replace(/\?.*/, "");
		}
		if (domain === "img.hotcelebzz.com") {
			return src
				.replace(/(\/photos\/+.*-[0-9]+)[0-9]{3}-thumbnail(\.[^/.]+)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/thumbnails\/.*)-300w-([0-9]{8,}\.[^/.]+)(?:[?#].*)?$/, "$1-zip-$2");
		}
		if (domain_nowww === "rule34.xyz") {
			newsrc = src.replace(/(\/files\/+)thumbnail\/+/, "$1");
			if (newsrc !== src) {
				return add_extensions_jpeg(newsrc);
			}
		}
		if (domain_nosub === "brazzers.com" && /^stage[0-9]*\./.test(domain)) {
			if (/\/assets\/+compiledAssets\/+build\/+Brazzers\/+BrazzersCom\/+Tour\/+assets\/+pages\/+img\/+spritesmith\//.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+scenes\/+view\/+id\/+([0-9]+)(?:\/+[^/]*\/*)?(?:[?#].*)?$/,
				query_for_id: "https://" + domain + "/scenes/view/id/${id}/",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/,\s+streams\s*:\s*({"stream_info".*}),/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					var stream_info = json.stream_info;
					var paths = {};
					if (stream_info.downloadHttp.paths) {
						paths = deepcopy(stream_info.downloadHttp.paths);
					}
					if (stream_info.http.paths) {
						paths = obj_extend(paths, stream_info.http.paths);
					}
					var keys = Object.keys(paths);
					keys.sort(function(a, b) {
						var a_match = a.match(/^[a-z0-9]+_[0-9]+_([0-9]+)$/);
						var b_match = b.match(/^[a-z0-9]+_[0-9]+_([0-9]+)$/);
						if (!a_match || !b_match) {
							return b.localeCompare(a);
						}
						return parseInt(b_match[1]) - parseInt(a_match[1]);
					});
					var urls = [];
					array_foreach(keys, function(key) {
						console_log(key);
						var path = paths[key];
						urls.push({
							url: urljoin(resp.finalUrl, path, true),
							video: true
						});
					});
					urls.push(urljoin(resp.finalUrl, json.poster, true));
					var obj = {
						extra: {
							page: resp.finalUrl
						}
					};
					match = resp.responseText.match(/<h1 class="scene-title"[^>]*>\s*([^<]+?)\s*</);
					if (match) {
						obj.extra.caption = decode_entities(match[1]);
					}
					return done(fillobj_urls(urls, obj), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "static-vz.brazzerscontent.com") {
			obj = {
				url: src,
				extra: {}
			};
			match = src.match(/:\/\/[^/]+\/+scenes\/+([0-9]+)\/+/);
			if (!match) {
				match = src.match(/\/bzv2\/+brazzerscom\/+landing\/+assets\/+pages\/+img\/+tgp5\/+gallery\/+jpg\/+([0-9]+)-[0-9]+\./);
			}
			if (match) {
				obj.extra.page = "https://stage4.brazzers.com/scenes/view/id/" + match[1] + "/";
			}
			newsrc = src.replace(/(\/scenes\/+[0-9]+\/+preview\/+)thm\/+([0-9]+\.[^/.]+)(?:[?#].*)?$/, "$1img/$2");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			if (obj.extra.page && /\/scenes\/+[0-9]+\/+[0-9]+x[0-9]+\./.test(src)) {
				return {
					url: obj.extra.page,
					is_pagelink: true
				};
			}
			return obj;
		}
		if (domain_nowww === "pinkqueen.com") return src.replace(/\/upload\/+thumb\/+[0-9]+x[0-9]+\/+/, "/upload/");
		if (host_domain_nowww === "fig.co" && options.element) {
			if (options.element.classList.contains("media-box__selector__selector-thumbnail__overlay")) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
		}
		if (domain === "cdn.locals.com") {
			return src
				.replace(/(\/images\/+(?:avatars|posts|groups)\/+)([0-9]+\/+[0-9]+_[0-9a-z]+)_full(\.[^/.]+)(?:[?#].*)?$/, "$1originals/$2$3")
				.replace(/(\/images\/+(?:avatars|posts|groups)\/+[0-9]+\/+[0-9]+_[0-9a-z]+_)(?:thumb|big)(\.[^/.]+)(?:[?#].*)?$/, "$1full$2");
		}
		if (domain === "matrix-client.matrix.org") return src.replace(/(\/_matrix\/+media\/+(?:r[0-9]+|v3)\/+)thumbnail\/+([^/]+\/+[-_a-zA-Z0-9]+)\?.*$/, "$1download/$2");
		if (domain_nowww === "pornssd.com") {
			match = src.match(/\/wp-content\/+plugins\/+clean-tube-player\/+public\/+player-x.php\?q=([^&]{50,})/);
			if (match) {
				var decoded = base64_decode(match[1]);
				var queries = get_queries("?" + decoded);
				return parse_tag_def(decodeURIComponent(queries.tag)).args.src;
			}
		}
		if (domain_nowww === "pornedup.com") return src.replace(/\/media\/+pics\/+thumbs_[a-z]+\/+/, "/media/pics/orig/");
		if (domain === "media.mstdn.io") return src.replace(/(\/mstdn-media\/+cache\/+media_attachments\/+files\/+(?:[0-9]{3}\/+)+)[a-z]+\/+/, "$1original/");
		if (domain_nosub === "avaz.ba") {
			newsrc = src.replace(/(\/media\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+\/+thumbs\/+)873x400(\.[^/.]+)(?:[?#].*)?$/, "$1w873$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src
				.replace(/(\/media\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+\/+thumbs\/+)cover_small(\.[^/.]+)(?:[?#].*)?$/, "$1cover_big$2")
				.replace(/(\/media\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+\/+thumbs\/+)240x225(\.[^/.]+)(?:[?#].*)?$/, "$1873x400$2");
			if (newsrc !== src) {
				return {
					url: newsrc,
					problems: {
						possibly_upscaled: true
					}
				};
			}
			regex = /(\/media\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+\/+thumbs\/+)(?:[0-9]+x[0-9]+|[wh][0-9]+)(\.[^/.]+)(?:[?#].*)?$/;
			if (regex && options.do_request && options.cb && !problem_excluded("possibly_upscaled")) {
				var larger_urls = [
					src.replace(regex, "$11200x700$2"),
					src.replace(regex, "$11005x635$2"),
					src.replace(regex, "$1h550$2"),
					src.replace(regex, "$1800x450$2"),
					src.replace(regex, "$1w873$2"),
					src.replace(regex, "$1873x400$2")
				];
				array_upush(larger_urls, src);
				common_functions["find_actual_largest_image"](src, larger_urls, function(src) {
					return options.cb({
						url: src,
						problems: {
							possibly_upscaled: true
						}
					});
				}, {
					check_length: true,
					api_cache: api_cache,
					do_request: options.do_request
				});
				return {
					waiting: true
				};
			}
		}
		if (domain === "cdn.firstshowing.net") {
			if (/\/firstshowing\/+images\/+cornerBR-playarrowcircle-/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "22pixx.xyz") return src.replace(/(:\/\/[^/]+\/+)os\/+([0-9]{4}\/+)/, "$1o/$2");
		if (domain === "i.prphotos.com" ||
			domain_nowww === "prphotos.com") {
			if (/\/mas_assets\/+prphotos\/+images\/+cat-thumb\.png/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			match = src.match(/^([a-z]+:\/\/[^/]+\/+mas_assets\/+)(?:thumb|full)(\/+[0-9]+\/+([A-Z]{3}-[0-9]+)\.[^/.]+)(?:[?#].*)?$/);
			if (match) {
				page = "https://www.prphotos.com/p/" + match[3] + "/";
				return fillobj_urls(replace_sizes(src, [
					{ url: match[1] + "full" + match[2], problems: { watermark: true } },
					{ url: match[1] + "thumb" + match[2], problems: { smaller: true } }
				], true), { extra: { page: page } });
			}
			match = src.match(/^([a-z]+:\/\/[^/]+\/+)[tf](\/+[0-9]+\/+([A-Z]{3}-[0-9]+)\/+[^/]+\.[^/.]+)(?:[?#].*)?$/);
			if (match) {
				page = "https://www.prphotos.com/p/" + match[3] + "/";
				return fillobj_urls(replace_sizes(src, [
					{ url: match[1] + "f" + match[2], problems: { watermark: true } },
					{ url: match[1] + "t" + match[2], problems: { smaller: true } }
				], true), { extra: { page: page } });
			}
		}
		if (amazon_container === "nrk-urort-prod") {
			return src.replace(/\/[0-9]+x[0-9]+\/+([-0-9a-f]{20,}\.[^/.]+)(?:[?#].*)?$/, "/images/$1");
		}
		if (domain === "d33mzpnc91f49u.cloudfront.net") return src.replace(/^[a-z]+:\/\/[^/]+\/+[0-9]+x[0-9]+\/+([a-z]+:\/\/)/, "$1");
		if (domain_nowww === "imgcarry.com" ||
			domain_nowww === "freebunker.com" ||
			domain_nowww === "imagefruit.com") {
			return src.replace(/\/tn\/+t([0-9]+\/+)/, "/tn/i$1");
		}
		if (domain === "d10ukrc8bht4o0.cloudfront.net") {
			return {
				url: src.replace(/(\/images\/+iva-img\/.*?)\?.*$/, "$1"),
				headers: {
					Referer: "" // otherwise 400
				},
				can_head: false // 404
			};
		}
		if (domain_nosub === "redbubble.net" && /^ih[0-9]*\./.test(domain)) {
			var basename = url_basename(src);
			var newbn;
			var obj_6 = {
				url: src,
				can_head: false,
				head_wrong_contentlength: true
			};
			var get_rb_obj = function() {
				obj_6.url = urljoin(src, newbn, true);
				return obj_6;
			};
			newbn = basename.replace(/\.webp(?:[?#].*)?$/, ".png");
			if (newbn !== basename)
				return get_rb_obj();
			newbn = decodeURIComponent(basename);
			if (newbn !== basename)
				return get_rb_obj();
			newbn = basename.replace(/-c(?:,[0-9]+){4}/, "");
			if (newbn !== basename)
				return get_rb_obj();
			newbn = basename.replace(/-pad,[0-9]+x[0-9]+,([0-9a-f]{6})/, "-bg,$1");
			if (newbn !== basename)
				return get_rb_obj();
			newbn = basename.replace(/\.u[0-9]*\./, ".");
			if (newbn !== basename)
				return get_rb_obj();
			if (false && /\/image\.[0-9]+\.[0-9]+\//.test(src)) {
				newbn = "bg,transparent.png";
				return get_rb_obj();
			}
			if (/^work\.[0-9]+\.[0-9]+\./.test(basename)) {
				newbn = basename.replace(/^(work\.[0-9]+\.[0-9]+\.).*?(\.[^/.]+)(?:[?#].*)?$/, "$1bg,transparent$2");
				return get_rb_obj();
			}
			return obj_6;
		}
		if (domain === "res.booklive.jp") {
			newsrc = src.replace(/(\/thumbnail\/+)2?[SML](\.[^/.]+)(?:[?#].*)?$/, "$1X$2");
			if (newsrc !== src) {
				return {
					url: newsrc,
					head_wrong_contenttype: true
				};
			}
		}
		if (domain_nowww === "viviancruz.net") return src.replace(/(\/files\/+page[0-9]+-[0-9]+-)thumb(\.[^/.]+)(?:[?#].*)?$/, "$1full$2");
		if (domain_nowww === "newtube.app") {
			match = src.match(/\/uploads\/+([^/]+)\/+([a-zA-Z0-9]+)\.jpg(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://newtube.app/uploads/" + match[1] + "/" + match[2] + ".mp4",
					video: true
				};
			}
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([^/]+)\/+([a-zA-Z0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					cb([
						{
							url: "https://newtube.app/uploads/" + match[1] + "/" + match[2] + ".mp4",
							video: true
						},
						"https://newtube.app/uploads/" + match[1] + "/" + match[2] + ".jpg"
					]);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (amazon_container === "fans-s3-18hhz4pv58rts-contentsbucket-llfrgay54iyy") {
			return src.replace(/(\/uploads\/+(?:artist\/+[^/]+\/+[0-9]+\/+|media\/+file\/+[0-9a-f]{10,}\/+|video_media\/+thumbnail\/+[0-9a-f]{10,}\/+))(?:resize_(?:horizontal_)?[0-9]+|convert_blur)?_([0-9a-f]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "fansnet.jp") return src.replace(/(\/resources\/+[0-9a-f]{10,}\/+)resize_(?:horizontal_)?[0-9]+(?:[?#].*)?$/, "$1file");
		if (domain_nosub === "fotki.com" && /^images[0-9]*\./.test(domain)) {
			return src.replace(/(\/photos\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+[^/]*)-th(\.[^/.]+)(?:[?#].*)?$/, "$1-vi$2");
		}
		if (domain_nowww === "sendvid.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:embed\/+)?([a-z0-9]{5,})(?:[?#].*)?$/,
				query_for_id: "https://sendvid.com/${id}",
				process: function(done, resp, cache_key) {
					var title = get_meta(resp.responseText, "og:title");
					var video = get_meta(resp.responseText, "og:video:secure_url");
					var thumb = get_meta(resp.responseText, "og:image");
					var url = get_meta(resp.responseText, "og:url") || resp.finalUrl;
					var obj = {
						extra: {
							caption: title,
							page: url
						}
					};
					var urls = [];
					urls.push({
						url: video,
						video: "hls",
						is_private: true // linked to ip
					});
					urls.push(thumb);
					return done(fillobj_urls(urls, obj), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "sendvid.com" && /^thumbs[0-9]*\./.test(domain)) {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+[0-9]{2}\/+[0-9]{2}\/+([0-9a-z]{5,})\./);
			if (match) {
				return {
					url: "https://sendvid.com/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain === "imageproxy.viewbook.com") {
			return {
				url: src
					.replace(/_hd(\.[^/.?#]+)$/, "$1")
					.replace(/\?.*/, ""),
				head_wrong_contenttype: true
			};
		}
		if (domain_nowww === "nintendo64ever.com") return src.replace(/\/thumbnails\/+([^/]+)_[0-9]+x[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "/$1$2");
		if (googlestorage_container === "studio-design-assets" ||
			googlestorage_container === "studio-design-asset-files") {
			return src.replace(/(\/projects\/+[^/]+\/+s-[0-9]+x[0-9]+_[^/.]+_[-0-9a-f]{10,})_small(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "arkiv.klassekampen.no") {
			return {
				url: src.replace(/(\/storyimage\/.*?)[?&#].*/, "$1"),
				head_wrong_contenttype: true
			};
		}
		if (domain_nowww === "remnant-tv.com") {
			if (/\/view\/+img\/+loading-gif\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+video\/+([0-9]+)\/+([^/?#]+)(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+videoEmbeded\/+([0-9]+)(?:[?#].*)?$/
				],
				query_for_id: "https://www.remnant-tv.com/videoEmbeded/${id}",
				process: function(done, resp, cache_key) {
					var obj = common_functions["get_videotag_obj"](resp);
					if (obj) {
						array_foreach(obj, function(single) {
							if (single.extra.caption)
								single.extra.caption = single.extra.caption.replace(/\s*-\s*Remnant TV\s*$/, "");
						});
					}
					done(obj, obj ? 60 * 60 : false);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "tv.gab.com") {
			newsrc = website_query({
				website_regex: {
					regex: /^[a-z]+:\/\/[^/]+\/+channel\/+([^/]+)\/+(?:embed|view)\/+([^/?#]+-[0-9a-f]{10,})(?:[?#].*)?$/,
					groups: ["channel", "id"]
				},
				query_for_id: "https://tv.gab.com/channel/${channel}/embed/${id}",
				process: function(done, resp, cache_key, match) {
					var channel = match.groups.channel;
					var fullid = match.groups.id;
					match = resp.responseText.match(/<div[^>]+\sid="tv-player"[^>]+>/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var info = parse_tag_def(match[0]);
					var title = info.args["data-episode-title"];
					var id = info.args["data-episode-id"];
					var viewkey = info.args["data-view-key"];
					var extra = {
						caption: title,
						author_username: channel,
						page: "https://tv.gab.com/channel/" + channel + "/view/" + fullid
					};
					var urls = [];
					urls.push({
						url: "https://tv.gab.com/media/" + id + "?viewKey=" + viewkey,
						imu_mode: "video",
						headers: {
							Referer: extra.page,
						},
						cookie_url: "https://tv.gab.com/", // hack, it requires cookies. browser refuses to load cookies for that site if embedded
						video: true
					});
					var thumbnail = get_meta(resp.responseText, "og:image");
					urls.push(thumbnail);
					return done(fillobj_urls(urls, { extra: extra }), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "nhm.ac.uk") {
			newsrc = src.replace(/(\/content\/+dam\/+.*\.[^/.]+)\.thumb\.[0-9]+\.[0-9]+\.[^/.]+(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return newsrc;
			return src
				.replace(/(\/resources\/+visit\/+wpy\/+[0-9]{4}\/+(?:[^/]+\/+)?large\/+)webp\/+([^/.]+)\.webp(?:[?#].*)?$/, "$1$2.jpg")
				.replace(/(\/resources\/+visit\/+wpy\/+[0-9]{4}\/+(?:[^/]+\/+)?)(?:small|medium)\/+/, "$1large/");
		}
		if (domain_nowww === "bear-family.com" && host_domain_nowww === "bear-family.com" && options.element) {
			if (options.element.tagName === "IMG") {
				var parent = options.element.parentElement;
				if (parent && parent.tagName === "SPAN" && parent.classList.contains("image--media")) {
					var dparent = parent.parentElement;
					if (dparent && dparent.tagName === "SPAN" && dparent.classList.contains("image--element")) {
						if (dparent.hasAttribute("data-img-original"))
							newsrc = dparent.getAttribute("data-img-original");
						else if (dparent.hasAttribute("data-img-large"))
							return dparent.getAttribute("data-img-large");
						if (newsrc !== src)
							return newsrc;
					}
				} else if (parent && parent.tagName === "A" && /\/media\/+image\//.test(parent.href)) {
					newsrc = parent.href;
					if (newsrc !== src)
						return newsrc;
				}
			}
		}
		if (digitalocean_container === "production-2") {
			return src
				.replace(/(\/playlog_image\/+)thumbnail(?:_[a-z]+)?\/+/, "$1");
		}
		if (domain_nowww === "playlog.com") {
			var query_playlog_csrf = function(cb) {
				api_query("playlog_csrf", {
					url: "https://playlog.com"
				}, cb, function(done, resp, cache_key) {
					var csrf_token = get_meta(resp.responseText, "csrf-token");
					if (!csrf_token) {
						console_error(cache_key, "Unable to find CSRF token for", resp);
						return done(null, false);
					}
					return done(csrf_token, 60 * 60);
				});
			};
			var query_playlog_xsrf = function(cb) {
				if (!options.get_cookies) {
					console_warn("No cookie support");
					return cb(null);
				}
				options.get_cookies("https://playlog.com/api/", function(cookies) {
					if (!cookies) {
						console_error("Unable to get cookies for playlog");
						return cb(null);
					}
					cookies = headers_list_to_dict(cookies);
					var xsrf = cookies["xsrf-token"];
					cb(xsrf);
				});
			};
			var query_playlog_csrf_xsrf = function(cb) {
				query_playlog_xsrf(function(xsrf) {
					if (!xsrf)
						return cb(null);
					query_playlog_csrf(function(csrf) {
						if (!csrf)
							return cb(null);
						return cb({
							xsrf: xsrf,
							csrf: csrf
						});
					});
				});
			};
			var query_playlog_api = function(token, url, cb) {
				api_query("playlog_api:" + url, {
					url: url,
					imu_mode: "xhr",
					headers: {
						"Referer": src.replace(/#.*/, ""),
						"x-api-version": "v2",
						"x-csrf-token": token.csrf,
						"x-requested-with": "XMLHttpRequest",
						"x-resource-version": "new",
						"x-xsrf-token": token.xsrf
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					if (resp.return_code !== 0) {
						console_error(cache_key, resp);
						return done(null, false);
					}
					return done(resp, 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+playlogs\/+([a-z0-9]{5,})(?:[?#].*)?$/,
				override_cb: function(cb, data) {
					var wanted_image = null;
					var queries = common_functions["parse_imu_hash"](src);
					if (queries && queries.image)
						wanted_image = queries.image;
					if (!wanted_image)
						return cb(data);
					wanted_image = url_basename(wanted_image);
					common_functions["update_album_info_links"](data, function(x) {
						return url_basename(x) === wanted_image;
					});
					cb(data);
				},
				run: function(cb, match) {
					var id = match[1];
					query_playlog_csrf_xsrf(function(token) {
						if (!token)
							return cb(null);
						query_playlog_api(token, "https://playlog.com/api/playlogs/" + id, function(data) {
							if (!data)
								return cb(null);
							var playlog = data.data.playlog;
							var obj = {
								extra: {
									page: "https://playlog.com/playlogs/" + id,
									caption: playlog.description,
									created_date: playlog.uploaded_at * 1000,
									author_username: playlog.user.name
								}
							};
							var links = [];
							array_foreach(playlog.image_frames, function(image) {
								links.push({
									url: image.image.url,
									is_current: false
								});
							});
							obj.album_info = {
								type: "links",
								links: links
							};
							links[0].is_current = true;
							return cb(fillobj_urls([links[0].url], obj));
						});
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if ((domain_nosub === "amplience.net" && /^i[0-9]*\./.test(domain)) ||
			domain === "cdn.media.amplience.net" ||
			domain === "media.finishline.com" ||
			domain === "media.jdsports.com") {
			if (/\/t\/+jpl\/+jd_product_list\?/.test(src)) {
				var queries = get_queries(src);
				if (queries.plu) {
					return urljoin(src, "/i/jpl/" + queries.plu, true);
				}
			} else if (/\/i\/+jpl\//.test(src)) {
				return src.replace(/\?.*/, "");
			}
		}
		if (domain === "cdn.media.amplience.net") {
			var obj_7 = {
				url: src,
				bad_if: [{
						headers: {
							"x-amp-published": "Sat, 13 Aug 2022 04:11:19 GMT",
							"x-amp-source-height": "1031",
							"x-amp-source-width": "1280",
							"content-length": "11185"
						}
					}]
			};
			obj_7.url = src
				.replace(/(\/i\/+harryrosen\/+[0-9]+)_[a-z]+(?:\.[a-z]+)?(?:[?#].*)?$/, "$1")
				.replace(/(\/s\/+hottopic\/+[0-9]+_hi)(?:_[a-z]+)?(?:\.[a-z]+)?(?:[?#].*)?$/, "$1");
			return obj_7;
		}
		if (domain_nowww === "indigowhitetv.com") {
			if (/\/assets\/+heart-circle-pink\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nosub === "dgtle.com" && /^s[0-9]*\./.test(domain)) {
			return src.replace(/(\/dgtle_img\/+[^/]+\/+[0-9]{4}\/+(?:[0-9]{2}\/+){1,2}[0-9a-fA-F]{20,})_[0-9]+_[0-9]+(?:_w)?(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "trumbhost.com" ||
			domain_nowww === "crazyimg.com") {
			return src.replace(/(\/images\/+[0-9]{4}\/+[0-9]{2}\/+[0-9a-z]{10,})_tn(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "brandnewtube.com") {
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+watch\/+(?:[^/._?#]+)?_([a-zA-Z0-9]{10,})\.html(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+embed\/+([a-zA-Z0-9]{10,})(?:[?#].*)?$/
				],
				query_for_id: "https://brandnewtube.com/watch/_${id}.html",
				process: function(done, resp, cache_key) {
					var obj = common_functions["get_videotag_obj"](resp);
					done(obj, obj ? 60 * 60 : false);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "onevsp.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+watch\/+([0-9a-zA-Z]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://onevsp.com/watch/${id}",
				process: function(done, resp, cache_key) {
					var obj = common_functions["get_videotag_obj"](resp);
					done(obj, obj ? 60 * 60 : false);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "cdn.betterttv.net") return src.replace(/(\/emote\/+[0-9a-f]{10,}\/+)[12]x(?:[?#].*)?$/, "$13x");
		if (domain === "cdn.frankerfacez.com") return src.replace(/(\/emote\/+[0-9]+\/+)[12](?:[?#].*)?$/, "$14");
		if (domain_nowww === "wsgf.org") return src.replace(/(\/f\/+u\/+imagecache\/+)ingame_screenshot_(?:normal|wide)\/+/, "$1node-gallery-display/");
		if (domain_nowww === "hotarena.net") return src.replace(/(\/userfiles\/+content\/+[0-9]+\/+)[0-9]+\/+/, "$1original/");
		if (domain === "i.gifer.com") {
			newsrc = src.replace(/(\/origin\/+[0-9a-f]{2}\/+[0-9a-f]{10,})_(?:w[0-9]+|mob)(\.(?:gif|webp))(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/origin\/+[0-9a-f]{2}\/+[0-9a-f]{10,})\.(?:gif|webp)(?:[?#].*)?$/, "$1.mp4");
			if (false && newsrc !== src) {
				return {
					url: newsrc,
					video: true
				};
			}
			newsrc = src.replace(/\/(?:fetch|preset)\/+[^/]+\/+([0-9a-f]{2}\/+[0-9a-f]{10,})\.[^/.]+(?:[?#].*)?$/, "/origin/$1.gif");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/^[a-z]+:\/\/[^/]+\/+([A-Z0-9]+)\.[^/.]+(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://gifer.com/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "gifer.com") {
			var query_gifer_media = function(id, cb) {
				api_query("gifer:" + id, {
					url: "https://gifer.com/api/media/" + id + "?include=creator,tags.tag",
					imu_mode: "xhr",
					headers: {
						"ab": "b",
						"accept": "*/*",
						"accept-language": "en", // or *
						"content-type": "application/json",
						referer: "https://gifer.com/en/" + id
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					if (!resp.file || !resp.file.formats) {
						console_error(cache_key, "Unable to find formats in", resp);
						return done(null, false);
					}
					return done(resp, 6 * 60 * 60);
				});
			};
			var gifer_media_to_obj = function(data) {
				var extra = {};
				if (data.createdAt)
					extra.created_date = new Date(data.createdAt).getTime();
				if (data.creator) {
					if (data.creator.username)
						extra.author_username = data.creator.username;
				}
				extra.page = "https://gifer.com/" + data.id;
				var obj = { extra: extra };
				var urls = [];
				var base = "https://i.gifer.com/origin/" + data.file.path;
				if (false && array_indexof(data.file.formats, "mp4") >= 0) {
					urls.push({
						url: base + ".mp4",
						video: true
					});
				}
				urls.push(base + ".gif");
				urls.push(base + ".webp");
				return fillobj_urls(urls, obj);
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:[a-z]{2}\/+)?([A-Z0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					var id = match[1];
					query_gifer_media(id, function(data) {
						if (!data)
							cb(null);
						cb(gifer_media_to_obj(data));
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "cdn.nivoli.com") return src.replace(/(\/adventuregamers\/+images\/+screenshots\/+[0-9]+\/+[^/]+)__(?:small|medium|large)(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "rusfap.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([^/]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://rusfap.com/video/${id}/",
				process: function(done, resp, cache_key) {
					var obj = common_functions["get_videotag_obj"](resp, {
						videotag: false,
						ogvideo: true
					});
					done(obj, obj ? 60 * 60 : false);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "media.oboobs.ru" ||
			domain === "media.obutts.ru") {
			return src.replace(/\/(boobs|butts)_preview\/+/, "/$1/");
		}
		if (domain_nowww === "veoh.com") {
			var get_veoh_csrf_from_resp = function(resp) {
				var match = resp.responseText.match(/\s+csrfToken:\s+"([a-zA-Z0-9]{20,})",/);
				if (!match) {
					console_error("Unable to find csrf token from", resp);
					return null;
				}
				return match[1];
			};
			var get_veoh_csrf = function(cb) {
				api_query("veoh_csrf", {
					url: "https://www.veoh.com/",
					imu_mode: "document"
				}, cb, function(done, resp, cache_key) {
					return done(get_veoh_csrf_from_resp(resp), 60 * 60);
				});
			};
			var query_veoh_video_with_csrf = function(csrf, vid, cb) {
				api_query("veoh:" + vid, {
					url: "https://www.veoh.com/watch/getVideo/" + vid,
					imu_mode: "xhr",
					headers: {
						referer: "https://www.veoh.com/watch/" + vid,
						accept: "application/json, text/plain, */*",
						"access-control-allow-origin": "*",
						"x-csrf-token": csrf,
						"x-requested-with": "XMLHttpRequest"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					if (!resp.success || !resp.video || !resp.video.src) {
						console_error(cache_key, "Error querying video", vid, resp);
						return done(null, false);
					}
					return done(resp, 6 * 60 * 60);
				});
			};
			var veoh_video_to_obj = function(data) {
				if (!data || !data.video || !data.video.src)
					return null;
				var video = data.video;
				var obj = { extra: {} };
				obj.extra.page = "https://www.veoh.com/watch/" + video.permalinkId;
				obj.extra.caption = video.title;
				obj.extra.author_username = video.author.nickname;
				var urls = [];
				if (video.src.HQ) {
					urls.push({
						url: video.src.HQ,
						video: true
					});
				}
				if (video.src.Regular) {
					urls.push({
						url: video.src.Regular,
						video: true
					});
				}
				urls = fillobj_urls(urls, {
					headers: {
						accept: "*/*",
						"accept-encoding": "identity;q=1, *;q=0",
						referer: "https://www.veoh.com/",
						"sec-fetch-dest": "video",
						"sec-fetch-mode": "no-cors",
						"sec-fetch-site": "same-site"
					},
					can_head: false // seems to be the important one to avoid 403?
				});
				if (video.src.poster) {
					urls.push(video.src.poster);
				}
				return fillobj_urls(urls, obj);
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+watch\/+(v[0-9]+[a-zA-Z0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					var vid = match[1];
					get_veoh_csrf(function(csrf) {
						if (!csrf)
							return cb(null);
						query_veoh_video_with_csrf(csrf, vid, function(data) {
							cb(veoh_video_to_obj(data));
						});
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "veoh.com") {
			newsrc = common_functions["get_pagelink_host_el_matching"](options, {
				url_match: /^https?:\/\/(?:www\.)?veoh\.com\/+watch\/+([0-9a-zA-Z]+)(?:[?#].*)?$/,
				el_match: function(x) {
					return x.tagName === "FIGURE" && x.classList.contains("video-container");
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "tutorialspoint.com") return src.replace(/(\/assets\/+profiles\/+[0-9]+\/+profile\/+)[0-9]+_/, "$1");
		if (domain === "img.gigapic.com" ||
			domain === "pics.hmporn.net") {
			return src.replace(/(\/(?:galleries|photos)\/+(?:[0-9]\/+){2}(?:[0-9]+\/+){1,2})[0-9]+-[0-9]+_([0-9a-f]{20,}\.)/, "$1pic_$2");
		}
		if (domain === "akm-img-a-in.tosshub.com") {
			return {
				url: src
					.replace(/(\/images\/+story\/+[0-9]{6}\/+[^/]+)-(?:[0-9]+x[0-9]+|sixteen_nine)(\.[^/.?#]+)$/, "$1$2")
					.replace(/(\/images\/+story\/[^?#]+)(?:[?#].*)?$/, "$1"),
				can_head: false
			};
		}
		if (domain === "cdn-s3.sidereel.com") return src.replace(/(\/tv_shows\/+[0-9]+\/+)(?:small|medium|large|giant)(?:_[0-9]+x)?\/+/, "$1original/");
		if (domain_nowww === "vergewiki.com") return src.replace(/(\/uploads\/+)resize-[a-z]+\/+/, "$1");
		if (domain === "img.mm52.com") return src.replace(/_128px(\.[^/.]+)$/, "_620px$1");
		if (domain === "image.noelshack.com") {
			newsrc = src.replace(/\/minis\/+([0-9]{4}\/+)/, "/fichiers/$1");
			if (newsrc !== src) {
				return add_extensions(newsrc);
			}
		}
		if (domain === "static.lostfilm.run") return src.replace(/(\/Gallery\/+(?:[0-9a-f]\/+){3})t_/, "$1");
		if (domain === "bi.im-g.pl") return src.replace(/(\/im\/+(?:[0-9a-f]{2}\/+){3}z[0-9]+)(?:[FJV]|I[IF])([,.])/, "$1O$2");
		if (domain === "images.macrumors.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+t\/+/, "/");
			if (newsrc !== src) {
				return urljoin("https://images.macrumors.com/", common_functions["get_thumbor_url"](newsrc), false);
			}
		}
		if (domain_nowww === "playvids.com") {
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+([0-9a-zA-Z]{10,12})\/+/,
					/^[a-z]+:\/\/[^/]+\/+embed\/+([0-9a-zA-Z]{10,12})(?:[?#].*)?$/
				],
				query_for_id: "https://www.playvids.com/embed/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<video[^>]+\s+data-dash-src="(https?:\/\/[^"]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done({
						extra: {
							page: resp.finalUrl
						},
						url: decode_entities(match[1]),
						video: "dash"
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "ugetube.com") {
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+watch\/+[^/.?#]*_([a-zA-Z0-9]{10,})\.html(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+embed\/+([a-zA-Z0-9]{10,})(?:[?#].*)?$/
				],
				query_for_id: "https://ugetube.com/watch/_${id}.html",
				process: function(done, resp, cache_key) {
					var title = get_meta(resp.responseText, "og:title");
					var page = get_meta(resp.responseText, "og:url");
					var image = get_meta(resp.responseText, "og:image");
					var obj = {
						extra: {
							caption: title,
							page: page
						}
					};
					var urls = [];
					var match = resp.responseText.match(/sources:\s*\[\s*{\s*"file":\s*("https?:[^"]+"),/);
					if (!match) {
						console_error(cache_key, "Unable to find video match from", resp);
						return done(null, false);
					}
					urls.push({
						url: JSON_parse(match[1]),
						cookie_url: "https://ugetube.com/", // cloudflare
						headers: {
							Referer: "https://ugetube.com/",
							"sec-fetch-dest": "video",
							"sec-fetch-mode": "no-cors",
							"sec-fetch-site": "same-site"
						},
						video: true
					});
					urls.push(image);
					return done(fillobj_urls(urls, obj), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "ugetube.com" && options.element) {
			newsrc = common_functions["get_pagelink_host_el_matching"](options, {
				url_match: /^[a-z]+:\/\/(?:www\.)?ugetube.com\/+watch\/+[^/.?#]*_([a-zA-Z0-9]{10,})\.html(?:[?#].*)?$/,
				el_match: function(x) {
					return x.tagName === "VIDEO" && x.classList.contains("jw-video");
				}
			});
			if (newsrc)
				return newsrc;
		}
		if ((domain_nosub === "optimole.com" && /^[a-z0-9]+\.i\./.test(domain))) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+[^/]+\/+(?:[a-z]{1,3}(?::(?:[a-z]+|[0-9.]+))+\/+)*(https?:\/\/)/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "bordalo.observador.pt") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+v2\/+.*?\/+(https?:\/\/)/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "podbean.com" && /^pbcdn[0-9]*\./.test(domain)) {
			return src.replace(/(\/imglogo\/+image-logo\/+[0-9]+\/+[^/]+)_[0-9]+x[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "podbean.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+media\/+player\/+mini\?(?:.*&)?media=(https?[^&]+)(?:[&#].*)?$/,
				run: function(cb) {
					var queries = get_queries(src);
					var urls = [];
					urls.push({
						url: decodeuri_ifneeded(queries.media),
						media_info: {
							type: "audio"
						}
					});
					if (queries.l) {
						urls.push(decodeuri_ifneeded(queries.l));
					}
					return cb(urls);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "turkcealtyazi.org") {
			return src
				.replace(/\/film\/+[0-9]+\/+([0-9]+\.)/, "/images/poster/$1")
				.replace(/\/film\/+mthumb\/+([0-9]+\.)/, "/images/poster/$1")
				.replace(/\/film\/+nmmid\/+/, "/film/nmbig/")
				.replace(/\/film\/+images\/+(nm[0-9]+\.)/, "/film/nmbig/$1")
				.replace(/\/images\/+avatars_thumb\/+/, "/images/avatars/")
				.replace(/(\/resimler\/+[^/]+\/+[0-9]+\/+)[tm]-/, "$1l-");
		}
		if (domain_nowww === "planetdp.org") return src.replace(/\/(covers|titleimgs)\/+(?:mid|thumb)\/+((?:dp[0-9]+|[^/.]+-[0-9a-f]+)\.)/, "/$1/big/$2");
		if (domain_nosub === "jegy.hu" && /^pb[0-9]*\./.test(domain)) {
			return src.replace(/(\/imgs\/+.*)-[0-9]+-[0-9]+(-[0-9]+\.)/, "$1-original$2");
		}
		if (domain_nowww === "wonderwall.com") {
			if (/\/wp-content\/+themes\/+[^/]+\/+assets\/+images\/+download\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain === "outgoing.prod.mozaws.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+v1\/+[0-9a-f]{20,}\/+(http)/, "$1");
			if (newsrc !== src) {
				return decodeuri_ifneeded(newsrc);
			}
		}
		if (domain_nowww === "hlamer.ru" ||
			domain_nowww === "zloekino.su") {
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+video\/+([0-9]+)(?:-[^/]+)(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+embed\/+([0-9]+)(?:[?#].*)?$/
				],
				query_for_id: "https://" + domain + "/video/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/video_Init\('([^']+)', /);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var decoded = base64_decode(match[1]);
					var json = JSON_parse(decoded);
					var obj = {
						extra: {
							id: json.v_id,
							caption: get_meta(resp.responseText, "og:title"),
							page: resp.finalUrl
						}
					};
					match = resp.responseText.match(/<meta itemprop='uploadDate' content='([^']+)'/);
					if (match) {
						obj.extra.created_date = new Date(match[1]).getTime();
					}
					var videourls = [];
					obj_foreach(json, function(key, value) {
						if (!/^url/.test(key))
							return;
						var video = true;
						var ext = url_basename(value, { split_ext: true })[1];
						if (ext === "mpd") {
							video = "dash";
						}
						videourls.push({
							url: value,
							video: video
						});
					});
					var urls = [];
					array_extend(urls, fillobj_urls(videourls, {
						headers: {
							Referer: "https://" + domain + "/"
						}
					}));
					urls.push(json.image);
					return done(fillobj_urls(urls, obj), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
			if (/\/resource\/+image\/+layout\/+bg-/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nosub === "krasview.ru" && /^cdn[0-9]*\./.test(domain)) {
			return src.replace(/(\/user\/+(?:[0-9]+\/+){1,2}[0-9a-f]+)_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "image.krasview.ru") return src.replace(/(\/video\/+[0-9a-f]+\/+)[0-9]+\./, "$1_.");
		if (domain_nowww === "topwam.com") return src.replace(/(\/uploaded\/+celebrities\/+thumbnails\/+[0-9]+\/+sbb_[0-9]{6}_[^/.]+)_150(\.[^/.]+)(?:[?#].*)?$/, "$1_450$2");
		if (domain === "static.starity.hu") return src.replace(/(\/images\/+gallery\/+)(?:120x120|345x230)\/+/, "$11920x1282/");
		if (domain_nowww === "keptarolo.hu") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(s[0-9]+\/+[^/?#]+\.[^/.?#]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					return cb("http://keptarolo.hu/kep/" + match[1]);
				}
			});
			if (newsrc)
				return newsrc;
			if (/\/images\/+thumbnail\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}/.test(src) && options.element) {
				newsrc = common_functions["get_pagelink_el_matching"](options.element, /^[a-z]+:\/\/keptarolo.hu\/+s[0-9]+\/+/);
				if (newsrc)
					return newsrc;
			}
		}
		if (amazon_container === "soundstripe-production") {
			return src.replace(/(\/uploads\/+[a-z]+\/+[0-9]+\/+pic\/+)(?:standard|thumb)_/, "$1");
		}
		if (domain_nowww === "dolphin-emu.org") {
			newsrc = src.replace(/(\/user\/+blog\/+[^/]+\/+[^/]+)_thumb(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src) {
				return add_extensions(newsrc);
			}
		}
		if (domain_nosub === "tvtome.com" && /^img[0-9]*\./.test(domain)) {
			return src.replace(/(\/i\/+(?:u|tvc)\/+)[^/]+\/+([0-9]+|[0-9a-f]{20,})\./, "$1$2.");
		}
		if (domain === "d2z1w4aiblvrwu.cloudfront.net") return src.replace(/(\/ad\/+[a-zA-Z0-9]+\/+[^/]+-)small(-[0-9]+\.)/, "$1large$2");
		if (domain === "uploads.xrel.to") {
			return src
				.replace(/(\/attachments\/+)thumb_([0-9]+)/, "$1$2")
				.replace(/(\/img_cover\/+(?:movie|game|console)[0-9]+-[0-9a-f]+)(\.[^/.]+)/, "$1-full$2")
				.replace(/(\/img_mediathek)_thumb\/+((?:movie|game|console)[0-9]+-)/, "$1/$2");
		}
		if (domain_nowww === "javteentube.com") {
			if (/^[a-z]+:\/\/[^/]+\/+jtt\/+[a-z]+-[0-9a-z]{4}\.png(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain === "pics.pornwatchers.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+media\/+thumbs\/+((?:[0-9a-f]\/+){5}[0-9a-f]+(?:-[^/.]+)?)(?:\.mp4)?\/+[0-9a-f]+.*/, "https://cdn.pornwatchers.com/media/videos/$1.mp4");
			if (newsrc !== src) {
				return {
					url: newsrc,
					video: true
				};
			}
		}
		if (domain_nowww === "pornwatchers.com") {
			newsrc = website_query({
				website_regex: [
					/^[a-z]+:\/\/[^/]+\/+video\/+[^/.]*-([0-9]+)\.html(?:[?#].*)?$/,
					/^[a-z]+:\/\/[^/]+\/+embed\/+([0-9]+)(?:[?#].*)?$/
				],
				query_for_id: "https://www.pornwatchers.com/video/-${id}.html",
				process: function(done, resp, cache_key) {
					var thumbnail = get_meta(resp.responseText, "thumbnailUrl");
					var video = strip_whitespace(get_meta(resp.responseText, "contentURL"));
					var name = get_meta(resp.responseText, "name");
					var description = get_meta(resp.responseText, "description");
					var urls = [];
					if (video)
						urls.push({ url: video, video: true });
					if (thumbnail)
						urls.push(thumbnail);
					var obj = {
						extra: {
							caption: name || description,
							page: resp.finalUrl
						}
					};
					done(fillobj_urls(urls, obj), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "alohatube.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+ktm\/+view\.cgi\?(?:.*&)?u=(https?:\/\/[^&]+)(?:[?&#].*)?$/);
			if (match) {
				return {
					url: match[1],
					is_pagelink: true
				};
			}
		}
		if (domain === "d29ef90wiiaj1a.cloudfront.net") return src.replace(/(\/user_[0-9a-f]{10,}_[^/.]+\.)[0-9]+x[0-9]+\./, "$1");
		if (domain_nowww === "asexypanties.com" ||
			domain_nowww === "twistyscafe.com" ||
			domain_nowww === "pantiespics.net") {
			return src.replace(/(\/galleries\/+(?:[^/]+\/+[a-z][0-9]+\/+)?[^/]+\/+[0-9]+)tn(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nowww === "panty-porn.com") return src.replace(/(\/pictures\/+[^/]+\/+p[0-9]+)t(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "pornstarsluv.com") return src.replace(/(\/media\/+images)_[0-9]+\/+/, "$1/");
		if (domain === "mk0movieguide99l7786.kinstacdn.com") {
			if (/\/wp-content\/+plugins\/+movieguide\/+images\/+overlay_[a-z]+\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (amazon_container === "booker-small-2-fk") {
			newsrc = src.replace(/(\/library\/+[0-9]+\/+[0-9]+_[0-9]+)(\.[^/.]+)(?:[?#].*)?$/, "$1_M$2");
			if (newsrc !== src) {
				return add_extensions_upper(newsrc);
			}
		}
		if (domain === "d1231c29xbpffx.cloudfront.net" &&
			host_domain_nowww === "blendermarket.com" && options.element) {
			regex = /\/store\/+product(?:image)?\/+([0-9]+)\/+image\/+/;
			match = src.match(regex);
			if (match) {
				id = match[1];
				var current = options.element;
				var _loop_2 = function() {
					if (current.tagName === "DIV" && current.classList.contains("slideshow-wrap")) {
						a_els = current.querySelectorAll("li > a[data-data-featherlight=\"image\"]");
						var newhref_1 = null;
						array_foreach(a_els, function(el) {
							var el_match = el.href.match(regex);
							if (!el_match)
								return;
							if (el_match[1] === id) {
								newhref_1 = el.href;
								return false;
							}
						});
						if (newhref_1)
							return { value: newhref_1 };
					}
				};
				var a_els;
				while (current = current.parentElement) {
					var state_1 = _loop_2();
					if (typeof state_1 === "object")
						return state_1.value;
				}
			}
		}
		if (domain_nowww === "powells.com") {
			if (/\/images\/+zoomImage\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain === "d3525k1ryd2155.cloudfront.net") {
			regex = /(\/[0-9]{5,}\.[0-9]+\.)[blmsx](\.[^/.]+(?:[?#].*)?)$/;
			if (regex.test(src)) {
				return [
					src.replace(regex, "$1x$2"),
					src.replace(regex, "$1l$2"),
					src.replace(regex, "$1m$2"),
					src.replace(regex, "$1b$2"),
					src.replace(regex, "$1s$2")
				];
			}
		}
		if (domain_nosub === "booksamillion.com" && /^covers[0-9]*\./.test(domain)) {
			return src.replace(/(\/covers\/+bam\/+(?:[0-9]+\/+)+[0-9]+)(?:_[wmbxst])?(\.[^/.]+)(?:[?#].*)?$/, "$1_o$2");
		}
		if (domain === "cropper.watch.aetnd.com") {
			newsrc = src.replace(/\?.*/, "");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+([^/]+\.[^/]+\/.*)$/, "$1");
			if (newsrc !== src)
				return add_http(newsrc);
		}
		if (domain_nowww === "zdnet.com") return src.replace(/(\/a\/+img\/+)resize\/+[0-9a-f]{10,}\/+(.*?)\?.*$/, "$1$2");
		if (domain_nowww === "cnet.com") {
			newsrc = src.replace(/(\/a\/+img\/+)resize\/+(.*?)\?.*$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+a\/+img\/+/, "/");
			if (newsrc) {
				return urljoin("https://" + domain + "/a/", common_functions["get_thumbor_url"](newsrc), true);
			}
		}
		if (domain === "japan.cnet.com") return src.replace(/(\/storage\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]{30,}\/+)t\/+[0-9]+\/+[0-9]+\/+d\/+([^/]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "rei.com") return src.replace(/(\/media\/+(?:product\/+[0-9]+|[-0-9a-f]{10,}))(?:[?#].*)?$/, "$1?size=999999");
		if (domain === "images.internetstores.de") return src.replace(/(\/products\/+[0-9]+\/+.*\/[^/.?#]+?)(?:(?:\[|%5[bB])[0-9]+x[0-9]+(?:\]|%5[dD]))*(\.[^/.?#]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "icheckmovies.com") {
			if (/\/images\/+dvdCover\.png/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			return src.replace(/(\/var\/+posters\/+)(?:small|medium)\/+/, "$1original/");
		}
		if (domain_nowww === "mojtv.hr") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+thumb\.ashx\?(?:.*&)?path=([^&]+).*$/, "$1");
			if (newsrc !== src) {
				return urljoin("https://" + domain + "/", newsrc, true);
			}
		}
		if (domain_nosub === "picstate.com" && /^s[0-9]*\./.test(domain)) {
			return src.replace(/\/[a-z]{2}\/+([0-9a-f]{3}\/+[0-9a-f]{20,}\.)/, "/fl/$1");
		}
		if (domain_nowww === "picstate.com") return src.replace(/\/thumbs\/+[a-z]+\/+/, "/files/");
		if (domain_nowww === "laden.to") return src.replace(/\/data\/+mini\/+/, "/data/poster/");
		if (domain === "images.universal-music.de") return src.replace(/^[a-z]+:\/\/[^/]+\/+img\/+assets\/+[0-9]{3}\/+([0-9]+)\/+[0-9]+\/+[0-9]+\/+([^/?#]+)(?:[?#].*)?$/, "https://static.universal-music.de/asset_new/$1/195/view/$2");
		if (domain === "cdn-shop.adafruit.com") return src.replace(/(:\/\/[^/]+\/+)[0-9]+x[0-9]+\/+/, "$1original/");
		if (domain_nowww === "dilangwyn.com") return src.replace(/(\/images\/+[0-9]+-[^/.]+)Thmb(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "embed.videodelivery.net") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+embed\/+iframe\.[^/.]+\.[0-9a-f]+\.html\?(?:.*&)?videoId=([0-9a-f]{10,})(?:[?&#].*)?$/,
				run: function(cb, match) {
					var vid = match[1];
					var urls = [];
					urls.push({
						url: "https://videodelivery.net/" + match[1] + "/manifest/video.mpd",
						headers: {
							origin: "",
							referer: ""
						},
						video: "dash"
					});
					urls.push("https://videodelivery.net/" + vid + "/thumbnails/thumbnail.jpg?width=2000");
					return cb(urls);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (amazon_container === "diy-magazine") {
			return src.replace(/\/_(?:square|landscape|[0-9]+x[0-9]+)(?:_[^/]+)?\/+([^/]+)(?:[?#].*)?$/, "/$1");
		}
		if (domain_nowww === "photosex.biz") {
			newsrc = src.replace(/\/imager\/+(?:[wh]_[0-9]+\/+)*/, "/pic_b/");
			if (newsrc !== src)
				return {
					url: newsrc,
					headers: {
						Referer: "http://photosex.biz/v.php?id=" + src.replace(/.*\/([0-9a-f]{10,})\.[^/]+(?:[?#].*)?$/, "$1")
					}
				};
		}
		if ((domain_nosub === "gmx.ch" ||
			domain_nosub === "gmx.net") && /^i[0-9]*\./.test(domain)) {
			newsrc = src.replace(/(\/image\/+[0-9]+\/+[0-9]+)(?:,|%2c)[^/]*([/.])/i, "$1,pd=1$2");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/image\/+[0-9]+\/+[^/]+(?:\/+[^/]*)?)\.webp(?:[?#].*)?$/i, "$1.png");
		}
		if ((domain_nosub === "amomama.xyz" && /^imgproxy/.test(domain)) ||
			domain === "images.apkeasy.me" ||
			domain === "img.apkeasy.com") {
			match = src.match(/\/(aHR0c[^/.?#]+)(?:\..*)?$/);
			if (match)
				return base64_decode(match[1]);
		}
		if (domain_nosub === "gravatar.com") {
			if (/\/(bl)?avatar\/+[0-9a-f]{10,}/.test(src)) {
				newsrc = remove_queries(add_queries(src, { "s": "9999" }), ["size"]);
				if (newsrc !== src) {
					return {
						url: newsrc,
						problems: {
							possibly_upscaled: true
						}
					};
				}
			}
		}
		if (domain === "cdn.v2ex.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+gravatar\/+([0-9a-f]+(?:\?.*)?)$/, "https://www.gravatar.com/avatar/$1");
		if (domain_nowww === "jeansgetwet.com" ||
			domain_nowww === "jeanslezdom.com" ||
			domain_nowww === "jeansorgasm.com" ||
			domain_nowww === "jeanstease.com" ||
			domain_nowww === "jeansverytight.com" ||
			domain_nowww === "jeansbabes.com" ||
			domain_nowww === "jeanslesbians.com") {
			return src.replace(/(\/updates\/+[a-z]\/+[a-z-_]+\/+[0-9]+\/+[^/]+-[0-9]+)s(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain_nosub === "cdn-outlet.com") {
			newsrc = src
				.replace(/\/photos\/+alternate\/+[0-9]+x[0-9]+\/+[0-9]+\/+([0-9]+-[0-9]+(?:-[0-9]+[A-Z])?)-[0-9]+x[0-9]+\./, "/photos/options/$1.")
				.replace(/\/photos\/+SOResource\/+((?:options\/+)?[0-9]+(?:-[0-9]+)?(?:-[0-9]+[A-Z])?)-[0-9]+x[0-9]+-AUTO\./, "/photos/$1.");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/photos\/+(?:options\/+)?[0-9]+(?:-[0-9]+)?(?:-[0-9]+[A-Z])?)\./, "$1-zoomin.");
			if (newsrc !== src) {
				return {
					url: newsrc,
					problems: {
						possibly_upscaled: true
					}
				};
			}
		}
		if (domain_nowww === "leisurepro.com") {
			return src.replace(/(\/image\/+product\/+)(?:thumb|small|medium|full|large)\/+/i, "$1XLarge/");
		}
		if (domain_nowww === "jcrew.com") {
			return {
				url: src
					.replace(/(-img-facade\/+[A-Za-z0-9_]+)(?:[?#].*)?$/, "$1")
					.replace(/(-video-facade\/+[^/]+)_sm\./, "$1."),
				bad_if: [{
						headers: {
							"last-modified": "Thu, 15 Oct 2020 22:15:14 GMT",
							"content-length": "21110",
							"content-type": "image/webp"
						}
					}]
			};
		}
		if (domain_nowww === "onlinescuba.com") {
			return src.replace(/(\/assets\/+productimages\/+[^/]+)_t\./i, "$1.");
		}
		if (domain_nosub === "azbro.com" && /^image[0-9]*\./.test(domain)) {
			newsrc = src.replace(/(\/o_img\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+-[0-9]+)-category\/+/, "$1/");
			if (newsrc !== src) {
				return {
					url: newsrc,
					problems: {
						possibly_upscaled: true
					}
				};
			}
		}
		if (domain === "foto.samfundet.no") return src.replace(/(\/media\/+alle\/+)thumb\/+/, "$1web/");
		if (domain_nowww === "gamaniak.com" ||
			domain === "mediagamaniak.cdn.re") {
			return src
				.replace(/(\/gal\/+[^/]+\/+)(?:full_)?([^_/]+)$/, "$1full_$2")
				.replace(/(\/gal\/+[^/]+\/+)tn_/, "$1");
		}
		if (domain === "images.tori.fi") return src.replace(/(\/api\/+v1\/+imagestori\/+images\/+[0-9]+\.[a-z]+)(?:[?#].*)?$/, "$1?rule=original");
		if (domain_nosub === "discountdance.com" && /^cdn[0-9]*\./.test(domain)) {
			return src.replace(/(\/image\/+)(?:[0-9]{1,3}x[0-9]{1,3}m?|1000x1333m)\/+/, "$11395x1860/");
		}
		if (domain === "i.rtings.com") return src.replace(/(\/assets\/+[^/]+\/+[A-Za-z0-9]{5,10}\/+(?:[^/]+\/+)?[^/]+)-(?:small|medium)\./, "$1-large.");
		if (domain === "img.yts.mx") return src.replace(/(\/assets\/+images\/+movies\/+[^/]+\/+)[a-z]+(-cover\.)/, "$1original$2");
		if (domain_nowww === "radikal.ru") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+lfp\/+([^/]*\.radikal\.ru.*?\.[^/.]+)\/htm(?:[?#].*)?$/,
				run: function(cb, match) {
					return cb({
						url: "https://" + match[1],
						headers: {
							Referer: "https://radikal.ru/"
						}
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "radikal.ru" && /^s[0-9]*\./.test(domain)) {
			return {
				url: src.replace(/(\/i[0-9]+\/.*\/[0-9a-f]{5,})x?\./, "$1."),
				headers: {
					Referer: "https://radikal.ru/"
				}
			};
		}
		if (domain_nosub === "radikal.ru" && /^[a-b]\./.test(domain)) {
			newsrc = src.replace(/(\/[0-9a-f]{4}\/+[0-9a-f]{2}\/+[0-9a-f]{5,})t\./, "$1.");
			if (newsrc !== src)
				return add_extensions(newsrc, {
					headers: {
						Referer: "https://radikal.ru/"
					}
				});
		}
		if (domain_nowww === "freemusicarchive.org") {
			newsrc = src.replace(/.*\/image\?(?:.*&)?file=([^&]+).*$/, "$1");
			if (newsrc !== src)
				return "https://files.freemusicarchive.org/storage-freemusicarchive-org/" + decodeURIComponent(newsrc);
		}
		if (amazon_container === "emojipedia-us") {
			return src.replace(/\/thumbs\/+(?:[0-9]{1,2}|[12][0-9]{2})\/+/, "/thumbs/320/");
		}
		if (domain_nosub === "disney.com" && /^cdn[0-9]*\./.test(domain)) {
			return src.replace(/\/resize\/+mwImage\/+[0-9]+\/+(?:[0-9]+\/+){2}[0-9]+\/+dam\/+/, "/dam/");
		}
		if (amazon_container === "duolingo-images") {
			newsrc = src.replace(/(\/avatars\/+[0-9]+\/+[^/]+\/+)(?:small|medium|large)(?:[?#].*)?$/, "$1xlarge");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/avatars\/+[0-9]+\/+[^/]+\/+)xlarge(?:[?#].*)?$/, "$1xxlarge");
			if (newsrc !== src) {
				return {
					url: newsrc,
					problems: {
						possibly_upscaled: true
					}
				};
			}
		}
		if (domain === "wl-brightside.cf.tsp.li") {
			return src
				.replace(/\/resize\/+[0-9]*x[0-9]*\/+(?:jpg|png)\/+/, "/compressed/")
				.replace(/\/resize\/+[0-9]*x[0-9]*\/+webp\/+(.*?\.[a-z]+)\.webp(?:[?#].*)?$/, "/compressed/$1");
		}
		if (domain_nowww === "means.tv") {
			var get_csrf_token = function(url, cb) {
				api_query("means.tv:csrf:" + url, {
					url: url,
					imu_mode: "document"
				}, cb, function(done, resp, cache_key) {
					var csrf_token = get_meta(resp.responseText, "csrf-token");
					if (!csrf_token) {
						console_error(cache_key, "Unable to find CSRF token from", resp);
						return done(null, false);
					}
					return done({
						token: csrf_token,
						pageurl: url
					}, 60 * 60);
				});
			};
			var query_means_api = function(tokenobj, url, cb) {
				api_query("means.tv:" + url, {
					url: url,
					headers: {
						Referer: tokenobj.pageurl,
						"X-CSRF-Token": tokenobj.token
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					done(resp, 60 * 60);
				});
			};
			var query_means_program_by_name = function(tokenobj, name, cb) {
				query_means_api(tokenobj, "https://means.tv/api/contents/" + name, cb);
			};
			var query_means_episodes = function(tokenobj, id, cb) {
				query_means_api(tokenobj, "https://means.tv/api/chapters?content_id=" + id, cb);
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+programs\/+([^/?#]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					var programname = match[1];
					var pageurl = "https://means.tv/programs/" + programname;
					var epid = null;
					var queries = get_queries(src);
					if (queries && queries.cid) {
						epid = queries.cid;
					}
					get_csrf_token(pageurl, function(tokenobj) {
						if (!tokenobj)
							return cb(null);
						query_means_program_by_name(tokenobj, match[1], function(data) {
							if (!data)
								return cb(null);
							var id = data.id;
							query_means_episodes(tokenobj, id, function(eps) {
								if (!eps)
									return cb(null);
								if (!eps.length) {
									console_error("No episodes", eps);
									return cb(null);
								}
								var album_links = [];
								var current_ep = null;
								array_foreach(eps, function(ep) {
									var is_current = !current_ep && (!epid || ep.id == epid);
									album_links.push({
										url: pageurl + "?cid=" + ep.id,
										is_current: is_current
									});
									if (is_current) {
										current_ep = ep;
									}
								});
								if (!current_ep) {
									console_error("Unable to find episode", epid, "from", eps);
									return cb(null);
								}
								var urls = [];
								var versions = current_ep.subject && current_ep.subject.versions;
								if (versions && versions.hls) {
									urls.push({
										url: versions.hls,
										video: "hls"
									});
								}
								urls.push(current_ep.preview_image);
								return cb(fillobj_urls(urls, {
									extra: {
										caption: current_ep.title,
										page: pageurl + "?cid=" + current_ep.id,
										created_at: current_ep.created_at
									},
									album_info: {
										type: "links",
										links: album_links
									}
								}));
							});
						});
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "means.tv" && options.element) {
			if (options.element.tagName === "VIDEO" && options.element.id) {
				match = options.element.id.match(/^video([0-9]+)$/);
				if (match) {
					return {
						url: options.host_url.replace(/[?#].*$/, "") + "?cid=" + match[1],
						is_pagelink: true
					};
				}
			}
		}
		if (domain === "img.ardmediathek.de") {
			return {
				url: src.replace(/(\/standard\/+.*\/)[0-9]+x[0-9]+\/+[0-9]+(?:[?#].*)?$/, "$10x0/4992"),
				head_wrong_contenttype: true // no content-type for head or get
			};
		}
		if (domain === "content.backcountry.com") {
			newsrc = src.replace(/(\/images\/+items\/+)(?:detail_)?(?:small|160|medium|large|900)\/+/, "$11200/");
			if (newsrc !== src)
				return {
					url: newsrc,
					problems: {
						possibly_upscaled: true
					}
				};
		}
		if (domain_nowww === "imgprime.com") return src.replace(/\/uploads\/+small\/+/, "/uploads/big/");
		if (domain === "dam-p-dfi.pqcloud.eu") {
			return {
				url: src.replace(/(\/preview\/+[^/]+\/+previews\/+)[^/]*(\.jpg)(\/.*?)?([?#].*)?$/, "$1maxWidth_999999$2$3$4"),
				head_wrong_contentlength: true
			};
		}
		if (domain === "cdn.sonyselect.com.cn") {
			return src.replace(/(\/covers\/+[^/]+)_512(\.[^/.]+)(?:[?#].*)?$/i, "$1$2");
		}
		if (host_domain_nowww === "asiantolick.com" && options.element) {
			if (options.element.tagName === "IMG" && /\/img\/+loading[0-9]*\./.test(src) && options.element.hasAttribute("data-src")) {
				return options.element.getAttribute("data-src");
			}
		}
		if (domain_nowww === "asiantolick.com") {
			if (/\/img\/+loading[0-9]*\.png(?:[?#].*)?$/.test(src))
				return {
					url: src,
					bad: "mask"
				};
			newsrc = src.replace(/(\/down\/+[^/]+\/+)thumb\/+/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "static.kino.de") return src.replace(/(\/wp-content\/+(?:uploads|gallery)\/+.*)-rc[mt][0-9]+x[0-9]+u?\./, "$1.");
		if (domain === "ec56229aec51f1baff1d-185c3068e22352c56024573e929788ff.ssl.cf1.rackcdn.com") return src.replace(/\/attachments\/+(?:small|medium|large)\/+/, "/attachments/original/");
		if (domain === "artworks.thetvdb.com") return src.replace(/(\/[^/?#._]+)_t(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if ((host_domain_nowww === "serienfans.org" ||
			host_domain_nowww === "filmfans.org") && options.element) {
			if (options.element.tagName === "I" && !src && /^data:image\/+svg\+xml;/.test(origsrc)) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "serienfans.org" ||
			domain_nowww === "filmfans.org") {
			return src.replace(/(\/media\/+[0-9]+)\/+[0-9]+\/+[0-9]+(?:[?#].*)?$/, "$1");
		}
		if (domain === "cdn.ok.de") return src.replace(/\/cdn\/+[^/]+\/+[^/]+\/+[0-9]{5,}\/+public\/+/, "/sites/default/files/");
		if (domain_nowww === "crossfire.nu") return src.replace(/\/_cache\/+(media\/+.*)_[0-9]+x[0-9]+\./, "/$1.");
		if (domain_nowww === "austrianfilms.com") {
			if (/\/jart\/+pub-prc\/+img\.jart\?/.test(src)) {
				newsrc = keep_queries(src, ["base", "img"]);
				if (newsrc !== src)
					return newsrc;
				var queries = get_queries(src);
				if (queries.img && queries.base) {
					return urljoin(urljoin("https://www.austrianfilms.com/jart/", queries.base), queries.img);
				}
			}
		}
		if (domain_nowww === "tagesspiegel.de" ||
			domain_nowww === "handelsblatt.com") {
			return src.replace(/-format[a-zA-Z0-9]+\./, "-formatOriginal.");
		}
		if (domain_nowww === "hello-online.org") return src.replace(/(\/picboardimg\/+)alt2\/+([0-9]{6}\/+img[0-9]+)s\./, "$1$2.");
		if (domain === "exlibris.azureedge.net") return src.replace(/(\/covers\/+.*\/[0-9]{5,})(?:x?l|[ms])\./, "$1xxl.");
		if (domain === "c.imgz.jp") {
			newsrc = src.replace(/_[1-4]?[0-9]{2}(\.[^/.]+)(?:[?#].*)?$/, "_500$1");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/:\/\/[^/]+\/+([0-9]+\/+[0-9]+\/+[^/]+)_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "://o.imgz.jp/$1$2");
		}
		if (domain === "cdn.wimg.jp") {
			newsrc = src.replace(/(:\/\/[^/]+\/+coordinate\/+[^/]+\/+[0-9]{5,}\/+[0-9]{5,})_[0-9]{2,3}\./, "$1_1000.");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(:\/\/[^/]+\/+)(coordinate\/+.*\/[0-9]{5,})_[0-9]+\./, "$1o/$2.");
			if (newsrc !== src)
				return {
					url: newsrc,
					problems: {
						possibly_upscaled: true
					}
				};
		}
		if (domain === "evelyn.tokyo.jp") return src.replace(/(\/photo\/.*\/)s-([^/]+)(?:[?#].*)?$/, "$1z-$2");
		if (domain === "itemimg-rcw.runway-webstore.net") return src.replace(/(\/itemimg\/.*)-[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "i.stpost.com") {
			newsrc = src.replace(/(:\/\/[^/]+\/+[^/.?#]*~[a-z]~[A-Za-z0-9]+_[0-9]+)~[0-9]+(?:~[0-9]+)?\.(?:[0-9]+\.)?/, "$1~9999.");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/:\/\/[^/]+\/+[^/.?#]*~([ap])~(([A-Za-z0-9]{3})[A-Za-z0-9]+_[0-9]+)~[0-9]+\.([a-z]+)(?:[?#].*)?$/);
			if (match) {
				var folders = {
					a: "alt",
					p: "sku"
				};
				return "https://i.stpost.com/" + folders[match[1]] + "/" + match[3] + "/" + match[2] + "." + match[4]; //.ashx?
			}
		}
		if (domain === "static.displate.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(?:[0-9]+x[0-9]+\/+)?(avatars|covers|displate)(\/+[0-9]{4}(?:-[0-9]{2}){2}\/+.*)/);
			if (match) {
				var folders_1 = {
					avatars: "avatars",
					covers: "covers",
					displate: "images/displate"
				};
				return "https://www.displate.com/" + folders_1[match[1]] + match[2];
			}
		}
		if (domain_nosub === "namshicdn.com") {
			if (/^p[a-z]+\./.test(domain)) {
				newsrc = src.replace(/(\/product\/+[^/]+\/+[^/]+\/+(?:v[0-9]+\/+)?[0-9]+)-(?:(?:(?:desktop|mobile)-web-|web-desktop-)?(?:cart|catalog|product|zoom)|zoom-mobile)\./, "$1-zoom-desktop.");
				if (newsrc !== src)
					return newsrc;
			}
			return src.replace(/^[a-z]+:\/\/p?([a-z]+\.[^/]+\/+product\/+[^/]+\/+[^/]+\/+)(?:v[0-9]+\/+)?([0-9]+)-[^/]+\./, "https://$1$2.");
		}
		if (domain_nowww === "theedge-sports.com") return src.replace(/(\/images\/+[^/]+)_(?:related|medium|image)\./, "$1_zoom.");
		if (domain === "cdn.dsmcdn.com" ||
			domain === "img-majestic-live.mncdn.com" ||
			domain === "img-incommerce-yargici.mncdn.com" ||
			domain === "img-dagi.mncdn.com" ||
			domain === "img-lcwaikiki.mncdn.com" ||
			(domain_nosub === "mncdn.com" && /^(?:img|cdn)-/.test(domain))) {
			newsrc = src
				.replace(/\/mnresize\/+[-0-9]+\/+[-0-9]+\/+/, "/")
				.replace(/\/mnpadding\/+[-0-9]+\/+[-0-9]+\/+[0-9A-F]{6}\/+/, "/");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/Content\/+Images\/+Thumbs\/+([0-9]+)(?:_[^/.?#]+)?(\.[^/.]+)(?:[?#].*)?$/, "/Content/Images/Originals/$1_0$2");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/product\/+media\/+images\/+.*\/[0-9]+)_org\./, "$1_org_zoom.");
		}
		if (domain_nowww === "bodytalk.com") {
			regex = /(\/uploads\/+resources\/+[0-9]+\/+[^/.?#]+)-(?:thumb|medianormal|list|normal|huge|enlarge)\./;
			if (regex.test(src)) {
				return [
					src.replace(regex, "$1-mediafancybox."),
					src.replace(regex, "$1-huge."),
					src.replace(regex, "$1-normal."),
					src.replace(regex, "$1-enlarge.")
				];
			}
		}
		if (domain_nowww === "seprun.com") return src.replace(/\/media\/+[0-9]*x[0-9]+\/+/, "/uploads/");
		if (domain === "df0a04043ae3b0be60ce-0769ebb99367e103e6cc409064fb3339.ssl.cf2.rackcdn.com") return src.replace(/(:\/\/[^/]+\/+[-0-9a-f]{10,})(?:__S)?\./, "$1__L.");
		if (domain === "fdn.gsmarena.com") return src.replace(/\/-[0-9]+(?:x[0-9]+m?|w[0-9]+)?(\/+[^/]+)(?:[?#].*)?$/, "$1");
		if (domain === "cvxf2z6hud.user-space.cdn.idcfcloud.net") {
			return {
				url: src.replace(/\?.*/, ""),
				headers: {
					Referer: "https://yanmaga.jp"
				}
			};
		}
		if (domain === "dfocupmdlnlkc.cloudfront.net") {
			return src
				.replace(/(\/original\/+[-0-9a-f]{10,})_[0-9]+x[0-9]+(?:q[0-9]+)?\./, "$1_99999x99999.")
				.replace(/_(jpg)\.webp(?:[?#].*)?$/, ".$1");
		}
		if (domain_nowww === "akcijeikatalozi.ba") return src.replace(/(\/media\/+[^/]+\/+)[0-9]+\/+/, "$1");
		if (domain === "static.pantaflix.com" ||
			amazon_container === "static.pantaflix.com") {
			return src
				.replace(/\/v2\/+[^/]+\/+p\/+pro\//, "/v2/p/pro/")
				.replace(/\.jpeg\.webp(?:[?#].*)?$/, ".jpeg");
		}
		if (domain === "dam.nmhmedia.sk") {
			return {
				url: src.replace(/(\/image\/+[^/]+\.[^/.]+)\/[0-9]+\/[0-9]+(?:[?#].*)?$/, "$1/0"),
				headers: {
					Referer: "https://magazin.pluska.sk/"
				}
			};
		}
		if (domain === "static.slickdealscdn.com") return src.replace(/(\/attachment\/+(?:[0-9]+\/+)+)[0-9]+x[0-9]+\/+([0-9]+)\.thumb(?:[?#].*)?$/, "$1$2.attach");
		if (domain_nowww === "cine.com") return src.replace(/(\/peliculas[0-9]*\/+[0-9]+\/+)cartel\/+([0-9]+)_cartel_[0-9]+\./, "$1$2_0.");
		if (domain_nowww === "silhcdn.com") return src.replace(/\/shapes\/+(?:sm|md)\/+/, "/shapes/lg/");
		if (domain === "cdn.notonthehighstreet.com") return src.replace(/(\/fs\/.*\/)(?:preview|normal|thumb)_([^/]+)(?:[?#].*)?$/, "$1original_$2");
		if (domain_nowww === "isubtitles.org") return src.replace(/(\/img\/+poster\/.*\.[^/.?#;]+)(?:[?#;].*)?$/, "$1");
		if (domain === "i.natgeofe.com") {
			newsrc = src.replace(/(:\/\/[^/]+\/+[a-z]\/+[-0-9a-f]{10,}\/+[^/?#]+)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(:\/\/[^/]+\/+[a-z]\/+[-0-9a-f]{10,}\/+[^/?#]+?)_square(\.[a-z]+)$/, "$1$2");
		}
		if (domain === "imgr.search.brave.com" ||
			domain === "imgs.search.brave.com") {
			match = src.match(/.*?\/+(aHR0[^?#.]+)(?:[.?#].*)?$/);
			if (match) {
				var splitted = match[1].split("/");
				array_foreach(splitted, function(x, i) {
					splitted[i] = base64_decode_urlsafe(x);
				});
				return splitted.join("");
			}
		}
		if (domain === "image.youtv.de") return src.replace(/(\/tv-bilder\/+normal\/+)[a-z]+\/+/, "$1original/");
		if (domain === "ssl.ofdb.de") {
			if (/\/thumbnail\.php\?/.test(src)) {
				var queries = get_queries(src, { decode: true });
				if (queries.cover)
					return "https://ssl.ofdb.de/" + queries.cover;
			}
		}
		if (domain === "cdn.cinematerial.com" ||
			domain === "media-cache.cinematerial.com") {
			return src.replace(/\/p\/+(?:60|136|297)x\/+/, "/p/500x/");
		}
		if (domain === "oldies-cdn.freetls.fastly.net") return src.replace(/\/i\/+boxart\/+[wh][0-9]+\/+/, "/i/boxart/original/");
		if (amazon_container === "talentsoup") {
			return src.replace(/(\/[0-9]{5}\/+[0-9]{10,})-[a-z]+\./, "$1.");
		}
		if (domain === "img.neirong.plus") return src.replace(/(:\/\/[^/]+\/+)[0-9]+x[0-9]+\/+o\/+/, "$1o/");
		if (domain === "image.pmgstatic.com") return src.replace(/\/cache\/+resized\/+[^/]+\/+files\/+/, "/files/");
		if (domain_nowww === "solvay.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+sites\/+[^/]+\/+files\/+[^/]+\/+files\/+styles\/+[^/]+\/+(https?)\/+(.*?)(?:[?#].*)?$/, "$1://$2");
		if (domain === "i.legendas.tv") {
			if (/:\/\/[^/]+\/+sprite_[0-9]+\.png(?:[?#].*)?$/.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src.replace(/\/poster\/+[0-9]+x[0-9]+\/+/, "/poster/");
		}
		if (domain_nowww === "techrepublic.com") return src.replace(/(\/i\/+r\/+[0-9]{4}\/(?:[0-9]{2}\/+){2}[-0-9a-f]{10,}\/+)resize\/+[0-9]*x[0-9]*\/+/, "$1");
		if (domain === "img.tennis-warehouse.com") {
			if (/\/watermark\/+rs\.php\?/.test(src)) {
				newsrc = keep_queries(src, ["path"]);
				if (newsrc !== src)
					return newsrc;
			}
			return src
				.replace(/\/watermark\/+rs\.php\?path=([^&]+)$/, "/new_big/$1")
				.replace(/\/cache\/+[0-9]+\/+/, "/watermark/rs.php?path=");
		}
		if (domain_nowww === "6mature9.com") return src.replace(/(\/galleries\/+[^/]+\/+[0-9]{4}\/+[0-9]{2}\/+[^/]+\/+[0-9]+)_[^/_.]+_69_sz[a-z]\./, "$1.");
		if (domain === "web.xdcdn.net") return src.replace(/(\/game\/+[^/]+\/+imgs\/+.*@)1x\./, "$12x.");
		if (domain === "images.gids.tv") {
			newsrc = src.replace(/.*\/(?:video-thumbnail\.jpg|image)\?(?:.*&)?url=([^&]+)(?:&.*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "images.npo.nl") return src.replace(/(\/(?:tile|header)\/+)[0-9]+x[0-9]+\/+/, "$1original/");
		if (domain === "radio-images.npo.nl") return src.replace(/(:\/\/[^/]+\/+)[^/]+\/+([-0-9a-f]{20,})\/+/, "$1c_limit/$2/");
		if (domain === "dmdlnu87i51n1.cloudfront.net") return src.replace(/(\/v1\/+[^/]+\/+[^/]+\/+)[0-9]+x[0-9]+:[0-9]+x[0-9]+\/+[0-9]+x[0-9]+\/+/, "$1");
		if (domain === "img.kitapyurdu.com") {
			if (/\/v1\/+getImage\//.test(src)) {
				return src.replace(/\/wi:[^/]+(\/.*)?$/g, "$1");
			}
		}
		if (domain_nosub === "rbxcdn.com") {
		}
		if (domain === "c.stocksy.com") return src.replace(/(\/a\/+[^/]+\/+z)[a0-8]\/+([0-9]+\.)/, "$19/$2");
		if (domain === "crowdin-static.downloads.crowdin.com") return src.replace(/(\/avatar\/+[0-9]+\/+)[a-z]+\/+/, "$1original/");
		if (amazon_container === "trello-members") {
			return src.replace(/(\/[0-9a-f]{20,}\/+)[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1original$2");
		}
		if (domain_nowww === "schauspielervideos.de") {
			if (/\/web\/+res\/+img\/+t\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src.replace(/(\/fotos\/+[0-9]{2}\/+[0-9]+\/+[a-z]{2}[0-9]+)_[a-z]{2}_[0-9]+\./, "$1.");
		}
		if (domain_nowww === "agentur-scenario.de") {
			newsrc = src.replace(/.*\/scenario-wp-template\/+imageresize\/+resize\.php\?(?:.*&)?src=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			return src.replace(/(\/wp-content\/+uploads\/+[0-9]{4}\/+[0-9]{2}\/+[^/]+)_[0-9]+x[0-9]+_acf_cropped\./, "$1.");
		}
		if (domain === "cdn.mydukaan.io") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+app\/+image\/+[0-9]+x[0-9]+\/+\?(?:.*&)?url=([^&]+).*$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nosub === "dial4trade.com") {
			var idmatch = src.match(/\/uploaded_files\/+product_images\/+(?:thumbs\/+)?[^/]+-([0-9]{5,})\./);
			if (idmatch) {
				var id_2 = parse_int(idmatch[1]);
				if (id_2 >= 1846699492419) {
					return src.replace(/(\/product_images\/+)([^/]+)(?:[?#].*)?$/, "$1thumbs/$2");
				} else {
					return src.replace(/(\/product_images\/+)thumbs\/+([^/]+)(?:[?#].*)?$/, "$1$2");
				}
			}
		}
		if (domain === "cdn.sportsshoes.com") {
			regex = /(\/product\/+[A-Z0-9]\/+[A-Z0-9]+\/+[A-Z0-9]+)_(?:10|25|[1-48])00_([0-9]+\.)/;
			if (regex.test(src)) {
				return [
					src.replace(regex, "$1_2500_$2"),
					src.replace(regex, "$1_1000_$2"),
					src.replace(regex, "$1_800_$2")
				];
			}
		}
		if (domain === "guide-images.cdn.ifixit.com") return src.replace(/(\/igi\/+[a-zA-Z0-9]+\.)(?:thumbnail|medium|large)(?:[?#].*)?$/, "$1full");
		if (domain_nowww === "miccostumes.com") return src.replace(/(\/images\/+[^?&#]+)(?:[?&#].*)?$/, "$1&width=0&height=0");
		if (domain === "images.adsttc.com") return src.replace(/(\/media\/+images\/+(?:[0-9a-f]{4}\/+){6})[^/]+\/([^/]+)(?:[?#].*)?$/, "$1original/$2");
		if (domain === "imgs.xkcd.com") return src.replace(/(\/comics\/+[^/.]+?)(?:_2x)?(\.[^/.]+)(?:[?#].*)?$/, "$1_2x$2");
		if (domain === "store.udiscover-music.de") return src.replace(/\/assets\/+asset_480x480\/+/, "/assets/asset_300x300/");
		if (domain === "shop.rammstein.de") return src.replace(/(\/img\/+katalog\/+[0-9]+\/+)[0-9]+\/+/, "$10/");
		if (domain_nowww === "gayeroticvideoindex.com") return src.replace(/(\/images\/+[^/]+\/+)Icons\/+/, "$1");
		if (domain_nowww === "essentialapparel.com") return src.replace(/(\/content\/+products\/+.\/+[a-z0-9]+\/+)[sm]_([a-z0-9]+_[^/]+)(?:[?#].*)?$/, "$1l_$2");
		if (domain_nowww === "nuclearblast.de") return src.replace(/(\/static\/+[^/]+\/+[0-9]+\/+[0-9]+\.[^/.]+\/+)[0-9]+x[0-9]+\./, "$10x0.");
		if (domain === "images.pixieset.com") {
			return src
				.replace(/(\/[0-9]+\/+[0-9a-f]{20,})-(?:thumb|small|medium|x?large)\./, "$1-xxlarge.")
				.replace(/(\/[0-9]+\/+[0-9a-f]{20,})-cover\./, "$1-cover-large.");
		}
		if (domain_nowww === "lullidancewear.com") {
			return src
				.replace(/(\/Products_\/.*)[?#].*$/, "$1")
				.replace(/\/SiteFiles\/+SmallProducts\/+/i, "/SiteFiles/Products_/");
		}
		if (domain === "r8zlusvr.rocketcdn.com") return src.replace(/(\/product_image_data\/+)resizeandpad:[0-9:]+\/+/, "$1");
		if (domain_nosub === "prplcdn.com") return src.replace(/(\/i\/+p\/+[0-9]+\/+)tn\/+/, "$1");
		if (domain === "static.picdeno.com") {
			newsrc = src.replace(/.*[?&]u=(http[^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nosub === "dumpor.com" && /^cdn[0-9]*\./.test(domain)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+view\?(?:.*&)?q=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return base64_decode(reverse_str(decodeURIComponent(newsrc)));
		}
		if (domain === "cdn.inflact.com" ||
			(domain_nosub === "padlet.pics" && /^v[0-9]*\./.test(domain))) {
			newsrc = src.replace(/.*[?&]url=(http[^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "instatory.net") {
			newsrc = src.replace(/.*[?&]url=(http[^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc).replace(/\|\|/g, "/");
		}
		if (domain === "media.prod-v2.mym.fans") {
			return {
				url: src,
				can_head: false // 403
			};
		}
		if (host_domain_nowww === "mym.fans" && options.element) {
			if (options.element.tagName === "VIDEO") {
				var url_5 = options.element.getAttribute("data-url");
				if (url_5) {
					if (/\.m3u8(?:[?#].*)?$/i.test(url_5)) {
						return {
							url: url_5,
							can_head: false,
							video: "hls"
						};
					} else {
						return {
							url: url_5,
							can_head: false,
							video: true
						};
					}
				}
			}
		}
		if (domain === "discografia.dds.it") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+display_full_imma\.php\?(?:.*?&)?imma=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return urljoin("http://discografia.dds.it/", decodeURIComponent(newsrc).replace(/^\.\/+/, "/"), true);
			return src.replace(/(\/immagini\/+[^/]+\/+)(?:ico|scheda)_/, "$1");
		}
		if (domain === "logo.uai.com.br") {
			if (/:\/\/[^/]+\/+uai\.jpg(?:[?#].*)?$/.test(src))
				return {
					url: src,
					bad: true
				};
		}
		if (domain === "img.guildedcdn.com") {
			return remove_queries(src.replace(/(\/ContentMedia\/+[^/?#]+-)Preview(\.[^/.]+(?:[?#].*)?)$/, "$1Full$2"), ["w", "h"]);
		}
		if (domain === "cdn.tatlerasia.com") return src.replace(/_cover_[0-9]+x[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1");
		if (domain_nowww === "feriasbrasil.com.br") {
			return src.replace(/(\/fotosfb\/+[0-9]+)-(?:p|m|mob|g)\./i, "$1-XG.");
		}
		if (domain_nosub === "jumia.is") return src.replace(/\/unsafe\/+fit-in\/+[0-9]+x[0-9]+\/+(?:filters:[^/]+\/+)?product\/+/, "/unsafe/fit-in/9999x9999/product/");
		if (domain_nosub === "umd.net") {
			return src
				.replace(/(\/media\/+(?:downloads_teasers\/+[0-9]+\/+[^/]+|(?:user_icons|photos|forum_uploads|subtracts|store_logos)\/+[0-9]+_[0-9]+|models)\/+)(?:thumbs|mediums|larges)\/+/, "$1");
		}
		if (domain_nowww === "drenchme.com") return src.replace(/(\/images\/+vdo-[0-9]+-[0-9]+\/+scene[0-9]+\/+)t-([^/]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "images.perthnow.com.au") return src.replace(/-[0-9]+x[0-9]+-x[0-9]+y[0-9]+w[0-9]+h[0-9]+\./, ".");
		if (domain === "static.metacritic.com") {
			return src
				.replace(/(\/images\/+products\/+.+?\/+[0-9a-f]\/+[0-9a-f]{20,})-[0-9]+\./, "$1.")
				.replace(/(\/images\/+avatars\/+[^/]+)_(?:sml|med)\./, "$1_lrg.");
		}
		if (domain === "ak.picdn.net") {
			return src
				.replace(/(\/photos\/+[0-9a-f]{10,}\/+)medium\/+/, "$1large_w/")
				.replace(/(\/contributors\/+[0-9]+\/+avatars\/+)[a-z]+\./, "$1original.");
		}
		if (domain === "covers.zlibcdn2.com") return src.replace(/(:\/\/[^/]+\/+covers)[0-9]+\/+/, "$1/");
		if (domain === "news-img.cdn.nimg.jp") return src.replace(/:\/\/news-img\.[^/]+\/+s\/+(articles\/+images\/+[0-9]+\/+[^/]+\.[^/]+)\/+.*/, "://news.cdn.nimg.jp/$1");
		if (domain_nowww === "physicaleditions.com") return src.replace(/\?.*?(Type\/+Picture\/+[0-9]+\/+File:).*?$/, "?$1");
		if (domain === "c.officialstore.jp") return src.replace(/(\/img\/+product_image\/+teichiku-shop\.com\/.*\/)w[0-4][0-9]{2}_h[0-4][0-9]{2}\./, "$1w0_h0.");
		if (domain === "cdn-thumbshot-ie.pearltrees.com") return src.replace(/:\/\/[^/]+\/+((?:[0-9a-f]{2}\/+){2})([0-9a-f]{4}([0-9a-f]{2})[0-9a-f]{10,})(?:-[a-z]+)?\./, "://cdn-media-ie.pearltrees.com/$1$3/$2-l.");
		if (domain === "img.animatetimes.com" ||
			domain_nowww === "animatetimes.com") {
			return src.replace(/(\/news\/+[^/]+\/+[0-9]{4}\/+[^/]+)_thumb2?(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "images.scawaiiweb.com") return src.replace(/(\/articles\/+[0-9]+\/+[0-9]+\/+)[0-9]+x[0-9]+\/+/, "$1OG/");
		if (domain === "i.pcmag.com") return src.replace(/(\/imagery\/+reviews\/+[^/.]+)\.+(?:(?:(?:fit|size)_[^/.]+|v?[0-9]{10})\.+)+([^/.]+)(?:[?#].*)?$/, "$1.$2");
		if (domain_nowww === "geoguessr.com") {
			return {
				url: src.replace(/\/images\/+[^/]+\/+[0-9]+\/+[0-9]+\/+/, "/images/auto/0/0/"),
				can_head: false // 404
			};
		}
		if (domain === "pricespy-75b8.kxcdn.com") return src.replace(/(\/product\/+[^/]+\/+)(?:140|280)\/+/, "$1800/");
		if (domain === "cdn.amuse.io") return src.replace(/(:\/\/[^/]+\/+[-0-9a-f]{20,})\.[0-9]+x[0-9]+\./, "$1.");
		if (domain === "artwork-cdn.7static.com") {
			var regex_1 = /(:\/\/[^/]+\/+static\/+img\/+[^/]+\/+[0-9]{2}\/+[0-9]{3}\/+[0-9]{3}\/+[0-9]+_)[0-9]+\./;
			if (regex_1.test(src)) {
				return replace_sizes(src, [
					src.replace(regex_1, "$1800."),
					src.replace(regex_1, "$1500."),
					src.replace(regex_1, "$1350."),
					src.replace(regex_1, "$1200.")
				]);
			}
		}
		if (domain_nosub === "plex.direct" && /.*\..*\.plex\.direct(:[\d]{0,5})?\/.*\/transcode/gm.test(src)) {
			return (decodeuri_ifneeded(get_queries(src).url));
		}
		if (domain_nowww === "donationcoder.com" ||
			domain_nowww === "coni.it") {
			newsrc = src.replace(/(\/images\/+igallery\/+)resized\/+([^/]+\/+[^/]+)-[0-9]+-[0-9]+-[0-9]{1,3}(?:-c)?\./, "$1original/$2.");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/forum\/+index\.php\?(?:.*;)?attach=)([0-9]+)(;.*)$/, function(_, prefix, id, suffix) {
				return prefix + (parse_int(id) - 1) + suffix;
			});
			if (newsrc !== src)
				return {
					url: newsrc,
					norecurse: true, // it should only decrement the id once
					problems: {
						possibly_different: true
					}
				};
		}
		if (domain === "d2rxqglyhdohqf.cloudfront.net" ||
			amazon_container === "img.shootproof.com") {
			var regex_2 = /(\/ph\/+[0-9a-f]{30,}\/+)(?:m|l|xl|2x|3x)\/+/;
			var match_2 = src.match(regex_2);
			if (match_2) {
				return replace_sizes(src, [
					src.replace(regex_2, "$13x/"),
					src.replace(regex_2, "$12x/"),
					src.replace(regex_2, "$1xl/"),
					src.replace(regex_2, "$1l/"),
					src.replace(regex_2, "$1m/")
				]);
			}
		}
		if (domain_nowww === "g4u.to") return src.replace(/(\/images\/+screenshots\/+[0-9]+\/+)s_/, "$1b_");
		if (domain === "s.uvlist.net") {
			if (/\/gfx\/+frame_[0-9]+x[0-9]+\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "cdn.rebrickable.com") return src.replace(/\/media\/+thumbs(\/+.*\/+[^/]+\.[^/.]+)\/+[^/]+\.[^/.]+(?:[?#].*)?$/, "/media$1");
		if (domain_nowww === "bricksafe.com") return src.replace(/(\/files\/+[^/]+\/+[^/]+\/+[^/]+\.[a-z]+)\/+[0-9]+x[0-9]+\.[a-z]+(?:[?#].*)?$/, "$1");
		if (host_domain === "addons.mozilla.org" && options.element) {
			if (!src && options.element.tagName === "BUTTON") {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
		}
		if (domain === "addons.mozilla.org") {
			newsrc = src.replace(/(\/user-media\/+addon_icons\/+[0-9]+\/+[0-9]+-)(?:16|32|64)\./, "$1128.");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/user-media\/+previews\/+)thumbs(\/+[0-9]+\/+)/, "$1full$2");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (domain === "d348imysud55la.cloudfront.net" ||
			domain === "files.vrchat.cloud") {
			var match_3 = src.match(/\/thumbnails\/+(file_[-0-9a-f]{20,})\.[0-9a-f]{30,}\.([0-9]+)\./);
			if (match_3)
				return "https://api.vrchat.cloud/api/1/file/" + match_3[1] + "/" + match_3[2] + "/file";
		}
		if (domain === "api.vrchat.cloud") return src.replace(/\/image\/+(file_[-0-9a-f]{20,}\/+[0-9]+)\/+[0-9]+(?:[?#].*)?$/, "/file/$1/file");
		if (domain === "static.ow.ly") return src.replace(/\/photos\/+[a-z]+\/+/, "/photos/original/");
		if (domain_nowww === "ow.ly") {
			var match_4 = src.match(/\/i\/+([A-Za-z0-9]+)(?:[?#].*)?$/);
			if (match_4) {
				return [
					{ url: "https://static.ow.ly/photos/original/" + match_4[1] + ".jpg" },
					{ url: src, is_pagelink: true }
				];
			}
		}
		if (domain === "d2ufj6gm1gtdrc.cloudfront.net" ||
			domain === "d3mcojo3jv0dbr.cloudfront.net") {
			if (/:\/\/[^/]+\/+[0-9]{4}\/+[0-9]{2}\/+/.test(src)) {
				return {
					url: src
						.replace(/:\/\/[^/]+\/+/, "://d2ufj6gm1gtdrc.cloudfront.net/") // d3mcojo3jv0dbr.cloudfront.net returns 403
						.replace(/[?#].*$/, ""),
					headers: {
						Referer: "https://www.postype.com/",
						"Sec-Fetch-Dest": "image",
						"Sec-Fetch-Mode": "no-cors",
						"Sec-Fetch-Site": "cross-site"
					}
				};
			}
		}
		if (domain === "static.fnac-static.com") {
			return src
				.replace(/(\/multimedia\/+Images\/+.*\/+15)(?:01|02|08|33|35|39|40|45)(-[0-9]+\/)/, "$107$2")
				.replace(/(\/multimedia\/+Images\/+.*\/+15)(?:41|43)(-[0-9]+\/)/, "$120$2");
		}
		if (domain === "img.photoreco.com") {
			if (/\/images\/+css\/+common\/+(?:icon_big|bg_opa-black_[0-9]+)\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "docimg.immanens.com") return src.replace(/(\/getcover\/+.*\/cover-)(?:small|medium)\./, "$1large.");
		if (domain_nowww === "pearlygates.net") return src.replace(/(\/contents\/+pages\/+)100\/+/, "$1200/");
		if (domain_nowww === "snizenja.ba") return src.replace(/\/images\/+mnwallimages\/+[0-9]+x[0-9]+\/+images\/+/, "/images/");
		if (domain === "assets.fanart.tv") return src.replace(/\/+preview\/+/, "/fanart/");
		if (domain === "cdn.app.c-rayon.com") return src.replace(/(\.[a-z]+)\.[0-9]+\.[a-z]+([?#].*)?$/, "$1.nop$2");
		if (domain_nowww === "old-games.com") return src.replace(/(\/screenshot\/+)t([0-9]+-)/, "$1$2");
		if (domain_nowww === "hochi.news") return src.replace(/(\/images\/+[0-9]{4}\/.*)-T\./, "$1-L.");
		if (domain === "ebookstore.sony.jp") {
			return src
				.replace(/(\/images\/+[0-9a-f]{2}\/+[0-9a-f]{20,})_[a-z]+\./, "$1_original.")
				.replace(/(\/photo\/+[A-Z]*[0-9]+\/+[A-Z]*[0-9]+)_(?:SMALL|LARGE)\./, "$1_XLARGE.");
		}
		if (domain === "prod-ripcut-delivery.disney-plus.net") {
			return src.replace(/\/scale(?:[?#].*)?$/, "");
		}
		if (domain === "misc.socialbladeshow.com") {
			newsrc = src.replace(/(\/afd\/+screenshots\/+[^/.]+)-[a-z]\./, "$1-o.");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (domain === "thumbnails.odycdn.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+optimize\/+.*?\/+(https?:\/\/)/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "it4profit.com" && /^cdn[0-9]*\./.test(domain)) {
			return {
				url: src.replace(/\/s3size\/.*\/plain\//, "/s3size/plain/"),
				head_wrong_contenttype: true // no content-type
			};
		}
		if (domain === "imgproxy.fourthwall.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+[^/]+\/+(?:(?:w:[0-9]+|plain)\/+)+(https?:\/\/)/, "$1");
		if (googlestorage_container === "cdn.fourthwall.com") {
			return src.replace(/.*?\/cdn\.fourthwall\.com\//, "https://cdn.fourthwall.com/");
		}
		if (domain === "img.fujisan.co.jp") return src.replace(/(\/images\/+products\/+backnumbers\/+[0-9]+_)[tsmlp]\./, "$1o.");
		if (domain === "gvimage.zype.com") return src.replace(/(\/custom_thumbnail\/+)[0-9]+\./, "$1original.");
		if (domain === "asset.wsj.net" ||
			domain === "images.wsj.net") {
			return src.replace(/(\/im-[0-9]+)\/*(?:[?#].*)?$/, "$1?width=0");
		}
		if (domain_nowww === "acplasticsinc.com") {
			if (/\/image\?/.test(src)) {
				return keep_queries(src, "filename");
			}
		}
		if (domain_nosub === "storyblok.com") return src.replace(/(\/f\/+[0-9]+\/.*\/[^/]+\.[^/.]+)\/m(?:\/+.*)?(?:[?#].*)?$/, "$1");
		if (domain_nowww === "sq-lab.com" ||
			domain_nowww === "heicko.de") {
			return src
				.replace(/\/out\/+pictures\/+generated\/+(product\/+[0-9]+)\/+[0-9]+_[0-9]+_[0-9]+\/+/, "/out/pictures/master/$1/")
				.replace(/\/modules\/+ajaxzoom\/+ajaxzoom\/+pic\/+zoomthumb\/+.\/+.\/+([^/]+?)(?:_[0-9]+x[0-9]+)(\.[^/.]+)(?:[?#].*)?$/, "/out/pictures/master/product/1/$1$2");
		}
		if (domain === "i.im.cz") return src.replace(/(:\/\/[^/]+\/+a\/+[^/]+)\/[0-9]+(?:[?#].*)?$/, "$1");
		if (domain === "content.minetest.net") return src.replace(/\/thumbnails\/+[0-9]+\/+/, "/uploads/");
		if (domain === "img.freepik.com") {
			return [
				{
					url: src.replace(/^([^?]+)(?:\?.*)?$/, "$1?h=5000"),
					problems: {
						watermark: true
					}
				},
				{
					url: src.replace(/^([^?]+)(?:\?.*)?$/, "$1?h=649"),
					problems: {
						smaller: true
					}
				}
			];
		}
		if (domain === "cdn-icons-png.freepik.com") return src.replace(/(:\/\/[^/]+\/+)(?:16|32|64|128|256)\/+/, "$1512/");
		if (domain === "img.poipiku.com") {
			newsrc = src.replace(/:\/\/[^/]+\/+(.*\.[^/._?#]+)_[0-9]+\.[^/.?#]+(?:[?#].*)?$/, "://img-org.poipiku.com/$1");
			if (newsrc !== src) {
				var pagematch = src.match(/\/user_img[0-9]+\/([0-9]+)\/+([0-9]+)_/);
				var page_3 = null;
				if (pagematch)
					page_3 = "https://poipiku.com/" + pagematch[1].replace(/^0+/, "") + "/" + pagematch[2].replace(/^0+/, "") + ".html";
				return {
					url: newsrc,
					headers: {
						Referer: page_3 || "https://poipiku.com/1234567/7654321.html" // id doesn't matter, but this url pattern is needed
					},
					extra: {
						page: page_3
					}
				};
			}
		}
		if (domain_nosub === "amazonaws.com" && /^(?:cnt(?:-[0-9]+)?\.)?content(?:-[a-z]+)?\.drive\./.test(domain)) {
			return {
				url: src.replace(/(\/cdproxy\/+templink\/+[^/?#]+)(?:\/+alt\/+.*)?(?:[?#].*)?$/, "$1?viewBox=9999999"),
				can_head: false // 404
			};
		}
		if (domain_nosub === "anilist.co") return src.replace(/(\/file\/anilistcdn\/.+)(?:small|medium)(\/)/, "$1large$2");
		if (domain_nowww === "bldimg.com" || domain === "static.blued.com") {
			if (!/!o\.png$/.test(src)) {
				return src.replace(/(?:!\d+x\d+\.png)?$/, "!o.png");
			}
		}
		if (domain_nosub === "hhv.de") {
			return src
				.replace(/(\/catalog\/)(?:\d+x\d+)(\/\d+\/)/, "$1shop_detail_zoom$2")
				.replace(/(\/items\/+images\/+generated\/+)475x475\/+/, "$1970x970/");
		}
		if (domain === "d7qztf2ityad6.cloudfront.net") {
			return remove_queries(src, "f");
		}
		if (domain === "img.ebay-kleinanzeigen.de") {
			var queries = get_queries(src);
			queries.rule = queries.rule.replace(/\d+/, "57");
			return add_queries(src, queries);
		}
		if (domain === "img.bntnews.co.kr") return src.replace(/^[a-z]+:\/\/[^/]+\/+(data\/+bnt\/+)(?:cache|image)\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+bnt[0-9]{5,})\.[0-9]+x\.[0-9]+\./, "https://www.bntnews.co.kr/$1image/$2.");
		if (domain === "a4tech.ua") return src.replace(/\/cache\/[0-9a-f]+\//, "/");
		if (domain === "cdn.coolermaster.com") return src.replace(/-(?:bannerdesktop|bannermobile|column|desktop|hover|imageleftorright|intro|mobile|small|zoom)(\.)/, "$1");
		if (domain_nowww === "westerndigital.com") {
			return src.replace(/\.wdthumb\.\d+\.\d+\.\w+/, "");
		}
		if (domain === "content.rozetka.com.ua") return src.replace(/(\/images\/)(?:preview|big)(\/)/, "$1original$2");
		if (domain_nowww === "verbatim-marcom.com") return src.replace(/(\/view-product-image-id)\/png-thumbnail_\d+(\/\d+)/, "$1$2");
		if (domain === "static.bhphoto.com") return src.replace(/(\/images\/+images)[0-9]+x[0-9]+\//, "$12500x2500/");
		if (domain === "cdnstatic.rg.ru") return src.replace(/\/(?:resize|crop)[0-9]+x[0-9]+\/+uploads\/+/, "/uploads/");
		if (domain_nowww === "sport24.gr") return src.replace(/\/img\/+[0-9]+\/+([0-9]+)\/+[0-9]+\/+[a-z]+[0-9]*\/+[0-9]+\/+(?:[0-9]+\/+)?([^/]+(?:[?#].*)?)$/, "/img/app/$1/0/o/0/0/$2");
		if (domain === "s74794.cdn.ngenix.net" ||
			domain === "cdn-m.sport24.ru") {
			return src.replace(/\/m((?:\/+[0-9a-f]{4}){8})\/[^/]*?(\.[^/.?#()!%]+?)(?:[?#()!%].*)?$/, "/m$1$2");
		}
		if (domain === "static.news.ru") return src.replace(/(\/photo\/+[-0-9a-f]{20,})_[0-9]+\./, "$1.");
		if (domain === "images.sportschau.de") return src.replace(/(\/image\/+[-0-9a-f]{20,}\/+[^/]+\/+[^/]+\/+)[0-9]+x[0-9]+-[0-9]+([/.])/, "$1original$2");
		if (domain_nowww === "induna.com") return src.replace(/(\/uploaded_images\/+[^/]+\/+)[a-z]+\/+/, "$1original/");
		if (domain_nowww === "shadeddog.com") return src.replace(/(\/images\/+[^/]+)_(?:thumb|small)\./, "$1.");
		if (domain === "i.maniadb.com") return src.replace(/\/images\/+(album|artist)_t\/+[0-9]+\/+/, "/images/$1/");
		if (domain === "furry34.com" ||
			domain === "furry34com.b-cdn.net" ||
			domain === "rule34storage.b-cdn.net" ||
			domain_nowww === "rule34.world") {
			newsrc = src.replace(/(:\/\/[^/]+\/+posts\/+[0-9]+\/+[0-9]+\/+[0-9]+)\.[^/.]+(\.[^/.]+)(?:[?#].*)?$/, "$1.pic$2");
			if (newsrc !== src) {
				return fillobj_urls(add_extensions(newsrc), {
					headers: {
						Referer: "https://" + domain + "/"
					},
					referer_ok: {
						same_domain: true
					}
				});
			}
		}
		if (domain_nosub === "kemono.party" ||
			domain_nosub === "kemono.su" ||
			domain_nosub === "coomer.party" ||
			domain_nosub === "coomer.su") {
			newsrc = src.replace(/\/thumbnail\/+data\/+/, "/data/");
			if (newsrc !== src)
				return newsrc.replace(/:\/\/img\./, "://c1.");
		}
		if (domain === "assistant.gloria.tv") {
			newsrc = keep_queries(src, ["secure", "expires"]);
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "gloria.tv") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+post\/+([a-zA-Z0-9]{10,})(?:\/.*)?(?:[?#].*)?$/,
				query_for_id: "https://gloria.tv/post/${id}",
				process: function(done, resp, cache_key) {
					var sources = common_functions["get_videotag_sources"](resp.responseText);
					if (!sources || !sources.video) {
						console_error(cache_key, "Unable to find sources in", resp);
						return done(null, false);
					}
					sources.video.sort(function(a, b) {
						if (a.args.type === "application/x-mpegurl")
							return -1;
						if (b.args.type === "application/x-mpegurl")
							return 1;
						var a_quality_str = a.args["data-quality"];
						var b_quality_str = b.args["data-quality"];
						if (!a_quality_str || !b_quality_str) {
							console_warn(cache_key, "Unable to find data-quality in", a, b);
							return 0;
						}
						var a_quality = JSON_parse(a_quality_str);
						var b_quality = JSON_parse(b_quality_str);
						return b_quality.bitrate - a_quality.bitrate;
					});
					var extra = {};
					var datetime_match = resp.responseText.match(/<a href="[^"]+\/replies".*<time datetime="([^"]+)"/);
					if (datetime_match)
						extra.created_date = new Date(datetime_match[1]).getTime();
					var title = get_meta(resp.responseText, "og:title");
					if (title)
						extra.caption = title;
					extra.page = resp.finalUrl;
					var urls = [];
					array_extend(urls, array_map(sources.video, function(value) {
						var url = value.url;
						var video = true;
						var can_head = true;
						if (value.args.type === "application/x-mpegurl") {
							video = "hls";
							can_head = false; // 405
						}
						return {
							url: urljoin(resp.finalUrl, url, true),
							headers: {
								Referer: resp.finalUrl
							},
							can_head: can_head,
							video: video
						};
					}));
					array_extend(urls, sources.image);
					return done(fillobj_urls(urls, { extra: extra }), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "gloria.tv") {
			if (options.element && options.do_request && options.cb) {
				var element_1 = common_functions["get_parent_el_matching"](options.element, function(x) {
					return x.hasAttribute("data-notify");
				});
				if (element_1) {
					try {
						var media = JSON_parse(element_1.getAttribute("data-notify"));
						if (media.id) {
							return {
								url: "https://gloria.tv/post/" + media.id,
								is_pagelink: true
							};
						}
					} catch (e) {
						console_error(e);
					}
				} else if (options.host_url && options.element.tagName === "VIDEO" && options.element.matches("div.leading > header > figure.video > video")) {
					return {
						url: options.host_url,
						is_pagelink: true
					};
				}
			}
			if (!src && origsrc && options.element && options.element.classList.contains("play")) {
				return {
					url: origsrc,
					bad: "mask"
				};
			}
		}
		if (domain === "images.plex.tv") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+photo\?(?:.*&)?url=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "govdeals.com") {
			return src.replace(/(\/photos\/+\d+\/+)thumb(?:nail)?s\/+(.*)/i, "$1$2");
		}
		if (domain_nowww === "isplus.com") return src.replace(/(\/data\/+isp\/+image\/+.*)\.[0-9]+x\.[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain === "cdn.aniplaylist.com") return src.replace(/(\/thumbnails\/+[0-9a-f]+)@[0-9a-z]+\./, "$1.");
		if (domain === "statics.tver.jp") return src.replace(/(\/images\/+content\/+thumbnail\/+[^/]+\/+)(?:small|medium|large)\/+/, "$1xlarge/");
		if (domain_nowww === "tver.jp") {
			var query_tver_episode_1 = function(id, cb) {
				api_query("tver:" + id, {
					url: "https://statics.tver.jp/content/episode/" + id + ".json?v=3",
					imu_mode: "xhr",
					headers: {
						Origin: "https://tver.jp",
						Referer: "https://tver.jp/",
						"Sec-Fetch-Dest": "empty",
						"Sec-Fetch-Mode": "cors",
						"Sec-Fetch-Site": "same-site"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					if (!resp) {
						return done(null, false);
					}
					var accountid = resp.video.accountID;
					var videoid = resp.video.videoID;
					var url = "https://players.brightcove.net/" + accountid + "/default_default/index.html?videoId=" + videoid;
					done(url, 6 * 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+episodes\/+([0-9a-z]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					var ep = match[1];
					query_tver_episode_1(ep, function(url) {
						if (!url) {
							return cb(null);
						}
						return cb({
							url: url,
							is_pagelink: true
						});
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "ais-cf.tvnow.de") return src.replace(/\/[0-9]+x[0-9]+\/+([^/]+)(?:[?#].*)?$/, "/$1");
		if (domain === "images.fanseven.com") {
			var queries_2 = get_queries(src);
			if (queries_2.url) {
				return add_http(decodeuri_ifneeded(queries_2.url));
			}
		}
		if (domain === "static.harpersbazaar.de") return src.replace(/\/fit\/+[0-9]+x[0-9]+\/+/, "/fit/0x0/");
		if (domain === "img.gazeta.ru") return src.replace(/(\/files[0-9]*\/+[0-9]+\/+[0-9]+\/+[^/]+)-pic[0-9]*(?:_[0-9a-z_]+)?-[0-9]+x[0-9]+-[0-9]+\./, "$1.");
		if (domain === "cdn.iportal.ru") {
			return src
				.replace(/\.webp-portal(?:[?#].*)?$/, "")
				.replace(/(\/preview\/+[0-9a-f]+)_[0-9]+\./, "$1.");
		}
		if (domain === "imaginary.abcmedia.no" ||
			domain === "images.ladbible.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+resize\?(?:.*&)?url=([^&#]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "storage.tele-sport.ru") {
			return src
				.replace(/(\.[a-z]+)\.webp(?:[?#].*)?$/, "$1")
				.replace(/\/files\/+filter\/+[^/]+\/+/, "/files/");
		}
		if (domain_nowww === "wabe.org") {
			return src
				.replace(/-[0-9]+x[0-9]+(\.[^-/.]+)(?:[?#].*)?$/, "$1")
				.replace(/-scaled(\.[^-/.]+)(?:[?#].*)?$/, "$1")
				.replace(/(\.[a-z]+)-[0-9]+x[0-9]+-[0-9]{9,}\.[^/.]+(?:[?#].*)?$/, "$1");
		}
		if (domain === "s.france24.com" ||
			domain === "s.rfi.fr") {
			return {
				url: src
					.replace(/\.webp(?:[?#].*)?$/, ".jpg")
					.replace(/(\/media\/+display\/+[-0-9a-f]+\/+)(?:[wp]:[^/]+\/+)+/, "$1"),
				head_wrong_contentlength: true
			};
		}
		if (domain === "s3-images.sportnews.bz") return src.replace(/\/_images\/+.*?\/+img\//, "/img/");
		if (domain_nowww === "vmcdn.ca") return src.replace(/(\/f\/+files\/+.*)(?:;[a-z]+=[^;]+)+([?&#].*)?$/, "$1");
		if (domain === "img.myslo.ru") {
			return src.replace(/(\/photogallery\/+(?:[0-9a-f]{2}\/+){2}[-0-9a-f]{10,})_[a-z]\./i, "$1_o.");
		}
		if (domain === "img.tsargrad.tv") return src.replace(/\/cache\/+((?:[0-9a-f]\/+){2}[^/]+)\/+.*/, "/$1");
		if (domain === "cdnlv.redkassa.ru") return src.replace(/(\/picture\/+[-0-9a-f]{20,})\/+[0-9]+\/+[0-9]+\/+[a-z]+(?:[?#].*)?$/, "$1");
		if (domain_nowww === "wa.de" ||
			domain_nowww === "ovb-online.de") {
			return {
				url: src.replace(/((?:\/bilder\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9]+\/+[0-9]+-[^/]+|\/images\/+[^/]+\/+img\/+[^/]*-[0-9]{10,}))-[0-9a-zA-Z]+(?:[UV]I|SG|[0-9a-f]{2})\./, "$1."),
				norecurse: true
			};
		}
		if (domain === "cdn.schweizer-illustrierte.ch") return src.replace(/\/fp\/+(?:[0-9]+\/+){4}/, "/");
		if ((domain_nowww === "oxfordmail.co.uk" ||
			domain_nowww === "heraldscotland.com" ||
			domain_nowww === "theboltonnews.co.uk" ||
			domain_nowww === "thenorthernecho.co.uk" ||
			domain_nowww === "glasgowtimes.co.uk" ||
			domain_nowww === "theargus.co.uk") && /\/resources\/+images\//.test(src)) {
			return src
				.replace(/\/images\/+[0-9]+x[0-9]+\/+[0-9]+x\/+[0-9]+\/+([0-9]+\.)/, "/images/$1")
				.replace(/\?.*/, "");
		}
		if (domain === "austin.culturemap.com" ||
			domain_nowww === "indy100.com" ||
			domain === "assets.rebelmouse.io" ||
			domain_nowww === "blackbeltmag.com") {
			match = src.match(/\/media-library\/+[^/]*?[?&]id=([0-9]+)/);
			if (match) {
				return src.replace(/[?#].*/, "?id=" + match[1]);
			}
		}
		if (domain_nowww === "out.com" ||
			domain_nowww === "coveteur.com") {
			return src.replace(/(\/media-library\/+.*\?)(?:.*&)?(id=[0-9]+).*?$/, "$1$2&quality=100");
		}
		if (domain_nowww === "figureskating-online.com") {
			newsrc = website_query({
				website_regex: /\/ce_photo\/+html\/+image\.html\?(?:.*&)?imageUrl=([^&]+)/,
				run: function(cb, match) {
					var joined = urljoin(src, match[1], true);
					return cb(joined);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "figureskating-online.com" && /\/thumb_[0-9]+\./.test(src) && options.element) {
			if (options.element.tagName === "IMG" && options.element.parentElement && options.element.parentElement.tagName === "A") {
				var parent_onclick = options.element.parentElement.getAttribute("onclick");
				if (parent_onclick) {
					var match_5 = parent_onclick.match(/displaySingleImage\('([^']+)'/);
					if (match_5) {
						return match_5[1].replace(/^.*?mediapool/, "/mediapool");
					}
				}
			}
		}
		if (domain === "assets-cms.thescore.com") return src.replace(/(\/image\/+file\/+[0-9]+\/+)w[0-9]+xh[0-9]+_/, "$1");
		if (domain === "cdn.7days.ru") {
			newsrc = src.replace(/(\/[0-9]+)\.webp(?:[?#].*)?$/, "$1.jpg");
			if (newsrc !== src)
				return newsrc;
			return {
				url: src.replace(/(\/pic\/.*\/[0-9]+)\/[0-9]+(\.[a-z]+)(?:[?#].*)?$/, "$1$2"),
				norecurse: true
			};
		}
		if (domain === "dthezntil550i.cloudfront.net") {
			var match_6 = src.match(/\/[0-9a-z]{2}\/+[a-z]+\/+([0-9a-z]{2}[0-9]+)\//);
			var extra_1 = null;
			if (match_6) {
				extra_1 = {
					page: "https://medibang.com/picture/" + match_6[1] + "/"
				};
			}
			return {
				url: src.replace(/\/[0-9]+_[0-9]+\/+([-0-9a-f]{20,}\.)/, "/$1"),
				extra: extra_1
			};
		}
		if (domain === "dlcdnwebimgs.asus.com") return src.replace(/(\/gain\/+[-0-9a-fA-F]{20,})\/.*/, "$1/");
		if (googlestorage_container === "mediaslide-us") {
			newsrc = src.replace(/(\/(?:news_)?pictures\/+[0-9]+\/+[0-9]+\/+)(?:large|profile|square)-/, "$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/videos\/+[0-9]+\/+[0-9]+-[0-9a-f]+)\.jpg(?:[?#].*)?$/, "$1.mp4");
			if (newsrc !== src)
				return {
					url: newsrc,
					video: true
				};
		}
		if (domain_nowww === "modemodels.com") {
			if (/\/images\/+grey\.gif(?:[?#].*)?$/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "images.craigslist.org") return src.replace(/(\/[^/]+)_(?:300x300|600x450)\./, "$1_1200x900.");
		if (domain === "images.rawpixel.com") {
			newsrc = src
				.replace(/[?#].*$/, "")
				.replace(/_(?:social_(?:square|landscape|portrait)|[1-9]00|1000)\//, "_1300/");
			if (newsrc !== src)
				return newsrc;
			try {
				var internal_url_match = src.match(/:\/\/[^/]+\/+[^/]+\/+([^/.?#]{20,})\./);
				if (internal_url_match) {
					var internal_url = internal_url_match[1];
					var decoded_1 = base64_decode(internal_url);
					decoded_1 = decoded_1.replace(/\/website_content\/+lr\/+/, "/website_content/");
					var encoded = base64_encode(decoded_1);
					return src.replace(/(:\/\/[^/]+\/+[^/]+\/+)[^/.?#]{20,}\./, "$1" + encoded + ".");
				}
			} catch (e) {
				console_error(e);
			}
		}
		if (domain_nosub === "carsforsale.com" && /^cdn[0-9]*\./.test(domain)) {
			newsrc = src.replace(/(\/[0-9a-f]{20,}\/+)[0-9]+x[0-9]+\/+/, "$1original/");
			if (newsrc !== src) {
				common_functions["get_redirect_url"](api_cache, options, newsrc, options.cb);
				return {
					waiting: true
				};
			}
		}
		if (domain === "assets.shueisha.online") return src.replace(/\/image\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]+\/+)[0-9]+\/+([^/]+)(?:[?#].*)?$/, "/image/-/$10/$2");
		if (domain_nowww === "panasonic.com") return src.replace(/(\/content\/+dam\/.*\.[a-z]+)\.pub\.thumb\.[0-9]+\.[0-9]+\.[a-z]+(?:[?#].*)?$/, "$1");
		if (domain_nowww === "coloring-pages.info") {
			return src
				.replace(/(\/images\/+)ccovers\/+([^/.]+)\.[a-z]+(?:[?#].*)?$/, "$1svg/$2.svg")
				.replace(/\/images\/+minicovers\/+/, "/images/ccovers/");
		}
		if (domain_nowww === "coloringhome.com") return src.replace(/\/thumbnail\//, "/coloring/");
		if (domain_nowww === "drawdoo.com") {
			newsrc = src.replace(/.*?\/wp-content\/+themes\/+blogfolio\/+themify\/+img\.php\?(?:.*&)?src=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nosub === "olxcdn.com" ||
			domain === "apollo-virginia.akamaized.net" ||
			domain === "apollo-frankfurt.akamaized.net" ||
			domain === "apollo-singapore.akamaized.net" ||
			domain === "apollo-ireland.akamaized.net") {
			return src
				.replace(/%3[Bb]/g, ";")
				.replace(/(\/files\/+[^/]+\/+[^/?#;]+?)(?:[;?#].*)?$/, "$1;s=0x0;f=png");
		}
		if (domain === "d2t6nqpqpe59g5.cloudfront.net") return src.replace(/(:\/\/[^/]+\/+)[0-9]+x[0-9]+x[a-z]+\/+/, "$1");
		if (domain === "images.prop24.com" ||
			domain === "img.autotrader.co.za") {
			return {
				url: src.replace(/(:\/\/[^/]+\/+[0-9]+)(?:\/+.*)?$/, "$1"),
				can_head: false // 500
			};
		}
		if (domain === "imgcdn.powr-media.com") {
			var match_7 = src.match(/:\/\/[^/]+\/+(?:[a-z]+:[^/]+\/+)*([^/.?#]{20,})/);
			if (match_7) {
				try {
					var decoded_2 = base64_decode(match_7[1]);
					var match1_1 = decoded_2.match(/^s3:\/\/([a-z]+)\/+(prod\/.*)$/);
					if (match1_1) {
						return "https://" + match1_1[1] + ".s3.amazonaws.com/" + match1_1[2];
					}
				} catch (e) {
					console_error(e);
				}
			}
		}
		if (domain === "static.thcdn.com") {
			return src
				.replace(/(:\/\/[^/]+\/+productimg\/+).*\/([^/?#]+)(?:[?#].*)?$/, "$1original/$2")
				.replace(/\/images\/+[^/]+\/+[^/]+\/+productimg\//, "/productimg/");
		}
		if (domain === "media.kingston.com") {
			newsrc = src.replace(/(\/kingston\/+product\/+[^/]+?-[0-9]+)-(?:tn|lg)\./, "$1-zm-lg.");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (domain === "cdn.7tv.app") {
			return {
				url: src.replace(/(\/emote\/+[0-9a-f]+\/+)[1-3]x\./, "$14x."),
				head_wrong_contenttype: true
			};
		}
		if (domain === "img-baila.hpplus.jp" ||
			domain === "img-maquia.hpplus.jp" // ||
		) {
			return src
				.replace(/:\/\/img-([^/]+\/+image\/.*)$/, "://cdn-$1")
				.replace(/(:\/\/[^/]+\/+).*?\/+(image\/+[0-9a-f]{2}\/+)/, "$1$2");
		}
		if (domain === "gather.fandalism.com" ||
			amazon_container === "gather.fandalism.com") {
			return src.replace(/(\.com\/+)[0-9]+x[0-9]+-/, "$1");
		}
		if (domain_nowww === "anigala-rew.jp") return src.replace(/(\/wp-content\/+uploads\/+)photo-gallery\/+[^/]+\/+/, "$1");
		if (domain_nowww === "zip2img.com") return src.replace(/(:\/\/[^/]+\/+i\/+\?)(?:.*&)?t(f=[^&]+)/, "$1$2");
		if (domain_nosub === "pornstar-scenes.com") return src.replace(/(:\/\/[^/]+\/+[^/]+\/+[^/]+)_thumb\.(?:webp|avif)(?:[?#].*)?$/, "$1_1500.webp");
		if (domain_nowww === "thotsbay.tv") return src.replace(/(\/storage\/+images\/.*)_[0-9]+\./, "$1.");
		if (domain_nowww === "fashionsnap-assets.com") return src.replace(/(:\/\/[^/]+\/+)asset\/+[^/]+=[^/]+\/+/, "$1");
		if (domain_nowww === "streamin.me" ||
			domain_nowww === "streamin.one") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+v\/+([0-9a-f]+)(?:[?#].*)?$/,
				query_for_id: "https://streamin.me/v/${id}",
				process: function(done, resp, cache_key) {
					var obj = common_functions["get_videotag_obj"](resp);
					if (!obj)
						return done(null, false);
					for (var _i = 0, obj_8 = obj; _i < obj_8.length; _i++) {
						var sobj = obj_8[_i];
						if (sobj.video) {
							sobj.headers.Referer = null;
							sobj.headers["Accept-Encoding"] = "identity;q=1, *;q=0";
							sobj.headers["Sec-Fetch-Dest"] = "video";
							sobj.headers["Sec-Fetch-Mode"] = "no-cors";
							sobj.headers["Sec-Fetch-Site"] = "cross-site";
							sobj.can_head = false;
						}
					}
					done(obj, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "shorpy.com") return src.replace(/(\/files\/+images\/+[^/]+)\.preview\./, "$1.");
		if (domain_nowww === "bellesa.co") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+videos\/+([0-9]+)\/+/,
				query_for_id: "https://www.bellesa.co/videos/${id}/",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/window\.__INITIAL_DATA__\s*=\s*({.*?});<\/script/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]).video;
					var resolutions = json.resolutions.split(",").sort(function(a, b) {
						return parse_int(b) - parse_int(a);
					});
					return done(fillobj_urls([
						{
							url: "https://s.bellesa.co/v/" + json.source + "/" + resolutions[0] + ".mp4",
							video: true
						},
						json.image
					], {
						extra: {
							page: resp.finalUrl,
							caption: json.title
						}
					}), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "media.kinoheld.de") {
			if (/:\/\/[^/]+\/+[^/]+=\//.test(src)) {
				newsrc = common_functions["get_thumbor_url"](src.replace(/^[a-z]+:\/\/[^/]+\/+/));
				if (newsrc) {
					return "https://media.kinoheld.de/" + decodeURIComponent(newsrc);
				}
			}
		}
		if (domain === "dosbg3xlm0x1t.cloudfront.net") return src.replace(/(\/images\/+items\/+[0-9]+\/+)(?:500|240)\/+/, "$11200/");
		if (domain === "thumb.viva.id") return src.replace(/:\/\/[^/]+\/+viva([a-z]+)\/+[0-9]+x[0-9]+\/+/, "://thumbs.vdvc.id/$1/images/original/");
		if (domain === "img.inews.co.id") return src.replace(/\/media\/+[0-9]+\/+files\//, "/files/");
		if (domain === "kbimages1-a.akamaihd.net") {
			return src.replace(/(\/[-0-9a-f]{20,}\/+)[0-9]+\/+[0-9]+\/+(?:true|false)\/+/i, "$1");
		}
		if (domain_nosub === "radiozet.pl" && /^gfx\./.test(domain)) {
			newsrc = src.replace(/_(?:size[-_][0-9]+x[0-9]+|article)(?:_(?:north|south))?(\.[a-z]+)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/storage\/+images\/.*)\.webp(?:[?#].*)?$/, "$1.jpg");
		}
		if (domain === "img.prosports.kz") {
			return src
				.replace(/(\/news\/+original\/.*)\.webp(?:[?#].*)?$/, "$1.jpg")
				.replace(/(\/news\/+)content\//, "$1original/");
		}
		if (domain === "ic-cdn.flipboard.com") {
			return src
				.replace(/\/_xlarge\.webp/, "/original.jpg")
				.replace(/\/_(?:small|medium|large)\./, "/_xlarge.");
		}
		if (domain === "dms-api.ntm.eu") return src.replace(/(\/api\/+v1\/+images\/+[a-z0-9]+)\/.*/, "$1");
		if (domain_nowww === "tatar-inform.ru" ||
			domain_nowww === "intertat.tatar") {
			return src.replace(/\/resize\/+[^/]+\/+images\//, "/images/");
		}
		if (domain === "img.chmedia.ch" ||
			domain === "img.luzernerzeitung.ch") {
			return src.replace(/\?.*/, "?quality=100");
		}
		if (domain_nowww === "ots.at" ||
			domain_nowww === "tourismuspresse.at") {
			return src.replace(/(?:_(?:liste|galerie|bildblock)|\.layout)(\.[^/.]+)(?:[?#].*)?$/, "$1");
		}
		if (domain === "image.puls24.at") return src.replace(/(\/images\/+)hera_dyn_[^/]+\/+/, "$1original/");
		if ((domain_nowww === "lalibre.be" ||
			domain_nowww === "lavenir.net" ||
			domain_nowww === "parismatch.be" ||
			domain_nowww === "dhnet.be") &&
			/:\/\/[^/]+\/+resizer\/.*\/arc-photo-ipmgroup\//.test(src)) {
			return src.replace(/.*\/arc-photo-ipmgroup\/+([^/]+)-prod\/+public\/+([^/]+)(?:[?#].*)?$/, "https://cloudfront-$1.images.arcpublishing.com/ipmgroup/$2");
		}
		if (domain_nowww === "leparisien.fr") return src.replace(/^[a-z]+:\/\/[^/]+\/+resizer\/+[^/]+=\/+arc-anglerfish-([^/]+)-prod-([^/]+)\/+public\/+/, "https://cloudfront-$1.images.arcpublishing.com/$2/");
		if (domain_nosub === "arcpublishing.com" && /\.cdn\./.test(domain)) {
			var subdomain = domain.replace(/\.cdn\.arcpublishing\.com$/, "");
			var folder_1 = subdomain.replace(/^([a-z]+)-.*/, "$1");
			var loc = "us-east-1";
			if (folder_1 === "thenational")
				loc = "eu-central-1";
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+resizer\/+v2\/+([^?#/]+)(?:[?#].*)?$/, "https://cloudfront-" + loc + ".images.arcpublishing.com/" + folder_1 + "/$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nosub === "arcpublishing.com" && /^cloudfront-[^/]+\.images\./.test(domain)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+[^/]+\/+(https?(?::|%3A).*)$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "nzherald.co.nz" ||
			domain_nowww === "reuters.com" ||
			domain_nowww === "masslive.com" ||
			domain === "imagenes.elpais.com" ||
			domain_nowww === "theglobeandmail.com") {
			var info_1 = { folder: "", loc: "" };
			if (domain_nowww === "nzherald.co.nz")
				info_1 = { folder: "nzme", loc: "ap-southeast-2" };
			else if (domain_nowww === "reuters.com")
				info_1 = { folder: "reuters", loc: "us-east-2" };
			else if (domain_nowww === "masslive.com")
				info_1 = { folder: "advancelocal", loc: "us-east-1" };
			else if (domain_nowww === "theglobeandmail.com")
				info_1 = { folder: "tgam", loc: "us-east-1" };
			else if (domain === "imagenes.elpais.com")
				info_1 = { folder: "prisa", loc: "eu-central-1" };
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+resizer\/+v2\/+([^?#/]+)(?:[?#].*)?$/, "https://cloudfront-" + info_1.loc + ".images.arcpublishing.com/" + info_1.folder + "/$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "lqj.ch") return src.replace(/(\/media\/+image\/+[0-9]+\/+)[^/]+\/+([-0-9a-f]{20,}\.[^/.]+)(?:\.webp)?(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "interfax-russia.ru") return src.replace(/\/images_cache\/+[0-9]+x[0-9]+\/+/, "/");
		if (domain === "images.wunderweib.de") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+([^/?#]+?)(?:\.[a-z]+)?(?:[?#].*)?$/);
			if (match) {
				var base_3 = match[1];
				var filename_1 = "";
				if (!/^[a-z]+=/.test(base_3)) {
					filename_1 = base_3.replace(/^([^,]*),.*/, "$1");
				}
				var id_match = base_3.match(/^(?:.*,)?id=([^,]+)/);
				var brand_match = base_3.match(/^(?:.*,)?b=([^,]+)/) || [null, "wunderweib"];
				if (id_match) {
					return "https://images.wunderweib.de/" + filename_1 + ",id=" + id_match[1] + ",b=" + brand_match[1] + ",w=2000.png";
				}
			}
		}
		if (domain_nowww === "baseljetzt.ch") {
			return {
				url: src
					.replace(/(\/[0-9]{4}\/+[0-9]{2}\/+[^/]+)_[0-9]+w\./, "$1_fullw.")
					.replace(/(\/[0-9]{4}\/+[0-9]{2}\/+[^/]+)-[0-9]+x[0-9]+\./, "$1."),
				can_head: false // 404
			};
		}
		if (domain_nowww === "stuttgart.de") {
			baseobj = {};
			match = src.match(/^(.*\.php)\.media\//);
			if (match) {
				baseobj = {
					extra: {
						page: match[1]
					}
				};
			}
			baseobj.url = src.replace(/(\.php\.media\/.*\.[a-zA-Z]+)\.scaled\/+[^/]+(?:[?#].*)?$/, "$1");
			return baseobj;
		}
		if (domain === "img-s-msn-com.akamaized.net" ||
			domain === "img.s-msn.com") {
			return {
				url: src
					.replace(/\.img$/, ".jpg")
					.replace(/\?.*/, ""),
				head_wrong_contentlength: true
			};
		}
		if (domain === "static.tvtropes.org") return src.replace(/:\/\/static\.([^/]+\/+pmwiki\/+pub\/+images\/)/, "://$1");
		if (domain_nosub === "cddbp.net" && /\.cdn\./.test(domain)) {
			return src.replace(/(\/[0-9A-F]{4}_)(?:[0-9]+x[0-9]+|thumb|small|medium|large)((?:_[^/]+)?\.[^/.]+)(?:[?#].*)?$/, "$1xlarge$2");
		}
		if (domain === "artwork.anghcdn.co") {
			newsrc = src.replace(/\/cover\/+([0-9]+)\/+([0-9]+)(?:[?#].*)?$/, "?id=$1&size=$2");
			if (newsrc !== src)
				return newsrc;
			id = src.replace(/^[a-z]+:\/\/[^/]+\/+\?(?:.*&)?id=([0-9]+)(?:[&#].*)?$/, "$1");
			if (id !== src) {
				return "https://artwork.anghcdn.co/?id=" + id + "&size=-1";
			}
		}
		if (domain === "images.bonanzastatic.com") return src.replace(/(\/images\/+[0-9a-f]{4}\/.*)_thumb[0-9]+\./, "$1.");
		if (domain === "static-cdn.nextapple.tw") return src.replace(/_750\.(?:jpeg|webp)(?:[?#].*)?$/, "_1280.webp");
		if (domain_nowww === "artmajeur.com") {
			newsrc = src
				.replace(/\/medias\/+standard\/+/, "/medias/hd/")
				.replace(/\/medias\/+profile_thumb\/+/, "/medias/profile/");
			if (newsrc !== src)
				return newsrc;
			match = src.match(/\/medias\/.*\/blog\/+([-0-9a-f]{36})\./);
			if (match) {
				return "https://www.artmajeur.com/attachment-preview/" + match[1];
			}
			newsrc = src.replace(/\/medias\/+mini\/+/, "/medias/standard/");
			if (newsrc !== src) {
				return [
					{
						url: newsrc,
						problems: {
							watermark: true
						}
					},
					{
						url: src,
						problems: {
							smaller: true
						}
					}
				];
			}
		}
		if (domain_nowww === "artelaguna.world") return src.replace(/(\/upload\/+url_immagine_[0-9]+\/+[0-9]+\/+)w[0-9]+\/+/, "$1");
		if (domain_nowww === "recordshopx.com") return src.replace(/\/cover\/+(?:width_[0-9]+|thumb|normal)\/+/, "/cover/big/");
		if (domain_nowww === "hcn.org") {
			return {
				url: src
					.replace(/(\/(?:big)?image)_(?:large|thumb|preview)(?:[?#].*)?$/, "$1")
					.replace(/\/@@images\/.*/, "/image"),
				can_head: false
			};
		}
		if (domain === "geo-static.traxsource.com") return src.replace(/\/scripts\/+image\.php\/+[0-9]+x[0-9]+\/+([0-9a-f]+)\./, "/files/images/$1.");
		if (domain === "imgproxy.ra.co") {
			match = src.match(/\/(aHR0c[^?#]+)(?:[?#].*)?$/);
			if (match) {
				var split = match[1].split("_");
				newsrc = base64_decode(split[0]);
				if (split[1])
					newsrc += "?" + base64_decode(split[1]);
				return newsrc;
			}
		}
		if (domain_nowww === "ad93.ltd") return src.replace(/-[0-9]+x-q[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1");
		if (domain === "img.karaoketexty.cz") return src.replace(/\/thumb\/+([^/]+)-w[0-9]+\./, "/$1.");
		if (domain === "search.pabloferreiro.es" ||
			domain === "librex.zzls.xyz" ||
			domain_nowww === "librex.me" ||
			domain === "librex.mikata.ru" ||
			domain === "search.ahwx.org" ||
			domain === "search.davidovski.xyz" ||
			domain === "search.madreyk.xyz" ||
			domain === "librex.pufe.org" ||
			domain === "librex.ratakor.com" ||
			domain === "search.tildevarsh.in" ||
			domain === "librex.myroware.eu" ||
			domain === "librex.bloatcat.tk" ||
			domain === "librex.retro-hax.net" ||
			domain === "search.funami.tech" ||
			domain === "search.zeroish.xyz" ||
			domain === "librex.baczek.me" ||
			domain === "librex.yogeshlamichhane.com.np" ||
			domain === "search.spaceint.fr" ||
			domain === "binternet.ahwx.org" ||
			domain === "lx.benike.monster") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+image_proxy\.php\?(?:.*&)?url=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "d1rgjmn2wmqeif.cloudfront.net") return src.replace(/(\/(?:[fr]|extra)\/+)(?:[gb]|[0-9]+)\/+/, "$1");
		if (domain === "mapi.associatedpress.com") {
			return src
				.replace(/(\/[0-9a-f.]+\/+components\/+)thumbnail\./, "$11024-preview.")
				.replace(/(\/v1\/+items\/+[0-9a-f.]+\/+)thumbnail\/+/, "$1preview/")
				.replace(/(\/v1\/+items\/+[0-9a-f.]+\/+[a-z]+\/+[^/.?#]+\.[^/.?#]+)(?:[?#].*)?$/, "$1");
		}
		if (domain === "view.publitas.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+images\?(?:.*&)?src=(http[^&#]+)(?:[?&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			return src
				.replace(/(\/pages\/+[0-9a-f]+)-at2400\./, "$1-original.")
				.replace(/(\/pages\/+[-0-9a-f]+)-at2000\./, "$1-at2400.")
				.replace(/(\/pages\/+[-0-9a-f]+)-at1600\./, "$1-at2000.")
				.replace(/(\/pages\/+[-0-9a-f]+)-at(?:200|600|800|1000)\./, "$1-at1600.");
		}
		if (domain_nosub === "hosting-media.net") return src.replace(/\/jpgr[0-9]+\/+/, "/jpgr99999/");
		if (domain === "img.mymusic.net.tw") return src.replace(/(\/mms\/+album\/+)M\/+/, "$1L/");
		if (domain_nosub === "files.fail" && /^v2-thumbs-/.test(domain)) {
			newsrc = src.replace(/(:\/\/v2-)thumbs(-[^/]+\/+)jpg\/+([0-9a-f]{10,})\.jpg(?:[?#].*)?$/, "$1videos$2$3.mp4");
			if (newsrc !== src)
				return {
					url: newsrc,
					Referer: "https://tik.fail/",
					video: true
				};
		}
		if (domain === "img.abcdinamo.com") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(eyJ[^/?#]+)(?:[?#].*)?$/);
			if (match) {
				var decoded_3 = base64_decode(match[1]);
				var json_2 = JSON_parse(decoded_3);
				if (json_2.bucket && json_2.key)
					return "https://" + json_2.bucket + ".s3.amazonaws.com/" + json_2.key;
			}
		}
		if (domain_nowww === "society6.com") return src.replace(/(\/cdn\/+[0-9]+\/+p\/+[0-9]+_[0-9]+_)(?:[a-z]|lz)\./, "$1i.");
		if (domain_nowww === "jazzmusicarchives.com") return src.replace(/(\/images\/+[^/]+\/+)thumbnails\/+([^/]+)_[0-9]+\./, "$1$2.");
		if (domain === "central.bac-lac.gc.ca") {
			if (/^[a-z]+:\/\/[^/]+\/+\.item\?(?:.*&)?id=/.test(src)) {
				return {
					url: remove_queries(src, ["op", "width", "height"]),
					can_head: false // 415
				};
			}
		}
		if (domain === "img.broadtime.com") return src.replace(/(\/Photo\/+[0-9]+):[0-9]+(?:[?#].*)?$/, "$1");
		if (domain === "cdn.twibooru.org") {
			newsrc = src.replace(/(\/img\/+[0-9]{4}\/+(?:[0-9]{1,2}\/+){2}[0-9]+\/+)(?:thumb|small|medium|large)\./, "$1full.");
			if (newsrc !== src)
				return add_extensions_with_jpeg(newsrc);
		}
		if (domain === "media.forgecdn.net") return src.replace(/(\/avatars\/+)thumbnails\/+([0-9]+\/+[0-9]+\/+)[0-9]+\/+[0-9]+\/+/, "$1$2");
		if (domain_nowww === "alamy.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+aggregator-api\/+download\/+\?(?:.*&)?url=(http[^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+[^/]+-image([0-9]+)\.html(?:[?#].*)?$/,
				query_for_id: "https://www.alamy.com/a-image${id}.html",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<script id="__NEXT_DATA__"[^>]*>({.*?})<\/script>/);
					if (!match) {
						console_error(cache_key, "Unable to find NEXT_DATA in", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					var product = json.props.pageProps.product;
					var extra = {
						page: product.uri,
						caption: product.meta.mediatitle,
						created_date: new Date(product.firstcreated).getTime() // firstcreated < uploaddate
					};
					var urls = [];
					urls.push(product.renditions.zoom.href.replace(/\/zooms\/+[0-9]+\/+/, "/zooms/15/"));
					return done(fillobj_urls(urls, { extra: extra }), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "alamy.com" && /^c[0-9]*\./.test(domain)) {
			return src.replace(/\/zooms\/+(?:[0-9]|10)\/+/, "/zooms/15/");
		}
		if (host_domain_nowww === "alamy.com" && options.element) {
			if (options.element.tagName.toUpperCase() === "SVG") {
				var img = options.element.querySelector("image");
				if (img) {
					return img.getAttribute("href");
				}
			}
		}
		if (domain_nowww === "snapxcdn.com") {
			match = src.match(/[?&]token=eyJ[^.&]+\.(eyJ[^.&]+)\./);
			if (match) {
				var splitted_2 = match[1].split("_");
				var jsonstr_1 = base64_decode(splitted_2[0]);
				if (splitted_2[1])
					jsonstr_1 += "?" + base64_decode(splitted_2[1]);
				var json_3 = JSON_parse(jsonstr_1);
				return json_3.url;
			}
		}
		if (domain_nowww === "pictures.immobilienscout24.de") return src.replace(/(\/listings\/+[-0-9a-f]+-[0-9]+\.[^/.]+)\/.*$/, "$1");
		if (domain === "cdn.nettiauto.com") return src.replace(/(\/[0-9]{4}\/+(?:[0-9]{2}\/+){2}[0-9a-f]+)-[a-z]+\./, "$1.");
		if (domain === "cdn.80sdb.com") return src.replace(/\/(?:small|medium)\/+/, "/preview/");
		if ((domain_nosub === "liveauctioneers.com" && /^p[0-9]\./.test(domain)) ||
			domain === "images.liveauctioneers.com") {
			return src
				.replace(/(:\/\/[^/]+\/+[0-9]+\/+[0-9]+\/+[0-9]+_[0-9]+_x\.[^/.?#]+)(?:[?#].*)?$/, "$1?quality=100")
				.replace(/(:\/\/[^/]+\/+[0-9]+\/+[0-9]+\/+[0-9]+_[0-9]+_)[a-z]+\./, "$1x.");
		}
		if (domain === "d2i8ejbvsgsqtt.cloudfront.net") return src.replace(/(\/gallery\/.*\/)(?:med|thumbnails)(\/+[^/]+)(?:[?#].*)?$/, "$1hires$2");
		if (domain_nosub === "tapas.io" ||
			domain === "d30womf5coomej.cloudfront.net") {
			return src.replace(/(\/[a-z]{2}\/+[0-9a-f]{2}\/+[-0-9a-f]{10,})_[a-z]\./, "$1.");
		}
		if (domain_nowww === "jokejive.com") return src.replace(/(\/images\/+jokejive\/+)s_([0-9]+\/+)/, "$1$2");
		if (amazon_container === "brandarmy-prod") {
			return src.replace(/(\/[0-9a-z]+\/+images\/+)thumbs\/+/, "$1");
		}
		if (domain === "am-a.akamaihd.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+image\?(?:.*&)?f=(http[^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "bnkr.b-cdn.net") {
			if (/:\/\/[^/]+\/+maintenance.mp4(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: true
				};
			}
		}
		if (domain_nosub === "bunkr.ru" && /^(?:i[0-9]*|[-a-z]+-[0-9]*img|i-[a-z]+)\./.test(domain)) {
			if (/\/404-file-video-not-found-OiF5LGXg\./.test(src))
				return {
					url: src,
					bad: true
				};
			newsrc = src.replace(/\/thumbs\/+/, "/");
			if (newsrc !== src) {
				var newsrcs = add_full_extensions(newsrc, ["png", "jpg", "jpeg"]);
				var videosrc = newsrc.replace(/^[a-z]+:\/\/i([0-9]*)\.[^/]+\/+([^/]+)\.[a-z]+$/, "https://media-files$1.bunkr.la/$2.mp4");
				if (videosrc !== newsrc) {
					var match_8 = parse_int(videosrc.match(/:\/\/media-files([0-9]*)\./)[1]);
					if (match_8 < 12 || isNaN(match_8)) {
						videosrc = videosrc.replace(/\.bunkr\.la\//, ".bunkr.ru/");
					}
					newsrcs.unshift({
						url: videosrc,
						video: true
					});
				}
				return newsrcs;
			}
		}
		if (domain_nowww === "cyberdrop.me") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+f\/+([0-9a-zA-Z]+)(?:[?#].*)?$/,
				query_for_id: function(id) {
					var url = "https://" + domain + "/f/" + id;
					return {
						url: "https://" + domain + "/api/f/" + id,
						imu_mode: "xhr",
						headers: {
							Accept: "application/json, text/plain, */*",
							Referer: url
						},
						json: true
					};
				},
				process: function(done, resp, cache_key) {
					if (!resp.url) {
						console_error(cache_key, "Unable to find URL from", resp);
						return done(null, false);
					}
					var obj = {
						url: resp.url
					};
					if (resp.type && /^video\//.test(resp.type))
						obj.video = true;
					return done(obj, 50 * 60); // expires in 60 minutes
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "cyberdrop.cloud" && host_domain_nowww === "cyberdrop.me" && options.element) {
			var link_el = common_functions["get_link_el_matching"](options.element.parentElement, function(el) { return el.href && /\/f\/+[a-zA-Z0-9]+$/.test(el.href); });
			if (link_el) {
				return {
					url: link_el.href,
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "webm.red") {
			newsrc = src.replace(/\/thumb\/+([a-zA-Z0-9]+)\.jpg(?:[?#].*)?$/, "/view/$1");
			if (newsrc !== src) {
				return {
					url: newsrc,
					is_pagelink: true
				};
			}
			newsrc = src.replace(/\/view\/+([a-zA-Z0-9]+)(?:\.webm)?(?:[?#].*)?$/, "/$1.webm");
			if (newsrc !== src) {
				return {
					url: newsrc,
					video: true
				};
			}
		}
		if (domain_nowww === "wolfstream.tv") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([0-9a-z]+)\/+[^/]+\.html(?:[?#].*)?$/,
				query_for_id: "https://wolfstream.tv/${id}/.html",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/sources: \[{file:("[^"]+")}\],\s*image: ("[^"]+"),/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var videofile = JSON_parse(match[1]);
					var imagefile = JSON_parse(match[2]);
					return done([
						{
							url: videofile,
							video: "hls",
							headers: {
								Origin: "https://wolfstream.tv",
								Referer: "https://wolfstream.tv/",
								"Sec-Fetch-Dest": "empty",
								"Sec-Fetch-Mode": "cors",
								"Sec-Fetch-Site": "same-site"
							}
						},
						imagefile
					], 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "beam-images.warnermediacdn.com") {
			return remove_queries(src, "w");
		}
		if (domain_nowww === "dior.com") {
			newsrc = src.replace(/(\/var\/+[^/]+\/+storage\/+images\/.*?\.[^/.?#]+)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/var\/+[^/]+\/+storage\/+images\/.*?)_[0-9]+_[0-9]+(\.[^/.?#]+)$/, "$1$2");
		}
		if (domain === "mediacache.wax.io") return src.replace(/(:\/\/[^/]+\/+[0-9a-zA-Z]+)\/+[0-9]+x[0-9]+(?:[?#].*)?$/, "$1");
		if (domain_nowww === "dominomusic.com") return src.replace(/(\/res\/+[^/]+\/+)[0-9]+_[0-9]+\//, "$1");
		if (domain_nowww === "delcampe.net") return src.replace(/\/img_(?:small|thumb)\/+/, "/img_large/");
		if (domain === "cdn.hmv.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+r\/.*?\/hmv\/+files\/+[0-9a-f]{2}\/+([-0-9a-f]{10,})(\.[a-z]+)(?:[?#].*)?$/, "https://hmv.com/getattachment/$1/a$2");
		if (domain_nowww === "ososedki.com" ||
			domain_nowww === "cosplaythots.com") {
			return src.replace(/\/images\/+a\/+604\/+/, "/images/a/1280/");
		}
		if (digitalocean_container === "immub-space") {
			return src.replace(/\/thumbnails\/+t_/, "/");
		}
		if (domain === "d1o6h00a1h5k7q.cloudfront.net") return src.replace(/(\/imagens\/+img_)[pm]\/+/, "$1g/");
		if (domain_nowww === "newspapers.com") {
			newsrc = website_query({
				website_regex: /:\/\/[^/]+\/+image\/+([0-9]+)\/*([?#].*)?$/,
				query_for_id: {
					url: "https://www.newspapers.com/image/${id}/${2}",
					imu_mode: "document"
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/var page\s*=\s*({.*?});\s*<\/script>/);
					if (!match) {
						console_error(cache_key, "Unable to find page match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					if (!json.iat) {
						console_error(cache_key, "No IAT for", resp, json);
						return done(null, false);
					}
					var queries = {
						id: json.image.imageId,
						width: json.image.width,
						height: json.image.height,
						crop: "0,0," + json.image.width + "," + json.image.height,
						brightness: 0,
						contrast: 0,
						invert: 0,
						ts: 1,
						cacheable: 1,
						iat: json.iat
					};
					return done({
						url: "https://img.newspapers.com/img/img?" + stringify_queries(queries, true)
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "img.newspapers.com") return src.replace(/\/img\/+img\?(?:.*&)?(clippingId=[0-9]+)(?:&.*)?$/, "/img/img?$1");
		if (domain_nowww === "devkis.club") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+pict\.php\?(?:.*&)?src=(http[^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "community.adobe.com") return src.replace(/(\/image-id\/+[0-9]+i[0-9A-F]{16}\/+).*/, "$1");
		if (domain === "d1u0ygfig6vnfa.cloudfront.net") return src.replace(/(\/gallery-artwork\/+)_galleryThumb\/+/, "$1");
		if (domain_nowww === "vgmsite.com") return src.replace(/\/thumbs\/+([^/]+)(?:[?#].*)?$/, "/$1");
		if (domain === "statics.indozone.news") return src.replace(/(\/content\/+[0-9]{4}\/+.*)_[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "atomgallery.co.uk") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+images\/+resize\.php\?(?:.*&)?src=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return urljoin(src, decodeuri_ifneeded(newsrc), true);
		}
		if (domain === "img.tineye.com") {
			return {
				url: src.replace(/(\/result\/+[0-9a-f]+-[0-9]+)(?:[?#].*)?$/, "$1?size=9999"),
				head_wrong_contenttype: true
			};
		}
		if (domain === "bu.azureedge.net") return src.replace(/(\/m2img\/+)(?:small_)?image\//, "$1image/");
		if (domain_nowww === "threads.net" && options && options.do_request && options.cb) {
			var threads_get_csrf_1 = function(cb) {
				if (!options.get_cookies) {
					console_error("No cookie support");
					return cb(null);
				}
				options.get_cookies("https://www.threads.net/", function(cookies) {
					if (!cookies) {
						console_error("Unable to get cookies for threads");
						return cb(null);
					}
					cookies = headers_list_to_dict(cookies);
					if (!("csrftoken" in cookies)) {
						console_error("csrftoken doesn't exist, try visiting threads.net");
						return cb(null);
					}
					cb(cookies["csrftoken"] || null);
				});
			};
			var threads_get_lsd_token_1 = function(cb) {
				api_query("threads:lsd", {
					url: "https://www.threads.net/"
				}, cb, function(done, resp, cache_key) {
					var lsdmatch = resp.responseText.match(/\["LSD",\[\],{"token":("[^"]+")}/);
					if (!lsdmatch) {
						console_error(cache_key, "Unable to find LSD token match", resp);
						return done(null, false);
					}
					var token = JSON_parse(lsdmatch[1]);
					return done(token, 60 * 60);
				});
			};
			var threads_get_tokens_1 = function(cb) {
				threads_get_csrf_1(function(csrf) {
					if (!csrf)
						return cb(null);
					threads_get_lsd_token_1(function(token) {
						cb({ csrf: csrf, lsd: token });
					});
				});
			};
			var threads_get_best_image_1 = function(candidates) {
				var has_nonsquare = false;
				for (var _i = 0, candidates_1 = candidates; _i < candidates_1.length; _i++) {
					var candidate = candidates_1[_i];
					if (candidate.width !== candidate.height)
						has_nonsquare = true;
				}
				var new_candidates = shallowcopy(candidates);
				new_candidates.sort(function(a, b) {
					var a_total = a.width * a.height;
					var b_total = b.width * b.height;
					return b_total - a_total;
				});
				for (var _a = 0, new_candidates_1 = new_candidates; _a < new_candidates_1.length; _a++) {
					var candidate = new_candidates_1[_a];
					if (has_nonsquare && candidate.width === candidate.height)
						continue;
					return candidate;
				}
				return candidates[0];
			};
			var threads_apicall_1 = function(query, cb) {
				threads_get_tokens_1(function(tokens) {
					if (!tokens)
						return cb(null);
					if (!query.lsd)
						query.lsd = tokens.lsd;
					if (!("server_timestamps" in query))
						query.server_timestamps = "true";
					if (!query.fb_api_caller_class)
						query.fb_api_caller_class = "RelayModern";
					if (query.variables && typeof query.variables !== "string") {
						query.variables = JSON_stringify(query.variables);
					}
					options.do_request({
						url: "https://www.threads.net/api/graphql",
						method: "POST",
						data: stringify_queries(query),
						imu_mode: "xhr",
						headers: {
							Accept: "*/*",
							"Content-Type": "application/x-www-form-urlencoded",
							Origin: "https://www.threads.net",
							Referer: "https://www.threads.net/",
							"Sec-Fetch-Dest": "empty",
							"Sec-Fetch-Mode": "cors",
							"Sec-Fetch-Site": "same-origin",
							"X-Asbd-Id": "129477",
							"X-Csrftoken": tokens.csrf,
							"X-Fb-Friendly-Name": query.fb_api_req_friendly_name,
							"X-Fb-Lsd": tokens.lsd,
							"X-Ig-App-Id": "238260118697367"
						},
						onload: function(resp) {
							if (resp.status !== 200) {
								console_error("threads: Unable to query", query, resp);
								return cb(null);
							}
							var json = null;
							try {
								json = JSON_parse(resp.responseText);
							} catch (e) {
								console_error("threads: Unable to parse JSON for", resp, query);
								return cb(null);
							}
							return cb(json);
						}
					});
				});
			};
			var threads_query_post_1 = function(postid, cb) {
				var cache_key = "threads:post:" + postid;
				api_cache.fetch(cache_key, cb, function(done) {
					threads_apicall_1({
						fb_api_req_friendly_name: "BarcelonaPostPageQuery",
						doc_id: "7074652575968011",
						variables: {
							"postID": postid,
							"__relay_internal__pv__BarcelonaIsLoggedInrelayprovider": false,
							"__relay_internal__pv__BarcelonaIsOriginalPostPillEnabledrelayprovider": false,
							"__relay_internal__pv__BarcelonaIsThreadContextHeaderEnabledrelayprovider": false,
							"__relay_internal__pv__BarcelonaShouldShowFediverseM1Featuresrelayprovider": false,
							"__relay_internal__pv__BarcelonaIsInlineReelsEnabledrelayprovider": false,
							"__relay_internal__pv__BarcelonaUseCometVideoPlaybackEnginerelayprovider": false,
							"__relay_internal__pv__BarcelonaOptionalCookiesEnabledrelayprovider": true,
							"__relay_internal__pv__BarcelonaShouldShowFediverseM075Featuresrelayprovider": false
						}
					}, function(data) {
						if (!data) {
							return done(null, false);
						}
						var thread_items = data.data.data.edges[0].node.thread_items;
						for (var _i = 0, thread_items_1 = thread_items; _i < thread_items_1.length; _i++) {
							var item = thread_items_1[_i];
							if (item.post.pk === postid) {
								return done(item.post, 60 * 60);
							}
						}
						return done(null, false);
					});
				});
			};
			var threads_query_post_by_shortcode_1 = function(shortcode, cb) {
				common_functions["instagram_shortcode_to_id"](shortcode, function(id) {
					threads_query_post_1(id, cb);
				});
			};
			newsrc = website_query({
				website_regex: /^https?:\/\/[^/]+\/+(?:t\/+|@[^/]+\/+post\/+)([-_A-Za-z0-9]+)\/*(?:[?#].*)?$/,
				run: function(cb, match) {
					threads_query_post_by_shortcode_1(match[1], function(result) {
						var baseobj = {
							extra: {
								page: "https://www.threads.net/t/" + result.code,
								caption: result.caption.text,
								created_date: result.taken_at * 1000
							},
							headers: {
								Referer: "https://www.threads.net/"
							}
						};
						var best_image_obj = threads_get_best_image_1(result.image_versions2.candidates);
						var urls = [];
						if (result.video_versions && is_array(result.video_versions) && result.video_versions.length > 0)
							urls.push({
								url: result.video_versions[0].url, // FIXME: Is [0] the best quality?
								video: true
							});
						if (best_image_obj)
							urls.push(best_image_obj.url);
						return cb(fillobj_urls(urls, baseobj));
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "threads.net" && options.element && options.do_request && options.cb) {
			var threads_el_is_miniavatar = function(el) {
				if (el.tagName !== "IMG")
					return false;
				var height = el.getAttribute("height");
				if (!height)
					return false;
				return parse_int(height) <= 20;
			};
			var threads_get_post_root_el = function(el) {
				var current = el;
				while (current = current.parentElement) {
					if (current.tagName === "DIV" && current.getAttribute("data-pressable-container"))
						return current;
				}
				return null;
			};
			if (!threads_el_is_miniavatar(options.element)) {
				if (options.element.tagName === "IMG" &&
					options.element.parentElement && options.element.parentElement.tagName === "DIV" &&
					options.element.parentElement.parentElement && options.element.parentElement.parentElement.tagName === "A") {
					var dblparent = options.element.parentElement.parentElement;
					var href_1 = dblparent.href;
					if (/\/@[^/]+\/*(?:[?#].*)?$/.test(href_1)) {
						return {
							url: dblparent.href,
							is_pagelink: true
						};
					}
				}
				var post_root = threads_get_post_root_el(options.element);
				if (post_root) {
					var thread_a = post_root.querySelector('a[href*="/t/"]');
					if (!thread_a)
						thread_a = post_root.querySelector('a[href*="/post/"]');
					console_log(options.element, post_root, thread_a);
					if (thread_a) {
						return {
							url: thread_a.href,
							is_pagelink: true
						};
					}
				}
			}
		}
		if (domain_nowww === "toolboxrecords.com") return src.replace(/(\/public\/+images\/.*\/)(?:small|medium|large)\./, "$1big.");
		if (domain === "api.roughtrade.com") return src.replace(/\/media\/+thumbnails\/+(products\/+[0-9]+_[0-9a-f]+)_thumbnail_[0-9]+\.webp(?:[?#].*)?$/, "/media/$1.jpg");
		if (domain === "linkstorage.linkfire.com") {
			match = src.match(/^([a-z]+:\/\/[^/]+\/+medialinks\/+images\/+[^/]+\/+[^/]+)-[0-9]+x[0-9]+(\.[^/.?#]+)(?:[?#].*)?$/);
			if (match) {
				return [
					match[1] + match[2],
					match[1]
				];
			}
		}
		if (domain === "i.jpgjet.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+cache\.php\?(?:.*&)?url=([^&#]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "vp.nyt.com") {
			match = src.match(/^([a-z]+:\/\/[^/]+\/+video\/+[0-9]{4}\/+(?:[0-9]{2}\/+){2}[^/]+)_[0-9]+p(\.mp4)(?:[?#].*)?$/);
			if (match) {
				return fillobj_urls(replace_sizes(src, [
					match[1] + "_2160p" + match[2],
					match[1] + "_1440p" + match[2],
					match[1] + "_1080p" + match[2],
					match[1] + "_720p" + match[2],
					match[1] + "_480p" + match[2],
					match[1] + "_360p" + match[2],
					match[1] + "_240p" + match[2]
				]), {
					video: true
				});
			}
		}
		if (domain === "static-cdn.strpst.com") return src.replace(/(\/(?:avatars|photos|intro)\/+(?:[0-9a-f]\/+){3}[0-9a-f]{10,})-[a-z]+(?:[?#].*)?$/, "$1");
		if (domain === "media.e-talenta.eu") return src.replace(/\/foto\/+[0-9]+\/+[0-9]+\/+/, "/foto/");
		if (domain === "cdn.chili.com") return src.replace(/(\/images\/+public\/+cms\/.*?)(?:[?#].*)?$/, "$1?width=0");
		if (domain === "img-cdn-p.ekstrabladet.dk") return src.replace(/(\/image\/+[^/]+\/+[0-9]+\/+)[a-zA-Z]+_?[0-9]+\/+/, "$1original/");
		if (domain === "cdn.v2ex.com") return src.replace(/(\/avatar\/.*)_(?:normal|x{0,2}large)(\.[^/.]+(?:[?#].*)?)$/, "$1_xxxlarge$2");
		if (domain === "meo.comick.pictures") return src.replace(/(:\/\/[^/]+\/+[^/]+)-[sm]\./, "$1.");
		if (domain_nosub === "wb.ru" && /^basket-[0-9]*\./.test(domain)) {
			return src
				.replace(/(\/images\/+big\/+[^/]+\.)webp(?:[?#].*)?$/, "$1jpg")
				.replace(/\/images\/+(?:c[0-9]+x[0-9]+|tm)\/+/, "/images/big/");
		}
		if (domain === "cdn.store-tsutaya.tsite.jp") return src.replace(/(\/images\/+jacket\/+[0-9]+\/+[0-9]+_[0-9]+)[SM]\./, "$1L.");
		if (domain === "cdn.marvel.com") return src.replace(/\/content\/+1x\/+/, "/content/2x/");
		if (domain === "cdn1.mmwst.ru") {
			return src
				.replace(/\.webp(?:[?#].*)?$/, ".jpg")
				.replace(/:\/\/[^/]+\/+[0-9a-f]+\/+([0-9a-f]{2})([0-9a-f]+\.)/, "://cdn2.mmwst.ru/files/$1/$1$2");
		}
		if (domain === "img.atlasobscura.com") {
			newsrc = src.replace(/.*?\/(aHR0c[^.?#]+?)(?:[?#.].*)?$/, "$1");
			if (newsrc !== src) {
				var splitted_3 = newsrc.split("/");
				var decoded_4 = [];
				for (var _b = 0, splitted_1 = splitted_3; _b < splitted_1.length; _b++) {
					var s = splitted_1[_b];
					decoded_4.push(base64_decode(s));
				}
				return decoded_4.join("");
			}
		}
		if (domain_nowww === "bildbyran.se") {
			newsrc = src.replace(/(\/getjpeg\?(?:.*&)?size=)537x358([&#].*)?$/, "$1950x632$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/\/getjpeg\?(?:.*&)?id=([0-9]{4})([0-9]{2})([A-Z]{2})([0-9]{3})(?:[&#].*)?$/, "/thumbnails/$1/$2$3/BB$1$2$3$4.jpg");
			if (newsrc !== src)
				return {
					url: newsrc,
					problems: { smaller: true }
				};
			newsrc = src.replace(/\/thumbnails\/+[0-9]{4}\/+[0-9]{2}[A-Z]{2}\/+[A-Z]{2}([0-9A-Z]+)\.[^/]+(?:[?#].*)?$/, "/getjpeg?id=$1&size=950x632");
			if (newsrc !== src)
				return {
					url: newsrc,
					problems: { watermark: true }
				};
		}
		if (domain === "img.peliplat.com") {
			if (/\/api\/+resize\/+v1\?/.test(src)) {
				return keep_queries(src, "imagePath");
			}
		}
		if (domain === "u.livechart.me") return src.replace(/(\/poster_image\/+[^/]+\.[^/]+\/+)small\./, "$1large.");
		if (domain === "d10j3mvrs1suex.cloudfront.net") {
			return src.replace(/\/!!\/.*/, "");
		}
		if (domain === "c758759.ssl.cf2.rackcdn.com") return src.replace(/(:\/\/[^/]+\/+)(?:small|large)\/+/, "$1original/");
		if (domain_nowww === "4kwallpapers.com") return src.replace(/\/images\/+walls\/+[^/]+\/+([0-9]+\.)/, "/images/wallpapers/-$1");
		if (domain === "seccdn.libravatar.org") {
			if (/\/avatar\/+[0-9a-f]+/.test(src))
				return add_queries(src, { "s": "512" });
		}
		if (domain_nowww === "40konline.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+proxy\.php\?(?:.*&)?request=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "militaryfactory.com") return src.replace(/\/imgs\/+(?:sml|med)\/+/, "/imgs/lrg/");
		if (domain_nowww === "shoplineimg.com") {
			newsrc = src.replace(/(\/[0-9a-f]+\/+)[0-9]+x(\.[a-z]+)(?:[?#].*)?$/, "$1original$2");
			if (newsrc !== src) {
				return add_full_extensions(newsrc);
			}
		}
		if (domain_nowww === "absolutearts.com") return src.replace(/(\/portfolio3\/+.\/+[^/]+\/+[^/.]+-[0-9]{5,})(?:st|mt?|lt)?\./, "$1l.");
		if (domain === "img.allzip.org") return src.replace(/\/thumbs\/+([0-9]+(?:_[0-9]+)?\.)/, "/orig/$1");
		if (domain_nowww === "arthive.net") {
			newsrc = src
				.replace(/(\/res\/+media\/+img\/.*)\.webp(?:[?#].*)?$/, "$1.jpg")
				.replace(/(\/res\/+media\/+img\/+o[xy]1400\/+work\/+[^/]+\/+[0-9]+)@2x\./, "$1.")
				.replace(/(\/res\/+media\/+img\/+o[xy])(?:400|800|1000|1200)\/+/, "$11400/");
			if (newsrc !== src)
				return newsrc;
			if (options && options.cb && get_image_size && /\/res\/+media\/+img\/+o[xy][0-9]+\//.test(src)) {
				get_image_size(src, function(x, y) {
					if (x > y) {
						return options.cb(src.replace(/(\/res\/+media\/+img\/+o)[xy]([0-9]+\/+)/, "$1y$2"));
					} else {
						return options.cb(src.replace(/(\/res\/+media\/+img\/+o)[xy]([0-9]+\/+)/, "$1x$2"));
					}
				});
				return {
					waiting: true
				};
			}
		}
		if (domain === "img-cdn.dnes.bg") return src.replace(/(\/images\/+photos\/+[^/]+\/+[0-9]+)-(?:lifestyle3?|article2|developing|fbh|middle|category)\./, "$1-exclusive.");
		if (domain_nowww === "oldbookillustrations.com") return src.replace(/(\/site\/+assets\/+files\/+[0-9]+\/+[^/.]+\.)[0-9]+x[0-9]+\./, "$1");
		if (domain === "imageprocessor.digital.vistaprint.com") {
			return src
				.replace(/^[a-z]+:\/\/[^/]+\/+([a-z]+:\/\/.*)/, "$1")
				.replace(/^[a-z]+:\/\/[^/]+\/+(stockservice\.digital\.vistaprint\.com\/)/, "https://$1")
				.replace(/^([a-z]+:\/\/[^/]+\/+)(?:(?:crop|width|height|max(?:Width|Height))\/+[^/]+|png)\/+/, "$1");
		}
		if (domain_nosub === "carrd.co") return src.replace(/(\/assets\/+images\/+gallery02\/+[0-9a-f]+)\./, "$1_original.");
		if (domain_nowww === "goodillustration.com") {
			newsrc = src.replace(/(\/images\/+)([0-9]+\.)/, "$1original_$2");
			if (newsrc !== src)
				return newsrc;
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+show-picture\/+id=([0-9]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://www.goodillustration.com/show-picture/id=${id}/",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<img src="([^"]+_upload\/+images\/+(?:original_)?[0-9]+[^"]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					return done(match[1], 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "goodillustration.com" && options.element) {
			if (options.element.tagName === "IMG" &&
				options.element.parentElement && options.element.parentElement.tagName === "A" && options.element.parentElement.id) {
				var match_9 = options.element.parentElement.id.match(/^gallery-photo-([0-9]+)$/);
				if (match_9) {
					return {
						url: "https://www.goodillustration.com/show-picture/id=" + match_9[1] + "/",
						is_pagelink: true
					};
				}
			}
		}
		if (domain_nowww === "egmo.org") {
			newsrc = src.replace(/(\/people\/+person[0-9]+\/+photo[0-9]+)-t[0-9]+\./, "$1.");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (host_domain_nowww === "picnob.com" && options.element && domain_nosub === "picnob.com") {
			if (options.element.tagName === "IMG" && options.element.parentElement && options.element.parentElement.tagName === "A") {
				var parent_4 = options.element.parentElement;
				var parent_href = parent_4.href || "";
				if (/^[a-z]+:\/\/[^/]*\.cdninstagram\.com\//.test(parent_href)) {
					return common_functions["set_cdninstagram_obj"](parent_href);
				}
			}
		}
		if (digitalocean_container === "warframe-web-assets") {
			newsrc = src.replace(/\/+thumbnails\/+([a-zA-Z0-9]+)(?:_[0-9]+x[0-9]+)?\./, "/$1.");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (domain === "media.comikey.com") return src.replace(/:\/\/[^/]+\/+gazo\/+[0-9]+\/+[a-z]+\/+/, "://comikey.com/media/");
		if (domain_nowww === "wright20.com") return src.replace(/\/items\/+index\/+[0-9]+\/+/, "/items/index/0/");
		if (domain === "image.civitai.com") return src.replace(/^([a-z]+:\/\/[^/]+\/+[^/]+\/+[^/]+\/+)(?:width|height|original)=[^/]+\/+/, "$1original=true/");
		if (domain_nowww === "vxxx.com" && options.do_request && options.cb) {
			var vxxx_b64_1 = function(e) {
				return base64_decode(e
					.replace(/А/g, "A")
					.replace(/В/g, "B")
					.replace(/С/g, "C")
					.replace(/Е/g, "E")
					.replace(/М/g, "M")
					.replace(/\./g, "+")
					.replace(/,/g, "/")
					.replace(/~/g, "="));
			};
			var get_vxxx_video_1 = function(id, cb) {
				api_query("vxxx:" + id, {
					url: "https://vxxx.com/api/videofile.php?video_id=" + id + "&lifetime=8640000",
					imu_mode: "xhr"
				}, cb, function(done, resp, cache_key) {
					var json = JSON_parse(resp.responseText);
					if (!json || !is_array(json)) {
						console_error(cache_key, "Invalid response", resp, json);
						return done(null, false);
					}
					var formats = ["_hd.mp4", "_sd.mp4"];
					json.sort(function(a, b) {
						var a_f = a.format;
						var b_f = b.format;
						if (!a_f || !b_f)
							return 0;
						return array_indexof(formats, a_f) - array_indexof(formats, b_f);
					});
					var urls = [];
					for (var _i = 0, json_4 = json; _i < json_4.length; _i++) {
						var obj_9 = json_4[_i];
						urls.push({
							url: urljoin("https://" + domain + "/", vxxx_b64_1(obj_9.video_url), true),
							video: true
						});
					}
					return done(urls, 12 * 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video-([0-9]+)\/*(?:[?#].*)?$/,
				run: function(cb, match) {
					get_vxxx_video_1(match[1], function(resp) {
						if (!resp)
							return cb(null);
						return cb(resp);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "pv.vxxx.com" ||
			domain === "tn.vxxx.com") {
			match = src.match(/\/videos(?:_screenshots)?\/+[0-9]+\/+([0-9]+)\/+(?:[0-9]+_tr\.|[0-9]+x[0-9]+\/)/);
			if (match) {
				return {
					url: "https://vxxx.com/video-" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain === "assets.privy.com") return src.replace(/(\/picture_photos\/+[0-9]+\/+)[a-z]+\/+/, "$1original/");
		if (domain_nowww === "produce101.jp") return src.replace(/(\/static\/+produce101s3\/+)([^/]+)(\/+[^/]+\/+)thumbnail\/+/, "$1$2$3$2/");
		if (domain_nowww === "fapello.com") return src.replace(/(\/content\/+.*)_[0-9]+px\./, "$1.");
		if (domain === "api-cdn.arte.tv") return src.replace(/(\/img\/+v2\/+image\/+[^/]+\/+)[0-9]+x[0-9]+(?:[?#].*)?$/, "$10x0");
		if (domain_nowww === "androidauthority.com") {
			return src
				.replace(/(\.(?:jpe?g|png))\.webp(?:[?#].*)?$/i, "$1")
				.replace(/(\/wp-content\/+uploads\/.*)-[0-9]+w-[0-9]+h\./, "$1.");
		}
		if (domain_nowww === "normanrecords.com") return src.replace(/\/artwork\/+(?:small|medium)\/+/, "/artwork/large/");
		if (domain === "ic.od-cdn.com") {
			match = src.match(/\/resize\?(?:.*&)?url=([^&]+)(?:[&#].*)?$/);
			if (match) {
				return urljoin("https://img1.od-cdn.com/", decodeURIComponent(match[1]), true);
			}
		}
		if (domain_nosub === "od-cdn.com" && /^img[0-9]*\./.test(domain)) {
			return src.replace(/\/ImageType-(?:150|[24]00)(\/.*)IMG(?:150|[24]00)\./i, "/ImageType-100$1IMG100.");
		}
		if (domain_nosub === "pic-upload.de") return src.replace(/\/thumb\/+([0-9]+)\/+/, "/img/$1/");
		if (domain === "cdn.dol.com.br") return src.replace(/(\/img\/+[^/]+\/+[0-9]+\/+)[0-9]+x[0-9]+\/+/, "$1");
		if (domain_nowww === "xappie.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+image\.php\?(?:.*&)?image=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return urljoin(src, decodeURIComponent(newsrc).replace(/^\.\//, "/"), true);
		}
		if (domain_nosub === "3hentai.net" && /^s[0-9]*\./.test(domain)) {
			return src.replace(/(\/d[0-9]+\/+[0-9]+)t\./, "$1.");
		}
		if (domain_nosub === "rule34.dev" && /^proxy[0-9]*\./.test(domain)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+convert\?(?:.*&)?q=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "itaku.ee") {
			newsrc = src.replace(/(\/api\/+media\/+gallery_imgs\/+[^/]+)\/+[a-z]{2}(?:_[A-Za-z0-9]+)?(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return add_extensions(newsrc);
			var query_itaku_api_1 = function(id, cb) {
				var cache_key = "itaku:" + id;
				api_query(cache_key, {
					url: "https://itaku.ee/api/galleries/images/" + id + "/",
					imu_mode: "xhr",
					headers: {
						Accept: "application/json, text/plain, */*"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					var extra = {
						page: "https://itaku.ee/images/" + id,
						caption: resp.title || resp.description,
						created_date: new Date(resp.date_added).getTime(),
						id: id,
						author_username: resp.owner_username
					};
					var urls = [];
					if (resp.video) {
						urls.push({
							url: resp.video.video,
							video: true
						});
					}
					urls.push(resp.image);
					return done(fillobj_urls(urls, { extra: extra }), 6 * 60 * 60);
				});
			};
			if (options.do_request && options.cb) {
				newsrc = website_query({
					website_regex: /^[a-z]+:\/\/[^/]+\/+images\/+([0-9]+)\/*(?:[?#].*)?$/,
					run: function(cb, match) {
						query_itaku_api_1(match[1], cb);
					}
				});
				if (newsrc)
					return newsrc;
			}
		}
		if (host_domain_nowww === "itaku.ee" && options.element) {
			var parent_5 = common_functions["get_parent_el_matching"](options.element, function(el) {
				return el.tagName === "A" && el.classList.contains("img-link") && el.href && /\/images\/+[0-9]+/.test(el.href);
			});
			if (parent_5) {
				return {
					url: parent_5.href,
					is_pagelink: true
				};
			}
		}
		if (domain_nosub === "loyalfans.com" && /^public-cdn[0-9]*\./.test(domain)) {
			return src.replace(/(\/images\/+[^/]+\/+(?:timeline|profile)\/+[0-9]+_[0-9]+_[0-9]+_[0-9]+)_[^/.?#]+(\.[^/.]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "saint-laurent.dam.kering.com") {
			return src.replace(/(\/m\/+[0-9a-f]+\/+)(?:Thumbnail|Small)-/i, "$1eCom-");
		}
		if (domain_nowww === "igcdn.xyz") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+\?(?:.*&)?file=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "assets.armadamusic.com") {
			match = src.match(/\/(eyJid[^/?#.]{10,})(?:[?#].*)?$/);
			if (match) {
				try {
					var decoded_5 = JSON_parse(base64_decode(match[1]));
					var encoded = base64_encode(JSON_stringify({
						bucket: decoded_5["bucket"], // armadafuga
						key: decoded_5["key"]
					}));
					newsrc = src.replace(/\/eyJid.*/, "/" + encoded);
					if (newsrc !== src) {
						return {
							url: src.replace(/\/eyJid.*/, "/" + encoded),
							filename: decoded_5["key"]
						};
					} else {
						return src.replace(/\/eyJid.*/, "/" + decoded_5["key"]);
					}
				} catch (e) {
					console_error(e);
				}
			}
		}
		if (domain === "ac.namu.la" ||
			domain === "ac-p.namu.la") {
			newsrc = src.replace(/:\/\/ac\./, "://ac-p.");
			if (newsrc !== src)
				return {
					url: newsrc,
					headers: {
						Referer: "https://arca.live/"
					}
				};
			if (/:\/\/ac-p\./.test(src))
				return {
					url: add_queries(src, { type: "orig" }),
					headers: {
						Referer: "https://arca.live/"
					}
				};
		}
		if (domain_nosub === "focus.bg" && /^cdn[0-9]*\./.test(domain)) {
			return src.replace(/(\/[0-9a-f]{2}\/+)(?:pics|large)\/+/, "$1original/");
		}
		if (domain === "lovestories.xcdn.nl") return src.replace(/(:\/\/[^/]+\/+)[^/]+\/+[^/]+\/+(catalog\/+product\/)/, "$1-/-/$2");
		if (domain_nosub === "kkmh.com" && /^tn[0-9]*-f[0-9]*\./.test(domain)) {
			return src.replace(/(\/image\/+[0-9]+\/+[^/.?#]+\.[a-z]+)-[^/]+(?:[?#].*)?$/, "$1");
		}
		if (domain_nowww === "tweakers.net") {
			match = src.match(/(\/i\/+[0-9]+\.[a-z]+)(?:[?#].*)?$/);
			if (match) {
				return "https://tweakers.net/ext" + match[1];
			}
		}
		if (domain_nowww === "dilvin.com.tr" ||
			domain === "kvyfm6d9dll6.merlincdn.net") {
			return src.replace(/(\/productimages\/+[0-9]+\/+)[a-z]+\/+/, "$1original/");
		}
		if (domain_nowww === "evbazaaravm.com") return src.replace(/(\/assets\/+images\/+products\/+)thumb\/+/, "$1large/");
		if (domain === "ffo3gv1cf3ir.merlincdn.net") {
			return {
				url: src.replace(/(\/SiteAssets\/.*\/crop\/+cg\/+[^/]+\/+[0-9]+-[0-9]+)\/+[^/.]+(\.[a-z]+)(?:[?#].*)?$/, "$1$2"),
				head_wrong_contenttype: true // text/html
			};
		}
		if (domain === "qpzgjzffeg4d.merlincdn.net") return src.replace(/(\/i\/+)[sm](\/+[0-9]+\/+)/, "$1l$2");
		if (domain === "images.gamebanana.com") return src.replace(/(\/img\/+ss\/+[^/]+\/+)[0-9]+-[0-9]+_([0-9a-f]+\.)/, "$1$2");
		if (host_domain_nowww === "sfmoma.org" && options.element) {
			if (options.element.tagName === "CANVAS" && options.element.matches("#artworkimage > .openseadragon-container .openseadragon-canvas > canvas")) {
				var parent_6 = common_functions["get_parent_el_matching"](options.element, function(x) { return x.matches("#artworkimage"); });
				if (parent_6) {
					var imgel = parent_6.querySelector("img.artworksingleimage-image");
					if (imgel)
						return imgel.src;
				}
			}
		}
		if (domain_nowww === "sexkontakt.net") {
			return src
				.replace(/\.webp(?:[?#].*)?$/, ".jpg")
				.replace(/(\/pictures\/+)360\/+/, "$11920/");
		}
		if (domain_nowww === "kika.de") return src.replace(/(-resimage_v-[a-z0-9]+)_w-[0-9]+\./, "$1.");
		if (domain === "embed-ssl.wistia.com") {
			return {
				url: src.replace(/(\/deliveries\/+[0-9a-f]+\.[a-z]+)[?#].*/, "$1"),
				head_wrong_contenttype: true
			};
		}
		if (domain === "fast.wistia.net") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+embed\/+iframe\/+([a-z0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://fast.wistia.net/embed/iframe/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/iframeInit\(({.*}),\s*{}\);/);
					if (!match) {
						console_error(cache_key, "Unable to find match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					var urls = [];
					var thumbnail = null;
					var captions = [];
					for (var _i = 0, _a = json.captions; _i < _a.length; _i++) {
						var caption_1 = _a[_i];
						if (caption_1.language) {
							captions.push({
								url: "https://fast.wistia.net/embed/captions/" + json.hashedId + ".vtt?language=" + caption_1.language,
								language_code: caption_1.language,
								mime: "text/vtt"
							});
						}
					}
					for (var _b = 0, _c = json.assets; _b < _c.length; _b++) {
						var asset = _c[_b];
						if (asset.type === "original") {
							urls.push({
								url: asset.url,
								video: true,
								subtitles: deepcopy(captions)
							});
						} else if (asset.type === "still_image" && !thumbnail) {
							thumbnail = asset.url;
						}
					}
					urls.push({
						url: "https://fast.wistia.com/embed/medias/" + json.hashedId + ".m3u8",
						video: "hls"
					});
					if (thumbnail)
						urls.push(thumbnail);
					return done(urls, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "jamanetwork.com" && options.element) {
			if (options.element.tagName === "IMG" && options.element.parentElement && options.element.parentElement.tagName === "A" &&
				options.element.parentElement.getAttribute("path-from-xml") === options.element.getAttribute("path-from-xml")) {
				return options.element.parentElement.href;
			}
		}
		if (domain === "media.radaronline.com") {
			return {
				url: src.replace(/(\/brand-img\/+[^/]+\/+)[0-9]+x[0-9]+\/+/, "$10x0/"),
				can_head: false // 403
			};
		}
		if (domain_nowww === "hakes.com") return src.replace(/\/Image\/+LowRes\/+/, "/Image/HighRes/");
		if (domain_nosub === "imgporn.xyz" && /^ip[0-9]*\./.test(domain)) {
			match = src.match(/\/cache\/+plugins\/+imageviewer\/+([0-9]+)\/+([0-9a-f]{30,})\/+/);
			if (match) {
				return {
					url: "https://" + domain_nosub + "/page/direct_download.php?fileId=" + match[1] + "&fileHash=" + match[2],
					headers: {
						Referer: "https://" + domain_nosub + "/"
					}
				};
			}
			match = src.match(/:\/\/[^/]+\/+thumb\/+([0-9A-Za-z]+)\/+/);
			if (match) {
				return {
					url: "https://imgporn.xyz/" + match[1] + "/",
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "imgporn.xyz" && options.do_request && options.cb) {
			if (!/\/(?:page|browse)\//.test(src)) {
				newsrc = website_query({
					website_regex: /^[a-z]+:\/\/[^/]+\/+([0-9A-Za-z]+)\/+[^/]*(?:[?#].*)?$/,
					query_for_id: "https://imgporn.xyz/${id}/",
					process: function(done, resp, cache_key) {
						return done(get_meta(resp.responseText, "og:image"), 60 * 60);
					}
				});
				if (newsrc)
					return newsrc;
			}
		}
		if (domain === "d3ltyosstobbfh.cloudfront.net") return src.replace(/(\/202[0-9]+_[^/]+\/+[0-9]+_[0-9a-f]+)_thumb\./, "$1.");
		if (domain === "cdn.drouot.com") return src.replace(/(\/d\/+image\/+[a-z]+\?(?:.*&)?size=)[^&#]+([&#].*)?$/, "$1src$2");
		if (domain === "aws-br-pic.kwai.net" ||
			domain === "ak-br-pic.kwai.net" ||
			domain === "tx-br-pic.kwai.net") {
			match = src.match(/\/kimg\/+([^/.?#]{30,})\./);
			if (match) {
				try {
					var decoded_6 = base64_decode(match[1]);
					var newstr = null;
					for (var i_14 = 1; i_14 < decoded_6.length; i_14++) {
						if (decoded_6[i_14] === "u" && decoded_6.charCodeAt(i_14 - 1) === 1) {
							newstr = decoded_6.substr(i_14);
							if (/^upic\//.test(newstr))
								break;
							newstr = null;
						}
					}
					return "https://" + domain + "/" + newstr;
				} catch (e) {
					console_error(e);
				}
			}
		}
		if (domain_nowww === "kwai.com") {
			var query_kwai_1 = function(id, cb) {
				var cache_key = "kwai:" + id;
				api_query(cache_key, {
					url: "https://www.kwai.com/rest/o/w/pwa/photo/get",
					headers: {
						Accept: "application/json, text/plain, */*",
						"Cache-Control": "no-cache",
						"Content-Type": "application/json",
						Origin: "https://www.kwai.com",
						Pragma: "no-cache",
						Referer: "https://www.kwai.com/",
						"Sec-Fetch-Dest": "empty",
						"Sec-Fetch-Mode": "cors",
						"Sec-Fetch-Site": "same-site"
					},
					imu_mode: "xhr",
					method: "POST",
					data: '{"photoId":"' + id + '"}',
					json: true
				}, cb, function(done, resp, cache_key) {
					if (!resp || !resp.feeds || !resp.feeds[0]) {
						console_error(cache_key, "Unable to query", id, resp);
						return done(null, false);
					}
					var feed = resp.feeds[0];
					var extra = {
						created_date: feed.timestamp,
						author_username: feed.kwai_id,
						id: feed.photo_id_str,
						caption: feed.caption
					};
					var urls = [];
					if (feed.main_mv_urls_rate) {
						feed.main_mv_urls_rate.sort(function(a, b) {
							return b.rate - a.rate;
						});
						var biggest = feed.main_mv_urls_rate[0];
						var codec = null;
						if (/_265$/.test(biggest.level)) {
							codec = "hevc";
						}
						urls.push({
							url: biggest.urls[0].url,
							media_info: {
								type: "video",
								codec: codec
							}
						});
					}
					if (feed.main_mv_urls) {
						urls.push({
							url: feed.main_mv_urls[0].url,
							video: true
						});
					}
					if (feed.cover_thumbnail_urls) {
						urls.push(feed.cover_thumbnail_urls[0].url);
					}
					return done(fillobj_urls(urls, { extra: extra }), 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+@[^/]+\/+video\/+([0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					query_kwai_1(match[1], cb);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "kwai.com" && options.element) {
			if (options.element.tagName === "IMG" && options.element.parentElement && options.element.parentElement.tagName === "A" &&
				options.element.parentElement.href && /^[a-z]+:\/\/[^/]+\/+@[^/]+\/+video\/+[0-9]+/.test(options.element.parentElement.href)) {
				return {
					url: options.element.parentElement.href,
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "minecraft.wiki") return src.replace(/(\/images\/+)thumb\/+([^/]+)\/+[^/]+(?:[?#].*)?$/, "$1$2");
		if (domain_nowww === "musik-sammler.de") return src.replace(/(\/cover\/+[0-9]+\/+[0-9]+_[0-9]+)_[0-9]+\./, "$1.");
		if (domain === "cdn.cimri.io") {
			return {
				url: src.replace(/(\/image\/+)[0-9]+x[0-9]+\/+/, "$10x0/"),
				head_wrong_contenttype: true
			};
		}
		if (domain_nowww === "rssso.com") {
			newsrc = src.replace(/^.*?\/Files\/+SrcImg\/+\?(?:.*&)?url=(.*)/i, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "guforecords.com") return src.replace(/(\/imgApp\/+)thumbs\/+([0-9]+)_[0-9]+x[0-9]+\./, "$1$2.");
		if (domain === "cdn.kdkw.jp") return src.replace(/\/cover_(?:b|500)\/+/, "/cover_1000/");
		if (domain === "phantom-elmundo.unidadeditorial.es") return src.replace(/:\/\/phantom-([^/.]+)\.[^/]+\/+[0-9a-f]{10,}\/+.*?\/(assets\/+multimedia\/+)/, "://e00-$1.uecdn.es/$2");
		if (domain_nosub === "youla.io") return src.replace(/(\/files\/+images\/+)[0-9]+_[0-9]+(?:_[^/]+)?\/+((?:[0-9a-f]{2}\/+){2}[0-9a-f]{10,})/, "$1orig/$2");
		if (domain === "i.hinnavaatlus.ee") return src.replace(/(\/p\/+)[0-9]+(?:x[0-9]+[a-z])?\/+/, "$1full/");
		if (domain_nosub === "avito.st" && /^[0-9]+\.img\./.test(domain)) {
			return src.replace(/\/(?:432x324|640x480)\/+/, "/1280x960/");
		}
		if (domain_nowww === "ugra.ru") return src.replace(/^[a-z]+:\/\/[^/]+\/+pics-([0-9]+\.img\.avito\.st\/)/, "https://$1");
		if (domain_nowww === "xanimu.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+([0-9]+-[^/]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://xanimu.com/${id}",
				process: function(done, resp, cache_key) {
					var urls = [];
					var baseobj = {
						extra: {}
					};
					var match = resp.responseText.match(/<script type="application\/ld\+json" class="yoast-schema-graph">({.*?})<\/script>/);
					if (match) {
						var json_5 = JSON_parse(match[1]);
						for (var _i = 0, _a = json_5["@graph"]; _i < _a.length; _i++) {
							var graph = _a[_i];
							if (graph["@type"] !== "Article")
								continue;
							baseobj.extra.caption = decode_entities(graph.headline);
							baseobj.extra.created_date = new Date(graph.datePublished).getTime();
							baseobj.extra.updated_date = new Date(graph.dateModified).getTime();
							baseobj.extra.page = resp.finalUrl;
							break;
						}
					}
					match = resp.responseText.match(/var videoHigh\s*=\s*"([^"]+)";/);
					if (match) {
						urls.push({
							url: match[1],
							video: true
						});
					}
					match = resp.responseText.match(/var videoLow\s*=\s*"([^"]+)";/);
					if (match) {
						urls.push({
							url: match[1],
							video: true
						});
					}
					match = resp.responseText.match(/var poster\s*=\s*"([^"]+)";/);
					if (match) {
						urls.push(match[1]);
					}
					return done(fillobj_urls(urls, baseobj), 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "pornkai.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+view\?(?:.*&)?key=([a-z]{2}[0-9a-z]+)(?:[?&].*)?$/,
				run: function(cb, match, cache_key) {
					var submatch = match[1].match(/^(ph|xv|xh)([0-9a-z]+)$/);
					if (!submatch) {
						console_error(cache_key, "Unhandled video ID:", match[1]);
						return cb(null);
					}
					if (submatch[1] === "xv") {
						return cb({
							url: "https://www.xvideos.com/embedframe/" + submatch[2],
							is_pagelink: true
						});
					} else if (submatch[1] === "ph") {
						return cb({
							url: "https://www.pornhub.com/view_video.php?viewkey=" + match[1],
							is_pagelink: true
						});
					} else if (submatch[1] === "xh") {
						return cb({
							url: "https://www.xhamster.com/videos/" + match[1],
							is_pagelink: true
						});
					}
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "cdn.bsky.app") return src.replace(/(\/img\/+)feed_thumbnail\/+/, "$1feed_fullsize/");
		if (domain_nosub === "24chasa.bg" && /^cache[0-9]*\./.test(domain)) {
			return src.replace(/(\/Images\/+Cache\/+[0-9]+\/+Image_[0-9]+_)[0-9]+_[0-9]+\./, "$10_0.");
		}
		if (domain === "images.livemint.com") return src.replace(/(\/img\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+)[0-9]+x[0-9]+\/+([^/.?#]+?_[0-9]{13})(?:_[0-9]{13}){1,}\./, "$1original/$2.");
		if (domain_nowww === "livemint.com") return src.replace(/:\/\/[^/]+\/+lm-img\/+img\//, "://images.livemint.com/img/");
		if (domain === "i.jauns.lv") return src.replace(/\/t\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9]+)\/+[0-9]+x[0-9]+\./, "/o/$1.");
		if (domain === "static.kinorium.com") {
			if (/\/img\/+blank100\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain === "images.kinorium.com" ||
			domain === "images-s.kinorium.com" ||
			domain === "en-images.kinorium.com") {
			return src
				.replace(/(\/(?:movie|persona)\/+)(?:300|1080)\/+([0-9]+\.)/, "$1original/$2")
				.replace(/(\/movie\/+[^/]+\/+[0-9]+\/+)w1500?_/, "$1original_")
				.replace(/(\/movie\/+[^/]+\/+[0-9]+\/+)h280_/, "$1w1500_");
		}
		if (domain === "images.eil.com") {
			return src
				.replace(/(\/product-size-custom\/+[0-9]+\.[a-z]+)(?:[?#].*)?$/, "$1")
				.replace(/\/large_image\/+[^/]+-([0-9]+\.[a-z]+)(?:[?#].*)?$/, "/product-size-custom/$1");
		}
		if (domain_nowww === "trunkarchive.com") {
			if (/\/ClientFiles\/+COR\/+Images\/+transparent_pixel\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "executivespeakers.com") return src.replace(/(\/images\/+.*)-cropped\./, "$1.");
		if (domain_nowww === "julienslive.com") return src.replace(/(\/images\/+(?:lot\/+[0-9]+|auction)\/+[0-9]+)_[sml]\./, "$1_xl.");
		if (domain === "st.violity.com") return src.replace(/(\/auction\/+)(?:small|view)(\/+auctions\/+)/, "$1big$2");
		if (domain === "media.springernature.com" ||
			domain === "media.nature.com" ||
			domain === "images.nature.com") {
			return remove_queries(src.replace(/(:\/\/[^/]+\/+)(?:l?w[0-9]+|w[0-9]+h[0-9]+)\//, "$1full/"), ["as"]);
		}
		if (domain_nowww === "openverse.org") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+image\/+([-0-9a-f]{20,})(?:[?#].*)?$/,
				query_for_id: {
					url: "https://api.openverse.engineering/v1/images/${id}/",
					imu_mode: "xhr",
					json: true
				},
				process: function(done, resp, cache_key) {
					return done(resp.url, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "api.openverse.engineering") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+v1\/+images\/+([-0-9a-f]{20,})\/+thumb\/+(?:[?#].*)?$/);
			if (match) {
				return {
					url: "https://openverse.org/image/" + match[1],
					is_pagelink: true
				};
			}
		}
		if (domain_nowww === "zzup.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+viewimage\/+(.*?\.html)(?:[?#].*)?$/,
				query_for_id: "https://zzup.com/viewimage/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<img src="(\/[^/]+\/+showimage\/+[^"]+)"/);
					if (!match) {
						console_error(cache_key, "Unable to find img match for", resp);
						return done(null, false);
					}
					return done(urljoin(resp.finalUrl, match[1], true), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "thumb.zzup.com") {
			match = src.match(/:\/\/[^/]+\/+[^/]+\/+image0*([0-9]+)-[0-9]+-([0-9]+)-[0-9]+\/+([^/]+)\/+/);
			if (match) {
				return {
					url: "https://zzup.com/viewimage/a/" + match[3] + "/a/image-" + match[1] + "-pics-1-mirror-" + match[2] + ".html",
					is_pagelink: true
				};
			}
		}
		if (domain === "shftr.adnxs.net") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+r\?(?:.*&)?url=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "images.mediago.io") return src.replace(/(\/[0-9a-f]{10,})__[^/.?#]+\./, "$1.");
		if (domain === "images.wolfgangsvault.com") {
			return src
				.replace(/(\/images\/+catalog\/+)thumb\/+/, "$1detail/")
				.replace(/(:\/\/[^/]+\/+m\/+)(?:small|medium|large)\/+/, "$1xlarge/");
		}
		if (domain === "images.collection.cooperhewitt.org") return src.replace(/^([a-z]+:\/\/[^/]+\/+[0-9]+_[0-9a-f]{10,}_)[bnz]\./, "$1k.");
		if (domain_nowww === "foto-kurier.pl") return src.replace(/(\/users\/+galleries\/+[0-9a-f]{20,})(?:_(?:280|m))?(\.)/, "$1_p$2");
		if (domain === "media.c5n.com") return src.replace(/\/p\/+[0-9a-f]{20,}\/+(adjuntos\/+[0-9]+\/+imagenes\/+[0-9]{3}\/+[0-9]{3}\/+[0-9]+)\/.*?(\.[a-z]+)(?:[?#].*)?$/, "/$1$2");
		if (domain_nosub === "hket.com" && /^static[0-9]*\./.test(domain)) {
			return src.replace(/(\/res\/+v3\/+image\/+content\/+[0-9]+\/+[0-9]+\/+[^/]+)_1024\./, "$1_1200.");
		}
		if (domain === "cdn.80.lv") return src.replace(/(\/api\/+upload\/+[a-z]+\/+[0-9a-f]+\/+)images\/+([0-9a-f]{10,})\/+[^/.]+(\.[a-z]+)(?:[?#].*)?$/, "$1$2$3");
		if (domain === "assets.exploreedmonton.com") return src.replace(/(\/images\/+feature\/+)_[0-9]+x[0-9]+_[^/]+\/+/, "$1");
		if (domain_nowww === "barrisol.com") return src.replace(/(\/exception\/+[0-9]+\/+)medium\/+/, "$1");
		if (domain_nowww === "singulart.com") {
			match = src.match(/\/images-sh\/+(eyJ[^/?#.]+)/);
			if (match) {
				var json_6 = JSON_parse(base64_decode(match[1]));
				return "https://" + json_6.bucket + ".s3.amazonaws.com/" + json_6.key.replace(/\/+/, "/");
			}
		}
		if (domain_nowww === "allinks.me") return src.replace(/(\/storage\/+logos\/+[0-9a-f]+)_small\./, "$1.");
		if (domain_nowww === "imagedelivery.net") {
			var cf_original_map = {
				"QondspN4HIUvB_R16-ddAQ": "original"
			};
			match = src.match(/^[a-z]+:\/\/[^/]+\/+([^/]+)\/+/);
			if (match) {
				if (match[1] in cf_original_map) {
					return src.replace(/^([a-z]+:\/\/[^/]+\/+[^/]+\/+.*\/)[^/]*(?:[?#].*)?$/, "$1" + cf_original_map[match[1]]);
				}
			}
			return src.replace(/^([a-z]+:\/\/[^/]+\/+[^/]+\/+.*\/)[^/]*(?:[?#].*)?$/, "$1w=9999999");
		}
		if (domain_nosub === "appmifile.com" && /^i[0-9]*\./.test(domain)) {
			return {
				url: src.replace(/(\/[^/?#!]+)(?:[!][^/.?#]+)+\./, "$1."),
				can_head: false // 403
			};
		}
		if (domain === "d2qu5xmcgmzxnb.cloudfront.net") {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+(ewog[^/?#]+)(?:[?#].*)?$/);
			if (match) {
				var parsed_6 = JSON_parse(base64_decode(match[1]));
				return "http://" + parsed_6.bucket + "/" + parsed_6.key;
			}
		}
		if (domain === "kuvat.huuto.net") return src.replace(/(\/[0-9]+)-[ms](\.[^/.]+)(?:[?#].*)?$/, "$1-orig$2");
		if (domain_nosub === "awork.com") {
			match = src.match(/\/api\/v1\/files\/[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\/download\?/);
			if (match) {
				return remove_queries(src, ["width", "height"]);
			}
		}
		if (domain_nowww === "thetv.jp") {
			if (/\/assets\/+v3\/+img\/+lemon_quarter\./.test(src))
				return {
					url: src,
					bad: "mask"
				};
			return src.replace(/(\/i\/+nw\/+[0-9]+\/+[0-9]+\.[a-z]+)(?:[?#].*)?$/, "$1?w=99999");
		}
		if (domain_nowww === "svbtleusercontent.com") return src.replace(/(:\/\/[^/]+\/+[^/.?#_]+)_small\./, "$1.");
		if (domain_nowww === "kinopavasaris.lt") return src.replace(/\/[0-9Auto]+x[0-9Auto]+\/+[0-9Auto]+x[0-9Auto]+_/, "/");
		if (domain === "thumbnails.yayimages.com") return src.replace(/(:\/\/[^/]+\/+)(?:1600\/+)?([0-9a-f]+\/+[0-9a-f]{3}\/+[^/]+\.)/, "$1neutral/$2");
		if (domain === "media-cloud.corcoranlabs.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+/, "/");
			if (newsrc !== src) {
				return urljoin(src, "/" + common_functions["get_thumbor_url"](newsrc), true);
			}
		}
		if (domain === "e.khoahoc.tv") {
			return src
				.replace(/(\/photos\/+image\/+[0-9]{4}\/+(?:[0-9]{1,2}\/+){2}[^/]+)-200\./, "$1.")
				.replace(/(\/photos\/+image\/+[0-9]{4}\/+(?:[0-9]{1,2}\/+){2}[^/]+)-size-[0-9]+x[0-9]+-[a-z]+\./, "$1.");
		}
		if (domain === "manhua.acimg.cn") {
			return {
				url: src.replace(/(\/(?:vertical|horizontal)\/.*\/)[0-9]+(?:[?#].*)?$/, "$10"),
				headers: {
					Referer: ""
				}
			};
		}
		if (domain_nowww === "mvd.cloud") return src.replace(/(:\/\/[^/]+\/+)images\/+/, "$1300dpi/");
		if (domain === "content-jp.umgi.net") return src.replace(/(\/products\/+ui\/+[^/.?#]+)_(?:large|extralarge)\./, "$1.");
		if (domain === "cdn.passes.com") return src.replace(/(\/profile\/+media\/+[-0-9a-f]{10,}\/+profile)-thumbnail\./, "$1-image.");
		if (domain_nowww === "weaudition.com") return src.replace(/(\/upload\/+userprofiles\/+)thumbnail\/+/, "$1");
		if (domain === "cdn.administrace.tv") return src.replace(/(\/[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+)[^/]+\/+([0-9a-f]{10,}\.)/, "$1$2");
		if (domain === "catalogo.biblio.unc.edu.ar") {
			if (/\/Cover\/+Show\?/i.test(src)) {
				return src.replace(/([?&]size=)(?:small|medium)([&#].*)?$/, "$1large$2");
			}
		}
		if (domain === "im.autopilot.ru") {
			newsrc = src.replace(/(:\/\/[^/]+\/+Issues\.photo\/+[^/]+\/+[0-9]{4}\/+[^/]+\/+[^/]+_t)2(?:[0-3][0-9]|[45]0)(_[0-9]+\.)/, "$1241$2");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\.webp(?:[?#].*)?$/, ".jpg");
		}
		if (amazon_container === "fesapp-bucket") {
			match = src.match(/\/article_images\/+image\/+([0-9]+)\/+width:/);
			if (match) {
				common_functions["get_redirect_url"](api_cache, options, "https://api.fesapp.jp/images/article/" + match[1] + "/default", options.cb);
				return {
					waiting: true
				};
			}
		}
		if (domain_nowww === "imgtraffic.com") return src.replace(/(\/[0-9]+)s\/+([0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9a-f]+\.)/, "$1/$2");
		if (domain === "s.movieinsider.com") return src.replace(/(\/images\/+p\/+)[0-9]+\/+/, "$1");
		if (domain_nosub === "filmfreeway.com") {
			newsrc = src.replace(/(\/(?:[0-9]{3}\/+){3}[0-9a-f]{10,}\/+)thumb\/+/, "$1original/");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "8muses.io") return src.replace(/(\/img\/+data\/+)th_([0-9]+\.)/, "$1full_$2");
		if (domain === "img.vivantiscdn.net") return src.replace(/\/photos\/+w[0-9N]+_h[0-9N]+_f[^/]+\/+/, "/photos/");
		if (domain === "static.eldorado.ru") return src.replace(/(\/img[0-9]+\/+[0-9a-f]\/+[0-9a-f]{3}\/+[0-9]+\.[a-z]+)\/+.*/, "$1");
		if (domain === "g.pggcdn.net") return src.replace(/(\/product\/+[0-9]+\/+)w[0-9]+\/+/, "$1");
		if (domain_nowww === "holod.ru") return src.replace(/(\/pics\/+[^/]+\/+)(?:[0-9]+x[0-9]+|medium)\/+/, "$1big/");
		if (domain === "shopgoodwillimages.azureedge.net") return src.replace(/(\/production\/+[0-9]+\/+Items\/+[0-9]{1,2}-[0-9]{1,2}-[0-9]{4}\/+[-0-9a-f]{10,}[^/.?#]+_[0-9]+)t([0-9]+)\.jpeg(?:[?#].*)?$/, "$1$2.png");
		if (domain_nosub === "photoblog.pl" && /^f[0-9]*\./.test(domain)) {
			return src.replace(/\/w[0-9]+\/+(fbl-[0-9]+\/+[0-9]+\/+[0-9]+)(?:\/+[^/?#]+)?(\.[^/?#]+)(?:[?#].*)?$/, "/$1$2");
		}
		if (domain === "catalog.shm.ru" && options && options.do_request && options.cb) {
			var query_shm_info = function(id, cb) {
				api_query("shm_info:" + id, {
					url: "https://catalog.shm.ru/api/spf/" + id + ".json",
					imu_mode: "xhr",
					json: true
				}, cb, function(done, resp, cache_key) {
					if (!resp) {
						console_error(cache_key, "Unable to get info from", resp);
						return done(null, false);
					}
					done({
						width: resp.width,
						height: resp.height
					}, 6 * 60 * 60);
				});
			};
			match = src.match(/\/api\/+spf\/+([^/.?#]+)\.[a-z]+(?:[?#].*)?$/);
			if (match) {
				query_shm_info(match[1], function(info) {
					if (!info)
						return options.cb(null);
					return options.cb("https://catalog.shm.ru/api/spf/" + match[1] + ".jpg?w=" + info.width + "&h=" + info.height);
				});
				return {
					waiting: true
				};
			}
		}
		if (domain === "main-cdn.sbermegamarket.ru") return src.replace(/(:\/\/[^/]+\/+)(?:mid|big)[0-9]*\/+(hlr-system\/+)/, "$1$2");
		if (domain === "cdn.create.vista.com") {
			return src
				.replace(/(\/api\/+media\/+)small\/+/, "$1medium/")
				.replace(/(\/downloads\/+[-0-9a-f]{10,})_[0-9]+\./, "$1.");
		}
		if (domain === "image.alza.cz") {
			return {
				url: src.replace(/\?.*/, ""),
				headers: {
					Referer: "https://www.alza.cz/"
				}
			};
		}
		if (domain_nowww === "pornhoarder.pictures") return src.replace(/\/img\/+small\/+/, "/img/large/");
		if (domain_nowww === "pornhoarder.net") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+player\.php\?(?:.*&)?video=([^&]+)(?:[?&].*)?$/,
				query_for_id: function(id) {
					var url = "https://pornhoarder.net/player.php?video=" + id;
					return {
						url: url,
						method: "POST",
						data: "play=",
						headers: {
							Referer: url,
							"Sec-Fetch-Dest": "document",
							"Sec-Fetch-Mode": "navigate",
							"Sec-Fetch-Site": "same-origin",
							"Content-Type": "application/x-www-form-urlencoded"
						}
					};
				},
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<iframe src="(https?:\/\/[^"]+)".*?allowfullscreen/);
					if (!match) {
						console_error(cache_key, "Unable to find iframe match for", resp);
						return done(null, false);
					}
					return done({
						url: decode_entities(match[1]),
						is_pagelink: true
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nosub === "pornhoarder.tv") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+[^/]+\/+([^/.?#]{10,})(?:[?#].*)?$/,
				query_for_id: "https://" + domain + "/video/a-a/${id}",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/<iframe src="(https?:\/\/[^"]+)".*?allowfullscreen/);
					if (!match) {
						console_error(cache_key, "Unable to find iframe match for", resp);
						return done(null, false);
					}
					return done({
						url: decode_entities(match[1]),
						is_pagelink: true
					}, 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "media.posterlounge.com") {
			return src
				.replace(/(\/img\/+products\/+[0-9]+\/+[0-9]+\/+[0-9]+)_poster\./, "$1.")
				.replace(/(\/img\/+products\/+[0-9]+\/+[0-9]+\/+[0-9]+_poster(?:_(?:room_movies|pds))?)(?:_[ml])\./, "$1.");
		}
		if (domain_nowww === "fapopedia.net") return src.replace(/(\/photos\/+.\/+.\/+[^/]+\/+[0-9]+\/+)t_/, "$1");
		if (domain_nowww === "archived.moe") {
			var archive_map = {
				"b": "thebarchive",
				"bant": "thebarchive",
				"cm": "fireden",
				"h": "archiveofsins",
				"hc": "archiveofsins",
				"hm": "archiveofsins",
				"i": "archiveofsins",
				"lgbt": "archiveofsins",
				"r": "archiveofsins",
				"s": "archiveofsins",
				"soc": "archiveofsins",
				"t": "archiveofsins",
				"u": "archiveofsins",
				"y": "fireden"
			};
			match = src.match(/\/files\/+([^/]+)\/+thumb\/+[0-9]+\/+[0-9]+\/+([0-9]+)s\./);
			if (match) {
				var board = match[1];
				var picid = match[2];
				var picid_4 = picid.match(/^([0-9]{4})/)[1];
				var picid_2 = picid.match(/^[0-9]{4}([0-9]{2})/)[1];
				var urls_4 = [];
				if (board in archive_map) {
					var provider = archive_map[board];
					if (provider === "thebarchive") {
						urls_4.push("https://thebarchive.com/data/" + board + "/thumb/" + picid_4 + "/" + picid_2 + "/" + picid + "s.jpg");
					} else if (provider === "fireden") {
						urls_4.push("https://img-lb.fireden.net/" + board + "/thumb/" + picid_4 + "/" + picid_2 + "/" + picid + "s.jpg");
					} else if (provider === "archiveofsins") {
						urls_4.push("https://archiveofsins.com/data/" + board + "/thumb/" + picid_4 + "/" + picid_2 + "/" + picid + "s.jpg");
					}
				}
				urls_4.push("https://i.4cdn.org/" + board + "/" + picid + "s.jpg");
				return urls_4;
			}
		}
		if (domain_nowww === "masterfap.net") {
			newsrc = src.replace(/(\/photos\/+[^/]+\/+[^/]+)-thumbnail\./, "$1.");
			if (newsrc) {
				return {
					url: newsrc,
					problems: {
						watermark: true
					}
				};
			}
		}
		if (amazon_container === "iibawards-prod") {
			return src.replace(/(\/images\/+(?:[0-9]{3}\/+){3})[a-z]+\./, "$1original.");
		}
		if (domain === "shop.miniscience.com") return src.replace(/(\/images\/+)medium\/+/, "$1large/");
		if (domain_nosub === "svdcdn.com" && /\.transforms\./.test(domain)) {
			return src.replace(/(:\/\/[^/]+)\.transforms(\.svdcdn\.com\/+[^?#].*?)(?:[?#].*)?$/, "$1.files$2");
		}
		if (domain === "images.vs-static.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+/, "/");
			if (newsrc !== src) {
				return "https://static.voguescandinavia.com/" + common_functions["get_thumbor_url"](newsrc);
			}
		}
		if (domain_nosub === "bitchesgirls.com" && /^cdn[0-9]*\./.test(domain)) {
			newsrc = src.replace(/(\/file\/+[^/]+\/+[^/]+)_thumbnail\./, "$1.");
			if (newsrc !== src)
				return add_full_extensions(newsrc, ["mp4", "jpg"]);
		}
		if (domain_nowww === "trenton.com.au") return src.replace(/(\/product-images\/+.*\/image-thumb__[0-9]+__)[^/]+\//, "$1trentonProductImagesFull/");
		if (host_domain_nowww === "directfromlourdes.com" && options.element) {
			if (options.element.tagName === "DIV" && options.element.classList.contains("mousetrap")) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain === "img.ridicdn.net") return src.replace(/(\/cover\/+[0-9]+)(?:\/.*)?(?:[?#].*)?$/, "$1/xxlarge?dpi=xxxhdpi&format=png");
		if (domain === "i.crepe.land") {
			newsrc = src.replace(/\?.*/, "?t=i");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/^[a-z]+:\/\/[^/]+\/+(https?:\/\/.*?)(?:[?#].*)?$/, "$1");
		}
		if (domain === "imaging.broadway.com") return src.replace(/(\/images\/+)[^/]+\/+[^/]+\/+([0-9]+-[0-9]+\.)/, "$1custom/$2");
		if (domain === "cdn.kobo.com") {
			return src.replace(/(\/book-images\/+[-0-9a-f]{10,}\/+)[0-9]+\/+[0-9]+\/+[0-9]+\/+(?:true|false)\/+/i, "$1");
		}
		if (domain_nowww === "gofile.io" && options.do_request && options.cb) {
			var get_gofile_website_token_1 = function(cb) {
				var cache_key = "gofile_website_token";
				api_query(cache_key, {
					url: "https://gofile.io/dist/js/alljs.js"
				}, cb, function(done, resp, cache_key) {
					var match = resp.responseText.match(/websiteToken\s*=\s*"([0-9a-z]{5,})"/);
					if (!match) {
						console_error(cache_key, "Unable to find websiteToken match for", resp);
						return done(null, false);
					}
					return done(match[1], 6 * 60 * 60);
				});
			};
			var get_gofile_token_1 = function(cb) {
				if (!options.get_cookies) {
					console_error("No cookie support");
					return cb(null);
				}
				options.get_cookies("https://www.gofile.io/", function(cookies) {
					if (!cookies) {
						console_error("Unable to get cookies for gofile");
						return cb(null);
					}
					cookies = headers_list_to_dict(cookies);
					if (!("accounttoken" in cookies)) {
						console_error("accountToken doesn't exist, try visiting gofile.io");
						return cb(null);
					}
					cb(cookies["accounttoken"] || null);
				});
			};
			var query_gofile_content_1 = function(id, cb) {
				get_gofile_token_1(function(token) {
					if (!token)
						return cb(null);
					get_gofile_website_token_1(function(websitetoken) {
						if (!websitetoken)
							return cb(null);
						var cache_key = "gofile_content:" + id;
						api_query(id, {
							url: "https://api.gofile.io/getContent?contentId=" + id + "&token=" + token + "&websiteToken=" + websitetoken,
							imu_mode: "xhr",
							headers: {
								Origin: "https://gofile.io"
							},
							json: true
						}, cb, function(done, resp, cache_key) {
							if (!resp) {
								return done(null, false);
							}
							if (resp.status !== "ok" || !resp.data) {
								console_error(cache_key, "Invalid response", resp);
								return done(null, false);
							}
							return done(resp.data, 6 * 60 * 60);
						});
					});
				});
			};
			newsrc = website_query({
				website_regex: /^https:\/\/(?:www\.)?gofile\.io\/+d\/+([^?#]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					query_gofile_content_1(match[1], function(content) {
						if (!content) {
							return cb(null);
						}
						var id = null;
						var queries = common_functions["parse_imu_hash"](src);
						if (queries && queries.id)
							id = queries.id;
						var items = [];
						var chosenitem = null;
						for (var itemid in content.contents) {
							var item = content.contents[itemid];
							var obj_10 = {
								url: item.link,
								headers: {
									Referer: "https://gofile.io/"
								},
								extra: {
									page: "https://gofile.io/d/" + content.code,
									created_date: content.createTime * 1000,
									id: item.id,
									caption: item.name
								},
								filename: item.name
							};
							var mime = item.mimetype || "";
							if (/^video\//.test(mime))
								obj_10.video = true;
							else if (!/^(?:image|audio)\//.test(mime)) {
								console_warn("Skipping", item, "due to mime:", mime);
								continue;
							}
							items.push(obj_10);
							if (itemid === id)
								chosenitem = obj_10;
						}
						if (chosenitem) {
							return cb(chosenitem);
						}
						if (!items.length) {
							console_warn("No items found for", content);
							return cb(null);
						}
						items.sort(function(a, b) {
							return a.filename.localeCompare(b.filename);
						});
						chosenitem = items[0];
						var newobj = {};
						var links = [];
						for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
							var item = items_1[_i];
							var is_current = item == chosenitem;
							var url_6 = "https://gofile.io/d/" + content.code + "#imu-id=" + item.extra.id;
							links.push({
								url: url_6,
								is_current: is_current
							});
							if (is_current)
								newobj.url = url_6;
						}
						if (!newobj.url) {
							console_error("Unable to get URL from", chosenitem, items);
							return cb(null);
						}
						newobj.album_info = {
							type: "links",
							links: links
						};
						cb(newobj);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "gofile.io" && options.element) {
			if (options.element.tagName === "A" && options.element.classList.contains("contentLink")) {
				var contentid_container = common_functions["get_parent_el_matching"](options.element, function(x) { return x.hasAttribute("data-contentid"); });
				if (contentid_container) {
					return {
						url: options.host_url.replace(/\/*(?:[?#].*)?$/, "#imu-id=" + contentid_container.getAttribute("data-contentid")),
						is_pagelink: true
					};
				}
			}
		}
		if (domain === "images.bubbleup.com") return src.replace(/(:\/\/[^/]+\/+)(?:width|quality)[0-9]+\/+/, "$1");
		if (domain_nowww === "lemmy.world" ||
			domain_nowww === "lemmynsfw.com" ||
			domain_nowww === "sopuli.xyz" ||
			domain_nowww === "lemmy.ml") {
			if (/\/pictrs\/+image\/+[-0-9a-f]{10,}\./.test(src)) {
				return {
					url: remove_queries(src, ["thumbnail"]).replace(/([?&])format=webp/, "$1").replace(/[?&]$/, ""),
					head_wrong_contenttype: true,
					head_wrong_contentlength: true
				};
			}
		}
		if (domain_nowww === "cache.pressmailing.net") {
			newsrc = src.replace(/\/thumbnail\/+[^/]+\/+([-0-9a-f]{10,}\/+)/, "/content/$1");
			if (newsrc !== src) {
				return {
					url: newsrc,
					can_head: false
				};
			}
		}
		if (amazon_container === "breakdownservices") {
			return {
				url: src.replace(/(\/media\/+photos\/+[0-9]+\/+[0-9]+\/+)(?:small\/+)?([-0-9A-F]{10,}\.)/, "$1print/$2"),
				head_wrong_contenttype: true
			};
		}
		if (domain === "cdn.youpic.com") {
			return {
				url: src.replace(/(:\/\/[^/]+\/+)(?:large|huge|link)\/+/, "$1full/"),
				head_wrong_contenttype: true
			};
		}
		if (domain_nowww === "youpic.com") return src.replace(/\/y\/+(?:large|huge|link)\/+/, "/y/full/");
		if (domain === "edge.99images.com") return src.replace(/\/md\/+([^/]+)(?:[?#].*)?$/, "/$1");
		if (domain === "akamai.sscdn.co") return src.replace(/(\/uploadfile\/+letras\/+fotos\/.*)-tb[0-9]+\./, "$1.");
		if (domain_nowww === "virtual-history.com") return src.replace(/(\/movie\/+card\/+[0-9]+\/+)thumb\/+([^/]+)(?:[?#].*)?$/, "$1large/$2");
		if (domain_nowww === "kick.com") {
			var query_kick_video_api_1 = function(vidid, cb) {
				var cache_key = "kick_video:" + vidid;
				api_query(cache_key, {
					url: "https://kick.com/api/v1/video/" + vidid,
					imu_mode: "xhr",
					json: true
				}, cb, function(done, resp, cache_key) {
					if (!resp)
						return done(null, false);
					var obj = {
						url: resp.source,
						video: "hls",
						extra: {
							created_date: new Date(resp.livestream.start_time).getTime(),
							page: "https://kick.com/video/" + vidid,
							caption: resp.livestream.session_title
						}
					};
					return done(obj, 6 * 60 * 60);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([-0-9a-f]{10,})(?:[?#].*)?$/,
				run: function(cb, match) {
					query_kick_video_api_1(match[1], cb);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "img.thecollector.io") return src.replace(/(\/f\/+[0-9]+\/+.*?\.[a-z]+)\/+m\/.*/, "$1");
		if (domain === "cdn.verk.net") return src.replace(/\/(?:[whq]|rt|sh):[^/]+\/+(plain\/+images\/)/, "/$1");
		if (domain === "image-cdn.spatialest.com") return src.replace(/(\/image\/+[^/]+\/+)(?:sml|med)\/+/, "$1lrg/");
		if (domain === "api.spatialest.com") {
			if (/\/images-api\?/.test(src)) {
				return keep_queries(src, ["size", "id", "type"], { overwrite: {
						"size": "lrg"
					} });
			}
		}
		if (domain === "images.comico.io") return src.replace(/\/dims\/+[^?#]*([?#].*)?$/, "$1");
		if (domain === "photos.eruce.com") {
			return src
				.replace(/\/thumbs\/+(.*?)_[0-9]+x[0-9]+(\.jpg)(?:[?#].*)?$/, "/$1$2")
				.replace(/\.webp(?:[?#].*)?$/, ".jpg");
		}
		if (domain === "img.rgstatic.com") return src.replace(/(\/content\/+[^/]+\/+[-0-9a-f]{10,}\/+[^/?#.]+-)[0-9]+\./, "$1original.");
		if (domain === "an.arbum.art") {
			return {
				url: src.replace(/\/[ip]\/+([-0-9a-f]{10,}\.[a-z]+)(?:[?#].*)?$/, "/i/$1"),
				headers: {
					Referer: "https://arbum.art"
				},
				can_head: false // 500
			};
		}
		if (domain_nowww === "pastvu.com") return src.replace(/(:\/\/[^/]+\/+_p\/+)[a-z]\/+/, "$1a/");
		if (domain === "img.fotokonkurs.ru") return src.replace(/(\/cache\/+)[^/]+\/+(photos\/+)/, "$1original/$2");
		if (domain === "img.championat.com") return src.replace(/\/[sc]\/+[0-9]+x[0-9]+\/+/, "/");
		if (domain === "img.dni.ru") return src.replace(/(\/binaries\/+)v3_main\//, "$1social/");
		if (domain_nowww === "mylittlewallpaper.com") return src.replace(/(\/images\/+)r[0-9]+_/, "$1o_");
		if (domain_nowww === "sr.de") {
			return {
				url: src.replace(/(\/sr\/+[^/]+100~_v)-sr__[^/.]+\./, "$1."),
				head_wrong_contentlength: true
			};
		}
		if (domain_nowww === "ndr.de") return src.replace(/(_v-)content(?:klein|gross|xl)\./, "$1fullhd.");
		if (domain_nowww === "cdn.mdr.de") return src.replace(/(_v-variant)[^/.]+\./, "$1Big1xN.");
		if (amazon_container === "acmi-website-media-prod") {
			return src.replace(/(\/media\/+)images\/+([^/]+?)(?:\.(?:2e16d0ba|(?:fill|max)-[0-9]+x[0-9]+|width-[0-9]+))+\./, "$1original_images/$2.");
		}
		if (host_domain_nosub === "finalfantasyxiv.com" && options.element) {
			if (options.element.tagName === "IMG" && options.element.hasAttribute("data-original") &&
				options.element.parentElement && options.element.parentElement.tagName === "A" && options.element.parentElement.classList.contains("js__media")) {
				return options.element.parentElement.href;
			}
		}
		if (domain === "sites.wrk.ru" ||
			domain_nowww === "balancer.ru") {
			return src.replace(/^[a-z]+:\/\/[^/]+\/+cache\/+sites\/+.\/+.\/+([^/]+\.[^/]+\/.*?)\/[0-9]+x[0-9]*(?:\([^/]+\)|-[a-z]+)?\/+([^/]+)(?:[?#].*)?$/, "http://$1/$2");
		}
		if (domain_nowww === "bilibili.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+video\/+([A-Za-z0-9]+)\/*(?:[?#].*)?$/,
				query_for_id: "https://www.bilibili.com/video/${id}/",
				process: function(done, resp, cache_key) {
					var match = resp.responseText.match(/__playinfo__\s*=\s*({.*?})<\/script/);
					if (!match) {
						console_error(cache_key, "Unable to find playinfo match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					var dashsource = json.data.dash;
					var dashdata = { mimes: {} };
					var add_source = function(src) {
						var formatdash = {
							url: src.baseUrl,
							width: src.width,
							height: src.height,
							bandwidth: src.bandwidth,
							id: src.id,
							init_range: src.SegmentBase.Initialization,
							index_range: src.SegmentBase.indexRange,
							mime: src.mime_type,
							codecs: src.codecs,
							start_with_sap: src.startWithSap,
							frame_rate: src.frameRate,
							sar: src.sar
						};
						if (!(src.mime_type in dashdata.mimes)) {
							dashdata.mimes[src.mime_type] = [];
						}
						dashdata.mimes[src.mime_type].push(formatdash);
					};
					for (var _i = 0, _a = dashsource.video; _i < _a.length; _i++) {
						var src_2 = _a[_i];
						add_source(src_2);
					}
					for (var _b = 0, _c = dashsource.audio; _b < _c.length; _b++) {
						var src_3 = _c[_b];
						add_source(src_3);
					}
					dashdata.duration = dashsource.duration;
					dashdata.min_buffer_time = dashsource.minBufferTime;
					var dash = common_functions["create_dash_stream"](dashdata);
					var dashurl = "data:application/dash+xml," + encodeURIComponent(dash);
					return done({
						url: dashurl,
						video: "dash"
					}, 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain_nowww === "parismatch.com") return src.replace(/(\/lmnr\/+)(?:[fr]\/+[^/]+\/+)+(img\/+)/, "$1$2");
		if (digitalocean_container === "ostagram1") {
			return src
				.replace(/(\/image\/+[0-9]+\/+)thumb_/, "$1")
				.replace(/(\/client\/+avatar\/+[0-9]+\/+)avatar[0-9]+_/, "$1");
		}
		if (domain_nowww === "ostagram.me") {
			if (/\/assets\/+lightbox\/+[^/]+\.png(?:[?#].*)?$/.test(src))
				return {
					url: src,
					bad: "mask"
				};
		}
		if (domain === "cdn-icons-png.flaticon.com") {
			newsrc = remove_queries(src, ["fd"]);
			if (newsrc !== src)
				return newsrc;
			return src.replace(/\/(?:32|64|128|256)\/+([0-9]+\/+[0-9]+\.)/, "/512/$1");
		}
		if (domain === "gaffa.blob.core.windows.net") return src.replace(/(\/gaffa-media\/+media\/+[-0-9a-f]{10,}\/+[^/]+-)(?:SMALL|MEDIUM|LARGE)\./, "$1default.");
		if (domain === "ccdn.lezhin.com") return src.replace(/(\/[0-9]+\/+(?:media|images)\/+[^/.?#]+)(?:\.[a-zA-Z0-9]+)?(?:[?#].*)?$/, "$1");
		if (domain === "image.balcony.studio") {
			newsrc = src.replace(/(\/[0-9]+\.)webp(?:[?#].*)?$/, "$1jpg");
			if (newsrc !== src)
				return add_full_extensions(newsrc, ["png", "jpg", "jpeg"], true);
		}
		if (domain === "img.lazcdn.com") return src.replace(/(\/p\/+[^/]+?\.[^_?#/]+)_[^/.?#]*\.[^/.?#]+(?:[?#].*)?$/, "$1");
		if (domain === "covers.audiobooks.com") return src.replace(/(\/images\/+covers\/+)large\/+/, "$1full/");
		if (domain === "smedia.alkemics.com") {
			newsrc = src.replace(/(\/product\/+picture\/+)exportable\/+([-0-9a-f]{10,})\/+[0-9]+x[0-9]+\./, "$1$2.");
			if (newsrc !== src)
				return add_extensions(newsrc);
		}
		if (domain_nowww === "rbb24.de") return src.replace(/(\/content\/+dam\/+.*?)\.[a-z]+\/+size=[^/]+(?:[?#].*)?$/, "$1");
		if (domain === "d38fgd7fmrcuct.cloudfront.net" ||
			domain === "media.zaiko.io") {
			return src.replace(/\/b[wh]_[0-9]+\/+([^/]+)(?:[?#].*)?$/, "/$1");
		}
		if (domain_nowww === "wallpapers.com") {
			return src
				.replace(/(\/images\/+file\/+[^/]+)\.webp(?:[?#].*)?$/, "$1.jpg")
				.replace(/(\/images\/+)(?:thumb(?:nail)?|high|hd4?)\/+/, "$1file/");
		}
		if (domain === "images.kolonmall.com") return src.replace(/(\/Prod_Img\/+[^/]+\/+[0-9]{4}\/+L)[SML]([0-9]+\/+[^/]+_L)[SML]([0-9]+\.)/, "$1Z$2Z$3");
		if (domain_nowww === "lookandlearn.com") return src.replace(/(\/history-images\/+)thumbnail\/+/, "$1preview/");
		if (domain === "storage.pubble.nl") {
			newsrc = src.replace(/(\/content\/.*)\.webp$/, "$1.jpg");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/content\/.*)_thumb[0-9]+\./, "$1.");
		}
		if (domain_nowww === "univision.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+proxy\/+api\/+cached\/+picture\?(?:.*&)?href=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "oblgazeta.ru") {
			newsrc = src.replace(/\/x([^/?#]+)\.pagespeed\.ic\.[-_0-9a-zA-Z]+\.webp$/, "/$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain_nowww === "stereoboard.com") return src.replace(/\/[0-9]+x[0-9]+x([^/?#]+)\.pagespeed\.ic\.[-_0-9a-zA-Z]+\.webp$/, "/$1");
		if (domain === "eu.gogo.mn") return src.replace(/\/thumbnail\/+[0-9]+\/+images\/+/, "/images/");
		if (domain === "static.legalcdn.org") return src.replace(/\/lbimg\/+post-[^/]+\/+/, "/");
		if (domain === "cdn.saam.media") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+[^/]+\/+[0-9]+\/+[0-9]+\/+[^/]+\/+[^/]+\/+[^/]+\/+(https?[%:].*)$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "img.kyodonews.net") return src.replace(/(\/images\/+[^/]+\/+[0-9a-f]{10,}\/+photo)_[sml]\./, "$1.");
		if (domain_nowww === "tulup.ru") return src.replace(/(\/photo\/+media\/+galleries\/+[^/]+\/+[^/]+\/+)normal\/+/, "$1big/");
		if (domain_nowww === "caps-a-holic.com") {
			if (/\/c_image\.php\?/.test(src)) {
				newsrc = keep_queries(src, ["max_height", "s"]) + "&a=0&x=0&y=0&l=1";
				if (newsrc !== src)
					return newsrc;
				return newsrc.replace(/([?&]max_height=)[0-9]+/, "$12160");
			}
		}
		if (domain === "resource.lap.recochoku.jp") {
			if (/\/front\/+common\/+b\.png(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain === "static.thenounproject.com") {
			newsrc = src.replace(/\/png\/+([0-9]+)-200\./, "/attribution/$1-600.");
			if (newsrc !== src) {
				return {
					url: newsrc,
					problems: { watermark: true }
				};
			}
			return src
				.replace(/(\/png\/+[0-9]+-)84\./, "$1200.")
				.replace(/\/resized\/+[0-9]+\/+[0-9]+\/+/, "/");
		}
		if (domain === "cdn.cms.prod.nypr.digital") return src.replace(/\/images\/+([^/?#]+)(?:\.width-[0-9]+|\.2e16d0ba\.fill-[0-9]+x[0-9]+)(\.[^/.]+)(?:[?#].*)?$/, "/original_images/$1$2");
		if (domain === "sns-webpic-qc.xhscdn.com") {
			return {
				url: src.replace(/:\/\/[^/]+(\.xhscdn.com\/+)[0-9]+\/+[0-9a-f]{10,}\/+([^/.?#!]+)(?:[?#!].*)?$/, "://sns-img-al$1$2"),
				headers: {
					Referer: ""
				}
			};
		}
		if (domain_nowww === "musescore.com" && string_indexof(src, "/static/")) {
			return src
				.replace(/@[0-9]+x[0-9]+$/, "")
				.replace(/\?.*/, "");
		}
		if (domain_nowww === "ticketfairy.com") return src.replace(/(\/uploaded\/+thumbnails\/+[^/]+)_(?:300|600)xauto\./, "$1_1024xauto.");
		if (domain === "media.deichmann.com") return src.replace(/(\/product-h6)(?:-[a-z]+)?\/+(?:p_[^/]+\/+)?/, "$1/");
		if (domain === "admin.itsnicethat.com") {
			match = src.match(/\/images\/+[^/]+=\/+.*\/([^/?#]+)(?:[?#].*)?$/);
			if (match) {
				return "https://media.itsnicethat.com/original_images/" + match[1];
			}
		}
		if (domain === "i.abcnewsfe.com") {
			return src
				.replace(/_16x9(\.[a-z]+)$/, "$1")
				.replace(/\?.*/, "");
		}
		if (domain_nosub === "pandora.com" && /^mediaserver-cont-/.test(domain) ||
			domain === "content-images.p-cdn.com") {
			newsrc = src.replace(/(\/images\/+.*\/)_?[0-9]{3}W_[0-9]{3}H\./, "$11080W_1080H.");
			if (newsrc !== src) {
				return {
					url: newsrc,
					problems: { possibly_upscaled: true }
				};
			}
		}
		if (domain === "websvc.afi-sa.net") return src.replace(/(\/images\/+jaquettes\/+(?:[0-9]\/+)+)thumbs\/+/, "$1big/");
		if (domain === "d3d00swyhr67nd.cloudfront.net") return src.replace(/(:\/\/[^/]+\/+)w[0-9]+h[0-9]+\/+/, "$1_source/");
		if (domain === "static.insales-cdn.com") {
			return src
				.replace(/(:\/\/[^/]+\/+images\/+[a-z]+\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+)(?:large|medium)_/, "$1")
				.replace(/\/r\/+.*?\/(images\/+[a-z]+\/+.*)(?:@[a-z]+)(?:[?#].*)?$/, "/$1");
		}
		if (domain === "img.audiofanzine.com") {
			return src
				.replace(/\/img\/+(product\/+[^/]+\/+)[0-9]+\/+[0-9]+\/+([0-9]+\.[a-z]+)(?:[?#].*)?$/, "/images/u/$1$2")
				.replace(/\/img\/+(.*[0-9]+\.[a-z]+)(?:[?#].*)?$/, "/images/u/$1");
		}
		if (domain_nosub === "pimeyes.com" && /^jsc[0-9]*\./.test(domain)) {
			match = src.match(/\/proxy\/+(7b2275[0-9a-f]+)(?:[?#].*)?$/i);
			if (match) {
				var ascii = hex_to_ascii(match[1]);
				var json_7 = JSON_parse(ascii);
				return json_7.url;
			}
		}
		if (domain_nowww === "gallerix.co.uk") {
			return src
				.replace(/(\/gallery\/+(?:[0-9]+\/+)+[0-9]+-800)\.webp(?:[?#].*)?/, "$1.jpg")
				.replace(/(\/gallery\/+(?:[0-9]+\/+)+[0-9]+-)300\./, "$1800.");
		}
		if (domain_nowww === "itemimg.com") return src.replace(/(\/i\/+[0-9]+\.[0-9]+)\.[0-9]+x[0-9]+\./, "$1.");
		if (domain_nosub === "wbbasket.ru") return src.replace(/(\/images\/+)(?:c[0-9]+x[0-9]+|tm)\/+/, "$1big/");
		if (domain === "pressi.universalmusic.fi") return src.replace(/([?&]img=)[^&#]+/, "$1full");
		if (domain_nosub === "kuvat.fi" && /^ts[0-9]*\./.test(domain)) {
			if (/\/tt\/+\?/.test(src)) {
				var queries_3 = get_queries(src);
				if (queries_3["d"] === "pressi.universalmusic.fi" && queries_3["f"]) {
					return "https://pressi.universalmusic.fi/" + decodeURIComponent(queries_3["f"]).replace(/^\/+/, "") + "?img=full";
				}
			}
		}
		if (domain_nosub === "d-cd.net") {
			return src
				.replace(/(:\/\/[^/]+\/+[^/]+)-100\./, "$1-200.")
				.replace(/(:\/\/[^/]+\/+[^/]+)-(?:240|480|960|1280)\./, "$1-1920.");
		}
		if (domain === "static.auction.ru") {
			newsrc = src.replace(/(\/offer_images\/+[^/]+\/+[0-9]{4}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9]+\/+)small\/+/, "$1big/");
			if (newsrc !== src) {
				return {
					url: newsrc,
					problems: { watermark: true }
				};
			}
		}
		if (domain === "collectionimages.npg.org.uk") return src.replace(/(:\/\/[^/]+\/+)(?:std|large|popover)\/+/, "$1long/");
		if (domain === "pictime7eus1public-m.azureedge.net" ||
			domain === "pictimecloudaf-m.azureedge.net") {
			return src.replace(/(\/pictures\/+[0-9]+\/+[0-9]+\/+[0-9]+\/+[0-9a-z]+\/+)(?:thumb|small)res\/+/, "$1lowres/");
		}
		if (domain === "static.pepper.ru") return src.replace(/\/(?:re\/+[0-9]+x[0-9]+|qt\/+[0-9]+)(\/+[^/]+)(?:[?#].*)?$/, "$1");
		if (domain === "goods-photos.static1-sima-land.com") return src.replace(/(\/items\/+[0-9]+\/+[0-9]+\/+)(?:140|280|400|700)\./, "$11600.");
		if (domain === "media.obi.ru") return src.replace(/\/resize\/+[0-9]+x[0-9]+\/+media\/+/, "/media/");
		if (domain_nowww === "unc.ua") return src.replace(/\/thumbs\/+(?:medium|large)_/, "/thumbs/big_");
		if (domain === "squat.telequebec.tv") {
			var query_mnmedias_api_1 = function(id, cb) {
				api_query("telequebec_mnmedias:" + id, {
					url: "https://mnmedias.api.telequebec.tv/api/v4/player/" + id,
					imu_mode: "xhr",
					headers: {
						Origin: "https://squat.telequebec.tv",
						Referer: "https://squat.telequebec.tv/",
						"Sec-Fetch-Dest": "empty",
						"Sec-Fetch-Mode": "cors",
						"Sec-Fetch-Site": "same-site"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					if (!resp)
						return done(null, false);
					for (var _i = 0, _a = resp.streamInfos; _i < _a.length; _i++) {
						var source = _a[_i];
						if (source.source !== "Brightcove")
							continue;
						var pk = base64_decode("IEJDcGtBRGF3cU0zbEJ6MDdmZFY2UV9fWjhqTTZSZW5Bck1mYU04WW94eUlCZXh6dFAybExCdlh3MlBsa255WGJuS18xTU1TbVh3N3FLcU9NOW1QSS1kb0t2bXFleXdUSjN3S1Z6aGRKU1FOOEp0aGhobXJVVDV6VmlrTVU4T3ZRRUdpclItZTdlN2lxbVpTQw").slice(1);
						return done("https://players.brightcove.net/6150020952001/default_default/index.html?videoId=" + source.sourceId + "#imu-pk=" + pk, 6 * 60 * 60);
					}
					console_warn(cache_key, "Unable to find source from", resp);
					return done(null, false);
				});
			};
			var query_squat_api_1 = function(id, cb) {
				api_query("telequebec_squat:" + id, {
					url: "https://squat.api.telequebec.tv/v1/videos/" + id,
					imu_mode: "xhr",
					headers: {
						Origin: "https://squat.telequebec.tv",
						Referer: "https://squat.telequebec.tv/",
						"Sec-Fetch-Dest": "empty",
						"Sec-Fetch-Mode": "cors",
						"Sec-Fetch-Site": "same-site"
					},
					json: true
				}, cb, function(done, resp, cache_key) {
					if (!resp)
						return done(null, false);
					if (resp.source !== "mnMedias") {
						console_warn(cache_key, "Unknown source for", resp);
						return done(null, false);
					}
					query_mnmedias_api_1(resp.sourceId, function(url) {
						if (!url)
							return done(null, false);
						return done(url, 6 * 60 * 60);
					});
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+videos\/+([0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					query_squat_api_1(match[1], function(url) {
						if (!url)
							return cb(null);
						return cb({
							url: url,
							is_pagelink: true
						});
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "baseec-img-mng.akamaized.net") return src.replace(/(\/images\/+item\/+[^/]+\/+[^/?#]*)(?:[?#].*)?$/, "$1?imformat=generic");
		if (domain_nowww === "ffkm.ru") return src.replace(/(\/images\/+gallery\/+[^/]+\/+)thumbs\/+/, "$1");
		if (domain_nosub === "seaart.ai" && /^image\./.test(domain)) {
			return src.replace(/(\/static\/+.*?)_low(\.[a-z]+)(?:[?#].*)?$/, "$1_high$2");
		}
		if (domain_nosub === "lnwfile.com") return src.replace(/(:\/\/[^/]+\/+_\/+[^/]+\/+)_(?:fit|resize)\/+[0-9]+\/+[0-9]+\/+/, "$1_raw/");
		if (domain_nosub === "photobiz.com" && /^image[0-9]*\./.test(domain)) {
			return src.replace(/_(?:small|large)(\.[^/.]+)(?:[?#].*)?$/, "_xlarge$1");
		}
		if (domain === "media.imagepost.com") return src.replace(/-thumb(\.[^/.]+)(?:[?#].*)?$/, "$1");
		if (domain === "cdn.viewing.nyc") return src.replace(/(\/assets\/+media\/+[0-9a-f]+\/+elements\/+[0-9a-f]+\/+)[a-z]+\/+([-0-9a-f]+)(?:_[0-9]+x)?\./, "$1$2.");
		if (domain === "media.kijiji.ca") return src.replace(/(\/api\/+v1\/+[^/]+\/+images\/+[0-9a-f]{2}\/+[-0-9a-f]{10,})\?rule=kijijica-(?:[0-9]{2,3}|1024|1200|1600)-[a-z]+$/, "$1?rule=kijijica-1600-jpg");
		if (domain_nowww === "vogue.com.tr") return src.replace(/(\/static\/+)img\/+[^/]+\/+/, "$1original/");
		if (domain_nowww === "cartier.jp") return src.replace(/(\/content\/+dam\/+.*\.[a-z]+)\.scale\.[0-9]+\.[a-z]+\.[a-z]+(?:[?#].*)?$/, "$1");
		if (domain === "storage.onecloudpro.com") {
			return {
				url: src.replace(/\?.*/, ""),
				can_head: false
			};
		}
		if (domain === "imageflow.rausgegangen.de") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+url\/(.*?)(?:[?#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (domain === "cdn.mpcautofill.com") {
			return {
				url: src.replace(/(\/images\/+[^/]+\/+)small\/+/, "$1large/"),
				can_head: false // 400
			};
		}
		if (domain_nowww === "azertag.az") return src.replace(/(\/files\/+[0-9]{4}\/+[0-9]+\/+)[0-9]+x[0-9]+\/+([0-9]+)_[0-9]+x[0-9]+\./, "$1$2.");
		if (googlestorage_container === "image-ichiba2") {
			return src.replace(/(\/prod\/+[^/]+\/+projects\/+[0-9]+\/+[^/]+\/+[^/]+)_w[0-9]+\./, "$1.");
		}
		if (domain === "img.chil-chil.net") {
			return {
				url: src.replace(/(\/goods_img\/+)X?[ML]\/+([0-9]+)_X?[ML]\./, "$1XXL/$2_XXL."),
				problems: { possibly_upscaled: true }
			};
		}
		if (domain === "images.mnstatic.com") return src.replace(/(?:\?.*)?$/, "?quality=100&format=png");
		if (domain_nosub === "mnstatic.com" && /^photo[0-9]+x[0-9]+\./.test(domain)) {
			match = src.match(/:\/\/[^/]+\/+([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{10,})\/+/);
			if (match) {
				return "https://images.mnstatic.com/" + match[1] + "/" + match[2] + "/" + match[1] + match[2] + match[3] + ".jpg?quality=100";
			}
		}
		if (domain_nowww === "esprit-photo.com") return src.replace(/\/render\/+w[0-9]+\/+/, "/content/");
		if (amazon_container === "kb-tenant-data") {
			return src.replace(/(\/uploads\/+images\/+[^/]+\/+)(?:thumb|medium)\/+/, "$1large/");
		}
		if (domain === "i.icanvas.com") {
			return add_queries(keep_queries(src, ["sh", "s", "d"]), { "d": "0" }).replace(/([?&]s=)(?:[sml]|xl)/, "$1xxl");
		}
		if (domain_nowww === "thevintageposter.com") return src.replace(/(\/Art_Images\/+)Small\/+TN/, "$1Medium/");
		if (domain_nowww === "tenor.com") {
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+(?:[a-z]+\/+)?view\/+[^/?#]+-([0-9]+)(?:[?#].*)?$/,
				query_for_id: "https://tenor.com/view/${id}",
				process: function(done, resp, cache_key, urlmatch) {
					var match = resp.responseText.match(/<script id="store-cache"[^>]*>({.*?})<\/script>/);
					if (!match) {
						console_error(cache_key, "Unable to find store-cache match for", resp);
						return done(null, false);
					}
					var json = JSON_parse(match[1]);
					var id = urlmatch[1];
					var data = json.gifs.byId[id].results[0];
					var obj = {
						extra: {
							page: data.itemurl,
							created_date: data.created * 1000,
							caption: data.h1_title,
							author_username: data.user.username
						}
					};
					var urls = [];
					if (data.media_formats.mp4) {
						urls.push({
							url: data.media_formats.mp4.url,
							video: true
						});
					}
					if (data.media_formats.gif) {
						urls.push(data.media_formats.gif.url);
					}
					return done(fillobj_urls(urls, obj), 6 * 60 * 60);
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (domain === "kaupokalda.com") return src.replace(/(\/storage\/+cache\/+.*?)\.thumb[0-9]+\.webp/, "$1.jpg");
		if (domain === "app.fanfix.io") {
			if (/\/static\/+images\/+circular_window_white\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain === "cms.rsa-media.de") return src.replace(/(\/uploads\/+)(?:small|medium|large)_([^/]+)(?:[?#].*)?$/, "$1$2");
		if (domain_nosub === "lemmecheck.com" && /^cdn[0-9]*\./.test(domain)) {
			return {
				url: src.replace(/-[0-9]+x[0-9]+(\.[^/.]+)(?:[?#].*)?$/, "$1"),
				headers: {
					Referer: "https://www.lemmecheck.com/"
				}
			};
		}
		if (domain_nowww === "irrgangfinearts.de") {
			return src
				.replace(/(\/xl\/+l[0-9]+\.)(?:webp|jpg)(?:[?#].*)?$/, "$1png")
				.replace(/(\/media\/+image\/+product\/+[0-9]+\/+)(?:sm|md|lg)\/+/, "$1xl/");
		}
		if (domain === "photos.psychologytoday.com") return src.replace(/(\/[-0-9a-f]{10,}\/+[0-9a-f]+\/+)[0-9]+x[0-9]+\./, "$1original.");
		if (domain_nowww === "lddb.com") return src.replace(/(\/cover\/+ld\/+[0-9]+-[0-9]+\/+)thumb\/+/, "$1");
		if (domain === "img.dlsite.jp") {
			return src
				.replace(/(\/modpub\/.*)\.webp(?:[?#].*)?$/, "$1.jpg")
				.replace(/\/resize\/+(.*?)_[0-9]+x[0-9]+(\.[a-z]+)(?:[?#].*)?$/, "/modpub/$1$2");
		}
		if (domain === "files.structurae.net") return src.replace(/(\/files\/+)[0-9]+(?:x[0-9]+|high)\/+/, "$1photos/");
		if (domain === "i.daily.jp") return src.replace(/(\/Images\/+)([0-9]+\.[a-z]+)(?:[?#].*)?$/, "$1f_$2");
		if (domain_nowww === "dr-johanna-budwig.de") return src.replace(/(\/cdn\/+)thumbnail\/+(.*?)_[0-9]+x[0-9]+(\.[a-z]+)(?:[?#].*)?$/, "$1media/$2$3");
		if (domain_nowww === "otakurepublic.com") return src.replace(/(\/media\/+binary\/+.*?\.[a-z]+)\.[^/.]+\.webp(?:[?#].*)?$/, "$1");
		if (domain === "scout.wgimager.com") return src.replace(/^[a-z]+:\/\/[^/]+\/+(?:[whqf]_[^/]+\/+)+(https?:\/\/)/, "$1");
		if (domain_nowww === "trustnordisk.com") return src.replace(/(\/fileadmin\/+)_processed_\/+(?:[0-9a-f]\/+){2}csm_([^/]+)_[0-9a-f]+\./, "$1user_upload/$2.");
		if (domain_nowww === "cinemacrush.com") {
			if (/\/assets\/+play\.png(?:[?#].*)?$/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			return src.replace(/(\/media\/+[^/]+\/+)[wh][0-9]+\/+/, "$1original/");
		}
		if (domain_nowww === "characterai.io") {
			newsrc = src.replace(/\/i\/+80\/+/, "/i/200/");
			if (newsrc !== src)
				return newsrc;
			if (!/\/static\/+avatars\/+uploaded\//.test(src)) {
				return src.replace(/\/i\/+[0-9]+\/+static\/+(.*?)(?:[?#].*)?$/, "/static/$1");
			}
		}
		if (domain === "cache.legacy.net") return src.replace(/(\/images\/.*?\.jpg)x\?.*/, "$1");
		if (domain_nosub === "gloria-jeans.ru" && /^storage-cdn[0-9]*\./.test(domain)) {
			return src.replace(/(\/pictures\/+[^/]+_)[0-9]*Wx[0-9]*H(\.[a-z]+)(?:[?#].*)?$/, "$1WxH$2");
		}
		if (domain_nowww === "codingtube.tech") {
			match = src.match(/\/(aHR0c[^/]+)\//);
			if (match) {
				return base64_decode(match[1]);
			}
		}
		if (domain === "cdn-s-www.ledauphine.com" ||
			domain === "cdn-s-www.leprogres.fr" ||
			domain === "cdn-s-www.estrepublicain.fr") {
			return src.replace(/(\/images\/+[-0-9A-F]{10,}\/+)[^/]+\/+/, "$1NW_raw/");
		}
		if (domain === "cdn.tukioswebsites.com") return src.replace(/(\/obituary_profile_photo\/+)(?:sm|md|lg)\/+/, "$1xl/");
		if (domain_nowww === "girlsnews.tv") return src.replace(/(\/reimage\/+y[0-9]+\/+m[0-9]+\/+)w[0-9]+\/+(?:[^?#]*\/)?/, "$1w0/");
		if (domain === "bilder.deutschlandfunk.de") return src.replace(/-100-[auto0-9]+x[auto0-9]+\./, "-100-original.");
		if (domain === "cdn.arabsstock.com") {
			newsrc = src.replace(/(\/uploads\/+images\/+[0-9]+\/+image-[0-9]+-[^/?#.]+-thumbnail\.)webp(?:[?#].*)?$/, "$1jpg");
			if (newsrc !== src)
				return newsrc;
			if (/\/uploads\/+images\/+[0-9]+\/+image-[0-9]+-[^/?#.]+-(?:preview|thumbnail)\./.test(src)) {
				return [
					{
						url: src.replace(/-[a-z]+(\.[a-z]+)(?:[?#].*)?$/, "-preview$1"),
						problems: { watermark: true }
					},
					{
						url: src.replace(/-[a-z]+(\.[a-z]+)(?:[?#].*)?$/, "-thumbnail$1"),
						problems: { smaller: true }
					}
				];
			}
		}
		if (domain_nowww === "4get.ca") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+proxy\?(?:.*&)?i=([^&#]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (host_domain_nowww === "4get.ca" && options.element) {
			if (options.element.tagName === "IMG" && options.element.parentElement &&
				options.element.parentElement.tagName === "A" && options.element.parentElement.classList.contains("thumb")) {
				return options.element.parentElement.href;
			}
		}
		if (domain === "img.fruugo.com") return src.replace(/(\/product\/+[0-9]+\/+[0-9]+\/+[0-9]+)_[0-9]+_[0-9]+\./, "$1_max.");
		if (domain_nowww === "chicos.com" && /\/Product_Images\//i.test(src)) {
			newsrc = src.replace(/[?#].*/, "");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/(\/Product_Images\/+[0-9]+_[0-9]+)(\.[a-z]+)$/i, "$1_large$2");
		}
		if (domain === "static.zara.net") return src.replace(/(\/assets\/+public\/+.*?)(?:[?#].*)?$/, "$1");
		if (domain_nowww === "diaart.org") return src.replace(/(\/media\/+)[^/]+\/+([a-z]+images\/+)/, "$1_source/$2");
		if (domain === "imageservice.disco.peacocktv.com") {
			newsrc = add_queries(remove_queries(src, ["image-format", "image-quality"]), { "image-format": "png" });
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/(\/(?:uuid|pcms)\/+[-0-9a-f]{10,}\/+[^/]+\/+)[0-9]+(?:\/+[0-9]+)?(\?.*)$/, "$10$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (host_domain === "muzeum.sanok.pl" && domain === "muzeum.sanok.pl" && options.element) {
			if (/\/images\/+multithumb_thumbs\/+[^/.?#]+_images_stories_/.test(src) && options.element.parentElement &&
				options.element.parentElement.tagName === "A" && options.element.parentElement.href &&
				/\/images\/+stories\//.test(options.element.parentElement.href)) {
				return options.element.parentElement.href;
			}
		}
		if (domain_nowww === "minecraft.net") return src.replace(/(\/content\/+dam\/+.*?)\.transform\/[^/]+\/+[^/]+\.[a-z]+(?:[?#].*)?$/, "$1");
		if (domain === "garden.spoonflower.com") {
			newsrc = src.replace(/(\/c\/+[0-9]+\/+.\/+(?:.\/+)?)(?:[sm]|xs)\//, "$1l/");
			if (newsrc !== src)
				return newsrc;
			if (/\?(?:.*&)?designs=[0-9]+/.test(src)) {
				return src.replace(/([?&]size=)(?:[sm]|xs)([&#].*)?$/, "$1l$2");
			}
		}
		if (domain === "store.unigine.com") {
			if (/\/api\/+media-files\/+[-0-9a-f]{10,}/.test(src)) {
				return remove_queries(src, "isPreview");
			}
		}
		if (domain_nowww === "swissiceskating.ch") {
			newsrc = src.replace(/(\/_default_upload_bucket\/+)image-thumb__[^/]+\/+/, "$1");
			if (newsrc !== src)
				return add_extensions_jpeg(newsrc);
			return src.replace(/(\/_default_upload_bucket\/+[^/]+)_16-9(\.[a-z]+)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "mim.p7s1.io") return src.replace(/(\/pis\/+[^/]+\/+[^/]+\/+)profile[^/?#]+(?:[?#].*)?$/, "$1profile:original");
		if (domain === "storage.fest2024.com") {
			return {
				url: src.replace(/(\/image\/+photo\/+images\/+[0-9A-F]{10,})\/.*/, "$1"),
				head_wrong_contenttype: true
			};
		}
		if (domain_nowww === "super.ru") return src.replace(/\/image\/+.*?s3:\/\//, "/image/rs:::::/quality:100/plain/s3://");
		if (domain === "images.sr.roku.com") return src.replace(/(\.[a-z]+)\/+magic\/+fit-in\/+[0-9]+x[0-9]+(?:[?#].*)?$/, "$1");
		if (domain === "cdn.directvelo.com") return src.replace(/\/mediacache\/+photo\/+(uploads\/.*?)_thumb\./, "/$1.");
		if (domain_nowww === "usnews.com" && /\/object\/+image\//.test(src)) {
			obj = {
				url: src,
				can_head: false
			};
			newsrc = src.replace(/\?.*$/, "");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			newsrc = src.replace(/-crop(?:-editorial)?(\.[a-z]+)$/, "$1");
			if (newsrc !== src) {
				obj.url = newsrc;
				return obj;
			}
			return obj;
		}
		if (domain === "rehost.diberie.com") return src.replace(/(\/Picture\/+Get\/+)[rtm]\/+/, "$1f/");
		if (domain === "images.sidearmdev.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+crop\?(?:.*&)?url=([^&]+)(?:[&#].*)?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nosub === "twic.pics") {
			newsrc = remove_queries(src, "twic");
			if (newsrc !== src)
				return newsrc;
			return src.replace(/-[0-9]+x[0-9]+(\.[a-z]+)$/, "$1");
		}
		if ((domain_nowww === "4pda.to" ||
			domain === "i.4pda.ws") && /:\/\/[^/]+\/+s\//.test(src)) {
			if (/\/s\/+as6yfz1IksFlRyBDvGH8dcO\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nowww === "pogd.es") return src.replace(/(\/assets\/+.*?-[0-9a-f]{10,})-thumb\./, "$1-full.");
		if (domain === "cdn.moviestillsdb.com") {
			if (/\/images\/+spacer\.png/.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
			return src.replace(/\/i\/+160x\/+/, "/i/500x/");
		}
		if (domain === "renginiai.kasvyksta.lt") return src.replace(/(\/uploads\/+[^/]+\/+[0-9]+\/+)(?:med)?thumb\/+/, "$1");
		if (domain_nosub === "scrolller.com") {
			if (/-[0-9a-z]{5,}-[0-9]+x[0-9]+\./.test(src)) {
				newsrc = src.replace(/-[0-9]+x[0-9]+(\.[a-z]+)(?:[?#].*)?$/, "$1");
				if (newsrc !== src)
					return newsrc;
			}
			newsrc = src.replace(/\.webp(?:[?#].*)?$/, ".jpg");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/-(?:poster|mobile)\.[a-z0-9]+(?:[?#].*)?$/, ".mp4");
			if (newsrc === src)
				newsrc = src.replace(/:\/\/images\.scrolller\.com\/+yocto\/+([^/]+-[a-z0-9]{5,})\.jpg$/, "://zepto.scrolller.com/$1.mp4");
			if (newsrc !== src)
				return {
					url: newsrc.replace(/:\/\/images\.scrolller\.com\/+([^/]+)\/+/, "://$1.scrolller.com/"),
					video: true
				};
		}
		if (domain === "cdn.rockislandauction.com") return src.replace(/(\/dev_cdn\/+[0-9]+\/+)thumbs\/+/, "$1");
		if (domain === "assets.playbill.com") return src.replace(/(\/editorial\/+)_enhancementPortrait\/+/, "$1");
		if (domain === "cdn.s-cloud.fi") return src.replace(/(\/v1\/+)[^/]+\/+assets\/+/, "$1assets/");
		if (domain_nowww === "likey.me") {
			var get_likey_device_id_1 = function(cb) {
				get_localstorage("https://likey.me/", ["deviceUUID"], function(data) {
					if (data && data["deviceUUID"]) {
						return cb(data["deviceUUID"]);
					}
					return cb(null);
				});
			};
			var get_likey_distinct_id_1 = function(cb) {
				if (!options.get_cookies) {
					return cb(null);
				}
				options.get_cookies("https://likey.me/", function(cookies) {
					if (!cookies) {
						console_error("Unable to get cookies for likey.me");
						return cb(null);
					}
					cookies = headers_list_to_dict(cookies);
					if (!("MIXPANEL_UUID" in cookies)) {
						console_error("MIXPANEL_UUID doesn't exist, try visiting likey.me");
						return cb(null);
					}
					cb(cookies["MIXPANEL_UUID"] || null);
				});
			};
			var query_likey_api_1 = function(url, cb) {
				get_likey_device_id_1(function(deviceid) {
					get_likey_distinct_id_1(function(distinctid) {
						var headers = {
							Accept: "application/json, text/plain, */*",
							Origin: "https://likey.me",
							Referer: "https://likey.me/",
							"Sec-Fetch-Dest": "empty",
							"Sec-Fetch-Mode": "cors",
							"Sec-Fetch-Site": "same-site"
						};
						if (deviceid && distinctid) {
							headers["X-Distinct-Id"] = distinctid;
							headers["X-Likey-Platform"] = "web; version=6.54.0; device=" + deviceid;
						}
						api_query("likey:" + url, {
							url: url,
							headers: headers,
							imu_mode: "xhr",
							json: true
						}, cb, function(done, resp, cache_key) {
							if (!resp)
								return done(null, false);
							done(resp, 60 * 60);
						});
					});
				});
			};
			var query_likey_post_1 = function(id, cb) {
				query_likey_api_1("https://api.likey.me/api/post/" + id, cb);
			};
			var get_likey_imageid_1 = function(url) {
				var match = url.match(/\/media\/+[0-9]+\/+([a-z]+_[0-9]+_[0-9]+)_[0-9a-f]{10,}/);
				if (!match)
					return null;
				return match[1];
			};
			var query_likey_post_imu_1 = function(id, cb) {
				query_likey_post_1(id, function(data) {
					if (!data)
						return cb(null);
					var base = {
						extra: {
							page: "https://likey.me/post/" + id,
							caption: data.post.content,
							created_date: new Date(data.post.createdAt).getTime(),
							updated_date: new Date(data.post.updatedAt).getTime()
						}
					};
					var links = [];
					var i = 0;
					for (var _i = 0, _a = data.post.attachments; _i < _a.length; _i++) {
						var attach = _a[_i];
						if (attach.mediaType !== "image") {
							console.warn("mediaType != image, unhandled");
							continue;
						}
						var ids = [];
						ids.push(i);
						ids.push(get_likey_imageid_1(attach.url));
						if (attach.thumbnailUrl)
							ids.push(get_likey_imageid_1(attach.thumbnailUrl));
						links.push({
							url: base.extra.page + "#imu-i=" + i,
							real_url: attach.url,
							x_id: ids.join("|"),
							is_current: false
						});
						i++;
					}
					links[0].is_current = true;
					base.album_info = {
						type: "links",
						links: links
					};
					base.url = links[0].real_url;
					cb(base);
				});
			};
			newsrc = website_query({
				website_regex: /^[a-z]+:\/\/[^/]+\/+post\/+([0-9]+)(?:[?#].*)?$/,
				run: function(cb, match) {
					query_likey_post_imu_1(match[1], function(obj) {
						if (!obj)
							return cb(null);
						var imu_imageid = null;
						var imu_i = null;
						var queries = common_functions["parse_imu_hash"](src);
						if (queries) {
							if (queries.image) {
								imu_imageid = get_likey_imageid_1(decodeURIComponent(queries.image));
							}
							if (queries.i)
								imu_i = queries.i;
						}
						if (imu_imageid !== null) {
							common_functions["update_album_info_links"](obj, function(x) {
								var ids = x.split("|");
								for (var _i = 0, ids_1 = ids; _i < ids_1.length; _i++) {
									var i_15 = ids_1[_i];
									if (imu_imageid === i_15)
										return true;
								}
								return false;
							});
						}
						if (imu_i !== null) {
							common_functions["update_album_info_links"](obj, function(x) {
								var ids = x.split("|");
								return ids[0] === imu_i;
							});
						}
						cb(obj);
					});
				}
			});
			if (newsrc)
				return newsrc;
		}
		if (host_domain_nowww === "likey.me" && domain === "static.likeycontents.xyz" && options.element) {
			if (options.host_url && /\/post\/+[0-9]+/.test(options.host_url)) {
				var parent_7 = common_functions["get_parent_el_matching"](options.element, function(x) {
					return x.tagName === "DIV" && x.classList.contains("attachment");
				});
				if (parent_7) {
					return {
						url: options.host_url + "#imu-image=" + encodeURIComponent(src),
						is_pagelink: true
					};
				}
			}
		}
		if (domain_nowww === "gameuidatabase.com") return src.replace(/(\/uploads\/+[^/]+)_thumb\./, "$1.");
		if (domain === "images-ng.pixai.art") return src.replace(/(\/images\/+)stillThumb\/+/, "$1orig/");
		if (domain_nowww === "gazetapress.com") {
			if (/\/assets\/+img\/+zoom-ico\./.test(src)) {
				return {
					url: src,
					bad: "mask"
				};
			}
		}
		if (domain_nosub === "bdnodes.net" && /^blockdaemon-audius-content/.test(domain)) {
			return src.replace(/(\/content\/+[0-9A-Z]+\/+)[0-9]+x[0-9]+\./, "$1original.");
		}
		if (domain === "cdn-image.zvuk.com") {
			if (/:\/\/[^/]+\/+pic\?/.test(src)) {
				return keep_queries(src, ["type", "id"]);
			}
		}
		if (domain === "files.magzter.com") {
			return src
				.replace(/(\/resize\/+.*\/view\/+)3\./, "$14.")
				.replace(/(\/resize\/+.*\/view\/+)[1-2]\./, "$13.")
				.replace(/(\/resize\/+[^/]+\/+[0-9]+\/+[0-9]+\/+)thumb\//, "$1view/")
				.replace(/(:\/\/[^/]+\/+)([0-9]+\/+[0-9]+\/+)svg\/+([0-9]+)\/+thumb\./, "$1resize/magazine/$2thumb/$3.");
		}
		if (domain_nosub === "c01.co" && /^file[0-9]+\./.test(domain)) {
			return src.replace(/(\/upload\/+[0-9A-F]+\/+[0-9]{6}\/+[^/?#]+\.[a-z]+)_[0-9]+x[0-9]+\.ashx(?:[?#].*)?$/, "$1");
		}
		if (domain_nosub === "berapt.com" && /^cdn[0-9]*\./.test(domain)) {
			if (/\/i\/+[^/]+\/+[0-9a-f/]+\//.test(src)) {
				return add_queries(keep_queries(src, ["h", "p", "s"]), { "size": "origin" });
			}
		}
		if (amazon_container === "kirja") {
			return src.replace(/(\/prod\/+[0-9]+_[_a-z]+_)(?:small|medium|large)\./, "$1original.");
		}
		if (src.match(/\/ImageGen\.ashx\?/)) {
			return urljoin(src, src.replace(/.*\/ImageGen\.ashx.*?image=([^&]*).*/, "$1"));
		}
		if (domain === "i.pinger.pl" ||
			src.search(/(?::\/\/[^/]*\/(gallery|photos|photogallery)|:\/\/gallery\.[^/]*)?\/albums\/+[^/]*(?:\/+.*)?\/+(normal|thumb|userpics)_[^/.]*\.[^/.]*$/) >= 0) {
			newsrc = src.replace(/\/[a-z]*_([^/.]*\.[^/.]*)$/, "/$1");
			if (newsrc !== src) {
				if (/\.JPG(?:[?#].*)?$/.test(newsrc))
					return [newsrc, newsrc.replace(/\.JPG/, ".jpg")];
				return newsrc;
			}
		}
		if (domain_nowww === "torrenthaja.com" ||
			src.match(/\/data\/[^/]*\/[^/]*\/(?:_thumb\/[^/]*\/|thumbs\/)?[^/]*$/)) {
			newsrc = src
				.replace(/\/thumb-([^/]*)_[0-9]+x[0-9]+(\.[^/.]*)(?:[?#].*)?$/, "/$1$2")
				.replace(/(\/data\/[^/]*\/[0-9]+\/)_thumb\/[0-9]+x[0-9]_[0-9]+\//, "$1")
				.replace(/(\/data\/[^/]*\/[0-9]+\/)thumbs\//, "$1");
			if (newsrc !== src)
				return add_full_extensions(newsrc);
		}
		if (src.search(/\/phpwas\/restmb_[a-z]*make\.php\?/) >= 0) {
			if (domain === "cgeimage.commutil.kr" ||
				domain === "cliimage.commutil.kr") {
				src = src.replace(/\/phpwas\/restmb_[a-z]*make\.php/, "/phpwas/restmb_allidxmake.php");
			}
			if (string_indexof(domain, "nimage.") === 0) {
				newsrc = src.replace(/\/phpwas\/restmb_idxmake\.php.*?simg=([0-9]{4})([0-9]{2})([0-9]{2})([^&]*).*?$/, "/photo/$1/$2/$3/$1$2$3$4");
				if (newsrc !== src)
					return newsrc;
			}
			if (domain === "res.heraldm.com" &&
				decodeURIComponent(src.match(/simg=([^&]*)/)[1])[0] === "/") {
				return urljoin(src, decodeURIComponent(src.match(/simg=([^&]*)/)[1]), true);
			}
			return src.replace(/(\/phpwas\/restmb_[a-z]*make\.php)\?.*(simg=[^&]*)/, "$1?idx=999&$2");
		}
		if (src.match(/.*?\/timthumb(?:\/index)?\.php\?(?:.*&)?src=/)) {
			var baseurl = src;
			if (domain_nowww === "foundation-media.com")
				baseurl = "https://www.foundation-media.com/";
			newsrc = src.replace(/.*\/timthumb(?:\/index)?\.php\?(?:.*&)?src=([^&]+).*$/, "$1");
			if (newsrc !== src) {
				return urljoin(baseurl, decodeURIComponent(newsrc), true);
			}
		}
		if (src.match(/\/fotogallery\/[0-9]+X[0-9]+\//)) {
			return src.replace(/\/fotogallery\/[0-9]+X[0-9]+\//, "/fotogallery/9999999999X0/");
		}
		if (string_indexof(src, "/redim_recadre_photo.php") >= 0) {
			return src.replace(/.*\/redim_recadre_photo\.php\?.*?path_url=([^&]*).*/, "$1");
		}
		if (src.match(/\/dynimage\/[^/]*\/[0-9]*\/[^/]*$/)) {
			return src.replace(/\/dynimage\/[^/]*\//, "/dynimage/original/"); // can be anything
		}
		if (src.match(/\/phocagallery\/.*\/thumbs\/[^/]*$/)) {
			return src.replace(/\/thumbs\/phoca_thumb_[^/._]*_/, "/");
		}
		if (src.match(/\/sfc\/servlet\.shepherd\/version\/renditionDownload/)) {
			return src.replace(/\/renditionDownload.*?[?&]versionId=([^&]*).*/, "/download/$1");
		}
		if (domain === "cdn.ome.lt") return src.replace(/(:\/\/[^/]*\/)[-_A-Za-z0-9]+=\/(?:(?:full-)?fit-in\/)?(?:[0-9x:]+\/)?(?:[0-9x:]+\/)?(?:(?:top|center|middle)\/)?(?:(?:smart|top|center|middle)\/)?(?:filters:[^/]*\/)?/, "$1");
		if ((domain_nosub === "vox-cdn.com" && string_indexof(domain, "cdn.vox-cdn.com") >= 0) ||
			domain === "thumbnails.trvl-media.com" ||
			domain === "thumbor-static.factorymedia.com" ||
			domain === "cdnrockol-rockolcomsrl.netdna-ssl.com" ||
			domain === "thumbor-titelmediaug.netdna-ssl.com" ||
			domain_nowww === "infobae.com" ||
			(domain_nosub === "glbimg.com" && /^s[0-9]*\./.test(domain)) ||
			domain === "i.amz.mshcdn.com" ||
			domain === "img.ilcdn.fi" ||
			domain === "img.fstatic.com" ||
			domain === "img.mthcdn.com" ||
			domain === "images.thestar.com" ||
			(domain_nosub === "holidaypirates.com" && domain.match(/thumb[0-9]*\.holidaypirates\.com/)) ||
			domain === "img.yasmina.com" ||
			domain === "resize.abcradio.net.au" ||
			domain === "th.pinkblog.it" ||
			domain === "th.blogosfere.it" ||
			domain === "th.fashionblog.it" ||
			domain === "images.jovempanfm.uol.com.br" ||
			domain === "img.atyabtabkha.com" ||
			domain === "imageresizer.static9.net.au" ||
			domain === "img-ha.mthcdn.com" ||
			domain === "imagenes.milenio.com" ||
			domain_nowww === "dyn.media.titanbooks.com" ||
			domain === "i.osvigaristas.net.br" ||
			domain === "dynamic.zacdn.com" ||
			domain === "svirtus.cdnvideo.ru" ||
			domain === "t.jwwb.nl" ||
			domain === "thumbs.videogamer.com" ||
			domain === "th.gossipblog.it" ||
			domain === "th.cineblog.it" ||
			domain === "images.news18.com" ||
			domain === "static.telugu.news18.com" ||
			domain === "th.clickblog.it" ||
			domain === "thumbor.forbes.com" ||
			domain === "thumbor.f3.cool" ||
			domain === "dw8stlw9qt0iz.cloudfront.net" ||
			domain === "img.nrj.fr" ||
			domain === "img.wynk.in" ||
			domain === "images.adrise.tv" ||
			domain_nowww === "nydailynews.com" ||
			(domain === "resizing.flixster.com" && /\/https?:\/\//.test(src)) ||
			domain === "thumborcdn.acast.com" ||
			(domain_nosub === "tubitv.com" && /^canvas-bridge[0-9]*\./.test(domain)) ||
			domain === "tcdn.couchsurfing.com" ||
			domain === "dyn.media.forbiddenplanet.com" ||
			domain === "image.goxip.com" ||
			domain === "img.betaseries.com" ||
			domain === "cdn.pinkblog.it" ||
			domain === "studio.cults3d.com" ||
			(domain_nowww === "reuters.com" && string_indexof(src, "/resizer/") >= 0) ||
			domain === "image.over-blog.com" ||
			domain_nowww === "tampabay.com" ||
			domain_nowww === "sanspo.com" ||
			domain === "i.em.com.br" ||
			domain === "images.gofundme.com" ||
			domain === "images.cults3d.com" ||
			domain === "thumb.spokesman.com" ||
			domain === "th-thumbnailer.cdn-si-edu.com" ||
			domain === "scalethumb.leparking.fr" ||
			domain === "img.gva.be" ||
			domain === "img.hbvl.be" ||
			domain === "img.nieuwsblad.be" ||
			domain === "media.customon.com" ||
			domain === "images.ecestaticos.com" ||
			domain === "img.leidschdagblad.nl" ||
			src.match(/:\/\/[^/]*\/thumbor\/[^/]*=\//) ||
			src.match(/:\/\/[^/]*\/resizer\/[^/]*=\/(?:fit-in\/+)?[0-9]+x[0-9]+(?::[^/]*\/[0-9]+x[0-9]+)?\/(?:filters:[^/]*\/)?/)) {
			newsrc = src.replace(/.*?\/(?:thumb(?:or)?|(?:new-)?resizer)\/.*?\/(?:filters(?::|%3A)[^/]*\/)?([a-z]*(?::|%3A)(?:\/|%2F){2}.*)/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			newsrc = src.replace(/.*?\/(?:thumb(?:or)?|(?:new-)?resizer)\/.*?\/(?:filters(?::|%3A)[^/]*\/)?([^%/]*\..*)/, "http://$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/[-_A-Za-z0-9]{64}\/([^%/]*\.[^/]*\/)/, "http://$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+thumbor\/+[0-9]+x[0-9]+\/+http/, "http");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
			newsrc = src.replace(/.*?\/(?:[-_A-Za-z0-9]+=|unsafe)\/(?:(?:full-)?fit-in\/)?(?:[0-9x:]+\/)?(?:[0-9x:]+\/)?(?:(?:smart|top|center|middle)\/)?(?:(?:smart|top|center|middle)\/)?(?:filters(?::|%3A)[^/]*\/)?(?:v[0-9]+\/)?((?:https?(?::|%3[aA])(?:\/\/|%2[fF]%2[fF]))?[^/%]*\..*)/, "$1");
			if (newsrc.match(/^[^/]*%2/))
				newsrc = decodeURIComponent(newsrc);
			if (string_indexof(newsrc, "http") !== 0) {
				newsrc = "http://" + newsrc;
			}
			if (newsrc.match(/^[a-z]*%3/) && false)
				newsrc = decodeURIComponent(newsrc);
			return newsrc;
		}
		if (src.match(/:\/\/[^/]*\/astronaut\/uploads\/[a-z]_[^/]*$/)) {
			return src.replace(/\/[a-z]_([^/]*)$/, "/$1");
		}
		if (src.match(/\/spree\/images\/attachments\/[0-9]+\/[0-9]+\/[0-9]+\//) ||
			domain === "d3on60wtl1ot7i.cloudfront.net") {
			return src.replace(/(\/[0-9]+\/[0-9]+\/[0-9]+\/)[^/]*\/([^/?]*)[^/]*?$/, "$1original/$2");
		}
		if (src.match(/\/applications\/core\/interface\/imageproxy\/imageproxy\.php/)) {
			return decodeURIComponent(src.replace(/.*\/imageproxy\/imageproxy\.php.*?[&?]img=([^&]*).*?$/, "$1"));
		}
		if (src.match(/\/dims[0-9]*\/.*?\/(?:(?:(?:thumbnail|resize)\/[0-9>%A-F]+[xX][0-9>%A-F!+]*[^/]*\/)|(?:crop\/[0-9]+[xX][0-9+]+)).*?(?:\/https?:\/\/|\?url=https?(?:%3A|:))/)) {
			newsrc = src.replace(/.*\/(?:thumbnail|crop|resize)\/.*?\/(https?:\/\/.*)/, "$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/.*\/(?:thumbnail|crop|resize)\/.*?\/\?url=(https?.*)/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
		}
		if (src.match(/\/dims\/CSFF\/[0-9]+\/[-0-9]+\/[-0-9]+\/[-0-9]+\/https?:\/\//)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/dims\/CSFF\/[0-9]+\/[-0-9]+\/[-0-9]+\/[-0-9]+\/(https?:\/\/)/, "$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (src.match(/\/media\/k2\/items\/cache\/[^/]*_[^/]*\.[^/.]*$/)) {
			return src.replace(/\/cache\/([^/]*)_[^/._]*?(\.[^/.]*)$/, "/src/$1$2");
		}
		if (src.match(/^[a-z]+:\/\/[^/]*\/index\.php\?.*=com_joomgallery/) ||
			src.match(/^[a-z]+:\/\/[^/]*\/component\/+joomgallery\/+image\./)) {
			if (src.match(/:\/\/[^/]*\/index\.php\?/)) {
				var queries = get_queries(src);
				if (queries.option === "com_joomgallery" && queries.view === "image" && queries.id) {
					return src.replace(/(:\/\/[^/]*\/).*/, "$1component/joomgallery/image.raw?view=image&type=orig&format=raw&option=com_joomgallery&id=" + queries.id);
				}
			}
			if (/\/component\/+joomgallery\/+image\./.test(src)) {
				return keep_queries(src, ["id", "view", "type", "format", "option"], {
					overwrite: {
						"view": "image",
						"type": "orig",
						"format": "raw",
						"option": "com_joomgallery"
					}
				});
			}
		}
		if (src.match(/:\/\/[^/]*\/+(?:(?:vb|forum)\/+)?proxy\.php\?(?:.*?&)?image=http/) ||
			domain_nowww === "sat-expert.com") {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+(?:[a-z]+\/+)?proxy\.php\?(?:.*?&)?image=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (/\/media\/+photologue\/+photos\/+cache\//.test(src)) {
			return src.replace(/\/cache\/+([^/]*)_[a-z]+(\.[^/.]*(?:[?#].*)?)$/, "/$1$2");
		}
		if (/\/\.evocache\/+([^/]*\.[^/]*)\/+fit-[0-9]+x[0-9]+\.[^/.]*(?:[?#].*)?$/.test(src)) {
			return src.replace(/\/\.evocache\/+([^/]*\.[^/]*)\/+[^/]*(?:[?#].*)?$/, "/$1");
		}
		if (src.match(/:\/\/[^/]*\/yahoo_site_admin[0-9]*\/assets\/images\//)) {
			return src.replace(/(\.[0-9]+)_[a-z]+(\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "dvdprime.com" ||
			domain_nowww === "mania.kr" ||
			src.match(/\/data\/+cheditor[0-9]*\/+[0-9]+\/+view_thumbnail\/+[^/]+(?:[?#].*)?$/)) {
			return src.replace(/\/view_thumbnail\/([^/]*)$/, "/$1");
		}
		if (src.match(/\/images\/easyblog_articles\/[0-9]+\/b2ap3_[^/]*$/)) {
			return src.replace(/\/b2ap3_[a-z]+_([^/]*)$/, "/$1");
		}
		if (src.match(/\/wp-content\/plugins\/BdSGallery\//)) {
			return src.replace(/(\/BdSGallery\/BdSGaleria\/[0-9]+)_[a-z]+(\.[^/.]*)$/, "$1$2");
		}
		if ((((domain_nosub === "fbcdn.net" && domain.match(/^external[-.].*\.fbcdn\.net/)) ||
			domain === "img.globuya.com" ||
			domain === "img.gluseum.com" ||
			domain === "img.govserv.org" ||
			domain === "img.gleauty.com") || (src.match(/^[a-z]+:\/\/[^/]*\/2\/safe_image\.php.*?[?&]url=http/))) && string_indexof(src, "/safe_image.php?") >= 0) {
			newsrc = src.replace(/.*\/safe_image\.php\?(?:.*&)?url=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "beckygworld.com" ||
			domain_nowww === "mariahsworld.com" ||
			domain_nowww === "nferaclub.com" ||
			domain_nowww === "tdjakes.com" ||
			src.match(/^[a-z]+:\/\/[^/]*\/public\/img\/posts\/photos\/[0-9]+_[0-9a-f]+_[a-z]\.[^/.]*$/)) {
			return src.replace(/(\/img\/posts\/photos\/[0-9]+_[0-9a-f]+)_[a-z](\.[^/.]*)$/, "$1$2");
		}
		if (domain_nowww === "airlinerphotos.com" ||
			src.match(/\/wp-content\/+(?:uploads\/(?:.*?\/)?nggallery|[gG]allery)\/(?:.*?\/)?(?:cache|dynamic)\/+[^/]+\.[^-_/.]*-nggid[0-9]+-ngg0dyn-[^/]*$/)) {
			return src.replace(/\/(?:cache|dynamic)(\/+[^/]+\.[^-_/.]+)-[^/]*$/, "$1");
		}
		if (src.match(/\/+wp-content\/+uploads\/+cache\/+[0-9]{4}\/+[0-9]{2}\/+[^/]*\/+[0-9]+\.[^/.]*(?:[?#].*)?$/)) {
			return src.replace(/\/+wp-content\/+uploads\/+cache\/+([0-9]{4}\/+[0-9]{2}\/+[^/]*)\/+[0-9]+(\.[^/.]*)([?#].*)?$/, "/wp-content/uploads/$1$2$3");
		}
		if (domain_nowww === "mywhere.it" ||
			domain_nowww === "radiowebitalia.it" ||
			src.match(/\/+wp-content\/+gallery\/+[^/]*\/+thumbs\/+thumbs_([^/]*\.[^/.]*)(?:[?#].*)?$/)) {
			return src.replace(/(\/+wp-content\/+[^/]*\/+[^/]*\/+)(?:thumbs\/+thumbs_|webview\/+)([^/]*\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (src.match(/\/+wp-content\/+plugins\/+doptg\/+uploads\/+thumbs\/+/)) {
			return src.replace(/\/+wp-content\/+plugins\/+doptg\/+uploads\/+thumbs\/+/, "/wp-content/plugins/doptg/uploads/");
		}
		if (src.match(/\/wp-content\/+plugins\/+phastpress\/+phast\.php\/+/)) {
			newsrc = src.replace(/.*\/wp-content\/+plugins\/+phastpress\/+phast\.php\/+([^/]*)\/.*?$/, "$1");
			if (newsrc !== src) {
				return newsrc.replace(/(-[0-9A-F][0-9A-F])/g, function(x) { return decodeURIComponent(x.replace(/^-/, "%")); });
			}
		}
		if (domain_nowww === "krauzer.ru" ||
			domain === "kino.tricolor.tv" ||
			domain_nosub === "prostitutki.today" ||
			domain_nowww === "menslife.com" ||
			domain_nowww === "sncmedia.ru" ||
			domain_nowww === "fashiontime.ru" ||
			domain_nowww === "hi-fi.ru" ||
			domain_nowww === "super.ru" ||
			domain === "fclm-new.hb.bizmrg.com" ||
			domain === "media-1obl-ru.storage.yandexcloud.net" ||
			domain_nowww === "icearenamsk.ru" ||
			domain === "ru.viomi.com" ||
			src.match(/:\/\/[^/]*\/upload\/+resize_cache\/+(?:[^/]*\/+)?iblock\/+[0-9a-f]{3}\/+[0-9]+_[0-9]+_/) ||
			src.match(/:\/\/[^/]*\/(?:upload\/+)?resize_cache_imm\/+iblock\/+[0-9a-f]{3}\/+[0-9a-f]{4}\/+[0-9]+x[0-9]+_Quality[0-9]+_[0-9a-f]+\./)) {
			/*newsrc = src.replace(/(\/upload\/+)webp\/+(iblock\/+[0-9a-f]{3}\/+[0-9a-z]{10,}\/+[^/]+\.)webp(?:[?#].*)?$/, "$1$2jpg");
			if (newsrc !== src)
				return newsrc;*/
			newsrc = src
				.replace(/\/resize_cache(?:\/+[^/]*)?(\/+[^/]*\/+...\/+)[0-9]+_[0-9]+_[0-9]+\/([0-9a-f]+(?:-[0-9]+x[0-9]+)?\.[^/.]*)$/, "$1$2")
				.replace(/\/resize_cache(?:\/+[^/]*)?(\/+[^/]*\/+...\/+(?:[0-9a-z]{20,}\/+)?)[0-9]+_[0-9]+_[0-9a-f]+\/([^\.]+(?:-[0-9]+x[0-9]+)?\.[^/.]*)$/, "$1$2")
				.replace(/\/resize_cache_imm\/+(iblock\/+[0-9a-f]{3}\/+)[0-9a-f]{4}\/+[0-9]+x[0-9]+_Quality[0-9]+_([0-9a-f]+\.[^/.]*)(?:[?#].*)?$/, "/$1$2")
				.replace(/\/resize_cache\/.*?\/(iblock\/+[0-9a-f]{3}\/)/, "/$1");
			if (newsrc !== src)
				return newsrc;
			newsrc = src
				.replace(/(\/iblock\/+[0-9a-f]{3}\/+[0-9a-f]+)(?:_[a-z][0-9]+){1,}(?:_[a-z]+)(\.[^/.]*)(?:[?#].*)?$/, "$1$2")
				.replace(/(\/iblock\/+[0-9a-f]{3}\/+[0-9a-f]+)[wh][0-9]+(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "storage.journaldemontreal.com" ||
			domain === "storage.torontosun.com" ||
			domain === "storage.ottawasun.com" ||
			domain === "storage.chathamthisweek.com" ||
			domain === "storage.journaldequebec.com" ||
			domain === "storage.journaldemontreal.com" ||
			domain === "storage.canoe.com" ||
			domain === "storage-cube.quebecormedia.com" ||
			domain_nowww === "stylosophy.it" ||
			domain_nosub === "nanopress.it" ||
			src.match(/^[a-z]+:\/\/storage\.[^/]*\/+v[0-9]*\/+dynamic_resize\/+sws_path\//)) {
			newsrc = src.replace(/^[a-z]+:\/\/[^/]*\/+v[0-9]*\/+dynamic_resize\/*.*?[?&]src=([^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeURIComponent(newsrc);
			newsrc = src
				.replace(/\/dynamic_resize\/+sws_path\//, "/")
				.replace(/_(?:JDX-[0-9]+x[0-9]+_[A-Z]+|LARGE_BOX)(\.[^/.]*)$/, "_ORIGINAL$1")
				.replace(/\?.*$/, "");
			if (newsrc !== src)
				return {
					url: newsrc,
					head_wrong_contenttype: true
				};
			return {
				url: src,
				head_wrong_contenttype: true
			};
		}
		if (domain === "upload.wikimedia.org" ||
			domain_nowww === "generasia.com" ||
			domain === "cdn.wikimg.net" ||
			domain_nowww === "liquipedia.net" ||
			domain === "i.know.cf" ||
			src.match(/\/thumb\/+[0-9a-f]\/+[0-9a-f]{2}\/+[^/]*\.[^/]*\/+(?:lossless-page[0-9]+-)?[0-9]+px-[^/]*(?:[?#].*)?$/)) {
			newsrc = src.replace(/\/(?:thumb\/+(archive\/+)?)?(.)\/+(..)\/+([^/]*)\/+(?:lossless-page[0-9]+-)?[0-9]+px-.*?$/, "/$1$2/$3/$4");
			if (newsrc !== src)
				return newsrc;
		}
		if (domain === "upload.wikimedia.org") {
			match = src.match(/\/commons\/+[0-9a-f]\/+[0-9a-f]{2}\/+([^/]+\.[^/.]+)(?:[?#].*)?$/);
			if (match) {
				return {
					url: src,
					is_original: true,
					extra: {
						page: "https://commons.wikimedia.org/wiki/File:" + match[1]
					}
				};
			}
		}
		if (domain_nosub === "wiki.gallery" && /:\/\/[^/]+\/+images\/+[0-9a-f]\/+[0-9a-f]{2}\/+/.test(src)) {
			return add_queries(src, { "format": "original" });
		}
		if (src.match(/\/lib\/+exe\/+fetch\.php.*?[?&]media=[^&]*.*?$/)) {
			newsrc = keep_queries(src, ["media"]);
			if (newsrc !== src)
				return newsrc;
			newsrc = src.replace(/.*\/fetch\.php\?(?:.*&)?media=([^&]+).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain === "cdn.himalaya.com" ||
			domain === "i.linkeddb.com" ||
			domain === "img.heypik.com" ||
			domain === "club-img.kdslife.com" ||
			(domain_nosub === "ofashion.com.cn" && domain.match(/^img[0-9]*\.ofashion.com.cn/)) ||
			domain === "kanfaimage.oss-cn-beijing.aliyuncs.com" ||
			(domain_nosub === "mioreport.com" && domain.match(/^s[0-9]*\./)) ||
			(domain_nosub === "aliyuncs.com" && domain.match(/[./]oss-cn-/)) ||
			domain === "rmrbcmsonline.peopleapp.com" ||
			domain === "img.fxe0898.com" ||
			domain === "img.xiumi.us" ||
			domain === "s.oneroof.co.nz" ||
			(domain_nosub === "hoopchina.com.cn" && domain.match(/[ci][0-9]*\.hoopchina\.com\.cn/)) ||
			domain === "bkimg.cdn.bcebos.com" ||
			src.match(/[?&]x-oss-process=(?:image|style)(?:\/|%2F)/)) {
			var authkey = src.replace(/.*[?&]auth_key=([-0-9a-f]+).*?$/, "$1");
			var replacement = "";
			if (authkey !== src)
				replacement = "?auth_key=" + authkey;
			if (src.match(/[?&]x-(?:oss|bce)-process=/)) {
				newsrc = src.replace(/[?#].*/, replacement);
				if (newsrc !== src)
					return newsrc;
			}
		}
		if (domain === "tfk.thefreekick.com" ||
			domain_nowww === "discourse-cdn-sjc1.com" ||
			domain_nowww === "swagup.co.kr" ||
			amazon_container === "pixls-discuss" ||
			domain === "forums.lutris.net" ||
			domain === "forum.combustionpunks.co.uk" ||
			domain_nowww === "discourse-cdn-aws1.com" ||
			domain_nosub === "discourse-cdn.com" ||
			src.match(/^[a-z]+:\/\/[^/]*\/(?:(?:forum\/+)?uploads\/+[a-z]+\/+)?(?:optimized|original)\/+[0-9]X\/+(?:[0-9a-f]\/+)*[0-9a-f]{10,}_[0-9]+_[0-9]+x[0-9]+\.[^/.]*(?:[?#].*)?$/)) {
			return src.replace(/(:\/\/[^/]*\/|\/uploads\/[a-z]+\/)?optimized(\/.*\/[0-9a-f]+)_[0-9]+_[0-9]+x[0-9]+(\.[^/.]*)$/, "$1original$2$3");
		}
		if (domain_nowww === "myproana.com" ||
			domain === "static.nulled.to" ||
			domain_nowww === "tesall.ru" ||
			src.match(/^[a-z]+:\/\/[^/]+\/+uploads\/+profile\/+photo-thumb-[0-9]+\.[^/.]*(?:[?#].*)?$/) ||
			src.match(/^[a-z]+:\/\/[^/]+\/+uploads\/+monthly_[0-9]{2}_[0-9]{4}\/+post-[0-9]+-[0-9]+(?:-[0-9]+-[0-9]+)?(?:_thumb)\.[^/]*(?:[?#].*)?/) ||
			src.match(/^[a-z]+:\/\/[^/]+\/+uploads\/+gallery\/+(?:album|category)_[0-9]+\/+[a-z]+_(?:gallery_[0-9]+_[0-9]+_[0-9]+)\.[^/.]*(?:[?#].*)?$/)) {
			return src
				.replace(/(\/uploads\/+gallery\/+(?:album|category)_[0-9]+\/)[a-z]+_(gallery_[0-9]+[^/]*\.[^/.]*)$/, "$1$2")
				.replace(/(\/uploads\/+profile\/+photo-)thumb-([0-9]+\.[^/.]*)$/, "$1$2")
				.replace(/(\/uploads\/+monthly_[0-9]{2}_[0-9]{4}\/+post-[0-9]+-[0-9]+(?:-[0-9]+-[0-9]+)?)_thumb(\.[^/.]*)(?:[?#].*)?$/, "$1$2");
		}
		if (domain === "files.mastodon.social" ||
			domain === "cf.mastohost.com" ||
			(domain_nosub === "filmfreeway.com" && /\/attachments\/+files\//.test(src)) ||
			src.match(/\/media_attachments\/+files\/+(?:[0-9]{3}\/+){3,6}[a-z]+\/+[0-9a-f]{16}\.[^/.]*(?:[?#].*)?$/)) {
			return src.replace(/((?:[0-9]{3}\/+){3,6})[a-z]+\/([^/?#]+\.[^/.]*)(?:[?#].*)?$/, "$1original/$2");
		}
		if (domain_nowww === "diasp.org" ||
			domain_nowww === "diasp.eu" ||
			/^[a-z]+:\/\/[^/]+\/+uploads\/+images\/+(?:thumb|scaled)_(?:large|small|full)_[0-9a-f]{20}\.[^/.]+(?:[?#].*)?$/.test(src)) {
			return src.replace(/\/uploads\/+images\/+[a-z_]+_([0-9a-f]{10,}\.[^/.]*)(?:[?#].*)?$/, "/uploads/images/$1");
		}
		if (/\/wp-content\/+themes\/+[^/]+\/+functions\/+resize_ext\.php\?(?:.*&)?image=http/.test(src)) {
			newsrc = src.replace(/.*\/wp-content\/+themes\/+[^/]+\/+functions\/+resize_ext\.php\?(?:.*&)?image=(http[^&]*).*?$/, "$1");
			if (newsrc !== src)
				return decodeuri_ifneeded(newsrc);
		}
		if (domain_nowww === "12andus.com" ||
			domain === "vln.school.nz" ||
			domain_nowww === "ict-21.ch" ||
			/\/mod\/+file\/+thumbnail\.php\?(?:.*&)?file_guid=[0-9]+(?:&.*)?$/.test(src)) {
			return src.replace(/(\/mod\/+file\/+thumbnail\.php\?)(?:.*&)?(file_guid=[0-9]+).*$/, "$1$2&size=original");
		}
		if (/\/monthly_[0-9]{4}_[0-9]{2}\/[^/]+\./.test(src) && options && options.element) {
			if (options.element.tagName === "SPAN" && options.element.hasAttribute("data-ipslightbox") && options.element.getAttribute("data-fullurl")) {
				return options.element.getAttribute("data-fullurl");
			}
			var get_gallery_image = function(url, cb) {
				var cache_key = "invision_gallery_image:" + url.replace(/^[a-z]+:\/\//, "://").replace(/[?#].*/, "");
				api_cache.fetch(cache_key, cb, function(done) {
					options.do_request({
						url: url,
						method: "GET",
						onload: function(resp) {
							if (resp.readyState < 4)
								return;
							if (resp.status !== 200)
								return done(null, false);
							var match = resp.responseText.match(/<meta\s+property=["']og:image["']\s+content=["']([^'"]+)["']/);
							if (match) {
								return done(decode_entities(match[1]), 12 * 60 * 60);
							} else {
								console_warn("Unable to find match", resp);
								return done(null, false);
							}
						}
					});
				});
			};
			if ((options.element.tagName === "IMG" || options.element.tagName === "LI") && options.do_request && options.cb) {
				var ael = options.element.parentElement;
				if (ael.tagName !== "A" && options.element.children.length === 1) {
					ael = options.element.children[0];
				}
				if (ael.tagName === "A" && ael.hasAttribute("data-imagelightbox")) {
					get_gallery_image(ael.href, function(url) {
						if (url) {
							options.cb(url);
						} else {
							options.cb(null);
						}
					});
					return {
						waiting: true
					};
				}
			}
			if (/\/[^/?#]+\.thumb\.[^/.]+\.[0-9a-f]{20,}\./.test(src) && options.element.tagName === "IMG") {
				var ael = options.element.parentElement;
				if (ael && ael.tagName === "A" && /\/monthly_[0-9]{4}_[0-9]{2}\/+[^/?#]+\.[^/.]+\.[0-9a-f]{20,}\.[^/.]+$/.test(ael.href)) {
					return ael.href;
				}
			}
		}
		if (domain === "lakeimagesweb.artic.edu" ||
			(domain_nosub === "oclc.org" && domain.match(/\.contentdm\./)) ||
			domain === "stor.artstor.org" ||
			domain === "ids.lib.harvard.edu" ||
			domain === "digitalcollections.lib.washington.edu" ||
			domain_nowww === "mtmemory.org" ||
			domain === "ids.si.edu" ||
			domain === "stacks.stanford.edu" ||
			domain === "images.britishart.yale.edu" ||
			domain === "iiif.archivelab.org" ||
			domain === "cplorg.cdmhost.com" ||
			domain === "iiif.lib.ncsu.edu" ||
			domain === "iiif.eluxemburgensia.lu" ||
			domain === "archives.norwich.edu" ||
			domain === "iiif.library.ubc.ca" ||
			domain === "iiif.library.utoronto.ca" ||
			domain === "iiif.bodleian.ox.ac.uk" ||
			domain === "iiif.lib.utexas.edu" ||
			domain === "digital.library.unt.edu" ||
			domain === "texashistory.unt.edu" ||
			domain === "media.ng-london.org.uk" ||
			domain === "iiif.ucd.ie" ||
			(domain_nosub === "unifr.ch" && string_indexof(src, "/loris/") >= 0) ||
			domain === "iiif.irht.cnrs.fr" ||
			domain === "gallica.bnf.fr" ||
			domain === "iiif.wellcomecollection.org" ||
			domain === "framemark.vam.ac.uk" ||
			/\/(?:iiif|loris)\/+(?:.*\/)?[^/]+\/+(?:full|square|(?:pct:)?[0-9.]+(?:,[0-9.]+){3})\/+(?:full|max|[0-9.]+,|,[0-9.]+|!?[0-9.]+,[0-9.]+|pct:[0-9.]+)\/+!?[0-9.]+\/+(?:color|gray|bitonal|default|native)\.(?:jpg|tif|png|gif|jp2|pdf|webp)(?:[?#].*)?$/.test(src)) {
			obj = {
				url: src
			};
			newsrc = src.replace(/(\/ark:\/+[0-9]+\/+[^/]+(?:\/+f[0-9])?)\.(?:thumbnail|lowres)(?:[?#].*)?$/, "$1.highres");
			if (newsrc !== src)
				return newsrc;
			var prefix = "(?:iiif|loris)";
			if (domain === "iiif.library.ubc.ca" || domain === "iiif.library.utoronto.ca" || domain === "iiif.wellcomecollection.org") {
				obj.head_wrong_contenttype = true; // text/html
				prefix = "image";
			} else if (domain === "framemark.vam.ac.uk") {
				prefix = "collections";
			}
			regex = new RegExp("(/" + prefix + "/.*?/)[^/]+/[^/]+/[^/]+/([^/]+\\.[^/.]*)$");
			newsrc = src.replace(regex, "$1full/full/0/$2");
			if (newsrc !== src)
				return fillobj_urls([newsrc], obj);
		}
		if (domain_nowww === "seigura.com" ||
			domain_nowww === "nhssf.org" ||
			domain_nowww === "larochette-hotel.fr" ||
			domain_nosub === "mundotkm.com" ||
			domain_nowww === "androidpolice.com" ||
			domain_nowww === "elle.vn" ||
			domain === "media.wonderlandmagazine.com" ||
			domain === "cdn.mopo.de" ||
			domain_nowww === "newscenter1.tv" ||
			(domain === "cdn.nba.com" && /\/manage\//.test(src)) ||
			(domain === "media.socastsrm.com" && /\/wp-content\//.test(src)) ||
			domain === "img.vt.co" ||
			(domain === "static.gazetaesportiva.com" && /\/uploads\/+imagem\//.test(src)) ||
			(domain === "dx8um8x08u61i.cloudfront.net" && /\/uploads\/+sites\//.test(src)) ||
			(domain === "cms3.ots.at" && /\/ots\/+files\//.test(src)) ||
			domain == "media.socastsrm.com" ||
			domain === "sports.inquirer.net" ||
			digitalocean_container === "saywhofr" ||
			(amazon_container === "sfmoma-media-dev" && string_indexof(src, "/www-media/") >= 0) ||
			/(\/wp-content\/+uploads\/+(?:sites\/+[0-9]+\/+)?[0-9]{4}\/+[0-9]{2}\/+.*)-(?:scaled|e[0-9]{10,})(\.[^/.]+)(?:[?#].*)?$/.test(src)) {
			newsrc = src.replace(/((?:(?:\/wp-content)?\/+uploads(?:\/+sites\/+[0-9]+)?)?\/+[0-9]{4}\/+[0-9]{2}\/+[^?#]*?)(?:-(?:scaled|e[0-9]{10,}|[0-9]+x[0-9]+))*(\.[^/.?]+)(?:[?#].*)?$/, "$1$2");
			if (newsrc !== src) {
				var urls_5 = [newsrc];
				var newsrc1 = newsrc.replace(/\.webp([?#].*)?$/, ".jpg$1");
				if (newsrc1 !== newsrc)
					urls_5.unshift(newsrc1);
				return urls_5;
			}
		}
		if (options.rule_specific && options.rule_specific.linked_image && options.element && options.element.parentElement) {
			var link_el = common_functions["get_link_el_matching"](options.element.parentElement, function(el) {
				if (el.href && el.href !== origsrc && looks_like_valid_link(el.href, el))
					return true;
			});
			if (link_el)
				return link_el.href;
		}
		if (/^[a-z]+:\/\/[^/]+\/+storage\/+m\/+_v2\/+[0-9]{5,}\/+[0-9a-f]+-[0-9a-f]+\/+[0-9a-zA-Z]+\/+[0-9a-zA-Z]+_thumb\./.test(src)) {
			return src.replace(/(\/storage\/+m\/+_v2\/+[0-9]{5,}\/+[0-9a-f]+-[0-9a-f]+\/+[0-9a-zA-Z]+\/+[0-9a-zA-Z]+)_thumb\./, "$1.");
		}
		if (/^[a-z]+:\/\/[^/]+\/+send_imgs\.php\?(?:.*&)?img=abe91d36bea45a343609fca197da54079/.test(src)) {
			match = src.match(/^[a-z]+:\/\/[^/]+\/+send_imgs\.php\?(?:.*&)?img=([^&]+)/);
			if (match) {
				newsrc = match[1].replace(/be91d36bea45a343609fca197da54079/g, "");
				return base64_decode(newsrc);
			}
		}
		if (/\/files\/+pl\/+mini\/+([^/]+)(?:[?#].*)?$/.test(src)) {
			return src.replace(/\/files\/+pl\/+mini\/+/, "/files/pl/");
		}
		if (/\/images\/+joomgallery\//.test(src)) {
			return src.replace(/\/images\/+joomgallery\/+(?:thumbnails|details)\/+([^/]+\/+(?:.*\/)?[^/]+)(?:[?#].*)?$/, "/images/joomgallery/originals/$1");
		}
		if ((/\/_next\/+image\/*\?/.test(src)) ||
			/\/_next\/+image\/*\?(?:.*&)?url=/.test(src)) {
			var queries = get_queries(src);
			if (queries && queries.url)
				return urljoin(src.replace(/\/_next\/.*/, ""), decodeURIComponent(queries.url), false);
		}
		if (/\/uc_server\/+data\/+avatar\/+[0-9]{3}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9]{2}_avatar(?:_[0-9a-f]+)?_[a-z]+\.[^/.]+(?:[?#].*)?$/.test(src)) {
			return src.replace(/(\/uc_server\/+data\/+avatar\/+[0-9]{3}\/+[0-9]{2}\/+[0-9]{2}\/+[0-9]{2}_avatar(?:_[0-9a-f]+)?)_(?:small|middle)\./, "$1_big.");
		}
		if (/\/wp-content\/+uploads\/+[0-9]{4}\/+[0-9]{2}\/+cropped-[^/]+(?:[?#].*)?$/) {
			newsrc = src.replace(/\/cropped-([^/]+(?:[?#].*)?)$/, "/$1");
			if (newsrc !== src)
				return newsrc;
		}
		if (!src && options.host_url && options.element && options.element.tagName && options.element.tagName.toUpperCase() === "SVG") {
			var images_1 = options.element.querySelectorAll("image");
			if (images_1.length === 1) {
				var image = images_1[0];
				var href_2 = image.getAttribute("href");
				if (!href_2) {
					href_2 = image.getAttribute("xlink:href");
				}
				if (href_2) {
					return urljoin(options.host_url, href_2, true);
				}
			}
		}
		if (domain === "blogs-images.forbes.com" ||
			domain === "images-origin.playboy.com" ||
			domain === "images.kpopstarz.com" ||
			domain === "etimg.etb2bimg.com" ||
			domain_nosub === "thetimes.co.uk" ||
			domain === "mediaresources.idiva.com" ||
			domain === "telugu.samayam.com" ||
			(domain_nosub === "cpcache.com" && domain.match(/^i[0-9]*\./)) ||
			domain_nosub === "filmibeat.com" ||
			domain === "www.cdn.tv2.no" ||
			domain === "photo.voici.fr" ||
			domain_nowww === "essexstudent.com" ||
			domain === "th.thgim.com" ||
			domain_nosub === "timesofindia.com" ||
			domain === "static.langimg.com" ||
			domain_nosub === "indiatimes.com" ||
			domain_nosub === "thehindu.com" ||
			(domain_nosub === "kauri.io" && /^api\./.test(domain) && string_indexof(src, "/ipfs/") >= 0) ||
			domain === "images.contentful.com") {
			return {
				url: src,
				head_wrong_contentlength: true
			};
		}
		if (domain === "cdn.marketplaceimages.windowsphone.com" ||
			domain === "img.br.de") {
			return {
				url: src,
				head_wrong_contentlength: true,
				head_wrong_contenttype: true
			};
		}
		if ((domain_nosub === "appspot.com" && domain.match(/^wixmp-[0-9a-f]+\./)) ||
			(domain_nosub === "wixmp.com" && domain.match(/^api-da(?:.*)?\./) && string_indexof(src, "/download/file") >= 0)) {
			return {
				url: src,
				head_wrong_contentlength: true,
				head_wrong_contenttype: true,
				forces_download: true,
				is_private: true
			};
		}
		if (domain_nowww === "ozanyerli.com" ||
			domain === "gallica.bnf.fr" ||
			domain === "dieta.pourfemme.it" ||
			domain_nowww === "ellahoy.es" ||
			domain_nowww === "allgirlannihilation.net" ||
			domain === "stockservice.digital.vistaprint.com" ||
			domain === "cdn.akb48.co.jp") {
			return {
				url: src,
				head_wrong_contenttype: true
			};
		}
		if ((domain === "images.thestar.com" && string_indexof(src, "/content/dam/") >= 0) ||
			(domain_nowww === "thestar.com" && string_indexof(src, "/content/dam/") >= 0) ||
			(domain_nosub === "akamaihd.net" && domain.match(/^steamuserimages-[a-z]\./)) ||
			domain_nowww === "kansascity.com" ||
			domain_nowww === "sanluisobispo.com" ||
			domain_nowww === "iichan.hk" || // 403
			domain_nowww === "pdfkul.com" ||
			domain_nosub === "strikinglycdn.com" || // 403
			domain === "images.boosty.to" || // 400
			domain_nowww === "snopes.com" || // 403
			domain_nowww === "contentmode.com" ||
			(domain_nowww === "newschainonline.com" && /\/bsp-static\/+image\//.test(src)) ||
			(domain_nosub === "sanalsinif.marmara.edu.tr" && /\/iapi\/+files\//.test(src)) || // 404 for recorded videos
			domain === "res.garmin.com" ||
			domain === "cbjpeg.stream.highwebmedia.com" ||
			domain === "images.moviesanywhere.com" ||
			(domain_nosub === "irishmirror.ie" && domain.match(/i[0-9]*(?:-prod)?\./))) {
			return {
				url: src,
				can_head: false
			};
		}
		if ( //(domain_nosub === "radikal.ru" && domain.match(/^s[0-9]*\./)) ||
		domain_nowww === "atkmodels.com" ||
			domain_nowww === "akibatan.com" ||
			(domain_nosub === "uai.com.br" && /^imgsapp[0-9]*\./.test(domain)) ||
			domain_nowww === "n3rdabl3.com") {
			return {
				url: src,
				headers: {
					Referer: ""
				}
			};
		}
		if (domain_nowww === "image.fomos.kr" ||
			domain_nowww === "onlifezone.com" ||
			domain === "cdn.anime-planet.com" ||
			domain === "write.dcinside.com") {
			return {
				url: src,
				can_head: false,
				headers: {
					Referer: ""
				}
			};
		}
		if (domain_nowww === "1in.am" ||
			(domain_nosub === "bobaedream.co.kr" && /^file[-0-9]+\./.test(domain)) ||
			domain_nowww === "dogdrip.net") {
			return {
				url: src,
				headers: {
					Referer: src
				}
			};
		}
		if (host_domain_nowww === "discordapp.com" || host_domain_nowww === "discord.com") {
			return {
				url: src,
				need_data_url: true
			};
		}
		if (options.null_if_no_change) {
			if (src !== origsrc)
				return src;
			return null;
		}
		return src;
	}
	// -- end bigimage --
	var get_helpers = function(options) {
		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");
			}
		}
		try {
			if (options.document)
				document = options.document;
			if (options.window)
				window = options.window;
		} catch (e) {
			//console_warn("Failed to set document/window", e);
		}
		var new_image = function(src) {
			var img = document_createElement("img");
			img.src = src;
			return img;
		};
		var new_video = function(src) {
			var video = document_createElement("video");
			video.src = src;
			return video;
		};
		var new_media = function(src, is_video) {
			if (is_video)
				return new_video(src);
			else
				return new_image(src);
		};
		var get_nextprev_el = function(el, nextprev) {
			if (nextprev) {
				return el.nextElementSibling;
			} else {
				return el.previousElementSibling;
			}
		};
		var get_nextprev_from_list = function(el, list, nextprev) {
			var el_src = get_img_src(el);
			var index = -1;
			for (var i = 0; i < list.length; i++) {
				if (typeof list[i] === "string") {
					if (el_src === list[i]) {
						index = i;
						break;
					}
				} else {
					if (el === list[i]) {
						index = i;
						break;
					}
				}
			}
			if (index === -1)
				return null;
			if (nextprev) {
				if ((index + 1) >= list.length)
					return null;
				else
					return list[index + 1];
			} else {
				if ((index - 1) < 0)
					return null;
				else
					return list[index - 1];
			}
		};
		var get_nextprev_from_tree = function(el, nextprev, tree, selector) {
			var current = el;
			for (var i = 0; i < tree.length; i++) {
				if (tree[i].tagName !== current.tagName)
					return "default";
				if (tree[i].classList) {
					for (var _i = 0, _a = tree[i].classList; _i < _a.length; _i++) {
						var cls = _a[_i];
						if (!current.classList.contains(cls)) {
							return "default";
						}
					}
				}
				if (tree[i].attrs) {
					for (var attr in tree[i].attrs) {
						if (current.getAttribute(attr) !== tree[i].attrs[attr])
							return "default";
					}
				}
				current = current.parentElement;
			}
			var items = current.querySelectorAll(selector);
			return get_nextprev_from_list(el, items, nextprev);
		};
		var get_nextprev_from_thumbs = function(el, nextprev, options) {
			if (!options.compare_els) {
				if (!options.compare_urls) {
					if (options.id_for_url) {
						if (typeof options.id_for_url !== "function") {
							var id_for_url = options.id_for_url;
							options.id_for_url = function(x) {
								var match = x.match(id_for_url);
								if (!match)
									return null;
								return match[1];
							};
						}
						options.compare_urls = function(a, b) {
							if (!a || !b)
								return false;
							return options.id_for_url(a) === options.id_for_url(b);
						};
					}
				}
				// e.g. for picture elements with source.srcset
				if (!options.get_img_src) {
					options.get_img_src = get_img_src;
				}
				if (options.compare_urls) {
					options.compare_els = function(a, b) {
						if (!a || !b)
							return false;
						return options.compare_urls(options.get_img_src(a), options.get_img_src(b));
					};
				}
			}
			if (!options.compare_els) {
				console_error("compare_els/compare_urls/id_for_url not present");
				return false;
			}
			var thumbs_el = null;
			if (!options.thumbs_selector_global) {
				var current = el;
				while (current = current.parentElement) {
					thumbs_el = current.querySelector(options.thumbs_selector);
					if (thumbs_el)
						break;
				}
			} else {
				thumbs_el = document.querySelector(options.thumbs_selector);
			}
			if (!thumbs_el) {
				console_error("Unable to find thumbs element for", el);
				return false;
			}
			var thumbs = thumbs_el.querySelectorAll(options.thumb_selector);
			if (!thumbs) {
				console_error("No thumbs for", thumbs_el);
				return false;
			}
			var thumb = null;
			array_foreach(thumbs, function(thumb_el) {
				if (options.compare_els(el, thumb_el)) {
					thumb = thumb_el;
					return false;
				}
			});
			if (!thumb) {
				console_error("Unable to find thumb for", el, "in", thumbs_el);
				return false;
			}
			return get_next_in_gallery(thumb, nextprev);
		};
		if (host_domain_nosub === "imgur.com" && host_domain !== "i.imgur.com") {
			return {
				gallery: function(el, nextprev) {
					if (!el)
						return "default";
					var find_from_el = function() {
						if (options.host_url.match(/\/a\/+[^/]+\/+embed/)) {
							return "default";
						}
						var current = el;
						while ((current = current.parentElement)) {
							if (current.tagName === "DIV" &&
								current.classList && current.classList.contains("post-image-container")) {
								while (current) {
									var next = current.nextElementSibling;
									if (!nextprev)
										next = current.previousElementSibling;
									current = next;
									if (!current)
										return "default";
									var img = current.querySelector("img");
									if (img) {
										return img;
									}
								}
							}
						}
						return "default";
					};
					// "default" isn't used here because it's only used as find_from_api ||
					var find_from_api = function(images) {
						var big = bigimage_recursive(el.src, {
							fill_object: true,
							use_cache: false,
							rule_specific: { imgur_source: false }
						});
						var current_hash = big[0].url.replace(/.*\/([^/._]+?)(?:_[^/]+)?\.[^/.]*?(?:[?#].*)?$/, "$1");
						if (current_hash !== el.src) {
							for (var i = 0; i < images.length; i++) {
								if (images[i].hash === current_hash) {
									var image_id;
									if (nextprev) {
										if (i + 1 >= images.length)
											return null;
										image_id = i + 1;
									} else {
										if (i - 1 < 0)
											return null;
										image_id = i - 1;
									}
									var ext = images[image_id].ext;
									if (options.exclude_videos && (ext === ".mp4" || ext === ".webm"))
										ext = ".jpg";
									var newel = document_createElement("img");
									newel.src = "https://i.imgur.com/" + images[image_id].hash + ext;
									return newel;
								}
							}
						}
						return null;
					};
					var find_from_both = function(images) {
						return find_from_api(images) || find_from_el();
					};
					if (!options.window.runSlots && options.do_request) {
						common_functions["fetch_imgur_webpage"](options.do_request, real_api_cache, void 0, options.host_url, function(data) {
							if (!data || !data.imageinfo || data.bad) {
								return options.cb(find_from_el());
							}
							try {
								return options.cb(find_from_both(data.imageinfo.album_images.images));
							} catch (e) {
								console_error(e);
								return options.cb(find_from_el());
							}
						});
						return "waiting";
					} else {
						try {
							return find_from_both(options.window.runSlots.item.album_images.images);
						} catch (e) {
							console_error(e);
							return find_from_el();
						}
					}
				}
			};
		}
		if (host_domain_nosub === "instagram.com") {
			return {
				// FIXME: is this even needed anymore?
				element_ok: function(el) {
					// TODO: improve
					if (el.tagName === "VIDEO") {
						return true;
					}
					return "default";
				},
				gallery: function(el, nextprev) {
					// disabling this section entirely due to https://github.com/qsniyg/maxurl/issues/726
					// it should be redundant with album_info
					if (!el || true)
						return "default";
					var query_el = el;
					if (!el.parentElement) { // check if it's a fake element returned by this function
						query_el = options.element;
					}
					var info = common_functions["instagram_find_el_info"](document, query_el, options.host_url);
					var can_apply = false;
					var use_default_after = false;
					for (var i = 0; i < info.length; i++) {
						if ((info[i].type === "post" && (info[i].subtype === "popup" || info[i].subtype === "page" || info[i].subtype === "home" || (info[i].subtype === "link" && options.rule_specific.instagram_gallery_postlink && !options.is_counting))) ||
							info[i].type === "story") {
							info[i].all = true;
							can_apply = true;
							if (info[i].type === "post" && info[i].subtype === "link")
								use_default_after = true;
						}
					}
					if (can_apply) {
						var imageid_el = common_functions["instagram_get_el_for_imageid"](el);
						var imageid_el_src = common_functions["instagram_get_image_src_from_el"](imageid_el);
						var our_imageid = common_functions["instagram_get_imageid"](imageid_el_src);
						var add = nextprev ? 1 : -1;
						common_functions["instagram_parse_el_info"](real_api_cache, options.do_request, options.rule_specific.instagram_use_app_api, options.rule_specific.instagram_dont_use_web, options.rule_specific.instagram_prefer_video_quality, info, options.host_url, function(data) {
							if (!data) {
								return options.cb("default");
							}
							for (var i = nextprev ? 0 : 1; i < data.length - (nextprev ? 1 : 0); i++) {
								var current_imageid = common_functions["instagram_get_imageid"](data[i].src);
								var current_videoid = "null";
								if (data[i].video) {
									current_videoid = common_functions["instagram_get_imageid"](data[i].video);
								}
								if (our_imageid === current_imageid || our_imageid === current_videoid) {
									var our_data = data[i + add];
									var cb_media = new_media(our_data.video || our_data.src, our_data.video);
									cb_media.setAttribute("data-imu-info", JSON_stringify(deepcopy(info, { json: true })));
									cb_media.setAttribute("data-imu-data", JSON_stringify(deepcopy(our_data, { json: true })));
									return options.cb(cb_media);
								}
							}
							if (!use_default_after)
								return options.cb(null);
							else
								return options.cb(get_next_in_gallery(options.element, nextprev));
						});
						return "waiting";
					}
					return "default";
				}
			};
		}
		if (host_domain_nosub === "tiktok.com") {
			return {
				gallery: function(el, nextprev) {
					if (el.tagName === "VIDEO" && el.parentElement && el.parentElement.parentElement) {
						if (el.parentElement.classList.contains("video-card") &&
							el.parentElement.parentElement.classList.contains("image-card")) {
							return get_next_in_gallery(el.parentElement.parentElement, nextprev);
						}
					}
					return "default";
				}
			};
		}
		if (host_domain_nowww === "twitter.com" ||
			host_domain_nowww === "x.com") {
			return {
				gallery: function(el, nextprev) {
					var is_photo_a = function(el) {
						return el.tagName === "A" && el.href && /\/status\/+[0-9]+\/+photo\/+/.test(el.href);
					};
					var get_img_from_photo_a = function(el) {
						var imgel = el.querySelector("img");
						if (imgel) {
							// don't return the <img> element because opacity: 0
							var prev = imgel.previousElementSibling;
							if (prev && prev.tagName === "DIV" && prev.style.backgroundImage)
								return prev;
						}
						return imgel;
					};
					var get_nextprev = function(el) {
						if (nextprev) {
							return el.nextElementSibling;
						} else {
							return el.previousElementSibling;
						}
					};
					var get_photoel_from_photo_container = function(nextel) {
						if (nextel.tagName === "A") {
							return get_img_from_photo_a(nextel);
						} else if (nextel.tagName === "DIV") {
							var childid = nextprev ? 0 : (nextel.children.length - 1);
							if (nextel.children.length > 0 && is_photo_a(nextel.children[childid])) {
								return get_img_from_photo_a(nextel.children[childid]);
							}
						} else {
							return "default";
						}
					};
					// tweet albums: https://twitter.com/phoronix/status/1229117085432926209
					var current = el;
					while ((current = current.parentElement)) {
						if (is_photo_a(current)) {
							var nextel = get_nextprev(current);
							if (nextel) {
								return get_photoel_from_photo_container(nextel);
							} else {
								var parent = current.parentElement;
								var sibling = get_nextprev(parent);
								if (sibling) {
									return get_photoel_from_photo_container(sibling);
								}
							}
							return null;
						}
					}
					return "default";
				},
				element_ok: function(el) {
					//var tweet = common_functions["get_twitter_video_tweet"](el, window);
					if (el.tagName === "VIDEO") {
						var tweet = common_functions["get_twitter_tweet_link"](el);
						if (tweet) {
							return true;
						}
					}
					return "default";
				}
			};
		}
		if (host_domain_nowww === "500px.com") {
			return {
				element_ok: function(el) {
					if (el.tagName === "A" && el.classList.contains("photo_link") && el.querySelector("div.nsfw_placeholder_content")) {
						return true;
					}
					return "default";
				}
			};
		}
		if (host_domain_nosub === "snapchat.com") {
			return {
				gallery: function(el, nextprev) {
					// useless because get_snapchat_info_from_el does this check for us
					if (false && el.tagName !== "VIDEO" && el.tagName !== "IMG")
						return "default";
					var info = common_functions["get_snapchat_info_from_el"](el);
					if (info) {
						common_functions["get_snapchat_storysharing"](real_api_cache, options.do_request, info.username, function(data) {
							if (!data) {
								return options.cb(null);
							}
							if (!("pos" in info) || info.pos === -1) {
								for (var i = 0; i < data.snaps.length; i++) {
									if (data.snaps[i].media.mediaUrl === info.url) {
										info.pos = i;
										break;
									}
								}
							}
							// mirroring to get_obj_from_snap_info
							if (info.pos === -1) {
								info.pos = data.snaps.length - 1;
							}
							if (!("pos" in info)) {
								return options.cb(null);
							}
							var diff = nextprev ? 1 : -1;
							var newpos = info.pos + diff;
							if (newpos < 0 || newpos >= data.snaps.length)
								return options.cb(null);
							var url = data.snaps[newpos].media.mediaUrl;
							var mediael = new_media(url, /\.mp4(?:[?#].*)?$/.test(url) && false);
							mediael.setAttribute("data-username", info.username);
							mediael.setAttribute("data-pos", newpos);
							mediael.setAttribute("data-url", url);
							mediael.setAttribute("data-imu", "true");
							return options.cb(mediael);
						});
						return "waiting";
					}
					return "default";
				},
				element_ok: function(el) {
					if (el.tagName === "VIDEO") {
						return true;
					}
					if (el.tagName === "DIV" && el.children.length === 1 && el.children[0].tagName === "VIDEO") {
						// to fix the pointer-events: none issue (thanks to remlap on discord for reporting)
						return el.children[0];
					}
					return "default";
				}
			};
		}
		if (host_domain_nosub === "allmusic.com") {
			return {
				gallery: function(el, nextprev) {
					// thanks to nimuxoha on github: https://github.com/qsniyg/maxurl/issues/279
					// https://www.allmusic.com/album/release/mr0002329530
					// https://www.allmusic.com/album/release/mr0002781134 -- no gallery
					// https://www.allmusic.com/album/release/mr0000570239
					// https://www.allmusic.com/album/release/mr0001144566 -- no gallery
					if (el.tagName !== "IMG" || !el.parentElement)
						return "default";
					if (!el.classList.contains("gallery-main-image"))
						return "default";
					var carousel_img = el.parentElement.querySelector("#carousel > ul > li.thumb-img > img.highlight-on");
					if (!carousel_img) {
						console_warn("Unable to find carousel thumbnail image");
						return "default";
					}
					var valid_or_null = function(el) {
						if (!el.classList.contains("thumb-img"))
							return null;
						return el.querySelector("img");
					};
					var li = carousel_img.parentElement;
					if (nextprev) {
						return valid_or_null(li.nextElementSibling);
					} else {
						return valid_or_null(li.previousElementSibling);
					}
				}
			};
		}
		if (host_domain_nosub === "flickr.com") {
			return {
				element_ok: function(el) {
					if (el.tagName === "DIV" && el.classList.contains("photo-well-media-scrappy-view")) {
						return true;
					}
					var current = el;
					while ((current = current.parentElement)) {
						if (current.tagName === "DIV" && current.classList.contains("restricted-interstitial")) {
							return true;
						}
					}
					return "default";
				}
			};
		}
		if (host_domain_nosub === "modelmayhem.com") {
			return {
				element_ok: function(el) {
					var current = el;
					while ((current = current.parentElement)) {
						// https://www.modelmayhem.com/portfolio/pic/45372959
						if (current.tagName === "DIV" && current.id === "viewpic") {
							return true;
						}
					}
					return "default";
				}
			};
		}
		if (host_domain_nowww === "imagefap.com" && /\/photo\/+[0-9]+\//.test(options.host_url)) {
			return {
				gallery: function(el, nextprev) {
					if (el.tagName !== "IMG" || !options.do_request)
						return "default";
					var is_navigation = false;
					var current = el.parentElement;
					if (!current && el.hasAttribute("data-imu-imagefap-album")) {
						is_navigation = true;
					} else {
						while ((current = current.parentElement)) {
							if ((current.tagName === "DIV" && current.id === "navigation") ||
								// main image
								current.tagName === "DIV" && current.classList.contains("image-wrapper")) {
								is_navigation = true;
								break;
							}
						}
					}
					if (!is_navigation)
						return "default";
					var query_imagefap_album = function(id, cb) {
						var cache_key = "imagefap_album:" + id;
						real_api_cache.fetch(cache_key, cb, function(done) {
							options.do_request({
								url: "https://www.imagefap.com/photo/" + id + "/",
								method: "GET",
								onload: function(resp) {
									if (resp.status !== 200) {
										console_error(cache_key, resp);
										return done(null, false);
									}
									var matches = match_all(resp.responseText, /<li>\s*<a href=\"https:\/\/[^/.]+\.imagefap\.com\/+images\/[^"]+".*?>\s*<img border=0 src2="(https:\/\/[^/.]+\.imagefap\.com\/[^"]+)"/);
									if (!matches) {
										console_warn(cache_key, "Unable to find album matches for", resp);
										return done(null, false);
									}
									var albumentries = [];
									array_foreach(matches, function(match) {
										albumentries.push(decode_entities(match[1]));
									});
									return done(albumentries, 60 * 60);
								}
							});
						});
					};
					var get_imagefap_photo_id = function(url) {
						var id = url.replace(/.*\/images\/+.*\/([0-9]+)\.[^/.]+(?:[?#].*)?$/, "$1");
						if (id !== url)
							return id;
						return null;
					};
					var our_photo_id = get_imagefap_photo_id(el.src);
					if (!our_photo_id)
						return "default";
					var our_album_id = options.host_url.match(/\/photo\/+([0-9]+)\//);
					our_album_id = our_album_id[1];
					query_imagefap_album(our_album_id, function(data) {
						if (!data) {
							return options.cb("default");
						}
						for (var i = 0; i < data.length; i++) {
							var data_id = get_imagefap_photo_id(data[i]);
							if (our_photo_id === data_id) {
								var nexti = i + (nextprev ? 1 : -1);
								if (nexti < 0 || nexti >= data.length) {
									return options.cb(null);
								} else {
									var our_el = new_image(data[nexti]);
									our_el.setAttribute("data-imu-imagefap-album", "true");
									return options.cb(our_el);
								}
							}
						}
						return options.cb("default");
					});
					return "waiting";
				}
			};
		}
		if (host_domain_nowww === "gog.com") {
			// https://www.gog.com/game/virtuaverse
			return {
				gallery: function(el, nextprev) {
					var current = el;
					while ((current = current.parentElement)) {
						if (current.tagName === "DIV" && current.classList.contains("productcard-thumbnails-slider__slide-item")) {
							var next_container = get_nextprev_el(current, nextprev);
							if (!next_container) {
								if (!current.parentElement.classList.contains("productcard-thumbnails-slider__slide")) {
									return null;
								}
								next_container = get_nextprev_el(current.parentElement, nextprev);
								if (!next_container)
									return null;
								if (!nextprev) {
									next_container = next_container.children[next_container.children.length - 1];
								} else {
									next_container = next_container.children[0];
								}
								if (!next_container)
									return null;
							}
							return next_container.querySelector("picture, img");
						}
					}
					return "default";
				}
			};
		}
		if (host_domain_nosub === "booth.pm") {
			return {
				element_ok: function(el) {
					// https://hawawa-temple.booth.pm/
					// thumbnails on https://hawawa-temple.booth.pm/items/1219489
					if (el.tagName === "DIV" && (el.classList.contains("swap-image") || el.classList.contains("thumb")) && el.children.length > 0 && el.children[0].tagName === "IMG") {
						return el.children[0];
					}
					return "default";
				}
			};
		}
		// no longer necessary due to blob being supported
		if (false && (common_functions["is_pinterest_domain"](host_domain) ||
			(host_domain_nowww === "nitter.net" ||
			// https://github.com/zedeus/nitter/wiki/Instances
			// sorting same as instance list in case we need to add new ones from it
			host_domain === "nitter.lacontrevoie.fr" ||
			host_domain === "nitter.nixnet.services" ||
			host_domain === "nitter.fdn.fr" ||
			host_domain === "nitter.1d4.us" ||
			host_domain === "nitter.kavin.rocks" ||
			host_domain === "nitter.unixfox.eu" ||
			host_domain === "nitter.domain.glass" ||
			host_domain === "birdsite.xanny.family" ||
			host_domain === "nitter.moomoo.me" ||
			host_domain === "bird.trom.tf" ||
			host_domain === "nitter.it" ||
			host_domain === "nitter.weiler.rocks" ||
			host_domain === "nitter.sethforprivacy.com" ||
			host_domain === "nitter.nl" ||
			host_domain === "nitter.mint.lgbt" ||
			host_domain === "nitter.esmailelbob.xyz" ||
			host_domain === "tw.artemislena.eu" ||
			host_domain === "nitter.tiekoetter.com" ||
			host_domain === "nitter.privacy.com.de" ||
			host_domain === "nitter.bird.froth.zone" ||
			host_domain === "nitter.cz" ||
			host_domain === "nitter.privacydev.net" ||
			host_domain === "tweet.lambda.dance" ||
			host_domain === "nitter.kylrth.com" ||
			host_domain === "unofficialbird.com" ||
			host_domain === "nitter.projectsegfau.lt" ||
			host_domain === "nitter.eu.projectsegfau.lt" ||
			host_domain === "nitter.in.projectsegfau.lt" ||
			host_domain === "singapore.unofficialbird.com" ||
			host_domain === "canada.unofficialbird.com" ||
			host_domain === "india.unofficialbird.com" ||
			host_domain === "nederland.unofficialbird.com" ||
			host_domain === "uk.unofficialbird.com" ||
			host_domain === "nitter.soopy.moe" ||
			host_domain === "nitter.qwik.space" ||
			host_domain === "read.whatever.social" ||
			host_domain === "nitter.rawbit.ninja" ||
			host_domain === "nt.vern.cc" ||
			host_domain === "n.sneed.network" ||
			host_domain === "nitter.smnz.de" ||
			host_domain === "nitter.twei.space" ||
			host_domain === "nitter.inpt.fr" ||
			host_domain === "nitter.d420.de" ||
			host_domain === "nitter.caioalonso.com" ||
			host_domain === "nitter.at" ||
			host_domain === "nitter.nicfab.eu" ||
			host_domain === "bird.habedieeh.re" ||
			host_domain === "nitter.hostux.net" ||
			host_domain === "nitter.adminforge.de" ||
			host_domain === "nitter.platypush.tech" ||
			host_domain === "nitter.us.projectsegfau.lt" ||
			host_domain === "t.com.sb" ||
			host_domain === "nitter.kling.gg" ||
			host_domain === "nitter.riverside.rocks" ||
			host_domain === "nitter.lunar.icu" ||
			host_domain === "twitter.moe.ngo" ||
			host_domain === "nitter.freedit.eu" ||
			host_domain === "n.opnxng.com" ||
			host_domain === "nitter.tux.pizza" ||
			host_domain === "nitter.altgr.xyz" ||
			host_domain === "jote.lile.cl" ||
			host_domain === "nitter.one" ||
			host_domain === "nitter.io.lol" ||
			host_domain === "nitter.no-logs.com" ||
			host_domain === "tweet.whateveritworks.org" ||
			host_domain === "nitter.fediflix.org" ||
			host_domain === "nitter.nohost.network" ||
			host_domain === "nitter.simpleprivacy.fr" ||
			host_domain === "nitter.onthescent.xyz" ||
			host_domain === "nitter.x86-64-unknown-linux-gnu.zip" ||
			host_domain === "nitter.private.coffee" ||
			host_domain === "nitter.oksocial.net" ||
			host_domain === "nitter.services.woodland.cafe" ||
			host_domain === "nitter.dafriser.be" ||
			host_domain === "nitter.catsarch.com" ||
			//host_domain === "nitter.13ad.de" ||
			//host_domain === "tw.openalgeria.org" ||
			host_domain === "nitter.42l.fr" ||
			host_domain === "nitter.pussthecat.org" ||
			//host_domain === "nitter.mastodont.cat" ||
			host_domain === "nitter.tedomum.net" ||
			host_domain === "nitter-home.kavin.rocks" ||
			host_domain === "nitter.cc" ||
			host_domain === "nitter.vxempire.xyz" ||
			host_domain === "nitter.eu" ||
			host_domain === "nitter.ethibox.fr" ||
			host_domain === "nitter.namazso.eu" ||
			host_domain === "nitter.mailstation.de" ||
			host_domain === "nitter.actionsack.com" ||
			host_domain === "nitter.cattube.org" ||
			host_domain === "nitter.40two.app" ||
			host_domain === "nitter.skrep.in" ||
			host_domain === "nitter.hu" ||
			host_domain === "nitter.database.red" ||
			host_domain === "nitter.exonip.de" ||
			host_domain === "twitr.gq" ||
			host_domain === "nitter.koyu.space" ||
			host_domain === "nitter.dark.fail" ||
			//host_domain === "t.maisputain.ovh" ||
			//host_domain === "nitter.weaponizedhumiliation.com" ||
			host_domain === "nitter.snopyta.org") ||
			host_domain_nowww === "nrk.no" ||
			host_domain_nowww === "local12.com" ||
			host_domain_nowww === "dailymotion.com" ||
			host_domain_nowww === "ok.ru")) {
			return {
				element_ok: function(el) {
					if (el.tagName === "VIDEO")
						return true;
				}
			};
		}
		if (host_domain_nosub === "instyle.com") {
			// thanks to remlap on discord for reporting: https://www.instyle.com/celebrity/zendaya-september-2020-cover
			return {
				element_ok: function(el) {
					if (el.tagName === "DIV" && el.classList.contains("lazy-image"))
						return el.querySelector(".image-overlay > img");
				}
			};
		}
		if (host_domain_nosub === "asiansister.com") {
			// thanks to Urkchar on discord for reporting
			return {
				element_ok: function(el) {
					if (el.tagName === "DIV" && el.id === "myModal") {
						return el.querySelector("img.modalTest-content");
					}
				}
			};
		}
		if (host_domain_nosub === "naver.com" && /\/viewer\/+postView\.nhn\?/.test(options.host_url)) {
			// thanks to Urkchar on discord for reporting
			return {
				gallery: function(el, nextprev) {
					var current = el;
					if (current.tagName === "IMG" && current.classList.contains("se_mediaImage")) {
						while ((current = current.parentElement)) {
							if (current.tagName === "DIV" && current.classList.contains("sect_dsc")) {
								var all_els = current.querySelectorAll("img.se_mediaImage");
								var nextprev_el = get_nextprev_from_list(el, all_els, nextprev);
								if (nextprev_el !== null) {
									return nextprev_el || null;
								}
							}
						}
					}
					return "default";
				}
			};
		}
		if (host_domain_nosub === "fetlife.com") {
			return {
				element_ok: function(el) {
					// a = profile link (image)
					if (el.tagName === "DIV" || el.tagName === "A") {
						for (var i = 0; i < el.children.length; i++) {
							var child = el.children[i];
							// .fl-disable-interaction is used for the profile pic when on the profile
							if (child.tagName === "IMG" && (child.classList.contains("ipp") || child.classList.contains("fl-disable-interaction"))) {
								return el.children[i];
							}
						}
					}
				}
			};
		}
		if (host_domain_nosub === "youtube.com") {
			return {
				element_ok: function(el) {
					// thanks to ambler on discord for reporting
					if (el.tagName === "DIV" && el.id === "background") {
						var newel = el.querySelector("div#backgroundFrontLayer");
						if (newel)
							return newel;
					}
				}
			};
		}
		if (host_domain_nowww === "ray-web.jp") {
			return {
				element_ok: function(el) {
					if (!el.children)
						return;
					var imgchild = null;
					array_foreach(el.children, function(child) {
						// all imgs are pointer-events: none
						if (child.tagName === "IMG") {
							imgchild = child;
							return false;
						}
					});
					if (imgchild)
						return imgchild;
				}
			};
		}
		if (host_domain_nowww === "klix.ba") {
			return {
				gallery: function(el, nextprev) {
					// thanks to AdClear247 on github for reporting: https://github.com/qsniyg/maxurl/issues/732
					var next_el = get_nextprev_from_thumbs(el, nextprev, {
						id_for_url: /.*\/([0-9]+\.[0-9]+)(?:_[^/.]+)?\.[a-z]+(?:[?#].*)?$/i,
						thumbs_selector: "div.galleria-thumbnails",
						thumb_selector: ".galleria-image > img"
					});
					return next_el !== false ? next_el : "default";
				}
			};
		}
		if (host_domain_nowww === "olx.ba") {
			return {
				gallery: function(el, nextprev) {
					// thanks to AdClear247 on github for reporting: https://github.com/qsniyg/maxurl/issues/732
					var next_el = get_nextprev_from_thumbs(el, nextprev, {
						id_for_url: /.*\/slika-([0-9]+-[0-9a-f]{5,})-[a-z]+\./i,
						thumbs_selector: "#fancybox-thumbs",
						thumbs_selector_global: true,
						thumb_selector: "li > a > img"
					});
					return next_el !== false ? next_el : "default";
				}
			};
		}
		if (host_domain_nowww === "asics.com") {
			return {
				gallery: function(el, nextprev) {
					var get_source_src = function(el) {
						if (el.tagName === "PICTURE") {
							var sourceel = el.querySelector("source");
							if (sourceel)
								return get_source_src(sourceel);
						} else if (el.tagName === "SOURCE") {
							return el.srcset;
						}
						return get_img_src(el);
					};
					// thanks to MinuteAd8502 on github for reporting: https://github.com/qsniyg/maxurl/issues/790
					var next_el = get_nextprev_from_thumbs(el, nextprev, {
						id_for_url: /.*\/is\/+image\/+asics\/+([^/.?#]+)(?:\.[^/]+?)?(?:[?#].*)?$/,
						get_img_src: get_source_src,
						thumbs_selector: "#thumbnails > ul div.slick-track",
						thumbs_selector_global: true,
						thumb_selector: "li.thumb > a > picture"
					});
					return next_el !== false ? next_el : "default";
				}
			};
		}
		if (host_domain_nowww === "bcy.net") {
			return {
				gallery: function(el, nextprev) {
					if (!el || el.tagName !== "IMG") {
						return "default";
					}
					// thanks to contextnerror on github for reporting: https://github.com/qsniyg/maxurl/issues/972
					// post page: https://bcy.net/item/detail/7021519360804002846?_source_page=
					// 10 images: https://bcy.net/item/detail/7042569063217765412?_source_page=
					var get_postpage_gallery = function() {
						return get_nextprev_from_tree(el, nextprev, [
							{ tagName: "IMG" },
							{ tagName: "DIV", classList: ["img-wrap-inner"] },
							{ tagName: "DIV", classList: ["img-wrap"] },
							{ tagName: "DIV", classList: ["inner-container"] }
						], ".inner-container > .img-wrap > .img-wrap-inner > img");
					};
					var get_profilepage_gallery = function() {
						return get_nextprev_from_list(el, document.querySelectorAll("li.li_item_box a.img_box img"), nextprev);
					};
					var value = get_postpage_gallery();
					if (value !== "default")
						return value;
					value = get_profilepage_gallery();
					if (value !== "default")
						return value;
					return "default";
				}
			};
		}
		if (host_domain_nowww === "sfmoma.org") {
			return {
				element_ok: function(el) {
					if (el.tagName === "CANVAS")
						return true;
				}
			};
		}
		if (host_domain_nowww === "behance.net") {
			return {
				element_replace: function(el) {
					if (el.matches("span.grid__item-filler") && el.previousElementSibling) {
						var prev = el.previousElementSibling;
						if (prev.matches("img.grid__item-image")) {
							return prev;
						}
					}
				}
			};
		}
		if (host_domain_nowww === "alamy.com") {
			return {
				element_ok: function(el) {
					if (el.tagName.toUpperCase() === "SVG")
						return true;
				}
			};
		}
		if (host_domain_nosub === "reddit.com") {
			return {
				gallery: function(el, nextprev) {
					if (el.tagName.toUpperCase() === "A" && el.parentElement &&
						el.parentElement.tagName.toUpperCase() === "P" && el.parentElement.classList.contains("title")) {
						return get_nextprev_from_tree(el, nextprev, [
							{ tagName: "A" },
							{ tagName: "P", classList: ["p.title"] },
							{ tagName: "DIV", classList: ["top-matter"] },
							{ tagName: "DIV", classList: ["entry"] },
							{ tagName: "DIV", classList: ["thing"] },
						], ".thing > .entry > .top-matter > p.title > a");
					}
				}
			};
		}
		if (host_domain_nowww === "gofile.io") {
			return {
				element_ok: function(el) {
					// FIXME: this disregards the mouseover_links setting
					if (el.tagName.toUpperCase() === "A" && el.classList.contains("contentLink"))
						return true;
				},
				gallery: function(el, nextprev) {
					if (el.tagName.toUpperCase() === "A" && el.classList.contains("contentLink")) {
						return get_nextprev_from_tree(el, nextprev, [
							{ tagName: "A", attrs: { class: el.getAttribute("class") } },
							{ tagName: "DIV" },
							{ tagName: "DIV", classList: ["contentId"] }
						], ".contentId > div > a[class=\"" + el.getAttribute("class") + "\"]");
					}
				}
			};
		}
		if (host_domain_nosub === "cnn.com") {
			return {
				element_ok: function(el) {
					if (el.tagName.toUpperCase() === "BUTTON" && (el.classList.contains("gallery-inline__next-overlay") ||
						el.classList.contains("gallery-inline__prev-overlay"))) {
						var parent_8 = el.parentElement;
						if (parent_8.classList.contains("gallery-inline__container")) {
							var slides = parent_8.querySelector(".gallery-inline__slides");
							return {
								el: slides,
								search: true
							};
						}
					}
				}
			};
		}
		// myportfolio
		if (host_domain_nowww === "kalyanyasaswi.com") {
			// thanks to anonymous for reporting:
			return {
				element_ok: function(el) {
					if (el.tagName.toUpperCase() === "SPAN" && el.classList.contains("grid__item-filler")) {
						var prev = el.previousElementSibling;
						if (prev && prev.tagName.toUpperCase() === "IMG" && prev.classList.contains("grid__item-image"))
							return prev;
					}
				}
			};
		}
		if (host_domain === "open.spotify.com") {
			// thanks to anonymous for reporting:
			// public lists on spotify user profiles
			return {
				element_ok: function(el) {
					if (el.getAttribute("data-testid") === "card-click-handler") {
						var prev = el.previousElementSibling;
						if (prev)
							prev = prev.previousElementSibling;
						if (prev && prev.tagName === "DIV") {
							return {
								el: prev,
								search: true
							};
						}
					}
				}
			};
		}
		return null;
	};
	var _get_album_info_gallery = function(album_info, el, nextprev) {
		if (album_info.type === "links") {
			var current_link_id = -1;
			array_foreach(album_info.links, function(link, i) {
				if (link.is_current) {
					current_link_id = i;
					return false;
				}
			});
			// unable to find current link
			if (current_link_id < 0)
				return null;
			for (var i = 0; i < album_info.links.length; i++) {
				delete album_info.links[i].is_current;
			}
			current_link_id += nextprev ? 1 : -1;
			if (current_link_id < 0 || current_link_id >= album_info.links.length)
				return false; // or null if we want to be able to move past the current gallery
			album_info.links[current_link_id].is_current = true;
			return album_info.links[current_link_id].url;
		}
		// unsupported type
		return null;
	};
	var get_album_info_gallery = function(popup_obj, el, nextprev) {
		var album_info;
		if (popup_obj)
			album_info = popup_obj.album_info;
		if (el) {
			var album_info_json = el.getAttribute("imu-album-info");
			if (album_info_json) {
				try {
					album_info = JSON_parse(album_info_json);
				} catch (e) {
					console_error(e);
				}
			}
		}
		if (!album_info)
			return null;
		album_info = deepcopy(album_info);
		var result = _get_album_info_gallery(album_info, el, nextprev);
		if (!result)
			return result;
		if (typeof result === "string") {
			var url = result;
			result = document_createElement("img");
			// don't set src, because otherwise the browser will try to load it
			result.setAttribute("data-imu-fake-src", url);
		}
		if (!result.hasAttribute("imu-album-info")) {
			// album_info can be modified by _get_album_info_gallery, so we must re-stringify it
			result.setAttribute("imu-album-info", JSON_stringify(album_info));
		}
		return result;
	};
	var get_next_in_gallery = null;
	var fullurl_obj = function(currenturl, obj) {
		if (!obj)
			return obj;
		if (!is_array(obj)) {
			obj = [obj];
		}
		var newobj = [];
		array_foreach(obj, function(url) {
			if (typeof (url) === "string") {
				newobj.push(fullurl(currenturl, url));
			} else {
				if (url.url) {
					if (is_array(url.url)) {
						for (var i = 0; i < url.url.length; i++) {
							url.url[i] = fullurl(currenturl, url.url[i]);
						}
					} else {
						url.url = fullurl(currenturl, url.url);
					}
				}
				newobj.push(url);
			}
		});
		return newobj;
	};
	var same_url = function(url, obj) {
		obj = fillobj(obj);
		if (obj[0] && obj[0].url === url)
			return true;
		return false;
	};
	var remove_webarchive_proxy = function(url) {
		return url.replace(/^[a-z]+:\/\/[^/]+\/+web\/+[0-9*]+\/+(https?:\/\/)/, "$1");
	};
	var get_bigimage_extoptions_first = function(options) {
		var our_settings = [
			"allow_thirdparty",
			"allow_apicalls",
			"allow_thirdparty_libs",
			"allow_thirdparty_code",
			{
				our: "process_format",
				settings: "process_format",
				obj: true
			}
		];
		for (var i = 0; i < our_settings.length; i++) {
			var our_setting_obj = our_settings[i];
			var our_setting;
			var settings_setting;
			var is_obj = false;
			if (typeof our_setting_obj === "string") {
				our_setting = our_setting_obj;
				settings_setting = our_setting;
			} else {
				our_setting = our_setting_obj.our;
				settings_setting = our_setting_obj.settings;
				is_obj = !!our_setting_obj.obj;
			}
			if (!is_obj) {
				if (!(our_setting in options)) {
					options[our_setting] = (settings[settings_setting] + "") === "true";
				}
			} else {
				if (!(our_setting in options)) {
					options[our_setting] = {};
				}
				obj_foreach(settings[settings_setting], function(key, value) {
					if (!(key in options[our_setting])) {
						options[our_setting][key] = value;
					}
				});
			}
		}
		return options;
	};
	var get_bigimage_extoptions = function(options) {
		if ("exclude_problems" in options) {
			for (var option in settings) {
				if (option in option_to_problems) {
					var problem = option_to_problems[option];
					var index = array_indexof(options.exclude_problems, problem);
					if (settings[option]) {
						if (index >= 0)
							options.exclude_problems.splice(index, 1);
					} else {
						if (index < 0)
							options.exclude_problems.push(problem);
					}
				}
			}
		}
		if (!options.allow_apicalls) {
			options.do_request = null;
		}
		if ("rule_specific" in options) {
			var rule_specific_map = {
				"deviantart_prefer_size": true,
				"deviantart_support_download": true,
				"ehentai_full_image": true,
				"imgur_filename": true,
				"imgur_source": true,
				"instagram_use_app_api": true,
				"instagram_dont_use_web": true,
				"instagram_prefer_video_quality": true,
				"instagram_gallery_postlink": true,
				"snapchat_orig_media": true,
				teddit_redirect_reddit: true,
				"tiktok_app_api": true,
				"tiktok_no_watermarks": true,
				"tiktok_thirdparty": true,
				"tumblr_api_key": true,
				"twitter_use_ext": true,
				"youtube_replace_n": true,
				"mouseover_linked_image": "linked_image"
			};
			for (var rule_specific in rule_specific_map) {
				var rule_specific_value = rule_specific_map[rule_specific];
				if (rule_specific_value === true) {
					rule_specific_value = rule_specific;
				}
				options.rule_specific[rule_specific_value] = settings[rule_specific];
			}
		}
		// Doing this here breaks things like Imgur, which will redirect to an image if a video was opened in a new tab
		if (false && !settings.allow_video) {
			options.exclude_videos = true;
		} else {
			options.exclude_videos = false;
		}
		if (settings.allow_webarchive) {
			if (options.host_url) {
				options.host_url = remove_webarchive_proxy(options.host_url);
			}
		}
		return options;
	};
	var bigimage_recursive = function(url, options) {
		// breaks element_ok on elements without sources
		if (false && !url)
			return url;
		if (!options)
			options = {};
		if (is_userscript || is_extension) {
			get_bigimage_extoptions_first(options);
		}
		for (var option in bigimage_recursive.default_options) {
			if (!(option in options)) {
				options[option] = deepcopy(bigimage_recursive.default_options[option]);
				continue;
			}
			if (is_iterable_object(options[option])) {
				for (var rsoption in bigimage_recursive.default_options[option]) {
					if (!(rsoption in options[option])) {
						options[option][rsoption] = deepcopy(bigimage_recursive.default_options[option][rsoption]);
					}
				}
			}
		}
		if (is_userscript || is_extension) {
			get_bigimage_extoptions(options);
			if (settings.allow_webarchive && typeof url === "string") {
				url = remove_webarchive_proxy(url);
			}
		}
		var waiting = false;
		var forcerecurse = false;
		var url_is_data = false;
		var origurl = url;
		if (typeof url === "string" && /^(?:data|blob):/.test(url)) {
			url_is_data = true;
		}
		var newhref = url;
		var endhref;
		var currenthref = url;
		var pasthrefs = [url];
		//var lastobj = fillobj(newhref);
		//var lastobj = newhref;
		var pastobjs = [];
		var currentobj = null;
		var used_cache = false;
		var loop_i = 0;
		// for tests
		var our_bigimage = options._internal_bigimage || bigimage;
		var do_cache = function() {
			if (_nir_debug_) nir_debug("bigimage_recursive", "do_cache (endhref, currentobj):", deepcopy(endhref), deepcopy(currentobj));
			if (!endhref)
				return;
			if (!get_currenthref(endhref))
				return;
			var cache_endhref = fillobj(endhref, currentobj);
			if (!cache_endhref || !cache_endhref.can_cache) {
				if (_nir_debug_) nir_debug("bigimage_recursive", "do_cache: skipping cache because cache_endhref.can_cache == false");
				return;
			}
			currenthref = get_currenthref(cache_endhref);
			if (!currenthref)
				return;
			if (!used_cache && (options.use_cache === true) && !waiting) {
				for (var i = 0; i < pasthrefs.length; i++) {
					var href = pasthrefs[i];
					if (href) {
						if (_nir_debug_) nir_debug("bigimage_recursive", "do_cache:", href, "=", deepcopy(cache_endhref));
						url_cache.set(href, deepcopy(cache_endhref), options.urlcache_time);
					}
				}
			}
		};
		var get_currenthref = function(objified) {
			if (!objified) {
				return objified;
			}
			if (is_array(objified)) {
				objified = objified[0];
			}
			if (!objified) {
				return objified;
			}
			if (is_array(objified.url))
				currenthref = objified.url[0];
			else
				currenthref = objified.url;
			return currenthref;
		};
		var prop_in_objified = function(prop, objified) {
			if (!is_array(objified)) {
				objified = [objified];
			}
			var found_prop = false;
			array_foreach(objified, function(obj) {
				if (typeof obj !== "object")
					return;
				if (prop in obj) {
					found_prop = true;
					return false;
				}
			});
			return found_prop;
		};
		var parse_bigimage = function(big) {
			if (_nir_debug_) nir_debug("bigimage_recursive", "parse_bigimage (big)", deepcopy(big));
			if (!big) {
				if (newhref === url && options.null_if_no_change)
					newhref = big;
				return false;
			}
			var newhref1 = fullurl_obj(currenthref, big);
			if (_nir_debug_) nir_debug("bigimage_recursive", "parse_bigimage (newhref1)", deepcopy(newhref1));
			if (!newhref1) {
				return false;
			}
			var copy_props = ["extra", "album_info"];
			// Copy important old properties
			var important_properties = {};
			if (pastobjs.length > 0) {
				if (pastobjs[0].likely_broken)
					important_properties.likely_broken = pastobjs[0].likely_broken;
				if (pastobjs[0].fake)
					important_properties.fake = pastobjs[0].fake;
				array_foreach(copy_props, function(prop) {
					//console_log(prop, deepcopy(pastobjs[0]));
					if (prop in pastobjs[0] && pastobjs[0][prop]) {
						important_properties[prop] = deepcopy(pastobjs[0][prop]);
					}
				});
			}
			var objified = fillobj(deepcopy(newhref1), important_properties);
			if (_nir_debug_) nir_debug("bigimage_recursive", "parse_bigimage (objified)", deepcopy(objified));
			for (var i = 0; i < objified.length; i++) {
				objified[i] = deepcopy(objified[i]); // ensure no references are kept between objects
				var obj = objified[i];
				var remove_obj = function() {
					if (_nir_debug_) nir_debug("bigimage_recursive", "parse_bigimage (removing obj)");
					objified.splice(i, 1);
					if (is_array(newhref1)) {
						newhref1.splice(i, 1);
					}
					i--;
				};
				// Remove null URLs
				if (obj.url === null && !obj.waiting) {
					remove_obj();
					continue;
				}
				if (obj.url === "" && url_is_data) {
					obj.url = origurl;
				}
				// Remove problems in exclude_problems
				for (var problem in obj.problems) {
					if (obj.problems[problem] &&
						array_indexof(options.exclude_problems, problem) >= 0) {
						if (_nir_debug_) nir_debug("bigimage_recursive", "Removing problematic:", obj.url, "because of", problem);
						remove_obj();
						continue;
					}
				}
				if (obj.url && options.filter && !options.filter(obj.url)) {
					console_log("Blacklisted:", obj.url);
					remove_obj();
					continue;
				}
				if (options.exclude_videos && obj.media_info.type === "video") {
					remove_obj();
					continue;
				}
				if (pastobjs[0]) {
					if (obj._copy_old_props) {
						for (var j = 0; j < obj._copy_old_props.length; j++) {
							var prop = obj._copy_old_props[j];
							obj[prop] = deepcopy(pastobjs[0][prop]);
						}
					}
				}
			}
			if (_nir_debug_) nir_debug("bigimage_recursive", "parse_bigimage (objified, processed)", deepcopy(objified));
			if (objified.length === 0) {
				if (_nir_debug_) nir_debug("bigimage_recursive", "parse_bigimage: objified.length == 0");
				return false;
			}
			waiting = false;
			forcerecurse = false;
			var temp_newhref1 = newhref1;
			if (is_array(newhref1))
				temp_newhref1 = newhref1[0];
			if (typeof (temp_newhref1) === "object") {
				currentobj = newhref1;
				if (temp_newhref1.waiting) {
					waiting = true;
					if (!temp_newhref1.url) {
						newhref = newhref1;
						return false;
					}
				}
				if (temp_newhref1.forcerecurse) {
					forcerecurse = true;
				}
			} else {
				currentobj = null;
			}
			// check if objified (our object) has the same url/href as the last url (currenthref)
			if (same_url(currenthref, objified) && !forcerecurse) {
				if (_nir_debug_) nir_debug("bigimage_recursive", "parse_bigimage: sameurl(currenthref, objified) == true (newhref, nh1, pastobjs)", deepcopy(currenthref), deepcopy(objified), deepcopy(newhref), deepcopy(newhref1), deepcopy(pastobjs));
				// FIXME: this is a terrible hack
				try {
					var cond = !options.fill_object || (newhref[0].waiting === true && !objified[0].waiting);
					if (cond) {
						newhref = objified;
					} else if (pastobjs.length) {
						// TODO: refactor
						var _apply = function(newobj) {
							array_foreach(basic_fillobj(newobj), function(sobj, i) {
								sobj = deepcopy(sobj);
								// FIXME? untested (url should resolve to the one right below it)
								if (!sobj.url) {
									sobj.url = currenthref;
								}
								for (var _i = 0, pastobjs_1 = pastobjs; _i < pastobjs_1.length; _i++) {
									var psobj = pastobjs_1[_i];
									if (psobj.url === sobj.url) {
										for (prop in sobj) {
											psobj[prop] = sobj[prop];
										}
										break;
									}
								}
							});
						};
						_apply(newhref);
						// strikinglycdn needs newhref1 to be applied, because it has two rules, the cloudinary one, then the {url: src, can_head: false} one
						// the second one is only set in newhref1, not newhref
						_apply(newhref1);
						// _apply is also needed for bigimage'd album_links
						// thanks to fireattack on discord for reporting:
						// https://repotama.com/wp-content/uploads/2023/11/am_gakusai2023_01.jpg without audio redirection enabled crashes because the object isn't filled
						// pastobjs.length check is needed because pastobjs = [] in this case
						newhref = null;
						currentobj = pastobjs[0];
					}
					if (false) {
						if (!cond) {
							array_foreach(copy_props, function(prop) {
								// using newhref1 instead of objified because otherwise it'll always be true (objified is the filled object, all props are in it)
								// the prop_in_objified check breaks facebook albums
								// [photo.php, post] -> [url+extra, photo.php] (album_info is missing because url is just a url, doesn't have album_info)
								//   but newhref = [url+extra, photo.php]
								//   we don't want to disregard newhref, as it contains new information (extra)
								//   newhref1 = [url]
								// but removing it breaks normal photos, e.g. mixdrop:
								// mp4(+headers) -> return src (.mp4 without headers)
								if (!(prop in newhref[0]) && (prop in important_properties) /*&& prop_in_objified(prop, newhref1)*/) {
									cond = true;
									return false;
								}
							});
						}
						if (cond)
							newhref = objified;
					}
				} catch (e) { }
				return false;
			} else {
				if (!forcerecurse) {
					for (var i = 0; i < pasthrefs.length; i++) {
						if (same_url(pasthrefs[i], objified)) {
							if (_nir_debug_) nir_debug("bigimage_recursive", "parse_bigimage: sameurl(pasthrefs[" + i + "], objified) == true", deepcopy(pasthrefs[i]), deepcopy(objified), deepcopy(newhref));
							// TODO: copy changes above here, or better yet, refactor
							//   copied over the newhref = objified code, hopefully this doesn't break anything
							//   this is needed for klix.ba when a largest _xxl.jpg is opened in a popup, reported here: https://github.com/qsniyg/maxurl/issues/732
							// FIXME: is this even correct?
							var cond = false;
							if (false && newhref && newhref.length) {
								array_foreach(copy_props, function(prop) {
									// using newhref1 instead of objified because otherwise it'll always be true? (objified is the filled object, all props are in it)
									if (!(typeof newhref[0] === "object" && (prop in newhref[0])) && (prop in important_properties) && prop_in_objified(prop, newhref1)) {
										cond = true;
										return false;
									}
								});
							}
							if (cond || true)
								newhref = objified;
							return false;
						}
					}
				}
				if (_nir_debug_) nir_debug("bigimage_recursive", "parse_bigimage: setting currenthref and newhref");
				currenthref = get_currenthref(objified);
				newhref = newhref1;
			}
			pasthrefs.push(currenthref);
			// Prepend objified to pastobjs
			var current_pastobjs = [];
			array_extend(current_pastobjs, objified);
			array_extend(current_pastobjs, pastobjs);
			pastobjs = current_pastobjs;
			if (false && !waiting) {
				// lastobj isn't used
				// commenting out because lastobj doesn't exist
				//lastobj = newhref;
			}
			if (objified[0].norecurse)
				return false;
			if (_nir_debug_ && _nir_debug_.no_recurse) {
				return false;
			}
			return true;
		};
		var do_bigimage = function() {
			if (_nir_debug_) nir_debug("bigimage_recursive", "do_bigimage", currenthref, deepcopy(options));
			if (options.use_cache && url_cache.has(currenthref) && !forcerecurse) {
				if (_nir_debug_) nir_debug("bigimage_recursive", "do_bigimage: newhref = url_cache[" + currenthref + "]", deepcopy(url_cache.get(currenthref)));
				newhref = url_cache.get(currenthref);
				used_cache = true;
				return false;
			}
			if (options.filter) {
				if (!options.filter(currenthref)) {
					console_log("Blacklisted: " + currenthref);
					return false;
				}
			}
			var big;
			if (options.catch_errors) {
				try {
					big = our_bigimage(currenthref, options);
				} catch (e) {
					console_error(e);
					console_error(e.stack);
				}
			} else {
				big = our_bigimage(currenthref, options);
			}
			return parse_bigimage(big);
		};
		var finalize = function() {
			if (options.fill_object) {
				if (_nir_debug_) nir_debug("bigimage_recursive", "finalize (fillobj(newhref, currentobj), pastobjs)", deepcopy(newhref), deepcopy(currentobj), deepcopy(pastobjs));
				// why the used_cache check? this breaks e.g. twitter api, where it returns multiple urls [orig, large, etc.] with extra, but the original one (from the twimg) rule doesn't have it
				// reason why is because fillobj will only look at the first entry from currentobj
				if ( /*used_cache &&*/newhref === null) {
					// for some reason, after the TS rewrite, currentobj is not an array. we need to basic_fillobj it
					endhref = basic_fillobj(deepcopy(currentobj));
				} else {
					// the reason for using fillobj(..., currentobj) is for objects that add to the last object (e.g. {url: src, head_wrong_contentlength: true})
					endhref = fillobj(deepcopy(newhref), currentobj);
				}
				if (options.include_pastobjs) {
					for (var i = 0; i < pastobjs.length; i++) {
						if (obj_indexOf(endhref, pastobjs[i].url) < 0 && !pastobjs[i].fake)
							endhref.push(deepcopy(pastobjs[i]));
					}
				}
			} else {
				if (_nir_debug_) nir_debug("bigimage_recursive", "finalize (newhref)", deepcopy(newhref));
				endhref = deepcopy(newhref);
			}
			if (_nir_debug_) nir_debug("bigimage_recursive", "endhref =", deepcopy(endhref));
		};
		var cb = null;
		if (options.cb) {
			var orig_cb = options.cb;
			options.cb = function(x) {
				// Is this needed?
				if (false) {
					for (var i = 0; i < pastobjs.length; i++) {
						if (pastobjs[i].url === null && pastobjs[i].waiting) {
							pastobjs.splice(i, 1);
							i--;
						}
					}
					;
				}
				if (_nir_debug_) nir_debug("bigimage_recursive", "options.cb", deepcopy(x));
				var do_end = function() {
					if (_nir_debug_) nir_debug("bigimage_recursive", "do_end");
					finalize();
					do_cache();
					var blankurl = null;
					if (!options.null_if_no_change)
						blankurl = pasthrefs[pasthrefs.length - 1];
					if (!endhref || (is_array(endhref) && !endhref[0])) {
						endhref = blankurl;
					} else if (typeof endhref === "string") {
						endhref = blankurl;
					} else if (is_array(endhref) && typeof endhref[0] === "string") {
						endhref[0] = blankurl;
					} else if (is_array(endhref) && endhref[0] && !endhref[0].url) {
						endhref[0].url = blankurl;
					}
					// hacky workaround for https://github.com/qsniyg/maxurl/issues/583
					// fails with fill_object, but that option hasn't worked properly for a very long time anyways
					if (!is_array(endhref)) {
						endhref = [endhref];
					}
					if (_nir_debug_) nir_debug("bigimage_recursive", "do_end (endhref, pasthrefs, pastobjs)", deepcopy(endhref), deepcopy(pasthrefs), deepcopy(pastobjs));
					orig_cb(endhref);
				};
				var parseresult = parse_bigimage(x);
				if ((!parseresult || (loop_i + 1) >= options.iterations) && !forcerecurse) {
					do_end();
				} else {
					for (; loop_i < options.iterations; loop_i++) {
						if (!do_bigimage()) {
							break;
						}
					}
					if (!waiting) {
						do_end();
					}
				}
			};
		}
		options._internal_info = {};
		for (loop_i = 0; loop_i < options.iterations; loop_i++) {
			if (!do_bigimage())
				break;
		}
		if (_nir_debug_) nir_debug("bigimage_recursive", "return finalize");
		finalize();
		do_cache();
		newhref = null;
		if (options.cb && !waiting) {
			options.cb(endhref);
		}
		return deepcopy(endhref);
	};
	bigimage_recursive.default_options = default_options;
	bigimage_recursive.internal = {
		settings: settings,
		settings_meta: settings_meta,
		strings: strings
	};
	function is_internet_url(url) {
		if (!url || typeof url !== "string")
			return false;
		if (!/^https?:\/\//.test(url))
			return false;
		// local addresses (IPv4)
		if (/^[a-z]+:\/\/(127\.0\.0\.1|192\.168\.[0-9]+\.[0-9]+|10\.[0-9]+\.[0-9]+\.[0-9]+|172\.(?:1[6-9]|2[0-9]|3[01])\.[0-9]+\.[0-9]+|localhost|[^/.]+)\//.test(url))
			return false;
		// IPv6 (TODO: implement)
		if (/^[a-z]+:\/\/(?:[0-9a-f]*\:){1,}\//.test(url))
			return false;
		return true;
	}
	bigimage_recursive.is_internet_url = is_internet_url;
	function clear_all_caches() {
		url_cache.clear();
		real_api_cache.clear();
		cookie_cache.clear();
	}
	bigimage_recursive.clear_caches = clear_all_caches;
	// tests
	if (false) {
		var fake_bigimage = function(src, options) {
			var origsrc = src;
			var nodomain = src.replace(/^[a-z]+:\/\/[^/]+\/+/, "");
			if (nodomain === "test1") {
				return "out_test1"; // should return https://www.example.com/out_test1
			}
			if (options.null_if_no_change) {
				if (src !== origsrc)
					return src;
				return null;
			}
		};
	}
	var obj_to_simplelist = function(obj) {
		var out = [];
		for (var i = 0; i < obj.length; i++) {
			out.push(obj[i].url);
		}
		return out;
	};
	var obj_indexOf = function(obj, url) {
		return array_indexof(obj_to_simplelist(obj), url);
	};
	var obj_merge = function(newobj, oldobj) {
		var newobj_simple = obj_to_simplelist(newobj);
		for (var i = 0; i < oldobj.length; i++) {
			var index = array_indexof(newobj_simple, oldobj[i].url);
			if (index >= 0) {
				for (var key in oldobj[i]) {
					var old_value = oldobj[i][key];
					var new_value = newobj[index][key];
					// e.g. for headers, extra, etc.
					if (new_value !== old_value && JSON_stringify(new_value) === JSON_stringify(default_object[key])) {
						newobj[index][key] = old_value;
					}
				}
				continue;
			}
			newobj.push(oldobj[i]);
		}
		return newobj;
	};
	var bigimage_recursive_loop = function(url, options, query, state) {
		var newoptions = {};
		if (!state) {
			state = {
				fine_urls: [],
				tried_urls: [],
				oldobj: [],
				tried_imus: [],
				redirect_map: {} // FIXME: is this needed?
			};
		}
		var fine_urls = state.fine_urls;
		var tried_urls = state.tried_urls;
		var oldobj = state.oldobj;
		var already_tried_url = false;
		for (var _i = 0, _a = state.tried_imus; _i < _a.length; _i++) {
			var tried_url = _a[_i];
			if (tried_url === url) {
				already_tried_url = true;
			}
		}
		state.tried_imus.push(url);
		for (var option in options) {
			if (option === "cb") {
				newoptions.cb = function(obj) {
					if (_nir_debug_) {
						console_log("bigimage_recursive_loop's cb: obj:", deepcopy(obj));
						console_log("bigimage_recursive_loop's cb: oldobj:", deepcopy(oldobj));
					}
					obj = obj_merge(obj, oldobj);
					var image_urls = obj_to_simplelist(obj);
					for (var i = 0; i < obj.length; i++) {
						// TODO: also remove bad_if
						if (obj[i].bad) {
							var bad_url = obj[i].url;
							obj.splice(i, 1);
							image_urls.splice(i, 1);
							i--;
							for (var j = 0; j < tried_urls.length; j++) {
								if (tried_urls[j].newurl === bad_url) {
									var orig_url = tried_urls[j].newobj.url;
									var index = array_indexof(image_urls, orig_url);
									tried_urls[j].redirects_to_bad = true;
									if (index >= 0) {
										obj.splice(index, 1);
										image_urls.splice(index, 1);
										if (index < i)
											i -= 2;
										else if (index === i)
											i--;
										break;
									}
								}
							}
						}
						// FIXME: is this needed?
						if (false && obj[i].url in state.redirect_map) {
							var to = state.redirect_map[obj[i].url];
							var j = void 0;
							for (j = i + 1; j < obj.length; j++) {
								if (obj[j].url === to) {
									obj.splice(i, j - i);
									image_urls.splice(i, j - i);
									break;
								}
							}
							i -= 1;
						}
					}
					if (_nir_debug_) {
						console_log("bigimage_recursive_loop's cb: obj after:", deepcopy(obj));
						console_log("bigimage_recursive_loop's cb: image_urls after:", deepcopy(image_urls));
						console_log("bigimage_recursive_loop's cb: fine_urls:", deepcopy(fine_urls));
						console_log("bigimage_recursive_loop's cb: tried_urls:", deepcopy(tried_urls));
					}
					for (var i = 0; i < fine_urls.length; i++) {
						var index = array_indexof(image_urls, fine_urls[i].url);
						if (index >= 0) {
							obj = [obj[index]];
							if (_nir_debug_) {
								console_log("bigimage_recursive_loop's cb: returning fine_url", deepcopy(obj), deepcopy(fine_urls[i]));
							}
							return options.cb(obj, fine_urls[i].data);
						}
					}
					var try_any = false;
					for (var i = 0; i < tried_urls.length; i++) {
						if (tried_urls[i].url === url || try_any) {
							if (tried_urls[i].redirects_to_bad === true) {
								try_any = true;
								continue;
							}
							var index = array_indexof(image_urls, tried_urls[i].newurl);
							if (index >= 0) {
								obj = [obj[index]];
								if (_nir_debug_) {
									console_log("bigimage_recursive_loop's cb: returning tried_url", deepcopy(obj), deepcopy(tried_urls[i]), try_any);
								}
								return options.cb(obj, tried_urls[i].data);
							} else {
								if (_nir_debug_) {
									console_log("bigimage_recursive_loop's cb: returning null tried_url", deepcopy(tried_urls[i]), try_any);
								}
								return options.cb(null, tried_urls[i].data);
							}
						}
					}
					if (_nir_debug_) {
						console_log("bigimage_recursive_loop: about to query", deepcopy(obj));
					}
					query(obj, function(newurl, newobj, data) {
						if (_nir_debug_) {
							console_log("bigimage_recursive_loop (query: newurl, newobj, data):", deepcopy(newurl), deepcopy(newobj), data);
						}
						if (!newurl) {
							if (_nir_debug_) {
								console_log("bigimage_recursive_loop (query): returning null", data);
							}
							return options.cb(null, data);
						}
						fine_urls.push({
							url: newurl,
							data: data
						});
						tried_urls.push({
							url: url,
							data: data,
							newurl: newurl,
							newobj: deepcopy(newobj),
							redirects_to_bad: false
						});
						state.redirect_map[url] = newurl;
						//if (array_indexof(image_urls, newurl) < 0 && newurl !== url || true) {
						var newurl_index = array_indexof(image_urls, newurl);
						if (newurl_index < 0 && already_tried_url) {
							if (_nir_debug_) {
								console_log("bigimage_recursive_loop (query): already tried url", deepcopy(state));
							}
							return options.cb(null, data);
						}
						if (newurl_index < 0 || !obj[newurl_index].norecurse) {
							state.oldobj = obj;
							bigimage_recursive_loop(newurl, options, query, state);
						} else {
							//obj = obj.slice(array_indexof(image_urls, newurl));
							obj = [obj[newurl_index]];
							if (_nir_debug_) {
								console_log("bigimage_recursive_loop (query): returning", deepcopy(obj), data);
							}
							options.cb(obj, data);
						}
					});
				};
			} else {
				newoptions[option] = options[option];
			}
		}
		if (_nir_debug_) {
			console_log("bigimage_recursive_loop", url, deepcopy(options), query, deepcopy(state));
		}
		return bigimage_recursive(url, newoptions);
	};
	bigimage_recursive.loop = bigimage_recursive_loop;
	var get_tagname = function(el) {
		return el.tagName.toUpperCase();
	};
	var get_computed_style = function(el) {
		return el.currentStyle || window.getComputedStyle(el);
	};
	var get_svg_src = function(el) {
		var remove_attributes = [
			"class",
			"id",
			"tabindex",
			"style"
		];
		var newel = document.createElementNS("http://www.w3.org/2000/svg", "svg");
		newel.innerHTML = el.innerHTML;
		newel.setAttribute("xmlns", "http://www.w3.org/2000/svg");
		var attrs = el.attributes;
		for (var i = 0; i < attrs.length; i++) {
			var attr_name = attrs[i].name;
			if (array_indexof(remove_attributes, attr_name) >= 0 || /^on/.test(attr_name) || /^aria-/.test(attr_name)) {
				continue;
			}
			newel.setAttribute(attr_name, attrs[i].value);
		}
		var computed_style = get_computed_style(el);
		var fillval = el.getAttribute("fill") || computed_style.fill;
		if (fillval) {
			newel.setAttribute("fill", fillval);
		}
		//var header = '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>\n';
		var header = ""; // unneeded
		var svgdoc = header + newel.outerHTML;
		// thanks to Rnksts on discord for these test images (base64 encode didn't work for unicode characters)
		// https://codepen.io/Rnksts/full/KKdJWvq
		return "data:image/svg+xml," + encodeURIComponent(svgdoc);
	};
	var get_canvas_src = function(el, format) {
		try {
			return el.toDataURL(format);
		} catch (e) {
			console_error(e);
			// "Tainted canvases may not be exported", CORS error in some pages
			return;
		}
	};
	var is_valid_src = function(src, isvideo) {
		// FIXME for audio
		return src && (!(/^blob:/.test(src)) || !isvideo);
	};
	var get_img_src = function(el) {
		if (typeof el === "string")
			return el;
		var el_tagname = get_tagname(el);
		if (el_tagname === "A")
			return el.href;
		if (el_tagname === "IFRAME") {
			return el.src.replace(/^javascript:window\.location\.replace\(["']([^"']+)["']\)$/, "$1");
		}
		if (el_tagname === "CANVAS") {
			return get_canvas_src(el, "image/png");
		}
		if (el_tagname === "SVG") {
			if (settings.mouseover_allow_svg_el) {
				return get_svg_src(el);
			} else {
				return null;
			}
		}
		if (el_tagname === "VIDEO") {
			return el.currentSrc || el.src || el.poster;
		}
		if (el_tagname === "AUDIO") {
			return el.currentSrc || el.src;
		}
		if (el_tagname === "SOURCE") {
			if (el.parentElement) {
				var newsrc = get_img_src(el.parentElement);
				// avoid adding blob url, e.g. reddit.com videos
				if (newsrc && is_valid_src(newsrc, true))
					return newsrc;
			}
			return el.currentSrc || el.src;
		}
		if (el_tagname === "IMAGE") {
			var xlink_href = el.getAttribute("xlink:href");
			if (xlink_href) {
				return xlink_href;
			} else {
				return null;
			}
		}
		// IMG or IFRAME
		// currentSrc is used if another image is used in the srcset
		var src = el.currentSrc || el.src;
		if (!src && el.tagName === "IMG") {
			// fake-src is used to avoid loading the image
			var fake_src = el.getAttribute("data-imu-fake-src");
			if (fake_src)
				return fake_src;
		}
		return src;
	};
	var check_highlightimgs_supported_image = function(el) {
		var src = get_img_src(el);
		var options = {
			fill_object: true,
			exclude_problems: [], // todo: use settings' exclude_problems instead
			use_cache: "read",
			//use_cache: false,
			use_api_cache: false,
			cb: function() { },
			do_request: function() { }
		};
		if (is_interactive) {
			options.host_url = window.location.href;
			options.element = el;
			options.document = document;
			options.window = window;
		}
		var imu_output = bigimage_recursive(src, options);
		// TODO: consolidate into its own routine
		if (imu_output.length !== 1)
			return true;
		var imu_obj = imu_output[0];
		if (imu_obj.url !== src)
			return true;
		for (var key in imu_obj) {
			if (key === "url")
				continue;
			if (!(key in default_object))
				return true;
			// e.g. for []
			if (JSON_stringify(default_object[key]) !== JSON_stringify(imu_obj[key]))
				return true;
		}
		return false;
	};
	var send_redirect = function(obj, cb, tabId) {
		if (is_extension) {
			extension_send_message({
				type: "redirect",
				data: {
					obj: obj,
					tabId: tabId
				}
			}, function() {
				cb();
			});
		} else {
			cb();
		}
	};
	var redirect = function(url, obj) {
		if (_nir_debug_) {
			console_log("redirect", url, obj);
		}
		if (_nir_debug_ && _nir_debug_.no_redirect)
			return;
		if (url === window.location.href)
			return;
		// wrap in try/catch due to nano defender
		try {
			// avoid downloading more before redirecting
			window.stop();
		} catch (e) {
		}
		send_redirect(obj, function() {
			if (settings.redirect_history) {
				window.location.assign(url);
			} else {
				window.location.replace(url);
			}
		});
	};
	// these functions can run before the document has loaded
	var cursor_wait = function() {
		if (document.documentElement)
			document.documentElement.style.cursor = "wait";
	};
	var cursor_default = function() {
		if (document.documentElement)
			document.documentElement.style.cursor = "default";
	};
	var infobox_timer = null;
	var show_image_infobox = function(text) {
		var div = document_createElement("div");
		div.style.backgroundColor = "#fffabb";
		// apparently this can be white in some cases: https://github.com/qsniyg/maxurl/issues/849#issuecomment-888695580 (thanks to ayunami2000 for reporting)
		div.style.color = "#000";
		div.style.position = "absolute";
		div.style.top = "0px";
		div.style.left = "0px";
		div.style.padding = ".3em .8em";
		div.style.boxShadow = "0px 0px 20px rgba(0,0,0,.6)";
		div.style.margin = ".8em";
		div.style.lineHeight = "1.5em";
		div.innerHTML = text;
		div.onclick = function() {
			document.body.removeChild(div);
			if (infobox_timer) {
				clearTimeout(infobox_timer);
				infobox_timer = null;
			}
		};
		document.body.appendChild(div);
		var do_timeout = function() {
			if (infobox_timer || settings.redirect_infobox_timeout <= 0)
				return;
			infobox_timer = setTimeout(function() {
				document.body.removeChild(div);
			}, settings.redirect_infobox_timeout * 1000);
		};
		if (document.hasFocus()) {
			do_timeout();
		} else {
			document.onfocus = function() {
				do_timeout();
				document.onfocus = null;
			};
			window.onfocus = function() {
				do_timeout();
				window.onfocus = null;
			};
		}
	};
	var check_ok_error = function(ok_errors, error) {
		if (ok_errors && is_array(ok_errors)) {
			for (var i = 0; i < ok_errors.length; i++) {
				if (error.toString() === ok_errors[i].toString()) {
					return true;
				}
			}
			return false;
		}
		return null;
	};
	var get_single_trigger_key_text = function(list) {
		list = list.sort(function(a, b) {
			if (a === b)
				return 0;
			if (a === "ctrl")
				return -1;
			if (b === "ctrl")
				return 1;
			if (a === "shift")
				return -1;
			if (b === "shift")
				return 1;
			if (a === "super")
				return -1;
			if (b === "super")
				return 1;
			if (a === "alt")
				return -1;
			if (b === "alt")
				return 1;
			if (a < b)
				return -1;
			if (b > a)
				return 1;
		});
		var newlist = [];
		for (var i = 0; i < list.length; i++) {
			var capitalized = string_charat(list[i], 0).toUpperCase() + list[i].slice(1);
			if (list.length === 1 && (capitalized === "Left" || capitalized === "Right" || capitalized === "Up" || capitalized === "Down")) {
				capitalized += " Arrow";
			}
			newlist.push(_(capitalized));
		}
		return newlist.join("+");
	};
	var get_trigger_key_texts = function(list) {
		if (!is_array(list[0])) {
			list = [list];
		}
		var result = [];
		for (var i = 0; i < list.length; i++) {
			result.push(get_single_trigger_key_text(list[i]));
		}
		return result;
	};
	var get_trigger_key_text = function(list) {
		return get_trigger_key_texts(list).join(" / ");
	};
	var truncate_with_ellipsis = function(text, maxchars) {
		var truncate_regex = new RegExp("^((?:.{" + maxchars + "}|.{0," + maxchars + "}[\\r\\n]))[\\s\\S]+?$");
		// "$1…"
		return text.replace(truncate_regex, decodeURIComponent("%241%E2%80%A6"));
	};
	var size_to_text = function(size) {
		var sizes = ["", "K", "M", "G", "T", "P"];
		while (size > 1024 && sizes.length > 1) {
			size /= 1024.;
			sizes.shift();
		}
		return size.toFixed(2).replace(/\.00$/, "") + sizes[0] + "B";
	};
	var check_image = function(obj, page_url, err_cb, ok_cb, no_infobox) {
		if (_nir_debug_)
			console_log("check_image", deepcopy(obj), page_url, no_infobox);
		if (is_array(obj)) {
			obj = obj[0];
		}
		if (!obj || !obj.url) {
			ok_cb(obj);
			return;
		}
		var print_orig = function() {
			if (obj && obj.extra) {
				if (obj.extra.page) {
					console_log("Original page: " + obj.extra.page);
				}
				if (obj.extra.caption) {
					console_log("Caption: " + obj.extra.caption);
				}
				if (obj.extra.created_date) {
					console_log("Created date: " + new Date(obj.extra.created_date));
				}
				if (obj.extra.updated_date) {
					console_log("Updated date: " + new Date(obj.extra.updated_date));
				}
			}
		};
		var url = obj.url;
		var err_txt;
		if (url === page_url) {
			print_orig();
			if (_nir_debug_)
				console_log("(check_image) url == page_url", url, page_url);
			ok_cb(url);
		} else {
			var headers = obj.headers;
			console_log(obj.url);
			print_orig();
			if (obj) {
				if (obj.bad) {
					err_txt = "Bad image";
				} else if (obj.media_info.type === "video" && obj.media_info.delivery) {
					err_txt = "Can't redirect to streaming video type " + JSON_stringify(obj.media_info.delivery);
				} else if (obj.is_pagelink) {
					err_txt = "Can't redirect to page";
				}
				if (err_txt) {
					if (err_cb) {
						err_cb(err_txt);
					} else {
						console_error(err_txt);
					}
					return;
				}
			}
			var mouseover_text = function(reason) {
				if (!is_interactive)
					return;
				if (no_infobox) {
					return err_cb(reason, true);
				}
				if (!settings.redirect_enable_infobox)
					return;
				var trigger_behavior = get_single_setting("mouseover_trigger_behavior");
				var mouseover;
				if (!settings.mouseover) {
					mouseover = "disabled";
				} else if (trigger_behavior === "keyboard") {
					// todo: maybe _t2 etc. too?
					mouseover = get_trigger_key_text(settings.mouseover_trigger_key);
				} else if (trigger_behavior === "mouse") {
					mouseover = "delay " + settings.mouseover_trigger_delay + "s";
				}
				// TODO: another option could be to allow it whenever the image can be imu'd
				imagetab_ok_override = true;
				var trigger_options_link = "<a style='color:blue; font-weight:bold' href='" + options_page + "' target='_blank' rel='noreferrer'>" + mouseover + "</a>";
				var infobox_text = _("Mouseover popup (%%1) is needed to display the original version", trigger_options_link) + " (" + _(reason) + ")";
				if (settings.redirect_infobox_url) {
					var link = document_createElement("a");
					link.href = url;
					link.innerText = truncate_with_ellipsis(url, 80);
					link.setAttribute("target", "_blank");
					infobox_text += "<br />" + link.outerHTML;
				}
				try {
					show_image_infobox(infobox_text);
				} catch (e) {
					console_error(e);
				}
			};
			if (!_nir_debug_ || !_nir_debug_.no_request) {
				if (is_interactive)
					cursor_wait();
				var url_domain = url.replace(/^([a-z]+:\/\/[^/]*).*?$/, "$1");
				var origheaders = deepcopy(headers);
				var customheaders = true;
				if (!headers || Object.keys(headers).length === 0) {
					headers = {};
					customheaders = false;
				}
				var specified_headers = new_set();
				for (var header in headers) {
					set_add(specified_headers, header.toLowerCase());
				}
				var base_headers = {
					// Origin is not often added by the browser, and doesn't work for some sites
					//"origin": url_domain,
					"referer": page_url,
					// e.g. for Tumblr URLs, this is sent by the browser when redirecting
					"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
					"sec-fetch-dest": "document",
					"sec-fetch-mode": "navigate",
					"sec-fetch-site": "cross-site"
				};
				for (var header in base_headers) {
					if (!set_has(specified_headers, header)) {
						headers[header] = base_headers[header];
					}
				}
				if (customheaders && Object.keys(origheaders).length === 1 && ("Referer" in origheaders)) {
					var domain = page_url;
					domain = domain.replace(/^[a-z]+:\/\/([^/]*).*?$/, "$1");
					var url_domain = url.replace(/^[a-z]+:\/\/([^/]*).*?$/, "$1");
					if (obj.referer_ok.same_domain && domain === url_domain) {
						customheaders = false;
					} else if (obj.referer_ok.same_domain_nosub && get_domain_nosub(domain) === get_domain_nosub(url_domain)) {
						customheaders = false;
					}
				}
				if (customheaders && !is_extension) {
					document.documentElement.style.cursor = "default";
					console_log("Custom headers needed, currently unhandled");
					mouseover_text("custom headers");
					return;
				}
				if (_nir_debug_)
					console_log("(check_image) headers", headers);
				if (obj.always_ok ||
					(!obj.can_head && !settings.canhead_get)) {
					if (_nir_debug_) {
						console_log("(check_image) always_ok || !can_head", url, deepcopy(obj));
					}
					return ok_cb(url);
				}
				var method = "HEAD";
				if (!obj.can_head && settings.canhead_get) {
					if (_nir_debug_)
						console_log("Trying GET");
					method = "GET";
				}
				var handled = false;
				var onload_cb = function(resp) {
					if (handled)
						return;
					handled = true;
					if (_nir_debug_)
						console_log("(check_image) resp", resp);
					// FireMonkey returns null when tracking protection blocks a URL
					if (is_userscript && userscript_manager === "FireMonkey" && !resp) {
						err_txt = "Error: resp == null (tracking protection blocked, FireMonkey bug)";
						if (err_cb) {
							err_cb(err_txt);
						} else {
							console_error(err_txt);
						}
						return;
					}
					// nano defender removes this.DONE
					if (resp.readyState < 2) {
						return;
					}
					if (is_userscript && !resp.status && resp.readyState < 4) {
						// Tampermonkey and Greasemonkey have a bug where status isn't set for onprogress events
						// Tampermonkey issue: https://github.com/Tampermonkey/tampermonkey/issues/857
						// Greasemonkey issue: https://github.com/greasemonkey/greasemonkey/issues/3068
						handled = false;
						return;
					}
					if (resp.readyState < 4) {
						if (req && req.abort)
							req.abort();
					}
					if (resp.status === 0 ||
						check_tracking_blocked(resp)) {
						// error loading image (IP doesn't exist, etc.), ignore
						err_txt = "Error: status == 0";
						if (err_cb) {
							err_cb(err_txt);
						} else {
							console_error(err_txt);
						}
						return;
					}
					cursor_default();
					if (resp.finalUrl === page_url) {
						console_log(resp.finalUrl);
						console_log("Same URL");
						return;
					}
					var headers_list = parse_headers(resp.responseHeaders);
					var headers = headers_list_to_dict(headers_list);
					if (_nir_debug_)
						console_log("(check_image) resp headers", headers);
					var digit = resp.status.toString()[0];
					var ok_error = check_ok_error(obj.head_ok_errors, resp.status);
					if (((digit === "4" || digit === "5") &&
						resp.status !== 405) &&
						ok_error !== true) {
						err_txt = "Error: " + resp.status;
						if (err_cb) {
							err_cb(err_txt);
						} else {
							console_error(err_txt);
						}
						return;
					}
					var content_type = headers["content-type"];
					if (!content_type)
						content_type = "";
					content_type = content_type.toLowerCase();
					// https://1.f.ix.de/scale/crop/3840x2160/q75/se/ct/motive/image/4291/ct-motiv-07-2019_3840x2160.jpg
					//   https://www.heise.de/ct/motive/image/4291/ct-motiv-07-2019_3840x2160.jpg -- no content-type header
					if ((content_type.match(/text\/html/) || !content_type) && !obj.head_wrong_contenttype &&
						ok_error !== true) {
						var err_txt = "Error: Not an image: " + (content_type || "(no content-type)");
						if (err_cb) {
							err_cb(err_txt);
						} else {
							console_error(err_txt);
						}
						return;
					}
					if (!is_extension || settings.redirect_disable_for_responseheader) {
						if (obj.forces_download || ((content_type.match(/(?:binary|application|multipart|text)\//) ||
							content_type === "image/tiff" ||
							content_type === "image/lsr" ||
							// such as [image/png] (server bug)
							content_type.match(/^ *\[/)) && !obj.head_wrong_contenttype) ||
							(headers["content-disposition"] &&
								headers["content-disposition"].toLowerCase().match(/^ *attachment/))) {
							console_error("Forces download");
							mouseover_text("forces download");
							return;
						}
					}
					if (headers["content-length"] && headers["content-length"] == "0" && !obj.head_wrong_contentlength) {
						console_error("Zero-length image");
						return;
					}
					if (check_bad_if(obj.bad_if, resp)) {
						console_error("Bad image (bad_if)", obj.bad_if, resp);
						return err_cb("bad image");
					}
					if (!customheaders || is_extension) {
						if (_nir_debug_) {
							console_log("(check_image) finalUrl", resp.finalUrl || url, resp, deepcopy(obj));
						}
						ok_cb(resp.finalUrl || url);
					} else {
						console_log("Custom headers needed, currently unhandled");
					}
				};
				var req = do_request({
					method: method,
					url: url,
					headers: headers,
					trackingprotection_failsafe: true,
					onprogress: function(resp) {
						// 2 = HEADERS_RECEIVED
						if (resp.readyState >= 2 && resp.responseHeaders) {
							onload_cb(resp);
						}
					},
					onload: onload_cb
				});
			}
		}
	};
	function do_export() {
		$$IMU_EXPORT$$ = bigimage_recursive;
		if (is_node) {
			module.exports = bigimage_recursive;
		} else if (is_scripttag) {
			imu_variable = bigimage_recursive;
		}
	}
	function contenttype_can_be_redirected(contentType) {
		// disable redirecting if redirecting to/from audio/video is disabled
		if (/^video\//.test(contentType))
			return !!settings.redirect_video;
		if (/^audio\//.test(contentType))
			return !!settings.redirect_audio;
		// amazonaws's error page are application/xml
		// fixme: why not search for image/ or video/ instead?
		return !(/^(?:text|application)\//.test(contentType));
	}
	function currenttab_is_image() {
		return contenttype_can_be_redirected(document.contentType);
	}
	function do_redirect_sub(page_url, force_page, redirect) {
		var bigimage_obj = {
			fill_object: true,
			force_page: force_page,
			cb: function(newhref) {
				if (_nir_debug_) {
					console_log("do_redirect (final)", newhref);
				}
				cursor_default();
				if (!newhref) {
					return;
				}
				if (is_interactive && settings.print_imu_obj)
					console_log(newhref);
				var newurl = newhref[0].url;
				if (false && newhref[0].extra && newhref[0].extra.page) {
					console_log("Original page: " + newhref[0].extra.page);
				}
				if (newurl === page_url)
					return;
				if (!newurl)
					return;
				if (_nir_debug_)
					console_log("redirect (recursive loop)", newhref);
				redirect(newurl, newhref);
			}
		};
		if (is_interactive) {
			bigimage_obj.document = document;
			bigimage_obj.window = get_window();
		}
		bigimage_recursive_loop(page_url, bigimage_obj, function(newhref, real_finalcb) {
			if (_nir_debug_) {
				console_log("do_redirect", newhref);
			}
			var currentobj = null;
			var finalcb = function(newurl, data, newobj) {
				real_finalcb(newurl, newobj || currentobj, data);
			};
			if (false && (!newhref[0].can_head || newhref[0].always_ok)) {
				var newurl = newhref[0].url;
				if (newurl === window.location.href) {
					cursor_default();
					return;
				}
				if (_nir_debug_) {
					console_log("Not checking due to can_head == false || always_ok == true");
				}
				finalcb(newurl);
				return;
			}
			var new_newhref = [];
			for (var i = 0; i < newhref.length; i++) {
				// is_probably_video and is_probably_audio have some overlap, so check them both
				if (!settings.redirect_video && is_probably_video(newhref[i]) &&
					!(settings.redirect_audio && is_probably_audio(newhref[i]))) {
					continue;
				}
				if (!settings.redirect_audio && is_probably_audio(newhref[i]) &&
					!(settings.redirect_video && is_probably_video(newhref[i]))) {
					continue;
				}
				new_newhref.push(newhref[i]);
			}
			var no_infobox = settings.redirect_to_no_infobox;
			var infobox_urls = [];
			var use_infobox = false;
			// TODO: avoid requesting again for second round after no_infobox (e.g. for force_download errors)
			var index = 0;
			var cb = function(err_txt, is_infobox) {
				if (_nir_debug_) {
					console_log("do_redirect_sub's err_cb:", err_txt, is_infobox);
				}
				if (is_infobox)
					infobox_urls.push(new_newhref[index]);
				index++;
				var array = new_newhref;
				if (use_infobox)
					array = infobox_urls;
				if (index >= array.length) {
					if (no_infobox && infobox_urls.length > 0) {
						use_infobox = true;
						no_infobox = false;
						index = 0;
					} else {
						cursor_default();
						console_error(err_txt);
						return;
					}
				}
				// FIXME: deduplicate
				if (same_url(window.location.href, array[index]) && no_infobox && infobox_urls.length > 0) {
					use_infobox = true;
					no_infobox = false;
					index = 0;
				}
				currentobj = array[index];
				check_image(currentobj, page_url, cb, finalcb, no_infobox);
			};
			currentobj = new_newhref[0];
			check_image(currentobj, page_url, cb, finalcb, no_infobox);
		});
	}
	function do_redirect() {
		if (!currenttab_is_image()) {
			if (!settings.redirect_host_html)
				return;
			if (!host_html_filter(window.location.href))
				return;
		}
		cursor_wait();
		var force_page = false;
		if ((settings["redirect_force_page"] + "") === "true")
			force_page = true;
		do_redirect_sub(window.location.href, force_page, redirect);
	}
	function onload(cb) {
		if (document.readyState === "complete" ||
			document.readyState === "interactive") {
			cb();
		} else {
			var state_cb = function() {
				if (document.readyState === "complete" ||
					document.readyState === "interactive") {
					cb();
					our_removeEventListener(document, "readystatechange", state_cb);
				}
			};
			our_addEventListener(document, "readystatechange", state_cb);
		}
	}
	function get_keystrs_map(event, value) {
		var keys = {};
		if (event.ctrlKey) {
			keys["ctrl"] = true;
		} else {
			keys["ctrl"] = false;
		}
		/*if (event.metaKey) {
			keys["super"] = true;
		} else {
			keys["super"] = false;
		}*/
		if (event.altKey) {
			keys["alt"] = true;
		} else {
			keys["alt"] = false;
		}
		if (event.shiftKey) {
			keys["shift"] = true;
		} else {
			keys["shift"] = false;
		}
		if (event.buttons !== void 0) {
			var buttonnames = ["button1", "button2", "button3", "button4", "button5"];
			var buttons = event.buttons;
			while (buttonnames.length > 0) {
				if (buttons & 1) {
					keys[buttonnames[0]] = true;
				} else {
					keys[buttonnames[0]] = false;
				}
				buttons >>= 1;
				buttonnames.shift();
			}
		}
		if (event.type === "wheel") {
			if (event.deltaY < 0) {
				keys["wheelUp"] = true;
			} else if (event.deltaY > 0) {
				keys["wheelDown"] = true;
			}
			if (event.deltaX < 0) {
				keys["wheelLeft"] = true;
			} else if (event.deltaX > 0) {
				keys["wheelRight"] = true;
			}
		}
		var str = keycode_to_str(event);
		if (str === void 0) {
			return keys;
		}
		keys[str] = value;
		return keys;
	}
	var keystr_is_wheel = function(keystr) {
		return /^wheel/.test(keystr);
	};
	var keystr_is_button12 = function(keystr) {
		// allow rebinding right click
		// todo: maybe add a warning if done globally (e.g. trigger key)?
		return keystr === "button1"; // || keystr === "button2";
	};
	var chord_is_only_wheel = function(chord) {
		for (var i = 0; i < chord.length; i++) {
			if (!keystr_is_wheel(chord[i]) && !keystr_is_button12(chord[i])) {
				return false;
			}
		}
		return true;
	};
	var keysequence_bad = function(keyseq) {
		if (chord_is_only_wheel(keyseq))
			return true;
		if (keyseq.length !== 1)
			return false;
		return keystr_is_button12(keyseq[0]);
	};
	var keysequence_valid = function(keyseq) {
		if (keyseq.length === 0)
			return false;
		if (keysequence_bad(keyseq))
			return false;
		if (keyseq.length > 1)
			return true;
		return true;
	};
	var prefers_dark_mode = function() {
		try {
			return window.matchMedia("(prefers-color-scheme: dark)").matches;
		} catch (e) {
			return false;
		}
	};
	function update_dark_mode() {
		if (!is_maxurl_website && !is_options_page) {
			return;
		}
		if (prefers_dark_mode()) {
			set_default_value("dark_mode", true);
		}
		if (settings.dark_mode) {
			document.documentElement.classList.add("dark");
		} else {
			document.documentElement.classList.remove("dark");
		}
	}
	var request_permission = function(permission, cb) {
		if (!is_extension)
			return cb(false);
		// This has to be done in the content script under firefox: https://github.com/qsniyg/maxurl/issues/254
		if (true) {
			try {
				chrome.permissions.request({
					permissions: [permission]
				}, function(granted) {
					if (granted) {
						extension_send_message({
							type: "permission_handler",
							data: {
								permission: permission
							}
						});
					}
					cb(granted);
				});
			} catch (e) {
				console_error(e);
				cb(false);
			}
		} else {
			extension_send_message({
				type: "permission",
				data: {
					permission: permission
				}
			}, function(result) {
				cb(result.data.granted);
			});
		}
	};
	var current_options_tab = "general";
	if (is_interactive) {
		var hash = window.location.hash;
		if (hash) {
			var hashmatch = hash.match(/^#?cat(?:_fake)?_(.*)$/);
			if (hashmatch) {
				current_options_tab = hashmatch[1];
			}
		}
	}
	function do_options() {
		update_dark_mode();
		var recording_keys = false;
		var options_chord = [];
		var current_options_chord = [];
		function update_options_chord(event, value) {
			if (!recording_keys)
				return;
			var map = get_keystrs_map(event, value);
			if ((keycode_to_str(event) || event.type === "mousedown") &&
				current_options_chord.length === 0) {
				// Don't clear the options chord for either left or right mouse buttons
				if (event.button !== 0 && event.button !== 2)
					options_chord = [];
			}
			var old_options_chord = deepcopy(options_chord);
			for (var key in map) {
				update_options_chord_sub(key, map[key]);
			}
			if (keysequence_bad(options_chord))
				options_chord = old_options_chord;
			recording_keys();
		}
		function update_options_chord_sub(str, value) {
			if (value) {
				if (array_indexof(options_chord, str) < 0) {
					options_chord.push(str);
				}
				if (array_indexof(current_options_chord, str) < 0) {
					current_options_chord.push(str);
				}
			} else {
				if (array_indexof(current_options_chord, str) >= 0) {
					current_options_chord.splice(array_indexof(current_options_chord, str), 1);
				}
			}
		}
		document.addEventListener('keydown', function(event) {
			update_options_chord(event, true);
			if (recording_keys) {
				event.preventDefault();
				return false;
			}
		});
		document.addEventListener('mousedown', function(event) {
			update_options_chord(event, true);
			if (recording_keys) {
				event.preventDefault();
				//event.stopImmediatePropagation();
				return false;
			}
		});
		document.addEventListener('wheel', function(event) {
			update_options_chord(event, true);
			if (recording_keys) {
				event.preventDefault();
				event.stopImmediatePropagation();
				event.stopPropagation();
				return false;
			}
		}, {
			capture: true,
			passive: false
		});
		document.addEventListener("contextmenu", function(event) {
			if (recording_keys) {
				event.preventDefault();
				event.stopImmediatePropagation();
				return false;
			}
		});
		document.addEventListener('keyup', function(event) {
			update_options_chord(event, false);
			if (recording_keys) {
				event.preventDefault();
				return false;
			}
		});
		document.addEventListener('mouseup', function(event) {
			if (event.button === 1)
				return;
			update_options_chord(event, false);
			if (recording_keys) {
				event.preventDefault();
				event.stopImmediatePropagation();
				return false;
			}
		});
		var options_el_real = document.getElementById("options");
		options_el_real.textContent = "";
		var options_el = document.createDocumentFragment();
		if (!is_extension_options_page) {
			var options_header_el = document_createElement("h1");
			options_header_el.textContent = _("options_header");
			options_el.appendChild(options_header_el);
		}
		var saved_el = document.getElementById("saved");
		if (!saved_el) {
			saved_el = document_createElement("div");
			saved_el.style.visibility = "hidden";
			saved_el.id = "saved";
			saved_el.classList.add("topsaved");
		}
		var get_default_saved_text = function(meta) {
			var text = "Saved! Refresh the target page for changes to take effect";
			if (meta && meta.needrefresh)
				return text;
			if (is_extension || typeof GM_addValueChangeListener !== "undefined") {
				text = "Saved!";
			}
			return text;
		};
		var set_saved_text = function(id) {
			var p_el = document_createElement("p");
			p_el.textContent = _(id);
			saved_el.textContent = "";
			saved_el.appendChild(p_el);
		};
		set_saved_text(get_default_saved_text());
		//saved_el.style.pointer_events = "none";
		//saved_el.style.textAlign = "center";
		//saved_el.style.paddingTop = "1em";
		//saved_el.style.fontStyle = "italic";
		//saved_el.style.color = "#0af";
		var saved_timeout = null;
		var create_update_available = function() {
			var update_available_el = document_createElement("div");
			update_available_el.classList.add("update-available");
			update_available_el.innerHTML = "Update available: v" + current_version + " -&gt; ";
			var link = get_update_url();
			if (link) {
				update_available_el.innerHTML += "<a href=\"" + link + "\" target=\"_blank\" rel=\"noreferer\">v" + settings.last_update_version + "</a>";
			} else {
				update_available_el.innerHTML += "v" + settings.last_update_version;
			}
			return update_available_el;
		};
		if (settings.check_updates && version_compare(current_version, settings.last_update_version) === 1) {
			options_el.appendChild(create_update_available());
		}
		var rules_failed_el = document.createElement("p");
		if (set_require_rules_failed_el(rules_failed_el)) {
			options_el.appendChild(rules_failed_el);
		}
		var topbtns_holder = document_createElement("div");
		topbtns_holder.id = "topbtns";
		options_el.appendChild(topbtns_holder);
		var importexport_ocontainer = document_createElement("div");
		importexport_ocontainer.id = "importexport";
		importexport_ocontainer.classList.add("center-outer");
		importexport_ocontainer.style.display = "none";
		options_el.appendChild(importexport_ocontainer);
		var importexport_container = document_createElement("div");
		importexport_container.classList.add("center-inner");
		importexport_ocontainer.appendChild(importexport_container);
		var importexport_text = document_createElement("textarea");
		importexport_container.appendChild(importexport_text);
		var safe_import_json = function(json) {
			json = strip_whitespace_simple(json);
			var append = false;
			if (json[0] === "+") {
				append = true;
				json = json.substring(1);
			}
			var value = null;
			try {
				value = JSON_parse(json);
			} catch (e) {
				console_error(e);
			}
			return {
				value: value,
				append: append
			};
		};
		var fetch_import_json = function(import_text, cb) {
			if (/^https?:\/\//.test(import_text)) {
				do_request({
					method: "GET",
					url: import_text,
					onload: function(resp) {
						if (resp.status !== 200) {
							console.error(resp);
							return cb(null);
						}
						cb(safe_import_json(resp.responseText));
					}
				});
			} else {
				cb(safe_import_json(import_text));
			}
		};
		var real_import_btn = document_createElement("button");
		real_import_btn.innerText = _("Import");
		real_import_btn.onclick = function() {
			if (real_import_btn.classList.contains("disabled"))
				return;
			real_import_btn.classList.add("disabled");
			var import_text = importexport_text.value;
			import_text = strip_whitespace_simple(import_text);
			fetch_import_json(import_text, function(data) {
				if (!data || !data.value) {
					importexport_text.value = "Error!";
					real_import_btn.classList.remove("disabled");
					return;
				}
				var value = data.value;
				var append = data.append;
				var changed = false;
				var current_settings = deepcopy(settings);
				var new_settings;
				if (!append)
					new_settings = deepcopy(orig_settings);
				else
					new_settings = deepcopy(settings);
				var settings_version;
				for (var key in value) {
					if (!(key in settings)) {
						if (key === "settings_version") {
							settings_version = value[key];
							continue;
						} else {
							console_warn("Unknown key in imported settings:", key);
						}
					}
					new_settings[key] = value[key];
				}
				for (var key in new_settings) {
					if (JSON_stringify(new_settings[key]) !== JSON_stringify(current_settings[key])) {
						settings[key] = new_settings[key];
						set_value(key, new_settings[key]);
						changed = true;
					}
				}
				if (settings_version === void 0) {
					settings_version = 1;
				}
				upgrade_settings_with_version(settings_version, new_settings, function(new_changed) {
					real_import_btn.classList.remove("disabled");
					if (changed || new_changed) {
						console_log("Settings imported");
						setTimeout(function() {
							do_options();
						}, 1);
					} else {
						console_log("No settings changed");
					}
					show_importexport(false);
				});
			});
		};
		importexport_container.appendChild(real_import_btn);
		var export_container = document_createElement("div");
		var export_txt_btn = document_createElement("button");
		export_txt_btn.innerText = _("Save");
		export_txt_btn.onclick = function() {
			var data = importexport_text.value;
			var url = "data:text/plain," + encodeURIComponent(data);
			var obj = {
				url: url,
				filename: "settings.txt"
			};
			do_download(obj, obj.filename, data.length);
		};
		export_container.appendChild(export_txt_btn);
		importexport_container.appendChild(export_container);
		var show_importexport = function(show, importexport) {
			if (show) {
				importexport_ocontainer.style.display = "block";
			} else {
				importexport_state = null;
				importexport_ocontainer.style.display = "none";
			}
			if (importexport) {
				if (show)
					importexport_state = "import";
				real_import_btn.style.display = "inline-block";
				export_container.style.display = "none";
			} else {
				if (show)
					importexport_state = "export";
				real_import_btn.style.display = "none";
				export_container.style.display = "block";
			}
		};
		var importexport_state = null;
		var import_btn = document_createElement("button");
		import_btn.id = "importbtn";
		import_btn.innerText = _("Import");
		import_btn.title = _("Import settings");
		import_btn.onclick = function() {
			if (importexport_state === "import")
				return show_importexport(false);
			importexport_text.value = "";
			show_importexport(true, true);
		};
		topbtns_holder.appendChild(import_btn);
		var export_btn = document_createElement("button");
		export_btn.id = "exportbtn";
		export_btn.innerText = _("Export");
		export_btn.title = _("Export settings");
		export_btn.onclick = function() {
			if (importexport_state === "export")
				return show_importexport(false);
			var newsettings = deepcopy(settings);
			get_value("settings_version", function(value) {
				if (value !== void 0)
					newsettings.settings_version = value;
				importexport_text.value = JSON_stringify(newsettings);
				show_importexport(true, false);
			});
		};
		topbtns_holder.appendChild(export_btn);
		var enabled_map = {};
		var reason_map = {};
		var check_sub_option = function(meta, reason) {
			if (typeof reason === "undefined") {
				reason = {};
			}
			var enabled = true;
			var prepare_array = function(value) {
				var result = deepcopy(value);
				if (!result) {
					return null;
				}
				if (typeof result === "string") {
					result = deepcopy(settings_conditions[result]);
				}
				if (!is_array(result)) {
					result = [result];
				}
				var newresult = [];
				array_foreach(result, function(single) {
					if (single._condition) {
						var cond = deepcopy(settings_conditions[single._condition]);
						if (!is_array(cond))
							cond = [cond];
						array_foreach(cond, function(scond) {
							obj_foreach(single, function(key, value) {
								if (key === "_condition")
									return;
								scond[key] = value;
							});
							newresult.push(scond);
						});
					} else {
						newresult.push(single);
					}
				});
				// add profiled keys, e.g.
				// [{mouseover_open_behavior: "popup"}] -> [{"mouseover_open_behavior": "popup"}, {"mouseover_open_behavior_t2": "popup"}]
				result = [];
				array_foreach(newresult, function(single) {
					result.push(single);
					var profiled_keys = [];
					obj_foreach(single, function(key, value) {
						var meta = settings_meta[key];
						if (!meta)
							return;
						if (meta.profiled) {
							profiled_keys.push(key);
						}
					});
					if (profiled_keys.length) {
						for (var i = 0; i < num_profiles; i++) {
							var new_single = deepcopy(single);
							array_foreach(profiled_keys, function(key) {
								var profiled_key = "t" + (i + 2) + "_" + key;
								new_single[profiled_key] = new_single[key];
								delete new_single[key];
							});
							new_single._auto = true;
							result.push(new_single);
						}
					}
				});
				return result;
			};
			var requires = prepare_array(meta.requires);
			var disabled_if = prepare_array(meta.disabled_if);
			if (!meta.imu_enabled_exempt) {
				if (!settings.imu_enabled) {
					enabled = false;
				}
			}
			reason.good = [];
			reason.bad = [];
			if (enabled && requires) {
				enabled = check_validity(requires, reason);
				reason.good = [];
			}
			if (enabled && disabled_if) {
				reason.good = [];
				reason.bad = [];
				enabled = !check_validity(disabled_if, reason);
				reason.bad = [];
			}
			return enabled;
		};
		var check_option = function(setting) {
			var meta = settings_meta[setting];
			enabled_map[setting] = "processing";
			reason_map[setting] = {};
			var enabled = check_sub_option(meta, reason_map[setting]);
			enabled_map[setting] = enabled;
			return enabled;
		};
		var check_validity = function(array, reason) {
			for (var i = 0; i < array.length; i++) {
				var current = array[i];
				var current_valid = true;
				var good_reason, bad_reason;
				if (typeof reason !== "undefined") {
					good_reason = [];
					bad_reason = [];
				}
				for (var required_setting in current) {
					if (required_setting[0] === "_")
						continue;
					var required_value = current[required_setting];
					var value = settings[required_setting];
					if (is_array(value) && !is_array(required_value))
						value = value[0];
					if (!(required_setting in enabled_map)) {
						check_option(required_setting);
					}
					if (enabled_map[required_setting] === "processing") {
						console_error("Dependency cycle detected for:", current, ",", required_setting);
						return;
					}
					var current_reason = {
						setting: required_setting,
						required_value: required_value,
						current_value: value,
						enabled: enabled_map[required_setting],
						auto: !!current._auto
					};
					var value_is_required = value === required_value;
					if (!value_is_required && settings_meta[required_setting].type === "keysequence" && required_value === true) {
						// value can be undefined because value = value[0] above
						value_is_required = value && !!value.length;
					}
					if (enabled_map[required_setting] && value_is_required) {
						//current_valid = true;
						if (typeof good_reason !== "undefined") {
							good_reason.push(current_reason);
						}
					} else {
						current_valid = false;
						if (typeof bad_reason !== "undefined") {
							bad_reason.push(current_reason);
						}
					}
					if (!current_valid && typeof reason === "undefined") {
						break;
					}
				}
				if (typeof reason !== "undefined") {
					reason.good.push(good_reason);
					reason.bad.push(bad_reason);
				}
				if (current_valid) {
					return true;
				}
			}
			return false;
		};
		var get_option_from_options = function(options, option) {
			if (option in options)
				return options[option];
			for (var option_name in options) {
				if (/^_group/.test(option_name)) {
					return get_option_from_options(options[option_name], option);
				}
			}
			return null;
		};
		var is_nonempty_reason = function(goodbad) {
			for (var i = 0; i < goodbad.length; i++) {
				if (goodbad[i].length !== 0)
					return true;
			}
			return false;
		};
		var is_reason_goodbad = function(reason) {
			if (is_nonempty_reason(reason.good))
				return "good";
			if (is_nonempty_reason(reason.bad))
				return "bad";
			return null;
		};
		var fill_requirements = function(reason, div) {
			div.textContent = "";
			if (!settings.settings_show_requirements)
				return;
			var goodbad = is_reason_goodbad(reason);
			if (!goodbad)
				return;
			var requires_p = document_createElement("p");
			requires_p.innerText = _("Requires:");
			div.appendChild(requires_p);
			var els = [];
			var array = reason[goodbad];
			for (var i = 0; i < array.length; i++) {
				if (array[i].length === 0)
					continue;
				var ul = document_createElement("ul");
				var ul_valid = false;
				for (var j = 0; j < array[i].length; j++) {
					var single_reason = array[i][j];
					if (single_reason.auto)
						continue;
					var option_meta = null;
					var option_name = single_reason.setting;
					var option_cat = null;
					if (single_reason.setting in settings_meta) {
						option_meta = settings_meta[single_reason.setting];
						option_name = _(option_meta.name);
						option_cat = option_meta.category || null;
						if (option_cat) {
							option_cat = _(categories[option_cat]);
						}
					}
					var cat_prefix = "";
					// TODO: don't check label_texts, this doesn't work with tabs. Instead, do proper parsing
					//var wanted_value_el = document.querySelector("label[for=\"input_" + single_reason.setting + "_" + single_reason.required_value + "\"]");
					var wanted_value = single_reason.required_value;
					var input_id = "input_" + single_reason.setting + "_" + single_reason.required_value;
					if (input_id in label_texts) {
						wanted_value = label_texts[input_id];
					} else if (option_cat) { // FIXME: really hacky check to see if in same tab or not
						cat_prefix = "(" + option_cat + ") ";
					}
					var equals = "=";
					if (goodbad === "good")
						equals = "!=";
					var li = document_createElement("li");
					li.innerText = cat_prefix + option_name + " " + equals + " " + wanted_value;
					ul.appendChild(li);
					ul_valid = true;
				}
				if (ul_valid)
					els.push(ul);
			}
			var newels = [];
			for (var i = 0; i < els.length - 1; i++) {
				newels.push(els[i]);
				// FIXME: this should be 'and' for disabled_if
				var or_p = document_createElement("p");
				or_p.innerText = _("Or:");
				newels.push(or_p);
			}
			newels.push(els[els.length - 1]);
			for (var i = 0; i < newels.length; i++) {
				div.appendChild(newels[i]);
			}
		};
		function check_disabled_options() {
			var options = options_el.querySelectorAll("div.option");
			enabled_map = {};
			for (var i = 0; i < options.length; i++) {
				var setting = options[i].id.replace(/^option_/, "");
				var enabled = check_option(setting);
				if (enabled) {
					options[i].classList.remove("disabled");
					options[i].classList.remove("disabled-hidden");
					options[i].getElementsByClassName("requirements")[0].classList.add("hidden");
					var meta = settings_meta[setting];
					var meta_options = meta.options;
					var regexp = new RegExp("^input_" + setting + "_");
					var els = options[i].querySelectorAll("input, textarea, button, select, option");
					for (var j = 0; j < els.length; j++) {
						var input = els[j];
						input.disabled = false;
						if (meta_options) {
							var option_name = input.id.replace(regexp, "");
							if (option_name !== input.id) {
								var option_value = get_option_from_options(meta_options, option_name);
								if (option_value) {
									if (!check_sub_option(option_value)) {
										input.disabled = true;
									}
								}
							}
						}
					}
				} else {
					options[i].classList.add("disabled");
					if (!settings.settings_show_disabled) {
						options[i].classList.add("disabled-hidden");
					} else if (!settings.settings_show_disabled_profiles && /^t[0-9]+_/.test(setting)) {
						var trigger_value = settings["mouseover_trigger_key_" + setting.replace(/^(t[0-9]+)_.*/, "$1")];
						if (trigger_value.length <= 0) {
							options[i].classList.add("disabled-hidden");
						}
					}
					var els = options[i].querySelectorAll("input, textarea, button, select");
					for (var j = 0; j < els.length; j++) {
						var input = els[j];
						input.disabled = true;
					}
					var requirements_div = options[i].getElementsByClassName("requirements")[0];
					//requirements_div.style.display = "block";
					requirements_div.classList.remove("hidden");
					fill_requirements(reason_map[setting], requirements_div);
				}
			}
		}
		function show_warnings() {
			var options = options_el.querySelectorAll("div.option");
			for (var i = 0; i < options.length; i++) {
				var setting = options[i].id.replace(/^option_/, "");
				var meta = settings_meta[setting];
				if (meta.warning) {
					var warning = meta.warning[settings[setting] + ""];
					var el = options[i].querySelector(".warning");
					if (!el)
						continue;
					if (warning) {
						el.innerText = warning;
						el.style.display = "block";
					} else {
						el.style.display = "none";
					}
				}
			}
		}
		function show_saved_message(meta) {
			set_saved_text(get_default_saved_text(meta));
			saved_el.setAttribute("style", "");
			saved_el.classList.remove("fadeout");
			if (saved_timeout)
				clearTimeout(saved_timeout);
			saved_timeout = setTimeout(function() {
				saved_el.classList.add("fadeout");
			}, 2000);
		}
		function md_to_html(parent, text) {
			var current_el = null;
			var current_text = "";
			var current_tag = null;
			var apply_tag = function() {
				if (current_text.length === 0)
					return;
				if (current_tag === "`") {
					current_el = document_createElement("code");
				} else {
					current_el = document_createElement("span");
				}
				current_el.innerText = current_text;
				current_text = "";
				parent.appendChild(current_el);
			};
			// fast path
			if (string_indexof(text, "`") < 0 && string_indexof(text, "\n") < 0) {
				current_text = text;
				apply_tag();
				return;
			}
			for (var i = 0; i < text.length; i++) {
				if (text[i] === current_tag) {
					apply_tag();
					current_tag = null;
					continue;
				}
				if (text[i] === "`") {
					apply_tag();
					current_tag = text[i];
					continue;
				}
				if (text[i] === "\n") {
					apply_tag();
					parent.appendChild(document_createElement("br"));
					continue;
				}
				current_text += text[i];
			}
			apply_tag();
		}
		var tabscontainer;
		if (settings.settings_tabs) {
			tabscontainer = document_createElement("div");
			tabscontainer.id = "tabs";
			options_el.appendChild(tabscontainer);
		}
		var category_els = {};
		var subcategory_els = {};
		if (!(current_options_tab in categories)) {
			current_options_tab = "general";
		}
		for (var category in categories) {
			var catname = _(categories[category]);
			var div = document_createElement("div");
			div.id = "cat_" + category;
			div.classList.add("category");
			category_els[category] = [div];
			if (settings.settings_tabs) {
				div.classList.add("tabbed");
				var tab = document_createElement("span");
				tab.classList.add("tab");
				//tab.href = "#cat_" + category;
				tab.id = "tab_cat_" + category;
				tab.innerText = catname;
				(function(category) {
					tab.onclick = function() {
						current_options_tab = category;
						window.location.hash = "cat_fake_" + category;
						do_options();
					};
				})(category);
				if (category === current_options_tab) {
					tab.classList.add("active");
				} else {
					div.style.display = "none";
				}
				category_els[category].push(tab);
				tabscontainer.appendChild(tab);
			} else {
				var h2 = document_createElement("h2");
				h2.innerText = catname;
				div.appendChild(h2);
			}
			var subdiv = document_createElement("div");
			subdiv.id = "subcat_" + category;
			subdiv.classList.add("subcat");
			subdiv.classList.add("frame");
			div.appendChild(subdiv);
			subcategory_els[category] = subdiv;
			if (category in subcategories) {
				for (var subcat in subcategories[category]) {
					var newsubdiv = document_createElement("div");
					var subcat_full = category + "_" + subcat;
					newsubdiv.id = "subcat_" + subcat_full;
					newsubdiv.classList.add("subcat");
					newsubdiv.classList.add("frame");
					var h3 = document_createElement("h3");
					h3.innerText = _(subcategories[category][subcat]);
					newsubdiv.appendChild(h3);
					div.appendChild(newsubdiv);
					subcategory_els[subcat_full] = newsubdiv;
				}
			}
			options_el.appendChild(div);
		}
		var show_advanced = settings.advanced_options;
		var normalize_value = function(value) {
			if (is_array(value) && value.length === 1) {
				return JSON_stringify(value[0]);
			}
			return JSON_stringify(value);
		};
		var category_settings = {};
		var label_texts = {};
		var add_setting_dom = function(setting) {
			var meta = settings_meta[setting];
			if (!meta) {
				return;
			}
			if (!(setting in orig_settings))
				return;
			var value = settings[setting];
			var orig_value = orig_settings[setting];
			if (meta.hidden)
				return;
			if (meta.userscript_only && !is_userscript)
				return;
			if (meta.extension_only && !is_extension)
				return;
			if (meta.advanced && !show_advanced)
				return;
			category_settings[meta.category] = true;
			if (settings.settings_tabs && meta.category !== current_options_tab)
				return;
			var option = document_createElement("div");
			option.classList.add("option");
			option.id = "option_" + setting;
			if (/^t[0-9]+_/.test(setting) || /_t[0-9]+$/.test(setting)) {
				option.classList.add("trigger_profile");
			}
			var table = document_createElement("table");
			table.classList.add("option-table");
			var tr = document_createElement("tr");
			table.appendChild(tr);
			var name = document_createElement("strong");
			md_to_html(name, _(meta.name));
			var description = _(meta.description);
			if (meta.description_userscript && is_userscript)
				description = _(meta.description_userscript);
			if (description) {
				name.title = description;
			} else {
				name.classList.add("no-title");
			}
			var name_td = document_createElement("td");
			name_td.classList.add("name_td");
			name_td.classList.add("name_td_va_middle");
			var revert_btn = document.createElement("button");
			// \u2b8c = ⮌
			revert_btn.innerText = "\u2b8c";
			revert_btn.classList.add("revert-button");
			revert_btn.title = _("Revert");
			revert_btn.onclick = function() {
				if (revert_btn.disabled)
					return;
				do_update_setting(setting, orig_value, meta);
				run_soon(do_options);
			};
			var check_value_orig_different = function(value) {
				var value_norm = normalize_value(value);
				var orig_norm = normalize_value(orig_value);
				if (meta.type === "keysequence") {
					value_norm = JSON_stringify(normalize_keychord(value));
					orig_norm = JSON_stringify(normalize_keychord(orig_value));
				}
				var value_orig_different = value_norm !== orig_norm;
				if (value_orig_different) {
					name_td.classList.add("value_modified");
					name_td.appendChild(revert_btn);
				} else {
					name_td.classList.remove("value_modified");
					if (revert_btn.parentElement === name_td)
						name_td.removeChild(revert_btn);
				}
			};
			var do_update_setting_real = function(setting, new_value, meta) {
				update_setting(setting, new_value);
				run_soon(function() {
					check_value_orig_different(new_value);
				});
				show_saved_message(meta);
			};
			var do_update_setting = function(setting, new_value, meta) {
				if (is_extension && meta.required_permission) {
					request_permission(meta.required_permission, function(granted) {
						if (granted) {
							do_update_setting_real(setting, new_value, meta);
						} else {
							do_options();
						}
					});
				} else {
					do_update_setting_real(setting, new_value, meta);
				}
			};
			name_td.appendChild(name);
			check_value_orig_different(value);
			tr.appendChild(name_td);
			var value_td = document_createElement("td");
			value_td.classList.add("value_td");
			var type = "options";
			var option_list = {};
			if (typeof orig_value === "boolean") {
				type = "options";
				option_list["true"] = { name: _("yes") };
				option_list["false"] = { name: _("no") };
				if (value)
					option_list["true"].checked = true;
				else
					option_list["false"].checked = true;
			} else if (meta.options) {
				if (meta.options._randomize) {
					var keys = Object.keys(meta.options);
					var new_options = {};
					// prepend options that do need to be properly sorted
					for (var option_name in meta.options) {
						if (option_name[0] == "_" || meta.options[option_name].is_null) {
							new_options[option_name] = meta.options[option_name];
						}
					}
					keys.sort(function() {
						return (Math_floor(Math_random() * 2) ? 1 : -1);
					});
					for (var i = 0; i < keys.length; i++) {
						if (keys[i] in new_options)
							continue;
						new_options[keys[i]] = meta.options[keys[i]];
					}
					meta.options = new_options;
				}
				if (meta.options._type === "combo") {
					type = "combo";
				} else {
					type = "options";
					option_list = deepcopy(meta.options);
					var check_optionlist = function(val, list) {
						if (val in list) {
							list[val].checked = true;
						} else {
							for (var item in list) {
								if (item.match(/^_group/)) {
									check_optionlist(val, list[item]);
								}
							}
						}
					};
					if (is_array(value)) {
						array_foreach(value, function(val) {
							check_optionlist(val, option_list);
						});
					} else {
						check_optionlist(value, option_list);
					}
				}
			} else if (meta.type) {
				if (meta.type === "textarea" ||
					meta.type === "keysequence" ||
					meta.type === "number" ||
					meta.type === "lineedit")
					type = meta.type;
			}
			if (type === "options") {
				var option_type = option_list._type;
				if (!option_type)
					option_type = "or";
				var add_setting = function(parent, op, val, option_type, group, group_type) {
					var id = "input_" + setting + "_" + op;
					var name = setting;
					if (group && group_type === "and")
						name += "_" + group;
					var input = document_createElement("input");
					if (option_type === "or" && false)
						input.setAttribute("type", "radio");
					else if (option_type === "and" || true)
						input.setAttribute("type", "checkbox");
					input.name = name;
					input.value = op;
					input.id = id;
					if (val.checked)
						input.setAttribute("checked", "true");
					input.addEventListener("change", function(event) {
						var value = this.value;
						if (value === "true") {
							value = true;
						}
						if (value === "false")
							value = false;
						if (this.checked) {
							if (group && group_type === "or") {
								for (var child_i = 0; child_i < value_td.children.length; child_i++) {
									var child = value_td.children[child_i];
									if (child.id !== (setting + group)) {
										for (var subchild_i = 0; subchild_i < child.children.length; subchild_i++) {
											var subchild = child.children[subchild_i];
											if (subchild.tagName === "INPUT") {
												subchild.checked = false;
											}
										}
									}
								}
							}
							if (option_type === "or") {
								for (var child_i = 0; child_i < parent.children.length; child_i++) {
									var child = parent.children[child_i];
									if (child.tagName === "INPUT" && child.id != input.id) {
										child.checked = false;
									}
								}
							}
						} else {
							var onechecked = false;
							for (var child_i = 0; child_i < value_td.children.length; child_i++) {
								var child = value_td.children[child_i];
								for (var subchild_i = 0; subchild_i < child.children.length; subchild_i++) {
									var subchild = child.children[subchild_i];
									if (subchild.tagName === "INPUT") {
										if (subchild.checked) {
											onechecked = true;
											break;
										}
									}
								}
								if (onechecked)
									break;
							}
							if (!onechecked) {
								this.checked = true;
							}
						}
						var new_value = value;
						if (group || option_type !== "or") {
							var out_value = [];
							var inputs = value_td.getElementsByTagName("input");
							for (var child_i = 0; child_i < inputs.length; child_i++) {
								var child = inputs[child_i];
								if (child.checked) {
									out_value.push(child.value);
								}
							}
							new_value = out_value;
							do_update_setting(setting, new_value, meta);
						} else {
							do_update_setting(setting, value, meta);
						}
						//settings[setting] = new_value;
						check_disabled_options();
						show_warnings();
					});
					parent.appendChild(input);
					var label = document_createElement("label");
					label.setAttribute("for", id);
					label_texts[id] = _(val.name);
					if (label_texts[id]) {
						label.innerText = label_texts[id];
					} else {
						label.innerHTML = "&nbsp;";
					}
					if (val.description) {
						label.title = _(val.description);
					}
					parent.appendChild(label);
				};
				for (var op in option_list) {
					if (option_list[op].extension_only && !is_extension)
						continue;
					if (op.match(/^_group/)) {
						var option_type1 = option_list[op]._type;
						if (!option_type1)
							option_type1 = "or";
						var sub = document_createElement("div");
						sub.classList.add("group");
						sub.id = setting + op;
						for (var op1 in option_list[op]) {
							if (!op1.match(/^_/))
								add_setting(sub, op1, option_list[op][op1], option_type1, op, option_type);
						}
						value_td.appendChild(sub);
					} else if (!op.match(/^_/)) {
						add_setting(value_td, op, option_list[op], option_type);
					}
				}
			} else if (type === "textarea") {
				var sub = document_createElement("table");
				var sub_tr = document_createElement("tr");
				var sub_ta_td = document_createElement("td");
				sub_ta_td.style.verticalAlign = "middle";
				//sub_ta_td.style.height = "1px";
				var sub_button_tr = document_createElement("tr");
				var sub_button_td = document_createElement("td");
				sub_button_td.style.textAlign = "center";
				//sub_button_td.style.verticalAlign = "middle";
				//sub_button_td.style.height = "1px";
				var textarea = document_createElement("textarea");
				textarea.style.height = "5em";
				textarea.style.width = "20em";
				if (value)
					textarea.value = value;
				var savebutton = document_createElement("button");
				savebutton.innerText = _("save");
				savebutton.onclick = function() {
					do_update_setting(setting, textarea.value, meta);
					// Background CSS style unlocks Background fade
					check_disabled_options();
					//settings[setting] = textarea.value;
				};
				sub_ta_td.appendChild(textarea);
				sub_button_td.appendChild(savebutton);
				sub_button_tr.appendChild(sub_button_td);
				sub_tr.appendChild(sub_ta_td);
				sub.appendChild(sub_tr);
				sub.appendChild(sub_button_tr);
				value_td.appendChild(sub);
			} else if (type === "number" || type === "lineedit") {
				var sub = document_createElement("table");
				var sub_tr = document_createElement("tr");
				var sub_in_td = document_createElement("td");
				sub_in_td.style = "display:inline";
				var input = document_createElement("input");
				if (false && type === "number") {
					// doesn't work properly on Waterfox, most of the functionality is implemented here anyways
					// thanks to decembre on github for reporting: https://github.com/qsniyg/maxurl/issues/14#issuecomment-531080061
					input.type = "number";
				} else {
					input.type = "text";
				}
				input.setAttribute("spellcheck", false);
				if (type === "number") {
					input.style = "text-align:right";
					if (meta.number_max !== void 0)
						input.setAttribute("max", meta.number_max.toString());
					if (meta.number_min !== void 0)
						input.setAttribute("min", meta.number_min.toString());
					if (meta.number_int)
						input.setAttribute("step", "1");
				}
				if (value !== void 0)
					input.value = value;
				input.oninput = input.onblur = function(e) {
					var need_correct = false;
					var do_update = true;
					if (e.type === "blur") {
						need_correct = true;
						do_update = false;
					}
					var value = input.value.toString();
					if (type === "number") {
						value = parseFloat(value);
						var orig_value = value;
						if (isNaN(value)) {
							if (!need_correct)
								return;
							value = 0;
						}
						if (meta.number_int) {
							value = parseInt(value);
						}
						if (meta.number_max !== void 0)
							value = Math_min(value, meta.number_max);
						if (meta.number_min !== void 0)
							value = Math_max(value, meta.number_min);
						if (isNaN(value)) {
							console_error("Error: number is NaN after min/max");
							return;
						}
						if (meta.number_int || value !== orig_value)
							input.value = value;
						value = parseFloat(value);
						if (e.type === "blur" && value !== orig_value) {
							do_update = true;
						}
					}
					if (do_update)
						do_update_setting(setting, value, meta);
				};
				var sub_units_td = document_createElement("td");
				//sub_units_td.style = "display:inline";
				sub_units_td.classList.add("number_units");
				if (meta.number_unit)
					sub_units_td.innerText = _(meta.number_unit);
				sub_tr.appendChild(input);
				sub_tr.appendChild(sub_units_td);
				sub.appendChild(sub_tr);
				value_td.appendChild(sub);
			} else if (type === "keysequence") {
				var sub = document_createElement("table");
				var values = deepcopy(value);
				if (values.length > 0 && !is_array(values[0]))
					values = [values];
				var indices = [];
				for (var i = 0; i < values.length; i++) {
					indices.push(i);
				}
				var is_only_keyseq = function() {
					var active_indices = 0;
					for (var i = 0; i < indices.length; i++) {
						if (indices[i] >= 0)
							active_indices++;
					}
					return active_indices < 2;
				};
				var update_keyseq_setting = function() {
					var result = [];
					for (var i = 0; i < indices.length; i++) {
						if (indices[i] >= 0 && values[i].length > 0) {
							result.push(values[i]);
						}
					}
					do_update_setting(setting, result, meta);
					check_disabled_options();
				};
				var recalculate_removebtns = function() {
					var do_remove = !meta.keyseq_allow_none && is_only_keyseq();
					for (var i = 0; i < sub.children.length; i++) {
						var child = sub.children[i];
						var removebtns = child.getElementsByClassName("removebtn");
						if (removebtns.length > 0) {
							if (do_remove) {
								removebtns[0].style.display = "none";
							} else {
								removebtns[0].style.display = "initial";
							}
						}
					}
				};
				var add_keyseq_tr = function(index, start_recording) {
					var sub_tr = document_createElement("tr");
					sub_tr.classList.add("keyseq");
					var sub_key_td = document_createElement("td");
					//sub_key_td.style = "display:inline;font-family:monospace";
					sub_key_td.classList.add("record_keybinding");
					if (value) {
						sub_key_td.innerText = get_trigger_key_texts(values)[index];
					}
					var sub_record_td = document_createElement("td");
					sub_record_td.style = "display:inline";
					var sub_record_btn = document_createElement("button");
					sub_record_btn.innerText = _("Record");
					var do_record = function() {
						if (recording_keys) {
							if (keysequence_valid(options_chord)) {
								values[index] = options_chord;
								update_keyseq_setting();
								//do_update_setting(setting, options_chord, meta);
								//settings[setting] = options_chord;
								do_cancel();
							}
						} else {
							options_chord = [];
							current_options_chord = [];
							recording_keys = function() {
								var our_chord = options_chord;
								if (our_chord.length === 0)
									our_chord = values[index];
								sub_key_td.innerText = get_trigger_key_texts(our_chord);
								if (keysequence_valid(options_chord)) {
									sub_record_btn.classList.remove("disabled");
								} else {
									sub_record_btn.classList.add("disabled");
								}
							};
							sub_record_btn.innerText = _("save");
							sub_cancel_btn.style = "display:inline-block";
						}
					};
					sub_record_btn.onmousedown = do_record;
					var sub_cancel_btn = document_createElement("button");
					sub_cancel_btn.innerText = _("Cancel");
					sub_cancel_btn.style = "display:none";
					var do_cancel = function() {
						recording_keys = false;
						sub_record_btn.innerText = _("Record");
						sub_record_btn.classList.remove("disabled");
						sub_cancel_btn.style = "display:none";
						sub_key_td.innerText = get_trigger_key_texts(values)[index];
					};
					sub_cancel_btn.onmousedown = do_cancel;
					var sub_remove_btn = document_createElement("button");
					//sub_remove_btn.innerText = "—";
					sub_remove_btn.innerText = "\xD7";
					sub_remove_btn.title = _("Remove");
					sub_remove_btn.classList.add("removebtn");
					sub_remove_btn.classList.add("small");
					if (!meta.keyseq_allow_none && is_only_keyseq()) {
						sub_remove_btn.style = "display:none";
					}
					sub_remove_btn.onclick = function() {
						if (!meta.keyseq_allow_none && is_only_keyseq())
							return;
						recording_keys = false;
						indices[index] = -1;
						for (var i = index + 1; i < indices.length; i++) {
							indices[i]--;
						}
						sub_tr.parentElement.removeChild(sub_tr);
						recalculate_removebtns();
						update_keyseq_setting();
					};
					sub_tr.appendChild(sub_key_td);
					sub_record_td.appendChild(sub_record_btn);
					sub_record_td.appendChild(sub_cancel_btn);
					sub_record_td.appendChild(sub_remove_btn);
					sub_tr.appendChild(sub_record_td);
					if (start_recording)
						do_record();
					return sub_tr;
				};
				for (var i = 0; i < indices.length; i++) {
					sub.appendChild(add_keyseq_tr(i));
				}
				var sub_add_tr = document_createElement("tr");
				var sub_add_td = document_createElement("td");
				var sub_add_btn = document_createElement("button");
				sub_add_btn.innerText = "+";
				sub_add_btn.title = _("Add keybinding");
				sub_add_btn.classList.add("small");
				sub_add_btn.onclick = function() {
					var last_index = -1;
					for (var i = indices.length - 1; i >= 0; i--) {
						if (indices[i] >= 0) {
							last_index = indices[i];
							break;
						}
					}
					indices.push(last_index + 1);
					values.push([]);
					sub.insertBefore(add_keyseq_tr(indices.length - 1, true), sub_add_tr);
					recalculate_removebtns();
				};
				sub_add_td.appendChild(sub_add_btn);
				sub_add_tr.appendChild(sub_add_td);
				sub.appendChild(sub_add_tr);
				value_td.appendChild(sub);
			} else if (type === "combo") {
				var sub = document_createElement("select");
				var null_option = null;
				for (var coption in meta.options) {
					if (!coption || coption[0] === '_')
						continue;
					var coption_obj = meta.options[coption];
					var trans_name = coption_obj.name;
					if (!("name_gettext" in coption_obj) || coption_obj.name_gettext) {
						trans_name = _(trans_name);
					}
					var optionid = "input_" + setting + "_" + coption;
					label_texts[optionid] = trans_name;
					var optionel = document_createElement("option");
					optionel.innerText = trans_name;
					optionel.value = coption;
					optionel.id = optionid;
					if (coption_obj.description) {
						optionel.title = _(coption_obj.description);
					}
					if (coption_obj.is_null)
						null_option = coption;
					sub.appendChild(optionel);
				}
				var sub_value = settings[setting];
				if (sub_value === null && null_option) {
					sub_value = null_option;
				}
				sub.value = sub_value;
				sub.onchange = function() {
					var value = sub.value;
					if (value in meta.options && meta.options[value].is_null) {
						value = null;
					}
					do_update_setting(setting, value, meta);
					check_disabled_options();
					show_warnings();
				};
				value_td.appendChild(sub);
			}
			tr.appendChild(value_td);
			option.appendChild(table);
			if (description && settings.settings_visible_description) {
				var description_el = document_createElement("p");
				md_to_html(description_el, description);
				//description_el.innerText = description;
				description_el.classList.add("description");
				option.appendChild(description_el);
			}
			if (meta.warning) {
				var warning = document_createElement("p");
				warning.style.display = "none";
				warning.classList.add("warning");
				option.appendChild(warning);
			}
			var requirements = document_createElement("div");
			//requirements.style.display = "none";
			requirements.classList.add("requirements");
			requirements.classList.add("hidden");
			option.appendChild(requirements);
			if (meta.example_websites) {
				var examples = document_createElement("ul");
				examples.classList.add("examples");
				for (var example_i = 0; example_i < meta.example_websites.length; example_i++) {
					var example_text = meta.example_websites[example_i];
					var example_el = document_createElement("li");
					example_el.innerText = _(example_text);
					examples.appendChild(example_el);
				}
				option.appendChild(examples);
			}
			if (meta.documentation) {
				var get_title = function(expanded) {
					// ⯈
					var arrow = "%E2%AF%88";
					if (expanded) {
						// ⯆
						arrow = "%E2%AF%86";
					}
					return decodeURIComponent(arrow) + " " + _(meta.documentation.title);
				};
				var text = get_title(false);
				var spoiler_title = document_createElement("span");
				spoiler_title.classList.add("spoiler-title");
				spoiler_title.innerText = text;
				var expanded = false;
				spoiler_title.onclick = function() {
					expanded = !expanded;
					if (expanded) {
						spoiler_contents.style.display = "block";
					} else {
						spoiler_contents.style.display = "none";
					}
					spoiler_title.innerText = get_title(expanded);
				};
				var spoiler_contents = document_createElement("div");
				spoiler_contents.classList.add("spoiler-contents");
				spoiler_contents.style.display = "none";
				spoiler_contents.innerHTML = meta.documentation.value;
				option.appendChild(spoiler_title);
				option.appendChild(spoiler_contents);
			}
			var errordiv = document_createElement("div");
			errordiv.classList.add("error");
			errordiv.classList.add("hidden");
			option.appendChild(errordiv);
			if (meta.category) {
				var subcat = meta.category;
				if (meta.subcategory)
					subcat += "_" + meta.subcategory;
				subcategory_els[subcat].appendChild(option);
			} else {
				options_el.appendChild(option);
			}
		};
		var settingslist = Object.keys(settings);
		if (settings.settings_alphabetical_order) {
			settingslist.sort(function(a, b) {
				var a_meta = settings_meta[a];
				var b_meta = settings_meta[b];
				if (!a_meta || !b_meta || !a_meta.name || !b_meta.name) {
					return a.localeCompare(b);
				}
				return _(a_meta.name).localeCompare(_(b_meta.name));
			});
		}
		for (var i = 0; i < settingslist.length; i++) {
			add_setting_dom(settingslist[i]);
		}
		check_disabled_options();
		show_warnings();
		for (var category in category_els) {
			var our_els = category_els[category];
			if (!(category in category_settings)) {
				for (var i = 0; i < our_els.length; i++) {
					our_els[i].parentNode.removeChild(our_els[i]);
				}
			}
		}
		for (var subcategory in subcategory_els) {
			var our_el = subcategory_els[subcategory];
			if (our_el.querySelectorAll(".option").length === 0) {
				our_el.parentNode.removeChild(our_el);
			}
		}
		document.body.appendChild(saved_el);
		options_el_real.appendChild(options_el);
		options_el = options_el_real;
	}
	function get_single_setting_raw(value) {
		if (is_array(value))
			return value[0];
		return value;
	}
	function get_single_setting(setting) {
		return get_single_setting_raw(settings[setting]);
	}
	function parse_value(value) {
		try {
			// undefined (void 0), "true" and "false" are the most common ones, let's avoid calling JSON_parse unless necessary
			// this improves performance
			if (value === void 0) {
				return value;
			} else if (value === "true") {
				return true;
			} else if (value === "false") {
				return false;
			}
			return JSON_parse(value);
		} catch (e) {
			return value;
		}
	}
	function serialize_value(value) {
		return JSON_stringify(value);
	}
	// needed for guerillajs (pale moon)
	var gm_nonexistent_is_null = null;
	function gm_check_nonexistent() {
		if (gm_nonexistent_is_null !== null)
			return gm_nonexistent_is_null;
		gm_nonexistent_is_null = GM_getValue("nonexistent_value_abcdefg", void 0) === null;
		return gm_nonexistent_is_null;
	}
	function gm_getvalue_wrap(key) {
		var value = GM_getValue(key, void 0);
		if (value === null && gm_check_nonexistent())
			value = void 0;
		return value;
	}
	function get_values(keys, cb) {
		if (is_extension) {
			extension_send_message({
				type: "getvalue",
				data: keys
			}, function(response) {
				response = response.data;
				obj_foreach(response, function(key, value) {
					response[key] = parse_value(value);
				});
				cb(response);
			});
		} else if (typeof GM_getValue !== "undefined" &&
			// Unfortunately FireMonkey currently implements GM_getValue as a mapping to GM.getValue for some reason
			//   https://github.com/erosman/support/issues/98
			// Until this is fixed, we cannot use GM_getValue for FireMonkey
			userscript_manager !== "FireMonkey") {
			var response = {};
			array_foreach(keys, function(key) {
				response[key] = parse_value(gm_getvalue_wrap(key));
			});
			return cb(response);
		} else if (typeof GM !== "undefined" && GM.getValue) {
			var total_keys = 0;
			var response = {};
			array_foreach(keys, function(key) {
				GM.getValue(key, void 0).then(function(value) {
					response[key] = parse_value(value);
					if (++total_keys >= keys.length) {
						cb(response);
					}
				}, function(error) {
					console_error(error);
					if (++total_keys >= keys.length) {
						cb(response);
					}
				});
			});
		} else {
			cb({});
		}
	}
	function get_value(key, cb) {
		return get_values([key], function(data) {
			return cb(data[key]);
		});
	}
	var updating_options = 0;
	function set_value(key, value, cb) {
		if (key in settings_meta && settings_meta[key].onedit) {
			settings_meta[key].onedit(value);
		}
		value = serialize_value(value);
		//console_log("Setting " + key + " = " + value);
		if (is_extension) {
			var kv = {};
			kv[key] = value;
			//chrome.storage.sync.set(kv, function() {});
			updating_options++;
			extension_send_message({
				type: "setvalue",
				data: kv
			}, function() {
				updating_options--;
				cb && cb();
			});
		} else if (typeof GM_setValue !== "undefined") {
			GM_setValue(key, value);
			cb && cb();
		} else if (typeof GM !== "undefined" && GM.setValue) {
			GM.setValue(key, value).then(function() {
				cb && cb();
			});
		} else {
			cb && cb();
		}
	}
	function update_setting(key, value) {
		if (value === settings[key])
			return false;
		value = deepcopy(value);
		settings[key] = value;
		if (is_extension) {
			if (!(key in settings_history))
				settings_history[key] = [];
			settings_history[key].push(value);
		}
		set_value(key, value);
		return true;
	}
	function set_default_value(key, value) {
		if (!(key in user_defined_settings)) {
			settings[key] = value;
		}
	}
	function settings_updated_cb(changes) {
		if (!settings.allow_live_settings_reload)
			return;
		//console_log(message);
		var changed = false;
		for (var key in changes) {
			if (changes[key].newValue === void 0)
				continue;
			//console_log("Setting " + key + " = " + changes[key].newValue);
			var newvalue = JSON_parse(changes[key].newValue);
			if (key in settings_history) {
				var index = array_indexof(settings_history[key], newvalue);
				var pass = false;
				if (index >= 0 && index < settings_history[key].length - 1) {
					pass = true;
				}
				settings_history[key].splice(index, 1);
				if (pass)
					continue;
			}
			var setting_updated = update_setting_from_host(key, newvalue);
			changed = setting_updated || changed;
			if (setting_updated && key in settings_meta && "onupdate" in settings_meta[key]) {
				settings_meta[key].onupdate();
			}
		}
		if (changed && updating_options <= 0 && is_options_page) {
			//console_log("Refreshing options");
			do_options();
		}
	}
	;
	function upgrade_settings_with_version(version, new_settings, cb) {
		if (!version) {
			version = 0;
		} else if (typeof version !== "number") {
			version = parseInt(version);
			if (isNaN(version))
				version = 0;
		}
		if (new_settings === void 0)
			new_settings = settings;
		var changed = false;
		if (version === 0) {
			if (new_settings.mouseover_trigger) {
				var trigger_keys = [];
				for (var i = 0; i < new_settings.mouseover_trigger.length; i++) {
					var trigger = new_settings.mouseover_trigger[i];
					if (trigger.match(/^delay_[0-9]+/)) {
						var delay = parse_int(new_settings.mouseover_trigger[i].replace(/^delay_([0-9]+).*?$/, "$1"));
						if (delay <= 0 || isNaN(delay))
							delay = false;
						if (typeof delay === "number" && delay >= 10)
							delay = 10;
						update_setting("mouseover_trigger_delay", delay);
						continue;
					}
					trigger_keys.push(trigger);
				}
				if (trigger_keys.length === 0) {
					update_setting("mouseover_trigger_key", orig_settings["mouseover_trigger_key"]);
					update_setting("mouseover_trigger_behavior", "mouse");
				} else {
					update_setting("mouseover_trigger_key", trigger_keys);
					update_setting("mouseover_trigger_behavior", "keyboard");
				}
			}
			update_setting("settings_version", 1);
			changed = true;
			version = 1;
		}
		if (version === 1) {
			var partial_setting = "none";
			var partial_setting_set = new_settings.mouseover_use_fully_loaded_video !== void 0 ||
				new_settings.mouseover_use_fully_loaded_image !== void 0;
			if (partial_setting_set) {
				if (new_settings.mouseover_use_fully_loaded_video === false ||
					new_settings.mouseover_use_fully_loaded_video === void 0) {
					partial_setting = "video";
				}
				if (new_settings.mouseover_use_fully_loaded_image === void 0) {
					if (!orig_settings.mouseover_use_fully_loaded_image) {
						partial_setting = "media";
					}
				} else if (new_settings.mouseover_use_fully_loaded_image === false) {
					partial_setting = "media";
				}
				update_setting("mouseover_allow_partial", partial_setting);
			}
			update_setting("settings_version", 2);
			changed = true;
			version = 2;
		}
		if (version === 2) {
			if ("mouseover_close_on_leave_el" in new_settings) {
				var policy;
				if (new_settings.mouseover_close_on_leave_el) {
					policy = "both";
				} else {
					policy = "popup";
				}
				update_setting("mouseover_close_el_policy", policy);
			}
			update_setting("settings_version", 3);
			changed = true;
			version = 3;
		}
		if (version === 3) {
			if ("mouseover_scroll_behavior" in new_settings) {
				if (get_single_setting_raw(new_settings.mouseover_scroll_behavior) !== "zoom") {
					update_setting("mouseover_scrollx_behavior", new_settings.mouseover_scroll_behavior);
				}
				update_setting("mouseover_scrolly_behavior", new_settings.mouseover_scroll_behavior);
			}
			update_setting("settings_version", 4);
			changed = true;
			version = 4;
		}
		if (version === 4) {
			if ("mouseover_mask_styles" in new_settings && new_settings.mouseover_mask_styles) {
				update_setting("mouseover_mask_styles2", new_settings.mouseover_mask_styles);
				update_setting("mouseover_enable_mask_styles", true);
			}
			update_setting("settings_version", 5);
			changed = true;
			version = 5;
		}
		if (version === 5) {
			if ("mouseover_video_seek_vertical_scroll" in new_settings && new_settings.mouseover_video_seek_vertical_scroll) {
				update_setting("mouseover_scrolly_video_behavior", "seek");
			}
			if ("mouseover_video_seek_horizontal_scroll" in new_settings && new_settings.mouseover_video_seek_horizontal_scroll) {
				update_setting("mouseover_scrollx_video_behavior", "seek");
			}
			update_setting("settings_version", 6);
			changed = true;
			version = 6;
		}
		if (version === 6) {
			if ("mouseover_support_pointerevents_none" in new_settings && new_settings.mouseover_support_pointerevents_none) {
				update_setting("mouseover_find_els_mode", "full");
			}
			update_setting("settings_version", 7);
			changed = true;
			version = 7;
		}
		if (version === 7) {
			if ("mouseover_enable_mask_styles" in new_settings && new_settings.mouseover_enable_mask_styles) {
				update_setting("mouseover_enable_mask_styles2", "always");
			}
			update_setting("settings_version", 8);
			changed = true;
			version = 8;
		}
		if (version === 8) {
			if ("allow_video" in new_settings && !new_settings.allow_video) {
				update_setting("mouseover_allow_video", false);
				for (var i = 0; i < num_profiles; i++) {
					update_setting("t" + (i + 2) + "_mouseover_allow_video", false);
				}
				update_setting("redirect_video", false);
			}
			update_setting("settings_version", 9);
			changed = true;
			version = 9;
		}
		if (version === 9) {
			if ("allow_audio" in new_settings && new_settings.allow_audio) {
				update_setting("mouseover_allow_audio", true);
				for (var i = 0; i < num_profiles; i++) {
					update_setting("t" + (i + 2) + "_mouseover_allow_audio", true);
				}
				update_setting("redirect_audio", true);
			}
			update_setting("settings_version", 10);
			changed = true;
			version = 10;
		}
		if (version === 10) {
			if ("replaceimgs_remove_size_constraints" in new_settings && new_settings.replaceimgs_remove_size_constraints) {
				update_setting("replaceimgs_size_constraints", "remove");
			}
			update_setting("settings_version", 11);
			changed = true;
			version = 11;
		}
		cb(changed);
	}
	function upgrade_settings(cb) {
		try {
			create_blacklist_regexes();
			create_host_blacklist_regexes();
			create_host_html_blacklist_regexes();
		} catch (e) {
			console_error(e);
		}
		if (!settings.last_update_check) {
			update_setting("last_update_check", Date.now());
		}
		check_updates_if_needed();
		// TODO: merge this get_value in do_config for performance
		get_value("settings_version", function(version) {
			upgrade_settings_with_version(version, settings, cb);
		});
	}
	function update_setting_from_host(setting, value) {
		if (value !== void 0) {
			if (typeof settings[setting] === "number") {
				value = parseFloat(value);
			}
			user_defined_settings[setting] = value;
			if (value !== settings[setting]) {
				settings[setting] = value;
				return true;
			}
		}
		return false;
	}
	function do_config() {
		if (_nir_debug_) {
			console_log("do_config");
		}
		if (is_userscript || is_extension) {
			var settings_done = 0;
			var total_settings = Object.keys(settings).length + old_settings_keys.length;
			var add_value_change_listeners = function(cb) {
				if (typeof GM_addValueChangeListener === "undefined") {
					return cb();
				}
				// run in timeout to prevent this from further delaying initial page load times
				// takes ~2-3ms. not huge, but still significant
				setTimeout(function() {
					for (var setting in settings) {
						GM_addValueChangeListener(setting, function(name, oldValue, newValue, remote) {
							if (remote === false)
								return;
							var updated = {};
							updated[name] = { newValue: newValue };
							settings_updated_cb(updated);
						});
					}
				}, 1);
				cb();
			};
			var process_settings = function(settings) {
				get_values(settings, function(values) {
					// not Object.keys(values).length, because it may be smaller
					settings_done += settings.length;
					obj_foreach(values, function(key, value) {
						update_setting_from_host(key, value);
					});
					if (settings_done >= total_settings) {
						upgrade_settings(function(value) {
							add_value_change_listeners(function() {
								start( /*value*/); // commenting out because start doesn't need any arguments
							});
						});
					}
				});
			};
			process_settings(Object.keys(settings));
			process_settings(old_settings_keys);
		} else {
			start();
		}
	}
	var can_use_subzindex = true;
	try {
		// uBlock Origin: div > div[style*="z-index:"]
		if (/^[a-z]+:\/\/[^/]*txxx\.com\//.test(window.location.href)) {
			can_use_subzindex = false;
		}
	} catch (e) { }
	function set_el_all_initial(el) {
		if (can_use_subzindex) {
			el.style.all = "initial";
		} // removing zIndex doesn't work if all = "initial";
		// Under Waterfox, if offsetInlineStart is set to anything (even unset), it'll set the left to 0
		// Thanks to decembre on github for reporting this: https://github.com/qsniyg/maxurl/issues/14#issuecomment-531080061
		el.style.removeProperty("offset-inline-start");
		// https://developer.chrome.com/en/blog/tablesng/ breaks without this with reduced-motion, thanks to Noodlers for reporting
		el.style.setProperty("transition-duration", "0s", "important");
	}
	function check_bad_if(badif, resp) {
		if (_nir_debug_)
			console_log("check_bad_if", badif, resp);
		if (!badif || !is_array(badif) || badif.length === 0) {
			if (_nir_debug_)
				console_log("check_bad_if (!badif)");
			return false;
		}
		var headers = parse_headers(resp.responseHeaders);
		var check_single_badif = function(badif) {
			if (badif.headers) {
				for (var header in badif.headers) {
					var header_lower = header.toLowerCase();
					var found = false;
					for (var i = 0; i < headers.length; i++) {
						if (headers[i].name.toLowerCase() === header_lower) {
							if (typeof (badif.headers[header]) === "function") {
								found = badif.headers[header](headers[i].value);
							} else if (typeof (badif.headers[header]) === "string") {
								found = headers[i].value === badif.headers[header];
							}
							if (found) {
								break;
							} else {
								return false;
							}
						}
					}
					if (!found)
						return false;
				}
			}
			return true;
		};
		for (var j = 0; j < badif.length; j++) {
			if (check_single_badif(badif[j]))
				return true;
		}
		return false;
	}
	bigimage_recursive.check_bad_if = check_bad_if;
	var mediadelivery_support = {};
	var is_probably_video = function(obj) {
		//console_log(obj);
		if (obj.media_info && obj.media_info.type === "video")
			return true;
		if (/\.(?:mp4|webm|mkv|mpg|ogv|wmv|m3u8|mpd)(?:[?#].*)?$/i.test(obj.url))
			return true;
		return false;
	};
	var is_probably_audio = function(obj) {
		//console_log(obj);
		if (obj.media_info && obj.media_info.type === "audio")
			return true;
		if (/\.(?:mp3|m4a|oga|mkv|wma|mp4|ogg)(?:[?#].*)?$/i.test(obj.url))
			return true;
		return false;
	};
	var is_probably_stream = function(obj) {
		return is_probably_video(obj) || is_probably_audio(obj);
	};
	var get_delivery_from_url = function(url) {
		var split_ext = url_basename(url, { split_ext: true });
		if (split_ext[1] === "mpd")
			return "dash";
		if (split_ext[1] === "m3u8")
			return "hls";
		return null;
	};
	var get_mediainfo_from_contenttype = function(contenttype) {
		contenttype = contenttype.replace(/^\s*\[?\s*(.*?)\s*\]?\s*$/, "$1");
		var mediainfo = {
			type: null,
			delivery: null
		};
		if (/^audio\//.test(contenttype))
			mediainfo.type = "audio";
		if (/^video\//.test(contenttype))
			mediainfo.type = "video";
		if (contenttype === "application/oga")
			mediainfo.type = "audio";
		if (contenttype === "application/ogv")
			mediainfo.type = "video";
		if (contenttype === "application/ogg")
			mediainfo.type = "video"; // FIXME?
		if (contenttype === "application/x-mpegurl") {
			mediainfo.type = "video"; // FIXME?
			mediainfo.delivery = "hls";
		}
		return mediainfo.type ? mediainfo : null;
	};
	var is_media_type_supported = function(media_info, processing) {
		if (!media_info) {
			console_error("is_media_type_supported called without media_info");
			return true;
		}
		if (media_info.type !== "image" && media_info.type !== "video" && media_info.type !== "audio") {
			return false;
		}
		if (media_info.type === "video" && processing.deny_video) {
			return false;
		}
		if (media_info.type === "audio" && processing.deny_audio) {
			return false;
		}
		if (media_info.codec === "hevc") {
			// TODO: check for HEVC support
			return false;
		}
		if (!media_info.delivery) {
			return true;
		}
		if (media_info.need_custom_xhr) {
			if (!settings.custom_xhr_for_lib)
				return false;
		}
		if (media_info.delivery) {
			if (media_info.delivery in mediadelivery_support) {
				if (mediadelivery_support[media_info.delivery].active()) {
					return true;
				}
			}
		}
		return false;
	};
	function get_event_error(e) {
		// https://stackoverflow.com/a/46064096
		var error = e;
		if (e.path && e.path[0]) {
			error = e.path[0].error;
		}
		if (e.originalTarget) {
			error = e.originalTarget.error;
		}
		return error;
	}
	var trigger_gallery;
	var override_request = function(data, obj) {
		if (!data.method)
			data.method = "GET";
		if (!data.headers)
			data.headers = {};
		if (obj.headers) {
			for (var header in obj.headers) {
				headerobj_set(data.headers, header, obj.headers[header]);
			}
		}
		if (data.url === obj.url) {
			if (!obj.can_head && data.method === "HEAD") {
				data.method = "GET";
			}
		}
		//console_log(data);
		return data;
	};
	var set_common_el_properties = function(el, obj) {
		if (settings.popup_use_anonymous_crossorigin || (obj && !obj.need_credentials)) {
			el.setAttribute("crossorigin", "anonymous");
		}
	};
	function serialize_img(img) {
		var obj = {
			tag: img.tagName.toLowerCase(),
			src: img.src,
			autoplay: img.getAttribute("autoplay"),
			controls: img.getAttribute("controls"),
			loop: img.getAttribute("loop"),
			muted: img.muted,
			volume: img.volume
		};
		if (img.hasAttribute("crossorigin")) {
			obj["crossorigin"] = img.getAttribute("crossorigin");
		}
		return obj;
	}
	function deserialize_img(obj, cb) {
		var el = document_createElement(obj.tag);
		if (obj.tag === "video" || obj.tag === "audio") {
			if (obj.autoplay)
				el.setAttribute("autoplay", obj.autoplay);
			if (obj.controls)
				el.setAttribute("controls", obj.controls);
			if (obj.loop)
				el.setAttribute("loop", obj.loop);
			if (obj.muted)
				el.muted = obj.muted;
			if (obj.volume !== void 0)
				el.volume = obj.volume;
			el.onloadedmetadata = function() {
				cb(el);
			};
		}
		if (obj.crossorigin)
			el.setAttribute("crossorigin", obj.crossorigin);
		el.src = obj.src;
		if (obj.tag !== "video" && obj.tag !== "audio") {
			cb(el);
		}
	}
	var get_image_dims = function(image) {
		var dims = {
			height: image.naturalHeight,
			width: image.naturalWidth
		};
		if (!image.complete || (dims.height && dims.width)) {
			return dims;
		}
		// Firefox returns a width of 0 for SVGs (https://github.com/qsniyg/maxurl/issues/1243)
		var newimg = new Image();
		set_el_all_initial(newimg);
		newimg.style.margin = "0";
		newimg.style.padding = "0";
		newimg.style.visibility = "hidden";
		newimg.src = image.src;
		document.documentElement.appendChild(newimg);
		dims = {
			width: newimg.offsetWidth,
			height: newimg.offsetHeight
		};
		document.documentElement.removeChild(newimg);
		return dims;
	};
	var get_window_url = function() {
		return native_URL; // || window.URL || window.webkitURL;
	};
	var create_dataurl = function(blob, cb) {
		var a = new FileReader();
		a.onload = function(e) {
			try {
				cb(e.target.result);
			} catch (e) {
				console_error(e);
				console_error(e.stack);
				cb(null);
			}
		};
		a.readAsDataURL(blob);
	};
	var create_objecturl = function(blob) {
		return get_window_url().createObjectURL(blob);
	};
	var revoke_objecturl = function(objecturl) {
		if (is_element(objecturl))
			objecturl = objecturl.src;
		return get_window_url().revokeObjectURL(objecturl);
	};
	var is_video_el = function(el) {
		if (el.tagName === "VIDEO")
			return true;
		if (el.tagName !== "SOURCE")
			return false;
		if (el.parentElement && el.parentElement.tagName === "VIDEO")
			return true;
		return false;
	};
	var el_media_type_single = function(el) {
		if (!el)
			return null;
		var tagname = get_tagname(el);
		if (tagname === "VIDEO")
			return "video";
		if (tagname === "AUDIO")
			return "audio";
		if (tagname === "PICTURE" || tagname === "IMG")
			return "image";
		return null;
	};
	var el_media_type = function(el) {
		var single = el_media_type_single(el);
		if (single)
			return single;
		if (get_tagname(el) === "SOURCE")
			return el_media_type_single(el.parentElement);
		return null;
	};
	var destroy_image = function(image) {
		if (_nir_debug_)
			console_log("destroy_image", image);
		// TODO: maybe check to make sure it's a blob? according to the spec, this will silently fail, but browsers may print an error
		revoke_objecturl(image.src);
		image.setAttribute("imu-destroyed", "true");
	};
	var preprocess_subtitles = function(subtitles) {
		var newsubs = deepcopy(subtitles);
		// https://en.wikipedia.org/wiki/IETF_language_tag
		var langcodemap = {
			"arabic": "ar",
			"العربية": "ar",
			"bengali": "bn",
			"বাংলা": "bn",
			"german": "de",
			"deutsch": "de",
			"english": "en",
			"spanish": "es",
			"español": "es",
			"espanol": "es",
			"french": "fr",
			"français": "fr",
			"francais": "fr",
			"hindi": "hi",
			"हिंदी": "hi",
			"italian": "it",
			"italiano": "it",
			"korean": "ko",
			"한국어": "ko",
			"polish": "pl",
			"polski": "pl",
			"portuguese": "pt",
			"português": "pt",
			"portugues": "pt",
			"russian": "ru",
			"русский": "ru",
			"thai": "th",
			"ไทย": "th",
			"turkish": "tr",
			"türkçe": "tr",
			"turkce": "tr",
			"chinese": "zh",
			"中文": "zh"
		};
		for (var _i = 0, newsubs_1 = newsubs; _i < newsubs_1.length; _i++) {
			var sub = newsubs_1[_i];
			if (!sub.language_code && sub.title) {
				var title = strip_whitespace(sub.title.toLowerCase());
				if (!(title in langcodemap)) {
					title = strip_whitespace(title.replace(/[ (].*$/, ""));
				}
				if (title in langcodemap) {
					sub.language_code = langcodemap[title];
				}
			}
			if (sub.language_code)
				sub.simple_language_code = sub.language_code.replace(/-.*/, "");
		}
		var user_langs = ["en"];
		// in case of anti-fingerprinting?
		try {
			user_langs = deepcopy(navigator.languages);
		} catch (e) {
			console_error(e);
		}
		for (var i = 0; i < user_langs.length; i++) {
			user_langs[i] = user_langs[i].replace(/-.*/, "");
		}
		var best_subs = shallowcopy_array(newsubs).sort(function(a, b) {
			var ai = array_indexof(user_langs, a.simple_language_code);
			var bi = array_indexof(user_langs, b.simple_language_code);
			if (ai < 0)
				ai = 9999;
			if (bi < 0)
				bi = 9999;
			return ai - bi;
		});
		console_log(user_langs, best_subs);
		if (best_subs.length > 0 && best_subs[0].simple_language_code === user_langs[0]) {
			best_subs[0].default = true;
		}
		return newsubs;
	};
	var create_streaming_el = function(obj, type, processing, good_cb, err_cb) {
		var video = document_createElement(type);
		set_common_el_properties(video, obj);
		if (settings.mouseover_video_autoplay)
			video.setAttribute("autoplay", "autoplay");
		if (settings.mouseover_video_controls || type === "audio")
			video.setAttribute("controls", "controls");
		if (settings.mouseover_video_loop && !settings.mouseover_gallery_move_after_video)
			video.setAttribute("loop", true);
		var volume = parseInt(settings.mouseover_video_volume);
		volume = Math_max(Math_min(volume, 100), 0);
		video.volume = volume / 100.;
		if (settings.mouseover_video_muted) {
			video.muted = true;
		}
		var remove_loaded_metadata_listener = function() {
			video.onloadedmetadata = null;
			video.removeEventListener("loadedmetadata", loaded_metadata_listener);
		};
		var errorhandler = function(e) {
			console_error("Error loading video", get_event_error(e));
			remove_loaded_metadata_listener();
			err_cb();
		};
		var ran_loadedmetadata_listener = false;
		var loaded_metadata_listener = function() {
			if (!ran_loadedmetadata_listener) {
				ran_loadedmetadata_listener = true;
			} else {
				return;
			}
			video.removeEventListener("error", errorhandler, true);
			remove_loaded_metadata_listener();
			if (!processing.running) {
				return err_cb(true);
			}
			if (obj.subtitles) {
				var subs = preprocess_subtitles(obj.subtitles);
				for (var _i = 0, subs_1 = subs; _i < subs_1.length; _i++) {
					var sub = subs_1[_i];
					var trackel = document_createElement("track");
					trackel.setAttribute("kind", "captions");
					trackel.setAttribute("src", sub.url);
					if (sub.language_code)
						trackel.setAttribute("srclang", sub.language_code);
					trackel.setAttribute("label", sub.title);
					video.appendChild(trackel);
					if (sub.default) {
						trackel.setAttribute("default", "default");
					}
				}
			}
			if (video.hasAttribute("loop")) {
				if (settings.mouseover_video_autoloop_max && settings.mouseover_video_autoloop_max < video.duration)
					video.removeAttribute("loop");
			}
			var source_video = null;
			if (processing.source && processing.source.el) {
				var source_el = processing.source.el;
				if (source_el.tagName === "SOURCE") {
					source_el = source_el.parentElement;
				}
				if (source_el.tagName === "VIDEO") {
					source_video = source_el;
				}
			}
			if (settings.mouseover_video_resume_from_source && source_video && source_video.currentTime) {
				// https://github.com/qsniyg/maxurl/issues/256
				if (settings.mouseover_video_resume_if_different ||
					Math_abs(source_video.duration - video.duration) < 1 || Math_abs(1 - (source_video.duration / video.duration)) < 0.01) {
					video.currentTime = source_video.currentTime;
				}
			}
			if (settings.mouseover_video_pause_source && source_video) {
				source_video.pause();
			}
			run_soon(function() {
				good_cb(video);
			});
		};
		video.onloadedmetadata = loaded_metadata_listener;
		video.addEventListener("loadedmetadata", loaded_metadata_listener);
		video.onended = function() {
			if (settings.mouseover_enable_gallery && settings.mouseover_gallery_move_after_video) {
				trigger_gallery(1);
			}
		};
		video.addEventListener("error", errorhandler, true);
		return video;
	};
	var create_image_el = function(obj, good_cb, err_cb) {
		var img = document_createElement("img");
		set_common_el_properties(img, obj);
		var end_cbs = function() {
			clearInterval(height_interval);
			img.onload = null;
			img.onerror = null;
		};
		img.onload = function() {
			end_cbs();
			var dims = get_image_dims(img);
			if (dims.width === 0 || dims.height === 0) {
				if (_nir_debug_)
					console_log("naturalWidth or naturalHeight == 0", img);
				return err_cb();
			}
			good_cb(img);
		};
		img.onerror = function(e) {
			if (_nir_debug_)
				console_log("Error loading image", img, e);
			end_cbs();
			err_cb();
		};
		var height_interval = setInterval(function() {
			if (img.naturalWidth !== 0 && img.naturalHeight !== 0) {
				end_cbs();
				good_cb(img);
			}
		}, 15);
		return img;
	};
	var set_direct_src = function(el, src, info_obj) {
		if (!el)
			return;
		var set_src = function(el, src) {
			el.src = src;
		};
		var is_incomplete = typeof src === "string" && /^https?:\/\//i.test(src);
		if (is_extension && is_incomplete) {
			extension_send_message({
				type: "override_next_headers",
				data: {
					url: src,
					method: "GET",
					headers: info_obj.headers,
					anonymous: el.getAttribute("crossorigin") === "anonymous",
					content_type: info_obj.content_type || null
				}
			}, function() {
				set_src(el, src);
			});
		} else {
			set_src(el, src);
		}
	};
	var create_media_el = function(obj, type, processing, good_cb, err_cb) {
		if (type === "image") {
			return create_image_el(obj, good_cb, err_cb);
		} else if (type === "video" || type === "audio") {
			return create_streaming_el(obj, type, processing, good_cb, err_cb);
		} else {
			console_error("Currently unsupported media type", type);
			err_cb();
			return null;
		}
	};
	// TODO: maybe move to a generic reference class, like Cache?
	var check_image_refs = new_map();
	var check_image_ref = function(image) {
		if (map_has(check_image_refs, image)) {
			var refs = map_get(check_image_refs, image);
			refs++;
			map_set(check_image_refs, image, refs);
		} else {
			map_set(check_image_refs, image, 1);
		}
	};
	var check_image_unref = function(image) {
		if (!map_has(check_image_refs, image))
			return;
		var refs = map_get(check_image_refs, image);
		refs--;
		if (refs <= 0) {
			destroy_image(image);
			map_remove(check_image_refs, image);
		} else {
			map_set(check_image_refs, image, refs);
		}
	};
	var check_image_cache = null;
	var check_image_cbs = {};
	function check_image_get(obj, cb, processing) {
		if (_nir_debug_) nir_debug("check_image_get", "check_image_get", deepcopy(obj), cb, deepcopy(processing));
		if (!obj || !obj[0] || !obj[0].url) {
			return cb(null);
		}
		if (!processing.running) {
			return cb(null);
		}
		var err_cb_real = function(_no_propagate) {
			revoke_objecturl(last_objecturl);
			obj.shift();
			if (_nir_debug_) nir_debug("check_image_get", "check_image_get(err_cb):", obj, processing);
			return check_image_get(obj, cb, processing);
		};
		var err_cb = err_cb_real;
		if (processing.set_cache || processing.use_cache) {
			if (!check_image_cache) {
				var maximum_items = settings.popup_cache_itemlimit;
				if (maximum_items <= 0)
					maximum_items = null;
				check_image_cache = new IMUCache({
					max_keys: maximum_items,
					destructor: function(key, value) {
						if (value && value.img)
							check_image_unref(value.img);
					}
				});
			}
		}
		// this happens for waiting: true images, such as private Flickr images (thanks to fireattack for reporting)
		// FIXME: a better fix would be to always fillobj, including for waiting: true
		if (!obj[0].media_info) {
			console_warn("No media info", obj[0]);
			obj[0].media_info = deepcopy(default_object.media_info);
			//return err_cb();
		}
		// do this before cache, in case settings change
		if (!is_media_type_supported(obj[0].media_info, processing)) {
			console_warn("Media type", obj[0].media_info, "is not supported");
			return err_cb();
		}
		if (processing.use_cache) {
			if (check_image_cache.has(obj[0].url)) {
				var cached_result = check_image_cache.get(obj[0].url);
				if (_nir_debug_) nir_debug("check_image_get", "check_image_get(cached):", cached_result.img, cached_result.resp, obj[0]);
				var img = cached_result.img;
				var destroyed = false;
				if (img) {
					if ((img.tagName === "VIDEO" || img.tagName === "AUDIO") && !settings.popup_cache_resume_video) {
						img.currentTime = cached_result.currentTime || 0;
					}
					if (img.hasAttribute("imu-destroyed"))
						destroyed = true;
				}
				if (!destroyed) {
					if (cached_result.filesize && !obj[0].filesize) {
						obj[0].filesize = cached_result.filesize;
					}
					if (processing.head) {
						cb(cached_result.resp, obj[0]);
					} else {
						cb(cached_result.img, cached_result.resp.finalUrl, obj[0], cached_result.resp);
					}
					return;
				}
			}
		}
		var method = "GET";
		var responseType = "blob";
		var last_objecturl = null;
		var obj_is_probably_video = is_probably_video(obj[0]);
		var obj_is_probably_stream = is_probably_stream(obj[0]);
		var incomplete_request = false;
		if (processing.incomplete_image || (obj_is_probably_stream && processing.incomplete_video) || processing.head)
			incomplete_request = true;
		if (obj[0].need_blob || obj[0].need_data_url)
			incomplete_request = false;
		if (obj_is_probably_stream && !obj[0].media_info.delivery) {
			obj[0].media_info.delivery = get_delivery_from_url(obj[0].url);
		}
		if (processing.head || incomplete_request) {
			if (incomplete_request && !obj[0].can_head) {
				method = "GET";
			} else {
				method = "HEAD";
			}
			responseType = void 0;
		}
		if (obj[0].url.match(/^data:/) && !obj[0].media_info.delivery) {
			var img = document_createElement("img");
			set_common_el_properties(img, obj[0]);
			img.src = obj[0].url;
			img.onload = function() {
				cb(img, obj[0].url, obj[0]);
			};
			img.onerror = function(e) {
				console_log("Error loading image", e);
				err_cb();
			};
			return;
		}
		var run_cbs = function(our_this, args, no_propagate) {
			if (no_propagate) {
				return final_cb.apply(our_this, args);
			}
			//console_log("Running cbs for", our_this, args, cb_key);
			var cbs = check_image_cbs[cb_key];
			if (!cbs) {
				console_error("Already ran cbs?", our_this, args, cb_key);
				return;
			}
			delete check_image_cbs[cb_key];
			array_foreach(cbs, function(cb) {
				cb(our_this, args);
			});
		};
		var final_cb = cb;
		var url = obj[0].url;
		console_log("Trying " + url);
		// commenting out because allow_video is no longer in settings
		/*if (false) {
			var video_allowed = settings.allow_video && !processing.deny_video;

			if (obj[0] && obj[0].media_info.type === "video") {
				if (!video_allowed) {
					console_log("Video, skipping due to user setting");
					return err_cb();
				}
			}
		}*/
		if (obj[0].url && /^blob:/.test(obj[0].url)) {
			console_log("Blob URL");
			return err_cb();
		}
		if (obj[0].bad) {
			console_log("Bad image");
			return err_cb();
		}
		if (obj[0].is_pagelink) {
			console_log("Page link");
			return err_cb();
		}
		if (is_invalid_url(obj[0].url)) {
			console_log("Invalid URL");
			return err_cb();
		}
		var url_domain = url.replace(/^([a-z]+:\/\/[^/]*).*?$/, "$1");
		var headers = obj[0].headers;
		if (!headers || Object.keys(headers).length === 0) {
			var referer_host = window.location.href;
			if (!/^https?:\/\//.test(referer_host)) // e.g. file://
				referer_host = "";
			headers = {
				//"Origin": url_domain,
				"Referer": referer_host
			};
		} else if (!headers.Origin && !headers.origin) {
			//headers.Origin = url_domain;
		}
		var handled = false;
		var onload_cb = function(resp) {
			if (handled) {
				return;
			}
			handled = true;
			if (!processing.running) {
				return final_cb(null);
			}
			if (false && resp.readyState !== 4)
				return;
			if (_nir_debug_) nir_debug("check_image_get", "check_image_get(onload)", deepcopy(resp), resp.readyState);
			var digit = resp.status.toString()[0];
			var ok_error = check_ok_error(obj[0].head_ok_errors, resp.status);
			if ((digit === "4" || digit === "5") &&
				resp.status !== 405 && ok_error !== true) {
				if (err_cb) {
					console_log("Bad status: " + resp.status + " ( " + url + " )");
					err_cb();
				} else {
					console_error("Error: " + resp.status);
				}
				return;
			}
			if (check_bad_if(obj[0].bad_if, resp)) {
				console_log("Bad image (bad_if)", resp, obj[0].bad_if);
				return err_cb();
			}
			if (processing.head) {
				final_cb(resp, obj[0]);
				return;
			}
			var parsed_headers = headers_list_to_dict(parse_headers(resp.responseHeaders));
			var media_info = obj[0].media_info;
			// TODO: improve
			if (media_info.type === "image" && parsed_headers["content-type"]) {
				var detected_mediainfo = get_mediainfo_from_contenttype(parsed_headers["content-type"]);
				if (detected_mediainfo) {
					media_info.type = detected_mediainfo.type;
					if (detected_mediainfo.delivery)
						media_info.delivery = detected_mediainfo.delivery;
				}
			}
			if (false) {
				// commenting out because video_allowed doesn't exist
				/*if (media_info.type === "video" && !video_allowed) {
					console_log("Video, skipping due to user setting");
					return err_cb();
				}*/
			}
			if (!is_media_type_supported(media_info, processing)) {
				console_warn("Media type", media_info, "is not supported");
				return err_cb();
			}
			if (settings.mouseover_matching_media_types && processing && processing.source && processing.source.el) {
				var source_mediatype = el_media_type(processing.source.el);
				if (source_mediatype) {
					if (source_mediatype !== media_info.type) {
						console_log("Source was ", source_mediatype, ", this is", media_info.type, "skipping");
						return err_cb();
					}
				}
			}
			var good_cb = function(img) {
				if (_nir_debug_) nir_debug("check_image_get", "check_image_get(good_cb):", img, resp.finalUrl, obj[0], resp);
				if (processing.set_cache) {
					var cache_obj = {
						img: img,
						resp: resp,
						filesize: obj[0].filesize
					};
					if (img.tagName === "VIDEO" || img.tagName === "AUDIO")
						cache_obj.currentTime = img.currentTime;
					check_image_cache.set(obj[0].url, cache_obj, (parseFloat(settings.popup_cache_duration) || 0) * 60);
				}
				if (img)
					check_image_ref(img);
				final_cb(img, resp.finalUrl, obj[0], resp);
			};
			if (parsed_headers["content-length"] && parseInt(parsed_headers["content-length"]) > 100) {
				obj[0].filesize = parseInt(parsed_headers["content-length"]);
			}
			var set_src = function(el, src) {
				var delivery = media_info.delivery + "";
				if (media_info.type !== "image" && !processing.deny_nondirect_delivery && delivery in mediadelivery_support) {
					var module = mediadelivery_support[delivery];
					if (module.active()) {
						module.el_init({
							success: function() { }, // todo?
							fail: err_cb,
							info_obj: obj[0],
							el: el,
							src: src
						});
						return;
					}
				} else {
					set_direct_src(el, src, obj[0]);
				}
			};
			var create_media = function(src, mediatype) {
				var our_err_cb = err_cb;
				// https://github.com/qsniyg/maxurl/issues/672
				if (!mediatype && obj[0].head_wrong_contenttype && media_info.type !== "audio") {
					our_err_cb = function() {
						var all_mediatypes = ["video", "image"];
						all_mediatypes.splice(array_indexof(all_mediatypes, media_info.type), 1);
						create_media(src, all_mediatypes[0]);
					};
				}
				if (!mediatype)
					mediatype = media_info.type;
				var el = create_media_el(obj[0], mediatype, processing, good_cb, our_err_cb);
				set_src(el, src);
				return el;
			};
			if (incomplete_request) {
				create_media(resp.finalUrl);
				return;
			}
			if (!resp.response) {
				err_cb();
				return;
			}
			var loadcb = function(urldata) {
				if (_nir_debug_) {
					console_log("check_image_get's loadcb", urldata, media_info);
				}
				last_objecturl = urldata;
				if (!urldata) {
					return err_cb();
				}
				create_media(urldata);
			};
			if (obj[0].need_data_url || (!settings.mouseover_use_blob_over_data && !obj[0].need_blob)) {
				create_dataurl(resp.response, loadcb);
			} else {
				var objecturl = create_objecturl(resp.response);
				loadcb(objecturl);
			}
		};
		var req = null;
		if ((!obj[0].can_multiple_request || settings.mouseover_partial_avoid_head) && incomplete_request
			&& (!obj[0].bad_if || obj[0].bad_if.length === 0)) {
			onload_cb({
				status: 200,
				responseHeaders: "Content-Type: " + (obj_is_probably_video ? "video/mp4" : "image/jpeg"),
				readyState: 3,
				finalUrl: obj[0].url
			});
			return;
		}
		var cb_key = method + " " + incomplete_request + " " + url;
		//console_log(cb_key);
		err_cb = function(no_propagate) {
			run_cbs(null, null, no_propagate);
		};
		final_cb = function() {
			run_cbs(this, arguments);
		};
		if (!(cb_key in check_image_cbs))
			check_image_cbs[cb_key] = [];
		check_image_cbs[cb_key].push(function(our_this, args) {
			if (!args && !our_this) {
				return err_cb_real();
			}
			return cb.apply(our_this, args);
		});
		// avoid multiple requests to the same image at the same time (e.g. for replace images)
		if (check_image_cbs[cb_key].length > 1)
			return;
		var start_req = function() {
			req = do_request({
				method: method,
				url: url,
				responseType: responseType,
				headers: headers,
				trackingprotection_failsafe: true,
				need_blob_response: method == "GET",
				retry_503: true,
				onprogress: function(resp) {
					var do_abort = function() {
						if (!req || !req.abort) {
							console_warn("Unable to abort request");
							return;
						}
						req.abort();
					};
					if (!processing.running) {
						do_abort();
					}
					if (processing.progress_cb && resp.lengthComputable && resp.loaded && resp.total) {
						processing.progress_cb({
							total: resp.total,
							loaded: resp.loaded
						});
					}
					if (incomplete_request && resp.readyState >= 2 && resp.responseHeaders) {
						do_abort();
						onload_cb(resp);
					}
				},
				onload: onload_cb
			});
		};
		if (obj[0].cookie_url && get_cookies) {
			get_cookies(obj[0].cookie_url, function(cookies) {
				if (!cookies) {
					return start_req();
				}
				headerobj_set(headers, "cookie", cookies_to_httpheader(cookies));
				start_req();
			}, { need_full: true });
		} else {
			start_req();
		}
	}
	var str_to_keycode_table = {
		backspace: 8,
		enter: 13,
		shift: 16,
		ctrl: 17,
		alt: 18,
		esc: 27,
		space: 32,
		left: 37,
		up: 38,
		right: 39,
		down: 40,
		//"super": 91,
		";": 186,
		"=": 187,
		",": 188,
		"-": 189,
		".": 190,
		"/": 191,
		"`": 192,
		"[": 219,
		"\\": 220,
		"]": 221,
		"'": 222
	};
	var keycode_to_str_table = {
		8: "backspace",
		13: "enter",
		16: "shift",
		17: "ctrl",
		18: "alt",
		19: "pause",
		27: "esc",
		32: "space",
		37: "left",
		38: "up",
		39: "right",
		40: "down",
		44: "prntscreen",
		//91: "super",
		// numpad
		97: "1",
		98: "2",
		99: "3",
		100: "4",
		101: "5",
		102: "6",
		103: "7",
		104: "8",
		105: "9",
		111: "/",
		106: "*",
		107: "+",
		109: "-",
		110: ".",
		145: "scrlock",
		186: ";",
		187: "=",
		188: ",",
		189: "-",
		190: ".",
		191: "/",
		192: "`",
		219: "[",
		220: "\\",
		221: "]",
		222: "'",
		226: "\\" // IntlBackslash, VK_OEM_102 (thanks to Noodlers for reporting)
	};
	//var maxzindex = 2147483647;
	// some sites have z-index: 99999999999999 (http://www.topstarnews.net/)
	// this gets scaled down to 2147483647 in the elements panel, but it gets seen as higher than 9999* by the browser
	// Number.MAX_VALUE doesn't work at all (z-index doesn't get set)
	var MAX_SAFE_INTEGER = 9007199254740991; // Number.MAX_SAFE_INTEGER
	var maxzindex = MAX_SAFE_INTEGER;
	// sites like topstarnews under Firefox somehow change sans-serif as the default font
	var sans_serif_font = '"Noto Sans", Arial, Helvetica, sans-serif';
	var get_safe_glyph = function(font, glyphs) {
		if (settings.mouseover_ui_use_safe_glyphs)
			return glyphs[glyphs.length - 1];
		try {
			for (var i = 0; i < glyphs.length; i++) {
				if (document.fonts.check(font, glyphs[i]))
					return glyphs[i];
			}
		} catch (e) {
			console_error(e);
		}
		return glyphs[glyphs.length - 1];
	};
	function keycode_to_str(event) {
		var x = event.which;
		if (event.code) {
			// when pressing Shift
			var match = event.code.match(/^Numpad([0-9]+)$/);
			if (match) {
				return match[1];
			}
			;
		}
		if (x in keycode_to_str_table) {
			return keycode_to_str_table[x];
		}
		if (!((x >= 65 && x <= 90) ||
			// numbers
			(x >= 48 && x <= 57))) {
			return;
		}
		return string_fromcharcode(x).toLowerCase();
	}
	function str_to_keycode(x) {
		if (x in str_to_keycode_table) {
			return str_to_keycode_table[x];
		}
		return x.toUpperCase().charCodeAt(0);
	}
	function normalize_keychord(keychord) {
		if (keychord.length === 0)
			return [[]];
		if (!is_array(keychord[0]))
			return [keychord];
		return keychord;
	}
	function general_extension_message_handler(message, sender, respond) {
		if (_nir_debug_) {
			console_log("general_extension_message_handler", message);
		}
		if (message.type === "settings_update") {
			//console_log(message);
			settings_updated_cb(message.data.changes);
		} else if (message.type === "request") {
			var response = message.data;
			if (!(response.id in extension_requests)) {
				// this happens when there's more than one frame per tab
				if (_nir_debug_) {
					console_log("Request ID " + response.id + " not in extension_requests");
				}
				return;
			}
			var request_final = function() {
				var reqdata = extension_requests[response.id].data;
				var events = [
					"onload",
					"onerror",
					"onprogress",
					"onabort",
					"ontimeout"
				];
				var handled = false;
				for (var i = 0; i < events.length; i++) {
					var event = events[i];
					if (response.event === event && reqdata[event]) {
						if (_nir_debug_) {
							console_log("Running " + event + " for response", response);
						}
						reqdata[event](response.data);
						handled = true;
					}
				}
				if (_nir_debug_ && !handled) {
					console_warn("No event handler for", response);
				}
				if (response.final) {
					delete extension_requests[response.id];
				}
			};
			if (response.data && response.data.responseType === "blob") {
				var enc = response.data._responseEncoded;
				if (enc) {
					var wanted_responseType = "blob";
					if (response.data._wanted_responseType === "arraybuffer")
						wanted_responseType = "arraybuffer";
					if (enc.value) {
						var value_array = new Uint8Array(enc.value.length);
						for (var i = 0; i < enc.value.length; i++) {
							value_array[i] = enc.value.charCodeAt(i);
						}
						if (wanted_responseType === "blob") {
							try {
								response.data.response = new native_blob([value_array.buffer], { type: enc.type });
							} catch (e) {
								console_error(e);
								response.data.response = null;
							}
						} else {
							response.data.response = value_array.buffer;
						}
					} else if (enc.objurl) {
						// based on https://stackoverflow.com/a/23856573/13255485
						var xhr = new XMLHttpRequest();
						xhr.open("GET", enc.objurl);
						xhr.responseType = wanted_responseType;
						xhr.onload = function() {
							revoke_objecturl(enc.objurl);
							response.data.response = xhr.response;
							request_final();
						};
						xhr.onerror = function() {
							revoke_objecturl(enc.objurl);
							console_error("Unable to load blob for", enc, xhr);
							response.data.response = null;
							request_final();
						};
						xhr.send();
						return;
					}
				} else {
					response.data.response = null;
				}
			} else if (response.data && response.data.responseText && !response.data.response) {
				response.data.response = response.data.responseText;
			}
			request_final();
		} else if (message.type === "bg_redirect") {
			if (settings.redirect && settings.redirect_extension && settings.imu_enabled) {
				try {
					var headers = headers_list_to_dict(message.data.responseHeaders);
					if (headers["content-type"] && contenttype_can_be_redirected(headers["content-type"])) {
						do_redirect_sub(message.data.url, false, function(newurl, obj) {
							send_redirect(obj, function() {
								chrome.tabs.update(message.data.tabId, {
									url: newurl
								});
							}, message.data.tabId);
						});
					}
				} catch (e) {
					console_error(e);
				}
			}
		} else if (message.type === "get_localstorage") {
			if (_localstorage_check_origin(message.data.url)) {
				respond(_localstorage_get_items(message.data.keys, message.data.options));
			} else {
				respond(null);
			}
		}
	}
	var stackoverflow_guard = function(func, i, count) {
		if (i % count !== (count - 1)) {
			func();
		} else {
			setTimeout(func, 0);
		}
	};
	function do_mouseover() {
		if (_nir_debug_)
			console_log("do_mouseover ran");
		var mouseover_base_enabled = function() {
			if (!settings.imu_enabled)
				return false;
			if (!host_filter(window.location.href))
				return false;
			return true;
		};
		var mouseover_enabled = function() {
			return mouseover_base_enabled() && settings.mouseover;
		};
		var mouseover_mouse_enabled = function() {
			return mouseover_enabled() && delay !== false && typeof delay === "number" && delay_mouseonly;
		};
		var mousepos_initialized = false;
		var mouseX = 0;
		var mouseY = 0;
		var mouseAbsX = 0;
		var mouseAbsY = 0;
		var mouse_frame_id = "top";
		var mouseContextX = null;
		var mouseContextY = null;
		var mouseAbsContextX = 0;
		var mouseAbsContextY = 0;
		var mouse_in_image_yet = false;
		var mouseDelayX = 0;
		var mouseDelayY = 0;
		var lastX = 0;
		var lastY = 0;
		var processing_list = [];
		var popups = [];
		var trigger_id = null;
		var mask_el = null;
		var popup_obj = null;
		var previous_album_links = null;
		var override_album = null;
		var popup_contentlength = null;
		var popup_el = null;
		var popup_el_mediatype = null;
		var popup_el_is_stream = false;
		var popup_orig_url = null;
		var resetpopup_timeout = null;
		var real_popup_el = null;
		var next_popup_el = null;
		var last_popup_el = null;
		var popup_orig_el = null;
		var popup_el_automatic = false;
		var popup_el_remote = false;
		var popups_active = false;
		var popup_trigger_reason = null;
		var can_close_popup = [false, false];
		var popup_hold = false;
		var popup_hold_func = common_functions["nullfunc"];
		var popup_zoom_func = common_functions["nullfunc"];
		var popup_createui_func = common_functions["nullfunc"];
		var popup_wheel_cb = null;
		var popup_update_pos_func = null;
		var popup_update_zoom_func = null;
		var popup_hidecursor_func = common_functions["nullfunc"];
		var popup_hidecursor_timer = null;
		var popup_cursorjitterX = 0;
		var popup_cursorjitterY = 0;
		var popup_is_fullscreen = false;
		var popup_last_zoom = null;
		var popup_client_rect_cache = null;
		var last_popup_client_rect_cache = 0;
		var popup_media_client_rect_cache = null;
		var last_popup_media_client_rect_cache = 0;
		var dragstart = false;
		var dragstartX = null;
		var dragstartY = null;
		var dragoffsetX = null;
		var dragoffsetY = null;
		var popupOpenX = null;
		var popupOpenY = null;
		var popupOpenLastX = null;
		var popupOpenLastY = null;
		var dragged = false;
		var waiting = false;
		var waitingel = null;
		var waitingstyleel = null;
		var waitingel_cursor = null;
		var elwaitingstyleclass = null;
		var elwaitingstyleel = null;
		var waitingsize = 200;
		var current_chord = [];
		var current_chord_timeout = {};
		var release_ignore = [];
		var editing_text = false;
		var host_location = window_location;
		var host_domain = get_domain_from_url(host_location);
		var host_domain_nosub = get_domain_nosub(host_domain);
		function resetifout(e) {
			// doesn't work, as e doesn't contain ctrlKey etc.
			if (!trigger_complete(settings.mouseover_trigger_key)) {
				//current_chord = [];
				stop_waiting();
				resetpopups();
			}
		}
		// runs on every focusout, not just window
		/*document.addEventListener("focusout", resetifout);
		  document.addEventListener("blur", resetifout);
		  unsafeWindow.addEventListener("focusout", resetifout);
		  unsafeWindow.addEventListener("blur", resetifout);*/
		if (false) {
			var disable_click = false;
			document.addEventListener("click", function(e) {
				if (disable_click && popups_active && false) {
					e.stopPropagation();
					e.stopImmediatePropagation();
					return true;
					//return false;
				}
			}, true);
		}
		var delay = false;
		var delay_handle = null;
		var delay_handle_triggering = false;
		var delay_mouseonly = true;
		var delay_el = null;
		function get_tprofile_setting_name(setting_name) {
			if (trigger_id) {
				var new_settingname = "t" + trigger_id + "_" + setting_name;
				if (new_settingname in settings)
					setting_name = new_settingname;
			}
			return setting_name;
		}
		function get_tprofile_setting(setting_name) {
			return settings[get_tprofile_setting_name(setting_name)];
		}
		function get_tprofile_single_setting(setting) {
			return get_single_setting_raw(get_tprofile_setting(setting));
		}
		function update_waiting() {
			if (!waitingel)
				return;
			var x = mouseX; //mouseAbsX;
			var y = mouseY; //mouseAbsY;
			waitingel.style.left = (x - (waitingsize / 2)) + "px";
			waitingel.style.top = (y - (waitingsize / 2)) + "px";
		}
		var start_waiting = function(el, cursor) {
			if (!cursor)
				cursor = "wait";
			waitingel_cursor = cursor;
			waiting = true;
			if (!settings.mouseover_wait_use_el) {
				if (waitingstyleel) {
					stop_waiting();
				}
				waitingstyleel = document_createElement("style");
				waitingstyleel.innerText = "*,a,img,video {cursor: " + cursor + "!important}";
				document.documentElement.appendChild(waitingstyleel);
				return;
			}
			if (!waitingel) {
				waitingel = document_createElement("div");
				set_el_all_initial(waitingel);
				waitingel.style.zIndex = maxzindex;
				waitingel.style.cursor = cursor;
				waitingel.style.width = waitingsize + "px";
				waitingel.style.height = waitingsize + "px";
				//waitingel.style.pointerEvents = "none"; // works, but defeats the purpose, because the cursor isn't changed
				waitingel.style.position = "fixed"; //"absolute";
				var simevent = function(e, eventtype) {
					waitingel.style.display = "none";
					document.elementFromPoint(e.clientX, e.clientY).dispatchEvent(new MouseEvent(eventtype, e));
					waitingel.style.display = "block";
				};
				our_addEventListener(waitingel, "click", function(e) {
					return simevent(e, "click");
				});
				our_addEventListener(waitingel, "contextmenu", function(e) {
					return simevent(e, "contextmenu");
				});
				document.documentElement.appendChild(waitingel);
			}
			waitingel.style.cursor = cursor;
			waitingel.style.display = "block";
			update_waiting();
		};
		function start_progress(el) {
			start_waiting(el, "progress");
		}
		var stop_waiting = function() {
			if (_nir_debug_) {
				console_log("stop_waiting");
			}
			waiting = false;
			if (!settings.mouseover_wait_use_el) {
				if (waitingstyleel) {
					waitingstyleel.parentElement.removeChild(waitingstyleel);
					waitingstyleel = null;
				}
			}
			if (waitingel)
				waitingel.style.display = "none";
		};
		// camhub.cc (ublock origin blocks any setTimeout'd function with 'stop' in the name)
		function dont_wait_anymore() {
			stop_waiting();
		}
		var not_allowed_timer = null;
		function cursor_not_allowed() {
			if (_nir_debug_) {
				console_log("cursor_not_allowed");
			}
			start_waiting(void 0, "not-allowed");
			if (not_allowed_timer) {
				clearTimeout(not_allowed_timer);
			}
			not_allowed_timer = setTimeout(function() {
				not_allowed_timer = null;
				if (waitingel_cursor === "not-allowed")
					dont_wait_anymore();
			}, settings.mouseover_notallowed_duration);
		}
		function stop_waiting_cant_load() {
			if (settings.mouseover_enable_notallowed_cant_load) {
				cursor_not_allowed();
			} else {
				stop_waiting();
			}
		}
		function in_clientrect(mouseX, mouseY, rect, border) {
			if (isNaN(border) || border === void 0)
				border = 0;
			if (mouseX >= (rect.left - border) && mouseX <= (rect.right + border) &&
				mouseY >= (rect.top - border) && mouseY <= (rect.bottom + border)) {
				return true;
			} else {
				return false;
			}
		}
		function stop_processing() {
			for (var i = 0; i < processing_list.length; i++) {
				processing_list[i].running = false;
			}
		}
		var clear_resetpopup_timeout = function() {
			if (resetpopup_timeout) {
				clearTimeout(resetpopup_timeout);
				resetpopup_timeout = null;
			}
		};
		var add_resetpopup_timeout = function() {
			if (!settings.mouseover_auto_close_popup || !settings.mouseover_auto_close_popup_time)
				return;
			clear_resetpopup_timeout();
			resetpopup_timeout = setTimeout(resetpopups, settings.mouseover_auto_close_popup_time * 1000);
		};
		var removepopups_timer = null;
		function removepopups() {
			array_foreach(popups, function(popup) {
				var els = popup.querySelectorAll("img, video, audio");
				for (var i = 0; i < els.length; i++) {
					if (els[i].tagName === "VIDEO" || els[i].tagName === "AUDIO")
						els[i].pause();
					check_image_unref(els[i]);
				}
				if (popup.parentNode)
					popup.parentNode.removeChild(popup);
				var index = array_indexof(popups, popup);
				if (index > -1) {
					popups.splice(index, 1);
				}
			});
			if (removepopups_timer) {
				clearTimeout(removepopups_timer);
				removepopups_timer = null;
			}
		}
		var remove_mask = function() {
			if (mask_el) {
				if (mask_el.parentElement)
					mask_el.parentElement.removeChild(mask_el);
				mask_el = null;
			}
			if (removemask_timer) {
				clearTimeout(removemask_timer);
				removemask_timer = null;
			}
		};
		var removemask_timer = null;
		function resetpopups(options) {
			if (_nir_debug_) {
				console_log("resetpopups(", options, ")");
			}
			if (!options) {
				options = {};
			}
			var from_remote = !!options.from_remote;
			array_foreach(popups, function(popup) {
				if (settings.mouseover_fade_time > 0 && (settings.mouseover_enable_fade || settings.mouseover_enable_zoom_effect)) {
					if (settings.mouseover_enable_fade) {
						popup.style.opacity = 0;
					}
					if (settings.mouseover_enable_zoom_effect) {
						popup.style.transform = "scale(0)";
					}
					if (!removepopups_timer) {
						removepopups_timer = setTimeout(removepopups, settings.mouseover_fade_time);
					}
				} else {
					// FIXME: this is called for each popup
					removepopups();
				}
			});
			if (mask_el) {
				set_important_style(mask_el, "pointer-events", "none");
				if (settings.mouseover_mask_fade_time > 0) {
					set_important_style(mask_el, "opacity", 0);
					if (!removemask_timer) {
						removemask_timer = setTimeout(remove_mask, settings.mouseover_mask_fade_time);
					}
				} else {
					remove_mask();
				}
			}
			if (!from_remote && can_use_remote()) {
				if (is_in_iframe) {
					remote_send_message("top", { type: "resetpopups" });
				} else if (popup_el_remote) {
					remote_send_message(popup_el_remote, { type: "resetpopups" });
				}
			}
			disable_click = false;
			popups_active = false;
			delay_handle_triggering = false;
			clear_resetpopup_timeout();
			next_popup_el = null;
			if (popup_el)
				last_popup_el = popup_el;
			popup_el = null;
			real_popup_el = null;
			popup_el_automatic = false;
			popup_el_remote = false;
			popup_el_mediatype = null;
			popup_el_is_stream = false;
			popup_orig_url = null;
			popup_hold_func = common_functions["nullfunc"];
			popup_zoom_func = common_functions["nullfunc"];
			popup_createui_func = common_functions["nullfunc"];
			popup_wheel_cb = null;
			popup_update_pos_func = null;
			popup_update_zoom_func = null;
			popup_client_rect_cache = null;
			popup_is_fullscreen = false;
			last_popup_client_rect_cache = 0;
			popup_media_client_rect_cache = null;
			last_popup_media_client_rect_cache = 0;
			if (!options.automatic) {
				popup_hold = false;
				override_album = null;
			}
			if (!options.new_popup) {
				can_close_popup = [false, false];
			}
			stop_processing();
			if (!options.new_popup || settings.mouseover_wait_use_el) {
				// don't recalculate style until after the popup is open
				stop_waiting();
			}
			if (!delay_mouseonly && delay_handle) {
				clearTimeout(delay_handle);
				delay_handle = null;
			}
		}
		termination_hooks.push(resetpopups);
		function get_viewport() {
			if (window.visualViewport) {
				return [
					window.visualViewport.width,
					window.visualViewport.height
				];
			} else {
				return [
					window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
					window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
				];
			}
		}
		var get_download_urls_from_infoobj;
		(function() {
			var parse_stream = function(delivery, text, url, cb) {
				get_library("stream_parser", settings, do_request, function(sp) {
					if (!sp)
						return cb(null);
					var parser_obj = sp[delivery];
					var parse;
					if (delivery === "dash") {
						parse = parser_obj.parse;
					} else if (delivery === "hls") {
						parse = function(text) {
							var parser = new parser_obj.Parser();
							parser.push(text);
							parser.end();
							return parser.manifest;
						};
					}
					try {
						var parsed = parse(text, url);
					} catch (e) {
						console_error(e);
						return cb(null);
					}
					return cb(parsed);
				});
			};
			// todo: cache, because it's possible more than one has the same url?
			var request_parsed_stream = function(info_obj, manifest_url, cb) {
				var requestobj = override_request({
					url: manifest_url,
					onload: function(resp) {
						if (resp.status !== 200) {
							console_error("Unable to load", resp);
							return cb(null);
						}
						parse_stream(info_obj.media_info.delivery, resp.responseText, resp.finalUrl || manifest_url, function(data) {
							cb(data);
						});
					}
				}, info_obj);
				do_request(requestobj);
			};
			// prefers bandwidth over resolution
			// fixme: is this even correct? this might choose inefficient formats over more efficient ones
			var sort_playlists = function(playlists) {
				return playlists.sort(function(a_obj, b_obj) {
					var a = a_obj.attributes;
					var b = b_obj.attributes;
					if (a.BANDWIDTH && b.BANDWIDTH) {
						return b.BANDWIDTH - a.BANDWIDTH;
					}
					if (a.RESOLUTION && b.RESOLUTION) {
						var a_res = a.RESOLUTION.width * a.RESOLUTION.height;
						var b_res = b.RESOLUTION.width * b.RESOLUTION.height;
						return b_res - a_res;
					}
					// todo: FRAME-RATE?
					return 0;
				});
			};
			var get_actual_best_playlist = function(info_obj, playlists, cb) {
				if (!is_array(playlists))
					playlists = [playlists];
				sort_playlists(playlists);
				var resolve_uri = function(uri) {
					return urljoin(info_obj.url, uri, true);
				};
				var resolve_playlist = function(playlist, cb) {
					if (playlist.uri) {
						playlist.uri = resolve_uri(playlist.uri);
						var uri = playlist.uri;
						//console_log("Requesting", playlist.uri);
						request_parsed_stream(info_obj, uri, function(data) {
							if (!data)
								return cb(null);
							var origattrs = playlist.attributes;
							// should return just a playlist (not a manifest) object for m3u8
							obj_extend(playlist, data);
							// fixme: is this necessary?
							if (origattrs)
								playlist.attributes = origattrs;
							playlist.base_uri = uri;
							playlist.uri = null; // to avoid possible re-requests
							cb(playlist);
						});
					} else {
						cb(playlist);
					}
				};
				var do_process = function(playlist_id, cb) {
					var playlist = playlists[playlist_id];
					if (!playlist)
						return cb(null);
					resolve_playlist(playlist, function(new_playlist) {
						if (!new_playlist)
							return do_process(playlist_id + 1, cb);
						return cb(new_playlist);
					});
				};
				do_process(0, cb);
			};
			var get_downloadable_playlists = function(info_obj, manifest, cb) {
				get_actual_best_playlist(info_obj, manifest.playlists, function(playlist) {
					if (!playlist)
						return cb(null);
					var audio = playlist.attributes.AUDIO;
					if (audio && audio in manifest.mediaGroups.AUDIO) {
						audio = manifest.mediaGroups.AUDIO[audio];
						// todo: somehow add an option to select this
						audio = audio[Object.keys(audio)[0]];
					} else {
						audio = null;
					}
					var retobj = {
						video: playlist
					};
					if (!audio)
						return cb(retobj);
					get_actual_best_playlist(info_obj, audio.playlists || audio, function(audio_pl) {
						if (!audio_pl)
							return cb(null);
						retobj.audio = audio_pl;
						return cb(retobj);
					});
				});
			};
			var get_download_urls_from_playlist = function(info_obj, playlist) {
				var resolve_uri = function(uri) {
					return urljoin(playlist.base_uri || info_obj.url, uri, true);
				};
				// todo
				if (false && playlist.attributes) {
					// dailymotion
					var progressive = playlist.attributes["PROGRESSIVE-URI"];
					if (progressive)
						return [resolve_uri(progressive)];
				}
				var urls = [];
				var push_url = function(url) {
					if (!url)
						return;
					url = resolve_uri(url);
					array_upush(urls, url);
				};
				var push_segment = function(segment) {
					if (segment.map) {
						// only resolvedUri is present for youtube urls
						push_url(segment.map.uri || segment.map.resolvedUri);
					}
					push_url(segment.uri || segment.resolvedUri);
				};
				// youtube
				if (playlist.sidx) {
					push_segment(playlist.sidx);
				}
				array_foreach(playlist.segments, push_segment);
				return urls;
			};
			var get_download_urls_from_playlists = function(info_obj, playlists) {
				var newobj = {};
				obj_foreach(playlists, function(key, value) {
					newobj[key] = get_download_urls_from_playlist(info_obj, value);
				});
				return newobj;
			};
			get_download_urls_from_infoobj = function(info_obj, cb) {
				request_parsed_stream(info_obj, info_obj.url, function(manifest) {
					if (!manifest)
						return cb(null);
					get_downloadable_playlists(info_obj, manifest, function(playlists) {
						if (!playlists)
							return cb(null);
						//console_log("playlists", playlists);
						var urls = get_download_urls_from_playlists(info_obj, playlists);
						//console_log("urls", urls);
						return cb(urls);
					});
				});
			};
		})();
		var check_sharedarraybuffer;
		(function() {
			var check_sharedarraybuffer_inner = function(cb) {
				if (typeof SharedArrayBuffer !== "function") {
					console_warn("SharedArrayBuffer doesn't exist");
					return cb(false);
				}
				try {
					var sab = new SharedArrayBuffer(1);
					var array = new Uint8Array(sab);
					array[0] = 30;
					var workersource = "self.addEventListener('message', function(m) {try {var a = new Uint8Array(m.data); postMessage(a[0] === 30);} catch (e) {postMessage(false);}});";
					new_blob(workersource, function(blob) {
						if (!blob) {
							console_warn("Unable to create blob");
							return cb(false);
						}
						var objurl = create_objecturl(blob);
						var worker = new Worker(objurl);
						worker.onmessage = function(m) {
							cb(!!m.data);
						};
						worker.postMessage(sab);
						setTimeout(function() {
							revoke_objecturl(objurl);
						}, 10);
					});
				} catch (e) {
					console_error(e);
					return cb(false);
				}
			};
			// todo: timeout?
			var cached_sab_success = null;
			check_sharedarraybuffer = function(cb) {
				if (cached_sab_success !== null)
					return cb(cached_sab_success);
				check_sharedarraybuffer_inner(function(success) {
					cached_sab_success = success;
					cb(success);
				});
			};
		})();
		var ffmpeg_progress_cb = null;
		var get_ffmpeg_inner = function(cb) {
			get_library("ffmpeg", settings, do_request, function(ffmpeg_lib) {
				if (!ffmpeg_lib)
					return cb(null);
				if (ffmpeg_lib._imu_failed_loading)
					return cb(null);
				var ffmpeg;
				if (!ffmpeg_lib._imu_instance) {
					if (ffmpeg_lib.overridden_xhr) {
						ffmpeg_lib.xhr.do_request = function(req) {
							//console_log("overriding", req);
							req = override_request(req, {
								headers: {
									Referer: "",
									Origin: ""
								}
							});
							//console_log("requesting", req.url);
							// no need to query this as it's been patched in
							if (/\/ffmpeg-core(?:\.worker)?\.js$/.test(req.url)) {
								req.url = "data:application/javascript,void%200";
							} else if (false && /\/ffmpeg-core\.wasm$/.test(req.url)) {
								//console.trace();
								req.responseType = "blob";
								// somehow helps avoid cache misses
								// no, it seems to work fine without, this also sets Accept-Encoding: identity, which more than doubles the size
								//req.headers = { Range: "bytes=0-" };
								if (true) {
									return do_request(req);
								}
								request_chunked(req, {
									onload: function(data, resp) {
										console_log("onload", data, resp);
										if (!data) {
											resp.status = 500;
											resp.response = null;
											return req.onload(resp);
										}
										resp.response = data.data;
										return req.onload(resp);
									}
								});
								return;
							}
							return do_request(req);
						};
					}
					ffmpeg = ffmpeg_lib.lib.createFFmpeg({
						log: true,
						progress: function(progress) {
							//console_log(progress.ratio);
							if (ffmpeg_progress_cb) {
								ffmpeg_progress_cb(progress.ratio);
							}
						}
					});
					ffmpeg_lib._imu_instance = ffmpeg;
				} else {
					ffmpeg = ffmpeg_lib._imu_instance;
				}
				if (!ffmpeg.isLoaded()) {
					ffmpeg.load().then(function() {
						cb(ffmpeg);
					}, function(err) {
						console_error(err);
						// since compilation takes 100% cpu for a few seconds, we really don't want to run it more than once if it continually fails
						ffmpeg_lib._imu_failed_loading = true; // untested
						cb(null);
					});
				} else {
					cb(ffmpeg);
				}
			});
		};
		var get_ffmpeg = function(cb) {
			if (!has_ffmpeg_lib) {
				console_error("Unable to load FFmpeg library: disabled for this build");
				return cb(null);
			}
			check_sharedarraybuffer(function(success) {
				// if we don't check for this, ffmpeg will hang under firefox
				if (!success) {
					console_error("Unable to load FFmpeg library: SharedArrayBuffer is missing or unusable");
					return cb(null);
				}
				get_ffmpeg_inner(cb);
			});
		};
		var ffmpeg_join;
		(function() {
			var ffmpeg_ops = [];
			var ffmpeg_running = false;
			var ffmpeg_run_single = function(ffmpeg) {
				var opobj = ffmpeg_ops.shift();
				var end = function(no_ops) {
					ffmpeg_progress_cb = null;
					ffmpeg_running = false;
					if (ffmpeg_ops.length) {
						if (!no_ops) {
							ffmpeg_run_single(ffmpeg);
						} else {
							array_foreach(ffmpeg_ops, function(op) {
								run_soon(op.fail);
							});
						}
					}
				};
				ffmpeg_progress_cb = function(percent) {
					if (percent > 1)
						percent = 1;
					opobj.progress(percent);
				};
				ffmpeg_running = true;
				var promise = null;
				try {
					promise = ffmpeg.run.apply(this, opobj.op);
				} catch (e) {
					console_error(e);
					end(true);
					opobj.fail(false);
					return;
				}
				promise.then(function(data) {
					end();
					opobj.success(data);
				}, function(data) {
					end(true);
					opobj.fail(false);
				});
			};
			var ffmpeg_run = function(ffmpeg, op, progress, success, fail) {
				ffmpeg_ops.push({
					op: op,
					progress: progress,
					success: success,
					fail: fail
				});
				if (ffmpeg_running)
					return;
				ffmpeg_run_single(ffmpeg);
			};
			// prefix in case multiple ops are running
			var get_ffmpeg_prefix = function(prefix) {
				return prefix + "_" + get_random_text(10) + "_";
			};
			// files = array of {data: uint8array, mime: ...}, not filenames
			var ffmpeg_concat = function(ffmpeg, files, cb) {
				if (true) {
					var total_size = 0;
					array_foreach(files, function(file) {
						total_size += file.data.byteLength;
					});
					var out = new Uint8Array(total_size);
					var current_size = 0;
					array_foreach(files, function(file) {
						out.set(file.data, current_size);
						current_size += file.data.byteLength;
					});
					var ourfilename = get_ffmpeg_prefix("concat");
					ffmpeg.FS("writeFile", ourfilename, out);
					return cb(ourfilename);
				} else {
					if (!ffmpeg)
						cb(null);
					var prefix = get_ffmpeg_prefix("concat");
					var files_txt_filename = prefix + "files.txt";
					var files_txt_files = [];
					var filenames = [];
					array_foreach(files, function(file, i) {
						// todo: file extensions? are they even necessary?
						var filename = prefix + i;
						if (file.mime) {
							filename += file.mime.replace(/.*\//, ".");
						}
						filenames.push(filename);
						files_txt_files.push("file '" + filename + "'");
						ffmpeg.FS("writeFile", filename, file.data);
					});
					ffmpeg.FS("writeFile", files_txt_filename, files_txt_files.join("\n"));
					var out_filename = prefix + "out";
					var cleanup = function(out) {
						array_foreach(filenames, function(filename) {
							ffmpeg.FS("unlink", filename);
						});
						ffmpeg.FS("unlink", files_txt_filename);
						if (out) {
							try {
								// this can fail if ffmpeg failed to create the out file entirely
								ffmpeg.FS("unlink", out_filename);
							} catch (e) { }
						}
					};
					ffmpeg_run(ffmpeg, ["-f", "concat", "-safe", "0", "-i", files_txt_filename, "-c", "copy", out_filename], null, function() {
						cleanup();
						cb(out_filename);
					}, function(err) {
						console_error(err);
						cleanup(true);
						cb(null);
					});
				}
			};
			var ffmpeg_fs_size = function(ffmpeg, file) {
				try {
					var stat = ffmpeg.FS("stat", file);
					if (!stat)
						return null;
					return stat.size;
				} catch (e) {
					//console_error(e);
					return null;
				}
				;
			};
			var ffmpeg_mux_single = function(ffmpeg, video_file, audio_file, out_filename, progress, success, fail) {
				var failfunc = function(err) {
					try {
						ffmpeg.FS("unlink", out_filename);
					} catch (e) { }
					fail(err);
				};
				var args = [];
				if (video_file)
					args.push("-i", video_file);
				if (audio_file)
					args.push("-i", audio_file);
				args.push("-c", "copy", out_filename);
				ffmpeg_run(ffmpeg, args, progress, function(data) {
					// it'll always succeed, so this is needed to check if it actually wrote the file
					if (!ffmpeg_fs_size(ffmpeg, out_filename)) {
						return failfunc();
					}
					success(data);
				}, failfunc);
			};
			var ffmpeg_mux = function(ffmpeg, video_file, audio_file, progress, cb) {
				if (!ffmpeg)
					return cb(null);
				var prefix = get_ffmpeg_prefix("out");
				var mux_final = function() {
					ffmpeg_mux_single(ffmpeg, video_file, audio_file, prefix + ".mkv", progress, function() { cb(prefix + ".mkv"); }, function(err) {
						console_error("Error muxing into .mkv", err);
						cb(null);
					});
				};
				if (settings.stream_mux_mp4_over_mkv) {
					var mp4_filename = prefix + ".mp4";
					ffmpeg_mux_single(ffmpeg, video_file, audio_file, mp4_filename, function(ratio) {
						if (ratio >= 0.95)
							ratio = 0.95; // hack to avoid removing the progress element on error
						progress(ratio);
					}, function() { cb(mp4_filename); }, function(err) {
						// this means ffmpeg can't be run
						if (err === false) {
							return cb(null);
						}
						//if (err) console_error(err);
						mux_final();
					});
				} else {
					mux_final();
				}
			};
			ffmpeg_join = function(ffmpeg, datas, progress, cb) {
				var streams = [];
				if (datas.video)
					streams.push(datas.video);
				if (datas.audio)
					streams.push(datas.audio);
				if (!streams.length)
					return cb(null);
				var files = [];
				var prefix = get_ffmpeg_prefix("join");
				var cleanup = function() {
					array_foreach(files, function(filename) {
						ffmpeg.FS("unlink", filename);
					});
					progress(1);
				};
				var err = function() {
					cleanup();
					cb(null);
				};
				var process_stream = function(i) {
					if (i >= streams.length) {
						return mux_files();
					} else {
						progress((i / streams.length) * 0.5);
					}
					var stream = streams[i];
					if (!stream.length) {
						// shouldn't happen?
						console_warn("No stream data for", i);
						process_stream(i + 1);
					} else if (stream.length === 1) {
						// no need to concat
						var filename = prefix + "stream" + i;
						ffmpeg.FS("writeFile", filename, stream[0].data);
						files.push(filename);
						process_stream(i + 1);
					} else {
						// todo: progress
						ffmpeg_concat(ffmpeg, stream, function(filename) {
							if (!filename)
								return err();
							files.push(filename);
							process_stream(i + 1);
						});
					}
				};
				var mux_files = function() {
					progress(0.5);
					if (!files.length) {
						console_warn("No files");
						return err();
					}
					// disabling this is inefficient, but otherwise we don't get a file extension
					if (false && files.length === 1) {
						// don't cleanup because it'll delete the file
						return cb(files[0]);
					}
					if (files.length > 2) {
						console_error("Unknown extra file(s)", files);
						return err();
					}
					ffmpeg_mux(ffmpeg, files[0], files[1], function(percent) {
						progress(0.5 + (percent * 0.5));
					}, function(out_file) {
						if (!out_file)
							return err();
						cleanup();
						return cb(out_file);
					});
				};
				process_stream(0);
			};
		})();
		var download_playlist_urls;
		(function() {
			var download_single_urls = function(info_obj, single_urls, progress, cb) {
				// for testing
				//single_urls = single_urls.slice(0, 2);
				var ip = new ImpreciseProgress({
					elements_num: single_urls.length,
					cb: progress
				});
				var urls_data = {};
				var max_run = Math_min(3, single_urls.length);
				var chunks = Math_max(1, ((max_run / 3) * 5) | 0);
				var chunk_size = 2 * 1024 * 1024;
				if (info_obj.max_chunks)
					chunks = Math_min(chunks, info_obj.max_chunks);
				if (chunks === 1)
					chunk_size = 0;
				var running = 0;
				var current_url_i = 0;
				var finished = 0;
				var do_stop = false;
				var request_url = function(url, cb) {
					running++;
					//console_log("requesting", url);
					request_chunked({
						url: url,
						headers: info_obj.headers,
						can_head: info_obj.can_head,
						head_wrong_contentlength: info_obj.head_wrong_contentlength
					}, {
						chunks: chunks,
						chunk_size: chunk_size,
						onload: function(data) {
							running--;
							//console_log("got", url, data);
							if (!data)
								cb(false);
							urls_data[url] = data;
							cb(true);
						},
						onprogress: function(progobj) {
							ip.update_progobj(url, progobj);
						}
					});
				};
				var stop = function() {
					// todo: abort requests
					do_stop = true;
				};
				var run = function() {
					if (do_stop)
						return;
					if (finished >= single_urls.length) {
						var out_urls = [];
						array_foreach(single_urls, function(url) {
							out_urls.push(urls_data[url]);
						});
						return cb(out_urls);
					} else if (current_url_i >= single_urls.length) {
						return;
					}
					for (var i = running; i < max_run; i++) {
						request_url(single_urls[current_url_i++], function(succeeded) {
							finished++;
							if (do_stop)
								return;
							if (!succeeded) {
								stop();
								return cb(null);
							} else {
								run();
							}
						});
					}
				};
				run();
				return {
					abort: stop
				};
			};
			download_playlist_urls = function(info_obj, urls, progress, cb) {
				var ip = new ImpreciseProgress({
					elements_num: Object.keys(urls).length,
					cb: progress
				});
				var final_data = {};
				var handles = {};
				var do_stop = false;
				var stop = function() {
					do_stop = true;
					obj_foreach(handles, function(k, obj) {
						obj.abort();
					});
				};
				obj_foreach(urls, function(type, single_urls) {
					handles[type] = download_single_urls(info_obj, single_urls, function(progobj) {
						ip.update_progobj(type, progobj);
					}, function(urls_data) {
						if (do_stop)
							return;
						if (!urls_data) {
							stop();
							return cb(null);
						}
						final_data[type] = urls_data;
						// todo: improve check?
						if (Object.keys(final_data).length === Object.keys(urls).length) {
							cb(final_data);
						}
					});
				});
			};
		})();
		var shaka_module = function() {
			var get_max_video_quality = function() {
				var max_video_quality = get_single_setting("max_video_quality");
				if (max_video_quality) {
					max_video_quality = parseInt(max_video_quality.substr(1));
				}
				return max_video_quality;
			};
			var get_variant_within_max_quality = function(variants, max_video_quality) {
				var wanted_variant = -1;
				array_foreach(variants, function(variant, i) {
					if (variant.height === max_video_quality) {
						wanted_variant = i;
						return false;
					}
					if (variant.height > max_video_quality) {
						if (i === 0) {
							wanted_variant = i;
						} else {
							wanted_variant = i - 1;
						}
						return false;
					}
				});
				return wanted_variant;
			};
			var add_xhr_hook = function(lib, info_obj) {
				if (lib.overridden_xhr) {
					lib.xhr.do_request = function(data) {
						do_request(override_request(data, info_obj));
					};
				}
			};
			var create_shaka = function(info_obj, el, src, success, fail) {
				get_library("shaka", settings, do_request, function(_shaka) {
					if (!_shaka)
						return fail();
					var shaka = _shaka.lib;
					if (true) {
						shaka.log.setLevel(shaka.log.Level.ERROR);
					} else {
						shaka.log.setLevel(shaka.log.Level.DEBUG);
					}
					//shaka.polyfill.installAll();
					if (!shaka.Player.isBrowserSupported()) {
						console_warn("Unsupported browser for Shaka");
						return fail();
					}
					add_xhr_hook(_shaka, info_obj);
					var player = new shaka.Player(el);
					var shaka_error_handler = function(e) {
						console_error(e);
						return fail();
					};
					player.addEventListener("error", shaka_error_handler);
					var need_buffer = false;
					var ran_success = false;
					player.addEventListener("buffering", function() {
						if (need_buffer && !ran_success) {
							// if this buffering event isn't added, the stream will wait for ~5 seconds before playing if a manual variant is selected
							el.currentTime = el.currentTime - 0.001; // FIXME: is -0.001 needed? it's added to force a manual playback change
							need_buffer = false;
							ran_success = true;
							success();
						}
					});
					player.load(src).then(function() {
						var subs = null;
						if (info_obj.subtitles) {
							var selected = false;
							subs = preprocess_subtitles(info_obj.subtitles);
							for (var _i = 0, subs_2 = subs; _i < subs_2.length; _i++) {
								var subtitle = subs_2[_i];
								var kind = "subtitle";
								var language = subtitle.language_code || "en";
								var title = subtitle.title || null;
								var mime = subtitle.mime || void 0;
								var forced = false;
								player.addTextTrackAsync(subtitle.url, language, kind, mime, undefined, title, forced);
							}
						}
						var text_tracks = player.getTextTracks();
						if (text_tracks && text_tracks.length) {
							player.selectTextTrack(text_tracks[0]); // TODO
						}
						player.setTextTrackVisibility(!!settings.popup_enable_subtitles);
						var variants = player.getVariantTracks();
						if (settings.hls_dash_use_max) {
							variants.sort(function(a, b) {
								return b.bandwidth - a.bandwidth;
							});
							//console_log(variants);
							player.configure("abr.enabled", false);
							player.selectVariantTrack(variants[0], true, 0);
							need_buffer = true;
						}
						var max_video_quality = get_max_video_quality();
						if (max_video_quality) {
							variants.sort(function(a, b) {
								var diff = a.height - b.height;
								if (diff)
									return diff;
								return a.bandwidth - b.bandwidth;
							});
							var wanted_variant = get_variant_within_max_quality(variants, max_video_quality);
							if (wanted_variant >= 0) {
								player.configure("abr.enabled", false);
								player.selectVariantTrack(variants[wanted_variant], true, 0);
								need_buffer = true;
							}
						}
						if (!need_buffer) {
							ran_success = true;
							return success();
						} else {
							// in case the buffering event doesn't run
							setTimeout(function() {
								if (ran_success)
									return;
								ran_success = true;
								success();
							}, 5 * 1000);
						}
					}, shaka_error_handler);
				});
			};
			var shaka_info = {
				el_init: function(info) {
					create_shaka(info.info_obj, info.el, info.src, info.success, info.fail);
				},
				active: function() {
					return settings.allow_thirdparty_libs && get_tprofile_setting("mouseover_allow_hlsdash");
				}
			};
			mediadelivery_support.dash = shaka_info;
			mediadelivery_support.hls = shaka_info;
		};
		shaka_module();
		var parse_styles = function(str, multi) {
			if (typeof str !== "string")
				return;
			str = strip_whitespace(str);
			if (!str)
				return;
			var blocks = {};
			var current_block = "default";
			var splitted = str.split("\n");
			for (var i = 0; i < splitted.length; i++) {
				var current = strip_whitespace(splitted[i]);
				if (!current)
					continue;
				// note: c/css multiline comments (/* */) aren't supported yet
				// c++-style comments
				if (/^\/\//.test(current))
					continue;
				var match = current.match(/^(#[-a-zA-Z0-9]+(?:\s*,\s*#[-a-zA-Z0-9]+){0,})\s*{/);
				if (match) {
					if (current_block !== "default") {
						console_error("Nested blocks aren't supported");
						return;
					}
					current_block = match[1].split(/\s*,\s*/);
					splitted[i--] = current.substr(match[0].length);
					continue;
				}
				if (current[0] === "}") {
					if (current_block === "default") {
						console_error("No block to escape from");
						return;
					}
					current_block = "default";
					continue;
				}
				if (string_indexof(current, ":") < 0)
					continue;
				var next_block = current_block;
				if (current_block !== "default" && /}$/.test(current)) {
					current = strip_whitespace(current.replace(/}$/, ""));
					next_block = "default";
				}
				var property = strip_whitespace(current.replace(/^(.*?)\s*:.*/, "$1"));
				var value = strip_whitespace(current.replace(/^.*?:\s*(.*)$/, "$1"));
				// FIXME: this is extremely hacky in order to avoid writing a better parser
				// doesn't support escapes like \"
				var scolon_pos = string_indexof(value, ";");
				if (scolon_pos >= 0) {
					var quote_pos = value.search(/['"]/);
					if (quote_pos < 0) {
						splitted[i--] = value.substr(scolon_pos + 1);
						value = strip_whitespace(value.substr(0, scolon_pos));
					} else {
						var new_quote_pos = value.substr(quote_pos + 1).search(/['"]/) + quote_pos + 1;
						scolon_pos = string_indexof(value.substr(new_quote_pos + 1), ";");
						if (scolon_pos >= 0) {
							scolon_pos += new_quote_pos + 1;
							splitted[i--] = value.substr(scolon_pos + 1);
							value = strip_whitespace(value.substr(0, scolon_pos));
						}
					}
				}
				var important = false;
				if (value.match(/!important$/)) {
					important = true;
					value = strip_whitespace(value.replace(/!important$/, ""));
				}
				var c_blocks = current_block;
				if (!is_array(c_blocks))
					c_blocks = [c_blocks];
				array_foreach(c_blocks, function(block) {
					var prop_obj = { property: property, value: value, important: important };
					if (!(block in blocks))
						blocks[block] = {};
					if (multi) {
						if (!(property in blocks[block]))
							blocks[block][property] = [];
						blocks[block][property].push(prop_obj);
					} else {
						blocks[block][property] = prop_obj;
					}
				});
				current_block = next_block;
			}
			return blocks;
		};
		function get_processed_styles(str) {
			if (!str || typeof str !== "string" || !strip_whitespace(str))
				return;
			var styles = {};
			var splitted = str.split(/[;\n]/);
			for (var i = 0; i < splitted.length; i++) {
				var current = strip_whitespace(splitted[i]);
				if (!current)
					continue;
				if (string_indexof(current, ":") < 0)
					continue;
				if (/^\s*\/\//.test(current))
					continue;
				var property = strip_whitespace(current.replace(/^(.*?)\s*:.*/, "$1"));
				var value = strip_whitespace(current.replace(/^.*?:\s*(.*)$/, "$1"));
				var important = false;
				if (value.match(/!important$/)) {
					important = true;
					value = strip_whitespace(value.replace(/!important$/, ""));
				}
				styles[property] = { value: value, important: important };
			}
			return styles;
		}
		function get_styletag_styles(str) {
			// TODO: use parse_styles instead
			var styles = get_processed_styles(str);
			if (!styles)
				return;
			var styles_array = [];
			for (var property in styles) {
				var current = property + ": " + styles[property].value;
				if (styles[property].important || true) {
					current += " !important";
				}
				styles_array.push(current);
			}
			return styles_array.join("; ");
		}
		function apply_styles(el, str, options) {
			var style_blocks = parse_styles(str, true);
			if (!style_blocks)
				return;
			// currently unused because revert_styles isn't used anywhere
			if (options.allow_revert) {
				var oldstyle = el.getAttribute("style"); // this can be expensive for `all: initial` styles
				if (oldstyle) {
					el.setAttribute("data-imu-oldstyle", oldstyle);
				}
			}
			var styles = {};
			if ("default" in style_blocks)
				styles = style_blocks["default"];
			if (options.id && ("#" + options.id) in style_blocks) {
				var block = style_blocks["#" + options.id];
				for (var property in block) {
					if (!(property in styles))
						styles[property] = [];
					array_extend(styles[property], block[property]);
				}
			}
			// avoid modifying the source object if format_string adds new variables
			var format_vars = shallowcopy(options.format_vars);
			var iter = function(property, obj) {
				var value = obj.value;
				// todo: maybe handle escape sequences with JSON_parse?
				if (value.match(/^['"].*['"]$/)) {
					value = value.replace(/^["'](.*)["']$/, "$1");
				}
				if (options.old_variables) {
					for (var variable in options.old_variables) {
						value = string_replaceall(value, variable, options.old_variables[variable]);
					}
				}
				if (options.format_vars) {
					var formatted = format_string_single(value, format_vars);
					if (!formatted)
						return;
					value = formatted;
				}
				if (options.properties) {
					if (property in options.properties) {
						options.properties[property](value, property);
					}
				}
				if (obj.important || options.force_important) {
					el.style.setProperty(property, value, "important");
				} else {
					el.style.setProperty(property, value);
				}
				el.setAttribute("data-imu-newstyle", true);
			};
			for (var property in styles) {
				array_foreach(styles[property], function(obj) {
					iter(property, obj);
				});
			}
		}
		function revert_styles(el) {
			var oldstyle = el.getAttribute("data-imu-oldstyle");
			if (oldstyle) {
				el.setAttribute("style", oldstyle);
				el.removeAttribute("data-imu-oldstyle");
			} else if (el.getAttribute("style") && el.getAttribute("data-imu-newstyle")) {
				el.removeAttribute("style");
			}
			el.removeAttribute("data-imu-newstyle");
		}
		function set_important_style(el, property, value) {
			el.style.setProperty(property, value, "important");
		}
		function get_caption(obj, el) {
			if (obj && obj.extra && obj.extra.caption) {
				return strip_whitespace(obj.extra.caption);
			}
			if (el) {
				do {
					// don't use el.title/el.alt because if the element is <form>, it refers to form > input[name="title"]
					var el_title = el.getAttribute("title");
					var el_alt = el.getAttribute("alt");
					if (el_title || el_alt) {
						var caption = el_title || el_alt;
						// When opening an image in a new tab in Firefox, alt is set to the src
						if (caption === el.src)
							return null;
						return strip_whitespace(caption);
					}
				} while ((el = el.parentElement));
			}
			return null;
		}
		function get_el_dimensions(el) {
			var el_tagname = get_tagname(el);
			if (el_tagname === "VIDEO") {
				return [
					el.videoWidth,
					el.videoHeight
				];
			} else if (el_tagname === "CANVAS") {
				return [
					el.width,
					el.height
				];
			} else if (el_tagname === "SVG") {
				return [
					el.width.animVal.value,
					el.height.animVal.value
				];
			} else if (el_tagname === "IMG") {
				var dims = get_image_dims(el);
				return [
					dims.width,
					dims.height
				];
			} else if (el_tagname === "IMG" || el_tagname === "PICTURE") {
				return [
					el.naturalWidth,
					el.naturalHeight
				];
			} else { // e.g. <audio>
				return [
					// .style. is a hack in order to get the dimensions before the element is created
					el.offsetWidth || getUnit(el.style.width),
					el.offsetHeight || getUnit(el.style.height)
				];
			}
		}
		function add_link_to_history(link) {
			if (is_extension) {
				extension_send_message({
					type: "add_to_history",
					data: {
						url: link
					}
				});
			}
		}
		// {}-based
		var parse_format = function(formatstr) {
			var segments = [];
			var push_segment = function() {
				if (!current.length)
					return;
				if (in_bracket) {
					segments.push({ text: current, type: "var" });
				} else {
					segments.push(current);
				}
				current = "";
			};
			var current = "";
			var in_bracket = false;
			var escape = false;
			for (var i = 0; i < formatstr.length; i++) {
				var c = formatstr[i];
				if (c === '\\') {
					if (escape) {
						current += '\\';
					} else {
						escape = true;
					}
					continue;
				}
				if (escape) {
					current += c;
					continue;
				}
				if (c === '{') {
					if (!in_bracket) {
						push_segment();
						in_bracket = true;
						continue;
					}
				} else if (c === '}') {
					if (in_bracket) {
						push_segment();
						in_bracket = false;
						continue;
					}
				}
				current += c;
			}
			push_segment();
			return segments;
		};
		var format_string_single = function(formatstr, vars) {
			// don't need to care about anything after // because / shouldn't be in the filename anyways
			formatstr = formatstr.replace(/\/\/.*/, "");
			formatstr = strip_whitespace(formatstr);
			if (!formatstr)
				return null;
			var parsed = parse_format(formatstr);
			var str = "";
			for (var i = 0; i < parsed.length; i++) {
				if (typeof parsed[i] === "string") {
					str += parsed[i];
				} else {
					var varname = parsed[i].text;
					var default_value = null;
					var compare_value = null;
					var compare_not = false;
					var op = null;
					var compare_flags = [];
					var match = varname.match(/^([^?]+)[?](.*)$/);
					if (match) {
						varname = match[1];
						default_value = match[2];
					}
					match = varname.match(/^([^!/:=]+)([!=]=)(.*)$/);
					if (match) {
						varname = match[1];
						compare_value = match[3];
						compare_not = match[2] === "!=";
						op = "eq";
					}
					match = varname.match(/^([^!/:=]+)(!)?\/([rc]{0,2})=(.*)$/);
					if (match) {
						varname = match[1];
						compare_value = match[4];
						compare_not = match[2] === "!";
						op = "contains";
						var flags = match[3];
						if (string_indexof(flags, "r") >= 0)
							compare_flags.push("regex");
						if (string_indexof(flags, "c") >= 0)
							compare_flags.push("nicase");
					}
					match = varname.match(/^([^!/:=]+):=(.*)$/);
					if (match) {
						varname = match[1];
						compare_value = match[2];
						op = "set";
					}
					var varvalue = vars[varname];
					var match = varname.match(/^(.*?):([0-9]+)(\.)?$/);
					if (match) {
						varvalue = vars[match[1]];
						if (varvalue) {
							var newvalue = varvalue.substr(0, parseInt(match[2]));
							if (match[3]) {
								if (newvalue !== varvalue) {
									// …
									newvalue += "\u2026";
								}
							}
							varvalue = newvalue;
						}
					}
					var usevar = !!varvalue;
					if (varvalue && typeof varvalue === "object") {
						var varobj = varvalue;
						varvalue = "";
						if ("usable" in varobj) {
							usevar = varobj.usable;
						}
						if ("value" in varobj) {
							varvalue = varobj.value;
						}
					}
					if (op) {
						if (usevar) {
							if (op === "eq") {
								usevar = varvalue === compare_value;
							} else if (op === "contains") {
								if (array_indexof(compare_flags, "nicase") < 0) {
									varvalue = varvalue.toLowerCase();
									compare_value = compare_value.toLowerCase(); // fixme: this might not be good for regex
								}
								if (array_indexof(compare_flags, "regex") >= 0) {
									usevar = (new RegExp(compare_value)).test(varvalue);
								} else {
									usevar = string_indexof(varvalue, compare_value) >= 0;
								}
							}
						}
						// not in the usevar block because it may not exist
						if (op === "set") {
							vars[varname] = compare_value;
							usevar = true;
						}
						if (compare_not)
							usevar = !usevar;
						varvalue = "";
					}
					if (!usevar) {
						if (typeof default_value === "string") {
							varvalue = default_value;
						} else {
							return null;
						}
					}
					str += varvalue;
				}
			}
			// if it's a {x==y}{var:=value} rule, this should return a falsey value
			return strip_whitespace(str);
		};
		var pluralify = function(number, forms) {
			if (number === 1) {
				return forms[0];
			} else {
				return forms[1];
			}
		};
		var format_ago = function(delta, max_units) {
			if (!max_units)
				max_units = 2;
			// we don't care about milliseconds
			delta = (delta / 1000) | 0;
			// fixme: this isn't really accurate due to averages
			var units = {
				seconds: delta % 60,
				minutes: ((delta / 60) | 0) % 60,
				hours: ((delta / 60 / 60) | 0) % 24,
				days: ((delta / 60 / 60 / 24) | 0),
				//weeks: ((delta / 60 / 60 / 24 / 7)|0), // is this really needed?
				months: ((delta / 60 / 60 / 24 / 30.4375) | 0), // (365 * 3 + 366) / (12 * 4)
				years: ((delta / 60 / 60 / 24 / 365.25) | 0) // (365 * 3 + 366) / 4
			};
			var mod_units = {
				months_years: 12,
				days_years: 365.25,
				days_months: 30.4375,
				days_weeks: 7
			};
			var unit_names = {
				seconds: "second",
				minutes: "minute",
				hours: "hour",
				days: "day",
				weeks: "week",
				months: "month",
				years: "year"
			};
			var unit_keys = Object.keys(units).reverse();
			var valid_units = [];
			array_foreach(unit_keys, function(unit) {
				if (valid_units.length >= max_units)
					return false;
				var value = units[unit];
				var last_valid = valid_units[valid_units.length - 1];
				if (last_valid) {
					var mod = mod_units[unit + "_" + last_valid[0]];
					if (mod) {
						value = (value % mod) | 0;
					}
				}
				if (!value) {
					// "1 year and 1 day ago" is interesting, but hardly useful. makes the leap year average problem more noticeable
					if (valid_units.length)
						return false;
					return;
				}
				valid_units.push([unit, value]);
			});
			if (!valid_units.length) {
				return null;
			}
			var formatted_units = [];
			array_foreach(valid_units, function(unit_value) {
				var unit = unit_value[0];
				var value = unit_value[1];
				var unit_name = unit_names[unit];
				var proper_name = pluralify(value, [unit_name, unit_name + "s"]);
				formatted_units.push(value + " " + proper_name);
			});
			// fixme for 3 or more
			return formatted_units.join(" and ") + " ago";
		};
		var format_string = function(formatstrs, vars) {
			if (!is_array(formatstrs))
				formatstrs = formatstrs.split("\n");
			for (var i = 0; i < formatstrs.length; i++) {
				var formatted = format_string_single(formatstrs[i], vars);
				if (formatted)
					return formatted;
			}
			return null;
		};
		var fill_obj_filename = function(newobj, url, respdata) {
			if (typeof newobj.filename !== "string")
				newobj.filename = "";
			var modified_date = null;
			var contenttype_ext = null;
			var orig_filename = null;
			var wanted_ext = null;
			if (respdata) {
				try {
					var headers = parse_headers(respdata.responseHeaders);
					for (var h_i = 0; h_i < headers.length; h_i++) {
						var header_name = headers[h_i].name.toLowerCase();
						var header_value = headers[h_i].value;
						if (header_name === "content-disposition") {
							// http://cfile7.uf.tistory.com/original/227CF24E57ABEC701869E7
							// Content-Disposition: inline; filename="160731 LA Kcon stage - 15 copy.jpg"; filename*=UTF-8''160731%20LA%20Kcon%20stage%20-%2015%20copy.jpg
							var loops = 0;
							while (loops < 100 && typeof header_value === "string" && header_value.length > 0) {
								var current_value = header_value.replace(/^\s*([^;]*?)\s*(?:;.*)?$/, "$1");
								//header_value = header_value.replace(/^[^;]*(?:;\s*(.*))?$/, "$1");
								var attr = current_value.replace(/^\s*([^=;]*?)\s*(?:[=;].*)?$/, "$1").toLowerCase();
								var a_match = header_value.match(/^[^=;]*(?:(?:=\s*(?:(?:["']([^'"]*?)["'])|([^;]*?))\s*(;.*)?\s*)|;\s*(.*))?$/);
								if (!a_match) {
									console_error("Header value does not match pattern:", header_value);
									break;
								}
								var a_value = a_match[1] || a_match[2];
								// TODO: implement properly
								/*if (attr === "filename*") {
									newobj.filename = a_value;
								}*/
								if (newobj.filename.length === 0 && attr === "filename" && typeof a_value === "string" && a_value.length > 0) {
									newobj.filename = a_value;
								}
								header_value = a_match[3] || a_match[4];
								loops++;
							}
						} else if (header_name === "content-type") {
							contenttype_ext = get_ext_from_contenttype(header_value);
						} else if (header_name === "last-modified") {
							modified_date = new Date(header_value);
							if (isNaN(modified_date.getTime()))
								modified_date = null;
						}
						if (newobj.filename.length > 0 && contenttype_ext && modified_date) {
							// we found everything we're looking for
							break;
						}
					}
				} catch (e) {
					console_error(e);
				}
				var is_data = /^data:/.test(url);
				if (is_data)
					newobj.filename = "";
				var found_filename_from_url = false;
				if (newobj.filename.length === 0 && !is_data) {
					newobj.filename = url.replace(/.*\/([^?#/]*)(?:[?#].*)?$/, "$1");
					found_filename_from_url = true;
					// Disable as there's no use for this
					if (false && (newobj.filename.split(".").length - 1) === 1) {
						newobj.filename = newobj.filename.replace(/(.*)\.[^.]*?$/, "$1");
					}
				}
				// thanks to fireattack on discord for reporting.
				// test: https://hiyoko-bunko.com/specials/h0xmtix1pv/
				// https://images.microcms-assets.io/protected/ap-northeast-1:92243b3c-cb7c-44e8-9c84-28ba954120c5/service/hiyoko-bunko/media/hb_sns_%E3%82%A4%E3%83%98%E3%82%99%E3%83%B3%E3%83%88%E5%BD%93%E6%97%A5_200831.jpg
				if (found_filename_from_url) {
					newobj.filename = decodeURIComponent(newobj.filename);
				}
				orig_filename = newobj.filename;
				// e.g. for /?...
				if (newobj.filename.length === 0) {
					newobj.filename = "download";
				}
				var filename_split = url_basename(newobj.filename, {
					split_ext: true,
					known_ext: true
				});
				if (contenttype_ext && !filename_split[1]) {
					if (orig_filename.length)
						orig_filename += "." + contenttype_ext;
					newobj.filename += "." + contenttype_ext;
				}
				filename_split = url_basename(newobj.filename, {
					split_ext: true,
					known_ext: true
				});
				if (filename_split[1])
					wanted_ext = filename_split[1];
			}
			// to avoid formatting the filename multiple times
			if (!("_orig_filename" in newobj))
				newobj._orig_filename = orig_filename;
			var format_vars = {
				filename: newobj._orig_filename
			};
			format_vars.host_url = window_location;
			format_vars.host_domain = get_domain_from_url(window_location);
			format_vars.host_domain_nosub = get_domain_nosub(format_vars.host_domain);
			try {
				format_vars.host_title = document.title;
			} catch (e) {
				// only available for browser versions
			}
			if (newobj.url && /^https?:\/\//i.test(newobj.url)) {
				format_vars.url = newobj.url;
				format_vars.domain = get_domain_from_url(newobj.url);
				format_vars.domain_nosub = get_domain_nosub(format_vars.domain);
			}
			// todo: only create when needed
			var create_date = function(name, date) {
				var map = {
					"year": "FullYear",
					"month": "Month",
					"day": "Date",
					"hours": "Hours",
					"minutes": "Minutes",
					"seconds": "Seconds"
				};
				var values = [];
				for (var x in map) {
					var local_value = date["get" + map[x]]();
					var utc_value = date["getUTC" + map[x]]();
					if (x === "month") {
						local_value++;
						utc_value++;
					}
					local_value = zpadnum(local_value, 2);
					utc_value = zpadnum(utc_value, 2);
					values[x] = local_value;
					values[x + "_utc"] = utc_value;
					format_vars[name + "_" + x] = local_value;
					format_vars[name + "_" + x + "_utc"] = utc_value;
				}
				format_vars[name + "_iso"] = values.year + "-" + values.month + "-" + values.day + "T" + values.hours + "-" + values.minutes + "-" + values.seconds;
				format_vars[name + "_iso_utc"] = values.year_utc + "-" + values.month_utc + "-" + values.day_utc + "T" + values.hours_utc + "-" + values.minutes_utc + "-" + values.seconds_utc;
				format_vars[name + "_yyyymmdd"] = values.year + values.month + values.day;
				format_vars[name + "_yyyymmdd_utc"] = values.year_utc + values.month_utc + values.day_utc;
				format_vars[name + "_hhmmss"] = values.hours + values.minutes + values.seconds;
				format_vars[name + "_hhmmss_utc"] = values.hours_utc + values.minutes_utc + values.seconds_utc;
				var ago;
				if (name !== "download" && (ago = format_ago(Date.now() - date.getTime()))) {
					format_vars[name + "_ago"] = ago;
				}
				format_vars[name + "_unix_ms"] = date.getTime();
				format_vars[name + "_unix"] = (date.getTime() / 1000) | 0;
			};
			var created_date = null;
			var updated_date = null;
			var download_date = new Date();
			if (newobj.extra) {
				var extra_copy = [
					"caption",
					"author_username",
					"id"
				];
				array_foreach(extra_copy, function(prop) {
					format_vars[prop] = newobj.extra[prop];
				});
				if (newobj.extra.created_date)
					created_date = new Date(newobj.extra.created_date);
				if (newobj.extra.updated_date)
					updated_date = new Date(newobj.extra.updated_date);
			}
			if (!updated_date && modified_date)
				updated_date = modified_date;
			if (created_date)
				create_date("created", created_date);
			if (updated_date || created_date)
				create_date("updated", updated_date || created_date);
			if (download_date)
				create_date("download", download_date);
			if (created_date || updated_date)
				create_date("date", created_date || updated_date);
			if (format_vars.filename) {
				var ext_split = url_basename(format_vars.filename, {
					split_ext: true,
					known_ext: true
				});
				format_vars.filename_noext = ext_split[0];
				if (wanted_ext)
					format_vars.ext = "." + wanted_ext;
			}
			newobj.format_vars = shallowcopy(format_vars);
			var new_filename = get_filename_from_format(settings.filename_format, format_vars);
			if (new_filename) {
				newobj.filename = new_filename;
			} else {
				newobj.filename = add_filename_ext(newobj.filename, format_vars);
			}
		};
		var format_string_post = function(str, vars) {
			if (str) {
				if (vars.prefix)
					str = vars.prefix + str;
				if (vars.suffix)
					str += vars.suffix;
			}
			return str;
		};
		var add_filename_ext = function(filename, format_vars) {
			filename = format_string_post(filename, format_vars);
			var filename_split = url_basename(filename, {
				split_ext: true,
				known_ext: true
			});
			if (!filename_split[1] && format_vars.ext) {
				filename += format_vars.ext;
			}
			return filename;
		};
		var get_filename_from_format = function(format, format_vars) {
			var formatted = format_string(format, format_vars);
			if (!formatted)
				return null;
			return add_filename_ext(formatted, format_vars);
		};
		function makePopup(obj, orig_url, processing, data) {
			if (_nir_debug_) {
				console_log("makePopup", obj, orig_url, processing, data);
			}
			if (settings.mouseover_add_to_history) {
				add_link_to_history(data.data.obj.url);
			}
			if (orig_url && settings.mouseover_add_thumbnail_to_history) {
				add_link_to_history(orig_url);
			}
			var openb = get_tprofile_single_setting("mouseover_open_behavior");
			if (openb === "newtab" || openb === "newtab_bg" || openb === "download" || openb === "copylink" || openb === "replace") {
				stop_waiting();
				var theobj = data.data.obj;
				// TODO: improve fix (for data: urls)
				if (typeof theobj === "string") {
					theobj = { url: theobj };
				}
				var resp = data.data.resp || data.data.respdata;
				if (resp.finalUrl)
					theobj.url = resp.finalUrl;
				fill_obj_filename(theobj, theobj.url, resp);
				popup_obj = theobj;
				if (openb === "newtab" || openb === "newtab_bg") {
					open_in_tab_imu(theobj, openb === "newtab_bg");
				} else if (openb === "download") {
					download_popup_media();
				} else if (openb === "copylink") {
					clipboard_write_link(theobj.url);
				} else if (openb === "replace") {
					// todo: use popup options instead of replace images options
					var replace_options = get_replace_images_options();
					replace_single_media(replace_options, { el: popup_el }, data, common_functions["nullfunc"]);
				}
				return;
			}
			//var x = mouseX;//mouseAbsX;
			//var y = mouseY;//mouseAbsY;
			var x = data.x;
			var y = data.y;
			if (x === null || x === void 0) {
				x = lastX;
			}
			if (y === null || y === void 0) {
				y = lastY;
			}
			dragged = false;
			dragstart = false;
			var seekstart = false;
			function cb(img, url) {
				if (!img) {
					delay_handle_triggering = false;
					if (processing.running) {
						stop_waiting_cant_load();
					}
					return;
				}
				var is_video = img.tagName === "VIDEO";
				var is_audio = img.tagName === "AUDIO";
				var is_stream = is_video || is_audio;
				var newobj = data.data.obj;
				if (!newobj)
					newobj = {};
				popup_obj = newobj;
				var estop = function(e) {
					e.stopPropagation();
					e.stopImmediatePropagation();
					return true;
				};
				var estop_pd = function(e) {
					e.preventDefault();
					estop(e);
					return true;
				};
				lastX = x;
				lastY = y;
				popupOpenX = x;
				popupOpenY = y;
				popupOpenLastX = x;
				popupOpenLastY = y;
				var initial_zoom_behavior = get_single_setting("mouseover_zoom_behavior");
				var last_zoom_behavior = get_single_setting("mouseover_zoom_use_last");
				var use_last_zoom = false;
				if (popup_last_zoom && (last_zoom_behavior === "always" ||
					(last_zoom_behavior === "gallery" && popup_el_automatic))) {
					use_last_zoom = true;
				}
				//img.onclick = estop;
				//img.onmousedown = estop;
				//img.addEventListener("click", estop, true);
				//img.addEventListener("mousedown", estop, true);
				var bgcolor = "#333";
				var fgcolor = "#fff";
				var textcolor = "#fff";
				var shadowcolor = "rgba(0,0,0,.5)";
				var enable_mask_styles = get_single_setting("mouseover_enable_mask_styles2");
				var old_mask_opacity = 1;
				var setup_mask_el = function(mask) {
					set_el_all_initial(mask);
					set_important_style(mask, "opacity", 1);
					if (enable_mask_styles !== "never") {
						apply_styles(mask, settings.mouseover_mask_styles2, {
							force_important: true
						});
					}
					// this allows us to respect a custom opacity for mouseover_mask_styles
					old_mask_opacity = mask.style.opacity;
					if (enable_mask_styles === "hold") {
						set_important_style(mask, "opacity", 0);
					}
					if (!settings.mouseover_close_click_outside &&
						!settings.mouseover_mask_ignore_clicks) {
						set_important_style(mask, "pointer-events", "none");
					}
					set_important_style(mask, "position", "fixed");
					set_important_style(mask, "z-index", maxzindex - 3);
					set_important_style(mask, "width", "100%");
					set_important_style(mask, "height", "100%");
					set_important_style(mask, "left", "0px");
					set_important_style(mask, "top", "0px");
					if (settings.mouseover_mask_fade_time > 0) {
						set_important_style(mask, "transition", "opacity " + (settings.mouseover_mask_fade_time / 1000.) + "s");
						if (enable_mask_styles !== "hold") {
							if (!popup_el_automatic) {
								set_important_style(mask, "opacity", 0);
								// this is needed in order to make the transition happen
								setTimeout(function() {
									set_important_style(mask, "opacity", old_mask_opacity);
								}, 1);
							} else {
								set_important_style(mask, "opacity", old_mask_opacity);
							}
						}
					}
					// same as the addbtn mousedown stop
					our_addEventListener(mask, "mousedown", function(e) {
						if (!settings.mouseover_close_click_outside)
							return;
						estop(e);
					});
					our_addEventListener(mask, "click", function(e) {
						if (!settings.mouseover_close_click_outside)
							return;
						estop(e);
						set_important_style(mask, "pointer-events", "none");
						resetpopups();
					}, true);
					return mask;
				};
				remove_mask();
				if (settings.mouseover_close_click_outside ||
					settings.mouseover_mask_ignore_clicks ||
					enable_mask_styles !== "never") {
					mask_el = document_createElement("div");
					setup_mask_el(mask_el);
				}
				var outerdiv = document_createElement("div");
				set_el_all_initial(outerdiv);
				set_important_style(outerdiv, "position", "fixed");
				set_important_style(outerdiv, "z-index", maxzindex - 2);
				var zoom_move_effect_enabled = false;
				if (settings.mouseover_fade_time > 0 && !popup_el_automatic) {
					var transition_effects = [];
					var temp_transition_effects = [];
					var fade_s = (settings.mouseover_fade_time / 1000.) + "s";
					if (settings.mouseover_enable_fade) {
						transition_effects.push("opacity " + fade_s);
						set_important_style(outerdiv, "opacity", 0);
					}
					if (settings.mouseover_enable_zoom_effect) {
						transition_effects.push("transform " + fade_s);
						set_important_style(outerdiv, "transform", "scale(0)");
						if (settings.mouseover_zoom_effect_move) {
							temp_transition_effects.push("top " + fade_s);
							temp_transition_effects.push("left " + fade_s);
							zoom_move_effect_enabled = true;
						}
					}
					if (transition_effects.length > 0) {
						var orig_transition_string = transition_effects.join(", ");
						array_extend(transition_effects, temp_transition_effects);
						var temp_transition_string = transition_effects.join(", ");
						set_important_style(outerdiv, "transition", temp_transition_string);
						if (temp_transition_effects.length > 0) {
							setTimeout(function() {
								set_important_style(outerdiv, "transition", orig_transition_string);
							}, settings.mouseover_fade_time);
						}
					}
					// setTimeout is needed in order to make the transition happen
					setTimeout(function() {
						set_important_style(outerdiv, "opacity", 1);
						set_important_style(outerdiv, "transform", "scale(1)");
					}, 1);
				}
				var div = document_createElement("div");
				var popupshown = false;
				set_el_all_initial(div);
				set_important_style(div, "box-shadow", "0 0 15px " + shadowcolor);
				set_important_style(div, "border", "3px solid " + fgcolor);
				set_important_style(div, "position", "relative");
				set_important_style(div, "top", "0px");
				set_important_style(div, "left", "0px");
				set_important_style(div, "display", "block");
				set_important_style(div, "background-color", "rgba(255,255,255,.5)");
				// http://png-pixel.com/
				var transparent_gif = "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";
				var styles_variables = {};
				if (popup_orig_url && !popup_el_is_stream) {
					styles_variables["%thumburl%"] = encodeuri_ifneeded(popup_orig_url);
				} else {
					styles_variables["%thumburl%"] = transparent_gif;
				}
				if (!is_stream) {
					styles_variables["%fullurl%"] = encodeuri_ifneeded(get_img_src(img));
				} else {
					styles_variables["%fullurl%"] = transparent_gif;
				}
				apply_styles(div, settings.mouseover_styles, {
					force_important: true,
					old_variables: styles_variables
				});
				outerdiv.appendChild(div);
				//div.style.position = "fixed"; // instagram has top: -...px
				//div.style.zIndex = maxzindex - 2;
				//div.onclick = estop;
				//div.onmousedown = estop;
				//div.addEventListener("click", estop, true);
				//div.addEventListener("mousedown", estop, true);
				// useful for instagram
				//disable_click = true;
				var outer_thresh = 16;
				var border_thresh = 20;
				var top_thresh = 30;
				var top_mb = top_thresh - border_thresh;
				var viewport;
				var vw;
				var vh;
				var v_mx = Math_max(x - border_thresh, 0);
				var v_my = Math_max(y - top_thresh, 0);
				var update_vwh = function(x, y) {
					viewport = get_viewport();
					vw = viewport[0];
					vh = viewport[1];
					vw -= border_thresh * 2;
					vh -= border_thresh + top_thresh;
					if (typeof x !== "undefined") {
						v_mx = Math_min(vw, Math_max(x - border_thresh, 0));
						v_my = Math_min(vh, Math_max(y - top_thresh, 0));
					}
				};
				var set_top = function(x) {
					outerdiv.style.top = x + "px";
				};
				var set_left = function(x) {
					outerdiv.style.left = x + "px";
				};
				var set_lefttop = function(xy) {
					set_top(xy[1]);
					set_left(xy[0]);
				};
				// https://stackoverflow.com/a/23270007
				function get_lefttopouter() {
					var style = outerdiv.currentStyle || window.getComputedStyle(outerdiv);
					return [style.marginLeft + style.borderLeftWidth,
						style.marginTop + style.borderTopWidth];
				}
				update_vwh(x, y);
				// TODO: improve
				var set_audio_size = function() {
					if (!is_audio)
						return;
					img.style.width = "500px";
					img.style.minWidth = "500px";
					img.style.height = "50px";
					img.style.minHeight = "50px";
				};
				set_audio_size();
				var el_dimensions = get_el_dimensions(img);
				// FIXME: when this is set, for some reason, some settings like min-width and min-height can't be set under chrome
				if (!is_audio)
					set_el_all_initial(img);
				//set_audio_size();
				var add_link = false;
				if (!is_stream && settings.mouseover_add_link) {
					add_link = true;
				} else if (is_video && settings.mouseover_add_video_link) {
					add_link = true;
				}
				if (add_link) {
					// don't !important because it'll override the waiting cursor for automatic (gallery) popups
					img.style.cursor = "pointer";
				}
				// https://stackoverflow.com/questions/7774814/remove-white-space-below-image
				img.style.verticalAlign = "bottom";
				set_important_style(img, "display", "block");
				var update_img_display = function(style) {
					img.style.setProperty("display", style[0], style[1]);
				};
				var visibility_workarounds = [
					// uBlock Origin on pornhub blocks: video[style*="display: block !important;"]
					{
						domain_nosub: /^pornhub(?:premium)?\./,
						img_display: ["block"]
					},
					{
						domain_nosub: /^pornhub(?:premium)?\./,
						img_display: ["initial", "important"]
					},
					// uBlock Origin on gelbooru blocks:
					//   a[target="_blank"] > img
					//   a[target="_blank"] > div
					// https://github.com/qsniyg/maxurl/issues/430#issuecomment-686768694
					{
						domain_nosub: /^gelbooru\./,
						func: function() {
							var span_el = document_createElement("span");
							span_el.appendChild(img);
							a.appendChild(span_el);
						}
					}
				];
				var check_visibility_workaround = function(workaround) {
					if (workaround.domain_nosub) {
						if (!workaround.domain_nosub.test(host_domain_nosub))
							return false;
					}
					return true;
				};
				var apply_visibility_workaround = function(workaround) {
					if (workaround.img_display) {
						update_img_display(workaround.img_display);
					} else if (workaround.func) {
						workaround.func();
					}
				};
				var check_img_visibility = function() {
					setTimeout(function() {
						var computed = get_computed_style(img);
						if (computed.display !== "none") {
							return;
						}
						while (visibility_workarounds.length > 0) {
							var current_workaround = visibility_workarounds.shift();
							if (!check_visibility_workaround(current_workaround))
								continue;
							apply_visibility_workaround(current_workaround);
							if (visibility_workarounds.length > 0)
								check_img_visibility();
							break;
						}
					}, 50);
				};
				check_img_visibility();
				// https://github.com/qsniyg/maxurl/issues/330
				set_important_style(img, "object-fit", "contain");
				var img_naturalHeight, img_naturalWidth;
				img_naturalWidth = el_dimensions[0];
				img_naturalHeight = el_dimensions[1];
				var imgh = img_naturalHeight;
				var imgw = img_naturalWidth;
				var setup_initial_zoom = function(initial_zoom_behavior, use_last_zoom) {
					var update_sizes = false;
					if (initial_zoom_behavior === "custom" || use_last_zoom) {
						var zoom_percent = settings.mouseover_zoom_custom_percent / 100;
						if (use_last_zoom)
							zoom_percent = popup_last_zoom;
						imgw = Math_max(img_naturalWidth * zoom_percent, 20);
						imgh = Math_max(img_naturalHeight * zoom_percent, 20);
						update_sizes = true;
					} else if (initial_zoom_behavior === "fit" || initial_zoom_behavior === "fill") {
						img.style.maxWidth = vw + "px";
						img.style.maxHeight = vh + "px";
						if (initial_zoom_behavior === "fill" && (img_naturalWidth < vw && img_naturalHeight < vh)) {
							var zoom_percent = 1;
							if (img_naturalHeight > img_naturalWidth) {
								zoom_percent = vh / img_naturalHeight;
							} else {
								zoom_percent = vw / img_naturalWidth;
							}
							imgw *= zoom_percent;
							imgh *= zoom_percent;
							update_sizes = true;
						}
					} else if (initial_zoom_behavior === "full") {
						imgw = img_naturalWidth;
						imgh = img_naturalHeight;
						update_sizes = true;
					}
					if (update_sizes) {
						img.style.maxWidth = imgw + "px";
						img.style.width = img.style.maxWidth;
						img.style.maxHeight = imgh + "px";
						img.style.height = img.style.maxHeight;
					}
				};
				setup_initial_zoom(initial_zoom_behavior, use_last_zoom);
				if (imgh < 20 || imgw < 20) {
					// FIXME: This will stop "custom" percentages with low percentages for small images
					stop_waiting_cant_load();
					console_error("Image too small to popup (" + imgw + "x" + imgh + ")");
					return;
				}
				var get_imghw_for_fit = function(width, height) {
					if (width === void 0)
						width = vw;
					if (height === void 0)
						height = vh;
					//height -= border_thresh * 2;
					//width  -= border_thresh * 2;
					var our_imgh = imgh;
					var our_imgw = imgw;
					if (imgh > height || imgw > width) {
						var ratio;
						if (imgh / height >
							imgw / width) {
							ratio = imgh / height;
						} else {
							ratio = imgw / width;
						}
						our_imgh /= ratio;
						our_imgw /= ratio;
					}
					return [our_imgw, our_imgh];
				};
				function calc_imghw_for_fit(width, height) {
					var new_imghw = get_imghw_for_fit(width, height);
					imgw = new_imghw[0];
					imgh = new_imghw[1];
				}
				if ((initial_zoom_behavior === "fit" || initial_zoom_behavior === "fill") && !use_last_zoom) {
					calc_imghw_for_fit();
				}
				var max_width = settings.mouseover_zoom_max_width || void 0;
				var max_height = settings.mouseover_zoom_max_height || void 0;
				if (max_width || max_height) {
					calc_imghw_for_fit(max_width, max_height);
				}
				popup_update_zoom_func = function(mode) {
					var use_last_zoom = false;
					if (mode === "last") {
						mode = get_single_setting("mouseover_zoom_behavior");
						if (popup_last_zoom)
							use_last_zoom = true;
					}
					setup_initial_zoom(mode, use_last_zoom);
					if (mode === "fit" || mode === "fill")
						calc_imghw_for_fit();
					set_popup_width(imgw, "initial");
					set_popup_height(imgh, "initial");
				};
				popup_update_pos_func = function(x, y, resize) {
					var popup_left, popup_top;
					update_vwh(x, y);
					var sct = scrollTop();
					var scl = scrollLeft();
					sct = scl = 0;
					var overflow_x = imgw > vw;
					var overflow_y = imgh > vh;
					var mouseover_position = get_single_setting("mouseover_position");
					if ((popup_hold && settings.mouseover_hold_position_center) ||
						(settings.mouseover_overflow_position_center && (overflow_x || overflow_y)))
						mouseover_position = "center";
					if (mouseover_position === "cursor") {
						popup_top = sct + Math_min(Math_max(v_my - (imgh / 2), 0), Math_max(vh - imgh, 0));
						popup_left = scl + Math_min(Math_max(v_mx - (imgw / 2), 0), Math_max(vw - imgw, 0));
					} else if (mouseover_position === "center") {
						var origin = get_single_setting("mouseover_overflow_origin");
						var ox = origin[1];
						var oy = origin[2];
						var top_x = 0;
						var top_y = 0;
						var bottom_x = vw - imgw;
						var bottom_y = vh - imgh;
						var middle_x = (vw - imgw) / 2;
						var middle_y = (vh - imgh) / 2;
						var our_x = middle_x;
						var our_y = middle_y;
						if (overflow_x) {
							if (ox === "0") {
								our_x = top_x;
							} else if (ox === "1") {
								our_x = middle_x;
							} else if (ox === "2") {
								our_x = bottom_x;
							}
						}
						if (overflow_y) {
							if (oy === "0") {
								our_y = top_y;
							} else if (oy === "1") {
								our_y = middle_y;
							} else if (oy === "2") {
								our_y = bottom_y;
							}
						}
						popup_top = sct + our_y;
						popup_left = scl + our_x;
					} else if (mouseover_position === "beside_cursor") {
						var update_imghw;
						if (resize) {
							update_imghw = function(w, h) {
								calc_imghw_for_fit(w, h);
							};
						} else {
							update_imghw = common_functions.nullfunc;
						}
						var calc_imgrect = function(w, h) {
							var new_imghw = [imgw, imgh];
							if (resize) {
								new_imghw = get_imghw_for_fit(w, h);
							}
							if (new_imghw[0] > w || new_imghw[1] > h)
								return null;
							return new_imghw;
						};
						var cursor_thresh = border_thresh;
						var ovw = vw - cursor_thresh;
						var ovh = vh - cursor_thresh;
						var calc_imgposd = function(lefttop, info, popupd) {
							var moused = lefttop ? v_mx : v_my;
							var vd = lefttop ? ovw : ovh;
							switch (info) {
								case -1:
									return Math_min(vd - popupd, Math_max(0, moused - (popupd / 2)));
								case 0:
									return Math_max(0, moused - popupd - cursor_thresh);
								case 1:
									return Math_min(vd - popupd, moused + cursor_thresh);
							}
						};
						var all_rects = [
							// top
							[-1, 0, ovw, v_my - cursor_thresh],
							// right
							[1, -1, ovw - v_mx - cursor_thresh, ovh],
							// bottom
							[-1, 1, ovw, ovh - v_my - cursor_thresh],
							// left
							[0, -1, v_mx - cursor_thresh, ovh]
						];
						var rects = [];
						// TODO: move the current popup position to the top
						if (x > viewport[0] / 2) {
							rects.push(all_rects[3]);
						} else {
							rects.push(all_rects[1]);
						}
						if (y > viewport[1] / 2) {
							rects.push(all_rects[0]);
						} else {
							rects.push(all_rects[2]);
						}
						for (var i = 0; i < all_rects.length; i++) {
							if (array_indexof(rects, all_rects[i]) < 0) {
								rects.push(all_rects[i]);
							}
						}
						var largest_rectsize = -1;
						var largest_rect = null;
						var largest_origrect = null;
						for (var i = 0; i < rects.length; i++) {
							var our_rect = calc_imgrect(rects[i][2], rects[i][3]);
							if (!our_rect)
								continue;
							var our_rectsize = our_rect[0] * our_rect[1];
							if (our_rectsize > largest_rectsize) {
								largest_rectsize = our_rectsize;
								largest_rect = our_rect;
								largest_origrect = rects[i];
							}
						}
						if (!largest_origrect) {
							largest_rectsize = -1;
							for (var i = 0; i < rects.length; i++) {
								var rectsize = rects[i][2] * rects[i][3];
								if (rectsize > largest_rectsize) {
									largest_origrect = rects[i];
									largest_rectsize = rectsize;
								}
							}
						}
						if (largest_origrect) {
							update_imghw(largest_origrect[2], largest_origrect[3]);
							popup_top = calc_imgposd(false, largest_origrect[1], imgh);
							popup_left = calc_imgposd(true, largest_origrect[0], imgw);
						} else {
							// ???
						}
					} else if (mouseover_position === "beside_cursor_old") {
						// TODO: maybe improve this to be more interpolated?
						var popupx;
						var popupy;
						var cursor_thresh = border_thresh;
						var ovw = vw - cursor_thresh;
						var ovh = vh - cursor_thresh;
						var update_imghw;
						if (resize) {
							update_imghw = function(w, h) {
								calc_imghw_for_fit(w, h);
							};
						} else {
							update_imghw = common_functions.nullfunc;
						}
						update_imghw(ovw, ovh);
						for (var loop_i = 0; loop_i < (resize ? 16 : 1); loop_i++) {
							if (y > viewport[1] / 2) {
								popupy = v_my - imgh - cursor_thresh;
							} else if (popupy === void 0) {
								popupy = v_my + cursor_thresh;
							}
							if (x > viewport[0] / 2) {
								popupx = v_mx - imgw - cursor_thresh;
							} else if (popupx === void 0) {
								popupx = v_mx + cursor_thresh;
							}
							if (popupy < 0) {
								popupy = 0;
								if (settings.mouseover_prevent_cursor_overlap) {
									update_imghw(ovw, v_my);
									//continue;
								}
							}
							if (popupx < 0) {
								popupx = 0;
								if (settings.mouseover_prevent_cursor_overlap) {
									update_imghw(v_mx, ovh);
									//continue;
								}
							}
							if ((popupy + imgh) > vh) {
								if (settings.mouseover_prevent_cursor_overlap) {
									update_imghw(ovw, ovh - v_my);
									//continue;
								} else {
									popupy = Math_max(vh - imgh - cursor_thresh, 0);
								}
							}
							if ((popupx + imgw) > vw) {
								if (settings.mouseover_prevent_cursor_overlap) {
									update_imghw(ovw - v_mx, ovh);
									//continue;
								} else {
									popupx = Math_max(vw - imgw - cursor_thresh, 0);
								}
							}
							//break;
						}
						popup_top = popupy;
						popup_left = popupx;
					}
					return [
						popup_left + border_thresh,
						popup_top + top_thresh
					];
				};
				var initialpos = popup_update_pos_func(x, y, true);
				if (!zoom_move_effect_enabled) {
					set_lefttop(initialpos);
				} else {
					set_lefttop([x - imgw / 2, y - imgh / 2]);
					setTimeout(function() {
						set_lefttop(initialpos);
					}, 1);
				}
				var set_popup_size_helper = function(size, maxsize, widthheight) {
					if (maxsize === void 0)
						maxsize = size;
					if (typeof size === "number")
						size = size + "px";
					if (typeof maxsize === "number")
						maxsize = maxsize + "px";
					if (widthheight) {
						img.style.width = size;
						img.style.maxWidth = maxsize;
					} else {
						img.style.height = size;
						img.style.maxHeight = maxsize;
					}
				};
				var set_popup_width = function(width, maxwidth) {
					set_popup_size_helper(width, maxwidth, true);
				};
				var set_popup_height = function(height, maxheight) {
					set_popup_size_helper(height, maxheight, false);
				};
				set_popup_width(imgw, "initial");
				set_popup_height(imgh, "initial");
				/*console_log(x - (imgw / 2));
				  console_log(vw);
				  console_log(imgw);
				  console_log(vw - imgw);*/
				function get_defaultopacity() {
					var defaultopacity = (settings.mouseover_ui_opacity / 100);
					if (isNaN(defaultopacity))
						defaultopacity = 1;
					if (defaultopacity > 1)
						defaultopacity = 1;
					if (defaultopacity < 0)
						defaultopacity = 0;
					return defaultopacity;
				}
				var defaultopacity = get_defaultopacity();
				function opacity_hover(el, targetel, action) {
					if (!targetel)
						targetel = el;
					our_addEventListener(el, "mouseover", function(e) {
						targetel.style.opacity = "1.0";
						if (action)
							targetel.style.boxShadow = "0px 0px 5px 1px white";
					}, true);
					our_addEventListener(el, "mouseout", function(e) {
						targetel.style.opacity = get_defaultopacity();
						if (action)
							targetel.style.boxShadow = "none";
					}, true);
				}
				var get_popup_dimensions = function() {
					return [
						(popupshown && outerdiv.clientWidth) || imgw,
						(popupshown && outerdiv.clientHeight) || imgh
					];
				};
				var btndown = false;
				function addbtn(options) {
					var tagname = "span";
					if (typeof options.action === "string")
						tagname = "a";
					// todo: preparse user styles, then set tagname to img if image
					var btn = document_createElement(tagname);
					if (options.action) {
						var do_action = function() {
							return !btn.hasAttribute("data-btn-noaction");
						};
						if (typeof options.action === "object") {
							var old_action = options.action;
							options.action = function() {
								action_handler(old_action);
							};
						}
						// thanks to Noodlers on discord for reporting
						// test: discord emoji picker, mousedown will close it
						our_addEventListener(btn, "mousedown", function(e) {
							e.stopPropagation();
							e.stopImmediatePropagation();
						});
						if (typeof options.action === "function") {
							our_addEventListener(btn, "click", function(e) {
								if (!do_action())
									return;
								//console_log(e);
								e.stopPropagation();
								e.stopImmediatePropagation();
								e.preventDefault();
								options.action();
								return false;
							}, true);
						} else if (typeof options.action === "string") {
							btn.href = options.action;
							btn.target = "_blank";
							btn.setAttribute("rel", "noreferrer");
							our_addEventListener(btn, "click", function(e) {
								e.stopPropagation();
								e.stopImmediatePropagation();
							}, true);
						}
						our_addEventListener(btn, "mouseover", function(e) {
							set_important_style(btn, "box-shadow", "0px 0px 5px 1px white");
						}, true);
						our_addEventListener(btn, "mouseout", function(e) {
							set_important_style(btn, "box-shadow", "none");
						}, true);
					}
					our_addEventListener(btn, "mousedown", function(e) {
						btndown = true;
					}, true);
					our_addEventListener(btn, "mouseup", function(e) {
						btndown = false;
					}, true);
					if (false && !options.istop) {
						opacity_hover(btn, void 0, true);
					} else if (typeof options.text === "object" && options.text.truncated !== options.text.full) {
						our_addEventListener(btn, "mouseover", function(e) {
							var computed_style = get_computed_style(btn);
							set_important_style(btn, "width", computed_style.width || (btn.clientWidth + "px"));
							set_important_style(btn, "height", "initial");
							btn.innerText = options.text.full;
						}, true);
						our_addEventListener(btn, "mouseout", function(e) {
							btn.innerText = options.text.truncated;
							btn.style.width = "initial";
						}, true);
					}
					set_el_all_initial(btn);
					if (options.action) {
						set_important_style(btn, "cursor", "pointer");
					}
					set_important_style(btn, "background", bgcolor);
					set_important_style(btn, "border", "3px solid " + fgcolor);
					set_important_style(btn, "border-radius", "10px");
					// test: https://www.yeshiva.org.il/ (topbarel sets this to ltr, so it must be set to the initial value in order to respect the direction)
					set_important_style(btn, "direction", text_direction);
					// workaround for emojis: https://stackoverflow.com/a/39776303
					if (typeof options.text === "string" && options.text.length === 1 && options.text.charCodeAt(0) > 256) {
						set_important_style(btn, "color", "transparent");
						set_important_style(btn, "text-shadow", "0 0 0 " + textcolor);
					} else {
						set_important_style(btn, "color", textcolor);
					}
					set_important_style(btn, "padding", "4px");
					set_important_style(btn, "line-height", "1em");
					//btn.style.whiteSpace = "nowrap";
					set_important_style(btn, "font-size", "14px");
					set_important_style(btn, "font-family", sans_serif_font);
					//set_important_style(btn, "height", "1em");
					// TODO: cache the styles
					apply_styles(btn, settings.mouseover_ui_styles, {
						id: options.id,
						force_important: true,
						format_vars: newobj.format_vars,
						properties: {
							"-imu-text": function(value) {
								// TODO: support emojis properly
								if (typeof options.text === "object")
									options.text.truncated = value;
								else
									options.text = value;
							},
							"-imu-title": function(value) {
								options.title = value;
							},
							"-imu-image": function(value) {
								options.image = value;
							},
							"-imu-pos": function(value) {
								options.pos = value;
								if (array_indexof(["top-left", "top-middle", "top-right",
									"left", "middle", "right",
									"bottom-left", "bottom-middle", "bottom-right"], value) < 0) {
									console_warn("Invalid pos", value);
									options.pos = "top-left";
								}
							}
						}
					});
					if (options.image) {
						options.text = null;
					}
					set_important_style(btn, "z-index", maxzindex - 1);
					if (false && !options.istop) {
						set_important_style(btn, "position", "absolute");
						set_important_style(btn, "opacity", defaultopacity);
					} else {
						set_important_style(btn, "position", "relative");
						set_important_style(btn, "margin-right", "4px");
					}
					set_important_style(btn, "vertical-align", "top");
					//btn.style.maxWidth = "50%";
					set_important_style(btn, "white-space", "pre-wrap");
					set_important_style(btn, "display", "inline-block");
					if (options.action) {
						set_important_style(btn, "user-select", "none");
					}
					if (typeof options.image === "string") {
						var img = document_createElement("img");
						set_el_all_initial(img);
						set_important_style(img, "padding", "0px");
						set_important_style(img, "margin", "0px");
						set_important_style(img, "display", "inline");
						set_important_style(img, "height", "1em");
						set_important_style(img, "cursor", "inherit");
						img.src = options.image;
						btn.appendChild(img);
					}
					if (options.text) {
						if (typeof options.text === "object" && options.text.link_underline && settings.mouseover_ui_link_underline) {
							set_important_style(btn, "text-decoration", "underline");
						}
						if (typeof options.text === "string") {
							btn.innerText = options.text;
						} else if (typeof options.text === "object") {
							btn.innerText = options.text.truncated;
						}
					}
					if (options.title)
						btn.title = options.title;
					if (options.containers && options.pos) {
						var container = options.containers[options.pos];
						container.appendChild(btn);
						// FIXME: container.clientWidth is 0 until it's visible
						var dimensions = get_popup_dimensions();
						if (container.hasAttribute("data-imu-middle_x")) {
							set_important_style(container, "left", ((dimensions[0] - container.clientWidth) / 2) + "px");
						}
						if (container.hasAttribute("data-imu-middle_y")) {
							set_important_style(container, "top", ((dimensions[1] - container.clientHeight) / 2) + "px");
						}
					}
					return btn;
				}
				var ui_els = [];
				var text_direction = "initial";
				var popup_el_style;
				if (popup_el) {
					popup_el_style = get_computed_style(popup_el);
				} else {
					popup_el_style = get_computed_style(document.body);
				}
				if (popup_el_style && popup_el_style.direction === "rtl") {
					text_direction = "rtl";
				}
				var cached_previmages = 0;
				var cached_nextimages = 0;
				function lraction(isright, is_scroll) {
					trigger_gallery(isright ? 1 : -1, function(changed) {
						if (!changed) {
							if (is_scroll) {
								if (isright && settings.scroll_past_gallery_end_to_close) {
									resetpopups();
									return;
								}
							}
							create_ui();
						}
					});
				}
				var create_containerel = function(x, y, margin, boundingclientrect) {
					var topbarel = document_createElement("div");
					set_el_all_initial(topbarel);
					set_important_style(topbarel, "position", "absolute");
					set_important_style(topbarel, "opacity", defaultopacity);
					if (can_use_subzindex)
						set_important_style(topbarel, "z-index", maxzindex - 1);
					set_important_style(topbarel, "white-space", "nowrap");
					// test: https://www.yeshiva.org.il/
					// otherwise, the buttons are in the wrong order
					set_important_style(topbarel, "direction", "ltr");
					var left = null;
					var top = null;
					var bottom = null;
					var right = null;
					var original_width = imgw || img_naturalWidth;
					var bounding_width = boundingclientrect.width || original_width;
					var bounding_wadd = (bounding_width - original_width) / 2;
					var original_height = imgh || img_naturalHeight;
					var bounding_height = boundingclientrect.height || original_height;
					var bounding_hadd = (bounding_height - original_height) / 2;
					if (x === "left") {
						left = -(margin + bounding_wadd) + "px";
					} else if (x === "middle") {
						left = "calc(50%)";
						topbarel.setAttribute("data-imu-middle_x", "true");
					} else if (x === "right") {
						right = -(margin + bounding_wadd) + "px";
					}
					if (y === "top") {
						top = -(margin + bounding_hadd) + "px";
					} else if (y === "middle") {
						// TODO: add buttons vertically, not horizontally
						top = "calc(50%)";
						topbarel.setAttribute("data-imu-middle_y", "true");
					} else if (y === "bottom") {
						bottom = -(margin + bounding_hadd) + "px";
					}
					//console_log(left, right, top, bottom);
					if (left)
						set_important_style(topbarel, "left", left);
					if (right)
						set_important_style(topbarel, "right", right);
					if (top)
						set_important_style(topbarel, "top", top);
					if (bottom)
						set_important_style(topbarel, "bottom", bottom);
					return topbarel;
				};
				var ui_visible = !!settings.mouseover_ui;
				function create_ui(use_cached_gallery, hide_ui) {
					for (var el_i = 0; el_i < ui_els.length; el_i++) {
						var ui_el = ui_els[el_i];
						ui_el.parentNode.removeChild(ui_el);
					}
					ui_els = [];
					var emi = 14;
					var em1 = emi + "px";
					var emhalf = (emi / 2) + "px";
					var gallerycount_fontsize = "13px";
					var galleryinput_fontsize = "12px";
					var img_boundingClientRect = img.getBoundingClientRect();
					var css_fontcheck = "14px " + sans_serif_font;
					var containers = {};
					var container_metas = {
						"top-left": ["left", "top"],
						"top-middle": ["middle", "top"],
						"top-right": ["right", "top"],
						"left": ["left", "middle"],
						"middle": ["middle", "middle"],
						"right": ["right", "middle"],
						"bottom-left": ["left", "bottom"],
						"bottom-middle": ["middle", "bottom"],
						"bottom-right": ["right", "bottom"]
					};
					obj_foreach(container_metas, function(key, data) {
						containers[key] = create_containerel(data[0], data[1], emi, img_boundingClientRect);
					});
					var do_hide = !settings.mouseover_ui;
					if (hide_ui) {
						if (hide_ui === "toggle") {
							do_hide = ui_visible;
						} else if (hide_ui === true) {
							do_hide = true;
						}
					}
					if (do_hide) {
						// Not sure why this is needed, but without it, clicking and dragging images doesn't work under Firefox (#78)
						outerdiv.appendChild(containers["top-left"]);
						ui_visible = false;
						return;
					} else {
						ui_visible = true;
					}
					for (var pos in containers) {
						opacity_hover(containers[pos]);
						outerdiv.appendChild(containers[pos]);
						ui_els.push(containers[pos]);
					}
					if (settings.mouseover_ui_closebtn) {
						var closebtn = addbtn({
							id: "closebtn",
							// \xD7 = ×
							text: "\xD7",
							title: _("Close") + " (" + _("ESC") + ")",
							action: function() {
								resetpopups();
							},
							pos: "top-left",
							containers: containers
						});
					}
					;
					var get_img_orientation = function() {
						var rotation = get_popup_rotation();
						if (Math_abs(rotation) % 180 == 90) {
							return true;
						} else {
							return false;
						}
					};
					var get_img_width = function() {
						// This is needed if img isn't displayed yet
						return img_boundingClientRect.width || imgw || img_naturalWidth;
					};
					var get_img_height = function() {
						return img_boundingClientRect.height || imgh || img_naturalHeight;
					};
					// TODO: improve
					var get_img_disp_height = function() {
						if (get_img_orientation()) {
							return get_img_width();
						} else {
							return get_img_height();
						}
					};
					var prev_images = 0;
					var next_images = 0;
					var gallery_calcing = false;
					function get_imagesizezoom_text() {
						var text = "";
						var rect_height = get_img_disp_height();
						var zoom_percent = rect_height / img_naturalHeight;
						var currentzoom = parse_int(zoom_percent * 100);
						var filesize = 0;
						if (newobj && newobj.filesize)
							filesize = newobj.filesize;
						var format = "";
						var formatorder = [
							{
								value: img_naturalWidth + "x" + img_naturalHeight,
								valid: settings.mouseover_ui_imagesize,
							},
							{
								value: currentzoom + "%",
								valid_paren: currentzoom !== 100 ? true : false,
								valid: settings.mouseover_ui_zoomlevel
							},
							{
								value: size_to_text(filesize),
								valid: settings.mouseover_ui_filesize && filesize
							}
						];
						var entries = [];
						for (var i = 0; i < formatorder.length; i++) {
							var our_format = formatorder[i];
							if (!our_format.valid)
								continue;
							if (entries.length > 0 && our_format.valid_paren === false)
								continue;
							entries.push(our_format.value);
						}
						if (entries.length === 0)
							return "";
						text = entries[0];
						if (entries.length > 1) {
							text += " (" + entries.slice(1).join(", ") + ")";
						}
						return text;
					}
					if (settings.mouseover_ui_imagesize || settings.mouseover_ui_zoomlevel || settings.mouseover_ui_filesize) {
						var imagesize = addbtn({
							id: "sizeinfo",
							text: get_imagesizezoom_text( /*100*/),
							pos: "top-left",
							containers: containers
						});
						set_important_style(imagesize, "font-size", gallerycount_fontsize);
					}
					var get_imagestotal_text = function() {
						if (gallery_calcing) {
							return _("Loading...");
						}
						if (prev_images + next_images > settings.mouseover_ui_gallerymax) {
							return settings.mouseover_ui_gallerymax + "+";
						} else {
							return (prev_images + 1) + " / " + (prev_images + next_images + 1);
						}
					};
					var update_imagestotal = function() {
						if (images_total_input_active)
							return;
						if (prev_images + next_images > 0 || gallery_calcing) {
							set_important_style(images_total, "display", "inline-block");
							images_total.innerText = get_imagestotal_text();
						} else {
							set_important_style(images_total, "display", "none");
						}
					};
					var imagestotal_input_enable = function() {
						images_total_input_active = true;
						editing_text = true;
						images_total.innerText = "";
						set_important_style(images_total_input, "display", "initial");
						images_total_input.value = prev_images + 1;
						images_total.setAttribute("data-btn-noaction", true);
						images_total.appendChild(images_total_input);
						// https://stackoverflow.com/a/19498477
						setTimeout(function() {
							images_total_input.select();
							images_total_input.setSelectionRange(0, images_total_input.value.length);
						}, 100);
					};
					var imagestotal_input_disable = function() {
						editing_text = false;
						if (!images_total_input_active)
							return;
						set_important_style(images_total_input, "display", "none");
						images_total.removeChild(images_total_input);
						images_total.removeAttribute("data-btn-noaction");
						images_total_input_active = false;
						update_imagestotal();
					};
					var popup_width = (popupshown && outerdiv.clientWidth) || imgw;
					if (settings.mouseover_enable_gallery && settings.mouseover_ui_gallerycounter) {
						var images_total = addbtn({
							id: "gallerycounter",
							text: get_imagestotal_text(),
							action: imagestotal_input_enable,
							pos: "top-left",
							containers: containers
						});
						set_important_style(images_total, "font-size", gallerycount_fontsize);
						set_important_style(images_total, "display", "none");
						var images_total_input = document_createElement("input");
						var images_total_input_active = false;
						set_el_all_initial(images_total_input);
						set_important_style(images_total_input, "display", "none");
						set_important_style(images_total_input, "background-color", "white");
						set_important_style(images_total_input, "font-family", sans_serif_font);
						set_important_style(images_total_input, "font-size", galleryinput_fontsize);
						set_important_style(images_total_input, "padding", "1px");
						set_important_style(images_total_input, "padding-left", "2px");
						set_important_style(images_total_input, "width", "5em");
						our_addEventListener(images_total_input, "mouseout", imagestotal_input_disable);
						our_addEventListener(images_total_input, "keydown", function(e) {
							if (e.which === 13) { // enter
								var parsednum = images_total_input.value.replace(/\s+/g, "");
								if (/^[0-9]+$/.test(parsednum)) {
									parsednum = parseInt(parsednum);
									trigger_gallery(parsednum - (prev_images + 1));
								}
								imagestotal_input_disable();
								e.stopPropagation();
								e.preventDefault();
								return false;
							}
						}, true);
					}
					if (settings.mouseover_ui_optionsbtn) {
						// \u2699 = ⚙
						var optionsbtn = addbtn({
							id: "optionsbtn",
							text: "\u2699",
							title: _("Options"),
							action: get_options_page(),
							pos: "top-left",
							containers: containers
						});
					}
					if (settings.mouseover_ui_downloadbtn) {
						// \u2193 = ↓
						// \ud83e\udc6b = 🡫
						// \uD83E\uDC47 = 🡇
						var download_glyphs = ["\uD83E\uDC47", "\ud83e\udc6b", "\u2193"];
						var download_glyph = get_safe_glyph(css_fontcheck, download_glyphs);
						var downloadbtn = addbtn({
							id: "downloadbtn",
							text: download_glyph,
							title: _("Download (" + get_trigger_key_text(settings.mouseover_download_key) + ")"),
							action: { type: "download" },
							pos: "top-left",
							containers: containers
						});
					}
					if (settings.mouseover_ui_rotationbtns) {
						var get_rotate_title = function(leftright) {
							var btn_name = leftright === "left" ? "Rotate Left" : "Rotate Right";
							return _(btn_name) + " (" + get_trigger_key_text(settings["mouseover_rotate_" + leftright + "_key"]) + ")";
						};
						// \u21B6 = ↶
						var rotateleftbtn = addbtn({
							id: "rotleftbtn",
							text: "\u21B6",
							title: get_rotate_title("left"),
							action: { type: "rotate_left" },
							pos: "top-left",
							containers: containers
						});
						// \u21B7 = ↷
						var rotaterightbtn = addbtn({
							id: "rotrightbtn",
							text: "\u21B7",
							title: get_rotate_title("right"),
							action: { type: "rotate_right" },
							pos: "top-left",
							containers: containers
						});
					}
					if (settings.mouseover_ui_caption) {
						var caption = get_caption(newobj, popup_el);
						var caption_link_page = settings.mouseover_ui_caption_link_page && newobj.extra && newobj.extra.page;
						if (!caption && caption_link_page) {
							caption = "(original page)";
						}
						if (caption) {
							var btntext = caption;
							if (settings.mouseover_ui_wrap_caption) {
								// /10 is arbitrary, but seems to work well
								// TODO: make top-left dynamic
								var chars = parseInt(Math_max(10, Math_min(60, (popup_width - containers["top-left"].clientWidth) / 10)));
								btntext = {
									truncated: truncate_with_ellipsis(caption, chars),
									full: caption,
									link_underline: caption_link_page
								};
							}
							var caption_link = null;
							if (caption_link_page) {
								caption_link = newobj.extra.page;
							}
							var caption_btn = addbtn({
								id: "caption",
								text: btntext,
								title: caption,
								action: caption_link,
								pos: "top-left",
								containers: containers
							});
						}
					}
					var add_lrhover = function(isleft, btnel, action, title) {
						if (!settings.mouseover_enable_gallery || popup_width < 200)
							return;
						var img_height = get_img_disp_height();
						var bottom_heights = 0;
						var top_heights = 20;
						if (is_stream) {
							bottom_heights = 60;
						}
						if (img_height < 100) {
							top_heights = 0;
						}
						var lrheight = img_height - top_heights - bottom_heights;
						if (lrheight < 10)
							return;
						var lrhover = document_createElement("div");
						set_el_all_initial(lrhover);
						lrhover.title = title;
						if (isleft) {
							lrhover.style.left = "0em";
						} else {
							lrhover.style.right = "0em";
						}
						lrhover.style.top = top_heights + "px";
						lrhover.style.height = lrheight + "px";
						lrhover.style.position = "absolute";
						lrhover.style.width = "15%";
						lrhover.style.maxWidth = "200px";
						//lrhover.style.height = "100%";
						lrhover.style.zIndex = maxzindex - 2;
						lrhover.style.cursor = "pointer";
						opacity_hover(lrhover, btnel, true);
						our_addEventListener(lrhover, "click", function(e) {
							if (dragged) {
								return false;
							}
							estop(e);
							action(e);
							return false;
						}, true);
						outerdiv.appendChild(lrhover);
						ui_els.push(lrhover);
						return lrhover;
					};
					var add_leftright_gallery_button = function(leftright) {
						if (!settings.mouseover_enable_gallery || !settings.mouseover_ui_gallerybtns)
							return;
						var action = function() {
							return lraction(leftright);
						};
						var name = leftright ? "Next" : "Previous";
						// \u2190 = ←
						// \ud83e\udc50 = 🡐
						var left_glyphs = ["\ud83e\udc50", "\u2190"];
						// \u2192 = →
						// \ud83e\udc52 = 🡒
						var right_glyphs = ["\ud83e\udc52", "\u2192"];
						var lr_glyphs = leftright ? right_glyphs : left_glyphs;
						var icon = get_safe_glyph(css_fontcheck, lr_glyphs);
						var keybinding = leftright ? settings.mouseover_gallery_next_key : settings.mouseover_gallery_prev_key;
						var keybinding_text = get_trigger_key_text(keybinding);
						var title = _(name) + " (" + _(keybinding_text) + ")";
						var id = "gallery";
						id += leftright ? "next" : "prev";
						id += "btn";
						var btn = addbtn({
							id: id,
							text: icon,
							title: title,
							action: action,
							containers: containers,
							pos: leftright ? "right" : "left"
						});
						/*btn.style.top = "calc(50% - 7px - " + emhalf + ")";
						if (!leftright) {
							btn.style.left = "-" + em1;
						} else {
							btn.style.left = "initial";
							btn.style.right = "-" + em1;
						}*/
						//outerdiv.appendChild(btn);
						//ui_els.push(btn);
						add_lrhover(!leftright, btn, action, title);
						if (settings.mouseover_enable_gallery && settings.mouseover_ui_gallerycounter) {
							if (use_cached_gallery) {
								if (!leftright) {
									prev_images = cached_previmages;
								} else {
									next_images = cached_nextimages;
								}
								update_imagestotal();
							} else {
								gallery_calcing = true;
								count_gallery(leftright, void 0, true, void 0, void 0, function(total) {
									gallery_calcing = false;
									if (!leftright) {
										prev_images = total;
										cached_previmages = prev_images;
									} else {
										next_images = total;
										cached_nextimages = next_images;
									}
									update_imagestotal();
								});
								setTimeout(update_imagestotal, 1);
							}
						}
					};
					var add_leftright_gallery_button_if_valid = function(leftright) {
						if (!settings.mouseover_enable_gallery)
							return;
						is_nextprev_valid(leftright, function(valid) {
							if (valid) {
								add_leftright_gallery_button(leftright);
							}
						});
					};
					add_leftright_gallery_button_if_valid(false);
					add_leftright_gallery_button_if_valid(true);
				}
				popup_createui_func = create_ui;
				fill_obj_filename(newobj, url, data.data.respdata);
				create_ui();
				var a = document_createElement("a");
				set_el_all_initial(a);
				if (add_link) {
					a.style.cursor = "pointer";
					//a.addEventListener("click", function(e) {
					a.onclick = function(e) {
						e.stopPropagation();
						e.stopImmediatePropagation();
						return true;
					};
				}
				a.style.setProperty("vertical-align", "bottom", "important");
				a.style.setProperty("display", "block", "important");
				var update_popup_clickthrough = function(clickthrough) {
					var value = "none";
					if (!clickthrough)
						value = "initial";
					set_important_style(a, "pointer-events", value);
					set_important_style(img, "pointer-events", value);
					set_important_style(div, "pointer-events", value);
					set_important_style(outerdiv, "pointer-events", value);
				};
				if (settings.mouseover_clickthrough)
					update_popup_clickthrough(true);
				popup_hold_func = function() {
					var enable_mask_styles = get_single_setting("mouseover_enable_mask_styles2");
					if (popup_hold) {
						if (settings.mouseover_hold_unclickthrough) {
							update_popup_clickthrough(false);
						}
						if (mask_el && (enable_mask_styles === "always" || enable_mask_styles === "hold")) {
							mask_el.style.opacity = old_mask_opacity;
						}
					} else {
						if (settings.mouseover_clickthrough) {
							update_popup_clickthrough(true);
						} else {
							update_popup_clickthrough(false);
						}
						if (mask_el && (enable_mask_styles === "hold" || enable_mask_styles === "never")) {
							mask_el.style.opacity = 0;
						}
					}
				};
				if (add_link) {
					a.href = url;
					// set this here instead of outside this block for gelbooru: https://github.com/qsniyg/maxurl/issues/430
					a.target = "_blank";
					if (settings.mouseover_download) {
						if (false) {
							a.href = img.src;
							if (newobj.filename.length > 0) {
								a.setAttribute("download", newobj.filename);
							} else {
								var attr = document.createAttribute("download");
								a.setAttributeNode(attr);
							}
						} else {
							a.href = "#"; // fixme: is this really required? this prevents it from right click->copy link location, etc.
							our_addEventListener(a, "click", function(e) {
								download_popup_media();
								e.preventDefault();
								e.stopPropagation();
								return false;
							}, true);
						}
					}
				} else {
					var click_close = false;
					if (!is_stream && settings.mouseover_click_image_close) {
						click_close = true;
					} else if (is_video && settings.mouseover_click_video_close) {
						click_close = true;
					}
					// TODO: what about audio?
					if (click_close) {
						our_addEventListener(a, "click", function(e) {
							if (dragged)
								return;
							resetpopups();
							e.preventDefault();
							e.stopPropagation();
							return false;
						});
					}
				}
				a.appendChild(img);
				div.appendChild(a);
				popup_hidecursor_timer = null;
				var orig_a_cursor = a.style.cursor;
				var orig_img_cursor = img.style.cursor;
				popup_hidecursor_func = function(hide) {
					popup_cursorjitterX = mouseX;
					popup_cursorjitterY = mouseY;
					if (settings.mouseover_hide_cursor && hide) {
						a.style.cursor = "none";
						img.style.cursor = "none";
					} else {
						if (popup_hidecursor_timer) {
							clearTimeout(popup_hidecursor_timer);
							popup_hidecursor_timer = null;
						}
						a.style.cursor = orig_a_cursor;
						img.style.cursor = orig_img_cursor;
					}
				};
				popup_cursorjitterX = Infinity;
				popup_cursorjitterY = Infinity;
				if (settings.mouseover_hide_cursor && settings.mouseover_hide_cursor_after <= 0) {
					popup_hidecursor_func(true);
				}
				div.onmouseover = div.onmousemove = function(e) {
					if ((Math_abs(mouseX - popup_cursorjitterX) < settings.mouseover_mouse_inactivity_jitter) &&
						(Math_abs(mouseY - popup_cursorjitterY) < settings.mouseover_mouse_inactivity_jitter)) {
						return;
					}
					if (settings.mouseover_hide_cursor_after > 0 || !settings.mouseover_hide_cursor) {
						popup_hidecursor_func(false);
						if (settings.mouseover_hide_cursor) {
							popup_hidecursor_timer = setTimeout(function() {
								popup_hidecursor_func(true);
							}, settings.mouseover_hide_cursor_after);
						}
					}
				};
				function startdrag(e) {
					dragstart = true;
					dragged = false;
					dragstartX = e.clientX;
					dragstartY = e.clientY;
					dragoffsetX = dragstartX - parseFloat(outerdiv.style.left);
					dragoffsetY = dragstartY - parseFloat(outerdiv.style.top);
				}
				// TODO: allow this to be live-reloaded
				if (get_single_setting("mouseover_pan_behavior") === "drag") {
					if (is_stream) {
						img.onseeking = function(e) {
							seekstart = true;
						};
						img.onseeked = function(e) {
							seekstart = false;
						};
					}
					div.ondragstart = a.ondragstart = img.ondragstart = function(e) {
						if (seekstart)
							return;
						//dragstart = true;
						//dragged = false;
						startdrag(e);
						//e.stopPropagation();
						estop(e);
						return false;
					};
					//div.ondrop = estop;
					div.onmousedown = div.onpointerdown = a.onmousedown = a.onpointerdown = function(e) {
						//console_log("(div,a).mousedown", e);
						if (btndown || e.button !== 0 || seekstart)
							return;
						//dragstart = true;
						//dragged = false;
						startdrag(e);
						e.preventDefault();
						estop(e);
						return false;
					};
					img.onmousedown = img.onpointerdown = function(e) {
						//console_log("img.onmousedown", e);
						if (btndown || e.button !== 0 || seekstart)
							return;
						//dragstart = true;
						//dragged = false;
						startdrag(e);
						estop(e);
						return true;
					};
					a.onclick = function(e) {
						//console_log("a.onclick", e);
						dragstart = false;
						if (dragged) {
							estop(e);
							dragged = false;
							return false;
						}
						e.stopPropagation();
						e.stopImmediatePropagation();
						return true;
					};
					div.onmouseup = div.onpointerup = div.onclick = a.onmouseup = a.onpointerup = /*a.onclick =*/ function(e) {
						//console_log("(div,a).mouseup", e);
						dragstart = false;
						if (dragged) {
							//estop(e);
							return false;
						}
						e.stopPropagation();
						e.stopImmediatePropagation();
						return true;
					};
					// Enabling this makes buttons not work after clicking the link
					//div.addEventListener("click", div.onclick, true);
					//a.addEventListener("click", a.onclick, true);
					img.onmouseup = img.onpointerup = img.onclick = function(e) {
						//console_log("img.mouseup", e);
						dragstart = false;
						//estop(e);
						return true;
					};
					if (is_video) {
						img.onclick = function(e) {
							if (img.controls)
								return;
							if (!dragged) {
								if (!img.paused) {
									img.pause();
								} else {
									play_video(img);
								}
							}
							//console_log("img.mouseup", e);
							dragstart = false;
							//estop(e);
							return true;
						};
					}
				}
				var currentmode = initial_zoom_behavior;
				if (currentmode === "fill")
					currentmode = "fit";
				popup_zoom_func = function(zoom_mode, zoomdir, x, y, zoom_out_to_close) {
					var changed = false;
					var popup_left = parseFloat(outerdiv.style.left);
					var popup_top = parseFloat(outerdiv.style.top);
					var popup_width = outerdiv.clientWidth;
					var popup_height = outerdiv.clientHeight;
					update_vwh();
					if (x === void 0)
						x = "center";
					if (y === void 0)
						y = "center";
					// used by pagemiddle, determines the final desired global position
					var x_moveto = null;
					var y_moveto = null;
					if (zoomdir > 0) {
						var zoomout_mode = get_single_setting("scroll_zoomout_pagemiddle");
						if (zoomout_mode === "always") {
							x = "pagemiddle";
							y = "pagemiddle";
						} else if (zoomout_mode === "viewport") {
							if (popup_width < vw)
								x = "pagemiddle";
							if (popup_height < vh)
								y = "pagemiddle";
						}
					}
					// TODO: if mouse is within the popup, use the mouse's coordinates instead
					//   This will have to check the zoom_origin setting.
					if (x === "center" || x === "pagemiddle") {
						if (x === "pagemiddle")
							x_moveto = vw / 2;
						var visible_left = Math_max(popup_left, 0);
						var visible_right = Math_min(visible_left + popup_width, vw);
						// get the middle of the visible portion of the popup
						x = visible_left + (visible_right - visible_left) / 2;
					} else {
						// ensure it's clamped, e.g. when scrolling on the document instead of the popup
						if (x < popup_left)
							x = popup_left;
						else if (x > popup_left + popup_width)
							x = popup_left + popup_width;
					}
					if (y === "center" || y === "pagemiddle") {
						if (y === "pagemiddle")
							y_moveto = vh / 2;
						var visible_top = Math_max(popup_top, 0);
						var visible_bottom = Math_min(visible_top + popup_height, vh);
						y = visible_top + (visible_bottom - visible_top) / 2;
					} else {
						if (y < popup_top)
							y = popup_top;
						else if (y > popup_top + popup_height)
							y = popup_top + popup_height;
					}
					var offsetX = x - popup_left;
					var offsetY = y - popup_top;
					var percentX = offsetX / popup_width;
					var percentY = offsetY / popup_height;
					if (zoom_mode === "fitfull") {
						if (zoom_out_to_close && currentmode === "fit" && zoomdir > 0) {
							resetpopups();
							return false;
						}
						if (zoomdir > 0 && currentmode !== "fit") {
							imgh = img_naturalHeight;
							imgw = img_naturalWidth;
							calc_imghw_for_fit();
							var oldwidth = parseFloat(img.style.width);
							var oldheight = parseFloat(img.style.height);
							set_popup_width(imgw, vw);
							set_popup_height(imgh, vh);
							if (zoom_out_to_close && parseFloat(img.style.width) === oldwidth && parseFloat(img.style.height) === oldheight) {
								resetpopups();
								return false;
							}
							currentmode = "fit";
							changed = true;
						} else if (zoomdir < 0 && currentmode !== "full") {
							set_popup_width(img_naturalWidth, "initial");
							set_popup_height(img_naturalHeight, "initial");
							imgw = img_naturalWidth;
							imgh = img_naturalHeight;
							currentmode = "full";
							changed = true;
						}
					} else if (zoom_mode === "incremental") {
						var imgwidth = img.clientWidth;
						var imgheight = img.clientHeight;
						var mult = 1;
						if (imgwidth < img_naturalWidth) {
							mult = img_naturalWidth / imgwidth;
						} else {
							mult = imgwidth / img_naturalWidth;
						}
						var increment = settings.scroll_incremental_mult - 1;
						mult = Math_round(mult / increment);
						mult *= increment;
						if (imgwidth < img_naturalWidth) {
							if (mult !== 0)
								mult = 1 / mult;
						}
						if (zoomdir > 0) {
							mult /= 1 + increment;
						} else {
							mult *= 1 + increment;
						}
						imgwidth = img_naturalWidth * mult;
						imgheight = img_naturalHeight * mult;
						var too_small = zoomdir > 0 && (imgwidth < 64 || imgheight < 64);
						var too_big = zoomdir < 0 && (imgwidth > img_naturalWidth * 512 || imgheight > img_naturalHeight * 512);
						if (too_small || too_big) {
							if (zoom_out_to_close && too_small)
								resetpopups();
							return false;
						}
						imgw = imgwidth;
						imgh = imgheight;
						set_popup_width(imgwidth);
						set_popup_height(imgheight);
						changed = true;
					}
					if (!changed)
						return false;
					var imgwidth = outerdiv.clientWidth;
					var imgheight = outerdiv.clientHeight;
					var current_zoom = ((imgwidth / img_naturalWidth) + (imgheight / img_naturalHeight)) / 2;
					if (current_zoom) {
						popup_last_zoom = current_zoom;
					}
					var newx, newy;
					var zoom_lerp = function(wantedpos, origpos, viewport) {
						var change = wantedpos - origpos;
						var maxchange = Math_max(100, viewport / 10); // arbitrary numbers
						if (change < 0) {
							change = -Math_min(maxchange, -change);
						} else {
							change = Math_min(maxchange, change);
						}
						return origpos + change;
					};
					if (true || (imgwidth <= vw && imgheight <= vh) || zoom_mode === "incremental") {
						// centers wanted region to pointer
						newx = (x - percentX * imgwidth);
						if (x_moveto !== null) {
							newx = zoom_lerp(x_moveto - imgwidth / 2, newx, vw);
						}
						newy = (y - percentY * imgheight);
						if (y_moveto !== null) {
							newy = zoom_lerp(y_moveto - imgheight / 2, newy, vh);
						}
					} else if (imgwidth > vw || imgheight > vh) {
						// centers wanted region to center of screen
						newx = (vw / 2) - percentX * imgwidth;
						var endx = newx + imgwidth;
						if (newx > border_thresh && endx > (vw - border_thresh))
							newx = Math_max(border_thresh, (vw + border_thresh) - imgwidth);
						if (newx < border_thresh && endx < (vw - border_thresh))
							newx = Math_min(border_thresh, (vw + border_thresh) - imgwidth);
						newy = (vh / 2) - percentY * imgheight;
						var endy = newy + imgheight;
						if (newy > border_thresh && endy > (vh - border_thresh))
							newy = Math_max(border_thresh, (vh + border_thresh) - imgheight);
						if (newy < border_thresh && endy < (vh - border_thresh))
							newy = Math_min(border_thresh, (vh + border_thresh) - imgheight);
					}
					// fitfull only because incremental is under user control
					if (zoom_mode === "fitfull" && imgwidth <= vw && imgheight <= vh) {
						newx = Math_max(newx, border_thresh);
						if (newx + imgwidth > (vw - border_thresh)) {
							newx = (vw + border_thresh) - imgwidth;
						}
						newy = Math_max(newy, border_thresh);
						if (newy + imgheight > (vh - border_thresh)) {
							newy = (vh + border_thresh) - imgheight;
						}
					}
					//var lefttop = get_lefttopouter();
					outerdiv.style.left = (newx /* - lefttop[0]*/) + "px";
					outerdiv.style.top = (newy /* - lefttop[1]*/) + "px";
					create_ui(true);
					// The mouse could accidentally land outside the image in theory
					mouse_in_image_yet = false;
					return false;
				};
				outerdiv.onwheel = popup_wheel_cb = function(e, is_document) {
					var handledx = false;
					var handledy = false;
					var handle_seek = function(xy) {
						var isright = false;
						if (xy) {
							if (e.deltaX < 0)
								isright = false;
							else if (e.deltaX > 0)
								isright = true;
							else
								return;
						} else {
							if (e.deltaY < 0)
								isright = false;
							else if (e.deltaY > 0)
								isright = true;
							else
								return;
							if (settings.mouseover_scrolly_video_invert)
								isright = !isright;
						}
						seek_popup_video(!isright);
						estop_pd(e);
						return true;
					};
					var actionx = true;
					var actiony = true;
					if (is_stream) {
						var video_scrollx = get_single_setting("mouseover_scrollx_video_behavior");
						var video_scrolly = get_single_setting("mouseover_scrolly_video_behavior");
						if (!handledx && video_scrollx !== "default") {
							if (video_scrollx === "seek") {
								if (handle_seek(true)) {
									handledx = true;
								}
							} else if (video_scrollx === "nothing") {
								actionx = false;
							}
						}
						if (!handledy && video_scrolly !== "default") {
							if (video_scrolly === "seek") {
								if (handle_seek(false)) {
									handledy = true;
								}
							} else if (video_scrollx === "nothing") {
								actiony = false;
							}
						}
					}
					var scrollx_behavior = get_single_setting("mouseover_scrollx_behavior");
					var scrolly_behavior = get_single_setting("mouseover_scrolly_behavior");
					if (popup_hold) {
						var hold_scrollx_behavior = get_single_setting("mouseover_scrollx_hold_behavior");
						var hold_scrolly_behavior = get_single_setting("mouseover_scrolly_hold_behavior");
						if (hold_scrollx_behavior !== "default")
							scrollx_behavior = hold_scrollx_behavior;
						if (hold_scrolly_behavior !== "default")
							scrolly_behavior = hold_scrolly_behavior;
					}
					var handle_gallery = function(xy) {
						if (!settings.mouseover_enable_gallery)
							return;
						var isright = false;
						if (xy) {
							if (e.deltaX < 0)
								isright = false;
							else if (e.deltaX > 0)
								isright = true;
							else
								return;
						} else {
							if (e.deltaY < 0)
								isright = false;
							else if (e.deltaY > 0)
								isright = true;
							else
								return;
						}
						lraction(isright, true);
						estop_pd(e);
						return true;
					};
					if (actionx && !handledx) {
						if (scrollx_behavior === "pan") {
							outerdiv.style.left = (parseInt(outerdiv.style.left) + e.deltaX) + "px";
							handledx = true;
						} else if (scrollx_behavior === "gallery") {
							if (handle_gallery(true)) {
								return;
							}
							handledx = true;
						}
					}
					if (actiony && !handledy) {
						if (scrolly_behavior === "pan") {
							outerdiv.style.top = (parseInt(outerdiv.style.top) + e.deltaY) + "px";
							handledy = true;
						} else if (scrolly_behavior === "gallery") {
							if (handle_gallery(false)) {
								return;
							}
							handledy = true;
						}
					}
					if (handledy) {
						estop_pd(e);
						return false;
					}
					if (!actiony || scrolly_behavior !== "zoom" || e.deltaY === 0) {
						return;
					}
					estop_pd(e);
					var cursor_x = e.clientX;
					var cursor_y = e.clientY;
					if (get_single_setting("scroll_zoom_origin") === "center") {
						cursor_x = "center";
						cursor_y = "center";
					}
					var zoom_mode = get_single_setting("scroll_zoom_behavior");
					if (popup_zoom_func(zoom_mode, e.deltaY, cursor_x, cursor_y, settings.zoom_out_to_close) === false)
						return false;
				};
				if (mask_el) {
					document.documentElement.appendChild(mask_el);
				}
				document.documentElement.appendChild(outerdiv);
				removepopups();
				check_image_ref(img);
				// even if autoplay is enabled, if the element is cached, it won't play automatically
				if (is_stream) {
					if (settings.mouseover_video_autoplay) {
						play_video(img);
					} else {
						img.pause();
					}
				}
				popups.push(outerdiv);
				popupshown = true;
				if (data.data.respdata && data.data.respdata.responseHeaders) {
					var parsed_headers = headers_list_to_dict(parse_headers(data.data.respdata.responseHeaders));
					if ("content-length" in parsed_headers) {
						popup_contentlength = parseInt(parsed_headers["content-length"]) || 0;
					}
				}
				//can_close_popup = [false, false];
				// don't set [0] to false, in case "Keep popup open until" == Any/All and keys are released before popup opens
				can_close_popup[1] = false;
				// don't unhold if in gallery
				if (!popup_el_automatic)
					popup_hold = false;
				mouse_in_image_yet = false;
				delay_handle_triggering = false;
				// causes issues with "Don't close until mouse leaves" if the mouse doesn't move
				if (false && popup_trigger_reason !== "mouse") {
					can_close_popup[1] = true;
				}
				setTimeout(function() {
					dont_wait_anymore();
				}, 1);
				popups_active = true;
				//console_log(div);
				add_resetpopup_timeout();
			}
			cb(data.data.img, data.data.newurl /*, obj*/);
		}
		var getunit_el = null;
		var getunit_cache = new IMUCache();
		// getUnit is really slow, e.g. on forbiddenplanet.com (max-width: 39em)
		function getUnit(unit) {
			if (unit.match(/^ *([0-9]+)px *$/)) {
				return unit.replace(/^ *([0-9]+)px *$/, "$1");
			}
			if (getunit_cache.has(unit)) {
				return getunit_cache.get(unit);
			}
			// Based on https://github.com/tysonmatanich/getEmPixels/blob/master/getEmPixels.js
			// /*! getEmPixels  | Author: Tyson Matanich (http://matanich.com), 2013 | License: MIT */
			var important = "!important;";
			var style = "position:absolute!important;visibility:hidden!important;width:" + unit + "!important;font-size:" + unit + "!important;padding:0!important";
			var extraBody;
			var unitel = document.body;
			if (!unitel) {
				// Emulate the documentElement to get rem value (documentElement does not work in IE6-7)
				unitel = extraBody = document_createElement("body");
				extraBody.style.cssText = "font-size:" + unit + "!important;";
				document.documentElement.insertBefore(extraBody, document.body);
			}
			// Create and style a test element
			if (!getunit_el) {
				getunit_el = document_createElement("i");
				set_el_all_initial(getunit_el);
				set_important_style(getunit_el, "position", "absolute");
				set_important_style(getunit_el, "visibility", "hidden");
				set_important_style(getunit_el, "padding", "0");
			}
			set_important_style(getunit_el, "width", unit);
			set_important_style(getunit_el, "font-size", unit);
			//getunit_el.style.cssText = style;
			unitel.appendChild(getunit_el);
			// Get the client width of the test element
			var value = getunit_el.clientWidth;
			getunit_cache.set(unit, value, 5 * 60);
			if (extraBody) {
				// Remove the extra body element
				document.documentElement.removeChild(extraBody);
			} else {
				// Remove the test element
				unitel.removeChild(getunit_el);
			}
			// Return the em value in pixels
			return value;
		}
		function valid_source(source) {
			var thresh = 20;
			if (source.tagName !== "PICTURE" &&
				source.tagName !== "VIDEO" &&
				source.tagName !== "IMG" &&
				source.tagName !== "SOURCE") {
				var style = get_computed_style(source);
				if (style.getPropertyValue("background-image")) {
					var bgimg = style.getPropertyValue("background-image");
					if (!bgimg.match(/^(.*?\)\s*,)?\s*url[(]/)) {
						return false;
					}
				} else {
					return false;
				}
			}
			return !(source.width && source.width < thresh ||
				source.height && source.height < thresh);
		}
		var recalculate_rect = function(rect) {
			rect.left = rect.x;
			rect.top = rect.y;
			rect.right = rect.left + rect.width;
			rect.bottom = rect.top + rect.height;
			return rect;
		};
		var copy_rect = function(rect) {
			// simplified copy, need to use recalculate_rect after
			return {
				x: rect.x,
				y: rect.y,
				width: rect.width,
				height: rect.height
			};
		};
		var parse_zoom = function(zoom) {
			if (typeof zoom === "number")
				return zoom;
			var match = zoom.match(/^([-0-9.]+)%$/);
			if (match)
				return parseFloat(match[1]) / 100.;
			match = zoom.match(/^([-0-9.]+)$/);
			if (match) {
				return parseFloat(match[1]);
			}
			return null;
		};
		function get_bounding_client_rect_inner(el, mapcache, need_rect) {
			// test: https://4seasonstaeyeon.tumblr.com/post/190710743124 (bottom images)
			if (!el)
				return null;
			if (mapcache && mapcache.has(el)) {
				var value = mapcache.get(el);
				if (need_rect) {
					if (value.orig_rect)
						return value;
				} else {
					return value;
				}
			}
			var parent = {};
			var parentel = el.parentElement;
			if (parentel) {
				parent = get_bounding_client_rect_inner(parentel, mapcache, false);
			}
			var orig_rect = null;
			if (need_rect)
				orig_rect = el.getBoundingClientRect();
			var rect = null;
			var zoom = 1;
			//var computed_style = get_computed_style(el);
			// computed_style is slow, and also might not be what we're looking for, as it might contain the parent's zoom
			// this is still very slow though (50ms on facebook)
			// https://thisistian.github.io/publication/real-time-subsurface-with-adaptive-sampling/
			// math tags don't have style
			// TS removes the "zoom" property from CSSStyleDeclaration
			if ("style" in el && el.style.zoom) {
				zoom = parse_zoom(el.style.zoom);
				if (zoom && zoom !== 1) {
					if (!orig_rect)
						orig_rect = el.getBoundingClientRect();
					rect = copy_rect(orig_rect);
					rect.width *= zoom;
					rect.height *= zoom;
				}
			}
			if (parent.zoom && parent.zoom !== 1) {
				if (!orig_rect)
					orig_rect = el.getBoundingClientRect();
				if (!rect)
					rect = copy_rect(orig_rect);
				rect.x *= parent.zoom;
				rect.y *= parent.zoom;
				rect.width *= parent.zoom;
				rect.height *= parent.zoom;
				zoom *= parent.zoom;
				//console.log(el, zoom, deepcopy(rect));
			}
			// this is surprisingly slow, so rect is optimized out if possible
			if (false && parent.rect && parent.orig_rect) {
				if (!orig_rect)
					orig_rect = el.getBoundingClientRect();
				if (!rect)
					rect = copy_rect(orig_rect);
				rect.x += parent.rect.x - parent.orig_rect.x;
				rect.y += parent.rect.y - parent.orig_rect.y;
			}
			if (rect)
				recalculate_rect(rect);
			var result = {
				zoom: zoom
			};
			if (orig_rect)
				result.orig_rect = orig_rect;
			if (rect)
				result.rect = rect;
			if (mapcache) {
				mapcache.set(el, result);
			}
			return result;
		}
		function get_bounding_client_rect(el, mapcache) {
			var need_qsa_patch = false;
			// ublock origin patches getBoundingClientRect under youtube, calling document.querySelectorAll every time, which is very slow
			if (/youtube\.com$/.test(window.location.host))
				need_qsa_patch = true;
			var old_selectorall = null;
			if (need_qsa_patch) {
				old_selectorall = document.querySelectorAll;
				try {
					document.querySelectorAll = function() { return []; };
				} catch (e) { }
			}
			var obj = get_bounding_client_rect_inner(el, mapcache, true);
			if (need_qsa_patch) {
				try {
					document.querySelectorAll = old_selectorall;
				} catch (e) { }
			}
			return obj.rect || obj.orig_rect;
		}
		function get_popup_client_rect() {
			if (!popups || !popups[0])
				return null;
			var current_date = Date.now();
			if (!popup_client_rect_cache || (current_date - last_popup_client_rect_cache) > 50) {
				popup_client_rect_cache = get_bounding_client_rect(popups[0]);
				last_popup_client_rect_cache = current_date;
			}
			return popup_client_rect_cache;
		}
		;
		function get_popup_media_client_rect() {
			if (!popups || !popups[0])
				return null;
			var img = get_popup_media_el();
			if (!img)
				return null;
			var current_date = Date.now();
			if (!popup_media_client_rect_cache || (current_date - last_popup_media_client_rect_cache) > 30) {
				popup_media_client_rect_cache = img.getBoundingClientRect();
				last_popup_media_client_rect_cache = current_date;
			}
			return popup_media_client_rect_cache;
		}
		;
		function is_popup_el(el) {
			var current = el;
			do {
				if (array_indexof(popups, current) >= 0) {
					//console_error("Trying to find popup");
					return true;
				}
			} while ((current = current.parentElement));
			return false;
		}
		function find_source(els, options) {
			if (!options)
				options = {};
			if (!("links" in options))
				options.links = get_single_setting("mouseover_links");
			//console_log(els);
			var ok_els = [];
			var result = _find_source(els, ok_els, options);
			if (_nir_debug_) nir_debug("find_source", "find_source: result =", result, "ok_els =", ok_els);
			if (!result)
				return result;
			var ret_bad = function() {
				if (ok_els.length > 0)
					return ok_els[0];
				return null;
			};
			if (result.el) {
				if (is_popup_el(result.el)) {
					if (_nir_debug_) nir_debug("find_source", "find_source: result.el is popup el", result.el);
					return ret_bad();
				}
			}
			if (!result.is_ok_el && !result.src && (true || !is_valid_src(result.src, is_video_el(result.el)))) {
				if (_nir_debug_) nir_debug("find_source", "find_source: invalid src", result);
				return ret_bad();
			}
			var thresh = parse_int(get_tprofile_setting("mouseover_minimum_size"));
			// if it can be imu'd, ignore the treshold because the image could be any size
			if (isNaN(thresh) || result.imu)
				thresh = 0;
			var maxThresh = parse_int(get_tprofile_setting("popup_maximum_source_size"));
			if (isNaN(maxThresh))
				maxThresh = 0;
			if (!isNaN(result.width) && !isNaN(result.height) && result.width > 0 && result.height > 0) {
				if (result.width < thresh || result.height < thresh) {
					if (_nir_debug_) nir_debug("find_source", "find_source: result size is too small");
					return ret_bad();
				}
				if (maxThresh) {
					if (result.width > maxThresh || result.height > maxThresh) {
						console_log("Source media is too big to popup (user-configured maximum is", maxThresh, "px)");
						return null;
					}
				}
			}
			return result;
		}
		function _find_source(els, ok_els, options) {
			// resetpopups() is already called in trigger_popup()
			/*if (popups_active)
				return;*/
			if (_nir_debug_) nir_debug("find_source", "_find_source (els)", els);
			var sources = {};
			//var picture_sources = {};
			var links = {};
			var layers = [];
			var ok_els_set = new_set();
			var id = 0;
			var thresh = parse_int(get_tprofile_setting("mouseover_minimum_size"));
			if (isNaN(thresh))
				thresh = 0;
			var helpers = do_get_helpers({});
			var source;
			function check_visible(el) {
				var visible_valid = true;
				do {
					if (!el)
						break;
					var style = get_computed_style(el);
					if (!style)
						break;
					//nir_debug("find_source", "check_visible:", el, style.opacity.toString(), style.visibility);
					if (style.opacity.toString().match(/^0(?:\.0*)?$/) ||
						(visible_valid && style.visibility === "hidden")) {
						return false;
					}
					// https://www.msn.com/en-us/music/news/the-weeknd-calls-grammys-corrupt-slams-lack-of-transparency-after-nominations-shutout/ar-BB1bkAHH ("more for you" section)
					// a higher element has visibility: hidden, but a lower one has visibility: visible
					if (visible_valid && style.visibility === "visible") {
						visible_valid = false;
					}
				} while (el = el.parentElement);
				return true;
			}
			function getsource() {
				var thesource = null;
				var first = false;
				for (var source in sources) {
					if (first)
						return;
					first = true;
					thesource = sources[source];
				}
				return thesource;
			}
			function getfirstsource(sources) {
				var smallestid = MAX_SAFE_INTEGER;
				var thesource = null;
				for (var source_url in sources) {
					var source = sources[source_url];
					if (source.id < smallestid) {
						smallestid = source.id;
						thesource = sources[source_url];
					}
				}
				return thesource;
			}
			function norm(src) {
				return urljoin(window.location.href, src, true);
			}
			function imu_check(src, el) {
				var result = bigimage_recursive(src, {
					fill_object: true,
					use_cache: "read",
					do_request: null,
					document: document,
					window: get_window(),
					host_url: window.location.href,
					element: el,
					include_pastobjs: true,
					iterations: 2,
					cb: null
				});
				var newurl = src;
				for (var i = 0; i < result.length; i++) {
					if (result[i].url !== src) {
						if (newurl === src)
							newurl = result[i].url;
						continue;
					}
					if (result[i].bad)
						return false;
					// if result.length > 1, then it can be imu'd
					if (result.length > 1) {
						return newurl || true;
					} else {
						return void 0;
					}
				}
				return newurl || true;
			}
			function addImage(src, el, options) {
				if (_nir_debug_) nir_debug("find_source", "_find_source (addImage)", src, el, check_visible(el), options);
				if (!is_valid_resource_url(src))
					return false;
				if (src && settings.mouseover_apply_blacklist && !bigimage_filter(src)) {
					if (_nir_debug_) nir_debug("find_source", "blacklisted");
					return false;
				}
				if (!(src in sources)) {
					sources[src] = {
						count: 0,
						src: src,
						el: el,
						id: id++,
					};
				}
				// blank images
				// https://www.harpersbazaar.com/celebrity/red-carpet-dresses/g7565/selena-gomez-style-transformation/?slide=2
				var el_style = null;
				if (el) {
					el_style = window.getComputedStyle(el) || el.style;
				}
				if (!options) {
					options = {};
				}
				if (options.isbg && get_tprofile_setting("mouseover_exclude_backgroundimages")) {
					return false;
				}
				var imucheck = imu_check(src, el);
				if (imucheck === false) {
					if (_nir_debug_) nir_debug("find_source", "Bad image", el);
					return false;
				}
				if (!("imu" in sources[src])) {
					sources[src].imu = !!imucheck;
				}
				if (imucheck === true) {
					// do this after imu_check, for lazy loaded images that have 1x1 images
					if (src && (src.match(/^data:/) && !(/^data:image\/svg\+xml;/.test(src)) && src.length <= 500)) {
						if (_nir_debug_) nir_debug("find_source", "Tiny data: image", el, src);
						return false;
					}
				}
				// https://www.smugmug.com/
				// https://www.vogue.com/article/lady-gaga-met-gala-2019-entrance-behind-the-scenes-video
				// https://www.pinterest.com/
				if (!check_visible(el)) {
					if (_nir_debug_) nir_debug("find_source", "Invisible: image", el);
					return false;
				}
				if (settings.mouseover_only_links) {
					if (!el)
						return false;
					var has_link = false;
					var current = el;
					do {
						if (get_tagname(current) === "A") {
							has_link = true;
							break;
						}
					} while (current = current.parentElement);
					if (!has_link)
						return false;
				}
				if ("layer" in options) {
					if (!(options.layer in layers)) {
						layers[options.layer] = [];
					}
					layers[options.layer].push(src);
				}
				sources[src].count++;
				return true;
			}
			function addTagElement(el, layer) {
				//nir_debug("find_source", "addTagElement", el);
				if (helpers && helpers.element_replace) {
					var newel = helpers.element_replace(el);
					if (newel)
						el = newel;
				}
				if (helpers && helpers.element_ok) {
					if (!set_has(ok_els_set, el)) {
						var element_ok_result = helpers.element_ok(el);
						var ok_el_obj = {
							count: 1,
							src: null,
							el: el,
							id: id++,
							is_ok_el: true
						};
						if (element_ok_result === true) {
							ok_els.push(ok_el_obj);
							set_add(ok_els_set, el);
						} else if (typeof element_ok_result === "object") {
							if (is_element(element_ok_result))
								element_ok_result = { el: element_ok_result };
							ok_el_obj.el = element_ok_result.el;
							ok_els.push(ok_el_obj);
							set_add(ok_els_set, el);
							el = element_ok_result.el;
							if (element_ok_result.search) {
								var point = options.point;
								if (!point) {
									var rect = get_bounding_client_rect(el);
									point = [
										rect.left + (rect.width / 2),
										rect.top + (rect.height / 2)
									];
								}
								var found_els = find_els_at_point(point, {
									els_mode: "full",
									els: [el]
								});
								for (var _i = 0, found_els_1 = found_els; _i < found_els_1.length; _i++) {
									var fel = found_els_1[_i];
									if (fel === el)
										continue;
									addElement(fel);
								}
							}
						}
					}
				}
				var el_tagname = get_tagname(el);
				if (el_tagname === "PICTURE" || el_tagname === "VIDEO") {
					for (var i = 0; i < el.children.length; i++) {
						addElement(el.children[i], layer);
					}
				}
				if (el_tagname === "SOURCE" || el_tagname === "IMG" || el_tagname === "IMAGE" || el_tagname === "VIDEO" ||
					(settings.mouseover_allow_canvas_el && el_tagname === "CANVAS") ||
					(settings.mouseover_allow_svg_el && el_tagname === "SVG")) {
					if (settings.mouseover_exclude_imagemaps && el_tagname === "IMG" && el.hasAttribute("usemap")) {
						var mapel = document.querySelector("map[name=\"" + el.getAttribute("usemap").replace(/^#/, "") + "\"]");
						if (mapel) {
							if (_nir_debug_) nir_debug("find_source", "_find_source skipping", el, "due to image map", mapel);
							return;
						}
					}
					var el_src = get_img_src(el);
					if (el_src) {
						var src = norm(el_src);
						addImage(src, el, { layer: layer });
						if (!el.srcset && src in sources) {
							var dimensions = get_el_dimensions(el);
							sources[src].width = dimensions[0];
							sources[src].height = dimensions[1];
						}
					}
					if (!el.srcset)
						return;
					var ssources = [];
					var srcset = el.srcset;
					// https://www.erinyamagata.com/art-direction/kiernan-shipka
					// https://format-com-cld-res.cloudinary.com/image/private/s--hNRUHHWH--/c_crop,h_1596,w_1249,x_0,y_0/c_fill,g_center,w_2500/fl_keep_iptc.progressive,q_95/v1/986aaf7dd74bd5041ddfc495c430bf0d/KShipkaR29MW_FULL_3468.jpg?2500 2500w 3194h, https://format-com-cld-res.cloudinary.com/image/private/s--VSup0NR3--/c_crop,h_1596,w_1249,x_0,y_0/c_fill,g_center,w_900/fl_keep_iptc.progressive,q_95/v1/986aaf7dd74bd5041ddfc495c430bf0d/KShipkaR29MW_FULL_3468.jpg?900 900w 1150h
					// newlines: https://www.rt.com/russia/447357-miss-moscow-2018-photos/
					//
					// https://cdni.rt.com/files/2018.12/xxs/5c221e1ffc7e9397018b4600.jpg 280w,
					// https://cdni.rt.com/files/2018.12/xs/5c221e1ffc7e9397018b4601.jpg 320w,
					// https://cdni.rt.com/files/2018.12/thumbnail/5c221e1ffc7e9397018b45ff.jpg 460w,
					// https://cdni.rt.com/files/2018.12/m/5c221e1ffc7e9397018b4602.jpg 540w,
					// https://cdni.rt.com/files/2018.12/l/5c221e1ffc7e9397018b4603.jpg 768w,
					// https://cdni.rt.com/files/2018.12/article/5c221e1ffc7e9397018b45fe.jpg 980w,
					// https://cdni.rt.com/files/2018.12/xxl/5c221e20fc7e9397018b4604.jpg 1240w
					while (srcset.length > 0) {
						var old_srcset = srcset;
						srcset = srcset.replace(/^\s+/, "");
						// reference: https://html.spec.whatwg.org/multipage/images.html#srcset-attribute
						// https://mindbodygreen-res.cloudinary.com/image/upload/c_fill,g_auto,w_70,h_70,q_auto,f_auto,fl_lossy/usr/RhDUPFE.jpg, https://mindbodygreen-res.cloudinary.com/image/upload/c_fill,g_auto,w_70,h_70,q_auto,f_auto,fl_lossy/dpr_2.0/usr/RhDUPFE.jpg 2x
						var match = srcset.match(/^(\S+)(?:,\s+.*)?$/);
						if (!match)
							match = srcset.match(/^(\S+(?:\s+[^,]+)?)(?:,[\s\S]*)?\s*$/);
						if (match) {
							ssources.push(match[1].replace(/\s*$/, ""));
							srcset = srcset.substr(match[1].length);
						}
						srcset = srcset.replace(/^\s*,/, "");
						if (srcset === old_srcset)
							break;
					}
					//var ssources = el.srcset.split(/ +[^ ,/],/);
					var sizes = [];
					if (el.sizes) {
						sizes = el.sizes.split(",");
					}
					// https://www.gamestar.de/artikel/red-dead-redemption-2-pc-vorabversion-mit-limit-bei-120-fps-directx-12-und-vulkan,3350718.html
					// sidebar articles: //8images.cgames.de/images/gamestar/256/red-dead-redemption-2_6062507.jpg, //8images.cgames.de/images/gamestar/210/red-dead-redemption-2_6062507.jpg 2x
					for (var i = 0; i < ssources.length; i++) {
						var src = norm(ssources[i].replace(/^(\S+)(?:\s+[\s\S]+)?\s*$/, "$1"));
						var desc = ssources[i].slice(src.length).replace(/^\s*([\s\S]*?)\s*$/, "$1");
						if (!addImage(src, el, { layer: layer }))
							continue;
						//picture_sources[src] = sources[src];
						sources[src].picture = el.parentElement;
						if (desc) {
							sources[src].desc = desc;
							// https://format-com-cld-res.cloudinary.com/image/pr…dc82/004_003_03-000083520001.jpg?2500 2500w 1831h
							while (desc.length > 0) {
								desc = desc.replace(/^\s+/, "");
								var whxmatch = desc.match(/^([0-9.]+)([whx])(?:\s+[0-9.]+[\s\S]*)?\s*$/);
								if (whxmatch) {
									var number = parseFloat(whxmatch[1]);
									if (number > 0) {
										// if width/height/desc_x > number, then number is probably more accurate (multiple els, see rt link above)
										if (whxmatch[2] === "w" && (!sources[src].width || sources[src].width > number))
											sources[src].width = number;
										else if (whxmatch[2] === "h" && (!sources[src].height || sources[src].height > number))
											sources[src].height = number;
										else if (whxmatch[2] === "x" && (!sources[src].desc_x || sources[src].desc_x > number))
											sources[src].desc_x = number;
									}
									desc = desc.substr(whxmatch[1].length + whxmatch[2].length);
								} else {
									break;
								}
							}
						}
						if (el.media) {
							sources[src].media = el.media;
							if (el.media.match(/min-width:\s*([0-9]+)/)) {
								//picture_minw = true;
								var minWidth = getUnit(el.media.replace(/.*min-width:\s*([0-9.a-z]+).*/, "$1"));
								if (!sources[src].minWidth || sources[src].minWidth > minWidth)
									sources[src].minWidth = minWidth;
							}
							if (el.media.match(/max-width:\s*([0-9]+)/)) {
								//picture_maxw = true;
								var maxWidth = getUnit(el.media.replace(/.*max-width:\s*([0-9.a-z]+).*/, "$1"));
								if (!sources[src].maxWidth || sources[src].maxWidth > maxWidth)
									sources[src].maxWidth = maxWidth;
							}
							if (el.media.match(/min-height:\s*([0-9]+)/)) {
								//picture_minh = true;
								var minHeight = getUnit(el.media.replace(/.*min-height:\s*([0-9.a-z]+).*/, "$1"));
								if (!sources[src].minHeight || sources[src].minHeight > minHeight)
									sources[src].minHeight = minHeight;
							}
							if (el.media.match(/max-height:\s*([0-9]+)/)) {
								//picture_maxh = true;
								var maxHeight = getUnit(el.media.replace(/.*max-height:\s*([0-9.a-z]+).*/, "$1"));
								if (!sources[src].maxHeight || sources[src].maxHeight > maxHeight)
									sources[src].maxHeight = maxHeight;
							}
						}
					}
				}
				if (el_tagname === "A" || (settings.mouseover_allow_iframe_el && el_tagname === "IFRAME")) {
					var src_4 = get_img_src(el);
					links[src_4] = {
						count: 1,
						src: src_4,
						el: el,
						id: id++
					};
				}
			}
			function _tokenize_css_value(str) {
				var tokensets = [];
				var tokens = [];
				var current_token = "";
				var quote = null;
				var escaping = false;
				for (var i = 0; i < str.length; i++) {
					var char = str[i];
					if (escaping) {
						current_token += char;
						escaping = false;
						continue;
					}
					if (quote) {
						if (char === quote) {
							quote = null;
							tokens.push(current_token);
							current_token = "";
						} else {
							current_token += char;
						}
						continue;
					}
					if (/\s/.test(char)) {
						if (current_token.length > 0) {
							tokens.push(current_token);
							current_token = "";
						}
						continue;
					} else if (char === '\\') {
						escaping = true;
						continue;
					} else if (char === '"' || char === "'") {
						quote = char;
						continue;
					} else if (char === '(') {
						var subtokens = _tokenize_css_value(str.substr(i + 1));
						tokens.push({ name: current_token, tokens: subtokens[0] });
						i += subtokens[1];
						current_token = "";
						continue;
					} else if (char === ')') {
						i++;
						break;
					} else if (char === ',') {
						if (current_token)
							tokens.push(current_token);
						tokensets.push(tokens);
						tokens = [];
						current_token = "";
						continue;
					}
					current_token += char;
				}
				if (current_token)
					tokens.push(current_token);
				if (tokens)
					tokensets.push(tokens);
				return [tokensets, i];
			}
			function has_bgimage_url(tokenized) {
				for (var i = 0; i < tokenized.length; i++) {
					if (tokenized[i].length < 1)
						continue;
					if (typeof tokenized[i][0] !== "object")
						continue;
					var our_func = tokenized[i][0];
					var funcname = our_func.name;
					// TODO: support image() and cross-fade()
					var allowed = [
						"url",
						"-webkit-image-set",
						"image-set"
					];
					if (array_indexof(allowed, funcname) < 0)
						continue;
					if (funcname === "url") {
						if (our_func.tokens.length >= 1 && our_func.tokens[0].length > 0 && our_func.tokens[0][0].length > 0)
							return true;
					} else {
						if (has_bgimage_url(our_func.tokens))
							return true;
					}
				}
				return false;
			}
			function get_urlfunc_url(func) {
				if (typeof func !== "object")
					return null;
				if (func.name !== "url")
					return null;
				if (func.tokens.length < 1 || func.tokens[0].length < 1 || func.tokens[0][0].length === 0)
					return null;
				return func.tokens[0][0];
			}
			function get_imageset_urls(func) {
				var urls = [];
				for (var i = 0; i < func.tokens.length; i++) {
					if (func.tokens[i].length < 1) {
						continue;
					}
					var url = get_urlfunc_url(func.tokens[i][0]);
					if (!url)
						continue;
					var source = {
						src: url
					};
					for (var j = 1; j < func.tokens[i].length; j++) {
						var desc = func.tokens[i][j];
						var whxmatch = desc.match(/^([0-9.]+)(x|dp(?:px|i|cm))$/);
						if (whxmatch) {
							var number = parseFloat(whxmatch[1]);
							if (number > 0) {
								var unit = whxmatch[2];
								// https://drafts.csswg.org/css-values-3/#cm
								if (unit === "dppx") {
									number *= 96;
									unit = "dpi";
								} else if (unit === "dpcm") {
									number *= 96 / 2.54;
									unit = "dpi";
								}
								if (unit === "x")
									source.desc_x = number;
								else if (unit === "dpi")
									source.dpi = number;
							}
						} else {
							console_warn("Unknown descriptor: " + desc);
						}
					}
					urls.push(source);
				}
				return urls;
			}
			function get_bgimage_urls(tokenized) {
				var urls = [];
				for (var i = 0; i < tokenized.length; i++) {
					if (tokenized[i].length < 1)
						continue;
					if (typeof tokenized[i][0] !== "object")
						continue;
					var our_func = tokenized[i][0];
					var funcname = our_func.name;
					// TODO: support image() and cross-fade()
					var allowed = [
						"url",
						"-webkit-image-set",
						"image-set"
					];
					if (array_indexof(allowed, funcname) < 0)
						continue;
					if (funcname === "url") {
						var url = get_urlfunc_url(our_func);
						if (url) {
							urls.push(url);
						}
					} else if (funcname === "-webkit-image-set" || funcname === "image-set") {
						var newurls = get_imageset_urls(our_func);
						if (newurls) {
							array_extend(urls, newurls);
						}
					}
				}
				return urls;
			}
			function get_urls_from_css(str, elstr) {
				var str_tokenized = _tokenize_css_value(str)[0];
				if (!has_bgimage_url(str_tokenized))
					return null;
				// -webkit-image-set(url('https://carbonmade-media.accelerator.net/34754698;460x194/lossless.webp') 1x, url('https://carbonmade-media.accelerator.net/34754698;920x388/lossless.webp') 2x)
				//var emptystrregex = /^(.*?\)\s*,)?\s*url[(]["']{2}[)]/;
				//if (!str.match(/^(.*?\)\s*,)?\s*url[(]/) || emptystrregex.test(str))
				//	return null;
				// window.getComputedStyle returns the window's URL in this case for some reason, so we need the element's style to find the empty string
				var elstr_tokenized;
				if (elstr) {
					elstr_tokenized = _tokenize_css_value(elstr)[0];
					if (!has_bgimage_url(elstr_tokenized))
						return null;
				}
				return get_bgimage_urls(str_tokenized);
			}
			function add_urls_from_css(el, str, elstr, layer, bg) {
				var urls = get_urls_from_css(str, elstr);
				if (urls) {
					var url;
					for (var i = 0; i < urls.length; i++) {
						url = urls[i];
						if (typeof url !== "string") {
							url = url.src;
						}
						addImage(url, el, {
							isbg: bg,
							layer: layer
						});
						if (typeof urls[i] !== "string") {
							var props = ["desc_x", "dpi"];
							for (var j = 0; j < props.length; j++) {
								var prop = props[j];
								if (urls[i][prop] && (!sources[url][prop] || sources[url][prop] > urls[i][prop])) {
									sources[url][prop] = urls[i][prop];
								}
							}
						}
					}
				}
			}
			function add_bgimage(layer, el, style, beforeafter) {
				if (!style || !("style" in el))
					return;
				if (style.getPropertyValue("background-image")) {
					var bgimg = style.getPropertyValue("background-image");
					add_urls_from_css(el, bgimg, el.style.getPropertyValue("background-image"), layer, beforeafter || true);
				}
				if (beforeafter) {
					if (style.getPropertyValue("content")) {
						add_urls_from_css(el, style.getPropertyValue("content"), void 0, layer, beforeafter);
					}
				}
			}
			function addElement(el, layer) {
				if (_nir_debug_) nir_debug("find_source", "_find_source (addElement)", el, layer);
				if (get_tprofile_setting("mouseover_exclude_page_bg") && el.tagName === "BODY") {
					return;
				}
				if (typeof layer === "undefined")
					layer = layers.length;
				addTagElement(el, layer);
				add_bgimage(layer, el, window.getComputedStyle(el));
				add_bgimage(layer, el, window.getComputedStyle(el, ":before"), "before");
				add_bgimage(layer, el, window.getComputedStyle(el, ":after"), "after");
			}
			var is_sub_element = function(el, parent) {
				if (el === parent) // el is not a subelement of parent
					return false;
				while (el) {
					if (el === parent)
						return true;
					el = el.parentElement;
				}
				return false;
			};
			for (var i = 0; i < els.length; i++) {
				// sidebar articles on https://www.rt.com/russia/447357-miss-moscow-2018-photos/
				// the <picture> element has a size of 0, and hence isn't added to find_els_at_point
				if (els[i].tagName === "IMG" && els[i].parentElement && els[i].parentElement.tagName === "PICTURE" && array_indexof(els, els[i].parentElement) < 0) {
					els.splice(i + 1, 0, els[i].parentElement);
				}
				// remove every sub element of PICTURE as they will be added automatically anyways
				// this messes up the layering
				if (els[i].tagName === "PICTURE") {
					for (var j_1 = 0; j_1 < i; j_1++) {
						var subel = els[j_1];
						if (is_sub_element(subel, els[i])) {
							els.splice(j_1, 1);
							j_1--;
							i--;
						}
					}
					break;
				}
			}
			for (var i = 0; i < els.length; i++) {
				var el = els[i];
				addElement(el);
			}
			if (_nir_debug_) {
				//console_log(els);
				if (_nir_debug_) nir_debug("find_source", "_find_source (els)", deepcopy(els));
				if (_nir_debug_) nir_debug("find_source", "_find_source (sources)", deepcopy(sources));
				if (_nir_debug_) nir_debug("find_source", "_find_source (layers)", deepcopy(layers));
				if (_nir_debug_) nir_debug("find_source", "_find_source (ok_els)", deepcopy(ok_els));
			}
			// remove sources that aren't used
			var activesources = [];
			for (var i = 0; i < layers.length; i++) {
				for (var j = 0; j < layers[i].length; j++) {
					if (array_indexof(activesources, layers[i][j]) < 0)
						activesources.push(layers[i][j]);
				}
			}
			var ok_els_sources = [];
			for (var source_1 in sources) {
				for (var i = 0; i < ok_els.length; i++) {
					if (sources[source_1].el === ok_els[i].el) {
						ok_els[i] = sources[source_1];
						ok_els_sources[i] = true;
					}
				}
				if (array_indexof(activesources, source_1) < 0)
					delete sources[source_1];
			}
			for (var i = 0; i < ok_els.length; i++) {
				if (!ok_els_sources[i] && !ok_els[i].src) {
					addElement(ok_els[i].el);
				}
			}
			if ((source = getsource()) !== void 0) {
				if (_nir_debug_) nir_debug("find_source", "_find_source (getsource())", source);
				if (source === null) {
					if (ok_els.length > 0) {
						return ok_els[0];
					} else if (options.links) {
						if (Object.keys(links).length > 0) {
							var our_key = null;
							for (var link in links) {
								if (!settings.mouseover_only_valid_links) {
									our_key = link;
									break;
								}
								if (looks_like_valid_link(link, links[link].el)) {
									our_key = link;
									break;
								}
							}
							if (our_key)
								return links[our_key];
						}
					}
				}
				return source;
			}
			for (var i = 0; i < layers.length; i++) {
				var minW = 0;
				var elW = null;
				var minH = 0;
				var elH = null;
				var minMinW = 0;
				var elMinW = null;
				var minMinH = 0;
				var elMinH = null;
				var minMaxW = 0;
				var elMaxW = null;
				var minMaxH = 0;
				var elMaxH = null;
				var minX = 0;
				var elX = null;
				var minDpi = 0;
				var elDpi = null;
				var okurls = {};
				var have_something = false;
				for (var j = 0; j < layers[i].length; j++) {
					var source_url = layers[i][j];
					var source = sources[source_url];
					if (source.width && source.width > minW) {
						minW = source.width;
						elW = source;
						have_something = true;
					}
					if (source.height && source.height > minH) {
						minH = source.height;
						elH = source;
						have_something = true;
					}
					if (source.minWidth && source.minWidth > minMinW) {
						minMinW = source.minWidth;
						elMinW = source;
						have_something = true;
					}
					if (source.minHeight && source.minHeight > minMinH) {
						minMinH = source.minHeight;
						elMinH = source;
						have_something = true;
					}
					if (source.maxWidth && source.maxWidth > minMaxW) {
						minMaxW = source.maxWidth;
						elMaxW = source;
					}
					if (source.maxHeight && source.maxHeight > minMaxH) {
						minMaxH = source.maxHeight;
						elMaxH = source;
					}
					if (source.desc_x && source.desc_x > minX) {
						minX = source.desc_x;
						elX = source;
						have_something = true;
					}
					if (source.dpi && source.dpi > minDpi) {
						//dpiX = source.dpi; // commenting out because dpiX doesn't exist
						elDpi = source;
						have_something = true;
					}
					if (source.isbg) {
						okurls[source.src] = true;
						have_something = true;
					}
				}
				if (!have_something)
					continue;
				if (minX > 1) {
					okurls[elX.src] = true;
				}
				if (minDpi > 96) {
					okurls[elDpi.src] = true;
				}
				if (minW > thresh && minW > minMinW) {
					okurls[elW.src] = true;
				}
				if (minH > thresh && minH > minMinH) {
					okurls[elH.src] = true;
				}
				if (minMinW > thresh && minMinW >= minW) {
					okurls[elMinW.src] = true;
				}
				if (minMinH > thresh && minMinH >= minH) {
					okurls[elMinH.src] = true;
				}
				layers[i] = [];
				for (var url in okurls) {
					layers[i].push(url);
				}
			}
			// TODO: improve?
			function pickbest(layer) {
				for (var i = 0; i < layer.length; i++) {
					var source_url = layer[i];
					var source = sources[source_url];
					if (source.desc_x)
						return source;
				}
				return sources[layer[0]];
			}
			function rebuildlayers() {
				var newlayers = [];
				for (var i = 0; i < layers.length; i++) {
					if (layers[i].length === 0)
						continue;
					newlayers.push(layers[i]);
				}
				layers = newlayers;
			}
			if (_nir_debug_) nir_debug("find_source", "_find_source (new layers)", deepcopy(layers));
			rebuildlayers();
			if (_nir_debug_) nir_debug("find_source", "_find_source (rebuilt layers)", deepcopy(layers));
			// If there are background images ahead of an image, it's likely to be masks
			// Maybe check if there's more than one element of ancestry between them?
			// Except: https://www.flickr.com/account/upgrade/pro (featured pro, the avatar's image is a bg image, while the image behind isn't)
			if (layers.length > 1 && layers[0].length === 1 && sources[layers[0][0]].isbg) {
				for (var i = 1; i < layers.length; i++) {
					if (layers[i].length === 1 && sources[layers[i][0]].isbg)
						continue;
					return pickbest(layers[i]);
				}
			}
			if (layers.length > 0) {
				return pickbest(layers[0]);
			}
			if (source = getsource())
				return source;
			else
				return getfirstsource(sources);
		}
		var get_next_in_gallery_generic = function(el, nextprev) {
			if (!el)
				return null;
			// https://www.gog.com/game/shadow_warrior_complete
			// "Buy series" gallery
			if (array_indexof(["SOURCE", "IMG"], el.tagName) >= 0 && el.parentElement && array_indexof(["PICTURE", "VIDEO"], el.parentElement.tagName) >= 0) {
				el = el.parentElement;
			}
			var stack = [el.tagName];
			var current_el = el;
			var firstchild = false;
			while (true) {
				if (!firstchild) {
					var next = current_el.nextElementSibling;
					if (!nextprev)
						next = current_el.previousElementSibling;
					if (!next) {
						current_el = current_el.parentElement;
						if (!current_el)
							break;
						stack.unshift(current_el.tagName);
						continue;
					}
					current_el = next;
				} else {
					firstchild = false;
				}
				if (current_el.tagName === stack[0]) {
					if (stack.length === 1) {
						//if (valid_source(current_el))
						if (is_valid_el(current_el))
							return current_el;
						continue;
					}
					if (nextprev) {
						for (var i = 0; i < current_el.children.length; i++) {
							if (current_el.children[i].tagName === stack[1]) {
								current_el = current_el.children[i];
								stack.shift();
								firstchild = true;
								break;
							}
						}
					} else {
						for (var i = current_el.children.length - 1; i >= 0; i--) {
							if (current_el.children[i].tagName === stack[1]) {
								current_el = current_el.children[i];
								stack.shift();
								firstchild = true;
								break;
							}
						}
					}
				}
			}
			return null;
		};
		get_next_in_gallery = function(el, nextprev) {
			if (override_album) {
				var index = array_indexof(override_album, el);
				if (index < 0)
					return null;
				if (nextprev) {
					index++;
				} else {
					index--;
				}
				if (index < 0)
					return null;
				if (index >= override_album.length)
					return null;
				return override_album[index];
			}
			var value = get_album_info_gallery(popup_obj, el, nextprev);
			if (value || value === false)
				return value;
			if (!el.parentElement) {
				if (el.hasAttribute("imu-album-info")) {
					el = popup_orig_el;
				}
			}
			// FIXME: this is a rather bad hack to fix https://github.com/qsniyg/maxurl/issues/467
			previous_album_links = [];
			// FIXME: disabling because get_next_in_gallery can be called multiple times, just for checking links, not for actually redirecting
			if (false && popup_obj && popup_obj.album_info && popup_obj.album_info.type === "links") {
				array_foreach(popup_obj.album_info.links, function(link) {
					previous_album_links.push(link.url);
				});
			}
			return get_next_in_gallery_generic(el, nextprev);
		};
		/*function normalize_trigger() {
			if (!is_array(settings.mouseover_trigger)) {
				settings.mouseover_trigger = [settings.mouseover_trigger];
			}
		}

		normalize_trigger();*/
		function update_mouseover_trigger_delay() {
			delay = settings.mouseover_trigger_delay;
			if (delay < 0 || isNaN(delay))
				delay = false;
			if (typeof delay === "number" && delay >= 10)
				delay = 10;
			if (get_single_setting("mouseover_trigger_behavior") === "mouse") {
				delay_mouseonly = true;
			} else {
				delay = false;
				delay_mouseonly = false;
			}
			if (delay_handle) {
				clearTimeout(delay_handle);
				delay_handle = null;
			}
		}
		update_mouseover_trigger_delay();
		settings_meta.mouseover_trigger_delay.onupdate = update_mouseover_trigger_delay;
		settings_meta.mouseover_trigger_behavior.onupdate = update_mouseover_trigger_delay;
		function can_add_to_chord(str) {
			if (!keystr_is_wheel(str))
				return true;
			return !chord_is_only_wheel(current_chord);
		}
		function clear_chord_wheel() {
			for (var i = 0; i < current_chord.length; i++) {
				if (keystr_is_wheel(current_chord[i])) {
					current_chord.splice(i, 1);
					i--;
				}
			}
		}
		function clear_chord() {
			current_chord = [];
			current_chord_timeout = {};
		}
		function clear_chord_if_only_wheel() {
			if (chord_is_only_wheel(current_chord))
				clear_chord();
		}
		function keystr_in_trigger(str, wanted_chord) {
			return array_indexof(wanted_chord, str) >= 0;
		}
		function key_would_modify_single_chord(str, value) {
			if (value) {
				if (!can_add_to_chord(str))
					return false;
				if (array_indexof(current_chord, str) < 0)
					return true;
			} else {
				if (array_indexof(current_chord, str) >= 0)
					return true;
			}
			return false;
		}
		function set_chord_sub(str, value) {
			if (value) {
				if (!can_add_to_chord(str))
					return false;
				current_chord_timeout[str] = Date.now();
				if (array_indexof(current_chord, str) < 0) {
					current_chord.push(str);
					//console_log("+" + str);
					return true;
				}
			} else {
				delete current_chord_timeout[str];
				if (array_indexof(current_chord, str) >= 0) {
					current_chord.splice(array_indexof(current_chord, str), 1);
					clear_chord_if_only_wheel();
					//console_log("-" + str);
					return true;
				}
			}
			return false;
		}
		function event_in_single_chord(e, wanted_chord) {
			var map = get_keystrs_map(e, true);
			for (var key in map) {
				// otherwise, modifiers like ctrl etc. get counted, even if they're not pressed (because get_keystrs_map reports them as false)
				// todo: if this function is ever called in keyup, another solution is needed.
				// for now, it'll only ever be called on keydown
				if (!map[key])
					continue;
				if (keystr_in_trigger(key, wanted_chord))
					return true;
			}
			return false;
		}
		function event_in_chord(e, wanted_chord) {
			wanted_chord = normalize_keychord(wanted_chord);
			for (var i = 0; i < wanted_chord.length; i++) {
				if (event_in_single_chord(e, wanted_chord[i]))
					return true;
			}
			return false;
		}
		function remove_old_keys() {
			var now = Date.now();
			for (var key in current_chord_timeout) {
				if (now - current_chord_timeout[key] > 5000)
					set_chord_sub(key, false);
			}
		}
		function update_chord(e, value) {
			var map = get_keystrs_map(e, value);
			remove_old_keys();
			var changed = false;
			for (var key in map) {
				if (set_chord_sub(key, map[key]))
					changed = true;
			}
			return changed;
		}
		function event_would_modify_single_chord(e, value, wanted_chord) {
			var map = get_keystrs_map(e, value);
			for (var key in map) {
				if (wanted_chord !== void 0 && !keystr_in_trigger(key, wanted_chord))
					continue;
				if (key_would_modify_single_chord(key, map[key]))
					return true;
			}
			return false;
		}
		function event_would_modify_chord(e, value, wanted_chord) {
			wanted_chord = normalize_keychord(wanted_chord);
			for (var i = 0; i < wanted_chord.length; i++) {
				if (event_would_modify_single_chord(e, value, wanted_chord[i]))
					return true;
			}
			return false;
		}
		function trigger_complete_single(wanted_chord) {
			for (var i = 0; i < wanted_chord.length; i++) {
				var key = wanted_chord[i];
				if (array_indexof(current_chord, key) < 0)
					return false;
			}
			// e.g. if the user presses shift+r, but the chord is r, then it should fail
			for (var i = 0; i < current_chord.length; i++) {
				if (keystr_is_wheel(current_chord[i]))
					continue;
				if (array_indexof(wanted_chord, current_chord[i]) < 0)
					return false;
			}
			return true;
		}
		function trigger_complete(wanted_chord) {
			wanted_chord = normalize_keychord(wanted_chord);
			for (var i = 0; i < wanted_chord.length; i++) {
				if (trigger_complete_single(wanted_chord[i]))
					return true;
			}
			return false;
		}
		function trigger_partially_complete_single(e, wanted_chord) {
			for (var i = 0; i < wanted_chord.length; i++) {
				var key = wanted_chord[i];
				if (array_indexof(current_chord, key) >= 0)
					return true;
			}
			return false;
		}
		function trigger_partially_complete(e, wanted_chord) {
			wanted_chord = normalize_keychord(wanted_chord);
			for (var i = 0; i < wanted_chord.length; i++) {
				if (trigger_partially_complete_single(e, wanted_chord[i]))
					return true;
			}
			return false;
		}
		function get_close_behavior() {
			return get_single_setting("mouseover_close_behavior");
		}
		function get_close_need_mouseout() {
			return settings.mouseover_close_need_mouseout && get_close_behavior() !== "esc";
		}
		// commenting out because it's unused and close_on_leave_el no longer exists
		/*function get_close_on_leave_el() {
			return settings.mouseover_close_on_leave_el && get_single_setting("mouseover_position") === "beside_cursor";
		}*/
		function should_exclude_imagetab() {
			return settings.mouseover_exclude_imagetab && get_single_setting("mouseover_trigger_behavior") === "mouse" &&
				currenttab_is_image() && !imagetab_ok_override;
		}
		var exclude_find_els = new_set();
		function find_els_at_point(xy, options, els, prev, zoom_cache) {
			// test for pointer-events: none: https://www.shacknews.com/article/114834/should-you-choose-vulkan-or-directx-12-in-red-dead-redemption-2
			if (false && _nir_debug_)
				console_log("find_els_at_point", deepcopy(options), deepcopy(xy), deepcopy(els), deepcopy(prev));
			if (!options) {
				options = {};
			}
			if (!options.els_mode)
				options.els_mode = get_single_setting("mouseover_find_els_mode");
			if (options.els && !els)
				els = options.els;
			var first_run = false;
			if (!prev) {
				prev = new_set();
				first_run = true;
			}
			if (zoom_cache === void 0) {
				try {
					zoom_cache = new Map();
				} catch (e) {
					zoom_cache = null;
				}
			}
			var ret = [];
			var afterret = [];
			if (!els) {
				var orig_els = document.elementsFromPoint(xy[0], xy[1]);
				els = [];
				for (var _i = 0, orig_els_1 = orig_els; _i < orig_els_1.length; _i++) {
					var el = orig_els_1[_i];
					if (!set_has(exclude_find_els, el))
						els.push(el);
				}
				afterret = els;
				if (_nir_debug_) {
					console_log("find_els_at_point (elsfrompoint)", deepcopy(els));
				}
				if (options.els_mode === "simple")
					return els;
			}
			for (var i = 0; i < els.length; i++) {
				if (i > 0 && first_run && options.els_mode === "hybrid") {
					ret.push(els[i]);
					continue;
				}
				var el = els[i];
				if (set_has(prev, el))
					continue;
				set_add(prev, el);
				var el_has_children = false;
				var el_children = null;
				var el_shadow_children = null;
				if (el.childElementCount > 0) {
					el_children = el.children;
					el_has_children = true;
				}
				if (el.shadowRoot && el.shadowRoot.childElementCount > 0) {
					el_shadow_children = el.shadowRoot.children;
					el_has_children = true;
				}
				// FIXME: should we stop checking if not in bounding client rect?
				// this would depend on the fact that children are always within the bounding rect
				//  - probably not, there are cases where the parent div has a size of 0, but children have proper sizes
				if (el_has_children) {
					// reverse, because the last element is (usually) the highest z
					var newchildren = [];
					if (el_children) {
						for (var j = el_children.length - 1; j >= 0; j--) {
							newchildren.push(el_children[j]);
						}
					}
					// shadow is above non-shadow?
					if (el_shadow_children) {
						for (var j = el_shadow_children.length - 1; j >= 0; j--) {
							newchildren.push(el_shadow_children[j]);
						}
					}
					var newels = find_els_at_point(xy, options, newchildren, prev, zoom_cache);
					for (var j_2 = 0; j_2 < newels.length; j_2++) {
						var newel = newels[j_2];
						//console_log("about to add", newel, deepcopy(ret))
						if (array_indexof(ret, newel) < 0) {
							//console_log("adding", newel);
							ret.push(newel);
						}
					}
				}
				// youtube links on: https://old.reddit.com/r/anime/comments/btlmky/wt_mushishi_a_beautifully_melancholic_take_on_the/
				// they pop up outside of the cursor
				var rect = get_bounding_client_rect(el, zoom_cache);
				if (rect && rect.width > 0 && rect.height > 0 &&
					rect.left <= xy[0] && rect.right >= xy[0] &&
					rect.top <= xy[1] && rect.bottom >= xy[1] &&
					array_indexof(ret, el) < 0) {
					ret.push(el);
				}
			}
			for (var i = 0; i < afterret.length; i++) {
				if (array_indexof(ret, afterret[i]) < 0)
					ret.push(afterret[i]);
			}
			if (_nir_debug_ && ret.length > 0) {
				console_log("find_els_at_point (unsorted ret)", shallowcopy(ret));
			}
			if (first_run && options.els_mode === "hybrid") {
				return ret;
			}
			var get_zindex_raw = function(el) {
				var zindex = get_computed_style(el).zIndex;
				var parent_zindex = 0;
				if (el.parentElement) {
					var parent_zindex = get_zindex(el.parentElement); // + 0.001; // hack: child elements appear above parent elements
					// don't use the above hack, it breaks z-ordering, the indexOf thing works already
				}
				if (zindex === "auto") {
					return parent_zindex;
				} else {
					zindex = parseFloat(zindex);
					// https://robertsspaceindustries.com/orgs/LUG/members
					if (zindex < parent_zindex)
						return parent_zindex + zindex; // hack:
					// <div style="z-index: 9"></div>
					// <div style="z-index: 10">
					//   <div style="z-index: 2">this is above z-index: 9 because it's a child of z-index: 10</div>
					// </div>
					else
						return zindex;
				}
			};
			var get_zindex = function(el) {
				if (zoom_cache) {
					var cached = map_get(zoom_cache, el);
					if (!cached || !("zIndex" in cached)) {
						var zindex = get_zindex_raw(el);
						if (cached) {
							cached.zIndex = zindex;
						} else {
							map_set(zoom_cache, el, {
								zIndex: zindex
							});
						}
						return zindex;
					} else {
						return cached.zIndex;
					}
				} else {
					return get_zindex_raw(el);
				}
			};
			// TODO: only sort elements that were added outside of elementsFromPoint
			ret.sort(function(a, b) {
				var a_zindex, b_zindex;
				a_zindex = get_zindex(a);
				b_zindex = get_zindex(b);
				//console_log(a_zindex, b_zindex, a, b);
				if (b_zindex === a_zindex) {
					// Don't modify the sort order
					return array_indexof(ret, a) - array_indexof(ret, b);
				} else {
					// opposite because we want it to be reversed (largest first)
					return b_zindex - a_zindex;
				}
			});
			if (_nir_debug_ && ret.length > 0)
				console_log("find_els_at_point (ret)", els, shallowcopy(ret), xy);
			return ret;
		}
		var get_physical_popup_el = function(el) {
			if (el.parentElement && el.tagName === "SOURCE")
				return el.parentElement;
			return el;
		};
		function trigger_popup(options) {
			if (!options) {
				options = {};
			}
			if (_nir_debug_)
				console_log("trigger_popup (options:", options, ")", current_frame_id);
			// this check is set here instead of trigger_popup_with_source because automatic requests (e.g. gallery) should be ok
			if (!settings.mouseover_allow_popup_when_fullscreen && is_fullscreen() && !is_popup_fullscreen())
				return;
			delay_handle_triggering = true;
			//var els = document.elementsFromPoint(mouseX, mouseY);
			var point = null;
			if (mousepos_initialized)
				point = [mouseX, mouseY];
			if (options.is_contextmenu && mouseContextX !== null && mouseContextY !== null)
				point = [mouseContextX, mouseContextY];
			if (point === null) {
				delay_handle_triggering = false;
				return;
			}
			var els = find_els_at_point(point);
			//console_log(els);
			if (_nir_debug_)
				console_log("trigger_popup: els =", els, "point =", point);
			// clearing in order to somewhat mitigate shift+right click issues: https://github.com/qsniyg/maxurl/issues/679
			if (options.is_contextmenu) {
				mouseContextX = null;
				mouseContextY = null;
			}
			var source = find_source(els, { point: point });
			if (!source && settings.mouseover_allow_self_pagelink && popup_trigger_reason === "keyboard") {
				source = {
					el: document.body,
					src: window.location.href,
					pagelink: true
				};
			}
			if (_nir_debug_)
				console_log("trigger_popup: source =", source);
			if (source && (popup_trigger_reason !== "mouse" || get_physical_popup_el(source.el) !== last_popup_el)) {
				trigger_popup_with_source(source);
			} else {
				if (popup_trigger_reason === "keyboard") {
					if (settings.mouseover_enable_notallowed) {
						cursor_not_allowed();
					}
				}
				delay_handle_triggering = false;
			}
		}
		function trigger_popup_with_source(source, automatic, use_last_pos, cb) {
			next_popup_el = get_physical_popup_el(source.el);
			if (!cb)
				cb = common_functions["nullfunc"];
			var use_head = false;
			var openb = get_tprofile_single_setting("mouseover_open_behavior");
			if (openb === "newtab" || openb === "newtab_bg" || openb === "download" || openb === "copylink") {
				use_head = true;
			}
			var old_source = source;
			var incomplete_image = false;
			var incomplete_video = false;
			var partial = get_single_setting("mouseover_allow_partial");
			if (partial === "media") {
				incomplete_image = true;
				incomplete_video = true;
			} else if (partial === "video") {
				incomplete_video = true;
			}
			if (is_in_iframe && can_iframe_popout()) {
				incomplete_image = true;
				incomplete_video = true;
			}
			return get_final_from_source(source, {
				automatic: automatic,
				multi: false,
				use_head: use_head,
				incomplete_image: incomplete_image,
				incomplete_video: incomplete_video,
				use_last_pos: use_last_pos
			}, function(source_imu, source, processing, data) {
				if (!source_imu && !source && !processing && !data) {
					delay_handle_triggering = false;
					if (old_source.pagelink) {
						stop_waiting_cant_load();
					} else {
						stop_waiting();
					}
					return cb(false);
				}
				// FIXME: this shouldn't fail, but rather go to the next element
				if (automatic && previous_album_links && source_imu && source_imu[0]) {
					if (array_indexof(previous_album_links, source_imu[0].url) >= 0) {
						delay_handle_triggering = false;
						stop_waiting();
						return cb(false);
					}
				}
				var was_fullscreen = is_popup_fullscreen();
				//console_log(source_imu);
				resetpopups({
					new_popup: true,
					automatic: automatic
				});
				if (automatic) {
					popup_el_automatic = true;
					removepopups(); // don't fade out
				}
				real_popup_el = source.el;
				popup_el = get_physical_popup_el(real_popup_el);
				if (popup_el.parentElement) // check if it's a fake element returned by a gallery helper
					popup_orig_el = popup_el;
				popup_el_mediatype = el_media_type(popup_el);
				popup_el_is_stream = popup_el_mediatype === "video" || popup_el_mediatype === "audio";
				popup_orig_url = get_img_src(popup_el);
				if (is_in_iframe && can_iframe_popout() && get_tprofile_single_setting("mouseover_open_behavior") === "popup") {
					data.data.img = serialize_img(data.data.img);
					remote_send_message("top", {
						type: "make_popup",
						data: {
							source_imu: source_imu,
							src: source.src,
							processing: processing,
							data: data
						}
					});
				} else {
					makePopup(source_imu, source.src, processing, data);
					if (is_in_iframe && can_use_remote() && get_tprofile_single_setting("mouseover_open_behavior") === "popup") {
						remote_send_message("top", {
							type: "popup_open"
						});
					}
					// fixme: this actually doesn't work, because it's not counted as being part of a user event
					if (false && was_fullscreen) {
						popup_set_fullscreen();
					}
				}
				cb(true);
			});
		}
		function get_final_from_source(source, options, cb) {
			// FIXME: "multi" is used purely for replace_images,
			//   so it's used as a check for many options that have nothing to do with multi
			var processing = { running: true };
			if (!options.multi) {
				stop_processing();
				processing_list = [processing];
			}
			//console_log(source);
			var do_popup = function() {
				if (!options.multi)
					start_waiting(source.el);
				var x = mouseX;
				var y = mouseY;
				var realcb = function(source_imu, data) {
					//console_log(source_imu);
					//console_log(data);
					// why && false here? this should be clarified
					if ((!source_imu && false) || !data) {
						if (!options.multi) {
							stop_waiting_cant_load();
						}
						return cb();
					}
					// In case the user has dragged while loading the next image (#154)
					if (options.use_last_pos) {
						x = null;
						y = null;
					}
					cb(source_imu, source, processing, {
						data: data,
						x: x,
						y: y
					});
				};
				try {
					// FIXME: shouldn't this be ||?
					var force_page = settings.mouseover_ui_caption && settings.redirect_force_page;
					bigimage_recursive_loop(source.src, {
						fill_object: true,
						host_url: window.location.href,
						document: document,
						window: get_window(),
						element: source.el,
						force_page: force_page,
						cb: realcb
					}, function(obj, finalcb) {
						var orig_obj = obj;
						if (_nir_debug_)
							console_log("do_popup: brl query:", obj);
						if (options.null_if_no_change && obj[0].url === source.src) {
							return finalcb(source.src, obj[0], null);
						}
						var newobj = deepcopy(obj);
						// TODO: find a way to fix bad images popping up because they weren't caught in addImage (because of do_request: null)
						// brl returns [] if they're bad, but the bad sources are added right back here
						if (!settings.mouseover_exclude_sameimage) {
							if (source.src && obj_indexOf(newobj, source.src) < 0)
								newobj.push(fillobj(source.src)[0]);
						} else if (source.src) {
							var index;
							while ((index = obj_indexOf(newobj, source.src)) >= 0) {
								newobj.splice(index, 1);
							}
						}
						if (source.pagelink) {
							newobj = basic_fillobj(newobj);
							array_foreach(newobj, function(sobj) {
								if (sobj.url.replace(/#.*/, "") === source.src.replace(/#.*/, "")) {
									sobj.is_pagelink = true;
								}
							});
						}
						processing.incomplete_image = options.incomplete_image;
						processing.incomplete_video = options.incomplete_video;
						processing.progress_cb = options.progress_cb;
						if (options.use_head) {
							processing.head = true;
						}
						if (settings.popup_allow_cache && !options.deny_cache) {
							processing.set_cache = true;
							processing.use_cache = true;
						}
						processing.deny_nondirect_delivery = options.deny_nondirect_delivery;
						if (!get_tprofile_setting("mouseover_allow_video")) {
							processing.deny_video = true;
						}
						if (!get_tprofile_setting("mouseover_allow_audio")) {
							processing.deny_audio = true;
						}
						processing.source = source;
						check_image_get(newobj, function(img, newurl, obj, respdata) {
							if (_nir_debug_)
								console_log("do_popup: check_image_get response:", img, newurl, obj, respdata);
							if (!img) {
								return finalcb(null);
							}
							var data = { img: img, newurl: newurl, obj: obj, respdata: respdata };
							var newurl1 = newurl;
							if (options.use_head) {
								data = { resp: img, obj: newurl };
								newurl1 = data.resp.finalUrl;
							}
							if (settings.print_imu_obj)
								console_log(orig_obj);
							finalcb(newurl1, data.obj, data);
							if (false) {
								// why?
								if (newurl == source.src) {
									realcb(obj, data);
								} else {
									finalcb(newurl, data);
								}
							}
						}, processing);
					});
				} catch (e) {
					console_error(e);
					//console.trace();
					// this doesn't work
					//makePopup(source.src);
				}
			};
			if (delay && !delay_mouseonly && !options.automatic) {
				start_progress(source.el);
				delay_handle = setTimeout(function() {
					if (delay_handle_triggering)
						return;
					delay_handle = null;
					do_popup();
				}, delay * 1000);
			} else {
				do_popup();
			}
		}
		function do_get_helpers(options) {
			var baseoptions = {
				document: document,
				window: get_window(),
				host_url: window.location.href,
				do_request: do_request,
				rule_specific: {}
			};
			for (var option in options) {
				baseoptions[option] = options[option];
			}
			return get_helpers(baseoptions);
		}
		function wrap_gallery_func(nextprev, origel, el, cb, new_options) {
			if (!el)
				el = real_popup_el;
			if (!origel)
				origel = popup_orig_el;
			var options = {
				element: origel,
				document: document,
				window: get_window(),
				host_url: window.location.href,
				do_request: do_request,
				rule_specific: {},
				cb: function(result) {
					if (result === void 0 || result === "default") {
						return cb(get_next_in_gallery(el, nextprev));
					} else {
						cb(result);
					}
				}
			};
			if (new_options) {
				for (var key in new_options) {
					options[key] = new_options[key];
				}
			}
			get_bigimage_extoptions_first(options);
			get_bigimage_extoptions(options);
			var helpers = get_helpers(options);
			var gallery = get_next_in_gallery;
			if (helpers && helpers.gallery) {
				gallery = function(el, nextprev) {
					var value = helpers.gallery(el, nextprev);
					if (value || value === null)
						return value;
					return get_next_in_gallery(el, nextprev);
				};
			}
			var value = gallery(el, nextprev);
			if (value === "waiting") {
				return;
			} else if (value === "default") {
				return cb(get_next_in_gallery(el, nextprev));
			}
			return cb(value);
		}
		// https://developer.chrome.com/en/blog/tablesng/
		// keeps re-requesting the same element, which causes massive performance issues
		// <img alt="correct and incorrect table rendering" height="333" loading="lazy" sizes="(min-width: 800px) 800px, calc(100vw - 48px)" src="https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?auto=format" srcset="https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=200 200w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=228 228w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=260 260w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=296 296w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=338 338w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=385 385w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=439 439w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=500 500w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=571 571w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=650 650w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=741 741w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=845 845w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=964 964w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=1098 1098w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=1252 1252w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=1428 1428w, https://developer-chrome-com.imgix.net/image/HodOHWjMnbNw56hvNASHWSgZyAf2/Ms8AqAJn1oKmM1thWYut.png?w=1600 1600w" width="800">
		var valid_el_cache = new IMUCache();
		function is_valid_el(el) {
			if (!el)
				return false;
			if (valid_el_cache.has(el))
				return valid_el_cache.get(el);
			var result = !!find_source([el]);
			valid_el_cache.set(el, result, 3);
			return result;
		}
		function count_gallery(nextprev, max, is_counting, origel, el, cb) {
			var count = 0;
			if (max === void 0)
				max = settings.mouseover_ui_gallerymax;
			var firstel = el;
			if (!firstel)
				firstel = real_popup_el;
			if (!firstel && popup_el_remote && can_iframe_popout() && !is_in_iframe) {
				return remote_send_message(popup_el_remote, {
					type: "count_gallery",
					data: {
						nextprev: nextprev,
						is_counting: is_counting,
						max: max
					}
				}, function(count) {
					cb(count);
				});
			}
			var loop = function() {
				wrap_gallery_func(nextprev, origel, el, function(newel) {
					if (!newel || !is_valid_el(newel))
						return cb(count, el);
					count++;
					if (count >= max)
						return cb(count, newel);
					el = newel;
					stackoverflow_guard(loop, count, 100);
				}, { is_counting: is_counting, counting_firstel: firstel });
			};
			loop();
		}
		var get_gallery_elements = function(cb, origel, el) {
			var count = 0;
			var els_set = new_set();
			var els = [];
			var firstel = el;
			if (!firstel)
				firstel = real_popup_el;
			if (firstel) {
				set_add(els_set, firstel);
				els.push(firstel);
			}
			var loop = function(nextprev, cb) {
				wrap_gallery_func(nextprev, origel, el, function(newel) {
					if (!newel || !is_valid_el(newel))
						return cb();
					count++;
					//if (count >= max) return cb();
					el = newel;
					if (!set_has(els_set, el)) {
						set_add(els_set, el);
						if (nextprev) {
							els.push(el);
						} else {
							els.unshift(el);
						}
					}
					// large galleries can cause stack overflows, as well as hanging the page
					stackoverflow_guard(function() {
						loop(nextprev, cb);
					}, count, 100);
				});
			};
			loop(false, function() {
				loop(true, function() {
					cb(els);
				});
			});
		};
		function wrap_gallery_cycle(dir, origel, el, cb) {
			if (!el)
				el = real_popup_el;
			if (dir === 0)
				return cb();
			var nextprev = true;
			var max = dir;
			if (dir < 0) {
				nextprev = false;
				max = -dir;
			}
			count_gallery(nextprev, max, false, origel, el, function(count, newel) {
				if (count < max) {
					if (settings.mouseover_gallery_cycle) {
						count_gallery(!nextprev, void 0, true, origel, el, function(count, newel) {
							cb(newel);
						});
					} else {
						cb(null);
					}
				} else {
					cb(newel);
				}
			});
		}
		function is_nextprev_valid(nextprev, cb) {
			if (popup_el_remote && can_iframe_popout() && !is_in_iframe) {
				return remote_send_message(popup_el_remote, {
					type: "is_nextprev_valid",
					data: {
						nextprev: nextprev
					}
				}, function(valid) {
					cb(valid);
				});
			}
			wrap_gallery_cycle(nextprev ? 1 : -1, void 0, void 0, function(el) {
				cb(is_valid_el(el));
			});
		}
		trigger_gallery = function(dir, cb) {
			if (!cb) {
				cb = common_functions.nullfunc;
			}
			if (popup_el_remote && can_iframe_popout() && !is_in_iframe) {
				return remote_send_message(popup_el_remote, {
					type: "trigger_gallery",
					data: {
						dir: dir
					}
				}, function(triggered) {
					cb(triggered);
				});
			}
			wrap_gallery_cycle(dir, void 0, void 0, function(newel) {
				if (newel) {
					var source = find_source([newel]);
					if (source) {
						trigger_popup_with_source(source, true, true, function(changed) {
							cb(changed);
						});
						return;
					}
				}
				return cb(false);
			});
		};
		var parse_transforms = function(transform) {
			var transforms = [];
			var transform_types = {};
			var last = 0;
			for (var i = 0; i < transform.length; i++) {
				if (transform[i] === ')') {
					var our_transform = strip_whitespace(transform.substr(last, (i - last) + 1));
					var type = our_transform.replace(/\(.*/, "");
					transforms.push(our_transform);
					if (!(type in transform_types)) {
						transform_types[type] = [];
					}
					transform_types[type].push(transforms.length - 1);
					last = i + 1;
					continue;
				}
			}
			return { transforms: transforms, types: transform_types };
		};
		var get_popup_transforms = function() {
			var style = null;
			if (popups && popups[0]) {
				var media = get_popup_media_el();
				if (media) {
					style = media.parentElement.parentElement.style;
				}
			}
			if (style && style.transform) {
				return parse_transforms(style.transform);
			} else {
				return { transforms: [], types: {} };
			}
		};
		var stringify_transforms = function(transforms) {
			return transforms.transforms.join(" ");
		};
		var set_popup_transforms = function(transforms) {
			var media = get_popup_media_el();
			if (media) {
				media.parentElement.parentElement.style.transform = stringify_transforms(transforms);
			}
		};
		var get_rotation_data_from_transforms = function(transforms) {
			var index = 0;
			if ("rotate" in transforms.types) {
				index = transforms.types.rotate[0];
			} else {
				transforms.transforms.unshift("rotate(0deg)");
			}
			var match = transforms.transforms[index].match(/^rotate\(([-0-9]+)deg\)$/);
			var deg = 0;
			if (match) {
				deg = parseInt(match[1]);
			}
			return {
				deg: deg,
				index: index
			};
		};
		var get_popup_rotation = function() {
			var transforms = get_popup_transforms();
			var rotation_data = get_rotation_data_from_transforms(transforms);
			return rotation_data.deg;
		};
		function rotate_gallery(dir) {
			if (!popups_active)
				return;
			var transforms = get_popup_transforms();
			var rotation_data = get_rotation_data_from_transforms(transforms);
			transforms.transforms[rotation_data.index] = "rotate(" + (rotation_data.deg + dir) + "deg)";
			set_popup_transforms(transforms);
			popup_createui_func(true);
		}
		// hv: vertical = true, horizontal = false
		var flip_gallery = function(hv) {
			if (!popups_active)
				return;
			var transforms = get_popup_transforms();
			var index = transforms.transforms.length;
			if ("scale" in transforms.types) {
				index = transforms.types.scale[0];
			} else {
				transforms.transforms.push("scale(1,1)");
			}
			var match = transforms.transforms[index].match(/^scale\(([-0-9.]+)\s*,\s*([-0-9.]+)\)$/);
			var scaleh = 1;
			var scalev = 1;
			if (match) {
				scaleh = parseFloat(match[1]);
				scalev = parseFloat(match[2]);
			}
			if (hv) {
				scalev = -scalev;
			} else {
				scaleh = -scaleh;
			}
			transforms.transforms[index] = "scale(" + scaleh + ", " + scalev + ")";
			set_popup_transforms(transforms);
		};
		var format_number_decimal = function(number, decimal) {
			var exp = Math_pow(10, decimal);
			;
			number *= exp;
			return (number | 0) / exp;
		};
		var get_bytes_unit = function(bytes) {
			var units = ["B", "KB", "MB", "GB", "TB", "PB"];
			while (units.length > 1 && bytes > 1024) {
				bytes /= 1024;
				units.shift();
			}
			return format_number_decimal(bytes, 2) + units[0];
		};
		function create_progress_el(position_top) {
			var progressc_el = document_createElement("div");
			set_el_all_initial(progressc_el);
			progressc_el.style.backgroundColor = "rgba(0,0,0,0.7)";
			//progressc_el.style.padding = "1em";
			progressc_el.style.height = "2em";
			progressc_el.style.zIndex = maxzindex - 2;
			var progressb_el = document_createElement("div");
			set_el_all_initial(progressb_el);
			progressb_el.style.position = "absolute";
			progressb_el.style.top = "0px";
			progressb_el.style.left = "0px";
			//progressb_el.style.backgroundColor = "#00aa00";
			progressb_el.style.backgroundColor = "#00aaff";
			progressb_el.style.height = "100%";
			progressb_el.style.width = "0%";
			progressb_el.style.zIndex = maxzindex - 1;
			progressc_el.appendChild(progressb_el);
			if (position_top) {
				progressc_el.style.position = "fixed";
				progressc_el.style.top = "0px";
				progressc_el.style.left = "0px";
				progressc_el.style.width = "80%";
				progressc_el.style.marginTop = "100px";
				progressc_el.style.marginLeft = "10%";
				document.documentElement.appendChild(progressc_el);
			}
			return progressc_el;
		}
		function update_progress_el(el, percent, remove_on_complete) {
			var bar = el.children[0];
			if (typeof percent === "number") {
				if (bar.getAttribute("data-timer")) {
					clearInterval(parseInt(bar.getAttribute("data-timer")));
					bar.removeAttribute("data-timer");
				}
				if (percent >= 1 && remove_on_complete && el.parentElement) {
					el.parentElement.removeChild(el);
				} else {
					bar.style.width = (percent * 100) + "%";
				}
			} else if (percent == "unknown") {
				bar.style.width = "10%";
				if (!bar.getAttribute("data-timer")) {
					bar.style.left = "0%";
					bar.setAttribute("data-dir", "right");
					var timer = setInterval(function() {
						var left = parseFloat(bar.style.left);
						var delta = (15 / 1000) * 1;
						var size = 90;
						if (bar.getAttribute("data-dir") == "right") {
							left += (delta * size);
							if (left >= size) {
								left = size - (left - size);
								bar.setAttribute("data-dir", "left");
							}
						} else {
							left -= (delta * size);
							if (left <= 0) {
								left = -left;
								bar.setAttribute("data-dir", "right");
							}
						}
						bar.style.left = left + "%";
					}, 15);
					bar.setAttribute("data-timer", timer);
				}
			}
		}
		var is_el_pic = function(el) {
			return el.tagName === "IMG" || el.tagName === "PICTURE";
		};
		var is_img_pic_vid = function(el) {
			return is_el_pic(el) || el.tagName === "VIDEO";
		};
		var is_img_pic_vid_link = function(el) {
			if (is_img_pic_vid(el))
				return true;
			if (settings.mouseover_links) {
				if (el.tagName === "A")
					return true;
			}
			return false;
		};
		var get_all_valid_els = function(el) {
			if (!el)
				el = document;
			return el.querySelectorAll("img, picture, video");
		};
		var get_all_valid_els_link_real = function(el) {
			if (!el)
				el = document;
			return el.querySelectorAll("img, picture, video, a");
		};
		var get_all_valid_els_link = function(el) {
			if (settings.mouseover_links) {
				return get_all_valid_els_link_real(el);
			} else {
				return get_all_valid_els(el);
			}
		};
		var copy_el = function(oldel, newel, override) {
			array_foreach(oldel.attributes, function(attr) {
				if (!newel.hasAttribute(attr.name) || override)
					newel.setAttribute(attr.name, attr.value);
			});
		};
		var duplicate_el = function(oldel) {
			var newel = document_createElement(oldel.tagName);
			copy_el(oldel, newel);
			return newel;
		};
		var replace_el = function(oldel, newel) {
			if (newel.parentElement) {
				newel = duplicate_el(newel);
				newel.removeAttribute("style"); // in case of cached element being used in popup
			}
			copy_el(oldel, newel);
			oldel.parentElement.insertBefore(newel, oldel);
			oldel.parentElement.removeChild(oldel);
		};
		var replace_with_replacement = function(options, el, replacement, url) {
			var newsrc;
			if (!replaced) {
				newsrc = get_img_src(replacement);
			}
			var do_replace = false;
			if (el.tagName === "A") {
				if (options.plainlink_replace_link) {
					el.href = newsrc;
				}
				if (options.plainlink_replace_text) {
					el.textContent = newsrc;
				}
				if (options.plainlink_replace_media) {
					do_replace = true;
				}
			}
			var el_dimensions = get_el_dimensions(el);
			var replaced = false;
			if (do_replace || (typeof replacement !== "string" && replacement.tagName === "VIDEO")) {
				if (typeof replacement !== "string") {
					// todo: only replace on either blob url (hls/dash), or when the source el was a picture
					el = replace_el(el, replacement);
					replaced = true;
				} else {
					console_warn("Unable to replace", el, "due to invalid replacement:", replacement);
					return;
				}
			}
			if (!replaced && options.replace_imgs) {
				// srcset can override src: https://github.com/qsniyg/maxurl/issues/659
				if (el.hasAttribute("srcset")) {
					el.removeAttribute("srcset");
				}
				if (get_img_src(el) !== newsrc) {
					el.src = newsrc;
				}
			}
			if (options.size_constraints === "remove") {
				el.removeAttribute("height");
				el.removeAttribute("width");
				el.style.setProperty("height", "auto", "important");
				el.style.setProperty("width", "auto", "important");
			} else if (options.size_constraints === "force" && el_dimensions && el_dimensions[0] && el_dimensions[1]) {
				el.setAttribute("height", el_dimensions[1]);
				el.removeAttribute("width", el_dimensions[0]);
				el.style.setProperty("height", el_dimensions[1] + "px", "important");
				el.style.setProperty("width", el_dimensions[0] + "px", "important");
			}
			if (options.replace_css) {
				apply_styles(el, options.replace_css, {
					force_important: true
				});
			}
			if (options.add_links) {
				var current = el;
				while (current = current.parentElement) {
					if (current.tagName === "A") {
						if (!options.replace_links)
							return;
						else
							break;
					}
				}
				if (!current) {
					current = document_createElement("a");
					el.parentElement.insertBefore(current, el);
					current.appendChild(el);
				}
				if (options.links_newtab) {
					current.target = "_blank";
				}
				if (current.href !== url) {
					current.href = url;
				}
			}
		};
		var replace_single_media = function(options, source, data, cb) {
			var waiting = false;
			if (data.data.img) {
				replace_with_replacement(options, source.el, data.data.img, data.data.obj.url);
			} else if (data.data.obj) {
				var load_image = function() {
					if (settings.replaceimgs_wait_fullyloaded && options.replace_imgs) {
						// Preload the image, as adding onload/onerror to existing images won't fire the event
						// todo: support videos
						var image = new Image();
						var finish_image = function() {
							replace_with_replacement(options, source.el, image.src, data.data.obj.url);
							cb();
						};
						image.onload = finish_image;
						image.onerror = cb;
						image.src = data.data.obj.url;
					} else {
						replace_with_replacement(options, source.el, data.data.obj.url, data.data.obj.url);
						cb();
					}
				};
				if (is_extension) {
					extension_send_message({
						type: "override_next_headers",
						data: {
							url: data.data.obj.url,
							headers: data.data.obj.headers,
							method: "GET"
						}
					}, function() {
						load_image();
					});
				} else {
					load_image();
				}
				waiting = true;
			}
			if (!waiting)
				cb();
		};
		var replacing_imgs = false;
		var replaceimgs_elcache = new IMUCache();
		function replace_images(options) {
			if (replacing_imgs || currenttab_is_image())
				return;
			var raw_imgs = options.images;
			if (raw_imgs === void 0) {
				if (options.support_plainlinks) {
					raw_imgs = get_all_valid_els_link_real();
				} else {
					raw_imgs = get_all_valid_els();
				}
			}
			// remove non-images/videos
			var imgs = [];
			if (!options.all_els_ok) {
				var parent_els = new_set();
				for (var i = 0; i < raw_imgs.length; i++) {
					var supported = is_img_pic_vid(raw_imgs[i]);
					if (!supported && options.support_plainlinks && raw_imgs[i].tagName === "A")
						supported = true;
					if (supported) {
						imgs.push(raw_imgs[i]);
						if (options.support_plainlinks) {
							var parent = raw_imgs[i].parentElement;
							while (parent) {
								set_add(parent_els, parent);
								parent = parent.parentElement;
							}
						}
					}
				}
				if (options.support_plainlinks) {
					// linked media are not plainlinks
					// fixme: does this work for non-document?
					for (var i = 0; i < imgs.length; i++) {
						if (imgs[i].tagName === "A" && set_has(parent_els, imgs[i])) {
							imgs.splice(i, 1);
							i--;
						}
					}
				}
			} else {
				imgs = raw_imgs;
			}
			if (imgs.length === 0)
				return;
			var ip;
			if (options.use_progressbar)
				console_log("Replacing images");
			var finished = 0;
			var final_progress = 1;
			if (options.finalcb && options.finalcb_progress) {
				final_progress -= options.finalcb_progress;
			}
			var finish_img = function(id) {
				finished++;
				if (options.use_progressbar) {
					//update_progress_el(progressc_el, finished / total_imgs, true);
					ip.finish_id(id);
					console_log("Finished " + finished + "/" + total_imgs);
				}
				if (finished >= total_imgs) {
					if (options.use_progressbar) {
						update_progress_el(progressc_el, final_progress, true);
					}
					//if (options.use_progressbar) {
					//	progressc_el.parentElement.removeChild(progressc_el);
					//}
					replacing_imgs = false;
					if (options.finalcb) {
						options.finalcb(function(progress) {
							if (options.use_progressbar && options.finalcb_progress) {
								update_progress_el(progressc_el, final_progress + (progress * options.finalcb_progress), true);
							}
						});
					}
				} else {
					// stack overflows are unlikely because we're mostly running from callbacks, but it may be possible if we're retrieving cached images?
					stackoverflow_guard(next_img, finished, 100);
				}
			};
			if (!options.replace_image_func) {
				options.replace_image_func = function(options, our_source, cb, domain_processed_cb, progress_cb) {
					if (options.use_elcache) {
						if (replaceimgs_elcache.has(our_source.el)) {
							domain_processed_cb();
							return cb();
						} else {
							// Not perfect, but 5 seconds should be enough
							replaceimgs_elcache.set(our_source.el, true, 5);
						}
					}
					var use_head = !settings.replaceimgs_usedata;
					var incomplete = use_head;
					var null_if_no_change = true;
					if (our_source.el.tagName === "A") {
						use_head = null_if_no_change = !options.plainlink_replace_media;
						// otherwise it'll request a lot of links, most of which aren't images
						if (!null_if_no_change) {
							null_if_no_change = !looks_like_valid_link(our_source.src, our_source.el);
						}
					}
					get_final_from_source(our_source, {
						automatic: true,
						multi: true,
						use_head: use_head,
						incomplete_image: incomplete,
						incomplete_video: incomplete,
						null_if_no_change: null_if_no_change,
						use_last_pos: false,
						progress_cb: progress_cb
					}, function(source_imu, source, processing, data) {
						domain_processed_cb();
						if (!data) {
							replace_with_replacement(options, our_source.el, our_source.src, our_source.src);
							return cb();
						}
						replace_single_media(options, source, data, cb);
					});
				};
			}
			var current_img_i = 0;
			var next_img = function() {
				var total_limit = parseInt(settings.replaceimgs_totallimit);
				if (currently_processing > total_limit) {
					currently_processing--;
					return;
				} else if (currently_processing < total_limit) {
					currently_processing++;
					next_img();
				}
				var our_source = null;
				var our_domain = null;
				var now = Date.now();
				for (var domain in domains) {
					if (domains_processing[domain] >= parseInt(settings.replaceimgs_domainlimit)) {
						continue;
					}
					var delta = now - domains_lastrequest[domain];
					var replaceimgs_delay = parseFloat(settings.replaceimgs_delay) * 1000.0;
					var wait_delay = replaceimgs_delay - delta;
					if (wait_delay > 0) {
						if (domains_timeout[domain] === null) {
							// wrap in closure to capture domain for the callback
							(function(domain) {
								domains_timeout[domain] = setTimeout(function() {
									domains_timeout[domain] = null;
									next_img();
								}, wait_delay + 1);
							})(domain);
						}
						continue;
					}
					our_domain = domain;
					domains_processing[domain]++;
					domains_lastrequest[domain] = now;
					our_source = domains[domain][0];
					domains[domain].splice(0, 1);
					if (domains[domain].length === 0) {
						delete domains[domain];
					}
					break;
				}
				if (our_source === null && other.length > 0) {
					our_source = other[0];
					other.splice(0, 1);
				}
				var our_id = current_img_i;
				current_img_i++;
				if (our_source) {
					options.replace_image_func(options, our_source, function() {
						finish_img(our_id);
					}, function() {
						if (our_domain)
							domains_processing[our_domain]--;
					}, function(progobj) {
						if (settings.replaceimgs_simple_progress) {
							var percent = progobj.loaded / progobj.total;
							progobj.total = 1;
							progobj.loaded = percent;
						}
						ip.update_progobj(our_id, progobj);
					});
				} else {
					currently_processing--;
				}
			};
			var progressc_el;
			if (options.use_progressbar) {
				progressc_el = create_progress_el(true);
			}
			var domains = {};
			var domains_processing = {};
			var domains_lastrequest = {};
			var domains_timeout = {};
			var other = [];
			var total_imgs = imgs.length;
			for (var i = 0; i < imgs.length; i++) {
				// fixme: if find_source only returns null, it will "hang" (progress bar will never close)
				var source = find_source([imgs[i]], { links: options.support_plainlinks });
				if (!source) {
					total_imgs--;
					continue;
				}
				source._replace_id = i;
				if (!source.src) {
					other.push(source);
					continue;
				}
				var domain = source.src.match(/^https?:\/\/([^/]+)\//);
				if (!domain) {
					other.push(source);
					continue;
				}
				if (!(domain[1] in domains)) {
					domains[domain[1]] = [];
					domains_processing[domain[1]] = 0;
					domains_lastrequest[domain[1]] = 0;
					domains_timeout[domain[1]] = null;
				}
				domains[domain[1]].push(source);
			}
			if (options.use_progressbar) {
				ip = new ImpreciseProgress({
					cb: function(progobj) {
						update_progress_el(progressc_el, progobj.percent * final_progress, false);
					},
					elements_num: total_imgs
				});
			}
			var currently_processing = 1;
			next_img();
		}
		var get_replace_images_options = function(options) {
			var base_options = {
				replace_imgs: settings.replaceimgs_replaceimgs,
				add_links: settings.replaceimgs_addlinks,
				replace_links: settings.replaceimgs_replacelinks,
				support_plainlinks: false,
				plainlink_replace_text: false,
				plainlink_replace_link: false,
				plainlink_replace_media: false,
				links_newtab: settings.replaceimgs_links_newtab,
				size_constraints: get_single_setting("replaceimgs_size_constraints"),
				replace_css: settings.replaceimgs_css,
				use_progressbar: true
			};
			var plainlinks_option = get_single_setting("replaceimgs_plainlinks");
			if (plainlinks_option !== "none") {
				base_options.support_plainlinks = true;
				if (plainlinks_option === "replace_link_text") {
					base_options.plainlink_replace_text = true;
					base_options.plainlink_replace_link = true;
				} else if (plainlinks_option === "replace_media") {
					base_options.plainlink_replace_media = true;
				}
			}
			if (!options)
				options = {};
			for (var key in options) {
				base_options[key] = options[key];
			}
			return base_options;
		};
		var replace_images_full = function(options) {
			var base_options = get_replace_images_options(options);
			return replace_images(base_options);
		};
		register_menucommand("Replace images", replace_images_full);
		var exit_custom_gallery = null;
		var setup_custom_gallery = function() {
			if (exit_custom_gallery)
				exit_custom_gallery();
			var base_maskel = document_createElement("div");
			set_important_style(base_maskel, "position", "absolute");
			set_important_style(base_maskel, "left", "0px");
			set_important_style(base_maskel, "top", "0px");
			set_el_all_initial(base_maskel);
			var mask_bgel = document_createElement("div");
			set_el_all_initial(mask_bgel);
			apply_styles(mask_bgel, settings.customgallery_bg_css, { force_important: true });
			set_important_style(mask_bgel, "pointer-events", "none");
			set_important_style(mask_bgel, "position", "fixed");
			set_important_style(mask_bgel, "left", "0px");
			set_important_style(mask_bgel, "top", "0px");
			set_important_style(mask_bgel, "height", "100%");
			set_important_style(mask_bgel, "width", "100%");
			set_important_style(mask_bgel, "z-index", maxzindex - 3);
			base_maskel.appendChild(mask_bgel);
			var mask_outlines_el = document_createElement("div");
			set_el_all_initial(mask_outlines_el);
			set_important_style(mask_outlines_el, "position", "absolute");
			set_important_style(mask_outlines_el, "pointer-events", "none");
			set_important_style(mask_outlines_el, "left", "0px");
			set_important_style(mask_outlines_el, "top", "0px");
			set_important_style(mask_outlines_el, "z-index", maxzindex - 2);
			base_maskel.appendChild(mask_outlines_el);
			var maskel = document_createElement("div");
			set_el_all_initial(maskel);
			set_important_style(maskel, "position", "fixed");
			set_important_style(maskel, "left", "0px");
			set_important_style(maskel, "top", "0px");
			set_important_style(maskel, "height", "100%");
			set_important_style(maskel, "width", "100%");
			set_important_style(maskel, "z-index", maxzindex);
			base_maskel.appendChild(maskel);
			set_add(exclude_find_els, maskel);
			var sources = [];
			var source_el_set = new_set();
			var _find_source = function(source) {
				for (var _i = 0, sources_1 = sources; _i < sources_1.length; _i++) {
					var src = sources_1[_i];
					if (src.el === source.el)
						return src;
				}
				return null;
			};
			var add_source = function(source) {
				if (!source.el)
					return false;
				if (set_has(source_el_set, source.el))
					return _find_source(source) || source;
				sources.push(source);
				set_add(source_el_set, source.el);
				return source;
			};
			var remove_source = function(source) {
				var found_source = _find_source(source);
				if (found_source) {
					var index = array_indexof(sources, found_source);
					if (index >= 0)
						sources.splice(index, 1);
				}
				set_remove(source_el_set, source.el);
			};
			exit_custom_gallery = function() {
				if (alt_keydown_cb === our_keydown_cb)
					alt_keydown_cb = null;
				set_remove(exclude_find_els, maskel);
				base_maskel.parentElement.removeChild(base_maskel);
				exit_custom_gallery = null;
			};
			var our_keydown_cb = alt_keydown_cb = function(e) {
				var actions = [
					{
						key: settings.mouseover_close_key,
						action: exit_custom_gallery
					},
					{
						key: settings.customgallery_apply_key,
						action: function() {
							exit_custom_gallery();
							if (!sources.length)
								return;
							override_album = [];
							for (var _i = 0, sources_2 = sources; _i < sources_2.length; _i++) {
								var source = sources_2[_i];
								override_album.push(source.el);
							}
							trigger_popup_with_source(sources[0], true);
						}
					}
				];
				for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) {
					var action = actions_1[_i];
					if (!trigger_complete(action.key))
						continue;
					action.action();
					return false;
				}
			};
			our_addEventListener(maskel, "click", function(e) {
				e.preventDefault();
				e.stopImmediatePropagation();
				e.stopPropagation();
				var point = [mouseX, mouseY];
				var els = find_els_at_point(point);
				var source = find_source(els, { point: point });
				if (!source || !source.el)
					return;
				source = add_source(source);
				source._real_el = source.el;
				if (source.picture)
					source._real_el = source.picture;
				if (source._outline_el) {
					// if _outline_el exists, then the source was already added previously
					// toggle
					remove_source(source);
					if (source._outline_el) {
						source._outline_el.parentElement.removeChild(source._outline_el);
					}
					return;
				}
				var rect = source._real_el.getBoundingClientRect();
				var outline_el = document_createElement("div");
				apply_styles(outline_el, settings.customgallery_outline_css, { force_important: true });
				set_important_style(outline_el, "position", "absolute");
				set_important_style(outline_el, "pointer-events", "none");
				set_important_style(outline_el, "z-index", maxzindex - 1);
				set_important_style(outline_el, "left", (rect.left + window.scrollX) + "px");
				set_important_style(outline_el, "top", (rect.top + window.scrollY) + "px");
				set_important_style(outline_el, "width", rect.width + "px");
				set_important_style(outline_el, "height", rect.height + "px");
				mask_outlines_el.appendChild(outline_el);
				source._outline_el = outline_el;
			}, { capture: true });
			document.documentElement.appendChild(base_maskel);
		};
		(function() {
			var added = false;
			var id = null;
			var update_button = function() {
				if (settings.customgallery_enable_button) {
					if (!added) {
						id = register_menucommand("Custom gallery", setup_custom_gallery);
						added = true;
					}
				} else {
					if (added) {
						unregister_menucommand(id);
						added = false;
					}
				}
			};
			update_button();
			var origfunc = settings_meta.customgallery_enable_button.onupdate;
			settings_meta.customgallery_enable_button.onupdate = function() {
				update_button();
				if (origfunc)
					return origfunc.apply(this, arguments);
			};
		})();
		var create_zip = function(files, foldername, cb, progresscb) {
			get_library("jszip", settings, do_request, function(lib) {
				if (!lib)
					return cb(null);
				var zip = new lib();
				var root = zip;
				if (foldername) {
					root = zip.folder(foldername);
				}
				for (var filename in files) {
					root.file(filename, files[filename]);
				}
				zip.generateAsync({ type: "blob" }, function(prog_info) {
					progresscb(prog_info.percent / 100);
				}).then(function(data) {
					cb(data);
				}, function(err) {
					console_error(err);
					cb(null);
				});
			});
		};
		var send_to_jdownloader = function(got_objs, foldername, cb) {
			var do_jd_request = function(req) {
				req.headers = {
					Referer: "https://qsniyg.github.io/maxurl/"
				};
				do_request(req);
			};
			var jdcheck = function(cb) {
				do_jd_request({
					method: "GET",
					url: "http://127.0.0.1:9666/jdcheckjson",
					onload: function(resp) {
						if (resp.status !== 200) {
							console_error("Unable to connect to JDownloader", resp);
							return cb(false);
						} else {
							// ensure it's valid json
							try {
								JSON.parse(resp.responseText);
							} catch (e) {
								console_error(e);
								return cb(false);
							}
							return cb(true);
						}
					}
				});
			};
			var prepare_flashgots = function() {
				var referers = {};
				var referer_policy = get_single_setting("gallery_jd_referer");
				for (var i = 0; i < got_objs.length; i++) {
					var gobj = got_objs[i];
					if (!gobj)
						continue;
					var our_obj = {
						url: gobj.obj.url,
						filename: gobj.filename || "",
						desc: ""
					};
					var referer_key = "";
					var our_referer = null;
					if (gobj.obj.headers && referer_policy !== "never") {
						our_referer = headerobj_get(gobj.obj.headers, "referer") || null;
						if (our_referer) {
							our_obj.referer = our_referer;
							referer_key = our_referer;
							// batch referers by domain, hopefully avoiding package spam
							if (referer_policy === "domain") {
								referer_key = get_domain_from_url(referer_key);
							}
						}
					}
					if (!(referer_key in referers)) {
						referers[referer_key] = {
							referer: our_referer,
							urls: []
						};
					}
					referers[referer_key].urls.push(our_obj);
				}
				var final_queries = [];
				for (var key in referers) {
					var referer_obj = referers[key];
					var urls = [];
					var descs = [];
					var fnames = [];
					array_foreach(referer_obj.urls, function(url) {
						// thanks to Jiaz from JDownloader for the directhttp trick
						urls.push("directhttp://" + url.url);
						fnames.push(url.fnames);
						descs.push(url.desc);
					});
					var query = {
						urls: urls.join("\n"),
						descriptions: descs.join("\n"),
						fnames: fnames.join("\n")
					};
					if (foldername)
						query.package = foldername;
					//if (referer_obj.referer)
					query.referer = referer_obj.referer || "";
					if (settings.gallery_jd_autostart)
						query.autostart = "1";
					final_queries.push(stringify_queries(query, true));
				}
				return final_queries;
			};
			jdcheck(function(ok) {
				if (!ok)
					return cb(false);
				var queries = prepare_flashgots();
				var queries_done = 0;
				var total_queries = queries.length;
				var query_error = false;
				array_foreach(queries, function(query) {
					do_jd_request({
						method: "GET",
						url: "http://127.0.0.1:9666/flashgot?" + query,
						onload: function(resp) {
							queries_done++;
							if (query_error)
								return;
							if (resp.status !== 200) {
								console_error("Error with flashgot api", resp);
								query_error = true;
								return cb(false);
							}
							if (queries_done >= total_queries)
								cb(true);
						}
					});
				});
			});
		};
		var download_album = function() {
			var files = {};
			var urls = new_set();
			var got_objs = [];
			var infos = {};
			var failed_infos = [];
			var filename = null;
			var download_method = get_single_setting("gallery_download_method");
			var set_zip_filename = function(obj) {
				if (filename || !obj)
					return;
				var our_vars = deepcopy(obj.format_vars);
				our_vars.ext = ".zip";
				// got_objs is used because files is not populated for jdownloader
				our_vars.items_amt = Object.keys(got_objs).length.toString(); //Object.keys(files).length.toString();
				//our_vars.filename = our_vars.filename_noext + our_vars.ext;
				filename = get_filename_from_format(settings.gallery_zip_filename_format, our_vars);
				if (!filename)
					filename = "download";
				if (!/\.zip$/i.test(filename))
					filename += ".zip";
			};
			var get_trunc_url = function(url) {
				if (/^https?:\/\//i.test(url))
					return url;
				return url.substr(0, 1000); // to avoid huge data urls
			};
			var get_host_info = function() {
				var info = {};
				info.url = window_location;
				try {
					var our_window = get_window();
					var href1 = our_window.location.href;
					if (href1 !== window_location) {
						info.url_orig = window_location;
						info.url = href1;
					}
					info.title = document.title;
					info.download_time = new Date().toString();
				} catch (e) {
					console_error(e);
				}
				return info;
			};
			var get_failed_info = function(source) {
				var info = {};
				info.num_in_gallery = source._replace_id + 1;
				var source_src = source.src;
				if (source_src)
					info.url = get_trunc_url(source_src);
				return info;
			};
			var get_info_for_file = function(filename, obj, origurl, source) {
				var info = {};
				info.num_in_gallery = source._replace_id + 1;
				info.download_url = get_trunc_url(origurl);
				if (obj.headers)
					info.download_headers = obj.headers;
				var source_src = source.src;
				if (source_src && source_src !== origurl) {
					info.thumb_url = get_trunc_url(source_src);
				}
				info.filename = filename;
				if (obj.filename !== filename) {
					info.orig_filename = obj.filename;
				}
				if (obj.filesize)
					info.filesize = obj.filesize;
				if (obj.extra) {
					obj_foreach(obj.extra, function(key, value) {
						if (value !== null && value !== "")
							info["extra_" + key] = value;
					});
				}
				return info;
			};
			var unix_to_dos = function(txt) {
				return txt.replace(/\r*\n/g, "\r\n");
			};
			var get_info_file = function() {
				var header = get_host_info();
				var file = [];
				file.push(" --- Page info ---", "");
				file.push(JSON_stringify(header, null, "\t"));
				file.push("", " --- Files ---", "");
				for (var i = 0; i < got_objs.length; i++) {
					if (!got_objs[i] || !got_objs[i].filename)
						continue;
					var filename = got_objs[i].filename;
					file.push(filename);
					file.push(JSON_stringify(infos[i], null, "\t"));
					file.push("");
				}
				if (failed_infos.length) {
					file.push("", " --- Failed ---", "");
					array_foreach(failed_infos, function(info) {
						file.push(JSON_stringify(info, null, "\t"));
						file.push("");
					});
				}
				return unix_to_dos(file.join("\n"));
			};
			var get_first_obj = function() {
				for (var i = 0; i < got_objs.length; i++) {
					if (!got_objs[i] || !got_objs[i].obj)
						continue;
					return got_objs[i].obj;
				}
			};
			var add_file = function(data, our_source, progresscb, cb) {
				if (!data || !data.data || !data.data.obj) {
					console_error("Invalid data", data, our_source);
					return cb();
				}
				var src = data.data.obj.url;
				if (data.data.resp) {
					if (!data.data.resp.finalUrl) {
						console_error("Unable to load image from", data, our_source);
						return cb();
					}
					src = data.data.resp.finalUrl;
				}
				// fixme: if img is blob, we need to free it
				if (data.data.img) {
					// otherwise it'll both use bandwidth and play the audio
					if (data.data.img.tagName === "VIDEO") {
						data.data.img.pause();
					}
					src = get_img_src(data.data.img);
				}
				var obj = data.data.obj || {};
				var origurl = obj.url;
				var filename = null; // to be filled by fill_filename
				//obj = overlay_object(obj, { url: src });
				if (set_has(urls, origurl)) {
					return cb();
				} else {
					set_add(urls, origurl);
				}
				var fill_filename = function(use_download) {
					fill_obj_filename(obj, origurl, data.data.respdata);
					filename = obj.filename;
					// this should hopefully not happen
					if (use_download && !filename)
						filename = "download";
					if (filename && filename in files) {
						var i = 1;
						var new_filename;
						var splitted = url_basename(filename, { split_ext: true });
						do {
							new_filename = splitted[0] + " (" + (i++) + ")";
							if (splitted[1]) {
								new_filename += "." + splitted[1];
							}
						} while (new_filename in files);
						filename = new_filename;
					}
					return filename;
				};
				var final_cb = function() {
					if (settings.gallery_zip_add_info_file) {
						infos[our_source._replace_id] = get_info_for_file(filename, obj, origurl, our_source);
					}
					got_objs[our_source._replace_id] = { obj: obj, filename: filename };
					cb();
				};
				if (download_method === "jdownloader") {
					fill_filename(false);
					final_cb();
					return;
				}
				// todo: some kind of infoobj_to_requestobj function
				request_chunked({
					url: src,
					headers: obj.headers
				}, {
					onload: function(resp) {
						fill_filename(true);
						files[filename] = resp.data;
						final_cb();
					},
					onprogress: progresscb
				});
			};
			var process_gallery_els = function(els) {
				replace_images_full({
					images: els,
					all_els_ok: true,
					replace_image_func: function(options, our_source, cb, domain_processed_cb, progress_cb) {
						//console_log(our_source);
						var gffs_options = {
							automatic: true,
							multi: true,
							use_head: false,
							incomplete_image: false,
							incomplete_video: true, // hack to force request_chunked
							deny_nondirect_delivery: true,
							deny_cache: true,
							null_if_no_change: !settings.gallery_download_unchanged,
							use_last_pos: false,
							progress_cb: progress_cb
						};
						if (download_method === "jdownloader") {
							gffs_options.use_head = true;
							gffs_options.incomplete_image = true;
							gffs_options.incomplete_video = true;
						}
						get_final_from_source(our_source, gffs_options, function(source_imu, source, processing, data) {
							domain_processed_cb();
							if (!data) {
								if (typeof source === "undefined" && !settings.gallery_download_unchanged) {
									console_warn("Not downloading unchanged image", our_source);
								} else {
									// source is undefined for non-existing urls too
									console_error("Unable to download", source, our_source);
									if (settings.gallery_zip_add_info_file) {
										failed_infos.push(get_failed_info(our_source));
									}
								}
								return cb();
							} else {
								add_file(data, our_source, function(progobj) { }, cb);
							}
						});
					},
					finalcb: function(onprogress) {
						if ((download_method === "zip" && !Object.keys(files).length) ||
							!got_objs.length) {
							console_error("No files!");
							onprogress(1);
							return;
						}
						set_zip_filename(get_first_obj());
						filename = filename || "download.zip";
						var foldername = filename.replace(/\.zip$/i, "");
						var zip_foldername = null;
						if (settings.gallery_zip_add_tld) {
							zip_foldername = foldername;
						}
						if (settings.gallery_zip_add_info_file) {
							files["info.txt"] = get_info_file();
						}
						start_waiting();
						if (download_method === "jdownloader") {
							send_to_jdownloader(got_objs, foldername, function(ok) {
								onprogress(1);
								if (!ok) {
									cursor_not_allowed();
								} else {
									stop_waiting();
								}
							});
						} else {
							create_zip(files, zip_foldername, function(data) {
								onprogress(1);
								if (!data) {
									cursor_not_allowed();
									return;
								} else {
									stop_waiting();
								}
								do_blob_download(data, filename);
							}, onprogress);
						}
					},
					finalcb_progress: 0.1
				});
			};
			// fetching the gallery elements can take time if it's a large gallery, so let the user know we have received input
			// no, don't do this (yet)! it'll take longer to update the css of every element than it will to fetch the gallery elements (tested with 5000)
			//start_waiting();
			get_gallery_elements(function(els) {
				//stop_waiting();
				process_gallery_els(els);
			});
		};
		var generate_random_class = function(name) {
			return "imu-" + get_random_text(10) + "-" + name;
		};
		var highlightimgs_styleel = null;
		var highlightimgs_classname = generate_random_class("highlight");
		var create_highlight_styleel = function() {
			if (highlightimgs_styleel || !/^text\//.test(document.contentType))
				return;
			highlightimgs_styleel = document_createElement("style");
			document.documentElement.appendChild(highlightimgs_styleel);
			update_highlight_styleel();
		};
		var update_highlight_styleel = function() {
			create_highlight_styleel();
			if (highlightimgs_styleel) {
				highlightimgs_styleel.innerText = "." + highlightimgs_classname + "{" + get_styletag_styles(settings.highlightimgs_css) + "}";
			}
		};
		(function() {
			var oldfunc = settings_meta.highlightimgs_css.onupdate;
			settings_meta.highlightimgs_css.onupdate = function() {
				update_highlight_styleel();
				if (oldfunc)
					return oldfunc.apply(this, arguments);
			};
		})();
		var apply_highlight_style = function(target) {
			create_highlight_styleel();
			target.classList.add(highlightimgs_classname);
		};
		var remove_highlight_style = function(target) {
			target.classList.remove(highlightimgs_classname);
		};
		var check_highlightimgs_valid_image = function(el) {
			var src = get_img_src(el);
			if (!is_valid_src(src, is_video_el(el)) || (el.tagName === "A" && !looks_like_valid_link(src, el)))
				return false;
			return true;
		};
		var get_highlightimgs_valid_image = function(el) {
			// TODO: dynamic attribute name
			if (el.hasAttribute("data-imu-valid")) {
				return !!parse_boolean(el.getAttribute("data-imu-valid"));
			}
			var valid = check_highlightimgs_valid_image(el);
			el.setAttribute("data-imu-valid", valid + "");
			return valid;
		};
		var get_highlightimgs_supported_image = function(el) {
			// TODO: dynamic attribute name
			if (el.hasAttribute("data-imu-supported")) {
				return !!parse_boolean(el.getAttribute("data-imu-supported"));
			}
			var supported = check_highlightimgs_supported_image(el);
			el.setAttribute("data-imu-supported", supported + "");
			return supported;
		};
		var auto_highlighted_imgs = [];
		var highlight_images = function(options) {
			if (currenttab_is_image() && settings.mouseover_exclude_imagetab)
				return;
			if (!options) {
				options = {};
			}
			var images = options.images;
			if (images === void 0) {
				images = get_all_valid_els_link();
			}
			if (!images.length)
				return;
			for (var i = 0; i < images.length; i++) {
				if (!get_highlightimgs_valid_image(images[i]))
					continue;
				var supported = !settings.highlightimgs_onlysupported;
				if (settings.highlightimgs_onlysupported) {
					supported = get_highlightimgs_supported_image(images[i]);
				}
				if (!options.hoveronly) {
					if (supported) {
						if (options.is_auto && array_indexof(auto_highlighted_imgs, images[i]) < 0) {
							auto_highlighted_imgs.push(images[i]);
						}
						apply_highlight_style(images[i]);
					} else {
						remove_highlight_style(images[i]);
					}
				}
			}
		};
		(function() {
			var added = false;
			var id = null;
			var update_button = function() {
				if (settings.highlightimgs_enable) {
					if (!added) {
						id = register_menucommand("Highlight images", highlight_images);
						added = true;
					}
				} else {
					if (added) {
						unregister_menucommand(id);
						added = false;
					}
				}
			};
			update_button();
			var origfunc = settings_meta.highlightimgs_enable.onupdate;
			settings_meta.highlightimgs_enable.onupdate = function() {
				update_button();
				if (origfunc)
					return origfunc.apply(this, arguments);
			};
		})();
		var popup_mouse_head = function() {
			if (delay_handle_triggering)
				return false;
			var enabledisable_toggle = get_single_setting("mouseover_trigger_enabledisable_toggle");
			if (trigger_complete(settings.mouseover_trigger_prevent_key)) {
				if (enabledisable_toggle === "disable")
					return false;
			} else {
				if (enabledisable_toggle === "enable")
					return false;
			}
			popup_trigger_reason = "mouse";
			return true;
		};
		var image_mouseover = function(e) {
			if (currenttab_is_image() && settings.mouseover_exclude_imagetab)
				return;
			if (get_single_setting("highlightimgs_auto") === "hover" && get_highlightimgs_valid_image(e.target)) {
				var supported = !settings.highlightimgs_onlysupported;
				if (!supported) {
					supported = get_highlightimgs_supported_image(e.target);
				}
				if (supported) {
					if (array_indexof(auto_highlighted_imgs, e.target) < 0)
						auto_highlighted_imgs.push(e.target);
					apply_highlight_style(e.target);
				}
			}
			if (mouseover_mouse_enabled() && settings.mouseover_trigger_mouseover && !delay_handle && !should_exclude_imagetab()) {
				delay_el = e.target;
				update_mouse_from_event(e);
				delay_handle = setTimeout(function() {
					delay_el = null;
					if (delay_handle) {
						clearTimeout(delay_handle);
						delay_handle = null;
					}
					if (!popup_mouse_head())
						return;
					// TODO: make configurable
					if (false) {
						var source = find_source([e.target]);
						if (source && get_physical_popup_el(source.el) !== last_popup_el) {
							trigger_popup_with_source(source);
						}
					} else {
						trigger_popup();
					}
				}, delay * 1000);
			}
		};
		var image_mouseout = function(e) {
			if (get_single_setting("highlightimgs_auto") === "hover" && get_highlightimgs_valid_image(e.target)) {
				remove_highlight_style(e.target);
			}
			if (mouseover_mouse_enabled() && settings.mouseover_trigger_mouseover && delay_handle) {
				if (delay_el === e.target) {
					clearTimeout(delay_handle);
					delay_handle = null;
				}
			}
		};
		function on_new_images(images) {
			var highlight = get_single_setting("highlightimgs_auto");
			if (highlight === "always" || highlight === "hover")
				highlight_images({ images: images, hoveronly: highlight === "hover", is_auto: true });
			for (var i = 0; i < images.length; i++) {
				// apparently this isn't needed to ensure no duplicate event listeners?
				our_removeEventListener(images[i], "mouseover", image_mouseover);
				our_removeEventListener(images[i], "mouseout", image_mouseout);
				our_addEventListener(images[i], "mouseover", image_mouseover);
				our_addEventListener(images[i], "mouseout", image_mouseout);
			}
			if (settings.replaceimgs_auto)
				replace_images_full({ images: images, use_progressbar: false, use_elcache: true });
		}
		;
		(function() {
			if (is_suspended())
				return;
			// TODO: allow this to be automatically updated
			if (!host_filter(window.location.href))
				return;
			var observer;
			var observe_options = { childList: true, subtree: true, attributes: true };
			var new_mutationobserver = function() {
				return new MutationObserver(function(mutations, observer) {
					var images = [];
					var add_nodes = function(nodes) {
						for (var i = 0; i < nodes.length; i++) {
							if (is_img_pic_vid_link(nodes[i])) {
								images.push(nodes[i]);
							}
							if (nodes[i].children) {
								add_nodes(nodes[i].children);
							}
						}
					};
					for (var i = 0; i < mutations.length; i++) {
						var mutation = mutations[i];
						if (mutation.addedNodes) {
							add_nodes(mutation.addedNodes);
						}
						if (mutation.target && mutation.type === "attributes") {
							if (mutation.attributeName === "src" || mutation.attributeName === "href" || mutation.attributeName === "srcset") {
								add_nodes([mutation.target]);
							}
						}
					}
					if (images.length > 0) {
						on_new_images(images);
					}
				});
			};
			var observe = function() {
				if (is_suspended())
					return;
				on_new_images(get_all_valid_els_link());
				if (!observer)
					return;
				observer.observe(document, observe_options);
			};
			var remove_all_highlights = function() {
				for (var i = 0; i < auto_highlighted_imgs.length; i++) {
					remove_highlight_style(auto_highlighted_imgs[i]);
				}
				auto_highlighted_imgs = [];
			};
			var disconnect = function() {
				remove_all_highlights();
				if (!observer)
					return;
				observer.disconnect();
			};
			termination_hooks.push(disconnect);
			var needs_observer = function() {
				var highlight = get_single_setting("highlightimgs_auto");
				return highlight === "always" || highlight === "hover" || settings.replaceimgs_auto || (mouseover_mouse_enabled() && settings.mouseover_trigger_mouseover);
			};
			var create_mutationobserver = function() {
				try {
					// In case the browser doesn't support MutationObservers
					observer = new_mutationobserver();
				} catch (e) {
					console_warn(e);
				}
				if (needs_observer()) {
					observe();
				}
			};
			create_mutationobserver();
			var update_highlightimgs_func = function() {
				if (needs_observer()) {
					if (get_single_setting("highlightimgs_auto") !== "always") {
						remove_all_highlights();
					}
					observe();
				} else {
					disconnect();
				}
			};
			// replaceimgs_auto is intentionally not added here due to the warning
			var orig_highlightfunc = settings_meta.highlightimgs_auto.onupdate;
			settings_meta.highlightimgs_auto.onupdate = function() {
				if (orig_highlightfunc)
					orig_highlightfunc();
				update_highlightimgs_func();
			};
			var orig_imuenabledfunc = settings_meta.imu_enabled.onupdate;
			settings_meta.imu_enabled.onupdate = function() {
				if (orig_imuenabledfunc)
					orig_imuenabledfunc.apply(this, arguments);
				if (settings.imu_enabled) {
					update_highlightimgs_func();
				} else {
					disconnect();
				}
			};
		})();
		var get_popup_media_el = function() {
			var imgels = popups[0].getElementsByTagName("video");
			if (imgels.length === 0)
				imgels = popups[0].getElementsByTagName("img");
			if (imgels.length > 0)
				return imgels[0];
			else
				return null;
		};
		var get_popup_media_url = function() {
			var el = get_popup_media_el();
			if (el)
				return el.src;
			else
				return null;
		};
		var download_popup_image = function() {
			do_download(popup_obj, popup_obj.filename, popup_contentlength);
		};
		var download_popup_media = function() {
			if (popup_obj.media_info && popup_obj.media_info.delivery && settings.enable_stream_download) {
				start_waiting();
				get_download_urls_from_infoobj(popup_obj, function(urls) {
					if (!urls) {
						cursor_not_allowed();
						return;
					}
					//console_log("urls", urls);
					// todo: only request ffmpeg if necessary
					get_ffmpeg(function(ffmpeg) {
						if (!ffmpeg) {
							cursor_not_allowed();
							return;
						}
						stop_waiting();
						var progress_el = create_progress_el(true);
						var last_console_progress = 0;
						download_playlist_urls(popup_obj, urls, function(progobj) {
							var now = Date.now();
							if (now - last_console_progress > 50) {
								last_console_progress = now;
								var percent = format_number_decimal(progobj.percent * 100, 2);
								var loaded_bytes = get_bytes_unit(progobj.loaded);
								var total_bytes = get_bytes_unit(progobj.total);
								var accurate = progobj.total_accurate ? "" : "~";
								console_log(loaded_bytes + " / " + accurate + total_bytes + " (" + percent + "%)");
							}
							update_progress_el(progress_el, progobj.percent * 0.9, true);
						}, function(data) {
							//console_log("final data", data);
							ffmpeg_join(ffmpeg, data, function(percent) {
								update_progress_el(progress_el, 0.9 + (percent * 0.1), true);
							}, function(filename) {
								update_progress_el(progress_el, 1, true);
								//console_log(filename);
								var data = ffmpeg.FS("readFile", filename);
								new_blob(data, function(blob) {
									var out_ext = url_basename(filename, { split_ext: true })[1];
									var out_filename = url_basename(popup_obj.filename || "download", { split_ext: true, known_ext: true })[0] + "." + out_ext;
									do_blob_download(blob, out_filename, function() {
										ffmpeg.FS("unlink", filename);
									});
								});
							});
						});
					});
				});
			} else {
				download_popup_image();
			}
		};
		var get_popup_video = function() {
			var videoel = popups[0].getElementsByTagName("video");
			// TODO: rename this function to get_popup_stream
			if (!videoel || videoel.length === 0) {
				videoel = popups[0].getElementsByTagName("audio");
			}
			if (!videoel || videoel.length === 0) {
				return null;
			}
			return videoel[0];
		};
		var seek_popup_video = function(leftright, amount) {
			var timemul = leftright ? -1 : 1;
			if (typeof amount === "undefined")
				amount = settings.mouseover_video_seek_amount;
			var time = timemul * amount;
			var videoel = get_popup_video();
			if (!videoel)
				return;
			videoel.currentTime += time;
		};
		var framestep_popup_video = function(leftright) {
			var videoel = get_popup_video();
			if (!videoel)
				return;
			videoel.pause();
			seek_popup_video(leftright, 1.0 / settings.mouseover_video_framerate);
		};
		var popup_video_speed = function(downup) {
			var videoel = get_popup_video();
			if (!videoel)
				return;
			if (typeof downup !== "number") {
				var amount = settings.mouseover_video_speed_amount;
				if (downup === true)
					amount = -amount;
				videoel.playbackRate += amount;
			} else {
				videoel.playbackRate = downup;
			}
		};
		var popup_video_volume = function(downup) {
			var videoel = get_popup_video();
			if (!videoel)
				return;
			if (typeof downup !== "number") {
				var amount = settings.mouseover_video_volume_change_amt;
				if (downup === true)
					amount = -amount;
				var new_volume = videoel.volume + (amount / 100.);
				new_volume = Math_min(Math_max(new_volume, 0), 1);
				videoel.volume = new_volume;
			} else {
				videoel.volume = downup;
			}
		};
		var toggle_video_muted = function() {
			var videoel = get_popup_video();
			if (!videoel)
				return;
			videoel.muted = !videoel.muted;
		};
		var toggle_video_controls = function() {
			var videoel = get_popup_video();
			if (!videoel)
				return;
			if (videoel.getAttribute("controls") === "controls") {
				videoel.removeAttribute("controls");
			} else {
				videoel.setAttribute("controls", "controls");
			}
		};
		var play_video = function(el) {
			try {
				el.play();
			} catch (e) {
				console_warn("Unable to autoplay", el, e);
			}
		};
		var toggle_video_playing = function() {
			var videoel = get_popup_video();
			if (!videoel)
				return;
			if (videoel.paused) {
				play_video(videoel);
			} else {
				videoel.pause();
			}
		};
		var toggle_popup_ui = function() {
			popup_createui_func(true, "toggle");
		};
		var is_fullscreen = function() {
			return document.fullscreenElement !== null || document.fullscreen;
		};
		var is_popup_fullscreen = function() {
			return is_fullscreen() && popup_is_fullscreen;
		};
		var popup_set_fullscreen = function() {
			var media_el = get_popup_media_el();
			media_el.requestFullscreen().then(function(e) {
				popup_is_fullscreen = true;
			}, function(e) {
				console_error("Error loading fullscreen", e);
			});
		};
		var exit_fullscreen = function() {
			document.exitFullscreen();
			popup_is_fullscreen = false;
		};
		var popup_toggle_fullscreen = function() {
			if (!is_fullscreen()) {
				popup_set_fullscreen();
			} else {
				exit_fullscreen();
			}
		};
		var popup_active = function() {
			return popups_active && popup_el;
		};
		var can_use_hold_key = function() {
			if (!popups_active)
				return false;
			if (popup_trigger_reason !== "mouse") {
				var auto_close = settings.mouseover_auto_close_popup && settings.mouseover_auto_close_popup_time;
				var close_mouseout = get_close_need_mouseout();
				if (!auto_close && !close_mouseout)
					return false;
			}
			return settings.mouseover_use_hold_key;
		};
		var update_popup_hold = function() {
			if (!popups_active)
				return;
			var hold_zoom = get_single_setting("popup_hold_zoom");
			if (popup_update_zoom_func && hold_zoom !== "none") {
				if (popup_hold) {
					popup_update_zoom_func(hold_zoom);
				} else {
					popup_update_zoom_func("last");
				}
			}
			if (popup_update_pos_func && settings.mouseover_hold_position_center) {
				var newpos = popup_update_pos_func(mouseX, mouseY, true);
				popups[0].style.top = newpos[1] + "px";
				popups[0].style.left = newpos[0] + "px";
			}
			popup_hold_func();
		};
		var toggle_popup_hold = function() {
			popup_hold = !popup_hold;
			clear_resetpopup_timeout();
			if (!popup_hold && (can_close_popup[1] || settings.mouseover_hold_close_unhold)) {
				action_handler({ type: "resetpopups" });
			} else {
				update_popup_hold();
			}
		};
		var get_video_screenshot = function(video, cb) {
			var canvas = document_createElement("canvas");
			canvas.width = video.videoWidth;
			canvas.height = video.videoHeight;
			var context = canvas.getContext("2d");
			context.drawImage(video, 0, 0, canvas.width, canvas.height);
			var mime = "image/png";
			var screenshot_format = get_single_setting("popup_video_screenshot_format");
			if (screenshot_format === "jpg")
				mime = "image/jpeg";
			return cb(get_canvas_src(canvas, mime));
		};
		var screenshot_video = function() {
			var videoel = get_popup_video();
			if (!videoel)
				return;
			get_video_screenshot(videoel, function(data) {
				if (!data) {
					console_error("Unable to screenshot video");
					cursor_not_allowed();
					return;
				}
				var our_vars = deepcopy(popup_obj.format_vars);
				our_vars.is_screenshot = { usable: true };
				our_vars.ext = ".png";
				if (get_single_setting("popup_video_screenshot_format") === "jpg") {
					our_vars.ext = ".jpg";
				}
				our_vars.filename = our_vars.filename_noext + our_vars.ext;
				var screenshot_filename = get_filename_from_format(settings.filename_format, our_vars);
				do_download({
					url: data
				}, screenshot_filename);
			});
		};
		var action_handler = function(action) {
			if (_nir_debug_) {
				console_log("action_handler", action);
			}
			if (action.needs_popup && !popup_active())
				return;
			switch (action.type) {
				case "resetpopups":
					resetpopups();
					return true;
				case "replace_images":
					replace_images_full();
					return true;
				case "highlight_images":
					highlight_images();
					return true;
				case "custom_gallery":
					setup_custom_gallery();
					return true;
				case "trigger_popup":
					if (action.trigger === "keyboard") {
						popup_trigger_reason = "keyboard";
					}
					trigger_popup();
					return true;
				case "gallery_prev":
					trigger_gallery(-1);
					return true;
				case "gallery_next":
					trigger_gallery(1);
					return true;
				case "download":
					download_popup_media();
					return true;
				case "open_in_new_tab":
					open_in_tab_imu(popup_obj, action.background_tab);
					return true;
				case "rotate_left":
					rotate_gallery(-90);
					return true;
				case "rotate_right":
					rotate_gallery(90);
					return true;
				case "flip_horizontal":
					flip_gallery(false);
					return true;
				case "flip_vertical":
					flip_gallery(true);
					return true;
				case "zoom_in":
					popup_zoom_func("incremental", -1);
					return true;
				case "zoom_out":
					popup_zoom_func("incremental", 1);
					return true;
				case "zoom_full":
					popup_zoom_func("fitfull", -1);
					return true;
				case "zoom_fit":
					popup_zoom_func("fitfull", 1);
					return true;
				case "fullscreen":
					popup_toggle_fullscreen();
					return true;
				case "seek_left":
					seek_popup_video(true);
					return true;
				case "seek_right":
					seek_popup_video(false);
					return true;
				case "frame_left":
					framestep_popup_video(true);
					return true;
				case "frame_right":
					framestep_popup_video(false);
					return true;
				case "speed_down":
					popup_video_speed(true);
					return true;
				case "speed_up":
					popup_video_speed(false);
					return true;
				case "reset_speed":
					popup_video_speed(1);
					return true;
				case "volume_up":
					popup_video_volume(false);
					return true;
				case "volume_down":
					popup_video_volume(true);
					return true;
				case "toggle_mute":
					toggle_video_muted();
					return true;
				case "toggle_controls":
					toggle_video_controls();
					return true;
				case "toggle_play_pause":
					toggle_video_playing();
					return true;
				case "open_options":
					open_in_tab_imu({ url: get_options_page() }, false);
					return true;
				case "open_orig_page":
					if (popup_obj && popup_obj.extra && popup_obj.extra.page) {
						open_in_tab_imu({ url: popup_obj.extra.page }, false);
					} else {
						console_log("Unable to find original page for", popup_obj);
					}
					return true;
				case "hold":
					update_popup_hold();
					return true;
				case "toggle_hold":
					toggle_popup_hold();
					return true;
				case "toggle_ui":
					toggle_popup_ui();
					return true;
				case "copy_link":
					if (popup_obj && popup_obj.url) {
						clipboard_write_link(popup_obj.url, function(success) {
							if (!success)
								console_warn("Unable to write url to clipboard:", popup_obj.url);
						});
					} else {
						console_warn("Popup not open?");
					}
					return true;
				case "screenshot_video":
					screenshot_video();
					return true;
				case "download_gallery":
					download_album();
					return true;
			}
			return false;
		};
		var action_remote = function(actions) {
			// use can_use_remote instead of can_iframe_popout because this doesn't necessarily pop out of iframes
			if (can_use_remote()) {
				var recipient = "top";
				var has_mouse = true;
				if (!is_in_iframe) {
					recipient = mouse_frame_id;
					if (recipient === "top") {
						has_mouse = false;
						if (popup_el_remote) {
							recipient = popup_el_remote;
						} else {
							return;
						}
					}
				}
				//console_log(deepcopy(actions));
				for (var i = 0; i < actions.length; i++) {
					if (!has_mouse && actions[i].requires_mouse) {
						actions.splice(i, 1);
						i--;
					}
				}
				if (actions.length > 0) {
					remote_send_message(recipient, {
						type: "action",
						data: actions
					});
				}
			}
		};
		var inputels_cache = new IMUCache();
		var is_inputel = function(el) {
			if (el.tagName === "TEXTAREA")
				return true;
			if (el.tagName === "INPUT") {
				if (!el.hasAttribute("type") || el.getAttribute("type") === "text") {
					return true;
				}
			}
			do {
				if (el.hasAttribute("contenteditable")) {
					return true;
				}
			} while (el = el.parentElement);
			return false;
		};
		var update_contextmenu_pos = function(event) {
			mouseContextX = event.clientX;
			mouseContextY = event.clientY;
			mouseAbsContextX = event.pageX;
			mouseAbsContextY = event.pageY;
		};
		var do_event_return = function(event, retval) {
			if (retval === false) {
				try {
					event.preventDefault();
					event.stopImmediatePropagation();
					event.stopPropagation();
				} catch (e) { }
			}
			return retval;
		};
		// https://github.com/qsniyg/maxurl/issues/680
		// contextmenu and mousedown are both run for right click, same timeStamp
		var event_cache = new IMUCache();
		var get_event_cache_key = function(event) {
			var down = true;
			if (event.type === "mouseup" || event.type === "keyup")
				down = false;
			var keystrs = get_keystrs_map(event, down);
			var keystrs_arr = [];
			for (var key in keystrs) {
				keystrs_arr.push(key + ":" + keystrs[key]);
			}
			return down + " " + keystrs_arr.join(",") + " " + event.timeStamp;
		};
		var alt_keydown_cb = null;
		var keydown_cb = function(event) {
			// otherwise rebinding the trigger key will fail
			if (is_options_page)
				return;
			if (_nir_debug_) nir_debug("input", "keydown_cb", event);
			if (!mouseover_base_enabled())
				return;
			if (event.type === "wheel" && chord_is_only_wheel(current_chord))
				return;
			if (event.type === "keydown") {
				// thanks to lnp5131 on github: https://github.com/qsniyg/maxurl/issues/415#issuecomment-684847125
				// it seems that even keys like control will cause a repeat under certain configurations
				if (event.repeat)
					return;
				if (editing_text)
					return;
				if (settings.disable_keybind_when_editing && event.target) {
					var is_bad = inputels_cache.get(event.target);
					if (is_bad === void 0) {
						is_bad = is_inputel(event.target);
						inputels_cache.set(event.target, is_bad, 60);
					}
					if (is_bad === true) {
						return;
					}
				}
			}
			var ret = void 0;
			var actions = [];
			update_chord(event, true);
			var event_cache_key = get_event_cache_key(event);
			if (event_cache.has(event_cache_key)) {
				return do_event_return(event, event_cache.get(event_cache_key));
			}
			if (is_extension && settings.extension_contextmenu && event.type === "mousedown") {
				// https://github.com/qsniyg/maxurl/issues/679
				if (trigger_complete(["shift", "button2"])) {
					update_contextmenu_pos(event);
				}
			}
			if (alt_keydown_cb) {
				ret = alt_keydown_cb(event);
				if (ret === false)
					return do_event_return(event, ret);
			}
			if (settings.mouseover) {
				if (get_single_setting("mouseover_trigger_behavior") === "keyboard") {
					var triggers = [settings.mouseover_trigger_key];
					for (var i = 0; i < num_profiles; i++) {
						triggers.push(settings["mouseover_trigger_key_t" + (i + 2)]);
					}
					array_foreach(triggers, function(trigger, i) {
						if (!event_in_chord(event, trigger))
							return;
						if (trigger_complete(trigger) && !popups_active) {
							// clear timeout so that all/any close behavior works
							current_chord_timeout = {};
							if (!delay_handle) {
								actions.push({
									requires_mouse: true,
									type: "trigger_popup",
									trigger: "keyboard"
								});
								ret = false;
								release_ignore = trigger;
							}
							trigger_id = i ? (i + 1) : null;
							if (get_tprofile_setting("mouseover_open_behavior") !== "popup") {
								// especially relevant for new tab
								clear_chord();
							}
						}
						var close_behavior = get_close_behavior();
						if (close_behavior === "all" || (close_behavior === "any" && trigger_complete(trigger))) {
							can_close_popup[0] = false;
						}
					});
				}
			}
			if (settings.replaceimgs_enable_keybinding && trigger_complete(settings.replaceimgs_keybinding)) {
				actions.push({ type: "replace_images" });
				ret = false;
				release_ignore = settings.replaceimgs_keybinding;
			}
			if (settings.highlightimgs_enable_keybinding && trigger_complete(settings.highlightimgs_keybinding)) {
				actions.push({ type: "highlight_images" });
				ret = false;
				release_ignore = settings.highlightimgs_keybinding;
			}
			if (settings.customgallery_enable_keybinding && trigger_complete(settings.customgallery_keybinding)) {
				actions.push({ type: "custom_gallery" });
				ret = false;
				release_ignore = settings.customgallery_keybinding;
			}
			// don't run if another function above was already triggered (e.g. when close is bound to the same key as trigger)
			if (settings.mouseover && ret !== false) {
				var is_popup_active = popup_el_remote || (popup_active());
				var keybinds = [
					{
						key: settings.mouseover_close_key,
						action: { type: "resetpopups" }
					},
					{
						key: settings.mouseover_gallery_prev_key,
						action: { type: "gallery_prev" },
						requires: settings.mouseover_enable_gallery
					},
					{
						key: settings.mouseover_gallery_next_key,
						action: { type: "gallery_next" },
						requires: settings.mouseover_enable_gallery
					},
					{
						key: settings.mouseover_download_key,
						// Clear the chord because keyup might not be called due to the save dialog popup
						clear: true,
						action: { type: "download" }
					},
					{
						key: settings.mouseover_open_new_tab_key,
						// Clear the chord because opening in a new tab will not release the keys
						clear: true,
						action: { type: "open_in_new_tab" }
					},
					{
						key: settings.mouseover_open_bg_tab_key,
						action: { type: "open_in_new_tab", background_tab: true }
					},
					{
						key: settings.mouseover_copy_link_key,
						action: { type: "copy_link" },
						requires: settings.write_to_clipboard
					},
					{
						key: settings.mouseover_open_options_key,
						// Clear the chord because opening in a new tab will not release the keys
						clear: true,
						action: { type: "open_options" }
					},
					{
						key: settings.mouseover_open_orig_page_key,
						// Clear the chord because opening in a new tab will not release the keys
						clear: true,
						action: { type: "open_orig_page" }
					},
					{
						key: settings.mouseover_rotate_left_key,
						action: { type: "rotate_left" }
					},
					{
						key: settings.mouseover_rotate_right_key,
						action: { type: "rotate_right" }
					},
					{
						key: settings.mouseover_flip_horizontal_key,
						action: { type: "flip_horizontal" }
					},
					{
						key: settings.mouseover_flip_vertical_key,
						action: { type: "flip_vertical" }
					},
					{
						key: settings.mouseover_zoom_in_key,
						action: { type: "zoom_in" }
					},
					{
						key: settings.mouseover_zoom_out_key,
						action: { type: "zoom_out" }
					},
					{
						key: settings.mouseover_zoom_full_key,
						action: { type: "zoom_full" }
					},
					{
						key: settings.mouseover_zoom_fit_key,
						action: { type: "zoom_fit" }
					},
					{
						key: settings.mouseover_fullscreen_key,
						action: { type: "fullscreen" }
					},
					{
						key: settings.mouseover_video_seek_left_key,
						action: { type: "seek_left" }
					},
					{
						key: settings.mouseover_video_seek_right_key,
						action: { type: "seek_right" }
					},
					{
						key: settings.mouseover_video_frame_prev_key,
						action: { type: "frame_left" }
					},
					{
						key: settings.mouseover_video_frame_next_key,
						action: { type: "frame_right" }
					},
					{
						key: settings.mouseover_video_speed_down_key,
						action: { type: "speed_down" }
					},
					{
						key: settings.mouseover_video_speed_up_key,
						action: { type: "speed_up" }
					},
					{
						key: settings.mouseover_video_reset_speed_key,
						action: { type: "reset_speed" }
					},
					{
						key: settings.mouseover_video_volume_up_key,
						action: { type: "volume_up" }
					},
					{
						key: settings.mouseover_video_volume_down_key,
						action: { type: "volume_down" }
					},
					{
						key: settings.mouseover_video_mute_key,
						action: { type: "toggle_mute" }
					},
					{
						key: settings.mouseover_video_controls_key,
						action: { type: "toggle_controls" }
					},
					{
						key: settings.mouseover_video_playpause_key,
						action: { type: "toggle_play_pause" }
					},
					{
						key: settings.mouseover_video_screenshot_key,
						// Clear the chord because keyup might not be called due to the save dialog popup
						clear: true,
						action: { type: "screenshot_video" }
					},
					{
						key: settings.mouseover_ui_toggle_key,
						action: { type: "toggle_ui" }
					},
					{
						key: settings.mouseover_gallery_download_key,
						action: { type: "download_gallery" },
						// Clear the chord because keyup might not be called due to the save dialog popup
						clear: true
					},
					{
						key: settings.mouseover_hold_key,
						action: { type: "toggle_hold" }
					}
				];
				for (var i = 0; i < keybinds.length; i++) {
					if (keybinds[i].key && trigger_complete(keybinds[i].key)) {
						if ("requires" in keybinds[i]) {
							if (!keybinds[i].requires)
								continue;
						}
						var action = keybinds[i].action;
						action.needs_popup = true;
						actions.push(action);
						if (keybinds[i].clear)
							clear_chord();
						if (is_popup_active) {
							release_ignore = keybinds[i].key;
							ret = false;
						}
						break;
					}
				}
			}
			if (!release_ignore || !release_ignore.length) {
				release_ignore = [];
			} else {
				release_ignore = deepcopy(release_ignore);
			}
			if (actions && actions.length > 0) {
				clear_chord_wheel();
				for (var i = 0; i < actions.length; i++) {
					action_handler(actions[i]);
				}
				action_remote(actions);
			}
			if (ret === false) {
				event_cache.set(event_cache_key, ret, 5);
			}
			return do_event_return(event, ret);
		};
		var keyup_cb = function(event) {
			if (_nir_debug_) nir_debug("input", "keyup_cb", event);
			if (!mouseover_base_enabled())
				return;
			update_chord(event, false);
			if (!settings.mouseover)
				return;
			var ret = void 0;
			var current_trigger = settings.mouseover_trigger_key;
			if (trigger_id)
				current_trigger = settings["mouseover_trigger_key_t" + trigger_id];
			var condition = event_would_modify_chord(event, false, current_trigger);
			var close_behavior = get_close_behavior();
			if (condition && close_behavior === "all") {
				condition = !trigger_partially_complete(event, current_trigger);
			}
			var can_cancel = popups_active;
			if (!can_cancel) {
				if (settings.mouseover_cancel_popup_when_release ||
					// this probably makes the most sense (#417, thanks to lnp5131 on github for reporting)
					(settings.mouseover_close_need_mouseout && !can_close_popup[1])) {
					can_cancel = true;
				}
			}
			if (condition && close_behavior !== "esc" && popup_trigger_reason === "keyboard" && can_cancel) {
				if (!settings.mouseover_close_need_mouseout || can_close_popup[1]) {
					stop_waiting();
					resetpopups();
				} else {
					can_close_popup[0] = true;
				}
				return;
			}
			// 27 = esc
			if (event.which === 27) {
				if (delay_handle_triggering && popup_trigger_reason === "mouse" && !settings.mouseover_cancel_popup_with_esc)
					return;
				stop_waiting();
				resetpopups();
			}
			if (release_ignore.length > 0) {
				var map = get_keystrs_map(event, false);
				for (var key in map) {
					var index = array_indexof(release_ignore, key);
					if (index >= 0) {
						release_ignore.splice(index, 1);
						ret = false;
					}
				}
			}
			return do_event_return(event, ret);
		};
		function scrollLeft() {
			var doc = document.documentElement;
			var body = document.body;
			return (doc && doc.scrollLeft || body && body.scrollLeft || 0) -
				(doc && doc.clientLeft || body && body.clientLeft || 0);
		}
		function scrollTop() {
			var doc = document.documentElement;
			var body = document.body;
			return (doc && doc.scrollTop || body && body.scrollTop || 0) -
				(doc && doc.clientTop || body && body.clientTop || 0);
		}
		var get_move_with_cursor = function() {
			// don't require this for now, because esc can also be used to close the popup
			//var close_el_policy = get_single_setting("mouseover_close_el_policy");
			// maybe disable if popup position == center, and "move within page" is activated?
			return settings.mouseover_move_with_cursor && !popup_hold; // && close_el_policy === "thumbnail";
		};
		function do_popup_pan(popup, event, mouseX, mouseY) {
			var pan_behavior = get_single_setting("mouseover_pan_behavior");
			var move_with_cursor = get_move_with_cursor();
			if (pan_behavior === "drag" && (event.buttons === 0 || !dragstart) && !move_with_cursor)
				return;
			var viewport = get_viewport();
			var edge_buffer = 40;
			var border_thresh = 20;
			var min_move_amt = parse_int(settings.mouseover_drag_min);
			var moved = false;
			// lefttop: true = top, false = left
			var dodrag = function(lefttop) {
				var orig = parseInt(lefttop ? popup.style.top : popup.style.left);
				var mousepos = lefttop ? mouseY : mouseX;
				var dragoffset = lefttop ? dragoffsetY : dragoffsetX;
				var last = lefttop ? lastY : lastX;
				var current = mousepos - dragoffset;
				if (current !== orig) {
					if (dragged || Math_abs(current - orig) >= min_move_amt) {
						var newlast = current - (orig - last);
						if (lefttop) {
							lastY = newlast;
							popup.style.top = current + "px";
						} else {
							lastX = newlast;
							popup.style.left = current + "px";
						}
						dragged = true;
						moved = true;
					}
				}
			};
			var popup_clientrect = null;
			var popup_media_clientrect = null;
			var domovement = function(lefttop) {
				if (!popup_clientrect) {
					popup_clientrect = get_popup_client_rect();
					popup_media_clientrect = get_popup_media_client_rect();
				}
				// offset* is very slow, slower than setting top/left! 250ms vs 30ms after a while
				//var offsetD = lefttop ? popup.offsetHeight : popup.offsetWidth;
				// offsetD and mediaOffsetD can differ when rotating, because the popup's dimensions don't get updated
				var offsetD = lefttop ? popup_clientrect.height : popup_clientrect.width;
				var mediaOffsetD = lefttop ? popup_media_clientrect.height : popup_media_clientrect.width;
				// the popup is always in the middle, so if the media is rotated, adding the difference in offset allows the position to be accurate
				var offset_add = (mediaOffsetD - offsetD) / 2;
				// mediaOffsetD will usually be smaller than offsetD because of the border
				// if the popup isn't rotated (or 180), we prefer offsetD
				// a proper fix would be nice though, as this only improves the situation for unrotated, which creates inconsistent behavior when rotated
				if (Math_abs(offset_add) < border_thresh) {
					mediaOffsetD = offsetD;
					offset_add = 0;
				}
				var viewportD = lefttop ? viewport[1] : viewport[0];
				var mousepos = lefttop ? mouseY : mouseX;
				if (!settings.mouseover_movement_inverted)
					mousepos = viewportD - mousepos;
				if (mediaOffsetD > viewportD) {
					var mouse_edge = Math_min(Math_max((mousepos - edge_buffer), 0), viewportD - edge_buffer * 2);
					var percent = mouse_edge / (viewportD - (edge_buffer * 2));
					var newpos = (percent * (viewportD - mediaOffsetD - border_thresh * 2) + offset_add + border_thresh) + "px";
					if (lefttop)
						popup.style.top = newpos;
					else
						popup.style.left = newpos;
					moved = true;
				}
			};
			var update_pos_cache = null;
			var domovewith = function(lefttop) {
				var orig = parseInt(lefttop ? popup.style.top : popup.style.left);
				var mousepos = lefttop ? mouseY : mouseX;
				//var popupopen = lefttop ? popupOpenY : popupOpenX;
				var last = lefttop ? popupOpenLastY : popupOpenLastX;
				var current = mousepos - last + orig;
				if (settings.mouseover_move_within_page) {
					if (false) {
						var offsetD = lefttop ? popup.offsetHeight : popup.offsetWidth;
						var viewportD = lefttop ? viewport[1] : viewport[0];
						current = Math_max(current, border_thresh);
						if (current + offsetD > (viewportD - border_thresh)) {
							current = viewportD - border_thresh - offsetD;
						}
					} else if (popup_update_pos_func) {
						if (!update_pos_cache)
							update_pos_cache = popup_update_pos_func(mouseX, mouseY, false);
						current = update_pos_cache[lefttop ? 1 : 0];
					}
				}
				if (current === orig)
					return;
				var newlast = mousepos;
				if (lefttop) {
					popupOpenLastY = newlast;
					popup.style.top = current + "px";
				} else {
					popupOpenLastX = newlast;
					popup.style.left = current + "px";
				}
			};
			if (pan_behavior === "drag" && dragstart) {
				dodrag(false);
				dodrag(true);
			} else if (pan_behavior === "movement") {
				domovement(false);
				domovement(true);
			}
			if (move_with_cursor) {
				// make sure to fix this for remote (this is called at the top frame, but popup_el is remote)
				//var popup_el_rect = popup_el.getBoundingClientRect();
				var popup_el_rect = null;
				// don't check for now, maybe add this as an option later?
				if (true || in_clientrect(mouseX, mouseY, popup_el_rect)) {
					domovewith(false);
					domovewith(true);
				}
			}
			if (moved) {
				mouse_in_image_yet = false;
			}
		}
		var remote_handle_message = function(message, sender, respond) {
			if (_nir_debug_) {
				console_log("ON_REMOTE_MESSAGE", message, sender, respond);
			}
			if (message.type === "make_popup") {
				if (!is_in_iframe) {
					resetpopups();
					deserialize_img(message.data.data.data.img, function(el) {
						message.data.data.data.img = el;
						popup_el_remote = sender;
						popup_el = null;
						real_popup_el = null;
						//console_log("Making popup", message);
						makePopup(message.data.source_imu, message.data.src, message.data.processing, message.data.data);
					});
				}
			} else if (message.type === "count_gallery") {
				count_gallery(message.data.nextprev, message.data.max, message.data.is_counting, void 0, void 0, function(count) {
					respond(count);
				});
			} else if (message.type === "is_nextprev_valid") {
				is_nextprev_valid(message.data.nextprev, function(valid) {
					respond(valid);
				});
			} else if (message.type === "trigger_gallery") {
				trigger_gallery(message.data.dir, function(triggered) {
					respond(triggered);
				});
			} else if (message.type === "resetpopups") {
				resetpopups({
					from_remote: true
				});
			} else if (message.type === "mousemove") {
				// todo: offset iframe location
				mousemove_cb(message.data);
			} else if (message.type === "action") {
				for (var i = 0; i < message.data.length; i++) {
					message.data[i].remote_origin = sender;
					action_handler(message.data[i]);
				}
			} else if (message.type === "popup_open") {
				popup_el_remote = sender;
				last_popup_el = null;
			}
		};
		var handle_remote_event = function(message) {
			if (message.type === "remote") {
				var respond = nullfunc;
				if (message.response_id) {
					var response_id = message.response_id;
					respond = function(data) {
						remote_send_reply(message.from, response_id, data);
					};
				}
				if (message.from === current_frame_id || (message.to && current_frame_id !== message.to)) {
					return true;
				}
				remote_handle_message(message.data, message.from, respond);
				return true;
			} else if (message.type === "remote_reply") {
				if (message.response_id in remote_reply_ids) {
					var response_id = message.response_id;
					delete message.response_id;
					remote_reply_ids[response_id](message.data);
				}
				return true;
			}
			return false;
		};
		if (is_extension) {
			// TODO: move out of do_mouseover
			chrome.runtime.onMessage.addListener(function(message, sender, respond) {
				if (_nir_debug_) {
					console_log("chrome.runtime.onMessage", message);
				}
				if (message.type === "context_imu") {
					// https://github.com/qsniyg/maxurl/issues/517
					// TODO: also set mouse_frame_id in oncontextmenu
					if (mouse_frame_id !== current_frame_id)
						return;
					popup_trigger_reason = "contextmenu";
					trigger_popup({ is_contextmenu: true });
				} else if (message.type === "popupaction") {
					if (message.data.action === "replace_images") {
						replace_images_full();
					} else if (message.data.action === "highlight_images") {
						highlight_images();
					} else if (message.data.action in menucommands_map) {
						menucommands_map[message.data.action].func();
					}
				} else if (message.type === "remote" || message.type === "remote_reply") {
					handle_remote_event(message);
				} else if (message.type === "suspend") {
					set_terminated(true);
				} else if (message.type === "unsuspend") {
					set_terminated(false);
				} else {
					general_extension_message_handler(message, sender, respond);
				}
			});
		} else {
			our_addEventListener(get_window(), "message", function(event) {
				if (_nir_debug_) {
					console_log("window.onMessage", event);
				}
				if (!can_use_remote() || !event.data || typeof event.data !== "object" || !(imu_message_key in event.data))
					return;
				// TODO: update id_to_iframe with event.source (remember that event.source is a window object, not an iframe)
				handle_remote_event(event.data[imu_message_key]);
				event.preventDefault();
				event.stopPropagation();
				event.stopImmediatePropagation();
			}, {
				capture: true,
				passive: false
			});
		}
		var last_remote_mousemove = 0;
		var last_remote_mousemove_timer = null;
		var last_remote_mousemove_event = null;
		onload(function() {
			var eventlistener_opts = {
				capture: true,
				passive: false
			};
			our_addEventListener(document, 'keydown', keydown_cb, eventlistener_opts);
			our_addEventListener(document, 'mousedown', keydown_cb, eventlistener_opts);
			our_addEventListener(document, 'contextmenu', keydown_cb, eventlistener_opts);
			our_addEventListener(document.body, 'contextmenu', keydown_cb, eventlistener_opts);
			our_addEventListener(document, 'wheel', keydown_cb, eventlistener_opts);
			our_addEventListener(document, 'keyup', keyup_cb, eventlistener_opts);
			our_addEventListener(document, 'mouseup', keyup_cb, eventlistener_opts);
			our_addEventListener(document, 'contextmenu', update_contextmenu_pos);
			var wheel_cb = function(event) {
				if (settings.scroll_override_page && popups_active && popup_wheel_cb) {
					return popup_wheel_cb(event, true);
				}
			};
			our_addEventListener(document, "wheel", wheel_cb, { passive: false });
			// https://github.com/qsniyg/maxurl/issues/771
			// seems to be a bug in chrome. if both a "wheel" and a "mousewheel" (deprecated) event are set on document, it will not fire the mousewheel event
			if (host_domain_nosub === "bilibili.com" && navigator.userAgent.indexOf("Chrome/") >= 0) {
				our_addEventListener(document, "wheel", function(e) {
					var ev = document.createEvent("MouseEvents");
					ev.initEvent("mousewheel", true, true);
					//ev.originalEvent = e.originalEvent || e;
					ev.wheelDelta = e.wheelDelta;
					ev.detail = e.detail;
					ev.deltaMode = e.deltaMode;
					ev.target = e.target;
					ev.srcElement = e.srcElement;
					document.dispatchEvent(ev);
				});
			}
		});
		var update_mouse_from_event = function(event) {
			if (event.pageX === null && event.clientX !== null) {
				// commenting out because unused and sets global variables
				/*eventDoc = (event.target && event.target.ownerDocument) || document;
				doc = eventDoc.documentElement;
				body = eventDoc.body;*/
				event.pageX = event.clientX + scrollLeft();
				event.pageY = event.clientY + scrollTop();
			}
			if (can_use_remote()) {
				if (event.remote_info && event.remote_info.id !== current_frame_id) {
					var iframe = find_iframe_for_info(event.remote_info);
					if (!iframe) {
						return;
					}
					//console_log(iframe);
					var bb = get_bounding_client_rect(iframe);
					// fixme: should this be done?
					event.clientX += bb.left;
					event.clientY += bb.top;
					event.pageX += bb.left + window.scrollX;
					event.pageY += bb.top + window.scrollY;
				} else if (is_in_iframe) {
					// todo: add timeouts to avoid too much cpu usage
					last_remote_mousemove_event = event;
					var mindelta = 16;
					if (!settings.mouseover_use_remote) {
						mindelta = 300; // we don't need precise movements, all we need is to inform the top frame that the mouse is here
					}
					var current_time = Date.now();
					var timeout = mindelta - (current_time - last_remote_mousemove);
					if (timeout < 1)
						timeout = 1;
					if (!last_remote_mousemove_timer) {
						last_remote_mousemove_timer = setTimeout(function() {
							if (!("remote_info" in last_remote_mousemove_event)) {
								last_remote_mousemove_event.remote_info = get_frame_info();
							}
							last_remote_mousemove_timer = null;
							last_remote_mousemove = Date.now();
							remote_send_message("top", {
								type: "mousemove",
								data: serialize_event(last_remote_mousemove_event)
							});
						}, timeout);
					}
				}
				mouse_frame_id = event.remote_info ? event.remote_info.id : current_frame_id;
			}
			mouseX = event.clientX;
			mouseY = event.clientY;
			mouseAbsX = event.pageX;
			mouseAbsY = event.pageY;
		};
		var mousemove_cb = function(event) {
			mousepos_initialized = true;
			// https://stackoverflow.com/a/7790764
			event = event || window.event;
			update_mouse_from_event(event);
			if (waiting) {
				update_waiting();
			}
			if (popups_active) {
				do_popup_pan(popups[0], event, mouseX, mouseY);
			}
			var jitter_base = settings.mouseover_jitter_threshold;
			var do_mouse_close_kbd = popup_trigger_reason === "keyboard" && get_close_need_mouseout() && popups_active;
			var do_mouse_close_mouse = popup_trigger_reason === "mouse";
			if (do_mouse_close_kbd || do_mouse_close_mouse) {
				if (popups_active) {
					// FIXME: why was this not in if (popups_active)?
					// The reason for putting it here is that if the mouse moves (even within jitter thresh) after a single popup is open, it will cancel the popup request
					if (delay_handle) {
						clearTimeout(delay_handle);
						delay_handle = null;
						if (false && waiting)
							stop_waiting();
					}
					var jitter_threshx = 40;
					var jitter_threshy = jitter_threshx;
					//var img = popups[0].getElementsByTagName("img")[0];
					var img = get_popup_media_el();
					var imgmiddleX = null;
					var imgmiddleY = null;
					var in_img_jitter = false;
					if (img) {
						var rect = get_popup_media_client_rect();
						in_img_jitter = in_clientrect(mouseX, mouseY, rect, jitter_base);
						var w = rect.width;
						var h = rect.height;
						imgmiddleX = rect.x + rect.width / 2;
						imgmiddleY = rect.y + rect.height / 2;
						jitter_threshx = Math_max(jitter_threshx, w / 2);
						jitter_threshy = Math_max(jitter_threshy, h / 2);
						jitter_threshx += jitter_base;
						jitter_threshy += jitter_base;
						/*console_log(jitter_threshx, img.naturalWidth, w);
						console_log(jitter_threshy, img.naturalHeight, h);*/
						if (mouse_in_image_yet === false) {
							if (in_clientrect(mouseX, mouseY, rect)) {
								mouse_in_image_yet = true;
							}
						}
					}
					var do_mouse_reset = function() {
						if (popup_hold) {
							can_close_popup[1] = true;
						} else {
							resetpopups();
						}
					};
					var close_el_policy = get_single_setting("mouseover_close_el_policy");
					var close_on_leave_el = (close_el_policy === "thumbnail" || close_el_policy === "both") && popup_el && !popup_el_automatic;
					var outside_of_popup_el = false;
					var popup_el_hidden = false;
					// check if we should check if the mouse has left popup_el (the source/thumbnail that was popped up from, _not_ the element of the popup)
					if (close_on_leave_el) {
						var popup_el_rect = get_bounding_client_rect(popup_el);
						// check if the source element is visible
						if (popup_el_rect && popup_el_rect.width > 0 && popup_el_rect.height > 0) {
							var our_in_img_jitter = in_img_jitter;
							if (close_el_policy === "thumbnail")
								our_in_img_jitter = false; // if not "both", we don't care if the mouse is still in the popup, only if it has left the thumbnail
							if (!in_clientrect(mouseX, mouseY, popup_el_rect) && !our_in_img_jitter) {
								outside_of_popup_el = true;
								if (close_el_policy === "thumbnail") {
									return do_mouse_reset();
								}
							}
						} else {
							// the element must be hidden
							popup_el_hidden = true;
						}
					}
					can_close_popup[1] = false;
					if (mouse_in_image_yet && (!close_on_leave_el || outside_of_popup_el || popup_el_hidden)) {
						if (imgmiddleX && imgmiddleY &&
							(Math_abs(mouseX - imgmiddleX) > jitter_threshx ||
								Math_abs(mouseY - imgmiddleY) > jitter_threshy)) {
							//console_log(mouseX, imgmiddleX, jitter_threshx);
							//console_log(mouseY, imgmiddleY, jitter_threshy);
							do_mouse_reset();
						}
					} else if (close_on_leave_el) {
						if (outside_of_popup_el) {
							do_mouse_reset();
						}
					}
				} else if (do_mouse_close_mouse && delay_handle_triggering) {
					if (next_popup_el && settings.mouseover_cancel_popup_when_elout) {
						var popup_el_rect = get_bounding_client_rect(next_popup_el);
						if (!in_clientrect(mouseX, mouseY, popup_el_rect)) {
							resetpopups();
						}
					}
				}
			}
			if (mouseover_mouse_enabled()) {
				// FIXME: this is rather weird. Less CPU usage, but doesn't behave in the way one would expect
				if ((!popups_active || popup_el_automatic) && !should_exclude_imagetab()) {
					if (delay_handle && !settings.mouseover_trigger_mouseover) {
						var trigger_mouse_jitter_thresh = 10;
						if (Math_abs(mouseX - mouseDelayX) < trigger_mouse_jitter_thresh &&
							Math_abs(mouseY - mouseDelayY) < trigger_mouse_jitter_thresh)
							return;
						clearTimeout(delay_handle);
						delay_handle = null;
					}
					mouseDelayX = mouseX;
					mouseDelayY = mouseY;
					//mouse_in_image_yet = false;
					if (last_popup_el) {
						var popup_el_rect = get_bounding_client_rect(last_popup_el);
						if (!in_clientrect(mouseX, mouseY, popup_el_rect)) {
							last_popup_el = null;
						}
					}
					if (!settings.mouseover_trigger_mouseover) {
						delay_handle = setTimeout(function() {
							if (!popup_mouse_head())
								return;
							trigger_popup();
						}, delay * 1000);
					}
				}
			}
		};
		onload(function() { return our_addEventListener(document, 'mousemove', mousemove_cb); });
		(function() {
			register_menucommand("Report issue", github_issues_page);
		})();
	}
	// end do_mouseover
	function do_websitehome() {
		if (require_rules_failed)
			return;
		unsafeWindow["imu_variable"] = bigimage_recursive;
		unsafeWindow["imu_inject"] = 1;
		unsafeWindow["do_imu"] = function(url, cb) {
			return bigimage_recursive(url, {
				fill_object: true,
				do_request: do_request,
				cb: cb
			});
		};
		var orig_set_max = unsafeWindow["set_max"];
		unsafeWindow["set_max"] = function(obj) {
			if (!obj || !obj[0].url) {
				orig_set_max(obj);
				return;
			}
			var loop_url = function(obj, cb, options, lasturl) {
				check_image_get(obj, function(img, newurl) {
					var finalurl = newurl;
					if (!newurl && img && img.finalUrl) {
						finalurl = img.finalUrl;
					}
					if (!finalurl) {
						cb(img, newurl);
						return;
					}
					if (obj_indexOf(obj, finalurl) < 0 &&
						lasturl !== finalurl) {
						bigimage_recursive(finalurl, {
							fill_object: true,
							do_request: do_request,
							cb: function(obj) {
								check_image_unref(img);
								loop_url(obj, cb, options, finalurl);
							}
						});
					} else {
						cb(img, newurl, obj[obj_indexOf(obj, finalurl)]);
					}
				}, options);
			};
			if (settings.website_image) {
				loop_url(obj, function(img, url, obj) {
					if (!img) {
						orig_set_max("broken");
					} else {
						var newobj = obj;
						if (!newobj)
							newobj = { url: url };
						orig_set_max([newobj]);
						unsafeWindow["maximgel"].src = img.src;
					}
				}, { running: true });
			} else if (obj.can_head) {
				loop_url(obj, function(resp) {
					if (!resp) {
						orig_set_max("broken");
					} else {
						var newobj = obj;
						if (!newobj)
							newobj = { url: resp.finalUrl };
						orig_set_max([newobj]);
					}
				}, { running: true, head: true });
			} else {
				orig_set_max(obj);
			}
		};
	}
	var set_require_rules_failed_el = function(el) {
		if (!require_rules_failed)
			return false;
		el.style.color = "#ff3333";
		el.innerText = "Error: Rules cannot be loaded.\nPlease either try reinstalling the script, or ";
		var github_link = document.createElement("a");
		github_link.href = userscript_update_url;
		github_link.target = "_blank";
		github_link.innerText = "install the github version";
		el.appendChild(github_link);
		var reason_el = document.createElement("p");
		reason_el.innerText = "Error reason:";
		reason_el.style.color = "#000";
		reason_el.style.marginTop = "1em";
		reason_el.style.marginBottom = "1em";
		try {
			var error_message = document.createElement("pre");
			error_message.style.color = "#000";
			error_message.innerText = require_rules_failed.message;
			el.appendChild(reason_el);
			el.appendChild(error_message);
		} catch (e) {
			console_error(e);
		}
		return true;
	};
	var do_userscript_page = function(imgel, latest_version) {
		var status_container_el = document_createElement("div");
		status_container_el.style.marginBottom = "2em";
		var version_el = document_createElement("span");
		version_el.style.fontSize = "90%";
		version_el.style.fontWeight = 800;
		version_el.style.marginRight = "2em";
		var options_el;
		var version = null;
		try {
			version = gm_info.script.version;
		} catch (e) {
		}
		if (!set_require_rules_failed_el(version_el)) {
			version_el.innerText = "Installed";
			if (version !== null) {
				version_el.innerText += " (v" + version;
				if (latest_version) {
					var compared = version_compare(latest_version, version);
					if (compared === -1) {
						version_el.innerText += ", update available";
					}
				}
				version_el.innerText += ")";
			}
			options_el = document_createElement("a");
			options_el.innerText = "Options";
			options_el.style.background = "#0af";
			options_el.style.padding = "0.5em 1em";
			options_el.style.color = "white";
			options_el.style.display = "inline-block";
			options_el.style.textDecoration = "none";
			options_el.target = "_blank";
			options_el.href = "https://qsniyg.github.io/maxurl/options.html";
		}
		status_container_el.appendChild(version_el);
		if (!require_rules_failed)
			status_container_el.appendChild(options_el);
		imgel.parentElement.appendChild(status_container_el);
	};
	var do_greasyfork_page = function() {
		var imgel = document.querySelector("div.script-author-description > center > img[alt='Image Max URL']");
		// greasyfork redesign
		if (!imgel)
			imgel = document.querySelector("#additional-info > center > img[alt='Image Max URL']");
		if (!imgel)
			return;
		// make sure it's the same general layout
		if (imgel.parentElement.previousElementSibling ||
			imgel.parentElement.nextElementSibling.tagName !== "UL")
			return;
		var gf_version = null;
		var gf_version_el = document.querySelector("dd.script-show-version");
		if (gf_version_el) {
			gf_version = gf_version_el.innerText.replace(/^\s*|\s*$/, "");
		}
		do_userscript_page(imgel, gf_version);
	};
	var do_oujs_page = function() {
		var imgel = document.querySelector("div#user-content > p[align='center'] img[alt='Image Max URL']");
		if (!imgel)
			return;
		// make sure it's the same general layout
		if ((imgel.parentElement.previousElementSibling && imgel.parentElement.previousElementSibling.tagName !== "HR") ||
			imgel.parentElement.nextElementSibling.tagName !== "UL")
			return;
		var latest_version = null;
		var version_icon_el = document.querySelector("div.script-meta i.fa-history");
		if (version_icon_el) {
			var code_el = version_icon_el.parentElement.querySelector("code");
			if (code_el) {
				latest_version = code_el.innerText.replace(/[+].*/, "");
				if (!/^[0-9.]+$/.test(latest_version))
					latest_version = null;
			}
		}
		do_userscript_page(imgel, latest_version);
	};
	var parse_node_args = function(args_info) {
		var parsed = { _positional: [] };
		for (var i = 2; i < process.argv.length; i++) {
			var arg = process.argv[i];
			if (arg[0] !== '-') {
				parsed["_positional"].push(arg);
				continue;
			}
			if (arg === '--') {
				array_extend(parsed._positional, process.argv.slice(i + 1));
				break;
			}
			var shortarg = null;
			var longarg = null;
			var argval = null;
			if (arg[1] === '-') {
				longarg = arg.substr(2);
			} else {
				// TODO: support chained args (-abc == -a -b -c)
				shortarg = arg.substr(1);
			}
			var our_arg = null;
			for (var _i = 0, args_info_1 = args_info; _i < args_info_1.length; _i++) {
				var arg_info = args_info_1[_i];
				if (shortarg) {
					if (arg_info.short === shortarg) {
						our_arg = arg_info;
						break;
					}
				}
				if (longarg) {
					if (arg_info.long === longarg) {
						our_arg = arg_info;
						break;
					}
				}
			}
			if (!our_arg) {
				console.error("Unable to find argument:", process.argv[i]);
				return null;
			}
			if (our_arg.needs_arg) {
				i++;
				if (i >= process.argv.length) {
					console.error("Argument", process.argv[i - 1], "needs an argument");
					return null;
				}
				argval = process.argv[i];
			} else {
				argval = true;
			}
			parsed[our_arg.name] = argval;
		}
		return parsed;
	};
	var do_node_main = function() {
		var parsed = parse_node_args({});
		if (!parsed)
			return;
		if (!parsed._positional.length) {
			console.error("Usage:", process.argv[0], process.argv[1], "url");
			return;
		}
		var url = parsed._positional[0];
		bigimage_recursive(url, {
			fill_object: true,
			cb: function(obj) {
				console.log(JSON_stringify(obj, null, '\t'));
			}
		});
	};
	function start() {
		do_export();
		if (is_interactive) {
			if (is_maxurl_website || is_options_page) {
				onload(function() {
					update_dark_mode();
				});
			}
			if (is_options_page) {
				onload(function() {
					try {
						do_options();
					} catch (e) {
						console_error(e);
						var error_pre = document_createElement("pre");
						error_pre.style.fontFamily = "monospace";
						error_pre.style.margin = "1em";
						error_pre.innerText = get_crashlog_info() + "\n" + e.toString() + "\n" + e.stack;
						var error_div = document_createElement("div");
						var error_div_text = "Error loading options page, please report this to <a href='" + github_issues_page + "'>" + github_issues_page + "</a>, ";
						error_div_text += "and include the following information in the report:";
						error_div.innerHTML = error_div_text;
						error_div.appendChild(error_pre);
						document.body.innerHTML = error_div.outerHTML;
					}
				});
			}
			if (settings.imu_enabled) {
				if (settings.redirect) {
					do_redirect();
				}
				if (settings.website_inject_imu &&
					(window.location.href.match(/^https?:\/\/qsniyg\.github\.io\/+maxurl(\/+|\/+index\.html)?(?:[?#].*)?$/) ||
						window.location.href.match(/^file:\/\/.*\/maxurl\/site\/index\.html/))) {
					if (typeof (unsafeWindow) !== "undefined") {
						onload(function() {
							do_websitehome();
						});
					}
				}
			}
			if (is_userscript) {
				if (window.location.href.match(/^https?:\/\/(?:www\.)?greasyfork\.org\/+[^/]*\/+scripts\/+36662(?:-[^/]*)?(?:[?#].*)?$/)) {
					onload(function() {
						do_greasyfork_page();
					});
				} else if (window.location.href.match(/^https?:\/\/(?:www\.)?openuserjs\.org\/+scripts\/+qsniyg\/+Image_Max_URL(?:[?#].*)?$/)) {
					onload(function() {
						do_oujs_page();
					});
				}
			}
			do_mouseover();
			if (is_extension) {
				extension_send_message({
					type: "ready"
				});
			}
		} else if (is_extension_bg) {
			imu_userscript_message_sender = general_extension_message_handler;
		} else if (is_node_main) {
			do_node_main();
		}
	}
	if (_nir_debug_)
		console_log("Finished initial loading");
	do_config();
})();
// @license-end
