\s*)*]{0,}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=]{0,}(ㄱㄹ){1,1}[ㄱ-ㅣ가-힣0-9A-Za-z\s~`!^\_+@\#$%&=]{0,}[(\s*
)*]{0,}/); await GM.setValue('npw', npw); } function waitForKoneContentAndProcess() { let attempts = 0; const maxAttempts = 20; const checkInterval = setInterval(async () => { attempts++; await handleBlockingModals(host); const atc = getKoneGGContentElement(); const titleEl = [...document.querySelectorAll('h1.flex, h1.text-xl')].find(el => el.textContent?.match(/RJ[0-9]{6,10}|VJ[0-9]{6,10}/i) ); const hasBase64 = atc && /aHR0c|YUhSMG|WVVoU|V1ZWb/.test(atc.textContent || ''); if (atc && (titleEl || hasBase64) && (atc.textContent || '').length > 10) { clearInterval(checkInterval); await FindPW(); setTimeout(doDec, 200); } else if (attempts >= maxAttempts) { clearInterval(checkInterval); } }, 200); } async function loadNpw() { const saved = await GM.getValue('npw'); if (Array.isArray(saved)) { npw = [...new Set([...npw, ...saved])]; } } async function initHostSpecificSettings() { await loadNpw(); const hostConfigs = { 'kio.ac': { chkpSelectors: [ '.overflow-auto.max-w-full.flex-grow.p-1 input:nth-of-type(1)', '.flex.flex-col-reverse button:nth-of-type(1)', 'td.align-middle > div.flex > button[type="button"].inline-flex' ], isT2: true, pageLoadDelay: 1500, inputPwDelay: 2000 }, 'kiosk.ac': { chkpSelectors: [ '.input.shadow-xl.flex-grow', '.btn.btn-ghost.w-full.mt-2.rounded-md', '.dropdown.group > button' ], isT2: Down_Option === 0, pageLoadDelay: 500, inputPwDelay: 300 }, 'mega.nz': { chkpSelectors: [ '#password-decrypt-input', '.mega-button.positive.fm-dialog-new-folder-button.decrypt-link-button', '.mega-button.positive.js-default-download.js-standard-download' ], isT2: false, pageLoadDelay: 2500, inputPwDelay: 1800 }, 'workupload.com': { chkpSelectors: [ '#passwordprotected_file_password', '#passwordprotected_file_submit', 'a.btn.btn-prio[href*="/file/"]' ], isT2: Down_Option === 0, pageLoadDelay: 1500, inputPwDelay: 0 }, 'drive.google.com': { chkpSelectors: [], isT2: true, pageLoadDelay: 500, inputPwDelay: 0 }, 'drive.usercontent.google.com': { chkpSelectors: [ null, null, 'form[method="POST"] button[type="submit"], input[type="submit"][value="다운로드"], button.jfk-button-action' ], isT2: true, pageLoadDelay: 500, inputPwDelay: 0 }, 'gofile.io': { chkpSelectors: [ '#filesErrorPasswordInput', '#filesErrorPasswordButton', 'button.btn-download, a.btn-download, #rowFolderCenter button[data-bs-target="#filesList"] + div .btn-outline-secondary' ], isT2: true, pageLoadDelay: 1500, inputPwDelay: 0 } }; const config = hostConfigs[host]; if (config) { chkp[0] = config.chkpSelectors[0]; chkp[1] = config.chkpSelectors[1]; chkp[2] = config.chkpSelectors[2]; isT[2] = config.isT2; PageLoading[1] = config.pageLoadDelay; if (host === 'drive.google.com') { if (document.URL.includes('/file/d/')) { const fileId = document.URL.split('/d/')[1].split('/')[0]; if (fileId) { window.location.href = `https://drive.usercontent.google.com/download?id=${fileId}&export=download&authuser=0`; } } else if (document.URL.includes('/drive/folders/')) { await new Promise(res => setTimeout(res, (PageLoading[0] || 1000) + 1500)); if (isT[0] === true) { const downloadAllButton = document.querySelector('div[aria-label="모두 다운로드"], div[data-tooltip="모두 다운로드"]'); if (downloadAllButton) { downloadAllButton.click(); } else { const firstItemDownloadButton = document.querySelector('div[role="gridcell"][data-is-shared="false"] div[aria-label*="다운로드"]'); if (firstItemDownloadButton) { firstItemDownloadButton.click(); } } } await new Promise(res => setTimeout(res, (PageLoading[0] || 1000) + 3500)).then(() => { if (isT[0] === true) DBtn(); }); } } else if (host === 'drive.usercontent.google.com') { await new Promise(res => setTimeout(res, 100)).then(() => { if (isT[0] === true) DBtn(); }); } else { await new Promise(res => setTimeout(res, (PageLoading[0] || 1000) + config.inputPwDelay)).then(inputPW); if (isT[0] === true) { DBtn(); } } } } (async () => { await chkPW(); await handleBlockingModals(host); if (host === 'arca.live') { await FindPW(); setTimeout(doDec, 200); } else if (host === 'kone.gg') { waitForKoneContentAndProcess(); } await initHostSpecificSettings(); })(); (function () { if (location.host !== 'kone.gg') return; function hookDecodeTriggerOnButton() { const buttonsToHook = [ document.querySelector('div.flex.items-center.justify-between.p-4 button[data-slot="button"]'), [...document.querySelectorAll('button.flex.cursor-pointer.items-center')] .find(button => button.textContent?.trim() === '댓글 더 불러오기'), ].filter(b => b instanceof Element && b.dataset._somi_hooked !== '1'); buttonsToHook.forEach(button => { button.dataset._somi_hooked = '1'; button.addEventListener('click', async () => { await handleBlockingModals(host); setTimeout(async () => { await FindPW(); setTimeout(doDec, 200); }, 500); }); }); } hookDecodeTriggerOnButton(); const observer = new MutationObserver(async (mutationsList) => { for (const mutation of mutationsList) { if (mutation.type === 'childList' && mutation.addedNodes.length > 0) { hookDecodeTriggerOnButton(); await handleBlockingModals(host); setTimeout(async () => { await FindPW(); setTimeout(doDec, 200); }, 100); } else if (mutation.type === 'attributes' && mutation.attributeName === 'class') { await handleBlockingModals(host); setTimeout(async () => { await FindPW(); setTimeout(doDec, 200); }, 100); } } await handleBlockingModals(host); }); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['class', 'style'] }); })(); (function () { if (location.host !== 'kone.gg') return; let lastUrl = location.href; let mainProcessingIntervalId = null; const observer = new MutationObserver(async () => { const currentUrl = location.href; if (currentUrl !== lastUrl) { lastUrl = currentUrl; if (mainProcessingIntervalId) { clearInterval(mainProcessingIntervalId); } await handleBlockingModals(host); observeAndRunKoneFunctions(); } }); observer.observe(document.body, { childList: true, subtree: true }); async function observeAndRunKoneFunctions() { const start = Date.now(); const timeout = 8000; if (mainProcessingIntervalId) { clearInterval(mainProcessingIntervalId); } mainProcessingIntervalId = setInterval(async () => { await handleBlockingModals(host); const atc = getKoneGGContentElement(); const hasText = atc && (atc.textContent || '').length > 20; const hasEncoded = atc && /aHR0c|YUhSMG|WVVoU|V1ZWb/.test(atc.textContent || ''); const hasDlsiteLink = atc && atc.querySelector('a[href*="dlsite.com"]'); const comments = document.querySelectorAll('p.text-sm.whitespace-pre-wrap'); let hasEncodedComments = false; for(const comment of comments) { if (/aHR0c|YUhSMG|WVVoU|V1ZWb/.test(comment.textContent || '')) { hasEncodedComments = true; break; } } if (atc && (hasText && (hasEncoded || hasDlsiteLink)) || hasEncodedComments) { clearInterval(mainProcessingIntervalId); mainProcessingIntervalId = null; await FindPW(); setTimeout(doDec, 200); } if (Date.now() - start > timeout) { clearInterval(mainProcessingIntervalId); mainProcessingIntervalId = null; } }, 200); } (async () => { await handleBlockingModals(host); observeAndRunKoneFunctions(); })(); })();