ckplayer ajax,旋风解析

view-source:https://api.177537.com/?url=http://www.iqiyi.com/v_19rr7p5oh8.html?vfm=f_191_360y

旋风VIP解析接口群 468518764

var xfsub = [];

xfsub.player_skin = '1';

xfsub.public_path = 'https://statics.xfsub.com:444/ckplayer';

正在加载播放中,请稍等....0s 解析响应超时,请刷新重试!
视频加载失败,请稍候再试...

function player(){

$.post("url.php", {"time":"1521983338","key":"cc94db90ee576bd3bdf1985fd57bb4f0","url":"http://www.iqiyi.com/v_19rr7p5oh8.html?vfm=f_191_360y","type":"iqiyi","ckey1": encodeURIComponent(sign("http://www.iqiyi.com/v_19rr7p5oh8.html?vfm=f_191_360y"))},

function(data){

if(data['success'] == 1){

var isiPad = navigator.userAgent.match(/iPad|iPhone|Linux|Android|iPod/i) != null;

if(data['play'] == 'url'){

$('#a1').html('');

} else if(data['play'] == 'ajax'){

if(data.type == 'youku'){

var get = getQuery(data.url);

data.ccode = get.ccode;

data.site = data.type;

data.stype = get.stype;

data.vid = get.vid;

data.weparser_js_url = BASE64.de(decodeURIComponent(get.js_url));

data.weparser_swf_url = BASE64.de(decodeURIComponent(get.swf_url));

if(isiPad){

weParserParams = data;

var weParserJS = document.createElement("script");

weParserJS.type = "text/javascript";

weParserJS.src = data.weparser_js_url;

document.getElementsByTagName("head")[0].appendChild(weParserJS);

} else {

data.ext = 'xml';

data.url = '/xml.php?a=setswf&data='+BASE64.en($.param(data));

ckplayer_(data);

}

} else if(data.type == 'qq'){

var get = getQuery(data.url);

$.ajax({

url: "//h5vv.video.qq.com/getinfo?charge=0&vid=" + get.vid + "&defaultfmt=auto&otype=json&guid=" + get.guid + "&platform=" + get.platform + "&defnpayver=1&appVer=3.0.83&sdtfrom=" + get.sdtfrom + "&host=v.qq.com&ehost=https%3A%2F%2Fv.qq.com%2Fx%2Fcover%2Fnuijxf6k13t6z9b%2Fl0023olk3g4.html&_0=" + get._0 + "&defn=mp4&fhdswitch=0&show1080p=1&isHLS=0&newplatform=" + get.sdtfrom + "&defsrc=1&_1=" + get._1 + "&_2=" + get._2,

dataType: 'jsonp',

jsonpCallback: "txplayerJsonpCallBack_getkey_" + parseInt(Math.random() * 800000 + 80000),

success: function(getinfo) {

if (!getinfo.exem) {

$.ajax({

url: data.url + '&filename=' + getinfo.vl.vi[0].lnk + '.mp4',

dataType: 'jsonp',

jsonpCallback: "txplayerJsonpCallBack_getkey_" + parseInt(Math.random() * 800000 + 80000),

success: function(json) {

var get = getQuery(data.url);

if (isiPad) {

data.ext = 'h5';

data.url = getinfo.vl.vi[0].ul.ui[0].url + json.filename + '?sdtfrom=' + get.sdtfrom + '&guid=' + get.guid + '&vkey=' + json.key

} else {

data.ext = 'xml';

data.url = '/xml.php?a=setxml&url=' + BASE64.en(getinfo.vl.vi[0].ul.ui[0].url + json.filename + '?sdtfrom=' + get.sdtfrom + '&guid=' + get.guid + '&vkey=' + json.key)

}

ckplayer_(data)

}

})

} else {

$('#loading').hide();

$('#a1').hide();

$('#error').html('
解析失败或资源不存在。');

$('#error').show();

return;

}

}

})

} else if(data.type == 'iqiyi'){

$.ajax({

url: data.url.replace('http:', ''),

dataType: 'html',

success: function(json) {

json = eval("("+json.substring(17,json.length - 15)+")");

if (json.code == 'A00000') {

if (isiPad) {

data.url = json.data.m3u;

data.ext = 'h5';

ckplayer_(data)

} else {

var array = {};

for (var i = json.data.vidl.length - 1; i >= 0; i--) {

if (json.data.vidl[i].fileFormat != "H265") {

array[json.data.vidl[i].vd] = json.data.vidl[i]

}

};

if (array[4] != undefined) {

data.url = array[4].m3u

} else if (array[3] != undefined) {

data.url = array[3].m3u

} else if (array[2] != undefined) {

data.url = array[2].m3u

} else if (array[1] != undefined) {

data.url = array[1].m3u

} else if (array[96] != undefined) {

data.url = array[96].m3u

}

data.url = '/xml.php?a=m3u8'+BASE64.en($.param(data));

data.play = 'm3u8';

ckplayer_(data)

}

} else {

$('#loading').hide();

$('#a1').hide();

$('#error').html('
解析失败或资源不存在。');

$('#error').show();

return;

}

}

})

}

} else if(isiPad || data['play'] == 'html5'){

$('#a1').html('');

} else if(data['play'] == 'h5mp4' || data['play'] == 'hls'){

var dplayer = new DPlayer({

element: document.getElementById("a1"),

autoplay: true,

video: {

url: data['url'],

type: (data.play == 'h5mp4')? 'normal':data.play,

}

});

} else {

ckplayer_(data);

}

$('#loading').hide();

$('#a1').show();

}else{

$('#loading').hide();

$('#a1').hide();

if(data.msg == undefined){

$('#error').html('
'+data['m']);

} else {

$('#error').html('
'+data['msg']);

}

$('#error').show();

}

},"json");

}

player();

(function(){

var BASE64_MAPPING = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

var __BASE64 = {

// 解密

de:function (r) {

var o = String(r).replace(/=+$/, "");

if (o.length % 4 == 1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");

for (var n, a, i = 0, c = 0, d = ""; a = o.charAt(c++); ~a && (n = i % 4 ? 64 * n + a : a, i++ % 4) ? d += String.fromCharCode(255 & n >> (-2 * i & 6)) : 0)a = BASE64_MAPPING.indexOf(a);

return d

},

// 加密

en:function (r) {

for (var o, n, a = String(r), i = 0, c = BASE64_MAPPING, d = ""; a.charAt(0 | i) || (c = "=", i % 1); d += c.charAt(63 & o >> 8 - i % 1 * 8)) {

if (n = a.charCodeAt(i += .75), n > 255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");

o = o << 8 | n

}

return d

}

};

window.BASE64 = __BASE64;

})();

function getQuery(url) {

if (typeof url !== 'string') {

return null

}

var query = url.match(/[^\?]+\?([^#]*)/, '$1');

if (!query || !query[1]) {

return null

}

var kv = query[1].split('&');

var map = {};

for (var i = 0, len = kv.length; i < len; i++) {

var result = kv[i].split('=');

var key = result[0],

value = result[1];

map[key] = value || (typeof value == 'string' ? null : true)

}

return map

}

function ckplayer_(data){

if(data.ext == 'h5'){

$('#a1').html('');

} else {

if(data['play'] == 'm3u8'){

var flashvars={f:'https://statics.xfsub.com:444/ckplayer/m3u8.swf',a:data['url'],c:0,p:1,s:4,lv:0};

} else {

var flashvars={f:data['url'],c:0,s:2,p:1,b:1};

}

var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent'};

CKobject.embedSWF('https://statics.xfsub.com:444/ckplayer/ckplayer.swf','a1','ckplayer_a1','100%','100%',flashvars,params);

}

}

function tipstime(count){$('.timemsg').text(count);if(count==40){$('.tips').hide();$('.timeout').show()}else{count+=1;setTimeout(function(){tipstime(count)},1000)}}tipstime(0);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值