Skip to content

Commit c8ff181

Browse files
author
Taois
committed
feat: 小改动
1 parent 93864b8 commit c8ff181

File tree

11 files changed

+245
-6
lines changed

11 files changed

+245
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ todo:
9090

9191
* 终端执行
9292

93-
`bash -c "$(curl -fsSLk https://github.com/hjdhnx/drpy-node/raw/refs/heads/main/autorun.sh)"`
93+
`bash -c "$(curl -fsSLk https://github.com/hjdhnx/drpy-node/raw/refs/heads/main/install/autorun.sh)"`
9494

9595
* 添加定时方案
9696

97-
`echo "30 7 * * * cd /patch && bash -c \"\$(curl -fsSLk https://github.com/hjdhnx/drpy-node/raw/refs/heads/main/autorun.sh)\" >> /patch/drpyslog.log 2>&1" | crontab -`
97+
`echo "30 7 * * * cd /patch && bash -c \"\$(curl -fsSLk https://github.com/hjdhnx/drpy-node/raw/refs/heads/main/install/autorun.sh)\" >> /patch/drpyslog.log 2>&1" | crontab -`
9898

9999
或者下载脚本到本地后
100100

File renamed without changes.
File renamed without changes.

install/uninstall.ps1

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<#
2+
.SYNOPSIS
3+
drpys 一键卸载脚本(最终容错版)
4+
.DESCRIPTION
5+
1) 删除任务计划
6+
2) 停止并删除 PM2 进程
7+
3) 结束残余 Node 进程
8+
4) 删除源码目录
9+
5) 可选:卸载运行环境(Node、Python、nvm、Git、yarn、pm2)
10+
.PARAMETER SkipConfirm
11+
静默模式
12+
.PARAMETER IncludeEnv
13+
强制连环境一起删
14+
.PARAMETER UseProxy
15+
下载时使用代理
16+
.PARAMETER ProxyHost
17+
代理地址,默认 127.0.0.1:7890
18+
#>
19+
20+
param(
21+
[switch]$SkipConfirm,
22+
[switch]$IncludeEnv,
23+
[switch]$UseProxy,
24+
[string]$ProxyHost = "127.0.0.1:7890"
25+
)
26+
$ErrorActionPreference = "Stop"
27+
28+
# ---------- 1. 自动提权 ----------
29+
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
30+
Write-Host "当前非管理员权限,正在尝试以管理员身份重新启动..." -ForegroundColor Yellow
31+
$arguments = "-NoProfile -ExecutionPolicy Bypass -File `"$($MyInvocation.MyCommand.Path)`""
32+
if ($SkipConfirm) { $arguments += " -SkipConfirm" }
33+
if ($IncludeEnv) { $arguments += " -IncludeEnv" }
34+
if ($UseProxy) { $arguments += " -UseProxy -ProxyHost `"$ProxyHost`"" }
35+
Start-Process powershell -ArgumentList $arguments -Verb RunAs
36+
exit
37+
}
38+
Set-Location -LiteralPath $PSScriptRoot
39+
40+
# ---------- 2. 代理 & 工具 ----------
41+
function Use-ProxyIfNeeded ([scriptblock]$Script) {
42+
if ($UseProxy) {
43+
$oldHttp = [Environment]::GetEnvironmentVariable("HTTP_PROXY")
44+
$oldHttps = [Environment]::GetEnvironmentVariable("HTTPS_PROXY")
45+
[Environment]::SetEnvironmentVariable("HTTP_PROXY", "http://$ProxyHost", "Process")
46+
[Environment]::SetEnvironmentVariable("HTTPS_PROXY", "http://$ProxyHost", "Process")
47+
try { & $Script } finally {
48+
[Environment]::SetEnvironmentVariable("HTTP_PROXY", $oldHttp, "Process")
49+
[Environment]::SetEnvironmentVariable("HTTPS_PROXY", $oldHttps, "Process")
50+
}
51+
} else { & $Script }
52+
}
53+
function Test-Cmd ([string]$cmd) { $null -ne (Get-Command $cmd -ErrorAction SilentlyContinue) }
54+
55+
# ---------- 3. 交互确认 ----------
56+
if (-not $SkipConfirm) {
57+
Write-Host "========== drpys 卸载脚本 ==========" -ForegroundColor Cyan
58+
Write-Host "请选择卸载方式:" -ForegroundColor Yellow
59+
Write-Host " 1) 仅删除项目(保留环境)"
60+
Write-Host " 2) 删除项目 + 卸载运行环境"
61+
$choice = Read-Host "请输入对应数字(1/2)默认(1)"
62+
$IncludeEnv = ($choice -eq "2")
63+
}
64+
65+
# ---------- 4. 任务计划 ----------
66+
"drpyS_PM2_Startup","drpyS_Update" | ForEach-Object {
67+
if (Get-ScheduledTask -TaskName $_ -ErrorAction SilentlyContinue) {
68+
Write-Host "删除任务计划 $_ ..." -ForegroundColor Green
69+
Unregister-ScheduledTask -TaskName $_ -Confirm:$false
70+
}
71+
}
72+
73+
# ---------- 5. PM2 进程 ----------
74+
if (Test-Cmd "pm2") {
75+
Write-Host "停止并删除 PM2 进程 drpyS ..." -ForegroundColor Green
76+
pm2 stop drpyS *>$null
77+
pm2 delete drpyS *>$null
78+
pm2 save *>$null
79+
}
80+
81+
# ---------- 6. 结束残余 Node ----------
82+
Get-Process -Name "node" -ErrorAction SilentlyContinue | ForEach-Object {
83+
Write-Host "结束残余 Node 进程 PID $($_.Id) ..." -ForegroundColor Green
84+
Stop-Process -Id $_.Id -Force
85+
}
86+
87+
# ---------- 7. 删除源码 ----------
88+
$repoDir = Read-Host "请输入项目存放目录(留空则使用当前目录)"
89+
if ([string]::IsNullOrWhiteSpace($repoDir)) { $repoDir = (Get-Location).Path }
90+
$projectPath = Join-Path $repoDir "drpy-node"
91+
if (Test-Path $projectPath) {
92+
Write-Host "删除源码目录 $projectPath ..." -ForegroundColor Green
93+
Remove-Item -Recurse -Force $projectPath
94+
} else {
95+
Write-Host "未检测到源码目录,跳过删除" -ForegroundColor Yellow
96+
}
97+
98+
# ---------- 8. 卸载运行环境(与安装脚本一一对应) ----------
99+
if ($IncludeEnv) {
100+
Write-Host "开始卸载运行环境(与安装脚本对应)..." -ForegroundColor Yellow
101+
102+
# 1) Node 20.18.3 用 nvm 卸载
103+
if (Test-Cmd "nvm") {
104+
Write-Host "使用 nvm 卸载 Node 20.18.3 ..." -ForegroundColor Green
105+
nvm uninstall 20.18.3 2>$null
106+
# 如果这是最后一个版本,nvm 本身仍保留,用户可手动在「应用和功能」里再卸 nvm
107+
} else {
108+
Write-Host "未检测到 nvm,跳过 Node 版本卸载" -ForegroundColor Yellow
109+
}
110+
111+
# 2) Python 3.11 —— 安装脚本里直接解压到 C:\Python311 并写注册表/追加 PATH
112+
$pyDir = "C:\Python311"
113+
if (Test-Path $pyDir) {
114+
Write-Host "删除 Python 3.11 目录 $pyDir ..." -ForegroundColor Green
115+
Remove-Item -Recurse -Force $pyDir -ErrorAction SilentlyContinue
116+
}
117+
118+
# 3) Git —— 安装脚本用 winget 装的,直接用 winget 卸载
119+
try {
120+
Write-Host "winget 卸载 Git..." -ForegroundColor Green
121+
winget uninstall --id Git.Git -e --accept-source-agreements --silent
122+
} catch {
123+
Write-Warning "Git winget 卸载失败,请手动在「应用和功能」里卸载"
124+
}
125+
126+
# 4) yarn / pm2 —— 安装脚本 npm -g 装的,npm -g 卸载
127+
if (Test-Cmd "npm") {
128+
Write-Host "npm 全局卸载 yarn、pm2 ..." -ForegroundColor Green
129+
npm uninstall -g yarn pm2 *>$null
130+
}
131+
132+
Write-Host "运行环境卸载步骤结束,如有残留请手动到「应用和功能」确认。" -ForegroundColor Yellow
133+
}
134+
135+
# ---------- 9. 完成 ----------
136+
Write-Host "drpys 卸载完成!" -ForegroundColor Green
137+
Write-Host "按任意键退出!!!" -ForegroundColor Green
138+
Read-Host
File renamed without changes.

