From 915e7e3639908afc033730f84962dca2674cfb4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B1=B3?= Date: Mon, 14 Oct 2024 00:16:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9=E4=BA=8E=E6=94=B6?= =?UTF-8?q?=E8=B4=B9=E7=9B=B4=E6=92=AD=E7=9A=84=E5=BD=95=E5=88=B6=E5=B0=9D?= =?UTF-8?q?=E8=AF=95=E5=92=8C=E4=BF=AE=E5=A4=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Core/RuntimeObject/Danmu.cs | 4 +++- Core/RuntimeObject/Download/HLS.cs | 30 +++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Core/RuntimeObject/Danmu.cs b/Core/RuntimeObject/Danmu.cs index 9f87f8db..1e340323 100644 --- a/Core/RuntimeObject/Danmu.cs +++ b/Core/RuntimeObject/Danmu.cs @@ -206,7 +206,9 @@ public static void SevaDanmu(LiveChat.LiveChatListener liveChatListener, bool De /// 保存路径 /// 昵称 /// 房间号 - public static FileInfo SevaDanmu(List danmuInfo, string FileName, string Name, long roomId) + /// 是否为临时保存(不删除记录) + /// + public static FileInfo SevaDanmu(List danmuInfo, string FileName, string Name, long roomId,bool IsTemporary= false) { string XML = string.Empty; XML = "" + diff --git a/Core/RuntimeObject/Download/HLS.cs b/Core/RuntimeObject/Download/HLS.cs index 14f976e3..144b5b41 100644 --- a/Core/RuntimeObject/Download/HLS.cs +++ b/Core/RuntimeObject/Download/HLS.cs @@ -237,29 +237,45 @@ private static DlwnloadTaskState HandleHlsError(RoomCardClass card, HostClass ho { return DlwnloadTaskState.StopLive; } - if(card.DownInfo.Unmark) + + if (card.DownInfo.Unmark) { return DlwnloadTaskState.UserCancellation; } - //是否为收费直播 + // bool isPaidLiveStream = hostClass.all_special_types.Contains(1); + string url = string.Empty; + + //是否为收费直播 if (isPaidLiveStream) - { - card.DownInfo.Status = RoomCardClass.DownloadStatus.Special; - return DlwnloadTaskState.PaidLiveStream; + { + //测是否有门票 + if (!GetHlsAvcUrl(card, Core.Config.Core_RunConfig._DefaultResolution, out url)) + { + //没门票 + card.DownInfo.Status = RoomCardClass.DownloadStatus.Special; + return DlwnloadTaskState.PaidLiveStream; + } + //有门票 + if (!string.IsNullOrEmpty(url)) + { + Log.Info(nameof(HandleHlsError), $"[{card.Name}({card.RoomId})]检测到收费直播,但是好像有门票,继续尝试录制"); + } } + //是否有HLS流 if (hostClass.Effective) { - card.DownInfo.Status = RoomCardClass.DownloadStatus.Downloading; + card.DownInfo.Status = RoomCardClass.DownloadStatus.Downloading; return DlwnloadTaskState.Default; } else { - card.DownInfo.Status = RoomCardClass.DownloadStatus.Standby; + card.DownInfo.Status = RoomCardClass.DownloadStatus.Standby; return DlwnloadTaskState.NoHLSStreamExists; } } + /// /// 更新下载速度 ///