KodieFiles Image Redirect

Links from a KodieFiles.nl gallery page directly to images.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name           KodieFiles Image Redirect
// @namespace      https://greasyfork.org/users/4390-seriousm
// @description    Links from a KodieFiles.nl gallery page directly to images.
// @match          http://www.kodiefiles.nl/*
// @version        0.4
// ==/UserScript==

// collect all links
var allLinks = document.getElementsByTagName('a')

// walk through the array

for(var i=0; i < allLinks.length; i++) {
if (allLinks[i].href.indexOf('images.kodiefiles.nl') > 0){
        allLinks[i].href = allLinks[i].href.replace('www.kodiefiles.nl','images.kodiefiles.nl');
	allLinks[i].href = allLinks[i].href.substr(0, allLinks[i].href.lastIndexOf('/') +1) + 'full' + allLinks[i].href.substr(allLinks[i].href.lastIndexOf('/'));
        allLinks[i].href = allLinks[i].href.replace('.html','.jpg');}
}

// that's it!