Greasy Fork is available in English.
Redirects Avistaz profiles to a specific URL
当前为
// ==UserScript==
// @name Redirect Avistaz Profile+
// @version 1.3
// @description Redirects Avistaz profiles to a specific URL
// @author ImprovedAVZ
// @match https://avistaz.to/profile/*/history
// @grant none
// @run-at document-end
// @namespace http://your-namespace.com
// ==/UserScript==
function AddedSeeding() {
document.querySelectorAll('tbody > tr').forEach(el =>
{
const cells = el.querySelectorAll('td');
const rawDownload = cells[6].querySelector('.text-red').textContent;
const Seededtimeraw = cells[10].querySelector('span').getAttribute('data-original-title');
const Seedingtimeraw = Seededtimeraw.match(/(\d+(\.\d+)?)/g);
const Seedingtime = Math.ceil(parseInt(Seedingtimeraw) / 60);
var Match = rawDownload.match(/(\d+(\.\d+)?)\s*(GB|MB|KB|TB|B)\b/i);
if (Match)
{
var DownloadedGB = parseFloat(Match[1]);
var unit = Match[3];
if (unit === "TB") DownloadedGB *= 1024;
if (unit === "GB") DownloadedGB = DownloadedGB;
if (unit === "MB") DownloadedGB /= 1024;
if (unit === "KB") DownloadedGB /= 1024 **2 ;
}
else Match = "0";
if (DownloadedGB === 0) var result = "0";
if (DownloadedGB <= 1) result = 72;
if (DownloadedGB > 1 && DownloadedGB < 50) result = 72 + 2 * DownloadedGB;
if (DownloadedGB > 50) result = 100 * Math.log(DownloadedGB) - 219.2023;
result = Math.ceil(result);
var difference = result - Seedingtime;
const appendedValue = Seedingtime;
const cellToModify = cells[10];
const textToDisplay = Seedingtime + 'h / ' + result + 'h';
cellToModify.textContent = textToDisplay;
Seedingtime > result ? cellToModify.style.color = 'green' : cellToModify.style.color = 'lightcoral';
});
}
AddedSeeding();
// Many thanks to the kind person that showed interest in this code!