mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Trezzor: Convert to cardigan (#1860)
* Convert Trezzor to cardigan * Change encoding
This commit is contained in:
113
src/Jackett/Definitions/trezzor.yml
Normal file
113
src/Jackett/Definitions/trezzor.yml
Normal file
@@ -0,0 +1,113 @@
|
||||
site: trezzor
|
||||
name: Trezzor
|
||||
language: cs-cz
|
||||
type: private
|
||||
encoding: windows-1250
|
||||
links:
|
||||
- https://tracker.czech-server.com/
|
||||
|
||||
caps:
|
||||
categorymappings:
|
||||
- {id: 1, cat: Movies/DVD, desc: "DVD CZ/SK dabing"}
|
||||
- {id: 2, cat: Movies/DVD, desc: "DVD CZ/SK titulky"}
|
||||
- {id: 3, cat: Audio/Video, desc: "DVD Hudební video"}
|
||||
- {id: 4, cat: Movies/SD, desc: "XviD, DivX CZ/SK dabing"}
|
||||
- {id: 13, cat: Audio, desc: "Hudba CZ/SK scéna"}
|
||||
- {id: 24, cat: Audio, desc: "Mluv. slovo CZ/SK dabing"}
|
||||
- {id: 10, cat: Audio/Other, desc: "DTS audio"}
|
||||
- {id: 14, cat: PC/Games, desc: "Hry"}
|
||||
- {id: 17, cat: PC, desc: "Programy"}
|
||||
- {id: 14, cat: PC, desc: "Cestiny,patche,upgrady"}
|
||||
- {id: 18, cat: Books, desc: "Knihy CZ/SK lokalizace"}
|
||||
- {id: 18, cat: Books/Comics, desc: "Komiks CZ/SK lokalizace"}
|
||||
- {id: 16, cat: Other, desc: "Foto,obrázky"}
|
||||
- {id: 20, cat: Console, desc: "Konzole"}
|
||||
- {id: 21, cat: PC/Phone-Other, desc: "Mobilmánia"}
|
||||
- {id: 22, cat: Other, desc: "Ostatní CZ/SK scéna"}
|
||||
- {id: 23, cat: Other, desc: "Na prani non CZ/SK"}
|
||||
- {id: 27, cat: Other, desc: "TreZzoR rls"}
|
||||
- {id: 35, cat: Audio/Video, desc: "HDTV Hudební video"}
|
||||
- {id: 36, cat: Movies/SD, desc: "XviD, DivX CZ/SK titulky"}
|
||||
- {id: 31, cat: Movies/HD, desc: "HDTV CZ/SK Dabing"}
|
||||
- {id: 33, cat: Movies/HD, desc: "HDTV CZ/SK Titulky"}
|
||||
- {id: 39, cat: Movies/3D, desc: "3D HDTV CZ/SK Dabing"}
|
||||
- {id: 40, cat: Movies/3D, desc: "3D HDTV CZ/SK Titulky"}
|
||||
- {id: 5, cat: Movies/SD, desc: "TV-rip CZ/SK dabing"}
|
||||
- {id: 41, cat: TV/HD, desc: "HD Seriály CZ/SK dabing"}
|
||||
- {id: 42, cat: TV/HD, desc: "HD Seriály CZ/SK titulky"}
|
||||
- {id: 7, cat: TV/SD, desc: "Seriály CZ/SK dabing"}
|
||||
- {id: 37, cat: TV/SD, desc: "Seriály CZ/SK titulky"}
|
||||
- {id: 9, cat: XXX/XviD, desc: "XXX CZ/SK dabing"}
|
||||
- {id: 32, cat: XXX/x264, desc: "XXX HD CZ/SK dabing"}
|
||||
- {id: 27, cat: Other, desc: "TreZzoR rls"}
|
||||
|
||||
modes:
|
||||
search: [q]
|
||||
tv-search: [q, season, ep]
|
||||
movie-search: [q]
|
||||
|
||||
login:
|
||||
path: prihlasenie.php
|
||||
method: form
|
||||
form: form[action^="prihlasenie.php"]
|
||||
inputs:
|
||||
uid: "{{ .Config.username }}"
|
||||
pwd: "{{ .Config.password }}"
|
||||
error:
|
||||
- selector: div > font:contains("V pripade problemov kontaktujte")
|
||||
test:
|
||||
path: torrents.php
|
||||
|
||||
search:
|
||||
path: torrents.php
|
||||
inputs:
|
||||
search: "{{ .Keywords }}"
|
||||
category: "0"
|
||||
active: "1"
|
||||
rows:
|
||||
selector: tr.torrenty_lista
|
||||
fields:
|
||||
title:
|
||||
selector: a[href^="details.php?id="]
|
||||
# attribute: title
|
||||
filters:
|
||||
- name: re_replace
|
||||
args: [".*? / ", ""]
|
||||
- name: diacritics
|
||||
args: replace
|
||||
category:
|
||||
selector: a[href^="torrents.php?onlycat="]
|
||||
attribute: href
|
||||
filters:
|
||||
- name: querystring
|
||||
args: onlycat
|
||||
details:
|
||||
selector: a[href^="details.php?id="]
|
||||
attribute: href
|
||||
download:
|
||||
selector: a[href^="download.php?id="]
|
||||
attribute: href
|
||||
size:
|
||||
selector: td:nth-child(7)
|
||||
date:
|
||||
selector: td:nth-child(6)
|
||||
filters:
|
||||
- name: append
|
||||
args: " +02:00"
|
||||
- name: dateparse
|
||||
args: "2/1/2006 15:04 -07:00"
|
||||
seeders:
|
||||
selector: td:nth-child(8) a
|
||||
leechers:
|
||||
selector: td:nth-child(9) a
|
||||
grabs:
|
||||
selector: td:nth-child(10)
|
||||
filters:
|
||||
- name: replace
|
||||
args: ["---", "0"]
|
||||
downloadvolumefactor:
|
||||
case:
|
||||
"*": "1"
|
||||
uploadvolumefactor:
|
||||
case:
|
||||
"*": "1"
|
@@ -1,217 +0,0 @@
|
||||
using CsQuery;
|
||||
using Jackett.Models;
|
||||
using Jackett.Services;
|
||||
using Jackett.Utils;
|
||||
using Jackett.Utils.Clients;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using Jackett.Models.IndexerConfig;
|
||||
|
||||
namespace Jackett.Indexers
|
||||
{
|
||||
public class Trezzor : BaseWebIndexer
|
||||
{
|
||||
string LoginUrl { get { return SiteLink + "prihlasenie.php"; } }
|
||||
private string SearchUrl { get { return SiteLink + "torrents.php?"; } }
|
||||
|
||||
|
||||
new ConfigurationDataBasicLogin configData
|
||||
{
|
||||
get { return (ConfigurationDataBasicLogin)base.configData; }
|
||||
set { base.configData = value; }
|
||||
}
|
||||
|
||||
public Trezzor(IIndexerConfigurationService configService, IWebClient wc, Logger l, IProtectionService ps)
|
||||
: base(name: "Trezzor",
|
||||
description: "SK/CZ Tracker.",
|
||||
link: "https://tracker.czech-server.com/",
|
||||
caps: new TorznabCapabilities(),
|
||||
configService: configService,
|
||||
client: wc,
|
||||
logger: l,
|
||||
p: ps,
|
||||
configData: new ConfigurationDataBasicLogin())
|
||||
{
|
||||
Encoding = Encoding.GetEncoding("windows-1250");
|
||||
Language = "cs-cz";
|
||||
Type = "private";
|
||||
|
||||
AddCategoryMapping(1, TorznabCatType.MoviesDVD, "DVD CZ/SK dabing");
|
||||
AddCategoryMapping(2, TorznabCatType.MoviesDVD, "DVD CZ/SK titulky");
|
||||
AddCategoryMapping(3, TorznabCatType.AudioVideo, "DVD Hudební video");
|
||||
AddCategoryMapping(4, TorznabCatType.MoviesSD, "XviD, DivX CZ/SK dabing");
|
||||
AddCategoryMapping(13, TorznabCatType.Audio, "Hudba CZ/SK scéna");
|
||||
AddCategoryMapping(24, TorznabCatType.Audio, "Mluv. slovo CZ/SK dabing");
|
||||
AddCategoryMapping(10, TorznabCatType.AudioOther, "DTS audio");
|
||||
AddCategoryMapping(14, TorznabCatType.PCGames, "Hry");
|
||||
AddCategoryMapping(17, TorznabCatType.PC, "Programy");
|
||||
AddCategoryMapping(14, TorznabCatType.PC, "Cestiny,patche,upgrady");
|
||||
AddCategoryMapping(18, TorznabCatType.Books, "Knihy CZ/SK lokalizace");
|
||||
AddCategoryMapping(18, TorznabCatType.BooksComics, "Komiks CZ/SK lokalizace");
|
||||
AddCategoryMapping(16, TorznabCatType.Other, "Foto,obrázky");
|
||||
AddCategoryMapping(20, TorznabCatType.Console, "Konzole");
|
||||
AddCategoryMapping(21, TorznabCatType.PCPhoneOther, "Mobilmánia");
|
||||
AddCategoryMapping(22, TorznabCatType.Other, "Ostatní CZ/SK scéna");
|
||||
AddCategoryMapping(23, TorznabCatType.Other, "Na prani non CZ/SK");
|
||||
AddCategoryMapping(27, TorznabCatType.Other, "TreZzoR rls");
|
||||
AddCategoryMapping(35, TorznabCatType.AudioVideo, "HDTV Hudební video");
|
||||
AddCategoryMapping(36, TorznabCatType.MoviesSD, "XviD, DivX CZ/SK titulky");
|
||||
AddCategoryMapping(31, TorznabCatType.MoviesHD, "HDTV CZ/SK Dabing");
|
||||
AddCategoryMapping(33, TorznabCatType.MoviesHD, "HDTV CZ/SK Titulky");
|
||||
AddCategoryMapping(39, TorznabCatType.Movies3D, "3D HDTV CZ/SK Dabing");
|
||||
AddCategoryMapping(40, TorznabCatType.Movies3D, "3D HDTV CZ/SK Titulky");
|
||||
AddCategoryMapping(5, TorznabCatType.MoviesSD, "TV-rip CZ/SK dabing");
|
||||
|
||||
AddCategoryMapping(41, TorznabCatType.TVHD, "HD Seriály CZ/SK dabing");
|
||||
AddCategoryMapping(42, TorznabCatType.TVHD, "HD Seriály CZ/SK titulky");
|
||||
AddCategoryMapping(7, TorznabCatType.TVSD, "Seriály CZ/SK dabing");
|
||||
AddCategoryMapping(37, TorznabCatType.TVSD, "Seriály CZ/SK titulky");
|
||||
|
||||
AddCategoryMapping(9, TorznabCatType.XXXXviD, "XXX CZ/SK dabing");
|
||||
AddCategoryMapping(32, TorznabCatType.XXXx264, "XXX HD CZ/SK dabing");
|
||||
AddCategoryMapping(27, TorznabCatType.Other, "TreZzoR rls");
|
||||
|
||||
}
|
||||
|
||||
public override async Task<IndexerConfigurationStatus> ApplyConfiguration(JToken configJson)
|
||||
{
|
||||
LoadValuesFromJson(configJson);
|
||||
|
||||
var loginPage = await RequestStringWithCookies(LoginUrl, string.Empty);
|
||||
|
||||
var pairs = new Dictionary<string, string> {
|
||||
{ "uid", configData.Username.Value },
|
||||
{ "pwd", configData.Password.Value }
|
||||
};
|
||||
|
||||
var result = await RequestLoginAndFollowRedirect(LoginUrl, pairs, loginPage.Cookies, true, null, LoginUrl);
|
||||
|
||||
await ConfigureIfOK(result.Cookies, result.Content != null && result.Content.Contains("If your browser doesn't have javascript enabled"), () =>
|
||||
{
|
||||
var errorMessage = "Couldn't login";
|
||||
throw new ExceptionWithConfigData(errorMessage, configData);
|
||||
});
|
||||
return IndexerConfigurationStatus.RequiresTesting;
|
||||
}
|
||||
|
||||
protected override async Task<IEnumerable<ReleaseInfo>> PerformQuery(TorznabQuery query)
|
||||
{
|
||||
var releases = new List<ReleaseInfo>();
|
||||
var searchurls = new List<string>();
|
||||
var searchUrl = SearchUrl;
|
||||
var queryCollection = new NameValueCollection();
|
||||
var searchString = query.GetQueryString();
|
||||
|
||||
|
||||
// assign category only if one cat is required, otherwise search in whole tracker (tracker has ability to search only in one category or in everything)
|
||||
var _cats = MapTorznabCapsToTrackers(query);
|
||||
if (_cats.Count == 1) searchUrl += "category=" + _cats.First() + "&";
|
||||
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchString))
|
||||
{
|
||||
queryCollection.Add("search", searchString);
|
||||
}
|
||||
|
||||
|
||||
|
||||
queryCollection.Add("active", "1");
|
||||
|
||||
searchUrl += queryCollection.GetQueryString().Replace("(", "%28").Replace(")", "%29"); // maually url encode brackets to prevent "hacking" detection
|
||||
|
||||
|
||||
var results = await RequestStringWithCookiesAndRetry(searchUrl);
|
||||
|
||||
// Check for being logged out
|
||||
if (results.IsRedirect)
|
||||
if (results.RedirectingTo.Contains("prihlasenie.php"))
|
||||
throw new ExceptionWithConfigData("Login failed, please reconfigure the tracker to update the cookies", configData);
|
||||
else
|
||||
throw new ExceptionWithConfigData(string.Format("Got a redirect to {0}, please adjust your the alternative link", results.RedirectingTo), configData);
|
||||
|
||||
if (results.Content.Contains("prihlasenie.php")) throw new ExceptionWithConfigData("Login failed, please reconfigure the tracker to update the cookies", configData);
|
||||
|
||||
try
|
||||
{
|
||||
CQ dom = results.Content;
|
||||
ReleaseInfo release;
|
||||
|
||||
var rows = dom[".torrenty_lista"];
|
||||
foreach (var row in rows)
|
||||
{
|
||||
CQ qRow = row.Cq();
|
||||
|
||||
release = new ReleaseInfo();
|
||||
|
||||
string _cat = qRow.Find("td").Get(0).FirstChild.GetAttribute("href");
|
||||
string _catName = qRow.Find("td a img").Get(0).GetAttribute("alt");
|
||||
int _from = _cat.IndexOf("=");
|
||||
_cat = _cat.Substring(_from + 1);
|
||||
|
||||
// filter results from categories, that were not requested
|
||||
if ((_cats.Count > 1) && (!_cats.Contains(_cat))) continue;
|
||||
release.Category = MapTrackerCatToNewznab(_cat);
|
||||
|
||||
string _guid = qRow.Find("td").Get(1).FirstChild.GetAttribute("href");
|
||||
release.Guid = new Uri(SiteLink + _guid);
|
||||
|
||||
string _title = qRow.Find("td").Get(1).FirstChild.InnerText;
|
||||
release.Title = _title + " [" + _catName + "]";
|
||||
|
||||
string _commentsLink = qRow.Find("td").Get(2).FirstChild.GetAttribute("href");
|
||||
release.Comments = new Uri(SiteLink + _guid);
|
||||
|
||||
string _downloadLink = qRow.Find("td").Get(3).FirstChild.GetAttribute("href");
|
||||
release.Link = new Uri(SiteLink + _downloadLink);
|
||||
|
||||
string _publishDate = qRow.Find("td").Get(5).InnerText;
|
||||
DateTime _parsed;
|
||||
DateTime.TryParse(_publishDate, out _parsed);
|
||||
release.PublishDate = _parsed;
|
||||
|
||||
string _size = qRow.Find("td").Get(6).InnerText;
|
||||
release.Size = ReleaseInfo.GetBytes(_size);
|
||||
|
||||
string _seeds = qRow.Find("td").Get(7).FirstChild.InnerText;
|
||||
string _leechs = qRow.Find("td").Get(8).FirstChild.InnerText;
|
||||
int seeders, peers;
|
||||
if (ParseUtil.TryCoerceInt(_seeds, out seeders))
|
||||
{
|
||||
release.Seeders = seeders;
|
||||
if (ParseUtil.TryCoerceInt(_leechs, out peers))
|
||||
{
|
||||
release.Peers = peers + release.Seeders;
|
||||
}
|
||||
}
|
||||
|
||||
release.MinimumRatio = 1;
|
||||
release.MinimumSeedTime = 172800;
|
||||
|
||||
release.UploadVolumeFactor = 1;
|
||||
|
||||
if (release.Title.Contains("FREELEECH")) release.DownloadVolumeFactor = 0;
|
||||
else release.DownloadVolumeFactor = 1;
|
||||
|
||||
releases.Add(release);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnParseError(results.Content, ex);
|
||||
}
|
||||
|
||||
return releases;
|
||||
}
|
||||
}
|
||||
}
|
@@ -201,7 +201,6 @@
|
||||
<Compile Include="Indexers\notwhatcd.cs" />
|
||||
<Compile Include="Indexers\Redacted.cs" />
|
||||
<Compile Include="Indexers\Norbits.cs" />
|
||||
<Compile Include="Indexers\Trezzor.cs" />
|
||||
<Compile Include="Indexers\TVVault.cs" />
|
||||
<Compile Include="Indexers\BJShare.cs" />
|
||||
<Compile Include="Indexers\CardigannIndexer.cs" />
|
||||
|
Reference in New Issue
Block a user