macpeers优化

macpeers自动对下载地址做超链接, 方便点击, 验证码和密码均支持点击复制到剪贴板

  1. // ==UserScript==
  2. // @name macpeers优化
  3. // @namespace https://gf.qytechs.cn/zh-CN/scripts/424268
  4. // @version 0.5
  5. // @description macpeers自动对下载地址做超链接, 方便点击, 验证码和密码均支持点击复制到剪贴板
  6. // @author zhenhappy<q505507538@gmail.com>
  7. // @icon https://hkmacpeers-1259420093.file.myqcloud.com/favicon.ico
  8. // @match https://www.macpeers.net/*
  9. // @require https://unpkg.com/jquery/dist/jquery.slim.min.js
  10. // @require https://unpkg.com/clipboard/dist/clipboard.min.js
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. console.log('macpeers>>>>>>>>')
  16. var t = setInterval(function () {
  17. try {
  18. var content = $('.post_content .STYLE2, .post_content .STYLE5')
  19. if (content.length > 0) {
  20. console.log('找到下载地址, 正在处理下载链接...')
  21. var _url, url, _code, code, _password, password
  22. $.each(content, function( index, value ) {
  23. _url = /(http.*?)\s/g.exec($(this).text())
  24. console.log(_url)
  25. _code = /提取码.*?(\w+)\s*/g.exec($(this).text())
  26. _password = /解压密码.*?(\w+)\s*/g.exec($(this).text())
  27. if (_url && _url.length > 1 && _code && _code.length > 1) {
  28. url = _url[1]
  29. console.log('url:', url)
  30. code = _code[1]
  31. console.log('code:', code)
  32. if (code) {
  33. $(this).html('链接: <a href="' + url + '#' + code + '" target="' + url + '#' + code + '" rel="nofollow noopener noreferrer">' + url + '</a> 提取码: <span style="cursor: pointer;" id="code" data-clipboard-target="#code">'+code+'</span>')
  34. new ClipboardJS('#code')
  35. }
  36. }
  37. if (_password && _password.length > 1) {
  38. password = _password[1]
  39. console.log('password:', password)
  40. if (password) {
  41. $(this).html('解压密码:<span style="cursor: pointer;" id="password" data-clipboard-target="#password">'+password+'</span>')
  42. new ClipboardJS('#password')
  43. }
  44. }
  45. })
  46. } else throw(Error('未找到元素'))
  47. clearInterval(t)
  48. console.log('<<<<<<<<macpeers')
  49. } catch (e) {
  50. if ((e.message !== '未找到元素')) console.error('macpeers优化出错', e)
  51. }
  52. }, 500)
  53. })()

QingJ © 2025

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