mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-18 21:55:12 -04:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ca0de18413 | |||
| fb8b65a91b | |||
| b4e0608b3b | |||
| 60d9f02830 |
+4
-8
@@ -19,10 +19,10 @@ indent_size = 4
|
|||||||
dotnet_sort_system_directives_first = true
|
dotnet_sort_system_directives_first = true
|
||||||
|
|
||||||
# Avoid "this." and "Me." if not necessary
|
# Avoid "this." and "Me." if not necessary
|
||||||
dotnet_style_qualification_for_field = false:refactoring
|
dotnet_style_qualification_for_field = false:warning
|
||||||
dotnet_style_qualification_for_property = false:refactoring
|
dotnet_style_qualification_for_property = false:warning
|
||||||
dotnet_style_qualification_for_method = false:refactoring
|
dotnet_style_qualification_for_method = false:warning
|
||||||
dotnet_style_qualification_for_event = false:refactoring
|
dotnet_style_qualification_for_event = false:warning
|
||||||
|
|
||||||
# Indentation preferences
|
# Indentation preferences
|
||||||
csharp_indent_block_contents = true
|
csharp_indent_block_contents = true
|
||||||
@@ -32,10 +32,6 @@ csharp_indent_case_contents_when_block = true
|
|||||||
csharp_indent_switch_labels = true
|
csharp_indent_switch_labels = true
|
||||||
csharp_indent_labels = flush_left
|
csharp_indent_labels = flush_left
|
||||||
|
|
||||||
dotnet_style_qualification_for_field = false:suggestion
|
|
||||||
dotnet_style_qualification_for_property = false:suggestion
|
|
||||||
dotnet_style_qualification_for_method = false:suggestion
|
|
||||||
dotnet_style_qualification_for_event = false:suggestion
|
|
||||||
dotnet_naming_style.instance_field_style.capitalization = camel_case
|
dotnet_naming_style.instance_field_style.capitalization = camel_case
|
||||||
dotnet_naming_style.instance_field_style.required_prefix = _
|
dotnet_naming_style.instance_field_style.required_prefix = _
|
||||||
|
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ class IndexerIndexRow extends Component {
|
|||||||
key={name}
|
key={name}
|
||||||
className={styles[column.name]}
|
className={styles[column.name]}
|
||||||
>
|
>
|
||||||
{appProfile.name}
|
{appProfile?.name || ''}
|
||||||
</VirtualTableRowCell>
|
</VirtualTableRowCell>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@
|
|||||||
"jquery": "3.6.0",
|
"jquery": "3.6.0",
|
||||||
"lodash": "4.17.21",
|
"lodash": "4.17.21",
|
||||||
"mobile-detect": "1.4.5",
|
"mobile-detect": "1.4.5",
|
||||||
"moment": "2.29.1",
|
"moment": "2.29.2",
|
||||||
"mousetrap": "1.6.5",
|
"mousetrap": "1.6.5",
|
||||||
"normalize.css": "8.0.1",
|
"normalize.css": "8.0.1",
|
||||||
"prop-types": "15.8.1",
|
"prop-types": "15.8.1",
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.Indexers.Gazelle
|
namespace NzbDrone.Core.Indexers.Gazelle
|
||||||
{
|
{
|
||||||
@@ -60,7 +59,6 @@ namespace NzbDrone.Core.Indexers.Gazelle
|
|||||||
public int TotalSeeders { get; set; }
|
public int TotalSeeders { get; set; }
|
||||||
public int TotalSnatched { get; set; }
|
public int TotalSnatched { get; set; }
|
||||||
public long MaxSize { get; set; }
|
public long MaxSize { get; set; }
|
||||||
[JsonConverter(typeof(GazelleTimestampConverter))]
|
|
||||||
public long GroupTime { get; set; }
|
public long GroupTime { get; set; }
|
||||||
public List<GazelleTorrent> Torrents { get; set; }
|
public List<GazelleTorrent> Torrents { get; set; }
|
||||||
public bool IsFreeLeech { get; set; }
|
public bool IsFreeLeech { get; set; }
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.Indexers.Gazelle
|
|
||||||
{
|
|
||||||
public class GazelleTimestampConverter : JsonConverter
|
|
||||||
{
|
|
||||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
|
||||||
{
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
writer.WriteNull();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
writer.WriteValue(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
|
||||||
{
|
|
||||||
if (objectType == typeof(long))
|
|
||||||
{
|
|
||||||
return Convert.ToInt64(reader.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (objectType == typeof(string))
|
|
||||||
{
|
|
||||||
var date = DateTimeOffset.Parse(reader.Value.ToString());
|
|
||||||
return date.ToUnixTimeSeconds();
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new JsonSerializationException("Can't convert type " + existingValue.GetType().FullName + " to timestamp");
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool CanConvert(Type objectType)
|
|
||||||
{
|
|
||||||
return objectType == typeof(long) || objectType == typeof(string);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,10 +4,13 @@ using System.Collections.Specialized;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common.Http;
|
using NzbDrone.Common.Http;
|
||||||
|
using NzbDrone.Common.Serializer;
|
||||||
using NzbDrone.Core.Annotations;
|
using NzbDrone.Core.Annotations;
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
using NzbDrone.Core.Indexers.Exceptions;
|
using NzbDrone.Core.Indexers.Exceptions;
|
||||||
@@ -21,6 +24,8 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
{
|
{
|
||||||
public class MyAnonamouse : TorrentIndexerBase<MyAnonamouseSettings>
|
public class MyAnonamouse : TorrentIndexerBase<MyAnonamouseSettings>
|
||||||
{
|
{
|
||||||
|
private static readonly Regex TorrentIdRegex = new Regex(@"tor/download.php\?tid=(?<id>\d+)$");
|
||||||
|
|
||||||
public override string Name => "MyAnonamouse";
|
public override string Name => "MyAnonamouse";
|
||||||
|
|
||||||
public override string[] IndexerUrls => new string[] { "https://www.myanonamouse.net/" };
|
public override string[] IndexerUrls => new string[] { "https://www.myanonamouse.net/" };
|
||||||
@@ -44,6 +49,47 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
return new MyAnonamouseParser(Settings, Capabilities.Categories);
|
return new MyAnonamouseParser(Settings, Capabilities.Categories);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override async Task<byte[]> Download(Uri link)
|
||||||
|
{
|
||||||
|
if (Settings.Freeleech)
|
||||||
|
{
|
||||||
|
_logger.Debug($"Attempting to use freeleech token for {link.AbsoluteUri}");
|
||||||
|
|
||||||
|
var idMatch = TorrentIdRegex.Match(link.AbsoluteUri);
|
||||||
|
if (idMatch.Success)
|
||||||
|
{
|
||||||
|
var id = int.Parse(idMatch.Groups["id"].Value);
|
||||||
|
var timestamp = DateTimeOffset.Now.ToUnixTimeSeconds();
|
||||||
|
var freeleechUrl = Settings.BaseUrl + $"json/bonusBuy.php/{timestamp}";
|
||||||
|
|
||||||
|
var freeleechRequest = new HttpRequestBuilder(freeleechUrl)
|
||||||
|
.AddQueryParam("spendtype", "personalFL")
|
||||||
|
.AddQueryParam("torrentid", id)
|
||||||
|
.AddQueryParam("timestamp", timestamp.ToString())
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
var indexerReq = new IndexerRequest(freeleechRequest);
|
||||||
|
var response = await FetchIndexerResponse(indexerReq).ConfigureAwait(false);
|
||||||
|
var resource = Json.Deserialize<MyAnonamouseFreeleechResponse>(response.Content);
|
||||||
|
|
||||||
|
if (resource.Success)
|
||||||
|
{
|
||||||
|
_logger.Debug($"Successfully to used freeleech token for torrentid ${id}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.Debug($"Failed to use freeleech token: ${resource.Error}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.Debug($"Could not get torrent id from link ${link.AbsoluteUri}, skipping freeleech");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return await base.Download(link).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
|
||||||
protected override IDictionary<string, string> GetCookies()
|
protected override IDictionary<string, string> GetCookies()
|
||||||
{
|
{
|
||||||
return CookieUtil.CookieHeaderToDictionary("mam_id=" + Settings.MamId);
|
return CookieUtil.CookieHeaderToDictionary("mam_id=" + Settings.MamId);
|
||||||
@@ -400,7 +446,10 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
[FieldDefinition(3, Type = FieldType.Checkbox, Label = "Exclude VIP", HelpText = "Exclude VIP Torrents from search results")]
|
[FieldDefinition(3, Type = FieldType.Checkbox, Label = "Exclude VIP", HelpText = "Exclude VIP Torrents from search results")]
|
||||||
public bool ExcludeVip { get; set; }
|
public bool ExcludeVip { get; set; }
|
||||||
|
|
||||||
[FieldDefinition(4)]
|
[FieldDefinition(4, Type = FieldType.Checkbox, Label = "Freeleech", HelpText = "Use freeleech token for download")]
|
||||||
|
public bool Freeleech { get; set; }
|
||||||
|
|
||||||
|
[FieldDefinition(5)]
|
||||||
public IndexerBaseSettings BaseSettings { get; set; } = new IndexerBaseSettings();
|
public IndexerBaseSettings BaseSettings { get; set; } = new IndexerBaseSettings();
|
||||||
|
|
||||||
public NzbDroneValidationResult Validate()
|
public NzbDroneValidationResult Validate()
|
||||||
@@ -438,4 +487,10 @@ namespace NzbDrone.Core.Indexers.Definitions
|
|||||||
public string Error { get; set; }
|
public string Error { get; set; }
|
||||||
public List<MyAnonamouseTorrent> Data { get; set; }
|
public List<MyAnonamouseTorrent> Data { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class MyAnonamouseFreeleechResponse
|
||||||
|
{
|
||||||
|
public bool Success { get; set; }
|
||||||
|
public string Error { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4648,10 +4648,10 @@ mobile-detect@1.4.5:
|
|||||||
resolved "https://registry.yarnpkg.com/mobile-detect/-/mobile-detect-1.4.5.tgz#da393c3c413ca1a9bcdd9ced653c38281c0fb6ad"
|
resolved "https://registry.yarnpkg.com/mobile-detect/-/mobile-detect-1.4.5.tgz#da393c3c413ca1a9bcdd9ced653c38281c0fb6ad"
|
||||||
integrity sha512-yc0LhH6tItlvfLBugVUEtgawwFU2sIe+cSdmRJJCTMZ5GEJyLxNyC/NIOAOGk67Fa8GNpOttO3Xz/1bHpXFD/g==
|
integrity sha512-yc0LhH6tItlvfLBugVUEtgawwFU2sIe+cSdmRJJCTMZ5GEJyLxNyC/NIOAOGk67Fa8GNpOttO3Xz/1bHpXFD/g==
|
||||||
|
|
||||||
moment@2.29.1:
|
moment@2.29.2:
|
||||||
version "2.29.1"
|
version "2.29.2"
|
||||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
|
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.2.tgz#00910c60b20843bcba52d37d58c628b47b1f20e4"
|
||||||
integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==
|
integrity sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg==
|
||||||
|
|
||||||
mousetrap@1.6.5:
|
mousetrap@1.6.5:
|
||||||
version "1.6.5"
|
version "1.6.5"
|
||||||
|
|||||||
Reference in New Issue
Block a user