Jackett/src/Jackett.Common/Indexers/HDOnly.cs

64 lines
2.6 KiB
C#
Raw Normal View History

using System.Collections.Generic;
using Jackett.Indexers.Abstract;
using Jackett.Models;
Feature/netcore preparation (#2035) * Move to use package reference for restoring nuget packages. * Return a task result for this async method. * Update to a supported version of the .NET Framework. This also has the side effect of allowing us to automatically generate our binding redirects on build. * Set the solution to target VS2017 * Update test solution csproj file to support being built through MSBuild 15 * Move to use package reference for restoring nuget packages. * Return a task result for this async method. * Update to a supported version of the .NET Framework. This also has the side effect of allowing us to automatically generate our binding redirects on build. * Set the solution to target VS2017 * Update test solution csproj file to support being built through MSBuild 15 * DateTimeRoutines does not have Nuget packages that support .NET Standard (and therefore .NET Core). We will have to include them for now until we can get rid of this dependency. * Move the interfaces into their own files. This will be useful when we share them between the .NET Core and .NET Framework WebAPI * Stage services that need to point to the new interface namespace. * Update CurlSharp to fix memory leak issue and support better runtime compatibility with OSX and Linux * Start spliting some interfaces into their own files - this will help by allowing us to split them out in the future into a seperate project so the actual implementations can stay within their respective architectures when required
2017-10-29 10:19:09 +00:00
using Jackett.Services.Interfaces;
2017-02-02 13:53:28 +00:00
using Jackett.Utils.Clients;
using Newtonsoft.Json.Linq;
using NLog;
2017-02-02 13:53:28 +00:00
namespace Jackett.Indexers
{
public class HDOnly : GazelleTracker
2017-02-02 13:53:28 +00:00
{
public HDOnly(IIndexerConfigurationService configService, WebClient webClient, Logger logger, IProtectionService protectionService)
2017-02-02 13:53:28 +00:00
: base(name: "HD-Only",
desc: "HD-Only (HD-O) is a FRENCH Private Torrent Tracker for HD MOVIES / TV",
2017-02-02 13:53:28 +00:00
link: "https://hd-only.org/",
configService: configService,
2017-02-02 13:53:28 +00:00
logger: logger,
protectionService: protectionService,
webClient: webClient,
supportsFreeleechTokens: true // not verified
2017-02-02 13:53:28 +00:00
)
{
Language = "fr-fr";
Type = "private";
// a few releases have "category":"S\u00e9ries" set
AddCategoryMapping(null, TorznabCatType.TV, "Séries");
// releaseType mappings
AddCategoryMapping(1, TorznabCatType.Movies, "Film");
AddCategoryMapping(3, TorznabCatType.TVAnime, "Dessin animé");
AddCategoryMapping(5, TorznabCatType.TV, "Série");
AddCategoryMapping(6, TorznabCatType.TVAnime, "Série Animée");
AddCategoryMapping(7, TorznabCatType.MoviesOther, "Film d'animation");
AddCategoryMapping(9, TorznabCatType.AudioVideo, "Concert");
AddCategoryMapping(11, TorznabCatType.TVDocumentary, "Documentaire");
AddCategoryMapping(13, TorznabCatType.MoviesOther, "Court-métrage");
AddCategoryMapping(14, TorznabCatType.MoviesOther, "Clip");
AddCategoryMapping(15, TorznabCatType.MoviesOther, "Démonstration");
AddCategoryMapping(16, TorznabCatType.MoviesOther, "Bonus de BD");
AddCategoryMapping(21, TorznabCatType.Other, "Autre");
2017-02-02 13:53:28 +00:00
}
protected override bool ReleaseInfoPostParse(ReleaseInfo release, JObject torrent, JObject result)
{
// releaseType is used for categories
var category = (string)result["category"];
if (category == null)
{
var releaseType = (string)result["releaseType"];
release.Category = MapTrackerCatDescToNewznab(releaseType);
}
return true;
2017-02-02 13:53:28 +00:00
}
protected override List<string> MapTorznabCapsToTrackers(TorznabQuery query, bool mapChildrenCatsToParent = false)
{
// don't use category filtering
return new List<string>();
2017-02-02 13:53:28 +00:00
}
}
}