PlatinSport direct AceStream links

Obtain direct, clickable AceStream links on PlatinSport, bypassing url shorteners.

目前為 2022-08-07 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        PlatinSport direct AceStream links
// @description Obtain direct, clickable AceStream links on PlatinSport, bypassing url shorteners.
// @namespace   StephenP
// @author   StephenP
// @grant       none
// @version     1.0
// @match https://www.platinsport.com/*
// @contributionURL https://nowpayments.io/donation/stephenpgreasyfork
// @license AGPL-3.0-or-later
// ==/UserScript==

if(!document.location.href.includes("/link/")){
  var links=document.getElementsByTagName("A");
  
  for(let link of links){
    if(link.href.includes("bc.vc")){
      let pos=link.href.indexOf("https://www.p");
      link.href=link.href.slice(pos);
    }
  }
}
else{
  var texts=document.getElementsByTagName("STRONG");
  for(let t of texts){
    var link=null;
    do{      
      link=/acestream:\/\/[a-f0-9]{40}/.exec(t.innerText);
      if(link!==null){
      	t.innerHTML=t.innerHTML.replace(link[0],"<a style=\"color: yellow\" href=\""+link+"\">"+link[0].replace("acestream://","")+"</a>");
      }
    }while(link!==null)
  }
}