Direct Image Link E621/926

Images direct links ripper for pages with search results

Stan na 12-04-2020. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name			Direct Image Link E621/926
// @version			2020.04.12
// @description		Images direct links ripper for pages with search results
// @description:ru	Рипалка ссылок в результатах поиска, для менеджеров закачки
// @include			http*://e621.net/*
// @include			http*://e926.net/*
// @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' ),
	span = document.createElement ( 'span' ),
	mesto = document.querySelector ( '#top' ),
	x, src, md5, link;

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

if ( artic != null ) {
	mesto.innerHTML += '<div align = "center"><strong>From <a href="https://comicslate.org" target="_blank">comicslate.org</a> with love.</strong></div>';
	for ( x = 0; x < artic.length; x++ ) {
		src = artic [ x ].getAttribute ( 'data-file-url' );
		md5 = src.split ( '/' );
		md5 = md5 [ md5.length - 1 ].split ( '.' )[0];
		link = document.createElement ( 'a' );
		link.setAttribute ( 'href', src );
		link.innerHTML = md5;
		link.style = 'word-wrap: anywhere;';
		artic [ x ].appendChild ( link );

		span.innerHTML += '<a href = "' + src + '">' + src + '</a><br>';
	}
	span.style = 'display: inline-block; column-gap: 5px; column-count: 3; max-height: 200px; overflow: auto;';
	mesto.appendChild ( span );
	selectblock ( span );
}