Direct Links - taodung.com

Change download links to direct links

2024/07/04のページです。最新版はこちら

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name           Direct Links - taodung.com
// @namespace    https://greasyfork.org/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;
    }
  }
})();