• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

脚本阿里云盘批量脚本-可设置提取码

武飞扬头像
差不多的张三
帮助1

想设置公开链接即无提取码请使用之前的文章

https://blog.csdn.net/qq_45196785/article/details/123112558

// 待整个程序执行完毕即可点击button把所有链接写入到剪贴板
var btn = document.createElement("button"); //创建需要增加的元素节点
var node = document.createTextNode("执行完毕后点击此处复制链接"); //创建文本节点
btn.appendChild(node); //将文本节点增加至创建的元素中
btn.setAttribute("onClick", "copyLink()");
var element = document.getElementsByClassName("actions--2qvID")[0]; //获取父节点
element.appendChild(btn); //添加至父节点内

// textarea存储每次循环复制的文件名链接
var textarea_text = document.createElement("textarea");
document.body.appendChild(textarea_text);

alert("请等待5秒钟...");
var i = -1;
setTimeout(function () {
  // 选择第一个文件
  let step1 = setTimeout(() => {
    document.getElementsByClassName("input--1mW1D")[i   1].click();
    clearTimeout(step1);
  }, 500);
  // 点击分享
  let step2 = setTimeout(() => {
    document.getElementsByClassName("toolbar-item--21b0l")[1].click();
    clearTimeout(step2);
  }, 800);
  // 私密链接
  let step2_5 = setTimeout(() => {
    document.getElementsByClassName("icon--3pGwN icon--d-ejA")[0].click();
    document.getElementsByClassName("text-wrapper--3ZfDC")[1].click();
    clearTimeout(step2_5);
  }, 1200);
  // 创建分享
  let step3 = setTimeout(() => {
    // 默认有效期永久(如果想设置为30天有效期请把下列两行代码删掉)
    document.querySelector(".share-expire-wrapper--w1Wb6").click();
    document.getElementsByClassName("title--2ojpH")[1].click();
    // 分享
    document.getElementsByClassName("button--2Aa4u")[0].click();
    clearTimeout(step3);
  }, 1500);
  // 复制文件名
  let step4 = setTimeout(() => {
    // 文件名
    var p_text = document.getElementsByClassName("title--3x5k2")[i];

    // 链接
    var div_text = document.getElementsByClassName("url--1vyKp")[0];
    var div_text_password = document.getElementsByClassName("code--F3uKf")[0];

    // 文本
    var ali_text =
      "点击链接保存,或者复制本段内容,打开「阿里云盘」APP ,无需下载极速在线查看,视频原画倍速播放。";
    var ali_password = "提取码:";
    sum =
      p_text.innerText  
      "\n"  
      div_text.innerText  
      "\n"  
      ali_password  
      div_text_password.innerText  
      "\n"  
      ali_text  
      "\n"  
      "\n";
    textarea_text.innerHTML  = sum;

    console.log(p_text.innerText);
    console.log(div_text.innerText);
    console.log(ali_password   div_text_password);
    console.log(ali_text);
    console.log(textarea_text.innerHTML);
    clearTimeout(step4);
  }, 2000);
  let step5 = setTimeout(() => {
    // 关闭
    document.getElementsByClassName("icon-wrapper--3dbbo")[0].click();
    clearTimeout(step5);
  }, 2500);
  let step6 = setTimeout(() => {
    // 取消选择
    document.getElementsByClassName("input--1mW1D")[i   1].click();
    clearTimeout(step6);
  }, 3000);

  i  ;
  if (i < document.getElementsByClassName("node-card--2g50y").length) {
    setTimeout(arguments.callee, 4000);
  }
}, 4000);
function copyLink() {
  textarea_text.select(); // 选择对象
  document.execCommand("Copy"); // 执行浏览器复制命令
}

学新通

目前先这样,过几天优化一下,可自行选择公开或者私密以及自定义有效期

这篇好文章是转载于:编程之路

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 编程之路
  • 本文地址: /boutique/detail/tanhghagka
系列文章
更多 icon
同类精品
更多 icon
继续加载