Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat:更新版本,优化了前面的累积问题
  • Loading branch information
Taois committed Sep 24, 2025
commit f0519ad0bc178ea533667a148cee2dacb633c0b8
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,4 @@ dist
/clipboard.txt
/clipboard.txt.bak
/apps/cat/
/data/temp/
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# drpyS(drpy-node)

nodejs作为服务端的drpy实现。全面升级异步写法
~~积极开发中,每日一更~~,当前进度 `99.9999%`
~~积极开发中,每日一更~~,当前进度 `99.99999%`
~~找工作中,随缘更新~~
上班当牛马,下班要带娃,阶段性佛系趁娃睡觉熬夜更新

Expand Down Expand Up @@ -49,6 +49,10 @@ nodejs作为服务端的drpy实现。全面升级异步写法

## 更新记录

### 20250925

更新至V1.3.5

### 20250919

更新至V1.3.4
Expand Down
8 changes: 8 additions & 0 deletions config/map.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
UC分享@@?type=url&params=../json/UC分享.json@@UC分享[盘]
16wMV[听]@@?type=url&params=../json/十六万歌曲.txt
点歌欢唱[B]@@?type=url&params=../json/十六万歌曲.txt
网盘[模板]@@?type=url&params=../json/域名配置.json$蜡笔@@蜡笔ᵐ[盘]
网盘[模板]@@?type=url&params=../json/域名配置.json$木偶@@木偶ᵐ[盘]
网盘[模板]@@?type=url&params=../json/域名配置.json$玩偶$1@@玩偶ᵐ[盘]
网盘[模板]@@?type=url&params=../json/域名配置.json$虎斑@@虎斑ᵐ[盘]
网盘[模板]@@?type=url&params=../json/域名配置.json$二小@@二小ᵐ[盘]
网盘[模板]@@?type=url&params=../json/域名配置.json$多多@@多多ᵐ[盘]
网盘[模板]@@?type=url&params=../json/域名配置.json$欧歌@@欧歌ᵐ[盘]
网盘[模板]@@?type=url&params=../json/域名配置.json$至臻@@至臻ᵐ[盘]
AppFox@@http://app.hktvyb.cc@@TVB云播[AFX]
AppFox@@{"host":"https://cunchu8.obs.cn-north-4.myhuaweicloud.com/config.json","parse":{"JL4K":"http://194.147.100.155:7891/?url="}}@@火猫影视[AFX]
AppFox@@{"host":"http://kumiao.yzbao.com.cn","parse":{"qq|qiyi|mgtv|youku|bilibili":"https://api.qljson.xyz/api/?key=67f6a108dc6d84eaf81ac58417c1f72a&url="}}@@未来影视[AFX]
Expand Down
2 changes: 1 addition & 1 deletion controllers/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ async function generateSiteJSON(options, requestHost, sub, pwd) {
// console.log(SitesMap);
// console.log(mubanKeys);
// 排除模板后缀的DS源
valid_files = valid_files.filter(it => !/\[模板]\.js$/.test(it));
valid_files = valid_files.filter(it => !/^APP.*\[模板]\.js$/i.test(it));
log(`开始生成ds的t4配置,jsDir:${jsDir},源数量: ${valid_files.length}`);
const tasks = valid_files.map((file) => {
return {
Expand Down
10 changes: 10 additions & 0 deletions docs/updateRecord.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# drpyS更新记录

### 20250925

更新至V1.3.5

1. 修复 `DS_REQ_LIB=0` 时 req系列请求不能正确处理禁止重定向和超时问题
2. 修复 `cut` 逻辑错误导致的`番茄小说`二级无数据,增强字符串的`parseX`改用`JSON5`
3. 新增 `网盘` 模板源及map示例
4. 新收录了几个源
5. 增加 `hikerSkipEr` 属性,允许海阔跳过T4源的形式二级

### 20250919

更新至V1.3.4
Expand Down
76 changes: 76 additions & 0 deletions json/域名配置.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"玩偶": [
"https://wogg.xxooo.cf",
"https://wogg.333232.xyz",
"https://woggpan.333232.xyz",
"https://wogg.heshiheng.top",
"https://www.wogg.one",
"https://www.wogg.lol"
],
"至臻": [
"https://xiaomiai.site",
"http://mihdr.top",
"http://www.miqk.cc"
],
"蜡笔": [
"http://xiaocge.fun",
"https://feimao666.fun",
"http://feimao888.fun",
"http://feimaoai.site",
"http://www.labi88.sbs",
"http://fmao.site",
"https://fmao.shop"
],
"木偶": [
"http://123.666291.xyz",
"https://mogg.5568.eu.org",
"https://mo.666291.xyz",
"http://666.666291.xyz",
"https://mo.muouso.fun"
],
"小米": [
"https://www.54271.fun",
"https://54271.fun",
"https://www.mucpan.cc",
"https://mucpan.cc"
],
"百家": [
"https://bj.jiexi.news",
"http://baijia.filegear-sg.me",
"http://cj.jiexi.news",
"http://baijia.885525.xyz"
],
"二小": [
"https://wexwp.cc",
"https://erxiaofn.click",
"http://2xiaopan.fun",
"http://xhww.net",
"http://www.xhww.net",
"http://www.2xiaopan.fun"
],
"多多": [
"https://tv.yydsys.top",
"https://tv.yydsys.cc"
],
"虎斑": [
"http://103.45.162.207:20720",
"http://xsayang.fun:12512"
],
"欧歌": [
"https://woog.xn--dkw.xn--6qq986b3xl",
"https://woog.nxog.eu.org"
],
"下饭": [
"http://154.204.177.231"
],
"闪电": [
"http://1.95.79.193"
],
"雷鲸": [
"https://leijing.xyz",
"https://leijing1.com"
],
"盘它": [
"https://www.91panta.cn"
]
}
6 changes: 5 additions & 1 deletion libs/drpyS.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ async function invokeMethod(filePath, env, method, args = [], injectVars = {}) {
result = await searchParseAfter(moduleObject, result, args[2]);
log(`[invokeMethod js:] 搜索 ${injectVars.input} 执行完毕,结果为:`, JSON.stringify(result.list.slice(0, 2)));
} else if (method === 'class_parse') {
result = await homeParseAfter(result, moduleObject.类型, moduleObject.hikerListCol, moduleObject.hikerClassListCol, injectVars);
result = await homeParseAfter(result, moduleObject.类型, moduleObject.hikerListCol, moduleObject.hikerClassListCol, moduleObject.hikerSkipEr, injectVars);
}
return result;
}
Expand Down Expand Up @@ -787,6 +787,10 @@ async function initParse(rule, env, vm, context) {
if (!rule.hasOwnProperty('sniffer')) { // 默认关闭辅助嗅探
rule.sniffer = false;
}
// 二级为*自动添加hikerSkipEr属性允许跳过形式二级
if (!rule.hasOwnProperty('hikerSkipEr') && rule.二级 === '*') {
rule.hikerSkipEr = 1;
}
rule.sniffer = rule.hasOwnProperty('sniffer') ? rule.sniffer : '';
rule.sniffer = !!(rule.sniffer && rule.sniffer !== '0' && rule.sniffer !== 'false');
rule.isVideo = rule.hasOwnProperty('isVideo') ? rule.isVideo : '';
Expand Down
8 changes: 6 additions & 2 deletions libs/drpysParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ export async function homeParse(rule) {
return context;
}

export async function homeParseAfter(d, _type, hikerListCol, hikerClassListCol, injectVars) {
export async function homeParseAfter(d, _type, hikerListCol, hikerClassListCol, hikerSkipEr, injectVars) {
if (!d) {
d = {};
}
Expand All @@ -435,6 +435,10 @@ export async function homeParseAfter(d, _type, hikerListCol, hikerClassListCol,
if (hikerClassListCol) {
d.hikerClassListCol = hikerClassListCol;
}
// 跳过形式二级
if (hikerSkipEr) {
d.hikerSkipEr = hikerSkipEr;
}
const {
classes,
filters,
Expand Down Expand Up @@ -1485,7 +1489,7 @@ export async function invokeWithInjectVars(rule, method, injectVars, args) {
}
break;
case 'class_parse':
result = await homeParseAfter(result, rule.类型, rule.hikerListCol, rule.hikerClassListCol, injectVars);
result = await homeParseAfter(result, rule.类型, rule.hikerListCol, rule.hikerClassListCol, rule.hikerSkipEr, injectVars);
break;
case '一级':
result = await cateParseAfter(rule, result, args[1]);
Expand Down
19 changes: 14 additions & 5 deletions libs/dsGlobal.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* 全局模块注册器
*
*
* 将drpy-node项目中的核心模块和工具库注册到全局对象(globalThis)上,
* 使得这些模块可以在整个应用程序中直接访问,无需重复导入。
*
*
* 主要功能:
* - 注册网络请求工具(reqs)
* - 注册加密工具(forge)
Expand All @@ -12,12 +12,12 @@
* - 注册各大网盘服务接口(夸克、UC、阿里、百度等)
* - 注册压缩工具和网络通信组件
* - 注册结果处理函数
*
*
* 使用场景:
* - 在drpy源解析器中直接使用全局工具
* - 在插件开发中访问核心功能
* - 在脚本执行环境中提供统一的API接口
*
*
* @module dsGlobal
* @author drpy-node
* @since 1.0.0
Expand Down Expand Up @@ -87,4 +87,13 @@ globalThis.WebSocket = WebSocket;
globalThis.WebSocketServer = WebSocketServer;

// 结果设置函数 - 用于设置和处理执行结果
globalThis.setResult = setResult;
globalThis.setResult = setResult;

// ds沙箱文件读写函数
globalThis.pathLib = pathLib;

// UA
globalThis.MOBILE_UA = MOBILE_UA;
globalThis.PC_UA = PC_UA;
// 其他常用
globalThis.$js = $js;
6 changes: 3 additions & 3 deletions libs_drpy/drpyCustom.js
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ export const objectToQueryString = (obj) => {

/**
* 获取加密前的原始的js源文本
* @param js_code
* @param {string} js_code
*/
export async function getOriginalJs(js_code) {
// let current_match = /var rule|[\u4E00-\u9FA5]+|function|let |var |const |\(|\)|"|'/;
Expand Down Expand Up @@ -825,8 +825,8 @@ export const jsDecoder = {

/**
* vodDeal函数 - 处理播放源排序和重命名
* @param vod
* @param rule
* @param {Object} vod
* @param {Object} rule
* @returns {*}
*/
export function vodDeal(vod, rule) {
Expand Down
4 changes: 2 additions & 2 deletions libs_drpy/drpyInject.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ async function request(url, opt = {}) {
return {code: resp.status, headers: resHeader, content: responseData};
} catch (error) {
const {response: resp} = error;
console.error(`[request]Request error: ${error.message}`);
console.error(`[request] Request error: ${error.message}`);
let responseData = '';
// console.log('responseData:',responseData);
try {
Expand All @@ -238,7 +238,7 @@ async function request(url, opt = {}) {
responseData = buffer.toString('utf-8');
}
} catch (e) {
console.error(`[request]get error response Text failed: ${e.message}`);
console.error(`[request] get error response Text failed: ${e.message}`);
}
// console.log('responseData:',responseData);
return {
Expand Down
61 changes: 48 additions & 13 deletions libs_drpy/es6-extend.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* ES6扩展和Polyfill库
*
*
* 该文件提供了ES6+特性的polyfill实现,确保在旧版本JavaScript环境中的兼容性
* 包含Object、String、Array等原生对象的方法扩展和自定义工具函数
*
*
* @author drpy
* @version 1.0.0
*/
Expand Down Expand Up @@ -264,19 +264,48 @@ function matchesAll(str, pattern, flatten) {
Object.defineProperties(String.prototype, {
replaceX: {
/**
* 增强的字符串替换方法
* 增强的字符串替换方法 - 支持高级替换逻辑
* @param {RegExp|string} regex - 匹配模式
* @param {string|Function} replacement - 替换内容
* @returns {string} 替换后的字符串
*/
value: function (regex, replacement) {
// 处理字符串类型的正则表达式
if (typeof regex === 'string') {
regex = new RegExp(regex, 'g');
}

// 处理函数类型的替换内容
if (typeof replacement === 'function') {
return this.replace(regex, replacement);
}
return this.replace(regex, replacement || '');

// 处理 null/undefined 的替换内容
replacement = replacement == null ? '' : String(replacement);

// 创建正则表达式副本以避免修改原始对象的 lastIndex
const regexCopy = new RegExp(regex.source, regex.flags);

// 获取所有匹配项
let matches = matchesAll(this, regexCopy, true);

// 如果有多个匹配项,进行高级替换处理
if (matches && matches.length > 1) {
const hasCaptureGroup = /\$\d/.test(replacement);

if (hasCaptureGroup) {
// 有捕获组引用时,使用标准替换
return this.replace(regex, replacement);
} else {
// 无捕获组引用时,对每个完整匹配进行替换
return this.replace(regex, function (match) {
return replacement;
});
}
}

// 单个匹配或无匹配时,使用标准替换
return this.replace(regex, replacement);
},
writable: true,
configurable: true,
Expand All @@ -289,8 +318,9 @@ Object.defineProperties(String.prototype, {
*/
get: function () {
try {
return JSON.parse(this);
return JSON5.parse(this);
} catch (e) {
log(`String.parseX error: ${e.message}`);
return null;
}
},
Expand All @@ -304,23 +334,23 @@ Object.defineProperties(String.prototype, {
* @param {string} text - 要处理的文本
* @param {string} start - 开始标记
* @param {string} end - 结束标记
* @param {string} method - 处理方法
* @param {function|null|undefined} method - 处理方法函数,用于对截取结果进行后处理
* @param {boolean} All - 是否处理所有匹配项
* @returns {string|Array} 处理结果
* @returns {string|Array} 处理结果,单个匹配返回字符串,多个匹配返回数组
*/
function cut(text, start, end, method, All) {
// 实现复杂的文本截取逻辑
if (!text || typeof text !== 'string') return '';

let startIndex = text.indexOf(start);
if (startIndex === -1) return All ? [] : '';

startIndex += start.length;
let endIndex = text.indexOf(end, startIndex);
if (endIndex === -1) return All ? [] : '';
let result = text.substring(startIndex, endIndex);

let result = text.substring(startIndex, endIndex) + end; // 包含 end 标记

if (All) {
let results = [result];
let remainingText = text.substring(endIndex + end.length);
Expand All @@ -330,7 +360,12 @@ function cut(text, start, end, method, All) {
}
return results;
}


// 应用 method 处理函数(如果提供)
if (method && typeof method === 'function') {
result = method(result);
}

return result;
}

Expand Down
Loading