diff --git a/src/OpenDirectoryDownloader/DirectoryParser.cs b/src/OpenDirectoryDownloader/DirectoryParser.cs index ed326929..653ec022 100644 --- a/src/OpenDirectoryDownloader/DirectoryParser.cs +++ b/src/OpenDirectoryDownloader/DirectoryParser.cs @@ -60,13 +60,6 @@ public static async Task ParseHtml(WebDirectory webDirectory, stri try { - IHtmlDocument htmlDocument = await HtmlParser.ParseDocumentAsync(html); - - if (webDirectory.Uri.Host == "ipfs.io" || webDirectory.Uri.Host == "gateway.ipfs.io") - { - return ParseIpfsDirectoryListing(baseUrl, parsedWebDirectory, htmlDocument, checkParents); - } - if (webDirectory.Uri.Host == Constants.BlitzfilesTechDomain) { return await BlitzfilesTechParser.ParseIndex(httpClient, webDirectory); @@ -92,6 +85,13 @@ public static async Task ParseHtml(WebDirectory webDirectory, stri return await MediafireParser.ParseIndex(httpClient, webDirectory); } + IHtmlDocument htmlDocument = await HtmlParser.ParseDocumentAsync(html); + + if (webDirectory.Uri.Host == "ipfs.io" || webDirectory.Uri.Host == "gateway.ipfs.io") + { + return ParseIpfsDirectoryListing(baseUrl, parsedWebDirectory, htmlDocument, checkParents); + } + if (httpClient is not null && !OpenDirectoryIndexer.Session.Parameters.ContainsKey(Constants.GoogleDriveIndexType)) { string googleDriveIndexType = null;