您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Descrição do script
当前为
// ==UserScript== // @name Filtro TikTok // @namespace URL única do autor // @version 1.0 // @description Descrição do script // @match http://www.tiktok.com/* // @match https://www.tiktok.com/* // @license MIT // ==/UserScript== // Add the following helper function to extract the number of interactions from a TikTok video URL function extractInteractions(url) { const match = url.match(/\/stat\/item\/(\d+)/); return match ? parseInt(match[1]) : 0; } const init = () => { // ... (Existing init function code) if (hostname === "www.tiktok.com") { window.addEventListener('mouseover', ({ target }) => { if (target.tagName == 'VIDEO') { const src = target.src; const parent = target.parentElement; const interactions = extractInteractions(src); // Get the number of interactions from the video URL // Define the threshold for the minimum number of interactions to show the download button const interactionsThreshold = 1000; // Adjust this value as desired if (interactions >= interactionsThreshold) { const link = src; const style = 'left: 10px; top: 10px;'; const cfg = { parent, link, style, target, name: lastItem(src.split('?')[0].split('/').filter(x => x)), position: 'beforeEnd', // Fixed typo in "position" }; createDom(cfg); } } }); } }; // ... (Existing script logic) // Código executável começa aqui (function() { init(); })();