←用户:PandaFiredoge/文件.js因为以下原因,您没有权限编辑该页面: 您请求的操作仅限属于这些用户组的用户执行:用户、管理员、行政员、editor您没有权限编辑此JavaScript页面,因为此页面包含另一位用户的个人设置。 您可以查看和复制此页面的源代码。 (async function fetchAllDirectImageUrls() { const scriptPath = mw.config.get('wgScriptPath') || ''; const apiEndpoint = `${window.location.origin}${scriptPath}/api.php`; let urlList = []; let aicontinue = ''; console.log('开始获取图片直链...'); do { const params = new URLSearchParams({ action: 'query', list: 'allimages', // 直接查图片表 ailimit: 'max', format: 'json', origin: '*' }); if (aicontinue) { params.append('aicontinue', aicontinue); } try { const response = await fetch(`${apiEndpoint}?${params.toString()}`); const data = await response.json(); if (data.query && data.query.allimages) { // 直接读取图片的原图 URL (url 字段) const urls = data.query.allimages.map(img => img.url); urlList.push(...urls); console.log(`已获取 ${urlList.length} 个原图直链...`); } aicontinue = data.continue ? data.continue.aicontinue : null; } catch (error) { console.error('获取失败:', error); break; } } while (aicontinue); console.log(`✅ 获取完成!共找到 ${urlList.length} 个原图直链。`); const blob = new Blob([urlList.join('\n')], { type: 'text/plain' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = 'direct_image_urls.txt'; a.click(); URL.revokeObjectURL(url); })(); 返回用户:PandaFiredoge/文件.js。