From 345025c4e8972d2026a8a47a160a4a691a66e8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=9A=E9=A3=8E=E6=8B=82=E6=9F=B3=E9=A2=9C?= <434857005@qq.com> Date: Tue, 25 Feb 2025 18:15:11 +0800 Subject: [PATCH 1/9] =?UTF-8?q?update:=20=E5=8F=91=E5=B8=83=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v1.1.20 --- README.md | 4 + apps/cookie-butler/index.html | 2 + apps/cookie-butler/static/js/cookie.js | 2 +- apps/cookie-butler/static/js/core.js | 201 +++++++++++++++++- apps/cookie-butler/static/js/crypto-js.min.js | 1 + docs/updateRecord.md | 11 +- ...\345\244\232\345\244\232[\347\233\230].js" | 22 +- ...\346\234\250\345\201\266[\347\233\230].js" | 22 +- ...\346\254\247\345\223\245[\347\233\230].js" | 22 +- ...\344\270\213\351\245\255[\347\233\230].js" | 24 +-- ...\345\223\245\345\223\245[\347\233\230].js" | 22 +- ...\350\207\263\350\207\273[\347\233\230].js" | 22 +- ...\350\231\216\346\226\221[\347\233\230].js" | 22 +- ...\350\234\241\347\254\224[\347\233\230].js" | 22 +- ...\344\274\230\346\261\220[\347\233\230].js" | 22 +- package.json | 5 +- public/index.html | 2 + utils/database.js | 95 ++++----- utils/uc.js | 159 ++++++++++++-- 19 files changed, 432 insertions(+), 250 deletions(-) create mode 100644 apps/cookie-butler/static/js/crypto-js.min.js diff --git a/README.md b/README.md index fc83974..f650d25 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,10 @@ nodejs作为服务端的drpy实现。全面升级异步写法 ## 更新记录 +### 20250225 + +更新至V1.1.20 + ### 20250224 更新至V1.1.19 diff --git a/apps/cookie-butler/index.html b/apps/cookie-butler/index.html index c9e24cc..c313001 100644 --- a/apps/cookie-butler/index.html +++ b/apps/cookie-butler/index.html @@ -9,6 +9,7 @@ + @@ -19,6 +20,7 @@
>>0?1:0),m=a.low=m+O,a.high=k+W+(m>>>0 更新至V1.1.20 更新至V1.1.19 更新至V1.1.21 更新至V1.1.20 更新至V1.1.22 更新至V1.1.21 nodejs作为服务端的drpy实现。全面升级异步写法 nodejs作为服务端的drpy实现。全面升级异步写法 更新至V1.1.23 更新至V1.1.22drpyS(drpy-node)
更新记录
+20250225
+20250224
20250211
diff --git a/utils/database.js b/utils/database.js
index fa41812..a9f991f 100644
--- a/utils/database.js
+++ b/utils/database.js
@@ -1,66 +1,25 @@
-import sqlite3 from 'sqlite3'
-import {open} from 'sqlite'
+// 1️⃣ 导入时用别名重命名原模块的 Database
+import pkg from 'node-sqlite3-wasm';
+
+const {Database: SQLite3Database} = pkg; // 👈 关键别名
import {fileURLToPath} from "url";
import path from 'path';
-async function main() {
- // 打开数据库(若不存在则创建)
- const db = await open({
- filename: '../database.db',
- driver: sqlite3.Database
- });
-
- // 创建表
- await db.run(`
- CREATE TABLE IF NOT EXISTS users (
- id INTEGER PRIMARY KEY AUTOINCREMENT,
- name TEXT NOT NULL
- )
- `);
-
- // 插入数据
- await db.run('INSERT INTO users (name) VALUES (?)', ['Alice']);
- await db.run('INSERT INTO users (name) VALUES (?)', ['Bob']);
-
- // 查询数据
- const users = await db.all('SELECT * FROM users');
- console.log(users);
-
- // 更新数据
- await db.run('UPDATE users SET name = ? WHERE id = ?', ['Charlie', 1]);
-
- // 查询更新后的数据
- const updatedUsers = await db.all('SELECT * FROM users');
- console.log(updatedUsers);
-
- // 删除数据
- await db.run('DELETE FROM users WHERE id = ?', [2]);
-
- // 查询删除后的数据
- const finalUsers = await db.all('SELECT * FROM users');
- console.log(finalUsers);
-
- // 关闭数据库
- await db.close();
-}
-
-// main().catch(err => console.error(err));
+// 2️⃣ 定义你的自定义类(可继承/扩展/完全重写)
export class DataBase {
constructor(db_file) {
this.db_file = db_file || './database.db';
this.db = null;
}
+ // 自定义方法
async initDb() {
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const __rootPath = path.join(__dirname, '../');
const __dbpath = path.join(__rootPath, this.db_file);
// console.log('__dbpath:', __dbpath);
- const db = await open({
- filename: __dbpath,
- driver: sqlite3.Database
- });
+ const db = new SQLite3Database(__dbpath);
this.db = db;
return db
}
@@ -79,4 +38,44 @@ export class DataBase {
}
}
+async function main() {
+ // 打开数据库(若不存在则创建)
+ const db = new SQLite3Database("../database.db");
+
+ // 创建表
+ db.run(`
+ CREATE TABLE IF NOT EXISTS users (
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ name TEXT NOT NULL
+ )
+ `);
+
+ // 插入数据
+ db.run('INSERT INTO users (name) VALUES (?)', ['Alice']);
+ db.run('INSERT INTO users (name) VALUES (?)', ['Bob']);
+
+ // 查询数据
+ const users = db.all('SELECT * FROM users');
+ console.log(users);
+
+ // 更新数据
+ db.run('UPDATE users SET name = ? WHERE id = ?', ['Charlie', 1]);
+
+ // 查询更新后的数据
+ const updatedUsers = db.all('SELECT * FROM users');
+ console.log(updatedUsers);
+
+ // 删除数据
+ db.run('DELETE FROM users WHERE id = ?', [2]);
+
+ // 查询删除后的数据
+ const finalUsers = db.all('SELECT * FROM users');
+ console.log(finalUsers);
+
+ // 关闭数据库
+ db.close();
+}
+
export const database = new DataBase('./database.db');
+
+// main().catch(err => console.error(err));
diff --git a/utils/uc.js b/utils/uc.js
index 483ef33..5eec95e 100644
--- a/utils/uc.js
+++ b/utils/uc.js
@@ -24,6 +24,19 @@ class UCHandler {
this.maxCache = 1024 * 1024 * 100;
this.urlHeadCache = {};
this.subtitleExts = ['.srt', '.ass', '.scc', '.stl', '.ttml'];
+ this.Addition = {
+ DeviceID: '07b48aaba8a739356ab8107b5e230ad4',
+ RefreshToken: '',
+ AccessToken: ''
+ }
+ this.conf = {
+ api: "https://open-api-drive.uc.cn",
+ clientID: "5acf882d27b74502b7040b0c65519aa7",
+ signKey: "l3srvtd7p42l0d0x1u8d7yc8ye9kki4d",
+ appVer: "1.6.8",
+ channel: "UCTVOFFICIALWEB",
+ codeApi: "http://api.extscreen.com/ucdrive",
+ };
}
@@ -33,6 +46,10 @@ class UCHandler {
return ENV.get('uc_cookie');
}
+ get token() {
+ return ENV.get('uc_token_cookie');
+ }
+
getShareData(url) {
let matches = this.regex.exec(url);
if (matches[1].indexOf("?") > 0) {
@@ -386,6 +403,19 @@ class UCHandler {
}
}
+ generateDeviceID(timestamp) {
+ return CryptoJS.MD5(timestamp).toString().slice(0, 16); // 取前16位
+ }
+
+ generateReqId(deviceID, timestamp) {
+ return CryptoJS.MD5(deviceID + timestamp).toString().slice(0, 16);
+ }
+
+ generateXPanToken(method, pathname, timestamp, key) {
+ const data = method + '&' + pathname + '&' + timestamp + '&' + key;
+ return CryptoJS.SHA256(data).toString();
+ }
+
async getDownload(shareId, stoken, fileId, fileToken, clean) {
@@ -398,32 +428,85 @@ class UCHandler {
this.saveFileIdCaches[fileId] = saveFileId;
}
+ if (this.token) {
+ let video = []
+ const pathname = '/file';
+ const timestamp = Math.floor(Date.now() / 1000).toString() + '000'; // 13位时间戳需调整
+ const deviceID = this.Addition.DeviceID || this.generateDeviceID(timestamp);
+ const reqId = this.generateReqId(deviceID, timestamp);
+ const x_pan_token = this.generateXPanToken("GET", pathname, timestamp, this.conf.signKey);
+ let config = {
+ method: 'GET',
+ url: `https://open-api-drive.uc.cn/file`,
+ params: {
+ req_id: reqId,
+ access_token: this.token,
+ app_ver: this.conf.appVer,
+ device_id: deviceID,
+ device_brand: 'Xiaomi',
+ platform: 'tv',
+ device_name: 'M2004J7AC',
+ device_model: 'M2004J7AC',
+ build_device: 'M2004J7AC',
+ build_product: 'M2004J7AC',
+ device_gpu: 'Adreno (TM) 550',
+ activity_rect: '{}',
+ channel: this.conf.channel,
+ method: "streaming",
+ group_by: "source",
+ fid: this.saveFileIdCaches[fileId],
+ resolution: "low,normal,high,super,2k,4k",
+ support: "dolby_vision"
+ },
+ headers: {
+ 'User-Agent': 'Mozilla/5.0 (Linux; U; Android 9; zh-cn; RMX1931 Build/PQ3A.190605.05081124) AppleWebKit/533.1 (KHTML, like Gecko) Mobile Safari/533.1',
+ 'Connection': 'Keep-Alive',
+ 'Accept-Encoding': 'gzip',
+ 'x-pan-tm': timestamp,
+ 'x-pan-token': x_pan_token,
+ 'content-type': 'text/plain;charset=UTF-8',
+ 'x-pan-client-id': this.conf.clientID
+ }
+ }
+ let req = await axios.request(config);
+ if (req.status === 200) {
+ let videoInfo = req.data.data.video_info
+ videoInfo.forEach((item) => {
+ video.push({
+ name: item.resolution,
+ url: item.url
+ })
+ })
+ return video;
+ }
+ } else {
+ const down = await this.api(`file/download?${this.pr}`, {
- const down = await this.api(`file/download?${this.pr}&sys=win32&ve=1.8.5&ut=Nk3UvPSOMurIrtiKrHXzCmx/iPIGIRI1HG5yX5zQL7ln7A%3D%3D`, {
-
- fids: [this.saveFileIdCaches[fileId]],
+ fids: [this.saveFileIdCaches[fileId]],
- });
+ });
- if (down.data) {
- const low_url = down.data[0].download_url;
- const low_cookie = this.cookie;
- const low_headers = {
- "Referer": "https://drive.uc.cn/",
- "cookie": low_cookie,
- "User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) quark-cloud-drive/2.5.20 Chrome/100.0.4896.160 Electron/18.3.5.4-b478491100 Safari/537.36 Channel/pckk_other_ch'
- };
- // console.log('low_url:', low_url);
- const test_result = await this.testSupport(low_url, low_headers);
- // console.log('test_result:', test_result);
- if (!test_result[0]) {
- try {
- await this.refreshUcCookie('getDownload');
- } catch (e) {
- console.log(`getDownload:自动刷新UC cookie失败:${e.message}`)
+ if (down.data) {
+ const low_url = down.data[0].download_url;
+ const low_cookie = this.cookie;
+ const low_headers = {
+ "Referer": "https://drive.uc.cn/",
+ "cookie": low_cookie,
+ "User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) quark-cloud-drive/2.5.20 Chrome/100.0.4896.160 Electron/18.3.5.4-b478491100 Safari/537.36 Channel/pckk_other_ch'
+ };
+ // console.log('low_url:', low_url);
+ const test_result = await this.testSupport(low_url, low_headers);
+ // console.log('test_result:', test_result);
+ if (!test_result[0]) {
+ try {
+ await this.refreshUcCookie('getDownload');
+ } catch (e) {
+ console.log(`getDownload:自动刷新UC cookie失败:${e.message}`)
+ }
}
+ return down.data[0];
}
- return down.data[0];
+
}
@@ -431,6 +514,40 @@ class UCHandler {
}
+ async getLazyResult(downCache, mediaProxyUrl) {
+ const urls = [];
+
+ downCache.forEach((it) => {
+ urls.push(it.name, it.url);
+ });
+
+ return {parse: 0, url: urls}
+
+ /*
+ // 旧的加速写法
+ const downUrl = downCache.download_url;
+ const headers = {
+ "Referer": "https://drive.uc.cn/",
+ "cookie": this.cookie,
+ "User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) quark-cloud-drive/2.5.20 Chrome/100.0.4896.160 Electron/18.3.5.4-b478491100 Safari/537.36 Channel/pckk_other_ch'
+ };
+ urls.push("UC原画", downUrl);
+ urls.push("原代服", mediaProxyUrl + `?thread=${ENV.get('thread') || 6}&form=urlcode&randUa=1&url=` + encodeURIComponent(downUrl) + '&header=' + encodeURIComponent(JSON.stringify(headers)));
+ if (ENV.get('play_local_proxy_type', '1') === '2') {
+ urls.push("原代本", `http://127.0.0.1:7777/?thread=${ENV.get('thread') || 6}&form=urlcode&randUa=1&url=` + encodeURIComponent(downUrl) + '&header=' + encodeURIComponent(JSON.stringify(headers)));
+ } else {
+ urls.push("原代本", `http://127.0.0.1:5575/proxy?thread=${ENV.get('thread') || 6}&chunkSize=256&url=` + encodeURIComponent(downUrl));
+ }
+
+ return {
+ parse: 0,
+ url: urls,
+ header: headers,
+ }
+ */
+
+ }
+
async testSupport(url, headers) {
From 03bbaf568105aa1ef7fda2cc0edbaa06e66bc3cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=99=9A=E9=A3=8E=E6=8B=82=E6=9F=B3=E9=A2=9C?=
<434857005@qq.com>
Date: Tue, 25 Feb 2025 18:50:55 +0800
Subject: [PATCH 2/9] =?UTF-8?q?fix:=20=E6=8E=A8=E9=80=81UC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
推送忘改了
---
js/push_agent.js | 23 +++--------------------
1 file changed, 3 insertions(+), 20 deletions(-)
diff --git a/js/push_agent.js b/js/push_agent.js
index be8b47f..85bdb8c 100644
--- a/js/push_agent.js
+++ b/js/push_agent.js
@@ -254,30 +254,13 @@ var rule = {
}
}
if (flag.startsWith('UC-')) {
- log("UC网盘解析开始")
+ console.log("UC网盘解析开始");
if (!UCDownloadingCache[ids[1]]) {
const down = await UC.getDownload(ids[0], ids[1], ids[2], ids[3], true);
if (down) UCDownloadingCache[ids[1]] = down;
}
- downUrl = UCDownloadingCache[ids[1]].download_url;
- const headers = {
- "Referer": "https://drive.uc.cn/",
- "cookie": UC.cookie,
- "User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) quark-cloud-drive/2.5.20 Chrome/100.0.4896.160 Electron/18.3.5.4-b478491100 Safari/537.36 Channel/pckk_other_ch'
- };
- urls.push("UC原画", downUrl);
-
- urls.push("原代服", mediaProxyUrl + `?thread=${ENV.get('thread') || 6}&form=urlcode&randUa=1&url=` + encodeURIComponent(downUrl) + '&header=' + encodeURIComponent(JSON.stringify(headers)));
- if (ENV.get('play_local_proxy_type', '1') === '2') {
- urls.push("原代本", `http://127.0.0.1:7777/?thread=${ENV.get('thread') || 6}&form=urlcode&randUa=1&url=` + encodeURIComponent(downUrl) + '&header=' + encodeURIComponent(JSON.stringify(headers)));
- } else {
- urls.push("原代本", `http://127.0.0.1:5575/proxy?thread=${ENV.get('thread') || 6}&chunkSize=256&url=` + encodeURIComponent(downUrl));
- }
- return {
- parse: 0,
- url: urls,
- header: headers,
- }
+ const downCache = UCDownloadingCache[ids[1]];
+ return await UC.getLazyResult(downCache, mediaProxyUrl)
}
if (flag.startsWith('Ali-')) {
const transcoding_flag = {
From ffd3c509e741ddf5bbefc011f6f148060db1aebb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=99=9A=E9=A3=8E=E6=8B=82=E6=9F=B3=E9=A2=9C?=
<434857005@qq.com>
Date: Thu, 27 Feb 2025 00:15:36 +0800
Subject: [PATCH 3/9] add: 123
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
123网盘可推送观看
---
README.md | 4 +
docs/updateRecord.md | 6 +
js/push_agent.js | 47 +++-
...76\347\275\256\344\270\255\345\277\203.js" | 1 +
libs/drpyS.js | 3 +
public/index.html | 2 +
utils/pan123.js | 223 ++++++++++++++++++
7 files changed, 282 insertions(+), 4 deletions(-)
create mode 100644 utils/pan123.js
diff --git a/README.md b/README.md
index f650d25..96fd93a 100644
--- a/README.md
+++ b/README.md
@@ -19,6 +19,10 @@ nodejs作为服务端的drpy实现。全面升级异步写法
## 更新记录
+### 20250226
+
+更新至V1.1.21
+
### 20250225
更新至V1.1.20
diff --git a/docs/updateRecord.md b/docs/updateRecord.md
index fd01646..5fea507 100644
--- a/docs/updateRecord.md
+++ b/docs/updateRecord.md
@@ -1,5 +1,11 @@
# drpyS更新记录
+### 20250226
+
+更新至V1.1.21
+
+1. 增加123网盘的逻辑和推送示例
+
### 20250225
更新至V1.1.20
diff --git a/js/push_agent.js b/js/push_agent.js
index 85bdb8c..38acfae 100644
--- a/js/push_agent.js
+++ b/js/push_agent.js
@@ -56,7 +56,7 @@ var rule = {
let list = input.split('@');
// log(list);
for (let i = 0; i < list.length; i++) {
- if (/pan.quark.cn|drive.uc.cn|www.alipan.com|www.aliyundrive.com|cloud.189.cn|yun.139.com/.test(list[i])) {
+ if (/pan.quark.cn|drive.uc.cn|www.alipan.com|www.aliyundrive.com|cloud.189.cn|yun.139.com|www.123684.com/.test(list[i])) {
if (/pan.quark.cn/.test(list[i])) {
playPans.push(list[i]);
const shareData = Quark.getShareData(list[i]);
@@ -127,12 +127,24 @@ var rule = {
playurls.push(urls);
})
}
+
+ if(/www.123684.com/.test(list[i])) {
+ playPans.push(list[i]);
+ let shareData = Pan.getShareData(list[i])
+ let videos = await Pan.getFilesByShareUrl(shareData)
+ if (videos.length > 0) {
+ playform.push('Pan123-' + shareData);
+ const urls = videos.map(item => item.FileName + "$" + [item.ShareKey, item.FileId, item.S3KeyFlag, item.Size, item.Etag].join('*')).join('#');
+ playurls.push(urls);
+ }
+ }
+
} else {
playform.push('推送');
playurls.push("推送" + '$' + list[i])
}
}
- } else if (/pan.quark.cn|drive.uc.cn|www.alipan.com|www.aliyundrive.com|cloud.189.cn|yun.139.com/.test(input)) {
+ } else if (/pan.quark.cn|drive.uc.cn|www.alipan.com|www.aliyundrive.com|cloud.189.cn|yun.139.com|www.123684.com/.test(input)) {
if (/pan.quark.cn/.test(input)) {
playPans.push(input);
const shareData = Quark.getShareData(input);
@@ -172,7 +184,6 @@ var rule = {
const shareData = Ali.getShareData(input);
if (shareData) {
const videos = await Ali.getFilesByShareUrl(shareData);
- log(videos);
if (videos.length > 0) {
playform.push('Ali-' + shareData.shareId);
playurls.push(videos.map((v) => {
@@ -203,6 +214,17 @@ var rule = {
playurls.push(urls);
})
}
+
+ if(/www.123684.com/.test(input)) {
+ playPans.push(input);
+ let shareData = Pan.getShareData(input)
+ let videos = await Pan.getFilesByShareUrl(shareData)
+ if (videos.length > 0) {
+ playform.push('Pan123-' + shareData);
+ const urls = videos.map(item => item.FileName + "$" + [item.ShareKey, item.FileId, item.S3KeyFlag, item.Size, item.Etag].join('*')).join('#');
+ playurls.push(urls);
+ }
+ }
} else {
playform.push('推送');
playurls.push("推送" + '$' + input)
@@ -222,7 +244,7 @@ var rule = {
} else {
return {parse: 1, url: input}
}
- } else if (/Quark-|UC-|Ali-|Cloud-|Yun-/.test(flag)) {
+ } else if (/Quark-|UC-|Ali-|Cloud-|Yun-|Pan123-/.test(flag)) {
const ids = input.split('*');
const urls = [];
let UCDownloadingCache = {};
@@ -304,6 +326,23 @@ var rule = {
url: url
}
}
+ if(flag.startsWith('Pan123-')) {
+ log('盘123解析开始')
+ const url = await Pan.getDownload(ids[0], ids[1], ids[2], ids[3], ids[4])
+ urls.push("原画", url + "#isVideo=true#")
+ log('jj:',url)
+ let data = await Pan.getLiveTranscoding(ids[0], ids[1], ids[2], ids[3], ids[4])
+ data.forEach((item) => {
+ urls.push(item.name, item.url)
+ })
+ return {
+ parse: 0,
+ url: urls,
+ header: {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
+ }
+ }
+ }
} else {
return input
}
diff --git "a/js/\350\256\276\347\275\256\344\270\255\345\277\203.js" "b/js/\350\256\276\347\275\256\344\270\255\345\277\203.js"
index 904d946..0aafe5c 100644
--- "a/js/\350\256\276\347\275\256\344\270\255\345\277\203.js"
+++ "b/js/\350\256\276\347\275\256\344\270\255\345\277\203.js"
@@ -23,6 +23,7 @@ let quick_data = {
移动1: 'https://yun.139.com/shareweb/#/w/i/0i5CLQ7BpV7Ai',
移动2: 'https://caiyun.139.com/m/i?2jexC1gcjeN7q',
移动3: 'https://yun.139.com/shareweb/#/w/i/2i2MoE9ZHn9p1',
+ 123: 'https://www.123684.com/s/oec7Vv-DggWh?ZY4K',
直链1: 'https://vdse.bdstatic.com//628ca08719cef5987ea2ae3c6f0d2386.mp4',
嗅探1: 'https://www.6080kk.cc/haokanplay/178120-1-1.html',
嗅探2: 'https://www.hahads.com/play/537106-3-1.html',
diff --git a/libs/drpyS.js b/libs/drpyS.js
index e3cd7bc..382b827 100644
--- a/libs/drpyS.js
+++ b/libs/drpyS.js
@@ -20,6 +20,7 @@ import {UC} from "../utils/uc.js";
import {Ali} from "../utils/ali.js";
import {Cloud} from "../utils/cloud.js";
import {Yun} from "../utils/yun.js";
+import {Pan} from "../utils/pan123.js";
import AIS from '../utils/ais.js';
// const { req } = await import('../utils/req.js');
import {gbkTool} from '../libs_drpy/gbk.js'
@@ -58,6 +59,7 @@ globalThis.UC = UC;
globalThis.Ali = Ali;
globalThis.Cloud = Cloud;
globalThis.Yun = Yun;
+globalThis.Pan = Pan;
globalThis.require = createRequire(import.meta.url);
globalThis._fetch = fetch;
globalThis.XMLHttpRequest = XMLHttpRequest;
@@ -312,6 +314,7 @@ export async function getSandbox(env = {}) {
Ali,
Cloud,
Yun,
+ Pan,
DataBase,
database,
require,
diff --git a/public/index.html b/public/index.html
index 0ad4fe8..c1b6ce5 100644
--- a/public/index.html
+++ b/public/index.html
@@ -24,6 +24,8 @@ drpyS(drpy-node)
更新记录
+20250226
+20250225
20250224
diff --git a/utils/pan123.js b/utils/pan123.js
new file mode 100644
index 0000000..3f2d300
--- /dev/null
+++ b/utils/pan123.js
@@ -0,0 +1,223 @@
+import axios from "axios";
+import {ENV} from "./env.js";
+
+
+class Pan123 {
+ constructor() {
+ this.regex = /https:\/\/www.123684.com\/s\/([^\\/]+)/
+ this.api = 'https://www.123684.com/b/api/share/';
+ this.loginUrl = 'https://login.123pan.com/api/user/sign_in';
+ }
+
+ async init() {
+ if(this.passport){
+ console.log("获取盘123账号成功")
+ }
+ if(this.password){
+ console.log("获取盘123密码成功")
+ }
+ if(this.auth){
+ let info = JSON.parse(CryptoJS.enc.Base64.parse(this.auth.split('.')[1]).toString(CryptoJS.enc.Utf8))
+ if(info.exp > Math.floor(Date.now() / 1000)){
+ console.log("登录成功")
+ }else {
+ console.log("登录过期,重新登录")
+ await this.loin()
+ }
+ }else {
+ console.log("尚未登录,开始登录")
+ await this.loin()
+ }
+ }
+
+ get passport(){
+ return ENV.get('pan_passport')
+ }
+
+ get password(){
+ return ENV.get('pan_password')
+ }
+
+ get auth(){
+ return ENV.get('pan_auth')
+ }
+
+ async loin(){
+ let data = JSON.stringify({
+ "passport": this.passport,
+ "password": this.password,
+ "remember": true
+ });
+ let config = {
+ method: 'POST',
+ url: this.loginUrl,
+ headers: {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36',
+ 'Content-Type': 'application/json',
+ 'App-Version': '43',
+ 'Referer': 'https://login.123pan.com/centerlogin?redirect_url=https%3A%2F%2Fwww.123684.com&source_page=website',
+ },
+ data: data
+ };
+
+ let auth = (await axios.request(config)).data
+ ENV.set('pan_auth',auth.data.token)
+ }
+
+ getShareData(url){
+ url = decodeURIComponent(url);
+ const matches = this.regex.exec(url);
+ if(url.indexOf('?') > 0){
+ this.SharePwd = url.split('?')[1].match(/[A-Za-z0-9]+/)[0];
+ console.log(this.SharePwd)
+ }
+ if (matches) {
+ if(matches[1].indexOf('?') > 0){
+ return matches[1].split('?')[0]
+ }else {
+ return matches[1]
+ }
+
+ }
+ return null;
+ }
+
+ async getFilesByShareUrl(shareKey){
+ return await this.getShareInfo(shareKey, this.SharePwd, 0, 0)
+ }
+
+ async getShareInfo(shareKey,SharePwd,next,ParentFileId) {
+ let filelist = []
+ let list = await axios.get(this.api+"get",{
+ headers: {},
+ params: {
+ "limit": "100",
+ "next": "0",
+ "orderBy": "file_name",
+ "orderDirection": "asc",
+ "shareKey": shareKey,
+ "SharePwd": SharePwd,
+ "ParentFileId": "0",
+ "Page": "1"
+ }
+ });
+ if(list.status === 200){
+ if(list.data.code === 5103){
+ console.log(list.data.message);
+ }else {
+ let info = list.data.data;
+ let next = info.Next;
+ let infoList = info.InfoList
+ for (let i = 0; i < infoList.length; i++) {
+ let data = infoList[i];
+ if(data.Category === 2){
+ filelist.push({
+ ShareKey: shareKey,
+ FileId: data.FileId,
+ S3KeyFlag: data.S3KeyFlag,
+ Size: data.Size,
+ Etag: data.Etag,
+ FileName: data.FileName,
+ })
+ }
+ let FileId = data.FileId
+ let file = await this.getShareList(shareKey,SharePwd,next,FileId);
+ filelist.push(...file)
+ }
+
+ return filelist;
+ }
+ }
+ }
+
+ async getShareList(shareKey,SharePwd,next,ParentFileId) {
+ let video = []
+ let infoList = (await axios.get(this.api+"get",{
+ headers: {},
+ params: {
+ "limit": "100",
+ "next": next,
+ "orderBy": "file_name",
+ "orderDirection": "asc",
+ "shareKey": shareKey,
+ "SharePwd": SharePwd,
+ "ParentFileId": ParentFileId,
+ "Page": "1"
+ }
+ })).data.data.InfoList;
+ for (let i = 0; i < infoList.length; i++) {
+ let data = infoList[i];
+ if(data.Category === 2){
+ video.push({
+ ShareKey: shareKey,
+ FileId: data.FileId,
+ S3KeyFlag: data.S3KeyFlag,
+ Size: data.Size,
+ Etag: data.Etag,
+ FileName: data.FileName,
+ })
+ }else {
+ let FileId = data.FileId
+ return await this.getShareList(shareKey, SharePwd, next, FileId)
+ }
+ }
+ return video;
+ }
+
+ async getDownload(shareKey,FileId,S3KeyFlag,Size,Etag) {
+ await this.init();
+ let data = JSON.stringify({
+ "ShareKey": shareKey,
+ "FileID": FileId,
+ "S3KeyFlag": S3KeyFlag,
+ "Size": Size,
+ "Etag": Etag
+ });
+ let config = {
+ method: 'POST',
+ url: `${this.api}download/info`,
+ headers: {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36',
+ 'Authorization': `Bearer ${this.auth}`,
+ 'Content-Type': 'application/json;charset=UTF-8',
+ 'platform': 'android',
+ },
+ data: data
+ };
+ let down = (await axios.request(config)).data.data
+ return down.DownloadURL;
+ }
+
+ async getLiveTranscoding(shareKey,FileId,S3KeyFlag,Size,Etag){
+ await this.init();
+ let config = {
+ method: 'GET',
+ url: `https://www.123684.com/b/api/video/play/info`,
+ headers: {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36',
+ 'Authorization': `Bearer ${this.auth}`,
+ 'Content-Type': 'application/json;charset=UTF-8',
+ 'platform': 'android',
+ },
+ params:{
+ "etag": Etag,
+ "size": Size,
+ "from": "1",
+ "shareKey": shareKey
+ }
+ };
+ let down = (await axios.request(config)).data.data.video_play_info
+ let videoinfo = []
+ down.forEach(item => {
+ if(item.url!==''){
+ videoinfo.push({
+ name:item.resolution,
+ url:item.url
+ })
+ }
+ })
+ return videoinfo;
+ }
+}
+
+export const Pan = new Pan123();
\ No newline at end of file
From 120e53ef40ac2082c95bb6633cbb09ac4071f624 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=99=9A=E9=A3=8E=E6=8B=82=E6=9F=B3=E9=A2=9C?=
<434857005@qq.com>
Date: Thu, 27 Feb 2025 00:15:49 +0800
Subject: [PATCH 4/9] add: 123
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
123网盘可推送观看
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index f0952e9..08ca969 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "drpy-node",
- "version": "1.1.20",
+ "version": "1.1.21",
"main": "index.js",
"type": "module",
"scripts": {
From 886ecc43be1e02855df6f53c3f515cdff10a9627 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=99=9A=E9=A3=8E=E6=8B=82=E6=9F=B3=E9=A2=9C?=
<434857005@qq.com>
Date: Thu, 27 Feb 2025 20:58:06 +0800
Subject: [PATCH 5/9] =?UTF-8?q?fix:=20123=E5=92=8C=E6=8E=A8=E9=80=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
更新版本
---
README.md | 4 ++
docs/updateRecord.md | 7 ++++
js/push_agent.js | 52 +++++++++++++-------------
libs/drpyS.js | 13 +++++--
package.json | 2 +-
public/index.html | 2 +
utils/pan123.js | 89 +++++++++++++++++++++++++-------------------
7 files changed, 100 insertions(+), 69 deletions(-)
diff --git a/README.md b/README.md
index 96fd93a..8b3ba5d 100644
--- a/README.md
+++ b/README.md
@@ -19,6 +19,10 @@ nodejs作为服务端的drpy实现。全面升级异步写法
## 更新记录
+### 20250227
+
+更新至V1.1.22
+
### 20250226
更新至V1.1.21
diff --git a/docs/updateRecord.md b/docs/updateRecord.md
index 5fea507..2c1f28e 100644
--- a/docs/updateRecord.md
+++ b/docs/updateRecord.md
@@ -1,5 +1,12 @@
# drpyS更新记录
+### 20250227
+
+更新至V1.1.22
+
+1. 优化123网盘的逻辑和推送示例
+2. 优化sqlite3库兼容装逼壳
+
### 20250226
更新至V1.1.21
diff --git a/js/push_agent.js b/js/push_agent.js
index 38acfae..d4b8167 100644
--- a/js/push_agent.js
+++ b/js/push_agent.js
@@ -25,8 +25,7 @@ var rule = {
let vod = {
vod_pic: icon,
vod_id: orId,
- vod_content: orId || '温馨提醒:宝子们,推送的时候记得确保ids存在哟~',
- vod_name: 'DS推送:道长&秋秋倾情打造',
+ vod_content: 'DS推送:道长&秋秋倾情打造',
}
let playPans = [];
if (/^[\[{]/.test(input.trim())) {
@@ -56,7 +55,7 @@ var rule = {
let list = input.split('@');
// log(list);
for (let i = 0; i < list.length; i++) {
- if (/pan.quark.cn|drive.uc.cn|www.alipan.com|www.aliyundrive.com|cloud.189.cn|yun.139.com|www.123684.com/.test(list[i])) {
+ if (/pan.quark.cn|drive.uc.cn|www.alipan.com|www.aliyundrive.com|cloud.189.cn|yun.139.com|www.123684.com|www.123865.com|www.123912.com|www.123pan.com|www.123pan.cn|www.123592.com/.test(list[i])) {
if (/pan.quark.cn/.test(list[i])) {
playPans.push(list[i]);
const shareData = Quark.getShareData(list[i]);
@@ -127,24 +126,24 @@ var rule = {
playurls.push(urls);
})
}
-
- if(/www.123684.com/.test(list[i])) {
+ if(/www.123684.com|www.123865.com|www.123912.com/.test(list[i])) {
playPans.push(list[i]);
- let shareData = Pan.getShareData(list[i])
+ let shareData = await Pan.getShareData(list[i])
let videos = await Pan.getFilesByShareUrl(shareData)
if (videos.length > 0) {
playform.push('Pan123-' + shareData);
- const urls = videos.map(item => item.FileName + "$" + [item.ShareKey, item.FileId, item.S3KeyFlag, item.Size, item.Etag].join('*')).join('#');
- playurls.push(urls);
+ playurls.push(videos.map((v) => {
+ const list = [v.ShareKey, v.FileId, v.S3KeyFlag, v.Size, v.Etag];
+ return v.FileName + '$' + list.join('*');
+ }).join('#'))
}
}
-
} else {
playform.push('推送');
playurls.push("推送" + '$' + list[i])
}
}
- } else if (/pan.quark.cn|drive.uc.cn|www.alipan.com|www.aliyundrive.com|cloud.189.cn|yun.139.com|www.123684.com/.test(input)) {
+ } else if (/pan.quark.cn|drive.uc.cn|www.alipan.com|www.aliyundrive.com|cloud.189.cn|yun.139.com|www.123684.com|www.123865.com|www.123912.com|www.123pan.com|www.123pan.cn|www.123592.com/.test(input)) {
if (/pan.quark.cn/.test(input)) {
playPans.push(input);
const shareData = Quark.getShareData(input);
@@ -184,6 +183,7 @@ var rule = {
const shareData = Ali.getShareData(input);
if (shareData) {
const videos = await Ali.getFilesByShareUrl(shareData);
+ log(videos);
if (videos.length > 0) {
playform.push('Ali-' + shareData.shareId);
playurls.push(videos.map((v) => {
@@ -214,16 +214,18 @@ var rule = {
playurls.push(urls);
})
}
-
- if(/www.123684.com/.test(input)) {
+ if(/www.123684.com|www.123865.com|www.123912.com|www.123pan.com|www.123pan.cn|www.123592.com/.test(input)) {
playPans.push(input);
- let shareData = Pan.getShareData(input)
+ let shareData = await Pan.getShareData(input)
let videos = await Pan.getFilesByShareUrl(shareData)
- if (videos.length > 0) {
- playform.push('Pan123-' + shareData);
- const urls = videos.map(item => item.FileName + "$" + [item.ShareKey, item.FileId, item.S3KeyFlag, item.Size, item.Etag].join('*')).join('#');
+ Object.keys(videos).forEach(it => {
+ playform.push('Pan123-' + it)
+ const urls = videos[it].map(v => {
+ const list = [v.ShareKey, v.FileId, v.S3KeyFlag, v.Size, v.Etag];
+ return v.FileName + '$' + list.join('*');
+ }).join('#');
playurls.push(urls);
- }
+ })
}
} else {
playform.push('推送');
@@ -328,23 +330,19 @@ var rule = {
}
if(flag.startsWith('Pan123-')) {
log('盘123解析开始')
- const url = await Pan.getDownload(ids[0], ids[1], ids[2], ids[3], ids[4])
- urls.push("原画", url + "#isVideo=true#")
- log('jj:',url)
- let data = await Pan.getLiveTranscoding(ids[0], ids[1], ids[2], ids[3], ids[4])
+ const url = await Pan.getDownload(ids[0],ids[1],ids[2],ids[3],ids[4])
+ urls.push("原画",url)
+ let data = await Pan.getLiveTranscoding(ids[0],ids[1],ids[2],ids[3],ids[4])
data.forEach((item) => {
- urls.push(item.name, item.url)
+ urls.push(item.name,item.url)
})
return {
parse: 0,
- url: urls,
- header: {
- 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
- }
+ url: urls
}
}
} else {
return input
}
},
-}
+}
\ No newline at end of file
diff --git a/libs/drpyS.js b/libs/drpyS.js
index 382b827..97cc42e 100644
--- a/libs/drpyS.js
+++ b/libs/drpyS.js
@@ -167,13 +167,20 @@ globalThis.simplecc = simplecc;
let DataBase = null;
let database = null;
try {
- const sqliteUtil = await import('../utils/database.js'); // 使用动态 import
- DataBase = sqliteUtil.DataBase;
- database = sqliteUtil.database;
+ if (typeof fetchByHiker !== 'undefined' && typeof globalThis.import === 'function') {
+ const sqliteUtil = await globalThis.import('../utils/database.js'); // 海阔放在globalThis里去动态引入
+ DataBase = sqliteUtil.DataBase;
+ database = sqliteUtil.database;
+ } else {
+ const sqliteUtil = await import('../utils/database.js'); // 使用动态 import
+ DataBase = sqliteUtil.DataBase;
+ database = sqliteUtil.database;
+ }
console.log('sqlite3 database imported successfully');
} catch (error) {
console.log(`Failed to import sqlite3:${error.message}`);
}
+
globalThis.DataBase = DataBase;
globalThis.database = database;
diff --git a/package.json b/package.json
index 08ca969..5f3a151 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "drpy-node",
- "version": "1.1.21",
+ "version": "1.1.22",
"main": "index.js",
"type": "module",
"scripts": {
diff --git a/public/index.html b/public/index.html
index c1b6ce5..9023688 100644
--- a/public/index.html
+++ b/public/index.html
@@ -24,6 +24,8 @@ drpyS(drpy-node)
更新记录
+20250227
+20250226
20250225
diff --git a/utils/pan123.js b/utils/pan123.js
index 3f2d300..ee04693 100644
--- a/utils/pan123.js
+++ b/utils/pan123.js
@@ -1,12 +1,14 @@
import axios from "axios";
import {ENV} from "./env.js";
+import {base64Decode} from "../libs_drpy/crypto-util.js";
class Pan123 {
constructor() {
- this.regex = /https:\/\/www.123684.com\/s\/([^\\/]+)/
+ this.regex = /https:\/\/(www.123684.com|www.123865.com|www.123912.com|www.123pan.com|www.123pan.cn|www.123592.com)\/s\/([^\\/]+)/
this.api = 'https://www.123684.com/b/api/share/';
this.loginUrl = 'https://login.123pan.com/api/user/sign_in';
+ this.cate = ''
}
async init() {
@@ -72,10 +74,10 @@ class Pan123 {
console.log(this.SharePwd)
}
if (matches) {
- if(matches[1].indexOf('?') > 0){
- return matches[1].split('?')[0]
+ if(matches[2].indexOf('?') > 0){
+ return matches[2].split('?')[0]
}else {
- return matches[1]
+ return matches[2].match(/www/g)?matches[1]:matches[2];
}
}
@@ -83,21 +85,40 @@ class Pan123 {
}
async getFilesByShareUrl(shareKey){
- return await this.getShareInfo(shareKey, this.SharePwd, 0, 0)
+ let file = {}
+ let cate = await this.getShareInfo(shareKey, this.SharePwd, 0, 0)
+ if(cate && Array.isArray(cate)){
+ await Promise.all(cate.map(async (item) => {
+ if (!(item.filename in file)) {
+ file[item.filename] = [];
+ }
+ const fileData = await this.getShareList(item.shareKey,item.SharePwd,item.next, item.fileId);
+ if (fileData && fileData.length > 0) {
+ file[item.filename].push(...fileData);
+ }
+ }));
+ }
+ // 过滤掉空数组
+ for (let key in file) {
+ if (file[key].length === 0) {
+ delete file[key];
+ }
+ }
+ return file;
}
async getShareInfo(shareKey,SharePwd,next,ParentFileId) {
- let filelist = []
+ let cate = []
let list = await axios.get(this.api+"get",{
headers: {},
params: {
"limit": "100",
- "next": "0",
+ "next": next,
"orderBy": "file_name",
"orderDirection": "asc",
"shareKey": shareKey,
"SharePwd": SharePwd,
- "ParentFileId": "0",
+ "ParentFileId": ParentFileId,
"Page": "1"
}
});
@@ -108,24 +129,20 @@ class Pan123 {
let info = list.data.data;
let next = info.Next;
let infoList = info.InfoList
- for (let i = 0; i < infoList.length; i++) {
- let data = infoList[i];
- if(data.Category === 2){
- filelist.push({
- ShareKey: shareKey,
- FileId: data.FileId,
- S3KeyFlag: data.S3KeyFlag,
- Size: data.Size,
- Etag: data.Etag,
- FileName: data.FileName,
- })
+ infoList.forEach(item => {
+ if(item.Category === 0){
+ cate.push({
+ filename:item.FileName,
+ shareKey:shareKey,
+ SharePwd:SharePwd,
+ next:next,
+ fileId:item.FileId
+ });
}
- let FileId = data.FileId
- let file = await this.getShareList(shareKey,SharePwd,next,FileId);
- filelist.push(...file)
- }
-
- return filelist;
+ })
+ let result = await Promise.all(cate.map(async (it)=> this.getShareInfo(shareKey,SharePwd,next, it.fileId)));
+ result = result.filter(item => item !== undefined && item !== null);
+ return [...cate,...result.flat()];
}
}
}
@@ -145,22 +162,18 @@ class Pan123 {
"Page": "1"
}
})).data.data.InfoList;
- for (let i = 0; i < infoList.length; i++) {
- let data = infoList[i];
- if(data.Category === 2){
+ infoList.forEach(it=>{
+ if(it.Category === 2){
video.push({
ShareKey: shareKey,
- FileId: data.FileId,
- S3KeyFlag: data.S3KeyFlag,
- Size: data.Size,
- Etag: data.Etag,
- FileName: data.FileName,
+ FileId: it.FileId,
+ S3KeyFlag: it.S3KeyFlag,
+ Size: it.Size,
+ Etag: it.Etag,
+ FileName: it.FileName,
})
- }else {
- let FileId = data.FileId
- return await this.getShareList(shareKey, SharePwd, next, FileId)
}
- }
+ })
return video;
}
@@ -185,7 +198,7 @@ class Pan123 {
data: data
};
let down = (await axios.request(config)).data.data
- return down.DownloadURL;
+ return base64Decode((new URL(down.DownloadURL)).searchParams.get('params'));
}
async getLiveTranscoding(shareKey,FileId,S3KeyFlag,Size,Etag){
From 705b1f55964b43b44e72e2cb4e546cebc954740b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=99=9A=E9=A3=8E=E6=8B=82=E6=9F=B3=E9=A2=9C?=
<434857005@qq.com>
Date: Mon, 10 Mar 2025 00:37:07 +0800
Subject: [PATCH 6/9] =?UTF-8?q?fix:=20=E7=95=AA=E8=8C=84=E5=B0=8F=E8=AF=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
更新版本
---
README.md | 6 +-
docs/updateRecord.md | 7 ++
...50\346\260\221\350\277\275\345\211\247.js" | 107 ++++++++++++++++++
...\345\260\217\350\257\264[\344\271\246].js" | 2 +-
...42\346\236\234\347\237\255\345\211\247.js" | 28 +++++
package.json | 2 +-
public/index.html | 4 +-
7 files changed, 152 insertions(+), 4 deletions(-)
create mode 100644 "js/\345\205\250\346\260\221\350\277\275\345\211\247.js"
create mode 100644 "js_dr2/\347\272\242\346\236\234\347\237\255\345\211\247.js"
diff --git a/README.md b/README.md
index 8b3ba5d..97a13b5 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# drpyS(drpy-node)
nodejs作为服务端的drpy实现。全面升级异步写法
-~~积极开发中,每日一更~~,当前进度 `48%`
+~~积极开发中,每日一更~~,当前进度 `49%`
找工作中,随缘更新
* [本地配置接口-动态本地](/config?pwd=)
@@ -19,6 +19,10 @@ nodejs作为服务端的drpy实现。全面升级异步写法
## 更新记录
+### 20250310
+
+更新至V1.1.23
+
### 20250227
更新至V1.1.22
diff --git a/docs/updateRecord.md b/docs/updateRecord.md
index 2c1f28e..1acf857 100644
--- a/docs/updateRecord.md
+++ b/docs/updateRecord.md
@@ -1,5 +1,12 @@
# drpyS更新记录
+### 20250310
+
+更新至V1.1.23
+
+1. 修复番茄小说
+2. 新增2个源
+
### 20250227
更新至V1.1.22
diff --git "a/js/\345\205\250\346\260\221\350\277\275\345\211\247.js" "b/js/\345\205\250\346\260\221\350\277\275\345\211\247.js"
new file mode 100644
index 0000000..b563217
--- /dev/null
+++ "b/js/\345\205\250\346\260\221\350\277\275\345\211\247.js"
@@ -0,0 +1,107 @@
+var rule = {
+ 类型:'影视',
+ title:'全民追剧',
+ desc:'不告诉你',
+ host:'https://jenzg.cn',
+ url: '/index.php/vod/showfyfilter.html[/index.php/vod/showfyclass.html]',
+ searchUrl: '/index.php/vod/search/page/fypage/wd/**.html',
+ searchable:1,quickSearch:1,double:false,timeout:5000,play_parse:true,filterable:1,invalid:true,
+ class_name:'电影&电视剧&综艺&动漫&短剧',
+ class_url:'/id/61&/id/79&/id/88&/id/93&/id/99',
+ filter_url:'{{fl.area}}{{fl.class}}{{fl.cateId}}/page/fypage{{fl.year}}',
+ filter_def:{'/id/61':{cateId:'/id/61'},'/id/79':{cateId:'/id/79'},'/id/88':{cateId:'/id/88'},'/id/93':{cateId:'/id/93'},'/id/99':{cateId:'/id/99'}},
+ 预处理: async () => {return []},
+ 推荐: async function (tid, pg, filter, extend) {
+ let homeFn = rule.一级.bind(this);
+ return await homeFn();
+ },
+ 一级: async function (tid, pg, filter, extend) {
+ let {input, pdfa, pdfh, pd} = this;
+ let html = await request(input);
+ let d = [];
+ let data = pdfa(html, '.module-items .module-item');
+ data.forEach((it) => {
+ d.push({
+ title: pdfh(it, 'a&&title'),
+ pic_url: pd(it, 'img&&data-src'),
+ desc: pdfh(it, '.module-item-text&&Text'),
+ url: pd(it, 'a&&href'),
+ })
+ });
+ return setResult(d)
+ },
+ 二级: async function (ids) {
+ let {input, pdfa, pdfh, pd} = this;
+ let html = await request(input);
+ let VOD = {};
+ VOD.vod_name = pdfh(html, 'h1&&Text');//名称
+ VOD.vod_actor = pdfh(html, '.video-info-items:eq(1)&&Text');//演员
+ VOD.vod_director = pdfh(html, '.video-info-items:eq(0)&&Text');//导演
+ VOD.vod_remarks = pdfh(html, '');//备注
+ VOD.vod_status = pdfh(html, '');//状态
+ VOD.vod_content = pdfh(html, '.video-info-content&&Text');//简介
+ let playlist = pdfa(html, '.module-list');
+ let tabs = pdfa(html, '.module-tab&&.module-tab-item.tab-item');
+ let playmap = {};
+ tabs.map((item, i) => {
+ const form = pdfh(item, 'span&&Text');
+ const list = playlist[i];
+ const a = pdfa(list, 'body&&a:not(:contains(排序))');
+ a.map((it) => {
+ let title = pdfh(it, 'a&&Text');
+ let urls = pd(it, 'a&&href', input);
+ if (!playmap.hasOwnProperty(form)) {
+ playmap[form] = [];
+ }
+ playmap[form].push(title + "$" + urls);
+ });
+ });
+ VOD.vod_play_from = Object.keys(playmap).join('$$$');
+ const urls = Object.values(playmap);
+ const playUrls = urls.map((urllist) => {
+ return urllist.join("#");
+ });
+ VOD.vod_play_url = playUrls.join('$$$');
+ return VOD;
+ },
+ 搜索: async function (wd, quick, pg) {
+ let {input, pdfa, pdfh, pd} = this;
+ let html = await request(input);
+ let d = [];
+ let data = pdfa(html, '.module-items .module-search-item');
+ data.forEach((it) => {
+ d.push({
+ title: pdfh(it, 'a&&title'),
+ pic_url: pd(it, 'img&&data-src'),
+ desc: pdfh(it, '.video-serial&&Text'),
+ url: pd(it, 'a&&href'),
+ content: pdfh(it, '.video-info-aux&&Text'),
+ })
+ });
+ return setResult(d);
+ },
+ lazy: async function (flag, id, flags) {
+ let {input, pdfa, pdfh, pd} = this;
+ let html = await request(input);
+ html = JSON.parse(html.match(/r player_.*?=(.*?))[1]);
+ let url = html.url;
+ if (html.encrypt == "1") {
+ url = unescape(url)
+ return {parse: 0, url: url}
+ } else if (html.encrypt == "2") {
+ url = unescape(base64Decode(url))
+ return {parse: 0, url: url}
+ }
+ if (/m3u8|mp4/.test(url)) {
+ input = url
+ return {parse: 0, url: input}
+ } else {
+ return {parse: 0, url: input}
+ }
+ },
+ filter: {"/id/61":[{"key":"class","name":"剧情","value":[{"n":"全部类型","v":""},{"n":"喜剧","v":"/class/喜剧"},{"n":"动作","v":"/class/动作"},{"n":"怪兽","v":"/class/怪兽"},{"n":"战争","v":"/class/战争"},{"n":"爱情","v":"/class/爱情"},{"n":"悬疑","v":"/class/悬疑"},{"n":"武侠","v":"/class/武侠"},{"n":"奇幻","v":"/class/奇幻"},{"n":"科幻","v":"/class/科幻"},{"n":"冒险","v":"/class/冒险"},{"n":"警匪","v":"/class/警匪"},{"n":"动画","v":"/class/动画"},{"n":"惊悚","v":"/class/惊悚"},{"n":"犯罪","v":"/class/犯罪"},{"n":"恐怖","v":"/class/恐怖"},{"n":"剧情","v":"/class/剧情"},{"n":"历史","v":"/class/历史"},{"n":"纪录片","v":"/class/纪录片"},{"n":"传记","v":"/class/传记"},{"n":"歌舞","v":"/class/歌舞"},{"n":"短片","v":"/class/短片"},{"n":"其他","v":"/class/其他"}]},{"key":"area","name":"地区","value":[{"n":"全部地区","v":""},{"n":"内地","v":"/area/内地"},{"n":"中国香港","v":"/area/中国香港"},{"n":"中国台湾","v":"/area/中国台湾"},{"n":"美国","v":"/area/美国"},{"n":"日本","v":"/area/日本"},{"n":"韩国","v":"/area/韩国"},{"n":"泰国","v":"/area/泰国"},{"n":"印度","v":"/area/印度"},{"n":"英国","v":"/area/英国"},{"n":"法国","v":"/area/法国"},{"n":"德国","v":"/area/德国"},{"n":"加拿大","v":"/area/加拿大"},{"n":"西班牙","v":"/area/西班牙"},{"n":"意大利","v":"/area/意大利"},{"n":"澳大利亚","v":"/area/澳大利亚"},{"n":"其它","v":"/area/其它"}]},{"key":"year","name":"年代","value":[{"n":"全部年代","v":""},{"n":"2025","v":"/year/2025"},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"},{"n":"2004","v":"/year/2004"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}],
+ "/id/79":[{"key":"class","name":"类型","value":[{"n":"全部类型","v":""},{"n":"青春","v":"/class/青春"},{"n":"古装","v":"/class/古装"},{"n":"爱情","v":"/class/爱情"},{"n":"都市","v":"/class/都市"},{"n":"喜剧","v":"/class/喜剧"},{"n":"战争","v":"/class/战争"},{"n":"军旅","v":"/class/军旅"},{"n":"谍战","v":"/class/谍战"},{"n":"偶像","v":"/class/偶像"},{"n":"警匪","v":"/class/警匪"},{"n":"冒险","v":"/class/冒险"},{"n":"穿越","v":"/class/穿越"},{"n":"仙侠","v":"/class/仙侠"},{"n":"武侠","v":"/class/武侠"},{"n":"悬疑","v":"/class/悬疑"},{"n":"罪案","v":"/class/罪案"},{"n":"家庭","v":"/class/家庭"},{"n":"历史","v":"/class/历史"},{"n":"年代","v":"/class/年代"},{"n":"农村","v":"/class/农村"},{"n":"其他","v":"/class/其他"}]},{"key":"area","name":"地区","value":[{"n":"全部地区","v":""},{"n":"内地","v":"/area/内地"},{"n":"中国香港","v":"/area/中国香港"},{"n":"中国台湾","v":"/area/中国台湾"},{"n":"美国","v":"/area/美国"},{"n":"日本","v":"/area/日本"},{"n":"韩国","v":"/area/韩国"},{"n":"泰国","v":"/area/泰国"},{"n":"印度","v":"/area/印度"},{"n":"英国","v":"/area/英国"},{"n":"法国","v":"/area/法国"},{"n":"德国","v":"/area/德国"},{"n":"加拿大","v":"/area/加拿大"},{"n":"西班牙","v":"/area/西班牙"},{"n":"意大利","v":"/area/意大利"},{"n":"澳大利亚","v":"/area/澳大利亚"},{"n":"其它","v":"/area/其它"}]},{"key":"year","name":"年代","value":[{"n":"全部年代","v":""},{"n":"2025","v":"/year/2025"},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"},{"n":"2004","v":"/year/2004"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}],
+ "/id/88":[{"key":"class","name":"类型","value":[{"n":"全部类型","v":""},{"n":"偶像","v":"/class/偶像"},{"n":"舞蹈","v":"/class/舞蹈"},{"n":"音乐","v":"/class/音乐"},{"n":"情感","v":"/class/情感"},{"n":"喜剧","v":"/class/喜剧"},{"n":"体育","v":"/class/体育"},{"n":"游戏","v":"/class/游戏"},{"n":"相声","v":"/class/相声"},{"n":"婚恋","v":"/class/婚恋"},{"n":"时尚","v":"/class/时尚"},{"n":"晚会","v":"/class/晚会"},{"n":"明星","v":"/class/明星"},{"n":"访谈","v":"/class/访谈"},{"n":"亲子","v":"/class/亲子"},{"n":"生活","v":"/class/生活"},{"n":"文化","v":"/class/文化"},{"n":"美食","v":"/class/美食"},{"n":"旅游","v":"/class/旅游"},{"n":"益智","v":"/class/益智"},{"n":"其他","v":"/class/其他"}]},{"key":"area","name":"地区","value":[{"n":"全部地区","v":""},{"n":"内地","v":"/area/内地"},{"n":"港台","v":"/area/港台"},{"n":"日韩","v":"/area/日韩"},{"n":"欧美","v":"/area/欧美"}]},{"key":"year","name":"年代","value":[{"n":"全部年代","v":""},{"n":"2025","v":"/year/2025"},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"},{"n":"2004","v":"/year/2004"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}], "/id/93":[{"key":"class","name":"类型","value":[{"n":"全部类型","v":""},{"n":"玄幻","v":"/class/玄幻"},{"n":"科幻","v":"/class/科幻"},{"n":"武侠","v":"/class/武侠"},{"n":"冒险","v":"/class/冒险"},{"n":"战斗","v":"/class/战斗"},{"n":"搞笑","v":"/class/搞笑"},{"n":"恋爱","v":"/class/恋爱"},{"n":"魔幻","v":"/class/魔幻"},{"n":"竞技","v":"/class/竞技"},{"n":"悬疑","v":"/class/悬疑"},{"n":"日常","v":"/class/日常"},{"n":"校园","v":"/class/校园"},{"n":"真人","v":"/class/真人"},{"n":"推理","v":"/class/推理"},{"n":"历史","v":"/class/历史"},{"n":"经典","v":"/class/经典"},{"n":"其他","v":"/class/其他"}]},{"key":"area","name":"地区","value":[{"n":"全部地区","v":""},{"n":"国产","v":"/area/国产"},{"n":"日本","v":"/area/日本"},{"n":"欧美","v":"/area/欧美"},{"n":"其他","v":"/area/其他"}]},{"key":"year","name":"年代","value":[{"n":"全部年代","v":""},{"n":"2025","v":"/year/2025"},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"},{"n":"2004","v":"/year/2004"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}],
+ "/id/99":[{"key":"class","name":"类型","value":[{"n":"全部类型","v":""},{"n":"青春","v":"/class/青春"},{"n":"古装","v":"/class/古装"},{"n":"爱情","v":"/class/爱情"},{"n":"都市","v":"/class/都市"},{"n":"喜剧","v":"/class/喜剧"},{"n":"战争","v":"/class/战争"},{"n":"军旅","v":"/class/军旅"},{"n":"谍战","v":"/class/谍战"},{"n":"偶像","v":"/class/偶像"},{"n":"警匪","v":"/class/警匪"},{"n":"冒险","v":"/class/冒险"},{"n":"穿越","v":"/class/穿越"},{"n":"仙侠","v":"/class/仙侠"},{"n":"武侠","v":"/class/武侠"},{"n":"悬疑","v":"/class/悬疑"},{"n":"罪案","v":"/class/罪案"},{"n":"家庭","v":"/class/家庭"},{"n":"历史","v":"/class/历史"},{"n":"年代","v":"/class/年代"},{"n":"农村","v":"/class/农村"},{"n":"其他","v":"/class/其他"}]},{"key":"year","name":"年代","value":[{"n":"全部年代","v":""},{"n":"2025","v":"/year/2025"},{"n":"2024","v":"/year/2024"},{"n":"2023","v":"/year/2023"},{"n":"2022","v":"/year/2022"},{"n":"2021","v":"/year/2021"},{"n":"2020","v":"/year/2020"},{"n":"2019","v":"/year/2019"},{"n":"2018","v":"/year/2018"},{"n":"2017","v":"/year/2017"},{"n":"2016","v":"/year/2016"},{"n":"2015","v":"/year/2015"},{"n":"2014","v":"/year/2014"},{"n":"2013","v":"/year/2013"},{"n":"2012","v":"/year/2012"},{"n":"2011","v":"/year/2011"},{"n":"2010","v":"/year/2010"},{"n":"2009","v":"/year/2009"},{"n":"2008","v":"/year/2008"},{"n":"2007","v":"/year/2007"},{"n":"2006","v":"/year/2006"},{"n":"2005","v":"/year/2005"},{"n":"2004","v":"/year/2004"}]},{"key":"by","name":"排序","value":[{"n":"时间","v":"/by/time"},{"n":"人气","v":"/by/hits"},{"n":"评分","v":"/by/score"}]}],
+ }
+}
diff --git "a/js/\347\225\252\350\214\204\345\260\217\350\257\264[\344\271\246].js" "b/js/\347\225\252\350\214\204\345\260\217\350\257\264[\344\271\246].js"
index 27b20df..53cb4fe 100644
--- "a/js/\347\225\252\350\214\204\345\260\217\350\257\264[\344\271\246].js"
+++ "b/js/\347\225\252\350\214\204\345\260\217\350\257\264[\344\271\246].js"
@@ -157,7 +157,7 @@ var rule = {
content_url = `https://fanqienovel.com/reader/${input}?enter_from=reader`;
log(content_url);
let html = (await req(content_url, {headers: {Cookie: getFqCookie()}})).content;
- html = html.match(/window.__INITIAL_STATE__=(.+?});/)[1];
+ html = html.match(/window.__INITIAL_STATE__=(.+?});/)[1].replaceAll(':undefined,', ':"undefined",');
let json = JSON.parse(html).reader.chapterData;
title = json.title;
content = decodeText(json.content, 2);
diff --git "a/js_dr2/\347\272\242\346\236\234\347\237\255\345\211\247.js" "b/js_dr2/\347\272\242\346\236\234\347\237\255\345\211\247.js"
new file mode 100644
index 0000000..73c9b0c
--- /dev/null
+++ "b/js_dr2/\347\272\242\346\236\234\347\237\255\345\211\247.js"
@@ -0,0 +1,28 @@
+var rule = {
+ title: '红果短剧',
+ host: 'https://www.hongguodj.cc/',
+ url: '/show/fyclass--------fypage---.html',
+ searchUrl: '/search/**----------fypage---.html',
+ class_parse: '.nav li;a&&Text;a&&href;.*/(.*?).html',
+ searchable: 2,
+ quickSearch: 0,
+ filterable: 0,
+ headers: {
+ 'User-Agent': 'MOBILE_UA',
+ },
+ play_parse: true,
+ lazy: "js:\n let html = request(input);\n let hconf = html.match(/r player_.*?=(.*?))[1];\n let json = JSON5.parse(hconf);\n let url = json.url;\n if (json.encrypt == '1') {\n url = unescape(url);\n } else if (json.encrypt == '2') {\n url = unescape(base64Decode(url));\n }\n if (/\\.(m3u8|mp4|m4a|mp3)/.test(url)) {\n input = {\n parse: 0,\n jx: 0,\n url: url,\n };\n } else {\n input = url && url.startsWith('http') && tellIsJx(url) ? {parse:0,jx:1,url:url}:input;\n }",
+ limit: 6,
+ double: true,
+ 推荐: '.show&&ul;li;img&&alt;img&&data-src;.bg&&Text;a&&href',
+ 一级: '.list li;img&&alt;img&&data-src;.bg&&Text;a&&href',
+ 二级: {
+ title: 'h2&&Text;.info p:eq(2)&&a&&Text',
+ img: 'img&&src',
+ desc: '.info p:eq(2)&&a&&Text;.info p:eq(3)&&a&&Text;.info p:eq(4)&&a&&Text;.info p:eq(0)&&a&&Text;.info p:eq(1)&&a&&Text',
+ content: '#desc&&Text',
+ tabs: '.play.my-2 .title&&a',
+ lists: '.play-list:eq(#id)&&.rows li',
+ },
+ 搜索: '.show.rows li;img&&alt;img&&data-src;.bg&&Text;a&&href',
+}
\ No newline at end of file
diff --git a/package.json b/package.json
index 5f3a151..b38b7fe 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "drpy-node",
- "version": "1.1.22",
+ "version": "1.1.23",
"main": "index.js",
"type": "module",
"scripts": {
diff --git a/public/index.html b/public/index.html
index 9023688..b86b6e7 100644
--- a/public/index.html
+++ b/public/index.html
@@ -8,7 +8,7 @@
drpyS(drpy-node)
-积极开发中,每日一更,当前进度 48%
找工作中,随缘更新积极开发中,每日一更,当前进度 49%
找工作中,随缘更新
drpyS(drpy-node)
更新记录
+20250310
+20250227
20250226
From 344fc95d7464bab7774594954b2c2795cd7762d9 Mon Sep 17 00:00:00 2001
From: Hiram