mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-16 16:44:10 +02:00
Compare commits
4 Commits
fix-orpheu
...
v0.2.0.167
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ca0de18413 | ||
![]() |
fb8b65a91b | ||
![]() |
b4e0608b3b | ||
![]() |
60d9f02830 |
@@ -19,10 +19,10 @@ indent_size = 4
|
||||
dotnet_sort_system_directives_first = true
|
||||
|
||||
# Avoid "this." and "Me." if not necessary
|
||||
dotnet_style_qualification_for_field = false:refactoring
|
||||
dotnet_style_qualification_for_property = false:refactoring
|
||||
dotnet_style_qualification_for_method = false:refactoring
|
||||
dotnet_style_qualification_for_event = false:refactoring
|
||||
dotnet_style_qualification_for_field = false:warning
|
||||
dotnet_style_qualification_for_property = false:warning
|
||||
dotnet_style_qualification_for_method = false:warning
|
||||
dotnet_style_qualification_for_event = false:warning
|
||||
|
||||
# Indentation preferences
|
||||
csharp_indent_block_contents = true
|
||||
@@ -32,10 +32,6 @@ csharp_indent_case_contents_when_block = true
|
||||
csharp_indent_switch_labels = true
|
||||
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.required_prefix = _
|
||||
|
||||
|
@@ -190,7 +190,7 @@ class IndexerIndexRow extends Component {
|
||||
key={name}
|
||||
className={styles[column.name]}
|
||||
>
|
||||
{appProfile.name}
|
||||
{appProfile?.name || ''}
|
||||
</VirtualTableRowCell>
|
||||
);
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@
|
||||
"jquery": "3.6.0",
|
||||
"lodash": "4.17.21",
|
||||
"mobile-detect": "1.4.5",
|
||||
"moment": "2.29.1",
|
||||
"moment": "2.29.2",
|
||||
"mousetrap": "1.6.5",
|
||||
"normalize.css": "8.0.1",
|
||||
"prop-types": "15.8.1",
|
||||
|
@@ -4,10 +4,13 @@ using System.Collections.Specialized;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using FluentValidation;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Indexers.Exceptions;
|
||||
@@ -21,6 +24,8 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
{
|
||||
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[] IndexerUrls => new string[] { "https://www.myanonamouse.net/" };
|
||||
@@ -44,6 +49,47 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
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()
|
||||
{
|
||||
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")]
|
||||
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 NzbDroneValidationResult Validate()
|
||||
@@ -438,4 +487,10 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
public string Error { 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"
|
||||
integrity sha512-yc0LhH6tItlvfLBugVUEtgawwFU2sIe+cSdmRJJCTMZ5GEJyLxNyC/NIOAOGk67Fa8GNpOttO3Xz/1bHpXFD/g==
|
||||
|
||||
moment@2.29.1:
|
||||
version "2.29.1"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
|
||||
integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==
|
||||
moment@2.29.2:
|
||||
version "2.29.2"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.2.tgz#00910c60b20843bcba52d37d58c628b47b1f20e4"
|
||||
integrity sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg==
|
||||
|
||||
mousetrap@1.6.5:
|
||||
version "1.6.5"
|
||||
|
Reference in New Issue
Block a user