copy all img link from catbox

copy all image link

  1. // ==UserScript==
  2. // @name copy all img link from catbox
  3. // @description copy all image link
  4. // @namespace nekohako_img
  5. // @author Covenant
  6. // @version 0.9
  7. // @license MIT
  8. // @homepage
  9. // @match https://catbox.moe
  10. // @match https://catbox.moe/*
  11. // @icon https://www.google.com/s2/favicons?sz=64&domain=catbox.moe
  12. // @grant GM_setValue
  13. // @grant GM_getValue
  14. // @grant GM_registerMenuCommand
  15. // @grant GM_setClipboard
  16. // @run-at document-end
  17. // @noframes
  18. // ==/UserScript==
  19. function main_01(str_format){
  20. let a_link_list=document.querySelectorAll('div.responseText>span');
  21. let str_img_links="";
  22. let str_img_html_code="";
  23. if(a_link_list.length==0){GM_setClipboard(a_link_list.length);}
  24. else{
  25. a_link_list.forEach((fe_link_list,i) =>{
  26. str_img_links=str_img_links+fe_link_list.textContent+"\n";
  27. str_img_html_code=str_img_html_code+"<img class=\"tmp\" src=\""+fe_link_list.textContent+"\"/>\n";
  28. });
  29. if(str_format=="html"){
  30. GM_setClipboard(str_img_html_code);
  31. }else{
  32. GM_setClipboard(str_img_links);
  33. }
  34. }
  35. }
  36. (function() {
  37. 'use strict';
  38. GM_registerMenuCommand("copy link", () =>{
  39. main_01();
  40. });
  41. GM_registerMenuCommand("copy link(html format)", () =>{
  42. main_01("html");
  43. });
  44. })();

QingJ © 2025

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