Skip to content

Commit 40adf62

Browse files
committed
feat(emby): add emby unlock script
1 parent 43d2c9d commit 40adf62

File tree

4 files changed

+43
-1
lines changed

4 files changed

+43
-1
lines changed

.gitignore

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
node_modules/*
2-
.DS_Store
2+
.DS_Store
3+
4+
.vscode
5+
6+
tncj/*
7+
*/unblock/*
8+
*.private.*
9+
*.dat
10+
*copy.js

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"quoteProps": "consistent",
3+
"semi": false,
4+
"singleQuote": true,
5+
"trailingComma": "none"
6+
}

emby/emby.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const CHECK_URL = 'mb3admin.com/admin/service/registration/validateDevice'
2+
3+
const url = $request.url
4+
const isCheckURL = (url) => url.includes(CHECK_URL)
5+
6+
if (isCheckUrl(url) && $response.status != 200) {
7+
const unlock = {
8+
cacheExpirationDays: 999,
9+
resultCode: 'GOOD',
10+
message: 'Device Valid'
11+
}
12+
13+
const status = 200
14+
const headers = $response.headers
15+
const body = JSON.stringify(unlock)
16+
17+
$done({ status, headers, body })
18+
} else {
19+
$done({})
20+
}

emby/emby.sgmodule

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!name=embyUnlock
2+
#!desc=embyUnlock
3+
4+
[Script]
5+
emby.js = type=http-response,pattern=^https?:\/\/mb3admin.com\/admin\/service\/registration\/validateDevice,requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/emby/emby.js
6+
7+
[MITM]
8+
hostname = %APPEND% mb3admin.com

0 commit comments

Comments
 (0)