腾讯二级.js 4.2 KB
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 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
js:
var vod = {};
let d = [];
let video_list = [];
let video_lists = [];
let list = [];
let html = fetch(input,fetch_params);
// print(html);
let sourceId = /get_playsource/.test(input)?input.match(/id=(\d*?)&/)[1]:input.split('cid=')[1];
let cid = sourceId;
let detailUrl = 'https://v.%71%71.com/detail/m/' + cid + '.html';
log('详情页:'+detailUrl);
// let detail_html = fetch(detailUrl,fetch_params);
var pdfh = jsp.pdfh;
var pd = jsp.pd;
//影片信息
try{
let json = JSON.parse(html);
vod = {
    vod_id:json.c.vid,
    vod_url:input,
    vod_name:json.c.title,
    type_name:json.typ.join(','),
    vod_actor:json.nam.join(','),
    vod_year:json.c.year,
    // vod_director:director,
    // vod_area:area,
    vod_content:json.c.description,
    vod_remarks:json.rec,
    vod_pic:urljoin2(input,json.c.pic),
};
// print(vod);
}catch(e){log('解析片名海报等基础信息发生错误:'+e.message) }

//掏直链
if (/get_playsource/.test(input)) {
    // print('流程1');
    eval(html);
    let indexList = QZOutputJson.PlaylistItem.indexList;
    indexList.forEach(function (it) {
        let dataUrl = 'https://s.video.qq.com/get_playsource?id=' + sourceId + '&plat=2&type=4&data_type=3&range=' + it + '&video_type=10&plname=qq&otype=json';
        eval(fetch(dataUrl, fetch_params));
        let vdata = QZOutputJson.PlaylistItem.videoPlayList;
        vdata.forEach(function (item) {
            d.push({
            title:item.title,
            pic_url:item.pic,
            desc:item.episode_number + '\t\t\t播放量:' + item.thirdLine,
            url:item.playUrl,
        });
        });
        video_lists = video_lists.concat(vdata);
    });
}else{
    let json = JSON.parse(html);
    video_lists = json.c.video_ids;
    // print(video_lists);
    let url = 'https://v.qq.com/x/cover/' + sourceId + '.html';
    if (json.c.type === 10) {//综艺
        // print('流程2-1');
        let dataUrl = 'https://s.video.qq.com/get_playsource?id=' + json.c.column_id + '&plat=2&type=2&data_type=3&video_type=8&plname=qq&otype=json';
        // print(dataUrl);
        let o_html = fetch(dataUrl, fetch_params);
        eval(o_html);
        video_lists = [];
        let indexList = QZOutputJson.PlaylistItem.indexList;
        indexList.forEach(function (it){
            let dataUrl = 'https://s.video.qq.com/get_playsource?id=' + json.c.column_id + '&plat=2&type=4&data_type=3&range=' + it + '&video_type=10&plname=qq&otype=json';
            eval(fetch(dataUrl, fetch_params));
            let vdata = QZOutputJson.PlaylistItem.videoPlayList;
            vdata.forEach(function (item){
                d.push({
                title:item.title,
                pic_url:item.pic,
                desc:item.episode_number + '\t\t\t播放量:' + item.thirdLine,
                url:item.playUrl,
            });
            });
            video_lists = video_lists.concat(vdata);
        });
    } else if (video_lists.length === 1) {//电影或者电视剧只有1集
        // print('流程2-2');
        d.push({
            title: '在线播放',
            url: url,
        });
    } else if (video_lists.length > 1) { // 电视剧 或者动漫? 电影也分普通话版和英语版
        // print('流程2-3');
        for (let i = 0; i < video_lists.length; i += 30) {
            video_list.push(video_lists.slice(i, i + 30))
        }
        // print(video_list);
        video_list.forEach(function (it,idex){
            let o_url = 'https://union.video.qq.com/fcgi-bin/data?otype=json&tid=682&appid=20001238&appkey=6c03bbe9658448a4&union_platform=1&idlist=' + it.join(',');
            let o_html = fetch(o_url, fetch_params);
            eval(o_html);
            QZOutputJson.results.forEach(function (it1){
                it1 = it1.fields;
                let url = 'https://v.qq.com/x/cover/' + cid + '/' + it1.vid + '.html';
                d.push({
                    title: it1.title,
                    pic_url: it1.pic160x90.replace('/160',''),
                    desc: it1.video_checkup_time,
                    url: url,
                });
            });
        });

    }

}
// print(d);
vod.vod_play_from = 'qq';
vod.vod_play_url = d.map(function (it){
    return it.title + '$' + it.url;
}).join('#');