Skip to content

Commit

Permalink
- Add support for /cheems/GDIndex, /cheems/goindex-extended
Browse files Browse the repository at this point in the history
  • Loading branch information
KoalaBear84 committed Nov 6, 2021
1 parent 9a1a1ad commit 986dc9f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/OpenDirectoryDownloader/DirectoryParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ public static async Task<WebDirectory> ParseHtml(WebDirectory webDirectory, stri
return await GoIndexParser.ParseIndex(httpClient, webDirectory);
}

if (htmlDocument.QuerySelector("script[src*=\"gdindex\" i]") != null)
{
return await GdIndexParser.ParseIndex(httpClient, webDirectory, html);
}

if (htmlDocument.QuerySelector("script[src*=\"Bhadoo-Drive-Index\" i]") != null ||
htmlDocument.QuerySelector("script[src*=\"/AjmalShajahan97/goindex\" i]") != null ||
htmlDocument.QuerySelector("script[src*=\"/LeeluPradhan/G-Index\" i]") != null ||
Expand All @@ -91,7 +86,9 @@ public static async Task<WebDirectory> ParseHtml(WebDirectory webDirectory, stri
htmlDocument.QuerySelector("script[src*=\"/RemixDev/goindex\" i]") != null ||
htmlDocument.QuerySelector("script[src*=\"/Virusia/Fia-Terminal\" i]") != null ||
htmlDocument.QuerySelector("script[src*=\"/sawankumar/Google-Drive-Index-III\" i]") != null ||
htmlDocument.QuerySelector("script[src*=\"/goIndex-theme-nexmoe\" i]") != null)
htmlDocument.QuerySelector("script[src*=\"/goIndex-theme-nexmoe\" i]") != null ||
htmlDocument.QuerySelector("script[src*=\"/cheems/GDIndex\" i]") != null ||
htmlDocument.QuerySelector("script[src*=\"/cheems/goindex-extended\" i]") != null)
{
return await BhadooIndexParser.ParseIndex(htmlDocument, httpClient, webDirectory);
}
Expand All @@ -108,7 +105,12 @@ public static async Task<WebDirectory> ParseHtml(WebDirectory webDirectory, stri
return await GoIndexParser.ParseIndex(httpClient, webDirectory);
}

htmlDocument.QuerySelectorAll("#sidebar").ToList().ForEach(e => e.Remove());
if (htmlDocument.QuerySelector("script[src*=\"gdindex\" i]") != null)
{
return await GdIndexParser.ParseIndex(httpClient, webDirectory, html);
}

htmlDocument.QuerySelectorAll("#sidebar").ToList().ForEach(e => e.Remove());
htmlDocument.QuerySelectorAll("nav").ToList().ForEach(e => e.Remove());

// The order of the checks is very important!
Expand Down

0 comments on commit 986dc9f

Please sign in to comment.