570
文章
·
28728
阅读
570
文章
·
28728
阅读

有27人阅读过 一键修改emby的UI
发布于2024/11/23 更新于2024/11/23
[ 教程仅保证更新时有效,请自行测试。]

项目地址:Nolovenodie/emby-crx: Emby 增强/美化 插件 (适用于 Chrome 内核浏览器 / EmbyServer)

一键脚本:embyui.sh

安装后,重启emby生效


脚本内容:

#! /bin/bash

echo "查找emby安装目录..."
# 查找 emby UI 的目录
UI_local=$(find / -type d -name "dashboard-ui" -print -quit 2>/dev/null)

# 如果找不到目录,退出脚本
if [ -z "$UI_local" ]; then
    echo "emby安装目录未找到!"
    exit 1
fi

# 切换到找到的目录
cd "$UI_local" || exit

# github加速
proxy="https://gh.llkk.cc/"

# 创建 emby-crx 目录并下载所需文件
rm -rf emby-crx
mkdir -p emby-crx
wget ${proxy}https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/static/css/style.css -P emby-crx/
wget ${proxy}https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/static/js/common-utils.js -P emby-crx/
wget ${proxy}https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/static/js/jquery-3.6.0.min.js -P emby-crx/
wget ${proxy}https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/static/js/md5.min.js -P emby-crx/
wget ${proxy}https://raw.githubusercontent.com/Nolovenodie/emby-crx/master/content/main.js -P emby-crx/

# 检查 index.html 是否存在
if [ ! -f index.html ]; then
    echo "index.html not found in $UI_local!"
    exit 1
fi

# 检查 index.html 是否包含 emby-crx
if grep -q "emby-crx" index.html; then
    echo "index.html already contains emby-crx, skipping insertion."
else
    # 定义要插入的代码
    code='<link rel="stylesheet" id="theme-css" href="emby-crx/style.css" type="text/css" media="all" />\n<script src="emby-crx/common-utils.js"></script>\n<script src="emby-crx/jquery-3.6.0.min.js"></script>\n<script src="emby-crx/md5.min.js"></script>\n<script src="emby-crx/main.js"></script>'

    # 在 </head> 之前插入代码
    sed -i "/<\/head>/i $code" index.html
    echo "Inserted emby-crx code into index.html."
fi


文章对你有帮助吗?
  • 一般[0]
  • 很赞[0]
  • 没用[0]
  • 垃圾[0]
  • 无语[0]
扫一扫,手机浏览手机访问本站