MCPcopy Index your code
hub / github.com/embyplus/embyRouter

github.com/embyplus/embyRouter @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
36 symbols 78 edges 7 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

emby stream router

大多数代码来自 ChatGPT-o1

实现

  • [x] 基于emby用户的路线选择API
  • [x] 根据deviceId获取用户路线,将emby stream重定向
  • [x] telegram通知功能
  • [x] 同一用户访问太频繁发送通知,防止扫库(50次/小时)

原理

nginx拦截emby请求,根据deviceId获取用户路线,将emby stream 302重定向到对应路线。

理论上可以拦截更多emby请求,将该项目作为emby的中间件

使用

docker运行【推荐】

# docker build -t "emby-router:latest" . --build-arg HTTP_PROXY=http://172.17.0.1:2333 // 使用代理加速build
docker build -t "emby-router:latest" .

vim docker-compose.yml // 修改配置,参考参数说明

docker compose up -d

本地运行

npm install
cp .env.example .env
vim .env // 修改配置,参考参数说明
node index.js

参数说明

参数 说明 备注
HTTP_PORT http监听端口 默认 9876,docker下运行请修改映射端口
REDIS_URL redis地址 默认 redis://127.0.0.1:6379
TELEGRAM_BOT_ID telegram bot id 通知使用,不填不通知
TELEGRAM_CHAT_ID telegram chat id 通知使用,不填不通知
EMBY_API_URL emby api地址 必填
EMBY_API_KEY emby api key 必填
KT_SALT 加密salt 必填
ROUTERS_JSON_DATA 路由配置 必填,json字符串,参考默认配置
DEFAULT_ROUTE 默认路由 默认 gd-1
DEFAULT_SOURCE 默认源 非法访问时返回的stream,不填返回404

Core symbols most depended-on inside this repo

get
called by 16
libs/kv.js
_getKey
called by 4
libs/kv.js
_request
called by 4
libs/emby.js
get
called by 4
libs/emby.js
redirectToDefault
called by 3
routes/emby.js
getRouter
called by 3
libs/datastore.js
getOrFetch
called by 3
libs/emby.js
redirect302
called by 2
routes/emby.js

Shape

Method 17
Function 13
Class 6

Languages

TypeScript100%

Modules by API surface

libs/emby.js16 symbols
routes/emby.js10 symbols
libs/kv.js7 symbols
libs/datastore.js2 symbols
libs/telegram.js1 symbols

For agents

$ claude mcp add embyRouter \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact