New: (Indexer) Torrent Xthor (#342)
* New: (Indexer) Torrent Xthor * New: (Indexer) Torrent Xthor Fix multiple lines fieldDefinition and texts * New: (Indexer) Torrent Xthor Remove unwanted blankline * New: (Indexer) Torrent Xthor Fix BaseSettings after rebase * New: (Indexer) Torrent Xthor * New: (Indexer) Torrent Xthor Fix multiple lines fieldDefinition and texts * New: (Indexer) Torrent Xthor Remove unwanted blankline * New: (Indexer) Torrent Xthor Fix BaseSettings after rebase * New: (Indexer) Torrent Xthor - Add "EnhancedFrenchAccent" field that will allow to find VF2 releases when searching VFF or VFQ - Fix BaseSettings - Decrease the RateLimit to 2.1 seconds - Remove page argument when searching page 0 * Fix punctuation * New: (Indexer) Torrent Xthor * New: (Indexer) Torrent Xthor Fix multiple lines fieldDefinition and texts * New: (Indexer) Torrent Xthor Remove unwanted blankline * New: (Indexer) Torrent Xthor Fix BaseSettings after rebase * New: (Indexer) Torrent Xthor - Add "EnhancedFrenchAccent" field that will allow to find VF2 releases when searching VFF or VFQ - Fix BaseSettings - Decrease the RateLimit to 2.1 seconds - Remove page argument when searching page 0 * Fix punctuation * New: (Indexer) Torrent Xthor - Fix "unknown" categories when searching with Prowlarr (category conversion was missing) - Now every class has its own file (like all others indexers) * New: (Indexer) Torrent Xthor - Fix fielddefinition to be on single line Co-authored-by: TCLE <t.clemenceau@shinken-solutions.com>pull/368/head
parent
e1c98d2b38
commit
b3b0467d22
@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.Definitions.Xthor
|
||||
{
|
||||
public class Xthor : TorrentIndexerBase<XthorSettings>
|
||||
{
|
||||
public override string Name => "Xthor";
|
||||
public override string[] IndexerUrls => new string[] { "https://api.xthor.tk/" };
|
||||
public override string Language => "fr-fr";
|
||||
public override string Description => "Xthor is a general Private torrent site";
|
||||
public override Encoding Encoding => Encoding.GetEncoding("windows-1252");
|
||||
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
|
||||
public override IndexerPrivacy Privacy => IndexerPrivacy.Private;
|
||||
|
||||
public override TimeSpan RateLimit => TimeSpan.FromSeconds(2.1);
|
||||
public override IndexerCapabilities Capabilities => SetCapabilities();
|
||||
|
||||
public Xthor(IHttpClient httpClient,
|
||||
IEventAggregator eventAggregator,
|
||||
IIndexerStatusService indexerStatusService,
|
||||
IConfigService configService,
|
||||
Logger logger)
|
||||
: base(httpClient, eventAggregator, indexerStatusService, configService, logger)
|
||||
{
|
||||
}
|
||||
|
||||
public override IIndexerRequestGenerator GetRequestGenerator()
|
||||
{
|
||||
return new XthorRequestGenerator() { Settings = Settings, Capabilities = Capabilities };
|
||||
}
|
||||
|
||||
public override IParseIndexerResponse GetParser()
|
||||
{
|
||||
return new XthorParser(Settings, Capabilities.Categories);
|
||||
}
|
||||
|
||||
private IndexerCapabilities SetCapabilities()
|
||||
{
|
||||
var caps = new IndexerCapabilities
|
||||
{
|
||||
TvSearchParams = new List<TvSearchParam> { TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep },
|
||||
MovieSearchParams = new List<MovieSearchParam> { MovieSearchParam.Q, MovieSearchParam.TmdbId },
|
||||
MusicSearchParams = new List<MusicSearchParam> { MusicSearchParam.Q },
|
||||
BookSearchParams = new List<BookSearchParam> { BookSearchParam.Q }
|
||||
};
|
||||
|
||||
caps.Categories.AddCategoryMapping(118, NewznabStandardCategory.MoviesBluRay, "Films 2160p/Bluray");
|
||||
caps.Categories.AddCategoryMapping(119, NewznabStandardCategory.MoviesBluRay, "Films 2160p/Remux");
|
||||
caps.Categories.AddCategoryMapping(107, NewznabStandardCategory.MoviesUHD, "Films 2160p/x265");
|
||||
caps.Categories.AddCategoryMapping(1, NewznabStandardCategory.MoviesBluRay, "Films 1080p/BluRay");
|
||||
caps.Categories.AddCategoryMapping(2, NewznabStandardCategory.MoviesBluRay, "Films 1080p/Remux");
|
||||
caps.Categories.AddCategoryMapping(100, NewznabStandardCategory.MoviesHD, "Films 1080p/x265");
|
||||
caps.Categories.AddCategoryMapping(4, NewznabStandardCategory.MoviesHD, "Films 1080p/x264");
|
||||
caps.Categories.AddCategoryMapping(5, NewznabStandardCategory.MoviesHD, "Films 720p/x264");
|
||||
caps.Categories.AddCategoryMapping(7, NewznabStandardCategory.MoviesSD, "Films SD/x264");
|
||||
caps.Categories.AddCategoryMapping(3, NewznabStandardCategory.Movies3D, "Films 3D");
|
||||
caps.Categories.AddCategoryMapping(6, NewznabStandardCategory.MoviesSD, "Films XviD");
|
||||
caps.Categories.AddCategoryMapping(8, NewznabStandardCategory.MoviesDVD, "Films DVD");
|
||||
caps.Categories.AddCategoryMapping(122, NewznabStandardCategory.MoviesHD, "Films HDTV");
|
||||
caps.Categories.AddCategoryMapping(94, NewznabStandardCategory.MoviesWEBDL, "Films WEBDL");
|
||||
caps.Categories.AddCategoryMapping(95, NewznabStandardCategory.MoviesWEBDL, "Films WEBRiP");
|
||||
caps.Categories.AddCategoryMapping(12, NewznabStandardCategory.TVDocumentary, "Films Documentaire");
|
||||
caps.Categories.AddCategoryMapping(31, NewznabStandardCategory.MoviesOther, "Films Animation");
|
||||
caps.Categories.AddCategoryMapping(33, NewznabStandardCategory.MoviesOther, "Films Spectacle");
|
||||
caps.Categories.AddCategoryMapping(125, NewznabStandardCategory.TVSport, "Films Sports");
|
||||
caps.Categories.AddCategoryMapping(20, NewznabStandardCategory.AudioVideo, "Films Concerts, Clips");
|
||||
caps.Categories.AddCategoryMapping(9, NewznabStandardCategory.MoviesOther, "Films VOSTFR");
|
||||
|
||||
// TV / Series
|
||||
caps.Categories.AddCategoryMapping(104, NewznabStandardCategory.TVOther, "Series BluRay");
|
||||
caps.Categories.AddCategoryMapping(13, NewznabStandardCategory.TVOther, "Series Pack VF");
|
||||
caps.Categories.AddCategoryMapping(15, NewznabStandardCategory.TVHD, "Series HD VF");
|
||||
caps.Categories.AddCategoryMapping(14, NewznabStandardCategory.TVSD, "Series SD VF");
|
||||
caps.Categories.AddCategoryMapping(98, NewznabStandardCategory.TVOther, "Series Pack VOSTFR");
|
||||
caps.Categories.AddCategoryMapping(17, NewznabStandardCategory.TVHD, "Series HD VOSTFR");
|
||||
caps.Categories.AddCategoryMapping(16, NewznabStandardCategory.TVSD, "Series SD VOSTFR");
|
||||
caps.Categories.AddCategoryMapping(101, NewznabStandardCategory.TVAnime, "Series Packs Anime");
|
||||
caps.Categories.AddCategoryMapping(32, NewznabStandardCategory.TVAnime, "Series Animes");
|
||||
caps.Categories.AddCategoryMapping(110, NewznabStandardCategory.TVAnime, "Series Anime VOSTFR");
|
||||
caps.Categories.AddCategoryMapping(123, NewznabStandardCategory.TVOther, "Series Animation");
|
||||
caps.Categories.AddCategoryMapping(109, NewznabStandardCategory.TVDocumentary, "Series DOC");
|
||||
caps.Categories.AddCategoryMapping(34, NewznabStandardCategory.TVOther, "Series Sport");
|
||||
caps.Categories.AddCategoryMapping(30, NewznabStandardCategory.TVOther, "Series Emission TV");
|
||||
|
||||
// XxX / MISC
|
||||
caps.Categories.AddCategoryMapping(36, NewznabStandardCategory.XXX, "MISC XxX/Films");
|
||||
caps.Categories.AddCategoryMapping(105, NewznabStandardCategory.XXX, "MISC XxX/Séries");
|
||||
caps.Categories.AddCategoryMapping(114, NewznabStandardCategory.XXX, "MISC XxX/Lesbiennes");
|
||||
caps.Categories.AddCategoryMapping(115, NewznabStandardCategory.XXX, "MISC XxX/Gays");
|
||||
caps.Categories.AddCategoryMapping(113, NewznabStandardCategory.XXX, "MISC XxX/Hentai");
|
||||
caps.Categories.AddCategoryMapping(120, NewznabStandardCategory.XXX, "MISC XxX/Magazines");
|
||||
|
||||
// Books / Livres
|
||||
caps.Categories.AddCategoryMapping(24, NewznabStandardCategory.BooksEBook, "Livres Romans");
|
||||
caps.Categories.AddCategoryMapping(124, NewznabStandardCategory.AudioAudiobook, "Livres Audio Books");
|
||||
caps.Categories.AddCategoryMapping(96, NewznabStandardCategory.BooksMags, "Livres Magazines");
|
||||
caps.Categories.AddCategoryMapping(99, NewznabStandardCategory.BooksOther, "Livres Bandes dessinées");
|
||||
caps.Categories.AddCategoryMapping(116, NewznabStandardCategory.BooksEBook, "Livres Romans Jeunesse");
|
||||
caps.Categories.AddCategoryMapping(102, NewznabStandardCategory.BooksComics, "Livres Comics");
|
||||
caps.Categories.AddCategoryMapping(103, NewznabStandardCategory.BooksOther, "Livres Mangas");
|
||||
|
||||
// SOFTWARE / Logiciels
|
||||
caps.Categories.AddCategoryMapping(25, NewznabStandardCategory.PCGames, "Logiciels Jeux PC");
|
||||
caps.Categories.AddCategoryMapping(27, NewznabStandardCategory.ConsolePS3, "Logiciels Playstation");
|
||||
caps.Categories.AddCategoryMapping(111, NewznabStandardCategory.PCMac, "Logiciels Jeux MAC");
|
||||
caps.Categories.AddCategoryMapping(26, NewznabStandardCategory.ConsoleXBox360, "Logiciels XboX");
|
||||
caps.Categories.AddCategoryMapping(112, NewznabStandardCategory.PC, "Logiciels Jeux Linux");
|
||||
caps.Categories.AddCategoryMapping(28, NewznabStandardCategory.ConsoleWii, "Logiciels Nintendo");
|
||||
caps.Categories.AddCategoryMapping(29, NewznabStandardCategory.ConsoleNDS, "Logiciels NDS");
|
||||
caps.Categories.AddCategoryMapping(117, NewznabStandardCategory.PC, "Logiciels ROM");
|
||||
caps.Categories.AddCategoryMapping(21, NewznabStandardCategory.PC, "Logiciels Applis PC");
|
||||
caps.Categories.AddCategoryMapping(22, NewznabStandardCategory.PCMac, "Logiciels Applis Mac");
|
||||
caps.Categories.AddCategoryMapping(23, NewznabStandardCategory.PCMobileAndroid, "Logiciels Smartphone");
|
||||
|
||||
return caps;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,167 @@
|
||||
using NzbDrone.Core.Annotations;
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
namespace NzbDrone.Core.Indexers.Definitions.Xthor
|
||||
{
|
||||
public enum XthorAccent
|
||||
{
|
||||
[FieldOption(Hint = "All Voices (default)")]
|
||||
All = 0,
|
||||
|
||||
[FieldOption(Hint = "Françaises")]
|
||||
VFF = 1,
|
||||
|
||||
[FieldOption(Hint = "Quebecoises")]
|
||||
VFQ = 2,
|
||||
|
||||
[FieldOption(Hint = "Françaises et Québécoises")]
|
||||
VF2 = 47,
|
||||
|
||||
[FieldOption(Hint = "Anglaises")]
|
||||
EN = 3,
|
||||
|
||||
[FieldOption(Hint = "Japonaises")]
|
||||
JP = 4,
|
||||
|
||||
[FieldOption(Hint = "Espagnoles")]
|
||||
ES = 5,
|
||||
|
||||
[FieldOption(Hint = "Allemandes")]
|
||||
DE = 6,
|
||||
|
||||
[FieldOption(Hint = "Chinoises")]
|
||||
CH = 7,
|
||||
|
||||
[FieldOption(Hint = "Italiennes")]
|
||||
IT = 8,
|
||||
|
||||
[FieldOption(Hint = "Coréennes")]
|
||||
KR = 9,
|
||||
|
||||
[FieldOption(Hint = "Danoises")]
|
||||
DK = 10,
|
||||
|
||||
[FieldOption(Hint = "Russes")]
|
||||
RU = 11,
|
||||
|
||||
[FieldOption(Hint = "Portugaises")]
|
||||
PT = 12,
|
||||
|
||||
[FieldOption(Hint = "Hindi")]
|
||||
IN = 13,
|
||||
|
||||
[FieldOption(Hint = "Hollandaises")]
|
||||
NL = 14,
|
||||
|
||||
[FieldOption(Hint = "Suédoises")]
|
||||
SE = 15,
|
||||
|
||||
[FieldOption(Hint = "Norvégiennes")]
|
||||
NO = 16,
|
||||
|
||||
[FieldOption(Hint = "Thaïlandaises")]
|
||||
TH = 17,
|
||||
|
||||
[FieldOption(Hint = "Hébreu")]
|
||||
HE = 18,
|
||||
|
||||
[FieldOption(Hint = "Persanes")]
|
||||
PE = 19,
|
||||
|
||||
[FieldOption(Hint = "Arabes")]
|
||||
AR = 20,
|
||||
|
||||
[FieldOption(Hint = "Turques")]
|
||||
TR = 21,
|
||||
|
||||
[FieldOption(Hint = "Hongroises")]
|
||||
HU = 22,
|
||||
|
||||
[FieldOption(Hint = "Polonaises")]
|
||||
PL = 23,
|
||||
|
||||
[FieldOption(Hint = "Finnoises")]
|
||||
FI = 24,
|
||||
|
||||
[FieldOption(Hint = "Indonésiennes")]
|
||||
ID = 25,
|
||||
|
||||
[FieldOption(Hint = "Roumaines")]
|
||||
RO = 26,
|
||||
|
||||
[FieldOption(Hint = "Malaisiennes")]
|
||||
MY = 27,
|
||||
|
||||
[FieldOption(Hint = "Estoniennes")]
|
||||
EE = 28,
|
||||
|
||||
[FieldOption(Hint = "Islandaises")]
|
||||
IS = 29,
|
||||
|
||||
[FieldOption(Hint = "Grecques")]
|
||||
GR = 30,
|
||||
|
||||
[FieldOption(Hint = "Serbes")]
|
||||
RS = 31,
|
||||
|
||||
[FieldOption(Hint = "Norvégiennes (2)")]
|
||||
NOB = 32,
|
||||
|
||||
[FieldOption(Hint = "Ukrainiennes")]
|
||||
UA = 33,
|
||||
|
||||
[FieldOption(Hint = "Bulgares")]
|
||||
BG = 34,
|
||||
|
||||
[FieldOption(Hint = "Tagalogues")]
|
||||
PH = 35,
|
||||
|
||||
[FieldOption(Hint = "Xhosa")]
|
||||
XH = 36,
|
||||
|
||||
[FieldOption(Hint = "Kurdes")]
|
||||
KU = 37,
|
||||
|
||||
[FieldOption(Hint = "Bengali")]
|
||||
BE = 38,
|
||||
|
||||
[FieldOption(Hint = "Amhariques")]
|
||||
AM = 39,
|
||||
|
||||
[FieldOption(Hint = "Bosniaques")]
|
||||
BO = 40,
|
||||
|
||||
[FieldOption(Hint = "Malayalam")]
|
||||
MA = 41,
|
||||
|
||||
[FieldOption(Hint = "Télougou")]
|
||||
TE = 42,
|
||||
|
||||
[FieldOption(Hint = "Bambara")]
|
||||
BA = 43,
|
||||
|
||||
[FieldOption(Hint = "Catalanes")]
|
||||
CT = 44,
|
||||
|
||||
[FieldOption(Hint = "Tchèques")]
|
||||
CZ = 45,
|
||||
|
||||
[FieldOption(Hint = "Afrikaans")]
|
||||
AF = 46,
|
||||
}
|
||||
|
||||
public enum XthorPagesNumber
|
||||
{
|
||||
[FieldOption(Label = "1", Hint = "1 (32 results - default / best perf.)")]
|
||||
one = 1,
|
||||
|
||||
[FieldOption(Label = "2", Hint = "2 (64 results)")]
|
||||
two = 2,
|
||||
|
||||
[FieldOption(Label = "3", Hint = "3 (96 results)")]
|
||||
three = 3,
|
||||
|
||||
[FieldOption(Label = "4", Hint = "4 (128 results - hard limit max)")]
|
||||
four = 4,
|
||||
}
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.Definitions.Xthor
|
||||
{
|
||||
public class XthorResponse
|
||||
{
|
||||
public XthorError Error { get; set; }
|
||||
public XthorUser User { get; set; }
|
||||
public List<XthorTorrent> Torrents { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// State of API
|
||||
/// </summary>
|
||||
public class XthorError
|
||||
{
|
||||
public int Code { get; set; }
|
||||
public string Descr { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// User Informations
|
||||
/// </summary>
|
||||
public class XthorUser
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Username { get; set; }
|
||||
public long Uploaded { get; set; }
|
||||
public long Downloaded { get; set; }
|
||||
public int Uclass { get; set; } // Class is a reserved keyword.
|
||||
public decimal Bonus_point { get; set; }
|
||||
public int Hits_and_run { get; set; }
|
||||
public string Avatar_url { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Torrent Informations
|
||||
/// </summary>
|
||||
public class XthorTorrent
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int Category { get; set; }
|
||||
public int Seeders { get; set; }
|
||||
public int Leechers { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int Times_completed { get; set; }
|
||||
public long Size { get; set; }
|
||||
public int Added { get; set; }
|
||||
public int Freeleech { get; set; }
|
||||
public int Numfiles { get; set; }
|
||||
public string Release_group { get; set; }
|
||||
public string Download_link { get; set; }
|
||||
public int Tmdb_id { get; set; }
|
||||
|
||||
public override string ToString() => string.Format(
|
||||
"[XthorTorrent: id={0}, category={1}, seeders={2}, leechers={3}, name={4}, times_completed={5}, size={6}, added={7}, freeleech={8}, numfiles={9}, release_group={10}, download_link={11}, tmdb_id={12}]",
|
||||
Id,
|
||||
Category,
|
||||
Seeders,
|
||||
Leechers,
|
||||
Name,
|
||||
Times_completed,
|
||||
Size,
|
||||
Added,
|
||||
Freeleech,
|
||||
Numfiles,
|
||||
Release_group,
|
||||
Download_link,
|
||||
Tmdb_id);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue