diff --git a/internal/service/emby_remote.go b/internal/service/emby_remote.go index 924cb4c..598616a 100644 --- a/internal/service/emby_remote.go +++ b/internal/service/emby_remote.go @@ -406,6 +406,9 @@ func (r *EmbyRemoteService) RemotePlaybackInfo(ctx context.Context, acct *model. } // rewritePlayURLs 按代理模式重写载荷内 MediaSources 的播放地址。 +// 远程 Emby 的 PlaybackInfo 通常不返回 DirectStreamUrl(客户端靠它拼 +// /Videos/{Id}/stream),因此这里总是强制构造播放地址,完全由 MMTL 掌控 +// 直连(远程绝对 URL)或代理(本地 /Videos/{encoded})的最终去向。 func (r *EmbyRemoteService) rewritePlayURLs(value any, acct *model.StrmAccount, cfg *EmbyRemoteConfig, remoteID string) { encoded := EncodeEmbyRemoteID(acct.ID, remoteID) sources := collectMediaSources(value) @@ -426,9 +429,8 @@ func (r *EmbyRemoteService) rewritePlayURLs(value any, acct *model.StrmAccount, } subtitlePlayURL = base + "/Videos/" + url.PathEscape(remoteID) } - if _, exists := src["DirectStreamUrl"]; exists { - src["DirectStreamUrl"] = streamPath - } + // 直连/代理地址总是下发(PlaybackInfo 语义:客户端直接请求该 URL)。 + src["DirectStreamUrl"] = streamPath if _, exists := src["TranscodingUrl"]; exists { src["TranscodingUrl"] = streamPath } diff --git a/internal/service/strm_service.go b/internal/service/strm_service.go index 994669e..ca46671 100644 --- a/internal/service/strm_service.go +++ b/internal/service/strm_service.go @@ -273,9 +273,10 @@ func HasStrmAccountCredential(acct *model.StrmAccount) bool { case model.StrmProviderOpenList: return strings.Contains(acct.Config, `"token"`) || strings.Contains(acct.Config, `"password"`) case model.StrmProviderEmbyRemote: - // 远程 Emby:已保存接入地址与认证凭据(自动认证得到的 token 或手动 api_key)。 + // 远程 Emby:接入地址 + (自动认证凭据 或 手动 api_key) 即视为已配置。 return strings.Contains(acct.Config, `"url"`) && - (strings.Contains(acct.Config, `"token"`) || strings.Contains(acct.Config, `"api_key"`)) + (strings.Contains(acct.Config, `"token"`) || strings.Contains(acct.Config, `"api_key"`) || + (strings.Contains(acct.Config, `"username"`) && strings.Contains(acct.Config, `"password"`))) default: return strings.Contains(acct.Config, `"password"`) || strings.Contains(acct.Config, `"token"`) }