// ==UserScript== // @name 🚀 Dcard 資源採集 (V10.3 網址黑名單過濾版) // @namespace http://tampermonkey.net/ // @version 10.3 // @description 精準排除 r2limit2 等廣告域名圖,鎖定真正的使用者影片/原圖 // @author Gemini_Adaptive // @match https://www.dcard.tw/f/sex* // @match https://lurl.cc/* // @match https://myppt.cc/* // @grant window.close // @grant GM_openInTab // @require https://code.jquery.com/jquery-3.6.0.min.js // @downloadURL https://update.greasyfork.icu/scripts/576576/%F0%9F%9A%80%20Dcard%20%E8%B3%87%E6%BA%90%E6%8E%A1%E9%9B%86%20%28V103%20%E7%B6%B2%E5%9D%80%E9%BB%91%E5%90%8D%E5%96%AE%E9%81%8E%E6%BF%BE%E7%89%88%29.user.js // @updateURL https://update.greasyfork.icu/scripts/576576/%F0%9F%9A%80%20Dcard%20%E8%B3%87%E6%BA%90%E6%8E%A1%E9%9B%86%20%28V103%20%E7%B6%B2%E5%9D%80%E9%BB%91%E5%90%8D%E5%96%AE%E9%81%8E%E6%BF%BE%E7%89%88%29.meta.js // ==/UserScript== (function() { 'use strict'; const currentHost = window.location.host; function getMMDD(text) { const match = text.match(/(\d{4})[-/](\d{2})[-/](\d{2})/); return match ? match[2] + match[3] : null; } // ==================== [1] Dcard 頁面邏輯 ==================== if (currentHost.includes('dcard.tw')) { const $btn = $('').css({ position: 'fixed', bottom: '30px', right: '30px', zIndex: 99999, padding: '16px 28px', backgroundColor: '#006aa6', color: 'white', border: 'none', borderRadius: '50px', cursor: 'pointer', fontWeight: 'bold' }); $btn.on('click', () => { const links = [...new Set($('a[href*="lurl.cc"], a[href*="myppt.cc"]').map((i, el) => el.href).get())]; if (links.length === 0) return alert('找不到連結,請先載入留言!'); links.forEach((url, i) => { setTimeout(() => GM_openInTab(url, { active: false }), i * 1500); }); }); $('body').append($btn); } // ==================== [2] Lurl / Myppt 邏輯 ==================== if (currentHost.match(/lurl\.cc|myppt\.cc/)) { // 檢查解鎖狀態 const pageText = $('body').text(); if (pageText.includes('密碼錯誤') || pageText.includes('Password Error')) { $('body').prepend('
⚠️ 自動解鎖失敗:請手動輸入 ⚠️
'); return; } const dateText = $('.login_span').text(); const mmdd = getMMDD(dateText); // 自動解鎖 if (currentHost.includes('lurl.cc')) { const pathId = window.location.pathname.replace('/', ''); if (mmdd && !document.cookie.includes(`psc_${pathId}`)) { document.cookie = `psc_${pathId}=${mmdd}; path=/`; location.reload(); return; } } if (currentHost.includes('myppt.cc') && $('#pasahaicsword').length > 0 && mmdd) { $('#pasahaicsword').val(mmdd); $('button[type="submit"], #main_fjim60unBU').click(); return; } // --- 資源偵測與「黑名單」過濾 --- let scanCount = 0; const cleaner = setInterval(() => { scanCount++; const $video = $('video'); const $img = $('img').filter((i, el) => { const src = el.src.toLowerCase(); // 【黑名單過濾條件】 const isBlockedDomain = src.includes('r2limit2.lurl.cc'); // 你提供的廣告圖域名 const isLogo = src.includes('logo') || src.includes('icon') || src.includes('banner'); const isPlaceholder = el.naturalWidth === 800 || el.naturalWidth < 200; return !isBlockedDomain && !isLogo && !isPlaceholder; }); if ($video.length > 0 || $img.length > 0) { clearInterval(cleaner); const videoSrc = $video.find('source').attr('src') || $video.attr('src'); const imgSrcs = $img.map((i, el) => el.src).get(); if (videoSrc || imgSrcs.length > 0) { $('body').empty().css({ 'background-color': '#000', 'color': '#fff', 'text-align': 'center', 'padding': '20px' }); if (videoSrc) { const $newVid = $('