AlexCSDev / PatreonDownloader

Powerful tool for downloading content posted by creators on patreon.com. Supports content hosted on patreon itself as well as external sites (additional plugins might be required).
MIT License
928 stars 95 forks source link

FATAL System.ArgumentNullException: Value cannot be null. (Parameter 'html') #145

Closed aksskl closed 1 year ago

aksskl commented 1 year ago

I've come across this error within the last twelve hours while crawling. Has anyone else experienced this? It seems random which creators are affected.

FATAL Fatal error, application will be closed: System.ArgumentNullException: Value cannot be null. (Parameter 'html') at HtmlAgilityPack.HtmlDocument.LoadHtml(String html) at UniversalDownloaderPlatform.MegaDownloader.Plugin.ExtractSupportedUrls(String htmlContents) at UniversalDownloaderPlatform.Engine.PluginManager.ExtractSupportedUrls(String htmlContents) in F:\Sources\BigProjects\PatreonDownloader\submodules\UniversalDownloaderPlatform\UniversalDownloaderPlatform.Engine\PluginManager.cs:line 112 at PatreonDownloader.Implementation.PatreonPageCrawler.ParsePage(String json, String downloadDirectory) in F:\Sources\BigProjects\PatreonDownloader\PatreonDownloader.Implementation\PatreonPageCrawler.cs:line 217 at PatreonDownloader.Implementation.PatreonPageCrawler.Crawl(ICrawlTargetInfo crawlTargetInfo, String downloadDirectory) in F:\Sources\BigProjects\PatreonDownloader\PatreonDownloader.Implementation\PatreonPageCrawler.cs:line 90 at UniversalDownloaderPlatform.Engine.UniversalDownloader.Download(String url, String downloadDirectory, IUniversalDownloaderPlatformSettings settings) in F:\Sources\BigProjects\PatreonDownloader\submodules\UniversalDownloaderPlatform\UniversalDownloaderPlatform.Engine\UniversalDownloader.cs:line 198 at PatreonDownloader.App.Program.RunPatreonDownloader(CommandLineOptions commandLineOptions) in F:\Sources\BigProjects\PatreonDownloader\PatreonDownloader.App\Program.cs:line 143 at PatreonDownloader.App.Program.Main(String[] args) in F:\Sources\BigProjects\PatreonDownloader\PatreonDownloader.App\Program.cs:line 69

emerladCoder commented 1 year ago

I had the same issue and was able to fix by just ensuring that value isn't null.

In PatreonDownloader.Implementation\PatreonPageCrawler.cs I just test if the Content is null and if it is pass an empty string instead of null value. That fixed the issue for me.

List<string> pluginUrls = await _pluginManager.ExtractSupportedUrls(jsonEntry.Attributes.Content != null ? jsonEntry.Attributes.Content : "");

aksskl commented 1 year ago

That has also fixed the issue for me. Thanks

DarkRoku12 commented 1 year ago

Can this be fixed in the binary provided?

AlexCSDev commented 1 year ago

Fixed in 0.10.5.0