Direct Links - taodung.com

Change download links to direct links

目前為 2024-07-04 提交的版本,檢視 最新版本

// ==UserScript==
// @name           Direct Links - taodung.com
// @namespace    https://gf.qytechs.cn/en/users/807108-jeremy-r
// @version      1
// @description   Change download links to direct links
// @author       JRem
// @include      https://taodung.com/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
  'use strict';

  const links = document.querySelectorAll('a[href]');

  for (const link of links) {
    const url = new URL(link.href);
    if (url.origin === 'https://ipamod.com' && url.pathname.startsWith('/redirect-to/')) {
      const encodedUrl = url.searchParams.get('url');
      let decodedUrl;

      try {
        decodedUrl = decodeURIComponent(encodedUrl.substring(encodedUrl.indexOf('?s=') + 3));
        decodedUrl = decodedUrl.split('&amp')[0]; // Split at "%26amp" and keep the first part
      } catch (error) {
        console.error('Error decoding URL:', error);
        continue; // Skip to next link if decoding fails
      }

      link.href = decodedUrl;
    }
  }
})();

QingJ © 2025

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