Direct Image Link E621/926 & e6AI

Рипалка ссылок в результатах поиска, для менеджеров закачки

2023-05-09 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name			Direct Image Link E621/926 & e6AI
// @name:en			Direct Image Link E621/926 & e6AI
// @version			2023.05.09.1
// @description:en		Images direct links ripper for pages with search results
// @description			Рипалка ссылок в результатах поиска, для менеджеров закачки
// @match			http*://e621.net/posts?*
// @match			http*://e621.net/pool*
// @match			http*://e926.net/posts?*
// @match			http*://e926.net/pool*
// @match			http*://e6ai.net/posts?*
// @author			Rainbow-Spike
// @namespace			https://greasyfork.org/users/7568
// @homepage			https://greasyfork.org/ru/users/7568-dr-yukon
// @icon			https://www.google.com/s2/favicons?domain=e621.net
// @grant			none
// @run-at			document-end
// ==/UserScript==

var lever = 1,								// 2 - post numbers, 1 - pic source, 0 - file name
	want = /[^_]pussy[^_]|tribadism/,				// wanted tags
	unwant = /censored|gore|male\/male|my_little_pony/, 		// unwanted tags
	wrong = 0.3,							// opacity of wrong tags
	have = 0.05,							// opacity of already haved media
	stop = [
'00000000000000000000000000000000', '00000000000000000000000000000000'
	],								// list of already haved MD5, INSERT YOUR'S!!
	artic = document . querySelectorAll ( '.post-preview' ),
	span = document . createElement ( 'span' ),
	mesto = document . querySelector ( '#top' ),
	x, tags, src, y, md5, name, link, num;

// SELECT
function selectblock ( name ) {
	var rng = document . createRange ( );
	rng . selectNode ( name );
	var sel = window . getSelection ( );
	sel . removeAllRanges ( );
	sel . addRange ( rng );
}

if ( artic != null ) {
	for ( x = 0; x < artic . length; x++ ) {
		tags = artic [ x ] . getAttribute ( 'data-tags' );
		if ( want . test ( tags ) && !unwant . test ( tags ) ) {
			src = artic [ x ] . getAttribute ( 'data-file-url' );
			md5 = src . split ( '/' );
			name = md5 [ md5 . length - 1 ];
			md5 = name . split ( '.' ) [ 0 ];
			for ( y = 0; y < stop . length; y++ ) {
				if ( stop [ y ] == md5 ) {
					artic [ x ] . style = 'opacity: ' + have;
					md5 = '';
					break;
				};
			};
			if ( lever == 2 ) {
				num = artic [ x ] . getAttribute ( 'data-id' );
				span . innerHTML += num + '<br>';
			} else if ( md5 != '' ) {
				span . innerHTML += '<a href = "' + src + '">' + ( lever ? src : name ) + ' </a><br>'; /* select link */

				link = document . createElement ( 'a' ); /* thumb link */
				link . setAttribute ( 'href', src );
				link . innerHTML = md5;
				link . style = 'word-wrap: anywhere;';
				artic [ x ] . appendChild ( link );
			}
		} else {
			artic [ x ] . style = 'opacity: ' + wrong;
		}
	}
	span . style = 'display: inline-block; column-gap: 3px; column-count: 7; font-size: 40%; line-height: .25em; max-height: 200px; overflow: auto;';
	if ( mesto != null ) mesto . appendChild ( span );
	selectblock ( span );
}