可以自己写? (比如?)
(下面这个简陋一些, 可以方便改)
// ==UserScript==
// @name UCAS SEP Download Selected Files
// @version 0.1
// @description Add a download all button for SEP files.
// @author 凉凉
// @match http*://course.ucas.ac.cn/portal/site/*/tool/*
// @grant none
// ==/UserScript==
// run after window is loaded
window.onload = (function () {
// base url of the content
let base_url = "https://course.ucas.ac.cn/access/content";
// Add a button to page.
// Get the bar.
let bar = document.getElementsByClassName("col-lg-6 col-md-8 col-sm-8 col-xs-12 btn-group btn-group-sm")[0];
// or at the bottom
// let bar = document.getElementById("bottompadding");
// make a button
let btm = document.createElement("button");
btm.innerHTML = "Download Selected";
btm.onclick = function () {
let table = document.getElementsByTagName("tr");
let length = table.length;
// the first two element of the web table is a total check
// and the second one is a directory path, which are useless
for (var i = 2; i < length; i++) {
let item = table[i].querySelector("[name=selectedMembers]");
if (item.checked) {
let url = base_url + item.value;
let fname = item.value.split("/").slice(-1)[0];
(function (url) {
// you can change the download method (主要就是替换这里的代码即可)
window.open(url, "_blank"); // 打开新窗口, 效果和直接点击链接一样
})(url);
// console.log(url)
}
}
}
// use the same style as copy button
btm.style = "margin:0";
btm.setAttribute("class", "btn btn-default");
btm.setAttribute("id", "download-button");
// add the item to the bar
bar.appendChild(btm);
})();
Xia 不过可能是脚本的限制,在下载时会出现上图中显示的 course.ucas.ac.cn 显示 的弹框,并且再批量下载时该脚本还会让 course.ucas.ac.cn 申请自动下载权限
不过可能和不同的游览器有关?