Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions PatreonDownloader.App/Models/CommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ class CommandLineOptions
{
[Option("url", Required = true, HelpText = "Url of the creator's page")]
public string Url { get; set; }

[Option("no-files", Required = false, HelpText = "Do not download files (images, attachments, media, etc.). Useful when only post metadata like descriptions is needed.", Default = false)]
public bool NoFiles { get; set; }

[Option("descriptions", Required = false, HelpText = "Save post descriptions", Default = false)]
public bool SaveDescriptions { get; set; }
[Option("embeds", Required = false, HelpText = "Save embedded content metadata", Default = false)]
Expand Down
1 change: 1 addition & 0 deletions PatreonDownloader.App/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ private static async Task<PatreonDownloaderSettings> InitializeSettings(CommandL
UrlBlackList = (_configuration["UrlBlackList"] ?? "").ToLowerInvariant().Split("|").ToList(),
UserAgent = "Patreon/126.9.0.15 (Android; Android 14; Scale/2.10)",
CookieContainer = null,
NoFiles = commandLineOptions.NoFiles,
SaveAvatarAndCover = commandLineOptions.SaveAvatarAndCover,
SaveDescriptions = commandLineOptions.SaveDescriptions,
SaveEmbeds = commandLineOptions.SaveEmbeds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public record PatreonDownloaderSettings : UniversalDownloaderPlatformSettings, I

public bool SaveAvatarAndCover { get; init; }

/// <summary>
/// If true, do not download remote files (images, attachments, media, etc.)
/// </summary>
public bool NoFiles { get; init; }

/// <summary>
/// Create a new directory for every post and store files of said post in that directory
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion PatreonDownloader.Implementation/PatreonPageCrawler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ await File.WriteAllTextAsync(Path.Combine(_patreonDownloaderSettings.DownloadDir

ParsingResult result = await ParsePage(json);

if(result.CrawledUrls.Count > 0)
if(!_patreonDownloaderSettings.NoFiles && result.CrawledUrls.Count > 0)
crawledUrls.AddRange(result.CrawledUrls);

nextPage = result.NextPage;
Expand Down