酷云免嗅.js 880 字节
Newer Older
H
hjdhnx 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
js:
function GetPlayUrl(playUrl) {
    let realPlay = {parse:0,url:playUrl};
    if (/mgtv|sohu/.test(playUrl)) {
        realPlay.headers = {'User-Agent':'Mozilla/5.0'};
    } else if (/bili/.test(playUrl)) {
        realPlay.headers  ={'User-Agent':'Mozilla/5.0','Referer':'https://www.bilibili.com'};
    } else if (/ixigua/.test(playUrl)) {
        realPlay.headers = {'User-Agent':'Mozilla/5.0','Referer':'https://www.ixigua.com'};
    }
    return realPlay
}
if (/\.m3u8|\.mp4/.test(input)) {
    input={parse:0,url:input};
} else {
    try {
        let url = "http://api.kunyu77.com/api.php/provide/parserUrl?url=" + input;
    let html = request(url);
    let urll = JSON.parse(html).data.url;
    let playhtml = request(urll);
    let playurl = JSON.parse(playhtml).url;
    input = GetPlayUrl(playurl);
    }catch (e) {
H
hjdhnx 已提交
24
        input = {parse:1,jx:1,url:input};
H
hjdhnx 已提交
25 26
    }
}