jx/szy.jsd

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// http://localhost:5757/parse/szy?url=https://v.qq.com/x/cover/mzc00200vkqr54u/v4100qp69zl.html
2+
const {getHtml} = $.require('./_lib.request.js');
3+
const host = 'https://ppl.sszzyy.com';
4+
const jx = {
5+
header: {
6+
'User-Agent': PC_UA,
7+
'Referer': host,
8+
'origin': host,
9+
},
10+
};
11+
12+
async function lazy(input, params) {
13+
console.log('input:', input);
14+
// 生成时间戳和密钥
15+
const t = Math.floor(Date.now() / 1000);
16+
const key = md5(`123456789${input}${t}`);
17+
console.log('key:', key);
18+
// 准备请求数据
19+
// const postData = `url=${encodeURIComponent(input)}&time=${t}&key=${key}`;
20+
const postData = qs.stringify({
21+
'url': encodeURIComponent(input),
22+
'time': t,
23+
'key': key
24+
});
25+
console.log('postData:', postData);
26+
let reqs = (await getHtml({
27+
url: "https://ppl.sszzyy.com",
28+
method: 'POST',
29+
headers: jx.header,
30+
data: postData,
31+
})).data;
32+
console.log(reqs);
33+
34+
// 解密 URL
35+
const SECRET_KEY = 'ARTPLAYER2023217';
36+
const IV = 'Artplayerapiban1';
37+
let play_url = reqs.url;
38+
return {
39+
url: decrypt(play_url, SECRET_KEY, IV),
40+
header: {
41+
'origin': host,
42+
'User-Agent': jx.header['User-Agent'],
43+
}
44+
}
45+
}
46+
47+
function decrypt(text, aes_key, aes_iv) {
48+
let key = CryptoJS.enc.Utf8.parse(aes_key),
49+
iv = CryptoJS.enc.Utf8.parse(aes_iv),
50+
decrypted = CryptoJS.AES.decrypt(text, key, {
51+
iv: iv,
52+
mode: CryptoJS.mode.CBC,
53+
padding: CryptoJS.pad.Pkcs7
54+
});
55+
return decrypted.toString(CryptoJS.enc.Utf8);
56+
}

