zimuku

zimuku明细页直接显示下载地址

当前为 2020-07-18 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name zimuku
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description zimuku明细页直接显示下载地址
  6. // @author You
  7. // @match http://www.zimuku.la/detail/*
  8. // @require http://libs.baidu.com/jquery/2.0.0/jquery.min.js
  9. // @grant GM_xmlhttpRequest
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. async function gethtml(url) {
  16. return new Promise((resolve, reject) => {
  17. GM_xmlhttpRequest(
  18. {
  19. url: url,
  20. method: "GET",
  21. onload: function (response) {
  22. resolve(response.responseText);
  23. }
  24. });
  25. });
  26. }
  27.  
  28.  
  29.  
  30.  
  31.  
  32. async function run() {
  33. let lhref = location.href;
  34. lhref = lhref.replace('www.zimuku.la/detail/', 'zmk.pw/dld/');
  35. const htmltxt = await gethtml(lhref);
  36.  
  37.  
  38. if(!htmltxt) return;
  39. let doc = $('<html></html>');
  40. doc.html(htmltxt);
  41. let td = doc.find('.col-xs-12 td:nth-child(1) div');
  42. console.log(td);
  43.  
  44. const subinfo=$('.subinfo');
  45. subinfo.append(td)
  46.  
  47. }
  48.  
  49.  
  50. run();
  51. })();