Pan Link Extractor

一键提取链接并自动跳装

  1. // ==UserScript==
  2. // @name Pan Link Extractor
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description 一键提取链接并自动跳装
  6. // @author huohuoma
  7. // @match https://www.seedhub.cc/link_start/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=seedhub.cc
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. let panLinkValue = null;
  16.  
  17. // 查找包含 panLink 的 script 标签
  18. for (let script of document.getElementsByTagName('script')) {
  19. if (script.innerText.includes('panLink')) {
  20. let match = script.innerText.match(/panLink\s*=\s*['"](.*?)['"]/);
  21. if (match && match[1]) {
  22. panLinkValue = match[1];
  23. break;
  24. }
  25. }
  26. }
  27.  
  28. // 如果找到了 panLink,跳转到该链接,否则显示提示
  29. if (panLinkValue) {
  30. window.location.href = panLinkValue;
  31. } else {
  32. // 显示提示信息
  33. let mobilePanDiv = document.querySelector('.mobile-pan');
  34. if (mobilePanDiv) {
  35. mobilePanDiv.innerHTML = '未找到有效链接,请检查页面设置。';
  36. mobilePanDiv.style.color = 'red';
  37. } else {
  38. console.warn('Div with class "mobile-pan" not found on this page.');
  39. }
  40. }
  41. })();