Compare commits
No commits in common. "master" and "testing" have entirely different histories.
@ -103,10 +103,6 @@ namespace OF_DL.Entities
|
|||||||
|
|
||||||
[JsonConverter(typeof(StringEnumConverter))]
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
public VideoResolution DownloadVideoResolution { get; set; } = VideoResolution.source;
|
public VideoResolution DownloadVideoResolution { get; set; } = VideoResolution.source;
|
||||||
|
|
||||||
// When enabled, post/message text is stored as-is without XML stripping.
|
|
||||||
[ToggleableConfig]
|
|
||||||
public bool DisableTextSanitization { get; set; } = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CreatorConfig : IFileNameFormatConfig
|
public class CreatorConfig : IFileNameFormatConfig
|
||||||
|
@ -464,7 +464,7 @@ public class APIHelper : IAPIHelper
|
|||||||
Dictionary<string, string> getParams = new()
|
Dictionary<string, string> getParams = new()
|
||||||
{
|
{
|
||||||
{ "offset", offset.ToString() },
|
{ "offset", offset.ToString() },
|
||||||
{ "limit", "50" },
|
{ "limit", "50" }
|
||||||
};
|
};
|
||||||
List<string> users = new();
|
List<string> users = new();
|
||||||
|
|
||||||
@ -540,8 +540,7 @@ public class APIHelper : IAPIHelper
|
|||||||
getParams = new Dictionary<string, string>
|
getParams = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "limit", post_limit.ToString() },
|
{ "limit", post_limit.ToString() },
|
||||||
{ "order", "publish_date_desc" },
|
{ "order", "publish_date_desc" }
|
||||||
{ "skip_users", "all" }
|
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -549,8 +548,7 @@ public class APIHelper : IAPIHelper
|
|||||||
getParams = new Dictionary<string, string>
|
getParams = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "limit", limit.ToString() },
|
{ "limit", limit.ToString() },
|
||||||
{ "offset", offset.ToString() },
|
{ "offset", offset.ToString() }
|
||||||
{ "skip_users", "all" }
|
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -740,10 +738,9 @@ public class APIHelper : IAPIHelper
|
|||||||
Dictionary<string, string> getParams = new()
|
Dictionary<string, string> getParams = new()
|
||||||
{
|
{
|
||||||
{ "limit", post_limit.ToString() },
|
{ "limit", post_limit.ToString() },
|
||||||
{ "skip_users", "all" },
|
|
||||||
{ "order", "publish_date_desc" },
|
{ "order", "publish_date_desc" },
|
||||||
{ "format", "infinite" },
|
{ "format", "infinite" },
|
||||||
{ "author", username }
|
{ "user_id", username }
|
||||||
};
|
};
|
||||||
|
|
||||||
var body = await BuildHeaderAndExecuteRequests(getParams, endpoint, GetHttpClient(config));
|
var body = await BuildHeaderAndExecuteRequests(getParams, endpoint, GetHttpClient(config));
|
||||||
@ -909,8 +906,7 @@ public class APIHelper : IAPIHelper
|
|||||||
{
|
{
|
||||||
{ "limit", post_limit.ToString() },
|
{ "limit", post_limit.ToString() },
|
||||||
{ "order", "publish_date_desc" },
|
{ "order", "publish_date_desc" },
|
||||||
{ "format", "infinite" },
|
{ "format", "infinite" }
|
||||||
{ "skip_users", "all" }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Enumerations.DownloadDateSelection downloadDateSelection = Enumerations.DownloadDateSelection.before;
|
Enumerations.DownloadDateSelection downloadDateSelection = Enumerations.DownloadDateSelection.before;
|
||||||
@ -1241,8 +1237,7 @@ public class APIHelper : IAPIHelper
|
|||||||
{
|
{
|
||||||
{ "limit", post_limit.ToString() },
|
{ "limit", post_limit.ToString() },
|
||||||
{ "order", "publish_date_desc" },
|
{ "order", "publish_date_desc" },
|
||||||
{ "format", "infinite" },
|
{ "format", "infinite" }
|
||||||
{ "skip_users", "all" }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Enumerations.DownloadDateSelection downloadDateSelection = Enumerations.DownloadDateSelection.before;
|
Enumerations.DownloadDateSelection downloadDateSelection = Enumerations.DownloadDateSelection.before;
|
||||||
@ -1529,8 +1524,7 @@ public class APIHelper : IAPIHelper
|
|||||||
Dictionary<string, string> getParams = new()
|
Dictionary<string, string> getParams = new()
|
||||||
{
|
{
|
||||||
{ "limit", post_limit.ToString() },
|
{ "limit", post_limit.ToString() },
|
||||||
{ "order", "desc" },
|
{ "order", "desc" }
|
||||||
{ "skip_users", "all" }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var body = await BuildHeaderAndExecuteRequests(getParams, endpoint, GetHttpClient(config));
|
var body = await BuildHeaderAndExecuteRequests(getParams, endpoint, GetHttpClient(config));
|
||||||
@ -1846,8 +1840,7 @@ public class APIHelper : IAPIHelper
|
|||||||
{ "limit", post_limit.ToString() },
|
{ "limit", post_limit.ToString() },
|
||||||
{ "order", "publish_date_desc" },
|
{ "order", "publish_date_desc" },
|
||||||
{ "format", "infinite" },
|
{ "format", "infinite" },
|
||||||
{ "author", username },
|
{ "user_id", username }
|
||||||
{ "skip_users", "all" }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var body = await BuildHeaderAndExecuteRequests(getParams, endpoint, GetHttpClient(config));
|
var body = await BuildHeaderAndExecuteRequests(getParams, endpoint, GetHttpClient(config));
|
||||||
@ -2812,11 +2805,11 @@ public class APIHelper : IAPIHelper
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var resp1 = await PostData(licenceURL, drmHeaders, new byte[] { 0x08, 0x04 });
|
var resp1 = PostData(licenceURL, drmHeaders, new byte[] { 0x08, 0x04 });
|
||||||
var certDataB64 = Convert.ToBase64String(resp1);
|
var certDataB64 = Convert.ToBase64String(resp1);
|
||||||
var cdm = new CDMApi();
|
var cdm = new CDMApi();
|
||||||
var challenge = cdm.GetChallenge(pssh, certDataB64, false, false);
|
var challenge = cdm.GetChallenge(pssh, certDataB64, false, false);
|
||||||
var resp2 = await PostData(licenceURL, drmHeaders, challenge);
|
var resp2 = PostData(licenceURL, drmHeaders, challenge);
|
||||||
var licenseB64 = Convert.ToBase64String(resp2);
|
var licenseB64 = Convert.ToBase64String(resp2);
|
||||||
Log.Debug($"resp1: {resp1}");
|
Log.Debug($"resp1: {resp1}");
|
||||||
Log.Debug($"certDataB64: {certDataB64}");
|
Log.Debug($"certDataB64: {certDataB64}");
|
||||||
|
@ -3,7 +3,4 @@ namespace OF_DL.Helpers;
|
|||||||
public static class Constants
|
public static class Constants
|
||||||
{
|
{
|
||||||
public const string API_URL = "https://onlyfans.com/api2/v2";
|
public const string API_URL = "https://onlyfans.com/api2/v2";
|
||||||
|
|
||||||
public const int WIDEVINE_RETRY_DELAY = 10;
|
|
||||||
public const int WIDEVINE_MAX_RETRIES = 3;
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using OF_DL.Helpers;
|
using System;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -14,66 +13,46 @@ namespace WidevineClient
|
|||||||
//Proxy = null
|
//Proxy = null
|
||||||
});
|
});
|
||||||
|
|
||||||
public static async Task<byte[]> PostData(string URL, Dictionary<string, string> headers, string postData)
|
public static byte[] PostData(string URL, Dictionary<string, string> headers, string postData)
|
||||||
{
|
{
|
||||||
var mediaType = postData.StartsWith("{") ? "application/json" : "application/x-www-form-urlencoded";
|
var mediaType = postData.StartsWith("{") ? "application/json" : "application/x-www-form-urlencoded";
|
||||||
var response = await PerformOperation(async () =>
|
|
||||||
{
|
|
||||||
StringContent content = new StringContent(postData, Encoding.UTF8, mediaType);
|
StringContent content = new StringContent(postData, Encoding.UTF8, mediaType);
|
||||||
//ByteArrayContent content = new ByteArrayContent(postData);
|
//ByteArrayContent content = new ByteArrayContent(postData);
|
||||||
|
|
||||||
return await Post(URL, headers, content);
|
HttpResponseMessage response = Post(URL, headers, content);
|
||||||
});
|
byte[] bytes = response.Content.ReadAsByteArrayAsync().Result;
|
||||||
|
|
||||||
byte[] bytes = await response.Content.ReadAsByteArrayAsync();
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<byte[]> PostData(string URL, Dictionary<string, string> headers, byte[] postData)
|
public static byte[] PostData(string URL, Dictionary<string, string> headers, byte[] postData)
|
||||||
{
|
|
||||||
var response = await PerformOperation(async () =>
|
|
||||||
{
|
{
|
||||||
ByteArrayContent content = new ByteArrayContent(postData);
|
ByteArrayContent content = new ByteArrayContent(postData);
|
||||||
|
|
||||||
return await Post(URL, headers, content);
|
HttpResponseMessage response = Post(URL, headers, content);
|
||||||
});
|
byte[] bytes = response.Content.ReadAsByteArrayAsync().Result;
|
||||||
|
|
||||||
byte[] bytes = await response.Content.ReadAsByteArrayAsync();
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<byte[]> PostData(string URL, Dictionary<string, string> headers, Dictionary<string, string> postData)
|
public static byte[] PostData(string URL, Dictionary<string, string> headers, Dictionary<string, string> postData)
|
||||||
{
|
|
||||||
var response = await PerformOperation(async () =>
|
|
||||||
{
|
{
|
||||||
FormUrlEncodedContent content = new FormUrlEncodedContent(postData);
|
FormUrlEncodedContent content = new FormUrlEncodedContent(postData);
|
||||||
|
|
||||||
return await Post(URL, headers, content);
|
HttpResponseMessage response = Post(URL, headers, content);
|
||||||
});
|
byte[] bytes = response.Content.ReadAsByteArrayAsync().Result;
|
||||||
|
|
||||||
byte[] bytes = await response.Content.ReadAsByteArrayAsync();
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<string> GetWebSource(string URL, Dictionary<string, string> headers = null)
|
public static string GetWebSource(string URL, Dictionary<string, string> headers = null)
|
||||||
{
|
{
|
||||||
var response = await PerformOperation(async () =>
|
HttpResponseMessage response = Get(URL, headers);
|
||||||
{
|
byte[] bytes = response.Content.ReadAsByteArrayAsync().Result;
|
||||||
return await Get(URL, headers);
|
|
||||||
});
|
|
||||||
|
|
||||||
byte[] bytes = await response.Content.ReadAsByteArrayAsync();
|
|
||||||
return Encoding.UTF8.GetString(bytes);
|
return Encoding.UTF8.GetString(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<byte[]> GetBinary(string URL, Dictionary<string, string> headers = null)
|
public static byte[] GetBinary(string URL, Dictionary<string, string> headers = null)
|
||||||
{
|
{
|
||||||
var response = await PerformOperation(async () =>
|
HttpResponseMessage response = Get(URL, headers);
|
||||||
{
|
byte[] bytes = response.Content.ReadAsByteArrayAsync().Result;
|
||||||
return await Get(URL, headers);
|
|
||||||
});
|
|
||||||
|
|
||||||
byte[] bytes = await response.Content.ReadAsByteArrayAsync();
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
public static string GetString(byte[] bytes)
|
public static string GetString(byte[] bytes)
|
||||||
@ -81,7 +60,7 @@ namespace WidevineClient
|
|||||||
return Encoding.UTF8.GetString(bytes);
|
return Encoding.UTF8.GetString(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<HttpResponseMessage> Get(string URL, Dictionary<string, string> headers = null)
|
static HttpResponseMessage Get(string URL, Dictionary<string, string> headers = null)
|
||||||
{
|
{
|
||||||
HttpRequestMessage request = new HttpRequestMessage()
|
HttpRequestMessage request = new HttpRequestMessage()
|
||||||
{
|
{
|
||||||
@ -93,10 +72,10 @@ namespace WidevineClient
|
|||||||
foreach (KeyValuePair<string, string> header in headers)
|
foreach (KeyValuePair<string, string> header in headers)
|
||||||
request.Headers.TryAddWithoutValidation(header.Key, header.Value);
|
request.Headers.TryAddWithoutValidation(header.Key, header.Value);
|
||||||
|
|
||||||
return await Send(request);
|
return Send(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<HttpResponseMessage> Post(string URL, Dictionary<string, string> headers, HttpContent content)
|
static HttpResponseMessage Post(string URL, Dictionary<string, string> headers, HttpContent content)
|
||||||
{
|
{
|
||||||
HttpRequestMessage request = new HttpRequestMessage()
|
HttpRequestMessage request = new HttpRequestMessage()
|
||||||
{
|
{
|
||||||
@ -109,41 +88,12 @@ namespace WidevineClient
|
|||||||
foreach (KeyValuePair<string, string> header in headers)
|
foreach (KeyValuePair<string, string> header in headers)
|
||||||
request.Headers.TryAddWithoutValidation(header.Key, header.Value);
|
request.Headers.TryAddWithoutValidation(header.Key, header.Value);
|
||||||
|
|
||||||
return await Send(request);
|
return Send(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<HttpResponseMessage> Send(HttpRequestMessage request)
|
static HttpResponseMessage Send(HttpRequestMessage request)
|
||||||
{
|
{
|
||||||
return await Client.SendAsync(request);
|
return Client.SendAsync(request).Result;
|
||||||
}
|
|
||||||
|
|
||||||
private static async Task<HttpResponseMessage> PerformOperation(Func<Task<HttpResponseMessage>> operation)
|
|
||||||
{
|
|
||||||
var response = await operation();
|
|
||||||
|
|
||||||
var retryCount = 0;
|
|
||||||
|
|
||||||
while (retryCount < Constants.WIDEVINE_MAX_RETRIES && response.StatusCode == System.Net.HttpStatusCode.TooManyRequests)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// We've hit a rate limit, so we should wait before retrying.
|
|
||||||
//
|
|
||||||
var retryAfterSeconds = Constants.WIDEVINE_RETRY_DELAY * (retryCount + 1); // Default retry time. Increases with each retry.
|
|
||||||
if (response.Headers.RetryAfter != null && response.Headers.RetryAfter.Delta.HasValue)
|
|
||||||
{
|
|
||||||
if (response.Headers.RetryAfter.Delta.Value.TotalSeconds > 0)
|
|
||||||
retryAfterSeconds = (int)response.Headers.RetryAfter.Delta.Value.TotalSeconds + 1; // Add 1 second to ensure we wait a bit longer than the suggested time
|
|
||||||
}
|
|
||||||
|
|
||||||
await Task.Delay(retryAfterSeconds * 1000); // Peform the delay
|
|
||||||
|
|
||||||
response = await operation();
|
|
||||||
retryCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
response.EnsureSuccessStatusCode(); // Throw an exception if the response is not successful
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,6 @@ public class Program
|
|||||||
hoconConfig.AppendLine($" DownloadDateSelection = \"{jsonConfig.DownloadDateSelection.ToString().ToLower()}\"");
|
hoconConfig.AppendLine($" DownloadDateSelection = \"{jsonConfig.DownloadDateSelection.ToString().ToLower()}\"");
|
||||||
hoconConfig.AppendLine($" CustomDate = \"{jsonConfig.CustomDate?.ToString("yyyy-MM-dd")}\"");
|
hoconConfig.AppendLine($" CustomDate = \"{jsonConfig.CustomDate?.ToString("yyyy-MM-dd")}\"");
|
||||||
hoconConfig.AppendLine($" ShowScrapeSize = {jsonConfig.ShowScrapeSize.ToString().ToLower()}");
|
hoconConfig.AppendLine($" ShowScrapeSize = {jsonConfig.ShowScrapeSize.ToString().ToLower()}");
|
||||||
hoconConfig.AppendLine($" DisableTextSanitization = false");
|
|
||||||
hoconConfig.AppendLine($" DownloadVideoResolution = \"{(jsonConfig.DownloadVideoResolution == VideoResolution.source ? "source" : jsonConfig.DownloadVideoResolution.ToString().TrimStart('_'))}\"");
|
hoconConfig.AppendLine($" DownloadVideoResolution = \"{(jsonConfig.DownloadVideoResolution == VideoResolution.source ? "source" : jsonConfig.DownloadVideoResolution.ToString().TrimStart('_'))}\"");
|
||||||
hoconConfig.AppendLine("}");
|
hoconConfig.AppendLine("}");
|
||||||
|
|
||||||
@ -281,8 +280,6 @@ public class Program
|
|||||||
DownloadDateSelection = Enum.Parse<DownloadDateSelection>(hoconConfig.GetString("Download.DownloadDateSelection"), true),
|
DownloadDateSelection = Enum.Parse<DownloadDateSelection>(hoconConfig.GetString("Download.DownloadDateSelection"), true),
|
||||||
CustomDate = !string.IsNullOrWhiteSpace(hoconConfig.GetString("Download.CustomDate")) ? DateTime.Parse(hoconConfig.GetString("Download.CustomDate")) : null,
|
CustomDate = !string.IsNullOrWhiteSpace(hoconConfig.GetString("Download.CustomDate")) ? DateTime.Parse(hoconConfig.GetString("Download.CustomDate")) : null,
|
||||||
ShowScrapeSize = hoconConfig.GetBoolean("Download.ShowScrapeSize"),
|
ShowScrapeSize = hoconConfig.GetBoolean("Download.ShowScrapeSize"),
|
||||||
// Optional flag; default to false when missing
|
|
||||||
DisableTextSanitization = bool.TryParse(hoconConfig.GetString("Download.DisableTextSanitization", "false"), out var dts) ? dts : false,
|
|
||||||
DownloadVideoResolution = ParseVideoResolution(hoconConfig.GetString("Download.DownloadVideoResolution", "source")),
|
DownloadVideoResolution = ParseVideoResolution(hoconConfig.GetString("Download.DownloadVideoResolution", "source")),
|
||||||
|
|
||||||
// File Settings
|
// File Settings
|
||||||
@ -348,8 +345,6 @@ public class Program
|
|||||||
}
|
}
|
||||||
|
|
||||||
levelSwitch.MinimumLevel = (LogEventLevel)config.LoggingLevel; //set the logging level based on config
|
levelSwitch.MinimumLevel = (LogEventLevel)config.LoggingLevel; //set the logging level based on config
|
||||||
// Apply text sanitization preference globally
|
|
||||||
OF_DL.Utils.XmlUtils.Passthrough = config.DisableTextSanitization;
|
|
||||||
Log.Debug("Configuration:");
|
Log.Debug("Configuration:");
|
||||||
string configString = JsonConvert.SerializeObject(config, Formatting.Indented);
|
string configString = JsonConvert.SerializeObject(config, Formatting.Indented);
|
||||||
Log.Debug(configString);
|
Log.Debug(configString);
|
||||||
@ -405,8 +400,6 @@ public class Program
|
|||||||
hoconConfig.AppendLine($" DownloadDateSelection = \"{jsonConfig.DownloadDateSelection.ToString().ToLower()}\"");
|
hoconConfig.AppendLine($" DownloadDateSelection = \"{jsonConfig.DownloadDateSelection.ToString().ToLower()}\"");
|
||||||
hoconConfig.AppendLine($" CustomDate = \"{jsonConfig.CustomDate?.ToString("yyyy-MM-dd")}\"");
|
hoconConfig.AppendLine($" CustomDate = \"{jsonConfig.CustomDate?.ToString("yyyy-MM-dd")}\"");
|
||||||
hoconConfig.AppendLine($" ShowScrapeSize = {jsonConfig.ShowScrapeSize.ToString().ToLower()}");
|
hoconConfig.AppendLine($" ShowScrapeSize = {jsonConfig.ShowScrapeSize.ToString().ToLower()}");
|
||||||
// New option defaults to false when converting legacy json
|
|
||||||
hoconConfig.AppendLine($" DisableTextSanitization = false");
|
|
||||||
hoconConfig.AppendLine($" DownloadVideoResolution = \"{(jsonConfig.DownloadVideoResolution == VideoResolution.source ? "source" : jsonConfig.DownloadVideoResolution.ToString().TrimStart('_'))}\"");
|
hoconConfig.AppendLine($" DownloadVideoResolution = \"{(jsonConfig.DownloadVideoResolution == VideoResolution.source ? "source" : jsonConfig.DownloadVideoResolution.ToString().TrimStart('_'))}\"");
|
||||||
hoconConfig.AppendLine("}");
|
hoconConfig.AppendLine("}");
|
||||||
|
|
||||||
@ -1310,7 +1303,7 @@ public class Program
|
|||||||
await AnsiConsole.Status()
|
await AnsiConsole.Status()
|
||||||
.StartAsync("[red]Getting Paid Messages[/]", async ctx =>
|
.StartAsync("[red]Getting Paid Messages[/]", async ctx =>
|
||||||
{
|
{
|
||||||
paidMessageCollection = await downloadContext.ApiHelper.GetPaidMessages("/posts/paid/chat", path, user.Key, downloadContext.DownloadConfig!, ctx);
|
paidMessageCollection = await downloadContext.ApiHelper.GetPaidMessages("/posts/paid", path, user.Key, downloadContext.DownloadConfig!, ctx);
|
||||||
});
|
});
|
||||||
int oldPaidMessagesCount = 0;
|
int oldPaidMessagesCount = 0;
|
||||||
int newPaidMessagesCount = 0;
|
int newPaidMessagesCount = 0;
|
||||||
@ -1963,7 +1956,7 @@ public class Program
|
|||||||
await AnsiConsole.Status()
|
await AnsiConsole.Status()
|
||||||
.StartAsync("[red]Getting Paid Posts[/]", async ctx =>
|
.StartAsync("[red]Getting Paid Posts[/]", async ctx =>
|
||||||
{
|
{
|
||||||
purchasedPosts = await downloadContext.ApiHelper.GetPaidPosts("/posts/paid/post", path, user.Key, downloadContext.DownloadConfig!, paid_post_ids, ctx);
|
purchasedPosts = await downloadContext.ApiHelper.GetPaidPosts("/posts/paid", path, user.Key, downloadContext.DownloadConfig!, paid_post_ids, ctx);
|
||||||
});
|
});
|
||||||
|
|
||||||
int oldPaidPostCount = 0;
|
int oldPaidPostCount = 0;
|
||||||
@ -2911,7 +2904,6 @@ public class Program
|
|||||||
hoconConfig.AppendLine($" DownloadDateSelection = \"{newConfig.DownloadDateSelection.ToString().ToLower()}\"");
|
hoconConfig.AppendLine($" DownloadDateSelection = \"{newConfig.DownloadDateSelection.ToString().ToLower()}\"");
|
||||||
hoconConfig.AppendLine($" CustomDate = \"{newConfig.CustomDate?.ToString("yyyy-MM-dd")}\"");
|
hoconConfig.AppendLine($" CustomDate = \"{newConfig.CustomDate?.ToString("yyyy-MM-dd")}\"");
|
||||||
hoconConfig.AppendLine($" ShowScrapeSize = {newConfig.ShowScrapeSize.ToString().ToLower()}");
|
hoconConfig.AppendLine($" ShowScrapeSize = {newConfig.ShowScrapeSize.ToString().ToLower()}");
|
||||||
hoconConfig.AppendLine($" DisableTextSanitization = {newConfig.DisableTextSanitization.ToString().ToLower()}");
|
|
||||||
hoconConfig.AppendLine($" DownloadVideoResolution = \"{(newConfig.DownloadVideoResolution == VideoResolution.source ? "source" : newConfig.DownloadVideoResolution.ToString().TrimStart('_'))}\"");
|
hoconConfig.AppendLine($" DownloadVideoResolution = \"{(newConfig.DownloadVideoResolution == VideoResolution.source ? "source" : newConfig.DownloadVideoResolution.ToString().TrimStart('_'))}\"");
|
||||||
hoconConfig.AppendLine("}");
|
hoconConfig.AppendLine("}");
|
||||||
|
|
||||||
@ -3071,7 +3063,6 @@ public class Program
|
|||||||
hoconConfig.AppendLine($" DownloadDateSelection = \"{newConfig.DownloadDateSelection.ToString().ToLower()}\"");
|
hoconConfig.AppendLine($" DownloadDateSelection = \"{newConfig.DownloadDateSelection.ToString().ToLower()}\"");
|
||||||
hoconConfig.AppendLine($" CustomDate = \"{newConfig.CustomDate?.ToString("yyyy-MM-dd")}\"");
|
hoconConfig.AppendLine($" CustomDate = \"{newConfig.CustomDate?.ToString("yyyy-MM-dd")}\"");
|
||||||
hoconConfig.AppendLine($" ShowScrapeSize = {newConfig.ShowScrapeSize.ToString().ToLower()}");
|
hoconConfig.AppendLine($" ShowScrapeSize = {newConfig.ShowScrapeSize.ToString().ToLower()}");
|
||||||
hoconConfig.AppendLine($" DisableTextSanitization = {newConfig.DisableTextSanitization.ToString().ToLower()}");
|
|
||||||
hoconConfig.AppendLine($" DownloadVideoResolution = \"{(newConfig.DownloadVideoResolution == VideoResolution.source ? "source" : newConfig.DownloadVideoResolution.ToString().TrimStart('_'))}\"");
|
hoconConfig.AppendLine($" DownloadVideoResolution = \"{(newConfig.DownloadVideoResolution == VideoResolution.source ? "source" : newConfig.DownloadVideoResolution.ToString().TrimStart('_'))}\"");
|
||||||
hoconConfig.AppendLine("}");
|
hoconConfig.AppendLine("}");
|
||||||
|
|
||||||
|
@ -9,16 +9,8 @@ namespace OF_DL.Utils
|
|||||||
{
|
{
|
||||||
internal static class XmlUtils
|
internal static class XmlUtils
|
||||||
{
|
{
|
||||||
// When true, return original text without parsing/stripping.
|
|
||||||
public static bool Passthrough { get; set; } = false;
|
|
||||||
|
|
||||||
public static string EvaluateInnerText(string xmlValue)
|
public static string EvaluateInnerText(string xmlValue)
|
||||||
{
|
{
|
||||||
if (Passthrough)
|
|
||||||
{
|
|
||||||
return xmlValue ?? string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var parsedText = XElement.Parse($"<root>{xmlValue}</root>");
|
var parsedText = XElement.Parse($"<root>{xmlValue}</root>");
|
||||||
|
10
mkdocs.yml
10
mkdocs.yml
@ -2,11 +2,6 @@ site_name: OF-DL Docs
|
|||||||
site_url: https://docs.ofdl.tools
|
site_url: https://docs.ofdl.tools
|
||||||
nav:
|
nav:
|
||||||
- Home: index.md
|
- Home: index.md
|
||||||
- Installation:
|
|
||||||
- Windows: installation/windows.md
|
|
||||||
- macOS: installation/macos.md
|
|
||||||
- Linux: installation/linux.md
|
|
||||||
- Docker: installation/docker.md
|
|
||||||
- Running the Program: running-the-program.md
|
- Running the Program: running-the-program.md
|
||||||
- Config:
|
- Config:
|
||||||
- Authentication: config/auth.md
|
- Authentication: config/auth.md
|
||||||
@ -14,6 +9,11 @@ nav:
|
|||||||
- Configuration: config/configuration.md
|
- Configuration: config/configuration.md
|
||||||
- All Configuration Options: config/all-configuration-options.md
|
- All Configuration Options: config/all-configuration-options.md
|
||||||
- Custom Filename Formats: config/custom-filename-formats.md
|
- Custom Filename Formats: config/custom-filename-formats.md
|
||||||
|
- Installation:
|
||||||
|
- Windows: installation/windows.md
|
||||||
|
- macOS: installation/macos.md
|
||||||
|
- Linux: installation/linux.md
|
||||||
|
- Docker: installation/docker.md
|
||||||
theme:
|
theme:
|
||||||
name: material
|
name: material
|
||||||
features:
|
features:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user