從myppt和lurl中導出圖片以及填寫密碼

導出myppt和lurl的圖片在網頁的底部,並且自動填寫日期密碼

  1. // ==UserScript==
  2. // @name export image from myppt and lurl
  3. // @name:zh-TW 從myppt和lurl中導出圖片以及填寫密碼
  4. // @name:en. export image from myppt and lurl
  5. // @namespace normaltool
  6. // @version 0.1.2
  7. // @description:zh-tw 導出myppt和lurl的圖片在網頁的底部,並且自動填寫日期密碼
  8. // @description Derive image to the bottom of web page and fill the password gennerated by update date
  9. // @author jw23
  10. // @match https://*.myppt.cc/*
  11. // @match https://*.lurl.cc/*
  12. // @license MIT
  13. // ==/UserScript==
  14.  
  15. (function () {
  16. 'use strict';
  17. var images = [];
  18. let deaultpassword = function(cssSelector){
  19. try{
  20. return /\d{4}-(\d{2}-\d{2})/.exec(document.querySelector(cssSelector).textContent)[1].replace('-','')
  21. }catch(e){
  22. console.log("error in password:",e)
  23. }
  24. }
  25. if (document.URL.indexOf('myppt.cc') != -1) {
  26. fillPassword('#pasahaicsword',deaultpassword('.form-group.has-feedback'))
  27. let links = document.querySelectorAll("link[rel=preload]");
  28. for (let link of links) {
  29. let imagesLinks = link.getAttribute('href');
  30. images.push(imagesLinks)
  31. }
  32. } else if (document.URL.indexOf('lurl.cc')) {
  33. fillPassword('#password',deaultpassword('.form-group.has-feedback'))
  34. let scripts = document.querySelectorAll('.gameIn script')
  35. for (let script of scripts) {
  36. if (script.textContent.indexOf('canvas_img') != -1) {
  37. let res = /https:\/\/.+.lurl.cc\/.+g/.exec(script.textContent)
  38. images.push(res[0])
  39. }
  40. }
  41. }
  42.  
  43. for (let image of images) {
  44. let img = document.createElement("img");
  45. img.src = image
  46. img.style.width = "100%"
  47. document.body.appendChild(img);
  48. }
  49. })();
  50. // 从URL中提取文件名
  51. function getFilename(url) {
  52. return url.substring(url.lastIndexOf('/') + 1);
  53. }
  54. function fillPassword(selector, password) {
  55.  
  56. let input = document.querySelector(selector)
  57. if (input !== null) {
  58. input.value = password;
  59. // document.querySelector('#main_fjim60unBU').click()
  60. }
  61. }
  62.  
  63.  

QingJ © 2025

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