Fetch the repository succeeded.
This action will force synchronization from 中大猫谱/download_wxykf, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
import { constants, promises } from 'node:fs';
import { parse, dirname, resolve } from 'path';
import CloudBase from "@cloudbase/manager-node";
import conf from "./config.js";
const { storage } = new CloudBase({
secretId: conf.secretId,
secretKey: conf.secretKey,
envId: conf.envId, // 云开发环境ID,可在腾讯云云开发控制台获取
});
async function main() {
var file_str = await promises.readFile("./delete_file_list.json");
const allFiles = JSON.parse(file_str);
const step = 10
var total_deleted = 0;
var error_count = 0;
for (let i = 0; i < (allFiles.length / step); i++) {
var files = allFiles.slice(i*step, (i+1)*step);
var delete_urls = files.map((x) => x.Key);
console.log(delete_urls);
try {
await storage.deleteFile(delete_urls);
} catch (error) {
error_count++;
}
total_deleted += files.length;
console.log(`[${total_deleted}/${allFiles.length}] Deleted, error_count=${error_count}.`);
}
}
main();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。