Compare commits

...

9 Commits

Author SHA1 Message Date
Bakerboy448 5e15054329 Avistaz response improvements 2023-01-05 15:40:22 -06:00
bakerboy448 3dfbfd07dd improve authentication required wording 2023-01-04 22:53:38 -06:00
Qstick 842df6913c New: Improve CF Detection
Co-Authored-By: Diego Heras <ngosang@hotmail.es>
2023-01-04 22:27:03 -06:00
Qstick 599eeb4c61 Bump Version to 1.1.0 2023-01-03 18:50:42 -06:00
Bogdan da371dd921 Fixed: (Avistaz) Use type password for PID 2023-01-03 18:49:17 -06:00
Bogdan fc25ba7ac0 Fixed: (Filelist) Use UTC in tests 2023-01-03 18:05:54 -06:00
Qstick 6e1bef13e2 Fixed: Correctly calculate UI age for some indexers 2023-01-02 23:28:36 -06:00
Qstick 72ee413411 Fixed: (BeyondHD) Assume Universal Time for publish dates 2023-01-02 23:23:56 -06:00
Qstick e87b45b47e Fixed: (Filelist) Assume UTC+2 for API Dates 2023-01-02 23:23:17 -06:00
13 changed files with 37 additions and 25 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ variables:
testsFolder: './_tests' testsFolder: './_tests'
yarnCacheFolder: $(Pipeline.Workspace)/.yarn yarnCacheFolder: $(Pipeline.Workspace)/.yarn
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
majorVersion: '1.0.1' majorVersion: '1.1.0'
minorVersion: $[counter('minorVersion', 1)] minorVersion: $[counter('minorVersion', 1)]
prowlarrVersion: '$(majorVersion).$(minorVersion)' prowlarrVersion: '$(majorVersion).$(minorVersion)'
buildName: '$(Build.SourceBranchName).$(prowlarrVersion)' buildName: '$(Build.SourceBranchName).$(prowlarrVersion)'
@@ -50,7 +50,7 @@ namespace NzbDrone.Core.Test.IndexerTests.FileListTests
torrentInfo.InfoUrl.Should().Be("https://filelist.io/details.php?id=665873"); torrentInfo.InfoUrl.Should().Be("https://filelist.io/details.php?id=665873");
torrentInfo.CommentUrl.Should().BeNullOrEmpty(); torrentInfo.CommentUrl.Should().BeNullOrEmpty();
torrentInfo.Indexer.Should().Be(Subject.Definition.Name); torrentInfo.Indexer.Should().Be(Subject.Definition.Name);
torrentInfo.PublishDate.Should().Be(DateTime.Parse("2020-01-25 22:20:19")); torrentInfo.PublishDate.Should().Be(DateTime.Parse("2020-01-25 20:20:19").ToUniversalTime());
torrentInfo.Size.Should().Be(8300512414); torrentInfo.Size.Should().Be(8300512414);
torrentInfo.InfoHash.Should().Be(null); torrentInfo.InfoHash.Should().Be(null);
torrentInfo.MagnetUrl.Should().Be(null); torrentInfo.MagnetUrl.Should().Be(null);
@@ -28,7 +28,11 @@ namespace NzbDrone.Core.Http.CloudFlare
if (response.StatusCode.Equals(HttpStatusCode.ServiceUnavailable) || if (response.StatusCode.Equals(HttpStatusCode.ServiceUnavailable) ||
response.StatusCode.Equals(HttpStatusCode.Forbidden)) response.StatusCode.Equals(HttpStatusCode.Forbidden))
{ {
return true; // Defected CloudFlare and DDoS-GUARD var responseHtml = response.Content;
if (responseHtml.Contains("<title>Just a moment...") || responseHtml.Contains("<title>DDOS-GUARD"))
{
return true;
}
} }
// detect Custom CloudFlare for EbookParadijs, Film-Paleis, MuziekFabriek and Puur-Hollands // detect Custom CloudFlare for EbookParadijs, Film-Paleis, MuziekFabriek and Puur-Hollands
@@ -98,6 +98,12 @@ namespace NzbDrone.Core.Indexers.Definitions.Avistaz
var jsonResponse = new HttpResponse<AvistazErrorResponse>(ex.Response); var jsonResponse = new HttpResponse<AvistazErrorResponse>(ex.Response);
return new ValidationFailure(string.Empty, jsonResponse.Resource?.Message ?? "Unauthorized request to indexer"); return new ValidationFailure(string.Empty, jsonResponse.Resource?.Message ?? "Unauthorized request to indexer");
} }
else if (ex.Response.StatusCode == HttpStatusCode.TooManyRequests)
{
_logger.Warn(ex, "Too Many Requests");
return new ValidationFailure(string.Empty, "Too Many Requests");
}
else else
{ {
_logger.Warn(ex, "Unable to connect to indexer"); _logger.Warn(ex, "Unable to connect to indexer");
@@ -24,24 +24,26 @@ namespace NzbDrone.Core.Indexers.Definitions.Avistaz
{ {
var torrentInfos = new List<TorrentInfo>(); var torrentInfos = new List<TorrentInfo>();
if (indexerResponse.HttpResponse.StatusCode == HttpStatusCode.NotFound) if (!indexerResponse.HttpResponse.Headers.ContentType.Contains(HttpAccept.Json.Value))
{ {
return torrentInfos.ToArray(); throw new IndexerException(indexerResponse, $"Unexpected response header {indexerResponse.HttpResponse.Headers.ContentType} from API request, expected {HttpAccept.Json.Value}");
}
if (indexerResponse.HttpResponse.StatusCode == HttpStatusCode.TooManyRequests)
{
throw new RequestLimitReachedException(indexerResponse, "API Request Limit Reached");
} }
if (indexerResponse.HttpResponse.StatusCode != HttpStatusCode.OK) if (indexerResponse.HttpResponse.StatusCode != HttpStatusCode.OK)
{ {
throw new IndexerException(indexerResponse, $"Unexpected response status {indexerResponse.HttpResponse.StatusCode} code from API request"); if (indexerResponse.HttpResponse.StatusCode == HttpStatusCode.NotFound)
} {
// No results found
return torrentInfos.ToArray();
}
if (!indexerResponse.HttpResponse.Headers.ContentType.Contains(HttpAccept.Json.Value)) HttpResponse<AvistazErrorResponse> jsonErrorResponse = new HttpResponse<AvistazErrorResponse>(indexerResponse.HttpResponse);
{ if (indexerResponse.HttpResponse.StatusCode == HttpStatusCode.Unauthorized)
throw new IndexerException(indexerResponse, $"Unexpected response header {indexerResponse.HttpResponse.Headers.ContentType} from API request, expected {HttpAccept.Json.Value}"); {
throw new IndexerAuthException(string.Empty, jsonErrorResponse.Resource?.Message ?? "Unauthorized request to indexer");
}
throw new IndexerException(indexerResponse, $"Unexpected response status {indexerResponse.HttpResponse.StatusCode} code from API request");
} }
var jsonResponse = new HttpResponse<AvistazResponse>(indexerResponse.HttpResponse); var jsonResponse = new HttpResponse<AvistazResponse>(indexerResponse.HttpResponse);
@@ -33,7 +33,7 @@ namespace NzbDrone.Core.Indexers.Definitions.Avistaz
[FieldDefinition(3, Label = "Password", HelpText = "Site Password", Privacy = PrivacyLevel.Password, Type = FieldType.Password)] [FieldDefinition(3, Label = "Password", HelpText = "Site Password", Privacy = PrivacyLevel.Password, Type = FieldType.Password)]
public string Password { get; set; } public string Password { get; set; }
[FieldDefinition(4, Label = "PID", HelpText = "PID from My Account or My Profile page")] [FieldDefinition(4, Label = "PID", HelpText = "PID from My Account or My Profile page", Privacy = PrivacyLevel.Password, Type = FieldType.Password)]
public string Pid { get; set; } public string Pid { get; set; }
[FieldDefinition(5, Label = "Freeleech Only", Type = FieldType.Checkbox, HelpText = "Search freeleech only")] [FieldDefinition(5, Label = "Freeleech Only", Type = FieldType.Checkbox, HelpText = "Search freeleech only")]
@@ -223,7 +223,7 @@ namespace NzbDrone.Core.Indexers.Definitions
InfoUrl = details, InfoUrl = details,
Guid = details, Guid = details,
Categories = _categories.MapTrackerCatDescToNewznab(row.Category), Categories = _categories.MapTrackerCatDescToNewznab(row.Category),
PublishDate = DateTime.Parse(row.CreatedAt, CultureInfo.InvariantCulture), PublishDate = DateTime.Parse(row.CreatedAt, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal),
Size = row.Size, Size = row.Size,
Grabs = row.Grabs, Grabs = row.Grabs,
Seeders = row.Seeders, Seeders = row.Seeders,
@@ -22,7 +22,7 @@ namespace NzbDrone.Core.Indexers.FileList
[JsonProperty(PropertyName = "doubleup")] [JsonProperty(PropertyName = "doubleup")]
public bool DoubleUp { get; set; } public bool DoubleUp { get; set; }
[JsonProperty(PropertyName = "upload_date")] [JsonProperty(PropertyName = "upload_date")]
public DateTime UploadDate { get; set; } public string UploadDate { get; set; }
public string Category { get; set; } public string Category { get; set; }
} }
} }
@@ -62,7 +62,7 @@ namespace NzbDrone.Core.Indexers.FileList
InfoUrl = GetInfoUrl(id), InfoUrl = GetInfoUrl(id),
Seeders = result.Seeders, Seeders = result.Seeders,
Peers = result.Leechers + result.Seeders, Peers = result.Leechers + result.Seeders,
PublishDate = result.UploadDate, PublishDate = DateTime.Parse(result.UploadDate + " +0200"),
ImdbId = imdbId, ImdbId = imdbId,
IndexerFlags = flags, IndexerFlags = flags,
Files = (int)result.Files, Files = (int)result.Files,
@@ -208,7 +208,7 @@ namespace NzbDrone.Core.Indexers.Definitions
Categories = new List<IndexerCategory> { TvCategoryFromQualityParser.ParseTvShowQuality(row.ReleaseTitle) }, Categories = new List<IndexerCategory> { TvCategoryFromQualityParser.ParseTvShowQuality(row.ReleaseTitle) },
Size = ParseUtil.CoerceLong(row.Size), Size = ParseUtil.CoerceLong(row.Size),
Files = row.FileList.Length, Files = row.FileList.Length,
PublishDate = DateTime.Parse(row.PublishDateUtc, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal), PublishDate = DateTime.Parse(row.PublishDateUtc, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal),
Grabs = ParseUtil.CoerceInt(row.Snatch), Grabs = ParseUtil.CoerceInt(row.Snatch),
Seeders = ParseUtil.CoerceInt(row.Seed), Seeders = ParseUtil.CoerceInt(row.Seed),
Peers = ParseUtil.CoerceInt(row.Seed) + ParseUtil.CoerceInt(row.Leech), Peers = ParseUtil.CoerceInt(row.Seed) + ParseUtil.CoerceInt(row.Leech),
+1 -1
View File
@@ -47,7 +47,7 @@
"AuthenticationMethodHelpText": "Require Username and Password to access Prowlarr", "AuthenticationMethodHelpText": "Require Username and Password to access Prowlarr",
"AuthenticationRequired": "Authentication Required", "AuthenticationRequired": "Authentication Required",
"AuthenticationRequiredHelpText": "Change which requests authentication is required for. Do not change unless you understand the risks.", "AuthenticationRequiredHelpText": "Change which requests authentication is required for. Do not change unless you understand the risks.",
"AuthenticationRequiredWarning": "To prevent remote access without authentication, Prowlarr now requires authentication to be enabled. You can optionally disable authentication from local addresses.", "AuthenticationRequiredWarning": "To prevent remote access without authentication, Prowlarr now requires authentication to be enabled. Configure your authentication method and credentials. You can optionally disable authentication from local addresses. Refer to the FAQ for additional information.",
"Automatic": "Automatic", "Automatic": "Automatic",
"AutomaticSearch": "Automatic Search", "AutomaticSearch": "Automatic Search",
"Backup": "Backup", "Backup": "Backup",
+1 -1
View File
@@ -109,7 +109,7 @@ namespace NzbDrone.Core.Parser
if (DateTimeRoutines.TryParseDateOrTime( if (DateTimeRoutines.TryParseDateOrTime(
str, dtFormat, out DateTimeRoutines.ParsedDateTime dt)) str, dtFormat, out DateTimeRoutines.ParsedDateTime dt))
{ {
return dt.DateTime.ToUniversalTime(); return dt.DateTime;
} }
throw new InvalidDateException($"FromFuzzyTime parsing failed for string {str}"); throw new InvalidDateException($"FromFuzzyTime parsing failed for string {str}");
@@ -61,7 +61,7 @@ namespace NzbDrone.Core.Parser.Model
public int Age public int Age
{ {
get { return DateTime.UtcNow.Subtract(PublishDate).Days; } get { return DateTime.UtcNow.Subtract(PublishDate.ToUniversalTime()).Days; }
//This prevents manually downloading a release from blowing up in mono //This prevents manually downloading a release from blowing up in mono
//TODO: Is there a better way? //TODO: Is there a better way?
@@ -70,7 +70,7 @@ namespace NzbDrone.Core.Parser.Model
public double AgeHours public double AgeHours
{ {
get { return DateTime.UtcNow.Subtract(PublishDate).TotalHours; } get { return DateTime.UtcNow.Subtract(PublishDate.ToUniversalTime()).TotalHours; }
//This prevents manually downloading a release from blowing up in mono //This prevents manually downloading a release from blowing up in mono
//TODO: Is there a better way? //TODO: Is there a better way?
@@ -79,7 +79,7 @@ namespace NzbDrone.Core.Parser.Model
public double AgeMinutes public double AgeMinutes
{ {
get { return DateTime.UtcNow.Subtract(PublishDate).TotalMinutes; } get { return DateTime.UtcNow.Subtract(PublishDate.ToUniversalTime()).TotalMinutes; }
//This prevents manually downloading a release from blowing up in mono //This prevents manually downloading a release from blowing up in mono
//TODO: Is there a better way? //TODO: Is there a better way?