From a57af4042ff37fae74c33a6a239823b2c632e351 Mon Sep 17 00:00:00 2001 From: whimsical-c4lic0 Date: Mon, 9 Feb 2026 01:10:05 -0600 Subject: [PATCH] Refactor remaining entities --- OF DL/Helpers/VersionHelper.cs | 4 +- OF DL/Models/Auth.cs | 18 ++++-- OF DL/Models/CDRMProjectRequest.cs | 5 +- OF DL/Models/Config.cs | 61 ++++++++----------- OF DL/Models/CreatorConfig.cs | 12 ++++ OF DL/Models/DynamicRules.cs | 2 +- OF DL/Models/FileNameFormatConfig.cs | 3 + OF DL/Models/IFileNameFormatConfig.cs | 3 + ...esponse.cs => LatestReleaseApiResponse.cs} | 2 +- OF DL/Models/OFDLRequest.cs | 5 +- OF DL/Models/ToggleableConfigAttribute.cs | 4 +- OF DL/Program.cs | 12 ++-- OF DL/Services/APIService.cs | 30 ++++----- OF DL/Services/AuthService.cs | 2 +- OF DL/Services/DownloadService.cs | 50 +++++++-------- 15 files changed, 113 insertions(+), 100 deletions(-) create mode 100644 OF DL/Models/CreatorConfig.cs rename OF DL/Models/{LatestReleaseAPIResponse.cs => LatestReleaseApiResponse.cs} (79%) diff --git a/OF DL/Helpers/VersionHelper.cs b/OF DL/Helpers/VersionHelper.cs index 1343f3d..2b3903b 100644 --- a/OF DL/Helpers/VersionHelper.cs +++ b/OF DL/Helpers/VersionHelper.cs @@ -27,8 +27,8 @@ public static class VersionHelper Log.Debug("GetLatestReleaseTag API Response: "); Log.Debug(body); - LatestReleaseAPIResponse? versionCheckResponse = - JsonConvert.DeserializeObject(body); + LatestReleaseApiResponse? versionCheckResponse = + JsonConvert.DeserializeObject(body); if (versionCheckResponse == null || versionCheckResponse.TagName == "") { diff --git a/OF DL/Models/Auth.cs b/OF DL/Models/Auth.cs index 7369d34..0788fbd 100644 --- a/OF DL/Models/Auth.cs +++ b/OF DL/Models/Auth.cs @@ -4,10 +4,18 @@ namespace OF_DL.Models; public class Auth { - public string? USER_ID { get; set; } = ""; - public string? USER_AGENT { get; set; } = ""; - public string? X_BC { get; set; } = ""; - public string? COOKIE { get; set; } = ""; + [JsonProperty(PropertyName = "USER_ID")] + public string? UserId { get; set; } = ""; - [JsonIgnore] public string? FFMPEG_PATH { get; set; } = ""; + [JsonProperty(PropertyName = "USER_AGENT")] + public string? UserAgent { get; set; } = ""; + + [JsonProperty(PropertyName = "X_BC")] public string? XBc { get; set; } = ""; + + [JsonProperty(PropertyName = "COOKIE")] + public string? Cookie { get; set; } = ""; + + [JsonIgnore] + [JsonProperty(PropertyName = "FFMPEG_PATH")] + public string? FfmpegPath { get; set; } = ""; } diff --git a/OF DL/Models/CDRMProjectRequest.cs b/OF DL/Models/CDRMProjectRequest.cs index 182e827..07ae8fe 100644 --- a/OF DL/Models/CDRMProjectRequest.cs +++ b/OF DL/Models/CDRMProjectRequest.cs @@ -2,11 +2,12 @@ using Newtonsoft.Json; namespace OF_DL.Models; +// ReSharper disable once InconsistentNaming public class CDRMProjectRequest { - [JsonProperty("pssh")] public string PSSH { get; set; } = ""; + [JsonProperty("pssh")] public string Pssh { get; set; } = ""; - [JsonProperty("licurl")] public string LicenseURL { get; set; } = ""; + [JsonProperty("licurl")] public string LicenseUrl { get; set; } = ""; [JsonProperty("headers")] public string Headers { get; set; } = ""; diff --git a/OF DL/Models/Config.cs b/OF DL/Models/Config.cs index aeb77b7..4e45631 100644 --- a/OF DL/Models/Config.cs +++ b/OF DL/Models/Config.cs @@ -105,52 +105,39 @@ public class Config : IFileNameFormatConfig public IFileNameFormatConfig GetCreatorFileNameFormatConfig(string username) { - FileNameFormatConfig createFileNameFormatConfig = new(); - - Func func = (val1, val2) => - { - if (string.IsNullOrEmpty(val1)) - { - return val2; - } - - return val1; - }; + FileNameFormatConfig combinedFilenameFormatConfig = new(); if (CreatorConfigs.TryGetValue(username, out CreatorConfig? creatorConfig)) { - createFileNameFormatConfig.PaidMessageFileNameFormat = creatorConfig.PaidMessageFileNameFormat; - createFileNameFormatConfig.PostFileNameFormat = creatorConfig.PostFileNameFormat; - createFileNameFormatConfig.MessageFileNameFormat = creatorConfig.MessageFileNameFormat; - createFileNameFormatConfig.PaidPostFileNameFormat = creatorConfig.PaidPostFileNameFormat; + combinedFilenameFormatConfig.PaidMessageFileNameFormat = + !string.IsNullOrEmpty(creatorConfig.PaidMessageFileNameFormat) + ? creatorConfig.PaidMessageFileNameFormat + : PaidMessageFileNameFormat; + + combinedFilenameFormatConfig.PostFileNameFormat = !string.IsNullOrEmpty(creatorConfig.PostFileNameFormat) + ? creatorConfig.PostFileNameFormat + : PostFileNameFormat; + + combinedFilenameFormatConfig.MessageFileNameFormat = + !string.IsNullOrEmpty(creatorConfig.MessageFileNameFormat) + ? creatorConfig.MessageFileNameFormat + : MessageFileNameFormat; + + combinedFilenameFormatConfig.PaidPostFileNameFormat = + !string.IsNullOrEmpty(creatorConfig.PaidPostFileNameFormat) + ? creatorConfig.PaidPostFileNameFormat + : PaidPostFileNameFormat; } - createFileNameFormatConfig.PaidMessageFileNameFormat = - func(createFileNameFormatConfig.PaidMessageFileNameFormat, PaidMessageFileNameFormat); - createFileNameFormatConfig.PostFileNameFormat = - func(createFileNameFormatConfig.PostFileNameFormat, PostFileNameFormat); - createFileNameFormatConfig.MessageFileNameFormat = - func(createFileNameFormatConfig.MessageFileNameFormat, MessageFileNameFormat); - createFileNameFormatConfig.PaidPostFileNameFormat = - func(createFileNameFormatConfig.PaidPostFileNameFormat, PaidPostFileNameFormat); - Log.Debug("PaidMessageFilenameFormat: {CombinedConfigPaidMessageFileNameFormat}", - createFileNameFormatConfig.PaidMessageFileNameFormat); + combinedFilenameFormatConfig.PaidMessageFileNameFormat); Log.Debug("PostFileNameFormat: {CombinedConfigPostFileNameFormat}", - createFileNameFormatConfig.PostFileNameFormat); + combinedFilenameFormatConfig.PostFileNameFormat); Log.Debug("MessageFileNameFormat: {CombinedConfigMessageFileNameFormat}", - createFileNameFormatConfig.MessageFileNameFormat); + combinedFilenameFormatConfig.MessageFileNameFormat); Log.Debug("PaidPostFileNameFormat: {CombinedConfigPaidPostFileNameFormat}", - createFileNameFormatConfig.PaidPostFileNameFormat); + combinedFilenameFormatConfig.PaidPostFileNameFormat); - return createFileNameFormatConfig; + return combinedFilenameFormatConfig; } } - -public class CreatorConfig : IFileNameFormatConfig -{ - public string? PaidPostFileNameFormat { get; set; } - public string? PostFileNameFormat { get; set; } - public string? PaidMessageFileNameFormat { get; set; } - public string? MessageFileNameFormat { get; set; } -} diff --git a/OF DL/Models/CreatorConfig.cs b/OF DL/Models/CreatorConfig.cs new file mode 100644 index 0000000..6c7ad40 --- /dev/null +++ b/OF DL/Models/CreatorConfig.cs @@ -0,0 +1,12 @@ +namespace OF_DL.Models; + +public class CreatorConfig : IFileNameFormatConfig +{ + public string? PaidPostFileNameFormat { get; set; } + + public string? PostFileNameFormat { get; set; } + + public string? PaidMessageFileNameFormat { get; set; } + + public string? MessageFileNameFormat { get; set; } +} diff --git a/OF DL/Models/DynamicRules.cs b/OF DL/Models/DynamicRules.cs index d1e8968..412547a 100644 --- a/OF DL/Models/DynamicRules.cs +++ b/OF DL/Models/DynamicRules.cs @@ -26,5 +26,5 @@ public class DynamicRules public int? ChecksumConstant { get; set; } [JsonProperty(PropertyName = "checksum_indexes")] - public List ChecksumIndexes { get; set; } + public List ChecksumIndexes { get; set; } = []; } diff --git a/OF DL/Models/FileNameFormatConfig.cs b/OF DL/Models/FileNameFormatConfig.cs index 8b51a05..2b1b0b2 100644 --- a/OF DL/Models/FileNameFormatConfig.cs +++ b/OF DL/Models/FileNameFormatConfig.cs @@ -3,7 +3,10 @@ namespace OF_DL.Models; public class FileNameFormatConfig : IFileNameFormatConfig { public string? PaidPostFileNameFormat { get; set; } + public string? PostFileNameFormat { get; set; } + public string? PaidMessageFileNameFormat { get; set; } + public string? MessageFileNameFormat { get; set; } } diff --git a/OF DL/Models/IFileNameFormatConfig.cs b/OF DL/Models/IFileNameFormatConfig.cs index 85b1d60..7622eee 100644 --- a/OF DL/Models/IFileNameFormatConfig.cs +++ b/OF DL/Models/IFileNameFormatConfig.cs @@ -3,7 +3,10 @@ namespace OF_DL.Models; public interface IFileNameFormatConfig { string? PaidPostFileNameFormat { get; set; } + string? PostFileNameFormat { get; set; } + string? PaidMessageFileNameFormat { get; set; } + string? MessageFileNameFormat { get; set; } } diff --git a/OF DL/Models/LatestReleaseAPIResponse.cs b/OF DL/Models/LatestReleaseApiResponse.cs similarity index 79% rename from OF DL/Models/LatestReleaseAPIResponse.cs rename to OF DL/Models/LatestReleaseApiResponse.cs index ec77eb7..3cf66ee 100644 --- a/OF DL/Models/LatestReleaseAPIResponse.cs +++ b/OF DL/Models/LatestReleaseApiResponse.cs @@ -2,7 +2,7 @@ using Newtonsoft.Json; namespace OF_DL.Models; -public class LatestReleaseAPIResponse +public class LatestReleaseApiResponse { [JsonProperty(PropertyName = "tag_name")] public string TagName { get; set; } = ""; diff --git a/OF DL/Models/OFDLRequest.cs b/OF DL/Models/OFDLRequest.cs index 5af7a25..52fef56 100644 --- a/OF DL/Models/OFDLRequest.cs +++ b/OF DL/Models/OFDLRequest.cs @@ -2,11 +2,12 @@ using Newtonsoft.Json; namespace OF_DL.Models; +// ReSharper disable once InconsistentNaming public class OFDLRequest { - [JsonProperty("pssh")] public string PSSH { get; set; } = ""; + [JsonProperty("pssh")] public string Pssh { get; set; } = ""; - [JsonProperty("licenceURL")] public string LicenseURL { get; set; } = ""; + [JsonProperty("licenceURL")] public string LicenseUrl { get; set; } = ""; [JsonProperty("headers")] public string Headers { get; set; } = ""; } diff --git a/OF DL/Models/ToggleableConfigAttribute.cs b/OF DL/Models/ToggleableConfigAttribute.cs index 98880a5..c0e6c83 100644 --- a/OF DL/Models/ToggleableConfigAttribute.cs +++ b/OF DL/Models/ToggleableConfigAttribute.cs @@ -1,6 +1,4 @@ namespace OF_DL.Models; [AttributeUsage(AttributeTargets.Property)] -internal class ToggleableConfigAttribute : Attribute -{ -} +internal class ToggleableConfigAttribute : Attribute; diff --git a/OF DL/Program.cs b/OF DL/Program.cs index 44b1bd7..b37abd5 100644 --- a/OF DL/Program.cs +++ b/OF DL/Program.cs @@ -376,12 +376,12 @@ public class Program(IServiceProvider serviceProvider) Log.Debug($"FFMPEG found: {configService.CurrentConfig.FFmpegPath}"); Log.Debug("FFMPEG path set in config.conf"); } - else if (!string.IsNullOrEmpty(authService.CurrentAuth!.FFMPEG_PATH) && - ValidateFilePath(authService.CurrentAuth.FFMPEG_PATH)) + else if (!string.IsNullOrEmpty(authService.CurrentAuth!.FfmpegPath) && + ValidateFilePath(authService.CurrentAuth.FfmpegPath)) { // FFmpeg path is set in auth.json and is valid (config.conf takes precedence and auth.json is only available for backward compatibility) ffmpegFound = true; - configService.CurrentConfig.FFmpegPath = authService.CurrentAuth.FFMPEG_PATH; + configService.CurrentConfig.FFmpegPath = authService.CurrentAuth.FfmpegPath; Log.Debug($"FFMPEG found: {configService.CurrentConfig.FFmpegPath}"); Log.Debug("FFMPEG path set in auth.json"); } @@ -2638,7 +2638,7 @@ public class Program(IServiceProvider serviceProvider) public static void ValidateCookieString(Auth auth) { string pattern = @"(auth_id=\d+)|(sess=[^;]+)"; - MatchCollection matches = Regex.Matches(auth.COOKIE, pattern); + MatchCollection matches = Regex.Matches(auth.Cookie, pattern); string output = string.Join("; ", matches); @@ -2647,9 +2647,9 @@ public class Program(IServiceProvider serviceProvider) output += ";"; } - if (auth.COOKIE.Trim() != output.Trim()) + if (auth.Cookie.Trim() != output.Trim()) { - auth.COOKIE = output; + auth.Cookie = output; string newAuthString = JsonConvert.SerializeObject(auth, Formatting.Indented); File.WriteAllText("auth.json", newAuthString); } diff --git a/OF DL/Services/APIService.cs b/OF DL/Services/APIService.cs index 0872e93..80edeb4 100644 --- a/OF DL/Services/APIService.cs +++ b/OF DL/Services/APIService.cs @@ -95,7 +95,7 @@ public class APIService(IAuthService authService, IConfigService configService, DateTimeOffset dto = DateTime.UtcNow; long timestamp = dto.ToUnixTimeMilliseconds(); - string input = $"{root!.StaticParam}\n{timestamp}\n{path + queryParams}\n{authService.CurrentAuth.USER_ID}"; + string input = $"{root!.StaticParam}\n{timestamp}\n{path + queryParams}\n{authService.CurrentAuth.UserId}"; byte[] inputBytes = Encoding.UTF8.GetBytes(input); byte[] hashBytes = SHA1.HashData(inputBytes); string hashString = BitConverter.ToString(hashBytes).Replace("-", "").ToLower(); @@ -108,12 +108,12 @@ public class APIService(IAuthService authService, IConfigService configService, { { "accept", "application/json, text/plain" }, { "app-token", root.AppToken! }, - { "cookie", authService.CurrentAuth!.COOKIE! }, + { "cookie", authService.CurrentAuth!.Cookie! }, { "sign", sign }, { "time", timestamp.ToString() }, - { "user-id", authService.CurrentAuth!.USER_ID! }, - { "user-agent", authService.CurrentAuth!.USER_AGENT! }, - { "x-bc", authService.CurrentAuth!.X_BC! } + { "user-id", authService.CurrentAuth!.UserId! }, + { "user-agent", authService.CurrentAuth!.UserAgent! }, + { "x-bc", authService.CurrentAuth!.XBc! } }; return headers; } @@ -1634,7 +1634,7 @@ public class APIService(IAuthService authService, IConfigService configService, } if (!configService.CurrentConfig.IgnoreOwnMessages || - list.FromUser?.Id != Convert.ToInt32(authService.CurrentAuth.USER_ID)) + list.FromUser?.Id != Convert.ToInt32(authService.CurrentAuth.UserId)) { await dbService.AddMessage(folder, list.Id, list.Text ?? "", list.Price ?? "0", list.CanPurchaseReason == "opened" ? true : @@ -1834,7 +1834,7 @@ public class APIService(IAuthService authService, IConfigService configService, message = MessagesMapper.FromDto(messageDto); if (!configService.CurrentConfig.IgnoreOwnMessages || - message.FromUser?.Id != Convert.ToInt32(authService.CurrentAuth.USER_ID)) + message.FromUser?.Id != Convert.ToInt32(authService.CurrentAuth.UserId)) { await dbService.AddMessage(folder, message.Id, message.Text ?? "", message.Price != null ? message.Price.ToString() : "0", true, false, @@ -2101,7 +2101,7 @@ public class APIService(IAuthService authService, IConfigService configService, .OrderByDescending(p => p.PostedAt ?? p.CreatedAt)) { if (!configService.CurrentConfig.IgnoreOwnMessages || - purchase.FromUser.Id != Convert.ToInt32(authService.CurrentAuth.USER_ID)) + purchase.FromUser.Id != Convert.ToInt32(authService.CurrentAuth.UserId)) { if (purchase.PostedAt != null) { @@ -3034,10 +3034,10 @@ public class APIService(IAuthService authService, IConfigService configService, HttpClient client = new(); HttpRequestMessage request = new(HttpMethod.Get, mpdUrl); - request.Headers.Add("user-agent", authService.CurrentAuth.USER_AGENT); + request.Headers.Add("user-agent", authService.CurrentAuth.UserAgent); request.Headers.Add("Accept", "*/*"); request.Headers.Add("Cookie", - $"CloudFront-Policy={policy}; CloudFront-Signature={signature}; CloudFront-Key-Pair-Id={kvp}; {authService.CurrentAuth.COOKIE};"); + $"CloudFront-Policy={policy}; CloudFront-Signature={signature}; CloudFront-Key-Pair-Id={kvp}; {authService.CurrentAuth.Cookie};"); using (HttpResponseMessage response = await client.SendAsync(request)) { response.EnsureSuccessStatusCode(); @@ -3083,10 +3083,10 @@ public class APIService(IAuthService authService, IConfigService configService, HttpClient client = new(); HttpRequestMessage request = new(HttpMethod.Get, mpdUrl); - request.Headers.Add("user-agent", authService.CurrentAuth.USER_AGENT); + request.Headers.Add("user-agent", authService.CurrentAuth.UserAgent); request.Headers.Add("Accept", "*/*"); request.Headers.Add("Cookie", - $"CloudFront-Policy={policy}; CloudFront-Signature={signature}; CloudFront-Key-Pair-Id={kvp}; {authService.CurrentAuth.COOKIE};"); + $"CloudFront-Policy={policy}; CloudFront-Signature={signature}; CloudFront-Key-Pair-Id={kvp}; {authService.CurrentAuth.Cookie};"); using (HttpResponseMessage response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead)) { @@ -3129,8 +3129,8 @@ public class APIService(IAuthService authService, IConfigService configService, CDRMProjectRequest cdrmProjectRequest = new() { - PSSH = pssh, - LicenseURL = licenceURL, + Pssh = pssh, + LicenseUrl = licenceURL, Headers = JsonConvert.SerializeObject(drmHeaders), Cookies = "", Data = "" @@ -3212,7 +3212,7 @@ public class APIService(IAuthService authService, IConfigService configService, OFDLRequest ofdlRequest = new() { - PSSH = pssh, LicenseURL = licenceURL, Headers = JsonConvert.SerializeObject(drmHeaders) + Pssh = pssh, LicenseUrl = licenceURL, Headers = JsonConvert.SerializeObject(drmHeaders) }; string json = JsonConvert.SerializeObject(ofdlRequest); diff --git a/OF DL/Services/AuthService.cs b/OF DL/Services/AuthService.cs index 8887731..3f9f654 100644 --- a/OF DL/Services/AuthService.cs +++ b/OF DL/Services/AuthService.cs @@ -212,7 +212,7 @@ public class AuthService : IAuthService string cookies = string.Join(" ", mappedCookies.Keys.Where(key => _desiredCookies.Contains(key)) .Select(key => $"${key}={mappedCookies[key]};")); - return new Auth { COOKIE = cookies, USER_AGENT = userAgent, USER_ID = userId, X_BC = xBc }; + return new Auth { Cookie = cookies, UserAgent = userAgent, UserId = userId, XBc = xBc }; } catch (Exception e) { diff --git a/OF DL/Services/DownloadService.cs b/OF DL/Services/DownloadService.cs index 254169d..1e6c74d 100644 --- a/OF DL/Services/DownloadService.cs +++ b/OF DL/Services/DownloadService.cs @@ -334,10 +334,10 @@ public class DownloadService( { HttpClient client = new(); HttpRequestMessage request = new(HttpMethod.Get, mpdUrl); - request.Headers.Add("user-agent", authService.CurrentAuth.USER_AGENT); + request.Headers.Add("user-agent", authService.CurrentAuth.UserAgent); request.Headers.Add("Accept", "*/*"); request.Headers.Add("Cookie", - $"CloudFront-Policy={policy}; CloudFront-Signature={signature}; CloudFront-Key-Pair-Id={kvp}; {authService.CurrentAuth.COOKIE};"); + $"CloudFront-Policy={policy}; CloudFront-Signature={signature}; CloudFront-Key-Pair-Id={kvp}; {authService.CurrentAuth.Cookie};"); using (HttpResponseMessage response = await client.SendAsync(request)) { response.EnsureSuccessStatusCode(); @@ -568,8 +568,8 @@ public class DownloadService( using HttpClient client = new(); client.DefaultRequestHeaders.Add("Cookie", - $"CloudFront-Policy={policy}; CloudFront-Signature={signature}; CloudFront-Key-Pair-Id={kvp}; {authService.CurrentAuth.COOKIE}"); - client.DefaultRequestHeaders.Add("User-Agent", authService.CurrentAuth.USER_AGENT); + $"CloudFront-Policy={policy}; CloudFront-Signature={signature}; CloudFront-Key-Pair-Id={kvp}; {authService.CurrentAuth.Cookie}"); + client.DefaultRequestHeaders.Add("User-Agent", authService.CurrentAuth.UserAgent); using HttpResponseMessage response = await client.GetAsync(mpdURL, HttpCompletionOption.ResponseHeadersRead); @@ -581,7 +581,7 @@ public class DownloadService( else { using HttpClient client = new(); - client.DefaultRequestHeaders.Add("User-Agent", authService.CurrentAuth.USER_AGENT); + client.DefaultRequestHeaders.Add("User-Agent", authService.CurrentAuth.UserAgent); using HttpResponseMessage response = await client.GetAsync(uri, HttpCompletionOption.ResponseHeadersRead); if (response.IsSuccessStatusCode) @@ -612,8 +612,8 @@ public class DownloadService( using HttpClient client = new(); client.DefaultRequestHeaders.Add("Cookie", - $"CloudFront-Policy={policy}; CloudFront-Signature={signature}; CloudFront-Key-Pair-Id={kvp}; {auth.COOKIE}"); - client.DefaultRequestHeaders.Add("User-Agent", auth.USER_AGENT); + $"CloudFront-Policy={policy}; CloudFront-Signature={signature}; CloudFront-Key-Pair-Id={kvp}; {auth.Cookie}"); + client.DefaultRequestHeaders.Add("User-Agent", auth.UserAgent); using HttpResponseMessage response = await client.GetAsync(mpdURL, HttpCompletionOption.ResponseHeadersRead); if (response.IsSuccessStatusCode) @@ -1242,8 +1242,8 @@ public class DownloadService( ? !File.Exists(folder + path + "/" + customFileName + ".mp4") : !File.Exists(folder + path + "/" + filename + "_source.mp4")) { - return await DownloadDrmMedia(authService.CurrentAuth.USER_AGENT, policy, signature, kvp, - authService.CurrentAuth.COOKIE, url, decryptionKey, folder, lastModified, media_id, api_type, + return await DownloadDrmMedia(authService.CurrentAuth.UserAgent, policy, signature, kvp, + authService.CurrentAuth.Cookie, url, decryptionKey, folder, lastModified, media_id, api_type, progressReporter, customFileName, filename, path); } @@ -1371,8 +1371,8 @@ public class DownloadService( ? !File.Exists(folder + path + "/" + customFileName + ".mp4") : !File.Exists(folder + path + "/" + filename + "_source.mp4")) { - return await DownloadDrmMedia(authService.CurrentAuth.USER_AGENT, policy, signature, kvp, - authService.CurrentAuth.COOKIE, url, decryptionKey, folder, lastModified, media_id, api_type, + return await DownloadDrmMedia(authService.CurrentAuth.UserAgent, policy, signature, kvp, + authService.CurrentAuth.Cookie, url, decryptionKey, folder, lastModified, media_id, api_type, progressReporter, customFileName, filename, path); } @@ -1501,8 +1501,8 @@ public class DownloadService( ? !File.Exists(folder + path + "/" + customFileName + ".mp4") : !File.Exists(folder + path + "/" + filename + "_source.mp4")) { - return await DownloadDrmMedia(authService.CurrentAuth.USER_AGENT, policy, signature, kvp, - authService.CurrentAuth.COOKIE, url, decryptionKey, folder, lastModified, media_id, api_type, + return await DownloadDrmMedia(authService.CurrentAuth.UserAgent, policy, signature, kvp, + authService.CurrentAuth.Cookie, url, decryptionKey, folder, lastModified, media_id, api_type, progressReporter, customFileName, filename, path); } @@ -1629,8 +1629,8 @@ public class DownloadService( ? !File.Exists(folder + path + "/" + customFileName + ".mp4") : !File.Exists(folder + path + "/" + filename + "_source.mp4")) { - return await DownloadDrmMedia(authService.CurrentAuth.USER_AGENT, policy, signature, kvp, - authService.CurrentAuth.COOKIE, url, decryptionKey, folder, lastModified, media_id, api_type, + return await DownloadDrmMedia(authService.CurrentAuth.UserAgent, policy, signature, kvp, + authService.CurrentAuth.Cookie, url, decryptionKey, folder, lastModified, media_id, api_type, progressReporter, customFileName, filename, path); } @@ -1759,8 +1759,8 @@ public class DownloadService( ? !File.Exists(folder + path + "/" + customFileName + ".mp4") : !File.Exists(folder + path + "/" + filename + "_source.mp4")) { - return await DownloadDrmMedia(authService.CurrentAuth.USER_AGENT, policy, signature, kvp, - authService.CurrentAuth.COOKIE, url, decryptionKey, folder, lastModified, media_id, api_type, + return await DownloadDrmMedia(authService.CurrentAuth.UserAgent, policy, signature, kvp, + authService.CurrentAuth.Cookie, url, decryptionKey, folder, lastModified, media_id, api_type, progressReporter, customFileName, filename, path); } @@ -1888,8 +1888,8 @@ public class DownloadService( ? !File.Exists(folder + path + "/" + customFileName + ".mp4") : !File.Exists(folder + path + "/" + filename + "_source.mp4")) { - return await DownloadDrmMedia(authService.CurrentAuth.USER_AGENT, policy, signature, kvp, - authService.CurrentAuth.COOKIE, url, decryptionKey, folder, lastModified, media_id, api_type, + return await DownloadDrmMedia(authService.CurrentAuth.UserAgent, policy, signature, kvp, + authService.CurrentAuth.Cookie, url, decryptionKey, folder, lastModified, media_id, api_type, progressReporter, customFileName, filename, path); } @@ -2017,8 +2017,8 @@ public class DownloadService( ? !File.Exists(folder + path + "/" + customFileName + ".mp4") : !File.Exists(folder + path + "/" + filename + "_source.mp4")) { - return await DownloadDrmMedia(authService.CurrentAuth.USER_AGENT, policy, signature, kvp, - authService.CurrentAuth.COOKIE, url, decryptionKey, folder, lastModified, media_id, api_type, + return await DownloadDrmMedia(authService.CurrentAuth.UserAgent, policy, signature, kvp, + authService.CurrentAuth.Cookie, url, decryptionKey, folder, lastModified, media_id, api_type, progressReporter, customFileName, filename, path); } @@ -2147,8 +2147,8 @@ public class DownloadService( ? !File.Exists(folder + path + "/" + customFileName + ".mp4") : !File.Exists(folder + path + "/" + filename + "_source.mp4")) { - return await DownloadDrmMedia(authService.CurrentAuth.USER_AGENT, policy, signature, kvp, - authService.CurrentAuth.COOKIE, url, decryptionKey, folder, lastModified, media_id, api_type, + return await DownloadDrmMedia(authService.CurrentAuth.UserAgent, policy, signature, kvp, + authService.CurrentAuth.Cookie, url, decryptionKey, folder, lastModified, media_id, api_type, progressReporter, customFileName, filename, path); } @@ -2267,8 +2267,8 @@ public class DownloadService( ? !File.Exists(folder + path + "/" + customFileName + ".mp4") : !File.Exists(folder + path + "/" + filename + "_source.mp4")) { - return await DownloadDrmMedia(authService.CurrentAuth.USER_AGENT, policy, signature, kvp, - authService.CurrentAuth.COOKIE, url, decryptionKey, folder, lastModified, media_id, api_type, + return await DownloadDrmMedia(authService.CurrentAuth.UserAgent, policy, signature, kvp, + authService.CurrentAuth.Cookie, url, decryptionKey, folder, lastModified, media_id, api_type, progressReporter, customFileName, filename, path); }