×
创建新页面
在此填写您的页面标题:
我们当前在FBC镜像站上拥有286个页面。请在上方输入您的页面名称或点击以下任意标题来开始编写页面!



FBC镜像站
286个页面

用户:PandaFiredoge/文件.js

PandaFiredoge留言 | 贡献2026年8月7日 (五) 15:21的版本 (创建页面,内容为“(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 (aic…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
(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);
})();

最近更改

  • RLMC • 00:45
  • RLMC • 00:41
  • RLMC • 00:27
  • RLMC • 00:23