diff --git a/PatreonDownloader.App/Models/CommandLineOptions.cs b/PatreonDownloader.App/Models/CommandLineOptions.cs index 4568575..6077955 100644 --- a/PatreonDownloader.App/Models/CommandLineOptions.cs +++ b/PatreonDownloader.App/Models/CommandLineOptions.cs @@ -64,5 +64,11 @@ class CommandLineOptions [Option("proxy-server-address", Required = false, HelpText = "The address of proxy server to use in the following format: [://][:]. Supported protocols: http(s), socks4, socks4a, socks5.")] public string ProxyServerAddress { get; set; } + + [Option("email", Required = false, HelpText = "Patreon account email used for automatic login in the browser.")] + public string Email { get; set; } + + [Option("password", Required = false, HelpText = "Patreon account password used for automatic login in the browser.")] + public string Password { get; set; } } } diff --git a/PatreonDownloader.App/Program.cs b/PatreonDownloader.App/Program.cs index f829a43..09467ec 100644 --- a/PatreonDownloader.App/Program.cs +++ b/PatreonDownloader.App/Program.cs @@ -166,7 +166,9 @@ private static async Task InitializeSettings(CommandL MaxFilenameLength = commandLineOptions.MaxFilenameLength, FallbackToContentTypeFilenames = commandLineOptions.FilenamesFallbackToContentType, ProxyServerAddress = commandLineOptions.ProxyServerAddress, - IsUseLegacyFilenaming = commandLineOptions.IsUseLegacyFilenaming + IsUseLegacyFilenaming = commandLineOptions.IsUseLegacyFilenaming, + LoginEmail = commandLineOptions.Email, + LoginPassword = commandLineOptions.Password }; if (settings.IsUseLegacyFilenaming && (settings.FileExistsAction == FileExistsAction.BackupIfDifferent || settings.FileExistsAction == FileExistsAction.ReplaceIfDifferent)) diff --git a/PatreonDownloader.Implementation/Models/PatreonDownloaderSettings.cs b/PatreonDownloader.Implementation/Models/PatreonDownloaderSettings.cs index 4a05085..29d8eed 100644 --- a/PatreonDownloader.Implementation/Models/PatreonDownloaderSettings.cs +++ b/PatreonDownloader.Implementation/Models/PatreonDownloaderSettings.cs @@ -52,8 +52,11 @@ public record PatreonDownloaderSettings : UniversalDownloaderPlatformSettings, I public string LoginPageAddress { get { return "https://www.patreon.com/login"; } } public string LoginCheckAddress { get { return "https://www.patreon.com/api/badges?json-api-version=1.0&json-api-use-default-includes=false&include=[]"; } } public string CaptchaCookieRetrievalAddress { get { return "https://www.patreon.com/home"; } } + public string AuthAddress { get { return "https://www.patreon.com/api/auth"; } } public Uri RemoteBrowserAddress { get; init; } public bool IsHeadlessBrowser { get; init; } + public string LoginEmail { get; init; } + public string LoginPassword { get; init; } public PatreonDownloaderSettings() {