提交 8b148488 编写于 作者: H hjdhnx

优酷搜索完成

上级 67959409
......@@ -2,7 +2,7 @@ var rule = {
title:'优酷',
host:'https://www.%79%6f%75%6b%75.com',
homeUrl:'',
searchUrl:'',
searchUrl:'https://search.%79%6f%75%6b%75.com/api/search?pg=fypage&keyword=**',
searchable:2,
quickSearch:0,
filterable:1,
......@@ -32,5 +32,5 @@ var rule = {
二级:'',
二级:'js:var d=[];var vod={vod_id:input};let html=request(input);let json=JSON.parse(html);if(/keyword/.test(input)){input="https://search.youku.com/api/search?appScene=show_episode&showIds="+json.pageComponentList[0].commonData.showId;json=JSON.parse(fetch(MY_URL,fetch_params))}let video_lists=json.serisesList;var name=json.sourceName;if(/优酷/.test(name)&&video_lists.length>0){let ourl="https://v.youku.com/v_show/id_"+video_lists[0].videoId+".html";let _img=video_lists[0].thumbUrl;let html=fetch(ourl,{headers:{Referer:"https://v.youku.com/","User-Agent":PC_UA}});let json=/__INITIAL_DATA__/.test(html)?html.split("window.__INITIAL_DATA__ =")[1].split(";")[0]:"{}";if(json==="{}"){log("触发了优酷人机验证");vod.vod_remarks=ourl;vod.vod_pic=_img;vod.vod_name=video_lists[0].title.replace(/(\\d+)/g,"");vod.vod_content="触发了优酷人机验证,本次未获取详情,但不影响播放("+ourl+")"}else{try{json=JSON.parse(json);let data=json.data.data;let data_extra=data.data.extra;let img=data_extra.showImgV;let model=json.data.model;let m=model.detail.data.nodes[0].nodes[0].nodes[0].data;let _type=m.showGenre;let _desc=m.updateInfo||m.subtitle;let JJ=m.desc;let _title=m.introTitle;vod.vod_pic=img;vod.vod_name=_title;vod.vod_type=_type;vod.vod_remarks=_desc;vod.vod_content=JJ}catch(e){log("海报渲染发生错误:"+e.message);vod.vod_remarks=name}}}if(!/优酷/.test(name)){vod.vod_content="非自家播放源,暂无视频简介及海报";vod.vod_remarks=name}function adhead(url){return urlencode(url)}play_url=play_url.replace("&play_url=","&type=json&play_url=");video_lists.forEach(function(it){let url="https://v.youku.com/v_show/id_"+it.videoId+".html";if(it.thumbUrl){d.push({desc:it.showVideoStage?it.showVideoStage.replace("期","集"):it.displayName,pic_url:it.thumbUrl,title:it.title,url:play_url+adhead(url)})}else if(name!=="优酷"){d.push({title:it.displayName?it.displayName:it.title,url:play_url+adhead(it.url)})}});vod.vod_play_from=name;vod.vod_play_url=d.map(function(it){return it.title+"$"+it.url}).join("#");',
搜索:'',
搜索:'js:let d=[];let html=request(input);let jsonA=JSON.parse(html.match(/INITIAL_STATE.*?({.*});/)[1]);jsonA=jsonA.result.longVideo.results;jsonA.forEach(function(it){let name=it.name;let introduction=it.introduction;let pic=it.v_picurl;let url=it.tiny_url;let zone=it.zone;let score=it.score||"暂无";let style=it.style;if(it.play.item_list){let r={};r.title=name.replace(//,"").replace(//,"");r.url="https://v.sogou.com"+url;r.desc=it.list_category.join(",");r.content=introduction;r.pic_url=pic;d.push(r)}});setResult(d);',
搜索:'js:var d=[];let html=request(input);let json=JSON.parse(html);json.pageComponentList.forEach(function(it){if(it.hasOwnProperty("commonData")){it=it.commonData;d.push({title:it.titleDTO.displayName,img:it.posterDTO.vThumbUrl,desc:it.stripeBottom,content:it.updateNotice+" "+it.feature,url:"https://search.youku.com/api/search?appScene=show_episode&showIds="+it.showId+"&appCaller=h5"})}});setResult(d);',
}
\ No newline at end of file
......@@ -221,7 +221,6 @@ function maoss(jxurl, ref, key) {
function request(url,obj){
// obj = obj||{'user-agent': MOBILE_UA};
print('224');
let new_obj;
if(typeof(fetch_params)!=='undefined'){
new_obj = obj?Object.assign(fetch_params,obj):fetch_params;
......@@ -242,7 +241,6 @@ function request(url,obj){
}
return html
}
print('245');
return ''
}
......
js:
var d = [];
let html=request(input);
let json = JSON.parse(html);
json.pageComponentList.forEach(function (it){
if (it.hasOwnProperty('commonData')) {
it = it.commonData;
d.push({
title: it.titleDTO.displayName,
img: it.posterDTO.vThumbUrl,
// desc: it.feature,
desc: it.stripeBottom,
content: it.updateNotice+' '+it.feature,
url: 'https://search.youku.com/api/search?appScene=show_episode&showIds=' + it.showId + '&appCaller=h5'
});
}
});
setResult(d);
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册