获取up主投稿页所有视频

自动生成you-get的bat下载脚本

  1. // ==UserScript==
  2. // @name 获取up主投稿页所有视频
  3. // @namespace get-bilibili-up-tougao-page-links
  4. // @version 1.0
  5. // @description 自动生成you-get的bat下载脚本
  6. // @license MIT
  7. // @match https://space.bilibili.com/*/video
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11.  
  12. (function () {
  13. "use strict";
  14.  
  15. // 创建按钮元素
  16. const button = document.createElement("button");
  17. // 设置按钮样式
  18. button.style.position = "fixed";
  19. button.style.right = "30px";
  20. button.style.bottom = "30px";
  21. button.style.width = "50px";
  22. button.style.height = "50px";
  23. button.style.borderRadius = "50%";
  24. button.style.backgroundColor = "#ff6699";
  25. button.style.border = "none";
  26. // 添加按钮文本
  27. button.textContent = "Down";
  28. button.style.color = "white";
  29. // 添加按钮到页面
  30. document.body.appendChild(button);
  31.  
  32. // 按钮点击事件处理函数
  33. button.addEventListener("click", () => {
  34. // 获取所有链接并去重
  35. const links = [
  36. ...new Set(Array.from(document.querySelectorAll("ul.cube-list li a")).map(link => link.href))
  37. ].map(link => ({ href: link })); // 处理链接
  38. const commands = links.map(
  39. (link) => `you-get ${link.href} -c cookie.txt`
  40. );
  41. // 将处理结果保存到文件
  42. const blob = new Blob([commands.join("\n")], { type: "text/plain" });
  43. const url = URL.createObjectURL(blob);
  44. // 下载文件
  45. const a = document.createElement("a");
  46. a.href = url;
  47. a.download = "youGetcommands.txt";
  48. a.click();
  49. });
  50. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址