rule 34 direct image links

gives direct links to images on rule 34.xxx, useful for mouseover addons

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         rule 34 direct image links
// @namespace    heck
// @version      0.1
// @description  gives direct links to images on rule 34.xxx, useful for mouseover addons
// @author       You
// @match        https://rule34.xxx/index.php?page=post&s=list*
// @exclude      https://rule34.xxx/index.php?page=post&s=view*
// @require      https://code.jquery.com/jquery-3.3.1.js
// @grant        none
// ==/UserScript==

Array.prototype.forEach.call($(".thumb"), function(el) {
    let newSpan = document.createElement("span");
    let currentLink = el.children[0].children[0].src;
    // newSpan.style.padding-bottom = "3px";
    let mp4Version = currentLink.replace("us.rule34", "nymp4.rule34").replace("thumbnails", "\/images").replace("thumbnail_", "").replace(/\.jpg\?\d+/, ".mp4");
    newSpan.innerHTML = `<br> <a href=${mp4Version}>mp4</a>`;
    el.children[0].after(newSpan);
});