上传文件至「js」

This commit is contained in:
2026-08-15 13:58:46 +02:00
parent 58e6e6100e
commit cc531ffbdb
5 changed files with 11452 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
var rule = {
title:'360影视',
host:'https://www.360kan.com',
homeUrl:'https://api.web.360kan.com/v1/rank?cat=2&size=9',
detailUrl:'https://api.web.360kan.com/v1/detail?cat=fyclass&id=fyid',
searchUrl:'https://api.so.360kan.com/index?force_v=1&kw=**&from=&pageno=fypage&v_ap=1&tab=all',
url:'https://api.web.360kan.com/v1/filter/list?catid=fyclass&rank=rankhot&cat=&year=&area=&act=&size=35&pageno=fypage&callback=',
headers:{
'User-Agent':'MOBILE_UA'
},
timeout:5000,
class_name:'电视剧&电影&综艺&动漫',
class_url:'2&1&3&4',
limit:5,
multi:1,
searchable:2,
play_parse:true,
lazy:'js:input=input.split("?")[0];log(input);',
// 疑似t4专用的
// lazy:'js:input={parse: 1, playUrl: "", jx: 1, url: input.split("?")[0]}',
// 手动调用解析请求json的url,此lazy不方便
// lazy:'js:input="https://cache.json.icu/home/api?type=ys&uid=292796&key=fnoryABDEFJNPQV269&url="+input.split("?")[0];log(input);let html=JSON.parse(request(input));log(html);input=html.url||input',
推荐:'json:data;title;cover;comment;cat+ent_id;description',
一级:'json:data.movies;title;cover;pubdate;id;description',
二级:'',
二级:'js:let html=JSON.parse(fetch(input,fetch_params));let data=html.data;let tilte=data.title;let img=data.cdncover;let vod_type=data.moviecategory.join(",");let area=data.area.join(",");let director=data.director.join(",");let actor=data.actor.join(",");let content=data.description;let base_vod={vod_id:input,vod_name:tilte,type_name:vod_type,vod_actor:actor,vod_director:director,vod_content:content,vod_remarks:area,vod_pic:urljoin2(input,img)};let delta=200;let vod_play={};let sites=data.playlink_sites;sites.forEach(function(site){let playList="";let vodItems=[];if(data.allupinfo){let total=parseInt(data.allupinfo[site]);for(let j=1;j<total;j+=delta){let end=Math.min(total,j+delta-1);let url2=buildUrl(input,{start:j,end:end,site:site});let vod_data=JSON.parse(fetch(url2),fetch_params).data;if(vod_data.allepidetail){vod_data=vod_data.allepidetail[site];vod_data.forEach(function(item,index){vodItems.push((item.playlink_num||"")+"$"+urlDeal(item.url||""))})}else{vod_data=vod_data.defaultepisode;vod_data.forEach(function(item,index){vodItems.push((item.period||"")+(item.name||"")+"$"+urlDeal(item.url)||"")})}}}else{let item=data.playlinksdetail[site];vodItems.push((item.sort||"")+"$"+urlDeal(item.default_url||""))}if(vodItems.length>0){playList=vodItems.join("#")}if(playList.length<1){return}vod_play[site]=playList});let tabs=Object.keys(vod_play);let playUrls=[];for(let id in tabs){print("id:"+id);playUrls.push(vod_play[tabs[id]])}if(tabs.length>0){let vod_play_from=tabs.join("$$$");let vod_play_url=playUrls.join("$$$");base_vod.vod_play_from=vod_play_from;base_vod.vod_play_url=vod_play_url}VOD=base_vod;',
搜索:'json:data.longData.rows;titleTxt||titlealias;cover;cat_name;cat_id+en_id;description',
}
+109
View File
@@ -0,0 +1,109 @@
/**
* 传参 ?type=url&params=http://122.228.85.203:1000@泽少1
* 传参 ?type=url&params=http://122.228.85.203:1000@泽少2
*/
var rule = {
title: 'APPV2[模板]',
author: '道长',
version: '20241012 beta1',
update_info: `
20241012:
1.根据群友嗷呜的appv2模板修改成可传参源,类似采集之王用法传参
`.trim(),
host: '',
url: '/api.php/app/video?tid=fyclassfyfilter&limit=20&pg=fypage',
filter_url: '',
filter: {},
homeUrl: '/api.php/app/index_video',
detailUrl: '/api.php/app/video_detail?id=fyid',
searchUrl: '/api.php/app/search?text=**&pg=fypage',
parseUrl: '',
searchable: 2,
quickSearch: 1,
filterable: 1,
headers: {
'User-Agent': 'okhttp/4.1.0'
},
params: 'http://122.228.85.203:1000$http://122.228.85.203:1000/play?url=',
hostJs: $js.toString(() => {
HOST = rule.params.split('$')[0];
}),
预处理: $js.toString(() => {
log(`传入参数:${rule.params}`);
let _host = rule.params.split('$')[0];
rule.parseUrl = rule.params.split('$')[1];
let _url = _host.rstrip('/') + '/api.php/app/nav?token';
let _headers = {'User-Agent': 'Dart/2.14 (dart:io)'};
let html = request(_url, {headers: _headers});
let data = JSON.parse(html);
let _classes = [];
let _filter = {};
let _filter_url = '';
let dy = {"class": "类型", "area": "地区", "lang": "语言", "year": "年份", "letter": "字母", "by": "排序"};
let jsonData = data.list;
for (let k = 0; k < jsonData.length; k++) {
let hasNonEmptyField = false;
let _obj = {
type_name: jsonData[k].type_name,
type_id: jsonData[k].type_id,
};
_classes.push(_obj);
for (let key in dy) {
if (key in jsonData[k].type_extend && jsonData[k].type_extend[key].trim() !== "") {
hasNonEmptyField = true;
break
}
}
if (hasNonEmptyField) {
_filter[String(jsonData[k].type_id)] = [];
for (let dkey in jsonData[k].type_extend) {
if (dkey in dy && jsonData[k].type_extend[dkey].trim() !== "") {
if (k === 0) {
_filter_url += `&${dkey}={{fl.${dkey}}}`
}
let values = jsonData[k].type_extend[dkey].split(',');
let valueArray = values.map(value => ({"n": value.trim(), "v": value.trim()}));
_filter[String(jsonData[k].type_id)].push({"key": dkey, "name": dy[dkey], "value": valueArray})
}
}
}
}
rule.classes = _classes;
rule.filter = _filter;
rule.filter_url = _filter_url;
}),
class_parse: $js.toString(() => {
input = rule.classes;
}),
play_parse: true,
lazy: $js.toString(() => {
if (!/^http/.test(input)) {
input = rule.parseUrl + input
} else {
input = {
url: input,
parse: 0,
header: ''
}
}
}),
推荐: $js.toString(() => {
let data = JSON.parse(request(input)).list;
let com = [];
data.forEach(item => {
if (Array.isArray(item.vlist) && item.vlist.length !== 0) {
com = com.concat(item.vlist)
}
})
VODS = com
}),
一级: $js.toString(() => {
VODS = JSON.parse(request(input)).list
}),
二级: $js.toString(() => {
VOD = JSON.parse(request(input)).data
}),
搜索: '*',
}
+70
View File
@@ -0,0 +1,70 @@
[
{
"share_name": "优品阁",
"share_id": "uWa9gbM3RJ7"
},
{
"share_name": "阿里1T",
"share_id": "mxAfB6eRgY4"
},
{
"share_name": "平凡中的",
"share_id": "4ydLxf7VgH7"
},
{
"share_name": "tacit0924",
"share_id": "DNgnCudf4cD?pwd=6666"
},
{
"share_name": "黄妈",
"share_id": "4bGRVUdUtct"
},
{
"share_name": "YYDSVIP",
"share_id": "dieULBdYP3D"
},
{
"share_name": "优源阁",
"share_id": "RnjUi1urdb2"
},
{
"share_name": "风流动漫",
"share_id": "WdaaeX7HK44"
},
{
"share_name": "风流剧集",
"share_id": "kgxWjZsK6bq"
},
{
"share_name": "xiaaluo",
"share_id": "sg8CdGUwmUr"
},
{
"share_name": "4K影视",
"share_id": "wHPKUENKFsS"
},
{
"share_name": "诺兰全集",
"share_id": "gf2GebXnZHh"
},
{
"share_name": "纪录片",
"share_id": "fSNHaYST47s"
},
{
"share_name": "掌灯者|港",
"share_id": "wHPKUENKFsS"
},
{
"share_name": "掌灯者|一",
"share_id": "wHPKUENKFsS"
},
{
"share_name": "掌灯者|二",
"share_id": "wHPKUENKFsS"
},
{
"share_name": "掌灯者|三",
"share_id": "wHPKUENKFsS"
}
]
+300
View File
@@ -0,0 +1,300 @@
/*
@header({
searchable: 1,
filterable: 1,
quickSearch: 0,
title: 'SaoHuo',
lang: 'cat'
})
*/
import { load } from 'assets://js/lib/cat.js';
let host = 'https://shdy2.com';
let cookie = '';
const headers = {
'User-Agent': 'Mozilla/5.0 (Linux; Android 9; ALN-AL00 Build/PQ3B.190801.05281406; wv) AppleWebKit/537.36',
'accept-language': 'zh-CN,zh;q=0.9'
};
async function request(url, options = {}) {
try {
let hdrs = { ...headers, ...options.headers };
if (cookie) hdrs['Cookie'] = cookie;
let res = await req(url, { headers: hdrs, ...options });
let setCookie = res.headers && res.headers['set-cookie'];
if (setCookie) cookie = Array.isArray(setCookie) ? setCookie.join('; ') : setCookie;
return res.content || '';
} catch (e) {
console.log('[请求失败] ' + url + ' - ' + e.message);
return '';
}
}
async function init(ext) {
if (typeof ext === 'string' && ext.trim().length > 0) host = ext.trim();
console.log('[当前域名] ' + host);
await request(host);
}
function home() {
const classes = [
{ type_id: '1', type_name: '电影' },
{ type_id: '2', type_name: '电视剧' },
{ type_id: '4', type_name: '动漫' }
];
const filters = {
"1": [{ "key": "cateId", "name": "类型", "value": [
{ "n": "全部", "v": "1" }, { "n": "喜剧", "v": "6" }, { "n": "爱情", "v": "7" },
{ "n": "恐怖", "v": "8" }, { "n": "动作", "v": "9" }, { "n": "科幻", "v": "10" },
{ "n": "战争", "v": "11" }, { "n": "犯罪", "v": "12" }, { "n": "动画", "v": "13" },
{ "n": "奇幻", "v": "14" }, { "n": "剧情", "v": "15" }, { "n": "冒险", "v": "16" },
{ "n": "悬疑", "v": "17" }, { "n": "惊悚", "v": "18" }, { "n": "其他", "v": "20" }
]}],
"2": [{ "key": "cateId", "name": "类型", "value": [
{ "n": "全部", "v": "2" }, { "n": "国产剧", "v": "20" }, { "n": "TVB", "v": "21" },
{ "n": "韩剧", "v": "22" }, { "n": "美剧", "v": "23" }, { "n": "日剧", "v": "24" },
{ "n": "英剧", "v": "25" }, { "n": "台剧", "v": "26" }, { "n": "其他", "v": "27" }
]}],
"4": [{ "key": "cateId", "name": "类型", "value": [
{ "n": "全部", "v": "4" }, { "n": "搞笑", "v": "38" }, { "n": "恋爱", "v": "39" },
{ "n": "热血", "v": "40" }, { "n": "格斗", "v": "41" }, { "n": "美少女", "v": "42" },
{ "n": "魔法", "v": "43" }, { "n": "机战", "v": "44" }, { "n": "校园", "v": "45" },
{ "n": "亲子", "v": "46" }, { "n": "童话", "v": "47" }, { "n": "冒险", "v": "48" },
{ "n": "真人", "v": "49" }, { "n": "LOLI", "v": "50" }, { "n": "其他", "v": "51" }
]}]
};
return JSON.stringify({ class: classes, filters: filters });
}
async function homeVod() {
if (!host || typeof host !== 'string') { host = 'https://shdy2.com'; await init(); }
let html = await request(host);
if (!html) return JSON.stringify({ list: [] });
const $ = load(html);
let list = [];
$('.v_list li, .module-item, .myui-vodlist__box, .stui-vodlist__box, li.vodlist_box').each((i, el) => {
if (i >= 6) return false;
let a = $(el).find('a').first();
let href = a.attr('href') || '';
let title = a.attr('title') || '';
let pic = a.find('img').attr('data-original') || a.find('img').attr('src') || '';
let remarks = $(el).find('.v_note, .continu, .pic-text, .pic-tag, .module-item-note').first().text().trim();
if (title && href) {
list.push({
vod_id: href.startsWith('http') ? href : (host + href),
vod_name: title,
vod_pic: pic.startsWith('http') ? pic : (host + pic),
vod_remarks: remarks
});
}
});
return JSON.stringify({ list });
}
async function category(tid, pg, filter, extend) {
if (!host || typeof host !== 'string') { host = 'https://shdy2.com'; await init(); }
let page = parseInt(pg) || 1;
let cateId = (extend && extend.cateId) || tid;
let url = host + '/list/' + cateId;
if (page > 1) url += '-' + page;
url += '.html';
console.log('[category] ' + url);
let html = await request(url);
if (!html) return JSON.stringify({ list: [], page, pagecount: 1 });
const $ = load(html);
let list = [];
$('.v_list li, .module-item, .myui-vodlist__box, .stui-vodlist__box, li.vodlist_box').each((i, el) => {
let a = $(el).find('a').first();
let href = a.attr('href') || '';
let title = a.attr('title') || '';
let pic = a.find('img').attr('data-original') || a.find('img').attr('src') || '';
let remarks = $(el).find('.v_note, .continu, .pic-text, .pic-tag, .module-item-note').first().text().trim();
if (title && href) {
list.push({
vod_id: href.startsWith('http') ? href : (host + href),
vod_name: title,
vod_pic: pic.startsWith('http') ? pic : (host + pic),
vod_remarks: remarks
});
}
});
let pagecount = page;
let pageLinks = $('.page a, .pagination a, #page a, .pages a');
if (pageLinks.length > 0) {
let maxPage = 0;
pageLinks.each((i, el) => {
let m = ($(el).attr('href') || '').match(/[-_](\d+)\.html/);
if (m && m[1]) {
let p = parseInt(m[1]);
if (p > maxPage) maxPage = p;
}
});
if (maxPage > 0) pagecount = maxPage;
} else if (list.length >= 10) {
pagecount = page + 1;
}
return JSON.stringify({ list, page, pagecount, limit: list.length, total: pagecount * list.length });
}
async function detail(id) {
if (!host || typeof host !== 'string') { host = 'https://shdy2.com'; await init(); }
let url = id.startsWith('http') ? id : (host + id);
let html = await request(url);
if (!html) return JSON.stringify({ list: [] });
const $ = load(html);
let vod_name = $('h1.v_title, h1.title').first().text().trim().replace(/\s*-.*$/, '');
let vod_pic = $('img.lazyload').first().attr('data-original') || $('img.lazyload').first().attr('src') || '';
if (vod_pic && !vod_pic.startsWith('http')) vod_pic = host + vod_pic;
let vod_remarks = $('.score, .text-red').text().trim();
let type_name = '', vod_area = '', vod_year = '', vod_director = '', vod_actor = '';
let infoStr = $('.v_info_box p').first().text().trim() || $('.myui-content__detail > p.data').first().text().trim();
if (infoStr) {
let segs = infoStr.split('/').map(s => s.trim());
if (segs.length >= 3) {
vod_area = segs[0];
vod_year = segs[1];
type_name = segs[2];
for (let seg of segs.slice(3)) {
if (seg.startsWith('导演:')) vod_director = seg.replace('导演:', '').trim();
else if (seg.startsWith('主演:')) {
vod_actor = seg.replace('主演:', '').trim();
vod_actor = vod_actor.replace(/剧情介绍.*$/, '').trim();
}
}
}
}
if (!type_name) type_name = $('.myui-content__detail > p.data:contains("分类:")').text().replace('分类:', '').trim();
if (!vod_area) vod_area = $('.myui-content__detail > p.data:contains("地区:")').text().replace('地区:', '').trim();
if (!vod_year) {
let m = ($('.myui-content__detail > p.data:contains("年份:")').text() || '').match(/(\d{4})/);
if (m) vod_year = m[1];
}
if (!vod_director) {
let t = $('.myui-content__detail > p.data:contains("导演:")').text().replace('导演:', '').trim();
if (t) vod_director = t;
}
if (!vod_actor) {
let t = $('.myui-content__detail > p.data:contains("主演:")').text().replace('主演:', '').trim();
if (t) {
t = t.replace(/剧情介绍.*$/, '').trim();
vod_actor = t;
}
}
let vod_content = $('.intro, .des, p.p_txt').text().trim() || $('#info_more, .detail-content').text().trim();
// 播放列表(强制正序)
let sourceNames = [];
let sourceUrls = [];
const fromList = $('.play_from ul.from_list li');
const linkBlocks = $('#play_link > li');
if (fromList.length && linkBlocks.length && fromList.length === linkBlocks.length) {
fromList.each((i, el) => {
sourceNames.push($(el).text().trim());
let episodes = [];
linkBlocks.eq(i).find('a').each((j, a) => {
let href = $(a).attr('href') || '';
let text = $(a).text().trim();
let num = parseInt(text.replace(/[^0-9]/g, ''));
if (isNaN(num)) num = j + 1;
episodes.push({ text, href, num });
});
episodes.sort((a, b) => a.num - b.num);
sourceUrls.push(episodes.map(ep => ep.text + '$' + ep.href).join('#'));
});
} else if (linkBlocks.length) {
linkBlocks.each((i, el) => {
sourceNames.push('线路' + (i + 1));
let episodes = [];
$(el).find('a').each((j, a) => {
let href = $(a).attr('href') || '';
let text = $(a).text().trim();
let num = parseInt(text.replace(/[^0-9]/g, ''));
if (isNaN(num)) num = j + 1;
episodes.push({ text, href, num });
});
episodes.sort((a, b) => a.num - b.num);
sourceUrls.push(episodes.map(ep => ep.text + '$' + ep.href).join('#'));
});
} else {
let panels = $('.myui-panel_bd .myui-content__list');
let titles = $('.myui-panel__head a + h3.title');
titles.each((i, el) => {
sourceNames.push($(el).text().trim());
let episodes = [];
let panel = panels.eq(i);
if (panel.length) {
panel.find('a').each((j, a) => {
let href = $(a).attr('href') || '';
let text = $(a).text().trim();
let num = parseInt(text.replace(/[^0-9]/g, ''));
if (isNaN(num)) num = j + 1;
episodes.push({ text, href, num });
});
episodes.sort((a, b) => a.num - b.num);
sourceUrls.push(episodes.map(ep => ep.text + '$' + ep.href).join('#'));
}
});
}
return JSON.stringify({
list: [{
vod_id: id,
vod_name,
vod_pic,
vod_content,
vod_play_from: sourceNames.join('$$$'),
vod_play_url: sourceUrls.join('$$$'),
vod_director,
vod_actor,
type_name,
vod_area,
vod_year,
vod_remarks
}]
});
}
async function search(wd, quick, pg) {
if (!host || typeof host !== 'string') { host = 'https://shdy2.com'; await init(); }
let html = await request(host + '/s----------.html?wd=' + encodeURIComponent(wd));
if (!html) return JSON.stringify({ list: [] });
const $ = load(html);
let list = [];
$('.v_list li, .module-item, .myui-vodlist__box, .stui-vodlist__box, li.vodlist_box').each((i, el) => {
let a = $(el).find('a').first();
let href = a.attr('href') || '';
let title = a.attr('title') || '';
let pic = a.find('img').attr('data-original') || a.find('img').attr('src') || '';
let remarks = $(el).find('.v_note, .continu, .pic-text').first().text().trim();
if (title && href) {
list.push({
vod_id: href.startsWith('http') ? href : (host + href),
vod_name: title,
vod_pic: pic.startsWith('http') ? pic : (host + pic),
vod_remarks: remarks
});
}
});
return JSON.stringify({ list });
}
async function play(flag, id, flags) {
let finalUrl = id;
if (!finalUrl.startsWith('http')) {
if (!host) await init();
finalUrl = host + finalUrl;
}
return JSON.stringify({ parse: 1, url: finalUrl, jx: 0 });
}
export function __jsEvalReturn() {
return { init, home, homeVod, category, detail, play, search };
}
+10945
View File
File diff suppressed because it is too large Load Diff