Camvault Mosaic Preview IMG Fix

Switches the preview (mosaic) image for the correct one on the page for video download..

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Camvault Mosaic Preview IMG Fix
// @namespace    https://github.com/cubedj/GM-Scripts
// @license      MIT
// @version      1.0.1
// @description  Switches the preview (mosaic) image for the correct one on the page for video download..
// @author       cubedj <[email protected]>
// @match        https://www.camvault.xyz/download/*
// @match        https://camvault.to/download/*
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';
    var string1 = document.getElementById("streamVideo").innerHTML;
	var regExToFind = /poster=\".+\"\ autoplay=/;
	var searchresult = regExToFind.exec(string1);
	var link = searchresult.toString().replace('poster="', '').replace('st.jpg" autoplay=', 'm.jpg');
 	// console.log(link);
	var unlinked = document.querySelectorAll("body > div.container > div.content-container > div.content-body.container-fluid > div:nth-child(5) > div > div > a");
		for (var myListIndex = 0; myListIndex < unlinked.length; myListIndex++) {
			var myListItem = unlinked[myListIndex];
		}
 	// console.log(myListItem);
	myListItem.href=link;
 	// console.log('final', myListItem);
	var unlinked2 = document.querySelectorAll("body > div.container > div.content-container > div.content-body.container-fluid > div:nth-child(5) > div > div > a > img");
		for (var myListIndex2 = 0; myListIndex2 < unlinked2.length; myListIndex2++) {
			var myListItem2 = unlinked2[myListIndex2];
		}
 	// console.log(myListItem2);
	myListItem2.src=link;
 	// console.log('final', myListItem2);
 	// console.log('final', link);
})();