AutoDL 每页 100 个

自动点击“100条/页”

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         AutoDL 每页 100 个
// @namespace    http://tampermonkey.net/
// @version      2025-03-19
// @description  自动点击“100条/页”
// @author       Ganlv
// @match        https://www.autodl.com/login*
// @match        https://www.autodl.com/subAccountLogin*
// @match        https://www.autodl.com/deploy*
// @match        https://www.autodl.com/console*
// @icon         https://www.autodl.com/favicon.png
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));

    (async () => {
        while (true) {
            const href = location.href;
            if ((href.includes('/console/instance/list') || href.includes('/deploy/list') || href.includes('/deploy/details/') || href.includes('/deploy/duration') || href.includes('/console/image')) && !href.includes('page_size')) {
                const elPaginationSize = document.querySelector('.el-pagination__sizes input[placeholder="请选择"]');
                if (elPaginationSize) {
                    elPaginationSize.click();
                    await sleep(16);
                    Array.from(document.querySelectorAll('.el-select-dropdown__item span')).find(el => el.textContent === '100条/页')?.click();
                    console.log(location.href + ' set page size to 100');
                }
            }
            await sleep(16);
        }
    })();
})();