aliyun_找资源
// ==UserScript==
// @name aliyun_找资源
// @namespace http://tampermonkey.net/
// @version 0.2.1
// @description 跳过中转页
// @author waitfortea
// @match https://zhaoziyuan.la/*
// @match https://www.niceso.fun/search/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=zhaoziyuan.la
// @require https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js
// @grant GM_xmlhttpRequest
// ==/UserScript==
(async function() {
'use strict';
replace_url()
//let replace_href=await get_aliyun_share()
// Your code here...
}())
async function replace_url(){
let news=$('.news_text')
let num
let url=location.href
if (url.match('zhaoziyuan.la/so')){
num=1
}else {
num=2
}
for(let i=num;i<news.length;i++){
let a_array=$('a',news[i])
for(let j=0;j<a_array.length;j++){
a_array[j].href=await get_aliyun_share(a_array[j].href)
a_array[j].target='_blank'
}
}
}
function get_aliyun_share(url){
return new Promise((resolve,reject)=>{
GM_xmlhttpRequest({
method:'get',
url:url,
onload:function (res){
let replace_a_text=$('.zuoyou+a',$(res.response))[0].href
resolve(replace_a_text)
}
})
})
}