为Emby、Jellyfin、Plex添加弹幕功能

zhangxh 发布于 2024-11-26 267 次阅读


AI 摘要

想为您的Emby、Jellyfin和Plex媒体服务器增添生动有趣的弹幕功能吗?通过简单的Nginx配置修改,您可以在更新时保留弹幕设置,轻松实现与观众的实时互动。不论是Emby还是Jellyfin,本文将详细指导您如何配置反向代理,让观影体验升级;而对于Plex,推荐使用Danmaku Anywhere插件,轻松搞定弹幕配置。快来探讨这一变革性解决方案吧!

为了在更新Emby、Jellydfin时不删除弹幕设置, 直接在反向代理上做些修改是最好的.

对于 Emby, 我们添加如下 Nginx 配置

    location / {
        proxy_pass http://192.168.31.120:8096;
        proxy_pass_request_headers on;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host $http_host;
        # 在流式传输时禁用缓冲
        proxy_buffering off;
    }

    location = /web/index.html {
        proxy_pass http://192.168.31.120:8096/web/index.html;
        proxy_pass_request_headers on;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host $http_host;
        # 禁用与后端压缩并侧载脚本
        proxy_set_header Accept-Encoding "";
        sub_filter '</body>' '<script src="https://cdn.jsdelivr.net/gh/chen3861229/dd-danmaku@new-ui/ede.js" defer></script></body>';
        sub_filter_once on;
    }
    
        location /socket {
        proxy_pass http://192.168.31.120:8096;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Protocol $scheme;
        proxy_set_header X-Forwarded-Host $http_host;
    }

这里的 192.168.31.120:8096 是 Emby 服务器的ip地址和端口.

对于 Jellyfin, 添加如下 Nginx 配置

location / {
        proxy_pass http://192.168.31.120:8096;
        proxy_pass_request_headers on;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host $http_host;
        # 在流式传输时禁用缓冲
        proxy_buffering off;
    }

    location = /web/index.html {
        return 301 /web/;
    }

    location = /web/ {
        proxy_pass http://192.168.31.120:8096/web/;
        proxy_pass_request_headers on;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Host $http_host;
        # 禁用与后端压缩并侧载脚本
        proxy_set_header Accept-Encoding "";
        sub_filter '</body>' '<script src="https://jellyfin-danmaku.pages.dev/ede.user.js" defer></script></body>';
        sub_filter_once on;
    }
    
        location /socket {
        proxy_pass http://192.168.31.120:8096;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Protocol $scheme;
        proxy_set_header X-Forwarded-Host $http_host;
    }

对于 Plex, 由于不明原因反代设置失败, 请使用 Danmaku Anywhere 插件添加弹幕. 安装好插件后, 在装填配置处将 Plex 的 url 改为自己的 url, 适配选为 Plex 即可.

此作者没有提供个人介绍
最后更新于 2024-11-26