Skip to content

Commit

Permalink
cardigann: ignore disabled or unchecked inputs in login (Jackett#14338)
Browse files Browse the repository at this point in the history
  • Loading branch information
mynameisbogdan authored May 19, 2023
1 parent 7e33461 commit a012c9d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Jackett.Common/Indexers/CardigannIndexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using AngleSharp.Dom;
using AngleSharp.Html;
using AngleSharp.Html.Dom;
using AngleSharp.Html.Parser;
using AngleSharp.Text;
using AngleSharp.Xml.Parser;
using Jackett.Common.Helpers;
using Jackett.Common.Models;
Expand Down Expand Up @@ -608,8 +610,18 @@ protected async Task<bool> DoLogin()
foreach (var input in inputs)
{
var name = input.GetAttribute("name");
if (name == null)

if (name == null || input.IsDisabled())
{
continue;
}

if (input is IHtmlInputElement element &&
element.Type.IsOneOf(InputTypeNames.Checkbox, InputTypeNames.Radio) &&
!input.IsChecked())
{
continue;
}

var value = input.GetAttribute("value") ?? "";

Expand Down

0 comments on commit a012c9d

Please sign in to comment.