public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ <h2 id="安装说明">安装说明</h2>
8181
<ul>
8282
<li>终端执行</li>
8383
</ul>
84-
<p><code>bash -c &quot;$(curl -fsSLk https://github.com/hjdhnx/drpy-node/raw/refs/heads/main/autorun.sh)&quot;</code></p>
84+
<p><code>bash -c &quot;$(curl -fsSLk https://github.com/hjdhnx/drpy-node/raw/refs/heads/main/install/autorun.sh)&quot;</code></p>
8585
<ul>
8686
<li>添加定时方案</li>
8787
</ul>
88-
<p><code>echo &quot;30 7 * * * cd /patch &amp;&amp; bash -c \&quot;\$(curl -fsSLk https://github.com/hjdhnx/drpy-node/raw/refs/heads/main/autorun.sh)\&quot; &gt;&gt; /patch/drpyslog.log 2&gt;&amp;1&quot; | crontab -</code></p>
88+
<p><code>echo &quot;30 7 * * * cd /patch &amp;&amp; bash -c \&quot;\$(curl -fsSLk https://github.com/hjdhnx/drpy-node/raw/refs/heads/main/install/autorun.sh)\&quot; &gt;&gt; /patch/drpyslog.log 2&gt;&amp;1&quot; | crontab -</code></p>
8989
<p>或者下载脚本到本地后</p>
9090
<p><code>chmod a+x /path/autorun.sh</code></p>
9191
<p><code>echo &quot;30 7 * * * bash /path/autorun.sh &gt;&gt; /path/logfile.log 2&gt;&amp;1&quot; | crontab -</code></p>

spider/js_dr2/六月听书[听].js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
filterable: 0,
55
quickSearch: 0,
66
title: '六月听书[听]',
7+
logo: 'https://pic.xlhs.com/up/2021-11/2021112985176843.png',
78
lang: 'dr2'
89
})
910
*/

spider/js_dr2/追剧狂人.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
@header({
3+
searchable: 1,
4+
filterable: 1,
5+
quickSearch: 1,
6+
title: '追剧狂人',
7+
logo: 'https://i-blog.csdnimg.cn/blog_migrate/2621e710a94ab40ba66645d47f296aaf.gif',
8+
lang: 'dr2'
9+
})
10+
*/
11+
12+
var rule = {
13+
类型: '影视',
14+
title: '追剧狂人',
15+
author: '不告诉你',
16+
host: 'https://www.zjkrmv.vip',
17+
logo: 'https://i-blog.csdnimg.cn/blog_migrate/2621e710a94ab40ba66645d47f296aaf.gif',
18+
url: '/vodshow/fyclass--------fypage---.html',
19+
searchUrl: '/vodsearch/**----------fypage---.html',
20+
headers: {
21+
'User-Agent': 'MOBILE_UA'
22+
},
23+
searchable: 1,
24+
quickSearch: 1,
25+
double: true,
26+
timeout: 10000,
27+
play_parse: true,
28+
filterable: 0,
29+
invalid: true,
30+
class_name: '电影&电视剧&动漫&短剧&综艺',
31+
class_url: '1&2&4&23&3',
32+
推荐: '*',
33+
一级: 'body&&.myui-vodbox-content;img&&alt;img&&src;.tag-box&&Text;a&&href',
34+
二级: {
35+
title: 'h1&&Text',
36+
img: 'img&&src',
37+
desc: '.tags&&Text;;;.detail-box&&.director:eq(1)&&Text;.detail-box&&.director:eq(0)&&Text',
38+
content: '.vod-content&&.wrapper_more_text&&Text',
39+
tabs: '.nav-btn li',
40+
lists: '.tab-content&&.tab-pane:eq(#id) a',
41+
},
42+
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;\n }",
43+
搜索: '*',
44+
}

spider/py/getapp3.4.2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
searchable: 1,
44
filterable: 1,
55
quickSearch: 1,
6-
title: 'getapp3.4.1',
6+
title: 'getapp3.4.2',
77
lang: 'hipy'
88
})
99
"""

0 commit comments

Comments
 (0)