Direct Image Link E621/926

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

Verze ze dne 19. 04. 2022. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name			Direct Image Link E621/926
// @version			2022.04.19
// @description:en	Images direct links ripper for pages with search results
// @description		Рипалка ссылок в результатах поиска, для менеджеров закачки
// @match			http*://e621.net/posts*
// @match			http*://e926.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 artic = document . querySelectorAll ( '.post-preview:not([data-tags~="male/male"]):not([data-tags~="gore"])' ),
	span = document . createElement ( 'span' ),
	mesto = document . querySelector ( '#top' ),
	x, src, md5, link, name, y,
	stop = [ '0004df48200873322269c8dc5b912dd8', 'INSERT YOUR BLOCKLIST HERE' , 'fffbe7eee9529d89dc11a797e78bf096' ];
	lever = 1; // 1 - pic source, 0 - file name

// 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++ ) {
		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 ( md5 != '' && stop [ y ] == md5 ) md5 = '';
		}
		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 = 'display: none';
		}
	}
	span . style = 'display: inline-block; column-gap: 3px; column-count: 7; font-size: 40%; line-height: .25em; max-height: 200px; overflow: auto;';
	mesto . appendChild ( span );
	selectblock ( span );
}