Skip to content

Commit f8004ae

Browse files
committed
Fix description not being saved.
Due to changes in patreon api, description.html has been replaced with description.json and scanning for the external urls is (temporary) disabled due to it expecting html data while patreon is now providing json.
1 parent 6e0f8a7 commit f8004ae

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

PatreonDownloader.App/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929
// Build Number
3030
// Revision
3131
//
32-
[assembly: AssemblyVersion("31.0.0.0")]
33-
[assembly: AssemblyFileVersion("31.0.0.0")]
32+
[assembly: AssemblyVersion("32.0.0.0")]
33+
[assembly: AssemblyFileVersion("32.0.0.0")]

PatreonDownloader.Implementation/Models/JSONObjects/Posts.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ public class RootDataAttributes
7070
public object ChangeVisibilityAt { get; set; }
7171
[JsonProperty("comment_count")]
7272
public int? CommentCount { get; set; }
73-
[JsonProperty("content")]
74-
public string Content { get; set; }
73+
[JsonProperty("content_json_string")]
74+
public string ContentJsonString { get; set; }
7575
[JsonProperty("current_user_can_delete")]
7676
public bool CurrentUserCanDelete { get; set; }
7777
[JsonProperty("current_user_can_view")]

PatreonDownloader.Implementation/PatreonPageCrawler.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal sealed class PatreonPageCrawler : IPageCrawler
3232
//TODO: Research possibility of not hardcoding this string
3333
private const string CrawlStartUrl = "https://www.patreon.com/api/posts?" +
3434
"include=user%2Cattachments_media%2Ccampaign%2Cpoll.choices%2Cpoll.current_user_responses.user%2Cpoll.current_user_responses.choice%2Cpoll.current_user_responses.poll%2Caccess_rules.tier.null%2Cimages.null%2Caudio.null" +
35-
"&fields[post]=change_visibility_at%2Ccomment_count%2Ccontent%2Ccurrent_user_can_delete%2Ccurrent_user_can_view%2Ccurrent_user_has_liked%2Cembed%2Cimage%2Cis_paid%2Clike_count%2Cmin_cents_pledged_to_view%2Cpost_file%2Cpost_metadata%2Cpublished_at%2Cpatron_count%2Cpatreon_url%2Cpost_type%2Cpledge_url%2Cthumbnail_url%2Cteaser_text%2Ctitle%2Cupgrade_url%2Curl%2Cwas_posted_by_campaign_owner" +
35+
"&fields[post]=change_visibility_at%2Ccomment_count%2Ccontent%2Ccurrent_user_can_delete%2Ccurrent_user_can_view%2Ccurrent_user_has_liked%2Cembed%2Cimage%2Cis_paid%2Clike_count%2Cmin_cents_pledged_to_view%2Cpost_file%2Cpost_metadata%2Cpublished_at%2Cpatron_count%2Cpatreon_url%2Cpost_type%2Cpledge_url%2Cthumbnail_url%2Cteaser_text%2Ctitle%2Cupgrade_url%2Curl%2Cwas_posted_by_campaign_owner%2Ccontent_json_string" +
3636
"&fields[user]=image_url%2Cfull_name%2Curl" +
3737
"&fields[campaign]=show_audio_post_download_links%2Cavatar_photo_url%2Cearnings_visibility%2Cis_nsfw%2Cis_monthly%2Cname%2Curl" +
3838
"&fields[access_rule]=access_rule_type%2Camount_cents" +
@@ -162,12 +162,12 @@ private async Task<ParsingResult> ParsePage(string json)
162162
{
163163
try
164164
{
165-
string filename = "description.html";
165+
string filename = "description.json";
166166
if (!_patreonDownloaderSettings.IsUseSubDirectories)
167167
filename = $"{jsonEntry.Id}_{filename}";
168168

169169
await File.WriteAllTextAsync(Path.Combine(additionalFilesSaveDirectory, filename),
170-
jsonEntry.Attributes.Content);
170+
jsonEntry.Attributes.ContentJsonString);
171171
}
172172
catch (Exception ex)
173173
{
@@ -212,7 +212,8 @@ await File.WriteAllTextAsync(
212212
}
213213

214214
//External urls via plugins (including direct via default plugin)
215-
List<string> pluginUrls = await _pluginManager.ExtractSupportedUrls(jsonEntry.Attributes.Content);
215+
//2026-03-08: disabled due to patreon getting rid of html contentn data replacing it with JSON. Current implementation expects pure HTML.
216+
/*List<string> pluginUrls = await _pluginManager.ExtractSupportedUrls(jsonEntry.Attributes.ContentJsonString);
216217
foreach (string url in pluginUrls)
217218
{
218219
PatreonCrawledUrl subEntry = (PatreonCrawledUrl)entry.Clone();
@@ -221,7 +222,7 @@ await File.WriteAllTextAsync(
221222
crawledUrls.Add(subEntry);
222223
_logger.Info($"[{jsonEntry.Id}] New external entry: {subEntry.Url}");
223224
OnNewCrawledUrl(new NewCrawledUrlEventArgs((CrawledUrl)subEntry.Clone()));
224-
}
225+
}*/
225226

226227
_logger.Debug($"[{jsonEntry.Id}] Scanning attachment data");
227228
//Attachments

0 commit comments

Comments
 (0)