// ==UserScript== // @name SOOP 리캡 // @license MIT // @namespace http://tampermonkey.net/ // @version 2.4 // @description 끼리 // @author 헤슷 // @match https://www.sooplive.com/* // @match https://play.sooplive.com/* // @match https://broadstatistic.sooplive.com/* // @connect sooplive.com // @connect sch.sooplive.com // @connect res.sooplive.com // @connect afevent2.sooplive.com // @grant GM_xmlhttpRequest // @grant GM_addStyle // @sandbox JavaScript // @require https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.js // @require https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js // @downloadURL https://update.greasyfork.icu/scripts/562690/SOOP%20%EB%A6%AC%EC%BA%A1.user.js // @updateURL https://update.greasyfork.icu/scripts/562690/SOOP%20%EB%A6%AC%EC%BA%A1.meta.js // ==/UserScript== (function () { 'use strict'; const CONFIG = { DEFAULT_BG: "https://i.ibb.co/Z6BXDfRH/20260112-235411-1.png", NO_PROFILE_IMG: "https://res.sooplive.com/images/common/thumb_profile.gif", MAX_ITEMS: 40 }; const Endpoints = { SEARCH: 'https://sch.sooplive.com/api.php', ANALYTICS: 'https://broadstatistic.sooplive.com/api/watch_statistic.php', USER: 'https://afevent2.sooplive.com/api/get_private_info.php' }; const MemoryBank = { imgBuffer: new Map(), bjLogoUrl: new Map(), apiData: new Map() }; const AppContext = { uid: localStorage.getItem('sr_uid') || "", activeYear: new Date().getFullYear(), activeMonth: new Date().getMonth() + 1, skinMode: localStorage.getItem('sr_skin_mode') || 'A', chartRef: null, heatmapChartRef: null, bgBlob: null, resizeCleanup: null }; const ThemeColors = { "Challenger": "#FFD700", "Grandmaster": "#ff4e4e", "Master": "#be8bff", "Diamond": "#57d5ff", "Emerald": "#2ecc71", "Platinum": "#3498db", "Gold": "#f1c40f", "Silver": "#bdc3c7", "Bronze": "#cd7f32" }; function convertTimeToSec(timeStr) { if (!timeStr || typeof timeStr !== 'string') return 0; const parts = timeStr.split(':').map(Number); while (parts.length < 3) parts.unshift(0); return (parts[0] * 3600) + (parts[1] * 60) + parts[2]; } async function fetchImageBlob(targetUrl) { const url = targetUrl || CONFIG.NO_PROFILE_IMG; if (MemoryBank.imgBuffer.has(url)) { return MemoryBank.imgBuffer.get(url); } return new Promise((resolve) => { GM_xmlhttpRequest({ method: "GET", url: url, responseType: "arraybuffer", timeout: 5000, onload: (response) => { const reader = new FileReader(); reader.onloadend = () => { MemoryBank.imgBuffer.set(url, reader.result); resolve(reader.result); }; reader.readAsDataURL(new Blob([response.response], { type: 'image/png' })); }, onerror: () => resolve(CONFIG.NO_PROFILE_IMG), ontimeout: () => resolve(CONFIG.NO_PROFILE_IMG) }); }); } function findStreamerImage(nickname) { if (MemoryBank.bjLogoUrl.has(nickname)) return Promise.resolve(MemoryBank.bjLogoUrl.get(nickname)); return new Promise((resolve) => { GM_xmlhttpRequest({ method: "GET", url: `${Endpoints.SEARCH}?m=searchHistory&service=list&d=${encodeURIComponent(nickname)}`, onload: (response) => { try { const parsed = JSON.parse(response.responseText); const match = parsed?.suggest_bj?.find(item => item.user_nick === nickname); const logo = match ? match.station_logo : CONFIG.NO_PROFILE_IMG; MemoryBank.bjLogoUrl.set(nickname, logo); resolve(logo); } catch { resolve(CONFIG.NO_PROFILE_IMG); } }, onerror: () => resolve(CONFIG.NO_PROFILE_IMG) }); }); } function getThemeColor(points) { if (points >= 7000) return ThemeColors["Challenger"]; if (points >= 5500) return ThemeColors["Grandmaster"]; if (points >= 3500) return ThemeColors["Master"]; if (points >= 1500) return ThemeColors["Diamond"]; if (points >= 900) return ThemeColors["Emerald"]; if (points >= 500) return ThemeColors["Platinum"]; if (points >= 300) return ThemeColors["Gold"]; if (points >= 150) return ThemeColors["Silver"]; return ThemeColors["Bronze"]; } function requestStats(uid, sDate, eDate, moduleName) { const key = JSON.stringify([uid, sDate, eDate, moduleName]); if (MemoryBank.apiData.has(key)) return Promise.resolve(MemoryBank.apiData.get(key)); return new Promise((resolve) => { const formData = `szModule=${moduleName}&szMethod=watch&szStartDate=${sDate}&szEndDate=${eDate}&nPage=1&szId=${uid}`; GM_xmlhttpRequest({ method: "POST", url: Endpoints.ANALYTICS, data: formData, headers: { "Content-Type": "application/x-www-form-urlencoded" }, onload: (response) => { try { const json = JSON.parse(response.responseText); const result = json.data || null; MemoryBank.apiData.set(key, result); resolve(result); } catch { resolve(null); } }, onerror: () => resolve(null) }); }); } function evaluateAchievements(metrics) { const list = []; const { totalHrs, attendance, dawnRate, vodRate, favRate, streamerCnt, weekendRate } = metrics; if (totalHrs >= 500) list.push({ icon: "🌌", title: "SOOP의 신", desc: `${totalHrs.toFixed(0)}h 시청`, sub: "월 500h 이상", color: "#FFD700" }); else if (totalHrs >= 300) list.push({ icon: "👑", title: "SOOP 성주", desc: `${totalHrs.toFixed(0)}h 시청`, sub: "월 300h 이상", color: "#ff4e4e" }); else if (totalHrs >= 150) list.push({ icon: "💎", title: "숲의 지배자", desc: `${totalHrs.toFixed(0)}h 시청`, sub: "월 150h 이상", color: "#be8bff" }); else if (totalHrs >= 80) list.push({ icon: "🥇", title: "프로 시청러", desc: `${totalHrs.toFixed(0)}h 시청`, sub: "월 80h 이상", color: "#57d5ff" }); else if (totalHrs >= 30) list.push({ icon: "🥉", title: "루키 시청자", desc: `${totalHrs.toFixed(0)}h 시청`, sub: "월 30h 이상", color: "#3498db" }); else list.push({ icon: "🌱", title: "새싹 와쳐", desc: `${totalHrs.toFixed(1)}h 시청`, sub: "첫 발걸음", color: "#2ecc71" }); if (attendance >= 30) list.push({ icon: "🛡️", title: "전설의 수호자", desc: `${attendance}일 출석`, sub: "개근 달성", color: "#FFD700" }); else if (attendance >= 25) list.push({ icon: "📅", title: "개근의 신", desc: `${attendance}일 출석`, sub: "25일 이상", color: "#f1c40f" }); else if (attendance >= 15) list.push({ icon: "🏃", title: "성실한 발걸음", desc: `${attendance}일 출석`, sub: "15일 이상", color: "#bdc3c7" }); if (dawnRate > 0.5) list.push({ icon: "🦇", title: "심야의 박쥐", desc: `새벽 ${(dawnRate*100).toFixed(0)}%`, sub: "새벽 50% 이상", color: "#6c63ff" }); else if (dawnRate > 0.2) list.push({ icon: "🌙", title: "올빼미 수호자", desc: `새벽 ${(dawnRate*100).toFixed(0)}%`, sub: "새벽 20% 이상", color: "#a29bfe" }); if (vodRate > 2.0) list.push({ icon: "🍿", title: "VOD 광인", desc: `VOD ${vodRate.toFixed(1)}배`, sub: "다시보기 위주", color: "#e17055" }); else if (totalHrs > 20 && vodRate < 0.1) list.push({ icon: "📡", title: "생방 사수단", desc: "VOD 거의 0%", sub: "라이브 올인", color: "#00c6ff" }); if (favRate > 0.6) list.push({ icon: "🧡", title: "일편단심", desc: `최애 ${(favRate*100).toFixed(0)}%`, sub: "한 방송 집중", color: "#fd79a8" }); if (streamerCnt >= 25) list.push({ icon: "🌍", title: "박애주의자", desc: `${streamerCnt}명 시청`, sub: "다채로운 취향", color: "#00b894" }); if (weekendRate > 0.3) list.push({ icon: "🔥", title: "주말의 전사", desc: `주말 ${(weekendRate*100).toFixed(0)}%`, sub: "주말 집중 시청", color: "#e84393" }); return list; } // 친구와 대화하는 듯한 편안한 반말로 변경된 코멘트 function createFeedbackString(m) { const { totalHrs, attendance, dawnRate, favRate, weekendRate, topName } = m; const parts = []; parts.push(`이번 달에는 총 ${totalHrs.toFixed(1)}시간 방송을 봤어.`); if (topName && topName !== '-') { const favPct = (favRate * 100).toFixed(0); parts.push(`그중에서 ${favPct}%는 ${topName} 방송을 챙겨봤네.`); } if (dawnRate >= 0.5) { parts.push(`주로 다들 자는 새벽 시간에 많이 봤구나.`); } else if (dawnRate >= 0.25) { parts.push(`늦은 밤부터 새벽까지 방송을 즐겨 보는 편이야.`); } else if (weekendRate >= 0.45) { parts.push(`평일보다는 주말에 몰아서 집중적으로 봤네.`); } else { parts.push(`시간이나 요일에 안 치우치고 골고루 잘 챙겨봤어.`); } parts.push(`이번 달 출석은 총 ${attendance}일이야.`); return parts.join(' '); } GM_addStyle(` @import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@400;600;700;800;900&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;700&display=swap'); #sp-launch-btn { position: fixed; z-index: 10000; padding: 16px 28px; background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%); color: white; border: none; border-radius: 15px; cursor: move; font-family: 'Pretendard'; font-weight: 800; box-shadow: 0 5px 15px rgba(0, 114, 255, 0.4); transition: 0.3s; } #sp-launch-btn.sp-invisible { opacity: 0; visibility: hidden; pointer-events: none; } #sp-modal-layer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(5, 5, 10, 0.95); z-index: 100001; display: block; overflow-y: auto; padding: 50px 0; box-sizing: border-box; } .sp-dashboard-container { background: #0a0a0f; color: #fff; width: 1350px !important; border-radius: 45px; margin: 0 auto; border: 1px solid rgba(255,255,255,0.1); min-height: 1000px; font-family: 'Pretendard'; overflow: visible; position: relative; display: flex; flex-direction: column; } .sp-header { border-radius: 45px 45px 0 0; overflow: hidden; position: relative; background-size: cover; background-position: center; flex-shrink: 0; background-color: transparent; } #sp-particles { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; } .sp-header-inner { position: relative; z-index: 2; background: linear-gradient(to bottom, rgba(10,10,15,0) 0%, rgba(10,10,15,0.4) 40%, #0a0a0f 95%, #0a0a0f 100%); padding: 320px 60px 20px 60px; } .sp-body { background: #0a0a0f; padding: 20px 60px 60px 60px; border-radius: 0 0 45px 45px; flex-grow: 1; display: flex; flex-direction: column; } .sp-stat-grid { display: grid !important; grid-template-columns: repeat(4, 1fr) !important; gap: 25px; width: 100%; margin-top: 20px; } .sp-card { background: rgba(255,255,255,0.05); padding: 25px; border-radius: 32px; border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 15px; position: relative; overflow: hidden; flex-direction: row; } .sp-card.hidden-mode { background: #000 !important; border: 1px dashed rgba(255,255,255,0.2); } .sp-card.hidden-mode > *:not(.sp-toggle-btn) { visibility: hidden !important; opacity: 0 !important; } .sp-card.hidden-mode::after { content: "SECRET"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-weight: 900; color: #333; font-size: 14px; letter-spacing: 2px; } .sp-saving .sp-toggle-btn { display: none !important; } .sp-toggle-btn { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.1); border: none; color: #fff; border-radius: 5px; font-size: 10px; padding: 2px 6px; cursor: pointer; z-index: 20; font-weight: 800; } .sp-card-img { width: 70px; height: 70px; border-radius: 20px; border: 2px solid #00c6ff; object-fit: cover; flex-shrink: 0; } .sp-list-container { display: flex; flex-direction: column; gap: 8px; height: auto; overflow: visible; } .sp-list-item { display: flex; align-items: center; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 10px 15px; cursor: pointer; } .sp-list-item:hover { background: rgba(255,255,255,0.08); border-color: var(--rank-color); } .sp-idx-badge { font-size: 16px; font-weight: 800; color: #666; width: 24px; text-align: center; margin-right: 12px; font-style: italic; } .sp-idx-badge.top3 { color: var(--rank-color); text-shadow: 0 0 5px var(--rank-color); font-size: 20px; font-weight: 900; } .sp-list-img { width: 42px; height: 42px; border-radius: 10px; background: #222; margin-right: 15px; border: 1px solid rgba(255,255,255,0.1); object-fit: cover; } .sp-list-content { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 5px; } .sp-list-bar { width: 100%; height: 5px; background: rgba(255,255,255,0.1); border-radius: 10px; overflow: hidden; } .sp-list-fill { height: 100%; background: var(--rank-color); border-radius: 10px; } .sp-row-value { font-size: 13px; font-weight: 700; color: #ccc; margin-left: 15px; min-width: 50px; text-align: right; } .sp-layout-grid { display: grid !important; grid-template-columns: 380px 1fr 1fr !important; gap: 25px !important; align-items: start; } .sp-panel { background: rgba(255,255,255,0.02); padding: 45px; border-radius: 40px; border: 1px solid rgba(255,255,255,0.06); box-sizing: border-box; display: flex; flex-direction: column; gap: 50px; } .sp-badge-area { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 50px; min-height: 70px; } .sp-badge { display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.09); border-radius: 22px; padding: 14px 22px 14px 16px; position: relative; cursor: default; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; } .sp-badge:hover { transform: translateY(-2px); border-color: var(--badge-color, #ffd700); box-shadow: 0 4px 20px color-mix(in srgb, var(--badge-color, #ffd700) 20%, transparent); } .sp-badge-icon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; background: color-mix(in srgb, var(--badge-color, #ffd700) 15%, transparent); } .sp-badge-body { display: flex; flex-direction: column; gap: 1px; } .sp-badge-title { font-size: 15px; font-weight: 900; color: #fff; letter-spacing: -0.2px; line-height: 1.2; } .sp-badge-desc { font-size: 13px; font-weight: 800; color: var(--badge-color, #ffd700); line-height: 1.2; margin-top: 2px; } .sp-badge-sub { font-size: 11px; color: #888; font-weight: 600; line-height: 1.2; margin-top: 1px; } .sp-tooltip { position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); background: #111; color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; z-index: 1000; border: 1px solid rgba(255,255,255,0.15); pointer-events: none; opacity: 0; transition: 0.2s; visibility: hidden; } .sp-badge:hover .sp-tooltip { opacity: 1; visibility: visible; bottom: 115%; } .sp-exit { position: absolute; top: 40px; right: 40px; background: rgba(255,255,255,0.2); border: none; color: #fff; width: 55px; height: 55px; border-radius: 50%; cursor: pointer; font-size: 24px; z-index: 100; transition: 0.2s; } .sp-exit:hover { background: var(--rank-color); color: #000; transform: rotate(90deg); } .sp-select-wrap { position: absolute; top: 45px; left: 45px; display: flex; align-items: center; gap: 10px; z-index: 200; } .sp-select { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); color: #fff; padding: 10px 25px; border-radius: 12px; font-size: 18px; font-weight: 800; cursor: pointer; outline: none; } .sp-select option { background: #1a1a2e; color: #fff; } .sp-msg-box { background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.08); border-radius: 20px; margin-bottom: 40px; padding: 24px 30px; display: flex; align-items: flex-start; gap: 18px; min-height: 70px; } .sp-msg-text-wrap { display: block; line-height: 1.7; font-size: 16px; color: #ddd; font-weight: 500; word-break: keep-all; letter-spacing: -0.3px; } .sp-msg-text-wrap strong { color: var(--rank-color, #00c6ff); font-weight: 900; } .sp-loading { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); border-radius: 45px; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 20px; font-weight: 900; font-size: 20px; z-index: 100; } .sp-spinner { width: 48px; height: 48px; border: 4px solid rgba(255,255,255,0.1); border-top-color: #00c6ff; border-radius: 50%; animation: sp-spin 0.8s linear infinite; } @keyframes sp-spin { to { transform: rotate(360deg); } } .sr-toolbar { margin-top: 60px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 35px; width: 100%; } .sr-opt-group { position: relative; display: flex; align-items: center; gap: 10px; } .sp-ctx-menu { position: absolute; bottom: 125%; left: 0; background: #15151a; border: 1px solid rgba(255,255,255,0.2); border-radius: 18px; padding: 12px; display: none; flex-direction: column; gap: 8px; width: 220px; z-index: 2000; } .sp-ctx-menu.active { display: flex; } .sp-ctx-item { background: transparent; border: none; color: #ccc; padding: 12px 15px; text-align: left; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; } .sp-ctx-item:hover { background: rgba(255,255,255,0.1); color: #fff; } .sp-tool-btn { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); padding: 14px 24px; border-radius: 20px; font-weight: 800; cursor: pointer; font-size: 16px; display: flex; align-items: center; gap: 8px; } .sp-tool-btn:hover { background: rgba(255,255,255,0.2); } .sp-save-btn { background: #fff; color: #000; border: none; padding: 16px 50px; border-radius: 22px; font-size: 18px; font-weight: 900; cursor: pointer; transition: 0.3s; } .sp-save-btn:disabled { background: #555; color: #888; cursor: not-allowed; } .sp-link-btn { background-image: url('https://i.ibb.co/XkJsTqHc/image.jpg'); background-size: cover; background-position: center; color: #fff; border: 2px solid rgba(255,255,255,0.2); padding: 16px 30px; border-radius: 22px; font-size: 18px; font-weight: 900; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; font-family: 'Pretendard'; position: relative; overflow: hidden; text-shadow: 0 2px 4px rgba(0,0,0,0.5); } #sp-upload-input { display: none; } .sp-anim-item { opacity: 1; } .sp-anim-show { opacity: 1; } .sp-cal-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; text-align: center; margin-bottom: 15px; font-size: 14px; font-weight: 900; color: #666; } .sp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; width: 100%; } .sp-cal-day { aspect-ratio: 1/1; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; background: rgba(255,255,255,0.03); color: rgba(255,255,255,0.08); } .sp-cal-day.active { background: linear-gradient(135deg, #00c6ff, #0072ff); color: #fff !important; box-shadow: 0 5px 15px rgba(0, 114, 255, 0.4); } .sp-cat-list { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; } .sp-cat-item { background: rgba(255,255,255,0.05); padding: 10px 18px; border-radius: 18px; display: flex; align-items: center; gap: 15px; border: 1px solid rgba(255,255,255,0.1); } .sp-cat-idx { font-weight: 900; color: #00c6ff; width: 20px; font-size: 16px; } .sp-cat-img { width: 30px; height: 30px; border-radius: 6px; background: #333; overflow: hidden; } .sp-cat-img img { width: 100%; height: 100%; object-fit: cover; } .sp-cat-txt { font-weight: 700; flex: 1; color: #ddd; font-size: 15px; } .sp-cat-cnt { background: rgba(0, 114, 255, 0.3); color: #fff; padding: 2px 10px; border-radius: 8px; font-size: 12px; font-weight: 800; } .sp-delta { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px; margin-top: 4px; display: inline-block; } .sp-delta.up { background: rgba(46, 204, 113, 0.2); color: #2ecc71; } .sp-delta.down { background: rgba(255, 78, 78, 0.2); color: #ff4e4e; } .sp-delta.same { background: rgba(255,255,255,0.1); color: #888; } .sp-heatmap-wrap { display: flex; flex-direction: column; gap: 6px; } .sp-heatmap-row { display: flex; gap: 5px; align-items: center; } .sp-heatmap-label { font-size: 11px; color: #555; font-weight: 700; width: 30px; text-align: right; flex-shrink: 0; } .sp-heatmap-cell { flex: 1; height: 18px; border-radius: 4px; background: rgba(255,255,255,0.04); transition: opacity 0.2s; cursor: default; position: relative; } .sp-heatmap-cell:hover::after { content: attr(data-tip); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%); background: #111; color: #fff; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px; white-space: nowrap; border: 1px solid rgba(255,255,255,0.2); pointer-events: none; z-index: 999; } .sp-heatmap-x { display: flex; gap: 5px; padding-left: 35px; margin-top: 4px; } .sp-heatmap-x span { flex: 1; text-align: center; font-size: 10px; color: #444; font-weight: 700; } `); async function initDashboard() { if (!AppContext.uid) { try { const response = await new Promise(resolve => { GM_xmlhttpRequest({ method: "GET", url: Endpoints.USER, onload: (r) => resolve(JSON.parse(r.responseText).CHANNEL) }); }); AppContext.uid = response.LOGIN_ID; localStorage.setItem('sr_uid', AppContext.uid); } catch (e) { return; } } let modal = document.getElementById('sp-modal-layer'); if (!modal) { modal = document.createElement('div'); modal.id = 'sp-modal-layer'; document.body.appendChild(modal); } document.body.style.overflow = 'hidden'; const bg = localStorage.getItem('sr_bg_url') || CONFIG.DEFAULT_BG; const bgBlob = await fetchImageBlob(bg); AppContext.bgBlob = bgBlob; modal.innerHTML = `