mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-26 22:46:37 -04:00
Fixed: Can now specify a cookie for BitMeTv.
This commit is contained in:
@@ -14,7 +14,7 @@ namespace NzbDrone.Core.Indexers.BitMeTv
|
||||
{
|
||||
var pageableRequests = new List<IEnumerable<IndexerRequest>>();
|
||||
|
||||
pageableRequests.AddIfNotNull(GetRssRequests(null));
|
||||
pageableRequests.AddIfNotNull(GetRssRequests());
|
||||
|
||||
return pageableRequests;
|
||||
}
|
||||
@@ -44,9 +44,13 @@ namespace NzbDrone.Core.Indexers.BitMeTv
|
||||
return new List<IEnumerable<IndexerRequest>>();
|
||||
}
|
||||
|
||||
private IEnumerable<IndexerRequest> GetRssRequests(String searchParameters)
|
||||
private IEnumerable<IndexerRequest> GetRssRequests()
|
||||
{
|
||||
yield return new IndexerRequest(String.Format("{0}/rss.php?uid={1}&passkey={2}{3}", Settings.BaseUrl.Trim().TrimEnd('/'), Settings.UserId, Settings.RssPasskey, searchParameters), HttpAccept.Html);
|
||||
var request = new IndexerRequest(String.Format("{0}/rss.php?uid={1}&passkey={2}", Settings.BaseUrl.Trim().TrimEnd('/'), Settings.UserId, Settings.RssPasskey), HttpAccept.Html);
|
||||
|
||||
request.HttpRequest.AddCookie(Settings.Cookie);
|
||||
|
||||
yield return request;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using FluentValidation;
|
||||
using FluentValidation.Results;
|
||||
using NzbDrone.Core.Annotations;
|
||||
@@ -14,6 +15,13 @@ namespace NzbDrone.Core.Indexers.BitMeTv
|
||||
RuleFor(c => c.BaseUrl).ValidRootUrl();
|
||||
RuleFor(c => c.UserId).NotEmpty();
|
||||
RuleFor(c => c.RssPasskey).NotEmpty();
|
||||
|
||||
RuleFor(c => c.Cookie).NotEmpty();
|
||||
|
||||
RuleFor(c => c.Cookie)
|
||||
.Matches(@"pass=[0-9a-f]{32}", RegexOptions.IgnoreCase)
|
||||
.WithMessage("Wrong pattern")
|
||||
.AsWarning();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +31,7 @@ namespace NzbDrone.Core.Indexers.BitMeTv
|
||||
|
||||
public BitMeTvSettings()
|
||||
{
|
||||
BaseUrl = "http://www.bitmetv.org";
|
||||
BaseUrl = "https://www.bitmetv.org";
|
||||
}
|
||||
|
||||
[FieldDefinition(0, Label = "Website URL")]
|
||||
@@ -35,6 +43,9 @@ namespace NzbDrone.Core.Indexers.BitMeTv
|
||||
[FieldDefinition(2, Label = "RSS Passkey")]
|
||||
public String RssPasskey { get; set; }
|
||||
|
||||
[FieldDefinition(3, Label = "Cookie", HelpText = "BitMeTv uses a login cookie needed to access the rss, you'll have to retrieve it via a browser.")]
|
||||
public String Cookie { get; set; }
|
||||
|
||||
public ValidationResult Validate()
|
||||
{
|
||||
return validator.Validate(this);
|
||||
|
||||
Reference in New Issue
Block a user