Skip to content

Commit

Permalink
Add catch on AV tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Xwilarg committed Nov 15, 2024
1 parent b408dd3 commit 19ac552
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Sanara/Module/Command/Impl/Doujin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,16 @@ public async Task AdultVideoAsync(IContext ctx)
// Get fields
var name = html.DocumentNode.SelectSingleNode("//h1[contains(@class, 'lg:text-lg')]").InnerHtml;
var description = HttpUtility.HtmlDecode(info.ChildNodes[1].ChildNodes[1].ChildNodes[1].InnerHtml);
var tags = info.ChildNodes[1].ChildNodes[5].ChildNodes[7].SelectNodes("a").Select(x => x.InnerHtml);
IEnumerable<string> tags;
try
{
tags = info.ChildNodes[1].ChildNodes[5].ChildNodes[7].SelectNodes("a").Select(x => x.InnerHtml);
}
catch (System.Exception e)
{
tags = [];
await Log.LogErrorAsync(e, null);
}
if (name.Length > 256) name = name[..255] + "…";

var embed = new EmbedBuilder()
Expand Down

0 comments on commit 19ac552

Please sign in to comment.